1 / 18

Edge Magnitude and Orientation

Edge Magnitude and Orientation. Roger S. Gaborski. Matlab Script to Calculate Magnitude and Orientation. First, use slide 90 of lecture 5 as a guide Read in image (in this example, Sign4.jpg from webpage) , convert to double in range [0,1] Convert to grayscale

warner
Download Presentation

Edge Magnitude and Orientation

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. Edge Magnitude and Orientation Roger S. Gaborski

  2. Matlab Script to Calculate Magnitude and Orientation • First, use slide 90 of lecture 5 as a guide • Read in image (in this example, Sign4.jpg from webpage) , convert to double in range [0,1] • Convert to grayscale • Use the following filters to calculate the edges: fx = [ -1 -1 -1; 0 0 0; 1 1 1] fy = [ -1 0 1; -1 0 1; -1 0 1] • Use imfilter to find edges in x and y directions (Ifx and Ify) • Use the subplot filter to display the two images • One row, two columns Roger S. Gaborski

  3. Gray scale Image Roger S. Gaborski

  4. EDGE IMAGES Ifx and Ify Roger S. Gaborski

  5. Find the magnitude of the edges and display the edge image (this is NOT a binary image) • figure, imshow(mag, []), title('Magnitude of Edges in Image') • Display a histogram of the magnitudes Roger S. Gaborski

  6. Roger S. Gaborski

  7. Roger S. Gaborski

  8. Find the orientation in degrees (NOT radians) of all the edges • Display a histogram of the orientation of the edges Roger S. Gaborski

  9. Roger S. Gaborski

  10. Find the magnitude value of the strongest edge, assign to variable max_mag • %Find edges that are 10%, 25 and 50% greater than the max_mag • ed10 = ??? • ed25 = ??? • ed50 = ??? • DISPLAY THESE EDGES • figure, imshow(ed10, []), title('Edges that are atleast 10% or greater of maximum edge strength') • figure, imshow(ed25, []), title('Edges that are atleast 25% or greater of maximum edge strength') • figure, imshow(ed50, []), title('Edges that are atleast 50% or greater of maximum edge strength') Roger S. Gaborski

  11. Roger S. Gaborski

  12. Roger S. Gaborski

  13. Roger S. Gaborski

  14. Display Orientated Edges using Color Map • figure, imshow(???, []), title('Orientation of edges that are atleast 10% or greater of maximum edge strength') • colormap(jet) • figure, imshow(???, []), title('Orientation of edges that are atleast 25% or greater of maximum edge strength') • colormap(jet) • figure, imshow(???, []), title('Orientation of edges that are atleast 50% or greater of maximum edge strength') • colormap(jet) Roger S. Gaborski

  15. EMAIL THIS RESULTS WITH SCRIPT Roger S. Gaborski

  16. EMAIL THIS RESULTS WITH SCRIPT Roger S. Gaborski

  17. EMAIL THIS RESULTS WITH SCRIPT Roger S. Gaborski

  18. Extra Credit for Exam 1 • Write a script to perform the operations described in this presentation and discussed in class • Use good MATLAB programming practices • No loops, etc. Zero credit if loops are used • Not counting print statements, about 15 lines of code • Use raingirl.jpg image • Email script, and last three images to course account by 5pm today, Thursday • You must work independently – students not working independently will receive a zero for Exam 1 • 10 points added to exam 1 score for correct programming techniques and correct answers • No partial credit Roger S. Gaborski

More Related