html5-img
1 / 17

CS 691 Computational Photography

CS 691 Computational Photography. Instructor: Gianfranco Doretto Morphological Operations. Morphological Operation. What if your images are binary masks? Binary image processing is a well-studied field, based on set theory, called Mathematical Morphology. Preliminaries. Preliminaries.

kirti
Télécharger la présentation

CS 691 Computational Photography

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. CS 691 Computational Photography Instructor: Gianfranco Doretto Morphological Operations

  2. Morphological Operation • What if your images are binary masks? • Binary image processing is a well-studied field, based on set theory, called Mathematical Morphology

  3. Preliminaries

  4. Preliminaries

  5. Dilation and Erosion • Two basic operations: • A is the image, B is the “structural element”, a mask akin to a kernel in convolution • Erosion : • all shifts of B such that B is fully contained within A • Dilation : • all shifts of B such that the center is contained by A =

  6. Dilation

  7. Dilation

  8. Erosion

  9. Erosion Original image Eroded image

  10. Erosion Eroded once Eroded twice

  11. Opening and Closing • Opening : (erode, then dilate) • Closing : (dilate, then erode) • Prove to yourself that they are not the same thing. Play around with imdilate,imerodeand bwmorph in Matlab. • smoothes the contour of an object, breaks narrow isthmuses, and eliminates thin protrusions • smooth sections of contours but, as opposed to opening, it generally fuses narrow breaks and long thin gulfs, eliminates small holes, and fills gaps in the contour

  12. Opening and Closing

  13. Opening and Closing OPENING: The original image eroded twice and dilated twice (opened). Most noise is removed CLOSING: The original image dilated and then eroded. Most holes are filled.

  14. Boundary Extraction Difference between image and erosion by a 3x3 mask of ones im = ~imread('http://petticoatsandpistols.com/wp-content/uploads/2009/02/silhouette11.bmp') imshow(xor(im, imerode(im, true(3))))

  15. Connected Components im = imread('text.png'); imshow(im); cc = bwlabel(im); figure; imagesc(cc); regions = regionprops(im); [regions.Area];% show area of each conn. component

  16. Some usefulMatlab functions • linspace: make linearly spaced samples • sub2ind, ind2sub: from 1D to ND indexing • bwdist: computes distance from positives in a binary image • regionprops: compute properties of connected components • find: find non-zeros, (can also find first k or find last k) • repmat: replicate a matrix • reshape: reshape a matrix • interp1: many types of interpolation • ndgrid: make array of indices of pixels • zeros, ones, rand, randn, blkdiag: matrix construction http://home.online.no/~pjacklam/matlab/doc/mtt/index.html

  17. Slide Credits • This set of sides also contains contributions kindly made available by the following authors • Alexei Efros • Nathan Jacobs

More Related