This preview shows page 1 out of 2 pages.

Save
View full document
View full document
Premium Document
Do you want full access? Go Premium and unlock all 2 pages.
Access to all documents
Download any document
Ad free experience
Premium Document
Do you want full access? Go Premium and unlock all 2 pages.
Access to all documents
Download any document
Ad free experience

Unformatted text preview:

ECE178 HW #3DUE: Friday, October 16, 2009 (by 5PM in the HW box)Please write down all the steps involved for complete creditQ1. Review textbook problems 3.3, 3.5, 3.6. No need to turn in solutions to these problems.Q2. Textbook Gonzalez and Woods (3rdEdition) problem 3.4Q3. Textbook Gonzalez and Woods (3rdEdition) problem 3.11Q4. Compute y[n] = x[n] ∗ x[n] where x[n] =1 −1 7 −1 1 , and * indicates lineardiscrete convolution. The boxed value represents the origin.Q5. Compute y[m, n] = x[m, n]∗ u[m, n] where u[m, n] is a unit step function and x[m, n] is definedas follows:x[m, n] =0 1 01 2 −10 −1 0Q6. Compute y[m, n] = x[m, n] ∗ h[m, n] where x[m, n] and h[m, n] are defined as follows:x[m, n] =2 −1−2 1, h[m, n] =-1 3 −21 0 10 1 −2Q7. This MATLAB assignment is to implement the function discussed in lecture on Oct. 5th.We shall study the effect of histogram equalization and how it can be implemented with apiecewise linear transformation of the pixel values.The original image is “lena.gif”. Plot its histogram using the “imhist” command in MAT-LAB. Then, consider the darkened version of the image, called “darklena.gif”. Again, plotits histogram using the “imhist” function and comment on the histogram difference betweenthe two images. For the two gif images, see class website www.ece.ucsb.edu/~manj/ece178.Then, use the histogram equalization command in MATLAB, called “histeq”, on the “dark-lena.gif” image. Comment on the image quality obtained after the histogram equalizationand comment on its histogram, with respect to the histograms obtained from “lena.gif” and“darklena.gif”.Now, we shall study the effect of using an appropriate piecewise linear transformation tothe pixel values. The logic is as follows: say, we provide 2 vectors a = [a1, a2, a3, a4] andb = [b1, b2, b3, b4] as input. Then, as showed in Fig. 1, the region [a1− a2] is mapped to[b1− b2], the region [a2− a3] is mapped to [b2− b3] and the region [a3− a4] gets mapped to[b3− b4].You have to choose a proper set of values for a = [a1, a2, a3, a4] and b = [b1, b2, b3, b4] andthen use them to perform piecewise linear transformation of the pixel values. Your MATLAB10 0.2 0.4 0.6 0.8 100.10.20.30.40.50.60.70.80.91a1 a2 a3 a4b1 b2 b3 b4Figure 1: A piecewise linear stretching function using a = [a1, a2, a3, a4] = [0, 0.1, 0.2, 1.0] andb = [b1, b2, b3, b4] = [0, 0.2, 0.8, 1.0].routine should take the “darklena.gif” image and a and b as inputs, and the output shouldbe the image, with piecewise linear transformation performed. Using Fig. 1 as the reference,you shall use vectors a and b, each of length 4, and set a1= 0, a4=1, b1= 0 and b4= 1.Then, you should intelligently choose a2, a3, b2and b3, so that the perceptual quality of theimage obtained after piecewise linear transformation is good.The pseudocode is as follows:• im = input image matrix• use “find” function in MATLAB to find the pixel values in the image between aiandai+1, for all i.• The line between the coordinates (ai, bi) and (ai+1, bi+1) has the equation:y =bi+1− biai+1− ai(x − ai) + biTo implement the above mentioned logic in MATLAB, usepix = find(im >= a(i) & im < a(i + 1));out(pix) = (im(pix) − a(i)) ∗ (b(i + 1) − b(i))/(a(i + 1) − a(i)) + b(i)where im is the input image and out is the output image.• Repeat the above process for all i and thus, im will be converted to out.Things to turn in (suggested to use the Publish-To option under File in the M-file editor):(a) M-file(b) Images obtained after using “histeq” and after using piecewise linear transformation(c) Also plot their histograms alongwith the histograms of “lena.gif” and “darklena.gif”.(d) Comments on the differences between the histograms and also justify how you chose aand b for the piecewise linear transformation


View Full Document

UCSB ECE 178 - HW #3

Download HW #3
Our administrator received your request to download this document. We will send you the file to your email shortly.
Loading Unlocking...
Login

Join to view HW #3 and access 3M+ class-specific study document.

or
We will never post anything without your permission.
Don't have an account?
Sign Up

Join to view HW #3 2 2 and access 3M+ class-specific study document.

or

By creating an account you agree to our Privacy Policy and Terms Of Use

Already a member?