Welcome to Kaikang Zhu's web page

Assignment Title

CS 585 HW 1
Kaikang Zhu
2018/9/12


Problem Definition

Manipulating a picture of myself in several ways, including grayscale, flip, blur or other interesting ways. The antipicated difficluties lie in analyzing the problem and finding the solution. I need to write code to manipulate the pixels of picture to meet the requirements. After test, the pictures show that the result is correct.


Method and Implementation

The first problem is to turn the picture into grayscle. My way is to set a matrix that is single-channel and give the value of the green channel of the original picture to the grayscale picture.

The second problem is to flip the picture. I choose to flip the picture horizontally. Using for loop to give the right pixels to the left area of the flipped picture column by column and row by row.

The third problem is to use another interesting way to produce results. My way is to calculate the average value of the pixel and its eight neighbours and let the pixel equal to the value.


Experiments

The experiments basically include manipulating the pixels, showing the image and saving the result.

We can visualize the result and find it's correct.


Results

Results

Trial Source Image Result Image
trial 1
trial 2
trial 3


Discussion

Discuss your method and results:


Conclusions

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


Credits and Bibliography

reference:https://stackoverflow.com/questions/17064582/mat-single-channel-element-access https://blog.csdn.net/mooneve/article/details/53067443 https://blog.csdn.net/xiangxianghehe/article/details/71600519

I have discussion on the first problem about how to transform three-channel to one-channel with my classmate Shijie Zhao.