computational photography

Description

In this assignment, as with all of our assignments, you shouldn’t be using built-in functions that
violate the “spirit” of the assignment. For instance, in part 3, you can’t use a function like rgb2gray,
for part 5 you can’t use any functions that do gamma correction for you.
In this assignment you will demonstrate your ability to:
• Obtain images and import them into Matlab
• Demonstrate the application of several pixel-processing algorithms.
• Render histograms and images

Don't use plagiarized sources. Get Your Custom Assignment on
computational photography
From as Little as $13/Page

Unformatted Attachment Preview

Computational Photography
Assignment 1 – Pixel Operations
Winter 2024
Introduction
In this first assignment we want to get you comfortable with importing and exporting images as well
applying basic point-processing algorithms.
Subsequent assignments will likely be far more involved, but we want to you getting
your “hands dirty” as soon as possible!
In this assignment, as with all of our assignments, you shouldn’t be using built-in functions that
violate the “spirit” of the assignment. For instance, in part 3, you can’t use a function like rgb2gray,
for part 5 you can’t use any functions that do gamma correction for you.
In this assignment you will demonstrate your ability to:
• Obtain images and import them into Matlab
• Demonstrate the application of several pixel-processing algorithms.
• Render histograms and images
Grading
Theory Questions
RGB → Grayscale
RGB → Binary
Gamma Correction
Histograms
TOTAL
20pts
20pts
20pts
20pts
20pts
100pts
Table 1: Grading Rubric
1
1
Theory Questions
1. Acknowledge the following by typing your name after each statement. These are true for all
assignments:
(a) All questions to theory questions will be typeset without images of handwritten solutions
(1pt)
(b) No code will be included (or output of code) in the PDF (1pt)
(c) No functions from the Vision or ML toobox will be used (1pt)
2. Based on observing a histogram perhaps we decided to create the following pixel intensity mappings in order to stretch the values of a particularly compressed area (you may assume the full
range is [0,255]):
[0,10]→[0,100]
(10,200]→(100,150]
(200,255]→(150,255]
(a) (5pts) Draw a 2D graph showing these mappings. The x-axis will be the input values and
the y-axis will be the output values.
(b) (7pts) What are the equations for these mappings?
(c) (2pt) Given a value of 50, what will this value be mapped to?
(d) (3pts) In your own words, describe the effect of this mapping. In particular, which regions
are being compressed and which are being stretched by this function.
2
2
Dataset
For the programming component of this assignment, you may use a color image of your choosing.
Make sure that you include your image with your submission so that we can recreate your results.
In each of the following sections you’ll be asked to output images. The images will also be included
in your report.
3
RGB → Grayscale
The first point-processing thing we want to be able to do is to convert an image from color to grayscale.
Read in your color image and use the following formula to convert it to a grayscale image. You may
not use a built-in function to do this (i.e rgb2gray).
Gray = 0.2989R + 0.5870 ∗ G + 0.1140B
4
(1)
RGB → Binary
In this part, we want to be able to convert your color image into a binary image, where each pixel is
either black or white.
To do this, first convert your image to grayscale (using what you did in the previous part), then
produce three binary images, one for each of the following thresholds (as percentages of maximum
possible intensity value):
• t=25%
• t=50%
• t=75%
5
Gamma Correction
In this part, we want to apply some gamma correction to your image. Making sure that your RGB
values are in the range [0, 1], apply gamma correction to each channel (independently) via the formula
s = rγ (we’ll let c = 1). Do this for each of the following values of gamma (producing three images):
• γ = 0.2
• γ=1
• γ = 50
3
6
Histograms
Histograms are a critical analysis tool use for many computer vision problems. Display four histograms for your image, each of which have 256 bins. You may not use a built-in function to
obtain the histogram. To plot your histogram, use the bar function of Matlab.
• Grayscale histogram
• Histogram of the red channel
• Histogram of the green channel
• Histogram of the blue channel.
4
Submission
For your submission, upload to Blackboard a single zip file containing:
1. PDF writeup that includes:
(a) Your answer to the theory question(s).
(b) The RGB and Gray images for Part 3.
(c) The RGB and Binary images for Part 4 (so 4 images total).
(d) The RGB and Gamma Corrected images for Part 5 (so 4 images total).
(e) The histograms for Part 6 (4 total)
2. A README text file (not Word or PDF) that explains:
(a) Any unique features of your program (if applicable).
(b) Any instructions on how to run your script to reproduce your results.
3. Your source file(s).
4. The chosen image(s) that you processed.
5

Purchase answer to see full
attachment