Assignment 1

CS 585 HW 1
Yifu Hu
Sept. 13, 2017

Problem Definition

The problem is how to manipulate images using OpenCV. First of all, we should read the data of an image. Then find an efficent way to use the data we obtained and, through calculation, to produce our desired result. At last, visualize the output and save it as a file.
Here are the three problems:
1. Create a grayscale image of your face by converting your color image using one of the conversions we discussed in class last week.
2. Create a blurred image of your grayscale face by assigning to each pixel the average grayscale pixel value of itself and its 8 neighbors. Hint: You may have to run your program a few times to make the blurring noticeable.
3. Come up with a third way of manipulating your face that produces an interesting output.

Method and Implementation

1. I used the "Gray=0.3*R + 0.6*G + 0.1*B" conversion method to convert my face image. Note that, the order of the three color channel in OpenCV is "BGR", not "RGB".
2. I simply used nested for-loop to process the entire image. Also, there is a variable that indicate the times this blurring process is repeated.
3. I extracted the edge (both vertical and horizontal) information of the image. For a pixel "P[i,j]", the output pixel value is simply |P[i,j]-P[i,j-1]|+|P[i,j]-P[i-1,j]|.

Briefly outline the functions you created in your code to carry out the algorithmic steps you described earlier.


Describe your experiments, including the number of tests that you performed, and the relevant parameter values.

Define your evaluation metrics, e.g., detection rates, accuracy, running time.


List your experimental results. Provide examples of input images and output images. If relevant, you may provide images showing any intermediate steps. If your work involves videos, do not submit the videos but only links to them.


Experiments Source Image Result Image
Color to Gray
Gray to Blurred (Repeated 5 times)
Gray to Edged

Source Code

Source code


Discuss your method and results:


Based on your discussion, what are your conclusions? What is your main message?

Credits and Bibliography

Cite any papers or other references you consulted while developing your solution. Citations to papers should include the authors, the year of publication, the title of the work, and the publication information (e.g., book name and publisher; conference proceedings and location; journal name, volume and pages; technical report and institution).

Material on the web should include the url and date of access.

Credit any joint work or discussions with your classmates.