Programming Homework
P1: Manipulating Pixels
Goal: Build OpenCV project and learn to access(read/write) image pixels.
Practice some basic image processing functions: add noise, color reduction, image enhancement, image addition, and remapping.
Learn to access pixels by different ways: scanning an image with pointers, scanning an image with iterators.
Learn to write efficient image scanning loops.
Readings and sample codes
OpenCV 4 Computer Vision Application Programming Cookbook, by D. M. Escrivá, R. Laganiere, Fourth Edition, Packt Publishing, 2019. [Book URL] [GitHub]
You can use the provided sample codes in your homework, but you have to replace the images with yours.
Web Report
Create a web page with description texts and a lot of pictures for the following programs
saltImage.cpp: Add salt-and-pepper noise into an image. (p.39 in Ch2 PDF)
colorReduce.cpp: Reduce the number of colors into 1/N. (p.44 in Ch2 PDF)
Compare speeds of different pixel access methods with the OpenCV function cv:getTickCount() to obtain the speed of pixel access. (p.54 inCh2 PDF)
contrast.cpp: Enhance an image by sharpening methods. (p.59 in Ch2 PDF)
addImages.cpp: Add two imags to get a blended image. (p.63 in Ch2 PDF)
remapping.cpp: Simulate a lens distortion to create distorted images. (p.67 in Ch2 PDF)
You have to give explanations of the codes. And you have to identify how did you modify the source code to get your results.
Submit your web address by Microsoft Teams.