TDM 40100: Project 8 — 2023
Motivation: Images are everywhere, and images are data! We will take some time to dig more into working with images as data in this series of projects.
Context: In the previous projects, we worked with images and implemented image Histogram Equalization, with some pretty cool results! In this project, we will continue to work with images key features, introduce YCbCr color space, and perform enhancing the image’s visual quality by histogram equalization technique with colors
Scope: Python, images, openCV, Histogram equalization, YCbCr, image digital fingerprint
Dataset(s)
The following questions will use the following dataset(s):
-
/anvil/projects/tdm/data/images/ballpit.jpg
As in our previous projects, by default, a image is read in as a
|
Questions
Question 1 (2 pts)
-
Please split
/anvil/projects/tdm/data/images/ballpit.jpg
into its `YCbCr`components and display them
To display the YCbCr Y component, you will need to set the Cb and Cr components to 127. To display the Cb component, you will need to set the Cr and Y components to 127, etc. |
The human eye is more sensitive to luminance than to color. As you can tell from the previous question, the Y component captures the luminance, and contains the majority of the image detail that is so important to our vision. The other Cb and Cr components are essentially just color components, and our eyes aren’t as sensitive to changes in those components. Luminance shows the brightness of an image. An RGB image can be converted to a YCbCr image. The histogram equalization then can apply to the luminance without impacting the color channels (Cb and Cr channels), which, if histogram equalization directly applies to an RGB image, it may cause image artifacts issues. "Artifacts issues" refers to unwanted distortion in an image. Let’s process some images in the following questions to makes this explicitly clear |
Question 2 (2 pts)
-
Please write a function named
equal_hist_rgb
to do Histogram Equalization directly to an image with RGB format. The parameter will be an image. The returns will be a Histogram Equalized colored image. Run the function with inputballpit.jpg
. Show the output Histogram Equalized colored image.
Question 3 (2 pts)
-
Please write a function named
equal_hist_YCrCb
that applies Histogram Equalization to an image, so that first the image will be converted from RGB format to YCrCb format, then apply Histogram Equalization. The parameter will be an image. The returns will be a Histogram Equalized colored image. Run the function with imageballpit.jpg
. Show the output Histogram Equalized colored image.
We can read a 3-chanel RGB image by both
|
Question 4 (1 pt)
-
Please plot the original image of
ballpit.jpg
, output images of it from question 2 and question 3 as a combined chart. What is your conclusion?
Question 5 (1 pt)
-
Please choose one of your favorite image as input to the two functions, display the original image and 2 output images in a combined histogram chart and state your finding
-
Please provide the digital fingerprints for all 3 images original one, two output images from two functions using
hashlib
library
Just like human has unique fingerprint. Every image has a unique SHA-256 hash value. Even a tiny change of a pixel can cause a totally different SHA-256 hash value for the image. You may use a SHA-256 Hash value as the digital fingerprint for a image, for example
|
Project 08 Assignment Checklist
-
Jupyter Lab notebook with your codes, comments and outputs for the assignment
-
firstname-lastname-project08.ipynb
.
-
-
Submit files through Gradescope
Please make sure to double check that your submission is complete, and contains all of your code and output before submitting. If you are on a spotty internet connection, it is recommended to download your submission after submitting it to make sure what you think you submitted, was what you actually submitted. In addition, please review our submission guidelines before submitting your project. |