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 3 computer vision application programming cookbook. R. Laganière, Packt Publishing, 2017. [Book URL]

    • 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.40 in OpenCV 3 Ch2 PDF)

      • colorReduce.cpp: Reduce the number of colors into 1/N. (p.44 in OpenCV 3 Ch2 PDF)

        • Compare speeds of different pixel access methods with the OpenCV function cv:getTickCount() to obtain the speed of pixel access. (p.55 in OpenCV 3 Ch2 PDF)

      • contrast.cpp: Enhance an image by sharpening methods. (p.60 in OpenCV 3 Ch2 PDF)

      • addImages.cpp: Add two images to get a blended image. (p.64 in OpenCV 3 Ch2 PDF)

      • remapping.cpp: Simulate a lens distortion to create a distorted images. (p.68 in OpenCV 3 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 Google Classroom.