1 / 37

HIT and MISS

HIT and MISS. Hit or Miss Transformation. “Hit or Miss” Called also “Hit and Miss” is useful to identify specified configuration of pixels. For instance, such combinations as: isolated foreground pixels or pixels at end of lines (end points) A  B = (A  B1 )  (A c  B2 )

jadriana
Télécharger la présentation

HIT and MISS

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. HIT and MISS

  2. Hit or Miss Transformation • “Hit or Miss” Called also “Hit and Miss” is useful to identify specified configuration of pixels. • For instance, such combinations as: • isolated foreground pixels • or pixels at end of lines (end points) • A B = (A B1)  (AcB2) • A eroded by B1, intersection A complement eroded by B2 (two different structuring elements)

  3. Hit or Miss Example: Find cross shape pixel configuration MATLAB Function: C = bwhitmiss(A, B1, B2)

  4. Original Image A and B1 A eroded by B1 Complement of Original Image and B2 Erosion of A complement And B2 Intersection of eroded images From: Digital Image Processing, Gonzalez,Woods And Eddins

  5. Hit or Miss • Have all the pixels in B1, but none of the pixels in B2

  6. Hit or Miss Example #2 • Locate upper left hand corner pixels of objects in an image • Pixels that have east and south neighbors (Hits) and no NE, N, NW, W, SW Pixels (Misses) B1 = B2 = Don’t Care about SE

  7. Hit or Miss in Matlab G = bwhitmiss(f, B1, B2); Figure, imshow(g) From: Digital Image Processing, Gonzalez,Woods And Eddins

  8. bwmorph(f, operation, n) • Implements various morphological operations based on combinations of dilations, erosions and look up table operations. • Example: Thinning >> f = imread(‘fingerprint_cleaned.tif’); >> g = bwmorph(f, ‘thin’, 1); >> g2 = bwmorph(f, ‘thin’, 2); >> g3 = bwmorph(f, ‘thin’, Inf);

  9. Chapter 9 Morphological Image Processing Input From: Digital Image Processing, Gonzalez,Woods And Eddins • >> f = imread(‘fingerprint_cleaned.tif’); • >> g = bwmorph(f, ‘thin’, 1); • >> g2 = bwmorph(f, ‘thin’, 2); • >> g3 = bwmorph(f, ‘thin’, Inf);

  10. From: Digital Image Processing, Gonzalez,Woods And Eddins

  11. Hit-and-miss Transform is used for “Pattern Matching” • Hit and Miss is used to look for particular patterns of foreground and background pixels • It allows a recognition of very simple objects • All other morphological operations can be derived from it!! • Input: • Binary Image • Structuring Element, containing 0s and 1s!!

  12. Example for a Hit-and-miss Structuring Element • Contains 0s, 1s and don’t care’s. • Usually a “1” at the origin!

  13. Hit-and-miss Transform as pattern matching • It is one variant of a general to Pattern Matching approach: • If foreground and background pixels in the structuring element exactly match foreground and background pixels in the image, • then the pixel underneath the origin of the structuring element is set to the foreground color.

  14. EXAMPLE: Corner Detection with Hit-and-miss Transform • Structuring Elements representing four corners

  15. Corner Detection with Hit-and-miss Transform • Apply Hit-&-Miss with each Structuring Element • Use OR operation to combine the four results Allows to describe approximate shape of an object

  16. Basic THINNING

  17. Thinning • Used to remove selected foreground pixels from binary images • After edge detection, lines are often thicker than one pixel. • Thinning can be used to thin those line to one pixel width.

  18. Definition of Thinning • Let K be a kernel and I be an image with 0-1=0!! • If foreground and background fit the structuring element exactly, then the pixel at the origin of the SE is set to 0 • Note that the value of the SE at the origin is 1 or don’t care!

  19. We use two Hit-and-miss Transforms Example Thinning with two H&M transforms 0 0

  20. Basic THICKENING

  21. Thickening • Used to grow selected regions of foreground pixels • E.g. applications like approximation of convex hull

  22. Definition Thickening • Let K be a kernel and I be an image with 1+1=1 • If foreground and background match exactly the SE, then set the pixel at its origin to 1! • Note that the value of the SE at the origin is 0 or don’t care!

  23. Example Thickening If foreground and background match exactly the SE, then set the pixel at its origin to 1! 1 1

  24. Skeletonization From: Digital Image Processing, Gonzalez,Woods And Eddins Bone Image Skeleton obtained using function bwmorph Resulting Skeleton obtained after pruning with function endpoints

  25. Objects in Images In many cases we want to find some known objects in images Image containing ten objects A subset of pixels from the Image From: Digital Image Processing, Gonzalez,Woods And Eddins

  26. Finding objects in pictures Pixel p and its diagonal neighbors Pixel p and its 8- neighbors Pixel p and its 4-neighbors Pixels that are 8 adjacent but not 4 adjacent 4 and 8 adjacent pixels These pixels are 4 and 8 connected These pixels are 8 connected but not 4 connected From: Digital Image Processing, Gonzalez,Woods And Eddins

  27. How many objects are really in a picture? From: Digital Image Processing, Gonzalez,Woods And Eddins

  28. Connected Components Center of mass is another useful concept in object recognition From: Digital Image Processing, Gonzalez,Woods And Eddins

  29. Morphological Reconstruction Original image (the mask) Intermediate image after 100 iterations Marker image

  30. Morphological Reconstruction Chapter 9 Morphological Image Processing From: Digital Image Processing, Gonzalez,Woods And Eddins

  31. Translation and Reflection From: Digital Image Processing, Gonzalez,Woods And Eddins

  32. Reflection • Dilation definition: “Dilation of A by B is the set consisting of all structuring element origin locations where the reflected and translated B overlaps at least some portion of A” • If structuring element is symmetric with respect to origin, reflection of B has no effect

  33. PROBLEMS TO THINK

  34. Images of lanes and corridors

  35. Problems • Consider the images on slide 17! Why are the images getting darker under erosion? Explain! • Consider the images on slide 31! Why are the intensities becoming more uniform? Explain! • Compare Dilatation and Erosion! How are they related? Verify your answers with Matlab! • Apply Erosion and Dilatation for noise removal! • Consider slide 38: Remove the artefacts remaining with the horizontal lines.

  36. Problems • Derive dilatation and erosion from the Hit-and-miss transformation • How to use these all operations to find some good features in our FAB building corridors and halls so that the robot can recognize the object such as door or windows?

  37. Sources Used Volker Krüger Rune Andersen . Roger S. Gaborski

More Related