ECSE4540 Homework#3 solution


Original Work ?
Category: You will Instantly receive a download link for .ZIP solution file upon Payment


5/5 - (1 vote)

1. (25points.) Considertheimage walk.png. LoadthisintoMatlabandconvertittoadouble. (a) (5 points.) Use filter2 to apply the Sobel operator  −1 0 1 −2 0 2 −1 0 1  to the image. First, visualizethe result using imshow(result,[]) and interpret what you see. Remember, the strongest positive responses will be mapped to white, the strongest negative responses will be mapped to black, and responsesclosetozerowillbemappedtoneutralgray. (b) (10 points.) Now, create a binary image containing only those pixels whose response is greater than 200 in absolute value. Which pixels are highlighted? Turn in a plot with your homework. There are someverticaledgesthataren’tpickedupatthisthreshold,likethenearlywhite-on-whiteedgeofthe front woman’s coat. How low do you have to make the threshold in order to get a visible response in thisarea? Whathappenstotherestoftheimagewhenyoudoso? (c) (10points.) Repeat theexperimentforthe secondSobeloperator  −1 −2 −1 0 0 0 1 2 1  . Again, interpret whatyouseeinvariousregionsoftheimageanddescribewhatpixelsarehighlightedifyouthreshold thepixelsgreaterthan200inabsolutevalue.
2. (20 points.) Consider the image fuzzycat.png. First, view it normally with imshow(…,[]). Note that theimageisslightlyblurry.
(a) (5 points.) First, filter the image using ones(5)/25. How does the image compare with the original? Whatdetailsaredifferent? (b) (15 points.) Using integer values of k ranging from 1 to 5, implement equations (3-64) and (3-65) in the booktoapply unsharpmasking (k=1) andhighboostfiltering(k>1) to the image. Explainwhat you see as k increases. How does the filtered image improve? Note that you should clip the results to [0, 255] before display. Include the k =1 and k =5 pictures in your homework. Discuss specific regionsintheimageforfullcredit.
3. (20points.) Considertheimage boat.png. Thisimagehasgrainynoiseaddedtoit.
(a) (8 points.) First, filter the image using the low-pass filter ones(5)/25. How does the image compare withtheoriginal? Howandwhereisthenoisevisiblyreduced? (b) (12 points.) Next, filter the image using a 5×5 median filter. How does the image compare with the original? How does it compare with the image in part (a)? Which image seems perceptually better? Pay particular attention to high-contrast edges, flat areas, and areas of fine detail. A good way to compare and contrast the two images is with a flicker animation using commands like while 1, figure(1), pause(.5), figure(2), pause(.5), end.
4. (10 points.) Suppose we filter an image twice: we first apply the box filter ones(3)/9, and then filter the resultingimagewiththe3×3Laplacianfilter(theonewith-4inthemiddleelement). (a) (5 points.) Determine (manually) a single 2D filter that will result in the same output using a single pass. Showyourwork. (b) (5 points.) Would your result in (a) be different if we applied the filters in the reverse order? You should be able to answer this without explicitly computing the result; what is the signal processing basisforyouranswer?
5. (25points.) Considertheimage board.png. (a) (5 points.) First, filter the image with a 19×19 Gaussian filter with standard deviation 3 (which you cancreateusing fspecial). Describewhatyousee. (b) (5 points.) Now create your own function called gaussv that returns a 1-D Gaussian low-pass filter as a column vector. The inputs to your function should be N, the length of the filter, and sigma, the standarddeviationoftheGaussian. Thefiltershouldbescaledsoitselementssumto1. (c) (5 points.) Use your gaussv function with arguments N =19 and σ =3 and apply it to the input image. Describewhatyouseecomparedtopart(a)andexplainwhythefilterhasthiseffect. (d) (5 points.) Use your gaussv function with arguments N =31 and σ =5 and apply it to the input image. Describewhatyouseecomparedtopart(c)andexplainwhythefilterhasthiseffect. (e) (5 points.) Use your gaussv function with arguments N =75 and σ =5 and apply it to the input image. Thisshouldlookalmostexactlythesameaspart(d);explainwhy.