For our second exercise, we were asked to gather 4 images: an image with low contrast, high contrast, an image taken at night and a normal one, taken with natural light.
Naturally, I picked my pets as subjects of these images because who doesn't love cats or dogs?
![]() |
Image 1. (Low Contrast)
This is Tenten (short for Kitten), my adorable cat. This picture was taken in natural light but I used an image editing app to tweak the contrast setting. |
![]() |
| Image 2. (High Contrast) This hilarious photo of MiHo sleeping was taken in daylight and again, I adjusted the contrast using an image editing app. |
![]() |
| Image 3. (Night Time) This picture is a puppy named Taiga (Tiger), taken at night, under a fluorescent light. |
![]() |
| Image 4. (Normal) This is a picture of my neighbor's cat, which will remain unnamed, taken at daylight. |
These images will then be read using a program (image_trans.cpp) in OpenCV provided in the laboratory class and will produce 12 outputs in total.
![]() |
| image_trans.cpp |
Basically, the program obtains the pixel values of the image and then manipulates each of them by using some functions.
Function 1
Applying the first function y = 1 - x, returns the maximum pixel value minus the current (channel) pixel value. Let's see what will happen to the images when this function is applied:
![]() |
| Image 1. Original vs. transformed image (using function 1) |
![]() |
| Image 2. Original vs. transformed image (using function 1) |
![]() |
| Image 3. Original vs. transformed image (using function 1) |
![]() |
| Image 4. Original vs. transformed image (using function 1) |
Based on the images produced, it seems the first function gives the image negative. The light parts of the images became dark and the colors are reversed into their respective complementary colors. The dark/light transformation is most apparent in images 2 and 3. Meanwhile, the yellow/orange colors turned into bluish tints in image 1 and 4 because the complimentary of yellow is blue.
Function 2
Next, we'll apply the second function, y = 0.001x^2 - 0.023x (y representing the value returned, x is the current channel/pixel value). These are the output images when function 2 is applied:
![]() |
| Transformed images using function 2: y = 0.001x^2 - 0.023x |
Function 3
Lastly, applying the third function, y = 0.47x + 120, these are the output images:
![]() |
| Transformed images using function 3: y = 0.47x + 120 |
The contrast of the images became low. The first image, which is a low contrast image, became even more grayish compared to the other images. Images 3 and 4, which were taken in daylight











No comments:
Post a Comment