TDM 30100: Project 7 — 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 project, we learned to manipulate image’s basic factors by functions from the openCV cv2
module. In this project, we will understand key image features, detect color dominance, and perform enhancing the image’s visual quality by histogram equalization technique
Scope: Python, images, openCV, Histogram equalization
Dataset(s)
The following questions will use the following dataset(s):
-
/anvil/projects/tdm/data/images/ballpit.jpg
Questions
Question 1 (2 pts)
-
Let’s work with our
ballpit.jpg
again. In project 06, we split the image into its color channels (red, green and blue). With outputs for its color channels, please find out the average values of intensity for each channel -
Display the average values for each channel with a bar chart. Briefly explain what is your finding from the bar chart
|
|
Question 2 (2 pts)
-
In project 06, you created a red mask for red pixels and applied the red mask to the original image. Please create another 2 masks for green and blue channels.
-
Please identify how many pixels in the image are red, green and blue (respectively), and visualize the number of pixels for the 3 channels using a combined Histogram. Briefly explain what you found from the diagrams.
A combined histogram here means a chart with 3 bars for the 3 channels respectively. The x-axis is the 3 channels, and the y-axis is the number of pixels for each channel. |
|
|
Question 3 (2 pts)
-
Write a function called
equal_histogram_gray
using the histogram equalized technique:-
The function will accomplish a way to enhance image area that is too dark or light by adjusting the intensity values; it will only consider intensity but not any color information.
-
The input argument to the function is an image
-
The function returns a tuple of two images: one is the grayscaled image, and the other is a histogram-equalized grayscaled image
-
-
Run the function with "ballpit.jpg" as input. Visualize the 2 output images aligning with the original "ballpit.jpg" using a Histogram chart
You may refer to more information about |
|
Question 4 (2 pts)
-
Process one of your favorite photos with the function
equal_histogram_gray
. Write 1-2 sentences about your input and output. Make sure to show the result of the images.
Feel free to use /anvil/projects/tdm/data/images/coke.jpg
— the results are pretty neat!
Project 07 Assignment Checklist
-
Jupyter Lab notebook with your codes, comments and outputs for the assignment
-
firstname-lastname-project07.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. |