html5-img
1 / 28

Problem Session #5

Problem Session #5. EE368/CS232 Digital Image Processing. 1 . Solving a Jigsaw Puzzle

nuwa
Download Presentation

Problem Session #5

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Problem Session #5 EE368/CS232 Digital Image Processing

  2. 1. Solving a Jigsaw Puzzle Please download the image hw5_puzzle_pieces.jpg from the handouts webpage, which shows the pieces of a jigsaw puzzle. Since we know that the completed puzzle should show a picture of the famous Mona Lisa painting, we can download an image of the painting from the web to use as a reference when solving the puzzle; you can download hw5_puzzle_reference.jpg from the handouts webpage.

  3. Step 1: We binarize the pieces image, with the result shown below. Step 2: We extract an edge map from the binary image (result shown below), which we will use later to draw the boundaries of the jigsaw pieces on top of the reference image.

  4. Step 3: When the jigsaw pieces are fully assembled, the assembled image may have a different size than the reference image. To account for this mismatch, we resize the reference image (maintaining the same aspect ratio) to have approximately the same number of pixels as the total number of white pixels in the binary pieces image. Step 4: We perform region labeling on the binary pieces image.

  5. Step 5: For each region in the binary pieces image, we compare the corresponding region in the original color pieces image to different regions in the reference image. Note that the regions being compared are non-rectangular in shape, because we utilize the regional shapes obtained from the segmentation in Step 1. We find the region in the reference image that best matches (has the smallest mean squared difference relative to) each piece region. Reference Template - + Mask x Final Difference Mask

  6. Step 6: • For the matching region in the reference image, we • label that region with the same number that identifies the jigsaw piece • overlay the boundary of the jigsaw piece using the edge map from Step 2 + EOP

  7. 2. Eigenfaces and Fisherfaces for Recognition of Glasses • In this problem, we will study the use of eigenfaces and fisherfaces for recognizing glasses in images. Please download the following files from the homework webpage: • hw5_non_glasses_training.zip: 153 training images of people not wearing glasses • hw5_glasses_training.zip: 67 training images of people wearing glasses • hw5_non_glasses_testing.zip: 128 testing images of people not wearing glasses • hw5_glasses_testing.zip: 52 testing images of people wearing glasses

  8. Part A: Compute, display, and submit the mean face image over the training set.

  9. Part B: Using the Sirovich and Kirby method on the training set, compute the 100 eigenfaces with the largest eigenvalues. Please use mean-removed training samples to compute the eigenfaces and make sure each eigenface has unit L2 norm. Display and submit the top 10 eigenfaces. (MATLAB function: eig)

  10. Part C: Pick one of the eigenfaces from the top 10 eigenfaces which seems to accentuate features around the eyes. Create a 1-d classifier which distinguishes between non-glasses and glasses images by choosing a threshold for the eigenface coefficient that minimizes the error rate for the training images. Report the overall error rate on the training set. Then, evaluate the classifier on the testing images, and report the numbers of non-glasses images and glasses images that are correctly classified, as well as the overall error rate on the testing set.

  11. Part D: Using the training set, compute, display, and submit the fisherface for recognizing glasses. Perform Fisher LDA in a 100-dimensional eigenface space (using the top 100 eigenfaces computed previously) and make sure the fisherface has unit L2 norm. Repeat part (c), except replace the single eigenface by the fisherface. Does the fisherface obtain a lower overall error rate on the testing set than a single eigenface? (MATLAB function: eig) Perform Fisher LDA Perform PCA Fisher LDA Coefficient Image 100 PCA Coefficients

  12. Classification Results on Testing Set 10thEigenface Fisherface EOP

  13. 3. Frequency Responses of Edge Templates Part A: Derive expressions for the frequency responses of the horizontal and vertical central difference, Prewitt, and Sobel edge templates and of the two diagonal Roberts edge templates. For each template, submit a plot of the magnitude of the frequency response. Which frequency components are boosted and which frequency components are attenuated by each edge template? (MATLAB functions: meshgrid, mesh, surf, abs)

  14. Central Difference Operator

  15. Part B: In some edge detection algorithms, e.g., the Canny edge detector, convolution with the edge template is combined with convolution with a Gaussian filter for noise suppression. Generate a Gaussian impulse response (function: fspecial) of standard deviation σ = 1and finite extent (6σ +1)× (6σ +1). Compute the Gaussian filter’s frequency response (function: freqz2) using the sample frequency-domain sampling grid that you used in Part A. For each edge template, submit a plot of the magnitude of the product of the Gaussian filter’s frequency and the edge template filter’s frequency response.

  16. Without Gaussian Prefilter With Gaussian Prefilter EOP

  17. 4. Document Image Restoration Please download the image hw5_insurance_form.jpg from the homework webpage. During faxing, the form has suffered some image distortions: it is slightly rotated and some of the table’s horizontal and vertical lines have been erased. Design and implement an algorithm to automatically rotate the form to an upright orientation and repair the gaps in the broken lines. Clearly describe the steps in your algorithm, showing intermediate results for clarification if necessary. Display and submit the final restored image.

  18. Binarization with Otsu’s Method

  19. Hough Transform MATLAB: hough, houghpeaks Orientation Histogram for Peaks in Hough Transform

  20. Rotated to Upright Orientation MATLAB: imrotate

  21. Erosion by 35-pixel Vertical Line MATLAB: imerode

  22. Closing by 201-pixel Vertical Line MATLAB: imclose

  23. Restoration of Vertical Lines in Table

  24. Erosion by 49-pixel Horizontal Line MATLAB: imerode

  25. Closing by 301-pixel Horizontal Line MATLAB: imclose

  26. Restoration of Horizontal Lines in Table

  27. Final Restoration Result EOP

More Related