Morphological Operators

Slides:



Advertisements
Similar presentations
Computational Biology, Part 23 Biological Imaging II Robert F. Murphy Copyright  1996, 1999, All rights reserved.
Advertisements

Document Image Processing
Image Segmentation Image segmentation (segmentace obrazu) –division or separation of the image into segments (connected regions) of similar properties.
Chapter 9: Morphological Image Processing
Morphology – Chapter 10. Binary image processing Often it is advantageous to reduce an image from gray level (multiple bits/pixel) to binary (1 bit/pixel)
Introduction to Morphological Operators
Morphological Image Processing Md. Rokanujjaman Assistant Professor Dept of Computer Science and Engineering Rajshahi University.
CS 376b Introduction to Computer Vision 04 / 11 / 2008 Instructor: Michael Eckmann.
Binary Image Analysis: Part 2 Readings: Chapter 3: mathematical morphology region properties region adjacency 1.
Color a* b* Brightness L* Texture Original Image Features Feature combination E D 22 Boundary Processing Textons A B C A B C 22 Region Processing.
Fitting a Model to Data Reading: 15.1,
CS 376b Introduction to Computer Vision 04 / 14 / 2008 Instructor: Michael Eckmann.
Computer Vision Basics Image Terminology Binary Operations Filtering Edge Operators.
Morphological Image Processing
GUIDED BY: C.VENKATESH PRESENTED BY: S.FAHIMUDDIN C.VAMSI KRISHNA ASST.PROFESSOR M.V.KRISHNA REDDY (DEPT.ECE)
כמה מהתעשייה? מבנה הקורס השתנה Computer vision.
Computer Vision Spring ,-685 Instructor: S. Narasimhan Wean Hall 5409 T-R 10:30am – 11:50am.
October 8, 2013Computer Vision Lecture 11: The Hough Transform 1 Fitting Curve Models to Edges Most contours can be well described by combining several.
Chapter 3 Binary Image Analysis. Types of images ► Digital image = I[r][c] is discrete for I, r, and c.  B[r][c] = binary image - range of I is in {0,1}
Chapter 9.  Mathematical morphology: ◦ A useful tool for extracting image components in the representation of region shape.  Boundaries, skeletons,
CS 376b Introduction to Computer Vision 02 / 22 / 2008 Instructor: Michael Eckmann.
Under Supervision of Dr. Kamel A. Arram Eng. Lamiaa Said Wed
Digital Image Processing Chapter 9: Morphological Image Processing 5 September 2007 Digital Image Processing Chapter 9: Morphological Image Processing.
Morphological Image Processing
Edges. Edge detection schemes can be grouped in three classes: –Gradient operators: Robert, Sobel, Prewitt, and Laplacian (3x3 and 5x5 masks) –Surface.
Image Segmentation and Morphological Processing Digital Image Processing in Life- Science Aviad Baram
CS654: Digital Image Analysis Lecture 25: Hough Transform Slide credits: Guillermo Sapiro, Mubarak Shah, Derek Hoiem.
Fitting: The Hough transform
CSC508 Convolution Operators. CSC508 Convolution Arguably the most fundamental operation of computer vision It’s a neighborhood operator –Similar to the.
Edge Detection and Geometric Primitive Extraction Jinxiang Chai.
Digital Image Processing CSC331 Morphological image processing 1.
Low level Computer Vision 1. Thresholding 2. Convolution 3. Morphological Operations 4. Connected Component Extraction 5. Feature Extraction 1.
October 16, 2014Computer Vision Lecture 12: Image Segmentation II 1 Hough Transform The Hough transform is a very general technique for feature detection.
CS654: Digital Image Analysis
October 1, 2013Computer Vision Lecture 9: From Edges to Contours 1 Canny Edge Detector However, usually there will still be noise in the array E[i, j],
Image Segmentation Image segmentation (segmentace obrazu)
Edges and Lines Readings: Chapter 10:
1 Mathematic Morphology used to extract image components that are useful in the representation and description of region shape, such as boundaries extraction.
Morphological Image Processing Robotics. 2/22/2016Introduction to Machine Vision Remember from Lecture 12: GRAY LEVEL THRESHOLDING Objects Set threshold.
 Mathematical morphology is a tool for extracting image components that are useful in the representation and description of region shape, such as boundaries,
Digital Image Processing Lecture 17: Segmentation: Canny Edge Detector & Hough Transform Prof. Charlene Tsai.
Machine Vision Edge Detection Techniques ENT 273 Lecture 6 Hema C.R.
BYST Morp-1 DIP - WS2002: Morphology Digital Image Processing Morphological Image Processing Bundit Thipakorn, Ph.D. Computer Engineering Department.
Course 3 Binary Image Binary Images have only two gray levels: “1” and “0”, i.e., black / white. —— save memory —— fast processing —— many features of.
Lecture(s) 3-4. Morphological Image Processing. 3/13/20162 Introduction ► ► Morphology: a branch of biology that deals with the form and structure of.
Morphological Image Processing (Chapter 9) CSC 446 Lecturer: Nada ALZaben.
Morphological Image Processing
Hough Transform CS 691 E Spring Outline Hough transform Homography Reading: FP Chapter 15.1 (text) Some slides from Lazebnik.
April 21, 2016Introduction to Artificial Intelligence Lecture 22: Computer Vision II 1 Canny Edge Detector The Canny edge detector is a good approximation.
Another Example: Circle Detection
Digital Image Processing Lecture 15: Morphological Algorithms April 27, 2005 Prof. Charlene Tsai.
Digital Image Processing CP-7008 Lecture # 09 Morphological Image Processing Fall 2011.
CSE 554 Lecture 1: Binary Pictures
Fitting: Voting and the Hough Transform
Detection of discontinuity using
HIT and MISS.
Introduction to Morphological Operators
Mean Shift Segmentation
Fitting Curve Models to Edges
Computer Vision Lecture 9: Edge Detection II
Computer Vision Lecture 16: Texture II
From a presentation by Jimmy Huff Modified by Josiah Yoder
CS Digital Image Processing Lecture 5
Digital Image Processing Lecture 15: Morphological Algorithms
Binary Image Analysis: Part 2 Readings: Chapter 3:
Outline Announcement Perceptual organization, grouping, and segmentation Hough transform Read Chapter 17 of the textbook File: week14-m.ppt.
ECE 692 – Advanced Topics in Computer Vision
Finding Line and Curve Segments from Edge Images
Introduction to Artificial Intelligence Lecture 22: Computer Vision II
DIGITAL IMAGE PROCESSING Elective 3 (5th Sem.)
Presentation transcript:

Morphological Operators

More on Homogeneous Intensity Regions Morphology Refers to “form and structure” Defined as set operations Pixels that make up a region are the elements of the set Pixels not in the region are the elements outside the set Operate on binary images where connected components have been identified Basic implementation is similar to that of convolution with a kernel

(connected components with boundaries) Pixels as Sets 1 3 2 5 4 1 Set of pixels (white) 5 Sets of pixels (connected components with boundaries)

Morphology Operations Inputs Binary image (connected components) Structuring element (kernel) Output Processed regions Region Region Morphological Operation Structuring Element

Structuring Element Analogous to a convolution kernel Acts as a “probe” of the binary image Designate an origin of the element May be the central pixel May be some other pixel Can be any shape or size

Structuring Element 1 1 1 1 1

Structuring Element Notice the empty spaces on the elements These spaces are treated as “don’t cares” Clearly we must represent them as something when writing code You choose what the values should be and make sure you handle them consistently More on this later

Basic Operations Five common Morphological Operations Dilation Erosion Closing Opening Hit And Miss

Dilation Used to enlarge a region Sweep the structuring element over the image (as you did with convolution) Each time the origin lands on a pixel within the region… Write a 1 wherever the structuring element is a 1 That is, replicate the structuring element for every region pixel The effect will be to thicken lines, fill gaps and holes, and grow object boundaries

Dilation With a 3x3 structure element of all 1’s: INPUT OUTPUT DIFFERENCE

Erosion Used to shrink a region Sweep the structuring element over the image When all structuring elements (the 1’s) cover region pixels Place a 1 at the origin pixel of the output image The effect will be to thin lines and shrink object boundaries

Erosion With a 3x3 structure element of all 1’s: INPUT OUTPUT DIFFERENCE

Closing Used to close internal holes and eliminate concavities from regions Concatenation of dilation/erosion operations Perform a dilation on the input image to produce an intermediate image Perform an erosion on the intermediate image to produce the output image

Closing With a 3x3 structure element of all 1’s: INPUT OUTPUT DIFFERENCE

Opening Used to remove “tails” from regions Concatenation of erosion/dilation operations Perform an erosion on the input image to produce an intermediate image Perform an dilation on the intermediate image to produce the output image

Opening With a 3x3 structure element of all 1’s: INPUT OUTPUT DIFFERENCE

Another Example INPUT DILATE ERODE OPEN CLOSE With a 3x3 structure element of all 1’s:

Hit And Miss Searches for specific patterns in the image Sweep the structuring element over the image When all structuring elements match underlying image pixels exactly Consider structure element 1’s (region pixels), 0’s (non-region pixels), and “don’t cares” Logical OR the image pixel corresponding to the structure element origin into the output image (i.e. write a value to the output where the origin of the structuring element is)

Hit And Miss Note that the Structuring Element contains three types of values Foreground (region) indicators Background (non-region) indicators “don’t care” indicators Foreground indicators must land on region pixels Background indicators must land on non-region pixels Don’t care indicators can land on anything

Hit And Miss 1 STRUCTURING OUTPUT ELEMENT INPUT There is a white pixel here (lower left corner of the square)

Compound Operations Advanced operations can be created by combining the basic operations Skeletonization (thinning) Thin(i, j) = I(i, j) ∩ HitAndMiss(I(i, j)) This will take a “wide” object and produce a thin object

From Edges to Lines The Hough Transform

From Edges To Lines Edges are a good start They contain some important information and reduce the amount of raw data We don’t have to deal with all the pixel intensities that may not be all that informative But now we must do something with the edges As we saw last week, computing texture was one of the things we can do

Binarized edgels (edge pixels), not a line! Hough Transform Hough Transform Binarized edgels (edge pixels), not a line!

Binarized edgels (edge pixels), not a line! Hough Transform Hough Transform Binarized edgels (edge pixels), not a line!

Binarized edgels (edge pixels), not a line! Hough Transform Hough Transform Binarized edgels (edge pixels), not a line!

Binarized edgels (edge pixels), not a line! Hough Transform Hough Transform Binarized edgels (edge pixels), not a line!

Binarized edgels (edge pixels), not a line! Hough Transform Hough Transform Binarized edgels (edge pixels), not a line!

Binarized edgels (edge pixels), not a line! Hough Transform Hough Transform Binarized edgels (edge pixels), not a line!

Binarized edgels (edge pixels), not a line! Hough Transform Hough Transform Binarized edgels (edge pixels), not a line!

Binarized edgels (edge pixels), not a line! Hough Transform Hough Transform Binarized edgels (edge pixels), not a line!

Hough Transform What exactly is going on? The Hough Transform is a technique for finding straight lines in a mass of disconnected points It’s a “model-based” technique It utilizes a mathematical equation (a model) of a line and then tries to fit points to the equation

Hough Transform Input image is [typically] a binarized edge magnitude map You could define it to use edge magnitudes in a manner similar to the Canny edge detector The process maps image space edge points to Hough Space coordinates The output image is the location of lines in image space What I showed was a rendering of Hough space which is not really the desired output

Hough Space A line in image space maps to a point in Hough Space A point in image space maps to multiple points in Hough Space Each point (ρ, θ) in Hough space represents line in image space ρ is the perpendicular distance from the line to the origin θ is the orientation of the line relative to a specified axis

Hough Transform A single edge point in image space can be part of an infinite number of lines in image space Since “infinite” is a bit difficult to deal with in the digital computer world we quantize the orientation of the lines into convenient bins To compute the Hough Transform of a single point in image space we measure the distance from the origin to every possible line through the point

Hough Transform Specifically, we compute for all values of θ. For example: θ ρ θ ρ Xp, Yp Xp, Yp

Hough Space The result is a sinusoidal waveform in Hough space There is a single dot in here

Implementation Basic data structure is the accumulator matrix θ ρ Similar to intensity histogram creation Initialize each location to 0 Set θ Calculate ρ Increment the (ρ, θ) bin

Mechanization When multiple dots contribute to the same line (are colinear) in image space the sin waves will intersect in a single point in Hough Space The coordinates of that point represent the parameters of the line

One Dot

Two Collinear Dots

Three Collinear Dots

Four Collinear Dots

Implementation Considerations Must settle on an origin Upper left image corner Image center Lower left image corner Whatever Just choose one and document it Must select a quantization of the orientation Too fine of a quantization and the sinusoidal waves won’t intersect in a single point Too coarse of a quantization and near parallel lines are accumulated into a single bin

Implementation Considerations The image points won’t always be perfectly collinear and therefore the Hough Space sinusoidal waves won’t always intersect in a single point Angle quantization Non-maximal peak suppression on the Hough accumulator array may be employed to reduce clustering effects (similar to the process used by Canny)

Implementation Considerations The answer is in here somewhere

Implementation Considerations After non-maximal peak suppression you may want to binarize (threshold) the accumulator array leaving only the strongest peaks Those represent locations where the most sinusoids intersected This is where the most number of points contributed to a given line (high degree of colinearity)

Implementation Considerations The basic Hough Transform does not keep track of which points contribute to a line Make each accumulator bin a linked-list (or array) of image space point locations if you want to do this Edge orientation information is completely ignored May want to store this or use it to weight a particular edges contribution to the accumulator

“Gotchas” Make sure your accumulator array is initialized to 0 each time you compute a Hough Transform Make sure your accumulator array is big enough to hold all possible distances Distances can be as far as the diagonal length of the image Distances can be positive or negative dependent on how you choose your origin

Generalized Hough Transform The only thing specific to a straight line is the parameterization – the process is general Basically, any shape that can be quantitatively described can be detected with the Hough Transform Many approaches to detecting circles have been published – especially fixed radius circles

Remainder of Class Period Open for questions regarding current or past programming assignments Write code to perform Morphology operations: Erosion Dilation Open Close Hit and Miss

Things To Do Write code to perform Reading for Next week The five basic morphological operations The Hough Transform Due 2 weeks from now Reading for Next week Chapter 6 – Color Why now? – because it is used to do segmentation, region description, and other mid-level vision stuff (as well as low-level operations) We’ll look at various color representations I especially like this topic 