Miguel Tavares Coimbra VC 17/18 – TP8 Segmentation Mestrado em Ciência de Computadores Mestrado Integrado em Engenharia de Redes e Sistemas Informáticos Miguel Tavares Coimbra
Outline Thresholding Geometric structures Hough Transform VC 17/18 - TP8 - Segmentation
Topic: Thresholding Thresholding Geometric structures Hough Transform VC 17/18 - TP8 - Segmentation
Boundaries of Objects Marked by many users http://www.eecs.berkeley.edu/Research/Projects/CS/vision/grouping/segbench/bench/html/images.html VC 17/18 - TP8 - Segmentation
Boundaries of Objects from Edges Brightness Gradient (Edge detection) Missing edge continuity, many spurious edges VC 17/18 - TP8 - Segmentation
Boundaries of Objects from Edges Multi-scale Brightness Gradient But, low strength edges may be very important VC 17/18 - TP8 - Segmentation
Machine Edge Detection Image VC 17/18 - TP8 - Segmentation Human Boundary Marking
Boundaries in Medical Imaging Detection of cancerous regions. VC 17/18 - TP8 - Segmentation [Foran, Comaniciu, Meer, Goodell, 00]
Boundaries in Ultrasound Images Hard to detect in the presence of large amount of speckle noise VC 17/18 - TP8 - Segmentation
Sometimes hard even for humans! VC 17/18 - TP8 - Segmentation
What is ‘Segmentation’? Separation of the image in different areas. Objects. Areas with similar visual or semantic characteristics. Not trivial! It is the holy grail of most computer vision problems! VC 17/18 - TP8 - Segmentation
What is the correct segmentation? Subjectivity A ‘correct’ segmentation result is only valid for a specific context. Subjectivity! Hard to implement. Hard to evaluate. What is the correct segmentation? Face Person Suitcase VC 17/18 - TP8 - Segmentation
Core Technique: Thresholding Divide the image into two areas: 1, if f(x,y)>K 0, if f(x,y)<=K Not easy to find the ideal k magic number. Core segmentation technique Simple Reasonably effective Adequate threshold VC 17/18 - TP8 - Segmentation
Finding the ‘magic number’ Wrong! (k = 128) Correct (k = 74) VC 17/18 - TP8 - Segmentation
Global thresholds are not always adequate... VC 17/18 - TP8 - Segmentation http://www.cee.hw.ac.uk/hipr/html/adpthrsh.html
Adaptive Thresholding Adapt the threshold value for each pixel. Use characteristics of nearby pixels. How? Mean Median Mean + K ... Mean of 7x7 neighborhood VC 17/18 - TP8 - Segmentation
7x7 window; K = 7 75x75 window; K = 10 VC 17/18 - TP8 - Segmentation
Topic: Geometric structures Thresholding Geometric structures Hough Transform VC 17/18 - TP8 - Segmentation
Points What is a point? Spatial Mask! Need to define a threshold K. Pixel with a significant illumination difference to its neighbors. Group of pixels? Spatial Mask! Need to define a threshold K. -1 8 VC 17/18 - TP8 - Segmentation
Lines Spatial filter One per line direction Sensitive to line width -1 2 -1 2 Horizontal Vertical Diagonal? VC 17/18 - TP8 - Segmentation
Edges Edge: Spatial discontinuity of pixel amplitude. High spatial gradient First derivative (peak) Second derivative (zero crossing) VC 17/18 - TP8 - Segmentation
Popular operators Edge detection A variety of solutions exists. Great utility for several problems. Well studied problem. A variety of solutions exists. VC 17/18 - TP8 - Segmentation
VC 17/18 - TP8 - Segmentation
Processing Edge Images Edge detection and Thresholding Noisy edge image Incomplete boundaries Image Edge Tracking Thinning VC 17/18 - TP8 - Segmentation
Edge Tracking Methods Adjusting a priori Boundaries Given: Approximate Location of Boundary Task: Find Accurate Location of Boundary Search for STRONG EDGES along normals to approximate boundary. Fit curve (eg., polynomials) to strong edges. VC 17/18 - TP8 - Segmentation
Edge Tracking Methods Divide and Conquer Given: Boundary lies between points A and B Task: Find Boundary Connect A and B with Line Find strongest edge along line bisector Use edge point as break point Repeat VC 17/18 - TP8 - Segmentation
Fitting Lines to Edges (Least Squares) Given: Many pairs Find: Parameters Minimize: Average square distance: Using: Note: VC 17/18 - TP8 - Segmentation
Topic: Hough Transform Thresholding Geometric structures Hough Transform VC 17/18 - TP8 - Segmentation
Hough Transform Elegant method for direct object recognition Edges need not be connected Complete object need not be visible Key Idea: Edges VOTE for the possible model VC 17/18 - TP8 - Segmentation
Image and Parameter Spaces Equation of Line: Find: Consider point: Image Space Parameter Space Parameter space also called Hough Space VC 17/18 - TP8 - Segmentation
Line Detection by Hough Transform Algorithm: Quantize Parameter Space Create Accumulator Array Set For each image edge increment: If lies on the line: Find local maxima in Parameter Space 1 2 VC 17/18 - TP8 - Segmentation
Better Parameterization NOTE: Large Accumulator More memory and computations Improvement: Line equation: Here Given points find Image Space (Finite Accumulator Array Size) ? Hough Space Hough Space Sinusoid VC 17/18 - TP8 - Segmentation
Horizontal axis is θ, vertical is rho. Figure 15.1, top half. Note that most points in the vote array are very dark, because they get only one vote. Image space Votes Horizontal axis is θ, vertical is rho. VC 17/18 - TP8 - Segmentation
This is 15.1 lower half VC 17/18 - TP8 - Segmentation
15.2; main point is that lots of noise can lead to large peaks in the array VC 17/18 - TP8 - Segmentation
Mechanics of the Hough Transform Difficulties how big should the cells be? (too big, and we merge quite different lines; too small, and noise causes lines to be missed) How many lines? Count the peaks in the Hough array Treat adjacent peaks as a single peak Which points belong to each line? Search for points close to the line Solve again for line and iterate VC 17/18 - TP8 - Segmentation
single bin when noise increases. Fewer votes land in a single bin when noise increases. This is the number of votes that the real line of 20 points gets with increasing noise (figure15.3) VC 17/18 - TP8 - Segmentation
Adding more clutter increases number of bins with false peaks. Figure 15.4; as the noise increases in a picture without a line, the number of points in the max cell goes up, too VC 17/18 - TP8 - Segmentation
Real World Example Original Edge Detection Found Lines Parameter Space
Edges when using circle model Other shapes Edges when using circle model Original VC 17/18 - TP8 - Segmentation
Resources Gonzalez & Woods – Chapter 7 N. Otsu, “A threshold selection method from gray-level histograms,” IEEE Trans. Sys., Man., Cyber., vol. 9, pp. 62–66, 1979. VC 17/18 - TP8 - Segmentation