SlideShare a Scribd company logo
1 of 50
1
CONTOURING
By
Ashish V. Deshpande
Electrical Engineering Department
The University of Texas at Arlington
June 21st
2004
2
OVERVIEW
• Geometry of Curves
• Contour Properties
• Curve Fitting
3
CONTOUR
• Edges are linked into a representation for a
region boundary called contour
• Closed Contour
• correspond to region boundaries
• Open Contour
• part of a region boundary
• gap in boundary : Edge detection threshold too
high , weak contrast
4
Representing a Contour
• Criteria for good representation
• Efficiency: Simple, compact representation.
• Accuracy: Fit image features accurately.
• Effectiveness: Suitable for the operations performed in the
later stages of the application
• Two ways
• Ordered list of edges
• Curve
(mathematical model of contour eg.Line segments , Cubic splines etc.)
5
Representing a Contour
• Ordered List
• Efficiency : least compact & simplest
• Accuracy : as accurate as estimate of edge locations
• Effectiveness : not good
• Curves
• Efficiency : increases
• Accuracy : as errors in edge detection are averaged
• Effectiveness : increases
6
Some Definitions
• A curve interpolates a set of points if it passes
through the points
• Approximation is fitting a curve passing close to the
points but not necessarily through the points
• An edge list is an ordered set of edge points.
• A contour is an edge list or the curve that has been
used to represent the edge list.
• A boundary is the closed contour that surrounds a
region.
7
Geometry of Curves
• Representing a point
• Explicit form y = f(x)
• Implicit form f(x,y)=0
• Parametric form (x(u), y(u))
u is the parameter
• Length of an arc
∫ 





+





2
1
22u
u
du
du
dy
du
dx
8
Contour Properties
• Let pi = (xi,yi) be the coordinates of edge i in the edge list
• Estimate the slope using edge points that are not adjacent :
• Left k-slope: direction from pi-k to pi
• Right k-slope: direction from pito pi+k
• K-curvature: diff. between the left and right k-slopes.
• Length of digital curve
• Distance between end points
• S/D ratio (covered in curve fitting)
∑=
−− −+−=
n
i
iiii yyxxS
2
2
1
2
1 )()(
2
1
2
1 )()( xxyyD nn −+−=
9
Representation using lists
• Chain Codes : specifies direction of contour at
each edge along the edge list
• Directions are quantized
• Starting at first edge and going clockwise around the
contour the direction is specified using one of the
directions
10
Chain Codes
• Example
• Limitations
• Limited set of directions
• Sensitive to noise
11
Slope Representation
• Continuous version of Chain code , also called y-s
plot
• Algorithm:
1.Start at the first edge and go clockwise
2.Estimate slope (y) and arc length (s)
3.Plot the slope Versus the arc length
• Horizontal line segments in y-s space correspond to
segments in the contour
• Line segments at other orientations correspond to
circular arcs
• Portions of the plot that are not straight line segments
correspond to other curve primitives
12
An Example
13
Centroidal Profile Representation
• Plot the distance from the centroid to the
boundary as a function of angle
14
Curve Fitting
• Four Models
• Line Segments
• Circular arcs
• Conic sections
• Cubic splines
• Note:
We proceed with the basic assumption that the edge
locations are sufficiently accurate that selected edge points
can be used to determine the fit. We will later consider
methods based on approximation that can handle such
errors.
15
Goodness of a fit
• Let di be the distance of edge point i from line.
• Maximum absolute error : measures how much the
points deviate from the curve in the worst case.
• Mean squared error : gives an overall measure of
the deviation of the curve from the edge points.
16
Goodness of a fit contd…
• Normalized maximum absolute error: the ratio of the
maximum absolute error to the length of the curve (error
becomes independent of the length of the curve ,i.e unitless ).
• Ratio of curve length to the end point distance: a good
measure of the complexity of the curve.
• Number of Sign Changes: in the error is a good indicator of
the appropriateness of the curve as a model for the edges in
the contour.
17
Curve fitting methods
• The use of straight line segments (polylines) is
appropriate if the image consists of straight lines. It
is the starting point for fitting other models.
• Circular arcs are a useful representation for
estimating curvature
• Conic sections provide a convenient way to
represent sequences of line segments and circular as
well as elliptic and hyperbolic arcs .
• Cubic splines are good to model smooth curves
18
Polyline Representation
• A polyline is a sequence of line segments joined end to end.
The ends of each line are edge points in the original edge list.
The points where line segments are joined are called vertices.
• A quick revision
• Equation of line passing from two points (x1, y1), (x2, y2):
• Distance d of edge point (u, v) from the line:
• D is the distance between (x1, y1) and (x2, y2).
19
Polyline Representation types
• Splitting
• Merging
• Split and Merge Algorithm
• Hop-Along Algorithm
20
Splitting (Top Down)
• Algorithm :
(1) Take the line segment connecting the end points of the
contour (if the contour is closed, consider the line
segment connecting the two farthest points)
(2) Find the farthest edge point from the line segment
(3) If the normalized maximum error of that point from the
line segment is above a threshold, split the segment into
two segments at that point (i.e., new vertex)
(4)Repeat the same procedure for each of the two
subsegments until the error is very small.
21
Example (Open Contour)
22
Example (Closed Contour)
23
Merging (Bottom Up)
• Algorithm :
(1) Use the first two edge points to define a line segment.
(2) Add a new edge point if it does not deviate too far from
the current line segment.
(3) Update the parameters of the line segment using least-
squares.
(4) Start a new line segment when edge points deviate too
far from the line segment.
24
Tolerance Band
• Algorithm:
(1) Two line segments that are parallel to the line segment
approximating the edge at a distance ε from the center
are computed.
(2) Edges are added to the current line segment as long as
the new edges are inside the tolerance band.
(3) The parameters of the line segment are recomputed as
the edges are added to the segment.
(4) The vertex at the end of the segment is the starting point
for the next segment
25
Example
26
Split and Merge
• The accuracy of line segment approximations can be
improved by interleaving merge and split
operations.
• Algorithm:
(1) After recursive subdivision (split), allow
adjacent segments to be replaced by a single
segment (merge).
(2) Alternate applications of split and merge until
no segments are merged or split.
27
Example
28
Hop Along Algorithm
1. Start with the first k edges from the list.
2. Fit a line segment between the first and the last edges in the
sub list.
3. If the normalized maximum error is too large, shorten the
sub list to the point of maximum error. Return to step 2.
4. If the line fit succeeds, compare the orientation of the current
line segment with that of the previous line segment. If the
lines have similar orientations, replace the two line segments
with a single line segment.
5. Make the current line segment the previous line segment and
advance the window of edges so that there are k edges in the
sublist. Return to step 2.
29
Circular arcs
• Subsequences of the line segments can be
replaced by circular arcs if desired. Replacing
by arcs involves fitting circular arcs through
the end points of two or more line segments,
i.e. fitting is done on vertices in the polyline
• The circular arc is a fit between the first and
last end points and one other point. There
can be several methods depending on how
the middle point is chosen .
30
Replacing line segments with arcs
• Algorithm:
1.Initialize the window of vertices to the 3 end points of the
first 2 line segments in the polyline.
2.Compute the ratio of the length of the part of the contour
corresponding to the 2 line segments to the distance
between the end points. If the ratio is large then leave the
first line segment unchanged, advance the window of
vertices by one vertex, and repeat this step.
3.Fit a circle through the 3 vertices.
4.Calculate the normalized error and number of sign
changes.
31
Contd…
5. If the normalized maximum error is too large or the
number of sign changes is too small then leave the first
line segment unchanged, advance the window of vertices
and return to step 2.
6.If the circle fit succeeds, then try to include the next line
segment in the circular arc. Repeat this step until no more
line segments can be sub-summed by this circular arc.
7.Advance the window to the next 3 polyline vertices after
the end of the circular arc and return to step 2.
32
Error Calculation
• To calculate error in fitting a circular arc , define
distance of point Q (x1, y1) from the circle along a
line passing through the center (x0, y0)
• q =
The distance from Q to the circular arc is d=q - r
2
01
2
01 )()( yyxx −+−
33
Conic Sections & Cubic Splines
• Conic sections correspond to hyperbolas, parabolas,
and ellipses (2nd degree polynomials).
• Cubic splines correspond to 3rd degree polynomials.
• Conic sections and cubic splines allow more
complex contours to be represented using fewer
segments.
• Conic sections can be fit between three vertices in
the polyline approximation.
34
Conic section between three points
35
Curve Approximation
• Higher accuracy can be obtained by computing an approximation
that is not forced to pass through particular edge points.
• Approximation based methods use all the edge points to find a
good fit (this is contrast to the previous methods that use only the
interpolated edge points).
• Methods to approximate curves depend on the reliability with
which edge points can be grouped into contours.
(1) Least-squares regression can be used if it is certain that the
edge points grouped together belong to the same contour.
(2) Robust regression is more appropriate if there are some
grouping errors.
(3) If grouping cannot be done easily using edge linking or
following methods , then cluster analysis techniques like
Hough transform are used
36
Least-squares line fit
• Linear regression fits a line to the edge points by minimizing
the sum of squares of the perpendicular distances of the edge
points from the line being fit.
∑ +−=
i
ii yxX 22
)cossin( ρθθ
37
Some math…(solution to the regression problem)
38
Limitations
• It works well for cases where the noise follows a
Gaussian distribution.
• It does not work well when there are outliers
(edge points incorrectly linked to the contour) in
the data (e.g., due to errors in edge linking ).
39
Robust Regression
• Outliers can pull the regression line far away from
its correct location.
• Robust regression methods try various subsets of the
data points and choose the subset that provides the
best fit.
40
Least - Median Suares Regression
• Algorithm:
(assume that there are n data points and p parameters in the model)
(1) Choose p points at random from the set of n data points.
(2) Compute the fit of the model to the p points.
(3) Compute the median of the square of the residuals.
(4) Repeat until the median squared error is less than some
threshold, or take the best median error result after
some number of runs.
• This algorithm can handle up to 50% outliers in the
data set.
41
Hough Transform
• Voting mechanism
• Each point on the curve votes for several
combinations of parameters, the parameters that
win a majority of votes are winners
• This technique assumes that a primitive edge
detection is already performed on an image
42
The technique
• Consider the equation of a straight line y= mx +c
• Rewriting the equation c= y – mx
• Let us assume that m and c are variables of interest and x
and y are constants. The above equation represents a line in
m-c space.
• A point (x,y) corresponds to line in m-c space
• If there are n points lying on the straight line (in x-y plane),
then these will correspond to a family of lines in parameter
space all passing through (m,c). This point gives parameters
of original straight line
43
Hough Transform Algorithm
1. Quantize the parameter space appropriately
2. Assume that each cell in the parameter space is an
accumulator. Initialize all cells to zero.
3. For each point (x,y) in the image space , increment by 1
each of the accumulators that satisfy the equation
4. Maxima in the accumulator array correspond to the
parameters of model instances
5. If the peak in the parameter space covers more than 1
accumulator then the centroid of the region gives an
estimate of the parameters
44
A Demonstration
• The data is given on the left. The result of the Hough transform is a
bright orange box on the right of the figure (the Hough space) which is
the result of a large number of counts for that accumulator.
45
Limitations
• Size of discrete parameter space increases
exponentially as number of parameters
increases hence Hough transform may be
computationally very inefficient for complex
models
46
Fourier Descriptors
• Fourier coefficients are used to represent a closed contour
since they are periodic.
• Boundary of an object is expressed as a sequence of
coordinates
• We can represent each co ordinate pair as a complex number
so that
• For a closed curve u(n) is periodic
• DFT
• IDFT
)](),([)( nynxnu =
1,....2,1,0),()()( −=+= Nnnjynxnu
∑
−
=
∏
−≤≤=
1
0
/2
10,)()(
N
k
Nknj
Nnekanu
∑
−
=
∏−
−≤≤=
1
0
2
10,)(
1
)(
N
n
N
nkj
Nnenu
N
ka
47
Fourier Descriptors (contd..)
• The complex coefficients a(k) are called Fourier
descriptors (FD) of the boundary
• Low resolution approximation
• Only first M coefficients are used
∑
−
=
∏
−≤≤=
1
0
2
10,)()(
M
k
N
knj
Nnekanu
48
Summary
Contour Representation
Using Interpolation
Using Edge list
Using Curve fitting
Using Approximation
Using Regression
Using Hough Transform
Using Fourier Descriptors
49
References
• Rafael C. Gonzalez, Digital Image Processing
• Ramesh C. Jain, et al., Machine Vision 
• Adrian Low, Introductory Computer Vision and
Image Processing
50
Thank You !!

More Related Content

What's hot

Classification of triangulation
Classification of triangulationClassification of triangulation
Classification of triangulationFayaz Ahamed A P
 
Bezier Curve and Spline Curve
Bezier Curve and Spline CurveBezier Curve and Spline Curve
Bezier Curve and Spline CurveAsifShahariar1
 
Using Drawing Tools and applied geometry
Using Drawing Tools and applied geometryUsing Drawing Tools and applied geometry
Using Drawing Tools and applied geometryNUST Stuff
 
Engineering Drawing: Chapter 02 using drawing tools
Engineering Drawing: Chapter 02 using drawing toolsEngineering Drawing: Chapter 02 using drawing tools
Engineering Drawing: Chapter 02 using drawing toolsmokhtar
 
Surveying - Module I - Introduction to surveying
Surveying - Module I - Introduction to surveying Surveying - Module I - Introduction to surveying
Surveying - Module I - Introduction to surveying SHAMJITH KM
 
Ce6304 surveying i-2015_07_16_10_57_06_997
Ce6304 surveying i-2015_07_16_10_57_06_997Ce6304 surveying i-2015_07_16_10_57_06_997
Ce6304 surveying i-2015_07_16_10_57_06_997Massanja Tollah
 
73941338 surveying-lab-manual-1
73941338 surveying-lab-manual-173941338 surveying-lab-manual-1
73941338 surveying-lab-manual-1Anu Parameswaran
 
Direct method of contouring(26 30) DCE FET IIUI
Direct method of contouring(26 30) DCE FET IIUIDirect method of contouring(26 30) DCE FET IIUI
Direct method of contouring(26 30) DCE FET IIUIcivilengineerf14
 
traversing of survey
traversing of surveytraversing of survey
traversing of surveySelf-employed
 
LAB MANUAL contouring by indirect method . dce: fet: iiui
LAB MANUAL contouring by indirect method . dce: fet: iiuiLAB MANUAL contouring by indirect method . dce: fet: iiui
LAB MANUAL contouring by indirect method . dce: fet: iiuicivilengineerf14
 
Perpendicular Offset
Perpendicular Offset Perpendicular Offset
Perpendicular Offset Mujeeb Muji
 
Angular measurement
Angular measurementAngular measurement
Angular measurementKHUSHBU SHAH
 
Multi Degree Spline
Multi Degree SplineMulti Degree Spline
Multi Degree SplineNikhil Tare
 

What's hot (20)

Classification of triangulation
Classification of triangulationClassification of triangulation
Classification of triangulation
 
Bezier Curve and Spline Curve
Bezier Curve and Spline CurveBezier Curve and Spline Curve
Bezier Curve and Spline Curve
 
Using Drawing Tools and applied geometry
Using Drawing Tools and applied geometryUsing Drawing Tools and applied geometry
Using Drawing Tools and applied geometry
 
Engineering Drawing: Chapter 02 using drawing tools
Engineering Drawing: Chapter 02 using drawing toolsEngineering Drawing: Chapter 02 using drawing tools
Engineering Drawing: Chapter 02 using drawing tools
 
Fingerprints images
Fingerprints imagesFingerprints images
Fingerprints images
 
Surveying - Module I - Introduction to surveying
Surveying - Module I - Introduction to surveying Surveying - Module I - Introduction to surveying
Surveying - Module I - Introduction to surveying
 
Ce6304 surveying i-2015_07_16_10_57_06_997
Ce6304 surveying i-2015_07_16_10_57_06_997Ce6304 surveying i-2015_07_16_10_57_06_997
Ce6304 surveying i-2015_07_16_10_57_06_997
 
73941338 surveying-lab-manual-1
73941338 surveying-lab-manual-173941338 surveying-lab-manual-1
73941338 surveying-lab-manual-1
 
C4 EDEXCEL HELP
C4 EDEXCEL HELPC4 EDEXCEL HELP
C4 EDEXCEL HELP
 
Curves
CurvesCurves
Curves
 
ellipse
ellipseellipse
ellipse
 
Direct method of contouring(26 30) DCE FET IIUI
Direct method of contouring(26 30) DCE FET IIUIDirect method of contouring(26 30) DCE FET IIUI
Direct method of contouring(26 30) DCE FET IIUI
 
Contouring
ContouringContouring
Contouring
 
Plane Table Survey
Plane Table SurveyPlane Table Survey
Plane Table Survey
 
traversing of survey
traversing of surveytraversing of survey
traversing of survey
 
LAB MANUAL contouring by indirect method . dce: fet: iiui
LAB MANUAL contouring by indirect method . dce: fet: iiuiLAB MANUAL contouring by indirect method . dce: fet: iiui
LAB MANUAL contouring by indirect method . dce: fet: iiui
 
Perpendicular Offset
Perpendicular Offset Perpendicular Offset
Perpendicular Offset
 
Angular measurement
Angular measurementAngular measurement
Angular measurement
 
2.2 linear measurement
2.2 linear measurement2.2 linear measurement
2.2 linear measurement
 
Multi Degree Spline
Multi Degree SplineMulti Degree Spline
Multi Degree Spline
 

Viewers also liked

Modelo pedagógico vanessa fda
Modelo pedagógico  vanessa fdaModelo pedagógico  vanessa fda
Modelo pedagógico vanessa fdaAlvarez Vanessa
 
Visual Communication Presentation
Visual Communication PresentationVisual Communication Presentation
Visual Communication PresentationMoses Ifamose
 
Conosci SpazioTu Coworking Cattolica?
Conosci SpazioTu Coworking Cattolica?Conosci SpazioTu Coworking Cattolica?
Conosci SpazioTu Coworking Cattolica?Davide Fuzzi
 
1539 graphs linear equations and functions
1539 graphs linear equations and functions1539 graphs linear equations and functions
1539 graphs linear equations and functionsDr Fereidoun Dejahang
 
A batea Julián, María, Andrés.
A batea Julián, María, Andrés.A batea Julián, María, Andrés.
A batea Julián, María, Andrés.vinhamedios
 
Sample Millennial Marketing Social Media
Sample Millennial Marketing Social MediaSample Millennial Marketing Social Media
Sample Millennial Marketing Social MediaJuanita McDowell
 
La integración de las tic en el aula encuentro 2
La integración de las tic en el aula   encuentro 2La integración de las tic en el aula   encuentro 2
La integración de las tic en el aula encuentro 2mpolot
 
redes sociales
redes socialesredes sociales
redes socialesJean71321
 
Tendencias pedagógicas
Tendencias pedagógicasTendencias pedagógicas
Tendencias pedagógicashiunday123
 
Tendencia pedagógicas
Tendencia pedagógicasTendencia pedagógicas
Tendencia pedagógicashiunday123
 

Viewers also liked (20)

Modelo pedagógico vanessa fda
Modelo pedagógico  vanessa fdaModelo pedagógico  vanessa fda
Modelo pedagógico vanessa fda
 
Visual Communication Presentation
Visual Communication PresentationVisual Communication Presentation
Visual Communication Presentation
 
1628 statistics
1628 statistics1628 statistics
1628 statistics
 
Conosci SpazioTu Coworking Cattolica?
Conosci SpazioTu Coworking Cattolica?Conosci SpazioTu Coworking Cattolica?
Conosci SpazioTu Coworking Cattolica?
 
1539 graphs linear equations and functions
1539 graphs linear equations and functions1539 graphs linear equations and functions
1539 graphs linear equations and functions
 
1550 ladders, couches, and envel
1550 ladders, couches, and envel1550 ladders, couches, and envel
1550 ladders, couches, and envel
 
1626 signs in maths
1626 signs in maths1626 signs in maths
1626 signs in maths
 
A batea Julián, María, Andrés.
A batea Julián, María, Andrés.A batea Julián, María, Andrés.
A batea Julián, María, Andrés.
 
1631 the binomial theorem
1631 the binomial theorem1631 the binomial theorem
1631 the binomial theorem
 
Sample Millennial Marketing Social Media
Sample Millennial Marketing Social MediaSample Millennial Marketing Social Media
Sample Millennial Marketing Social Media
 
1511 circle position-conics project
1511 circle position-conics project1511 circle position-conics project
1511 circle position-conics project
 
La integración de las tic en el aula encuentro 2
La integración de las tic en el aula   encuentro 2La integración de las tic en el aula   encuentro 2
La integración de las tic en el aula encuentro 2
 
Dulce manía s
Dulce manía sDulce manía s
Dulce manía s
 
1538 graphs & linear equations
1538 graphs & linear equations1538 graphs & linear equations
1538 graphs & linear equations
 
Estrategia Inteligente
Estrategia InteligenteEstrategia Inteligente
Estrategia Inteligente
 
redes sociales
redes socialesredes sociales
redes sociales
 
Tendencias pedagógicas
Tendencias pedagógicasTendencias pedagógicas
Tendencias pedagógicas
 
La salud
La saludLa salud
La salud
 
Tendencia pedagógicas
Tendencia pedagógicasTendencia pedagógicas
Tendencia pedagógicas
 
1558 log-maths
1558 log-maths1558 log-maths
1558 log-maths
 

Similar to 1516 contouring

Curves wire frame modelling
Curves wire frame modellingCurves wire frame modelling
Curves wire frame modellingjntuhcej
 
Brief ContourLines power point for surveying engineering
Brief ContourLines power point for surveying engineeringBrief ContourLines power point for surveying engineering
Brief ContourLines power point for surveying engineeringdejenemulu
 
contourlines-161212065738.pdf
contourlines-161212065738.pdfcontourlines-161212065738.pdf
contourlines-161212065738.pdfshucaybcabdi
 
Unit 2 curves & surfaces
Unit 2  curves & surfacesUnit 2  curves & surfaces
Unit 2 curves & surfacesS.DHARANI KUMAR
 
Traversing Notes |surveying II | Sudip khadka
Traversing Notes |surveying II | Sudip khadka Traversing Notes |surveying II | Sudip khadka
Traversing Notes |surveying II | Sudip khadka Sudip khadka
 
Contour lines by sk
Contour lines by skContour lines by sk
Contour lines by skSalman Khan
 
UNIT 2-Geometric Modeling.pptx
UNIT 2-Geometric Modeling.pptxUNIT 2-Geometric Modeling.pptx
UNIT 2-Geometric Modeling.pptxdinesh babu
 
5. AREAS AND VOLUMES (SUR) 3140601 GTU
5. AREAS AND VOLUMES (SUR) 3140601 GTU5. AREAS AND VOLUMES (SUR) 3140601 GTU
5. AREAS AND VOLUMES (SUR) 3140601 GTUVATSAL PATEL
 
1.5_Basic Engineering_Day 7.pptx
1.5_Basic Engineering_Day 7.pptx1.5_Basic Engineering_Day 7.pptx
1.5_Basic Engineering_Day 7.pptxJanak82
 
Image representation
Image representationImage representation
Image representationRahul Dadwal
 
DEFINITIONS, PRINCIPLES AND CHAIN SURVEYING
DEFINITIONS, PRINCIPLES AND CHAIN SURVEYINGDEFINITIONS, PRINCIPLES AND CHAIN SURVEYING
DEFINITIONS, PRINCIPLES AND CHAIN SURVEYINGKamal B
 
Polygon Fill
Polygon FillPolygon Fill
Polygon Fillwahab13
 

Similar to 1516 contouring (20)

Curves wire frame modelling
Curves wire frame modellingCurves wire frame modelling
Curves wire frame modelling
 
ContourLines (4).ppt
ContourLines (4).pptContourLines (4).ppt
ContourLines (4).ppt
 
ContourLines.ppt
ContourLines.pptContourLines.ppt
ContourLines.ppt
 
Brief ContourLines power point for surveying engineering
Brief ContourLines power point for surveying engineeringBrief ContourLines power point for surveying engineering
Brief ContourLines power point for surveying engineering
 
contourlines-161212065738.pdf
contourlines-161212065738.pdfcontourlines-161212065738.pdf
contourlines-161212065738.pdf
 
Unit 2 curves & surfaces
Unit 2  curves & surfacesUnit 2  curves & surfaces
Unit 2 curves & surfaces
 
Traversing Notes |surveying II | Sudip khadka
Traversing Notes |surveying II | Sudip khadka Traversing Notes |surveying II | Sudip khadka
Traversing Notes |surveying II | Sudip khadka
 
Contouring
ContouringContouring
Contouring
 
Triangulation survey
Triangulation surveyTriangulation survey
Triangulation survey
 
Contour lines by sk
Contour lines by skContour lines by sk
Contour lines by sk
 
UNIT 2-Geometric Modeling.pptx
UNIT 2-Geometric Modeling.pptxUNIT 2-Geometric Modeling.pptx
UNIT 2-Geometric Modeling.pptx
 
5. AREAS AND VOLUMES (SUR) 3140601 GTU
5. AREAS AND VOLUMES (SUR) 3140601 GTU5. AREAS AND VOLUMES (SUR) 3140601 GTU
5. AREAS AND VOLUMES (SUR) 3140601 GTU
 
curve one
curve onecurve one
curve one
 
unit-3.ppt
unit-3.pptunit-3.ppt
unit-3.ppt
 
cg mod2.pdf
cg mod2.pdfcg mod2.pdf
cg mod2.pdf
 
1.5_Basic Engineering_Day 7.pptx
1.5_Basic Engineering_Day 7.pptx1.5_Basic Engineering_Day 7.pptx
1.5_Basic Engineering_Day 7.pptx
 
Image representation
Image representationImage representation
Image representation
 
DEFINITIONS, PRINCIPLES AND CHAIN SURVEYING
DEFINITIONS, PRINCIPLES AND CHAIN SURVEYINGDEFINITIONS, PRINCIPLES AND CHAIN SURVEYING
DEFINITIONS, PRINCIPLES AND CHAIN SURVEYING
 
Drawing tools unit 1
Drawing tools unit 1Drawing tools unit 1
Drawing tools unit 1
 
Polygon Fill
Polygon FillPolygon Fill
Polygon Fill
 

More from Dr Fereidoun Dejahang

27 j20 my news punch -dr f dejahang 27-01-2020
27 j20 my news punch -dr f dejahang  27-01-202027 j20 my news punch -dr f dejahang  27-01-2020
27 j20 my news punch -dr f dejahang 27-01-2020Dr Fereidoun Dejahang
 
028 fast-tracking projects & cost overrun
028 fast-tracking projects & cost overrun028 fast-tracking projects & cost overrun
028 fast-tracking projects & cost overrunDr Fereidoun Dejahang
 
026 fast react-productivity improvement
026 fast react-productivity improvement026 fast react-productivity improvement
026 fast react-productivity improvementDr Fereidoun Dejahang
 
022 b construction productivity-write
022 b construction productivity-write022 b construction productivity-write
022 b construction productivity-writeDr Fereidoun Dejahang
 
016 communication in construction sector
016 communication in construction sector016 communication in construction sector
016 communication in construction sectorDr Fereidoun Dejahang
 
014 changes-cost overrun measurement
014 changes-cost overrun measurement014 changes-cost overrun measurement
014 changes-cost overrun measurementDr Fereidoun Dejahang
 
013 changes in construction projects
013 changes in construction projects013 changes in construction projects
013 changes in construction projectsDr Fereidoun Dejahang
 

More from Dr Fereidoun Dejahang (20)

27 j20 my news punch -dr f dejahang 27-01-2020
27 j20 my news punch -dr f dejahang  27-01-202027 j20 my news punch -dr f dejahang  27-01-2020
27 j20 my news punch -dr f dejahang 27-01-2020
 
28 dej my news punch rev 28-12-2019
28 dej my news punch rev 28-12-201928 dej my news punch rev 28-12-2019
28 dej my news punch rev 28-12-2019
 
16 fd my news punch rev 16-12-2019
16 fd my news punch rev 16-12-201916 fd my news punch rev 16-12-2019
16 fd my news punch rev 16-12-2019
 
029 fast-tracking projects
029 fast-tracking projects029 fast-tracking projects
029 fast-tracking projects
 
028 fast-tracking projects & cost overrun
028 fast-tracking projects & cost overrun028 fast-tracking projects & cost overrun
028 fast-tracking projects & cost overrun
 
027 fast-tracked projects-materials
027 fast-tracked projects-materials027 fast-tracked projects-materials
027 fast-tracked projects-materials
 
026 fast react-productivity improvement
026 fast react-productivity improvement026 fast react-productivity improvement
026 fast react-productivity improvement
 
025 enterprise resources management
025 enterprise resources management025 enterprise resources management
025 enterprise resources management
 
022 b construction productivity-write
022 b construction productivity-write022 b construction productivity-write
022 b construction productivity-write
 
022 a construction productivity (2)
022 a construction productivity (2)022 a construction productivity (2)
022 a construction productivity (2)
 
021 construction productivity (1)
021 construction productivity (1)021 construction productivity (1)
021 construction productivity (1)
 
019 competencies-managers
019 competencies-managers019 competencies-managers
019 competencies-managers
 
018 company productivity
018 company productivity018 company productivity
018 company productivity
 
017 communication
017 communication017 communication
017 communication
 
016 communication in construction sector
016 communication in construction sector016 communication in construction sector
016 communication in construction sector
 
015 changes-process model
015 changes-process model015 changes-process model
015 changes-process model
 
014 changes-cost overrun measurement
014 changes-cost overrun measurement014 changes-cost overrun measurement
014 changes-cost overrun measurement
 
013 changes in construction projects
013 changes in construction projects013 changes in construction projects
013 changes in construction projects
 
012 bussiness planning process
012 bussiness planning process012 bussiness planning process
012 bussiness planning process
 
011 business performance management
011 business performance management011 business performance management
011 business performance management
 

Recently uploaded

Python Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docxPython Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docxRamakrishna Reddy Bijjam
 
Single or Multiple melodic lines structure
Single or Multiple melodic lines structureSingle or Multiple melodic lines structure
Single or Multiple melodic lines structuredhanjurrannsibayan2
 
Exploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptx
Exploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptxExploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptx
Exploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptxPooja Bhuva
 
REMIFENTANIL: An Ultra short acting opioid.pptx
REMIFENTANIL: An Ultra short acting opioid.pptxREMIFENTANIL: An Ultra short acting opioid.pptx
REMIFENTANIL: An Ultra short acting opioid.pptxDr. Ravikiran H M Gowda
 
SOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning PresentationSOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning Presentationcamerronhm
 
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptxMaritesTamaniVerdade
 
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...ZurliaSoop
 
On_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptx
On_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptxOn_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptx
On_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptxPooja Bhuva
 
Micro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdfMicro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdfPoh-Sun Goh
 
NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...
NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...
NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...Amil baba
 
Application orientated numerical on hev.ppt
Application orientated numerical on hev.pptApplication orientated numerical on hev.ppt
Application orientated numerical on hev.pptRamjanShidvankar
 
How to Add New Custom Addons Path in Odoo 17
How to Add New Custom Addons Path in Odoo 17How to Add New Custom Addons Path in Odoo 17
How to Add New Custom Addons Path in Odoo 17Celine George
 
Graduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - EnglishGraduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - Englishneillewis46
 
On National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan FellowsOn National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan FellowsMebane Rash
 
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptxBasic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptxDenish Jangid
 
General Principles of Intellectual Property: Concepts of Intellectual Proper...
General Principles of Intellectual Property: Concepts of Intellectual  Proper...General Principles of Intellectual Property: Concepts of Intellectual  Proper...
General Principles of Intellectual Property: Concepts of Intellectual Proper...Poonam Aher Patil
 
Holdier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfHoldier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfagholdier
 
Key note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfKey note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfAdmir Softic
 
FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024Elizabeth Walsh
 
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...Nguyen Thanh Tu Collection
 

Recently uploaded (20)

Python Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docxPython Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docx
 
Single or Multiple melodic lines structure
Single or Multiple melodic lines structureSingle or Multiple melodic lines structure
Single or Multiple melodic lines structure
 
Exploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptx
Exploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptxExploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptx
Exploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptx
 
REMIFENTANIL: An Ultra short acting opioid.pptx
REMIFENTANIL: An Ultra short acting opioid.pptxREMIFENTANIL: An Ultra short acting opioid.pptx
REMIFENTANIL: An Ultra short acting opioid.pptx
 
SOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning PresentationSOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning Presentation
 
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
 
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
 
On_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptx
On_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptxOn_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptx
On_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptx
 
Micro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdfMicro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdf
 
NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...
NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...
NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...
 
Application orientated numerical on hev.ppt
Application orientated numerical on hev.pptApplication orientated numerical on hev.ppt
Application orientated numerical on hev.ppt
 
How to Add New Custom Addons Path in Odoo 17
How to Add New Custom Addons Path in Odoo 17How to Add New Custom Addons Path in Odoo 17
How to Add New Custom Addons Path in Odoo 17
 
Graduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - EnglishGraduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - English
 
On National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan FellowsOn National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan Fellows
 
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptxBasic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
 
General Principles of Intellectual Property: Concepts of Intellectual Proper...
General Principles of Intellectual Property: Concepts of Intellectual  Proper...General Principles of Intellectual Property: Concepts of Intellectual  Proper...
General Principles of Intellectual Property: Concepts of Intellectual Proper...
 
Holdier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfHoldier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdf
 
Key note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfKey note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdf
 
FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024
 
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...
 

1516 contouring

  • 1. 1 CONTOURING By Ashish V. Deshpande Electrical Engineering Department The University of Texas at Arlington June 21st 2004
  • 2. 2 OVERVIEW • Geometry of Curves • Contour Properties • Curve Fitting
  • 3. 3 CONTOUR • Edges are linked into a representation for a region boundary called contour • Closed Contour • correspond to region boundaries • Open Contour • part of a region boundary • gap in boundary : Edge detection threshold too high , weak contrast
  • 4. 4 Representing a Contour • Criteria for good representation • Efficiency: Simple, compact representation. • Accuracy: Fit image features accurately. • Effectiveness: Suitable for the operations performed in the later stages of the application • Two ways • Ordered list of edges • Curve (mathematical model of contour eg.Line segments , Cubic splines etc.)
  • 5. 5 Representing a Contour • Ordered List • Efficiency : least compact & simplest • Accuracy : as accurate as estimate of edge locations • Effectiveness : not good • Curves • Efficiency : increases • Accuracy : as errors in edge detection are averaged • Effectiveness : increases
  • 6. 6 Some Definitions • A curve interpolates a set of points if it passes through the points • Approximation is fitting a curve passing close to the points but not necessarily through the points • An edge list is an ordered set of edge points. • A contour is an edge list or the curve that has been used to represent the edge list. • A boundary is the closed contour that surrounds a region.
  • 7. 7 Geometry of Curves • Representing a point • Explicit form y = f(x) • Implicit form f(x,y)=0 • Parametric form (x(u), y(u)) u is the parameter • Length of an arc ∫       +      2 1 22u u du du dy du dx
  • 8. 8 Contour Properties • Let pi = (xi,yi) be the coordinates of edge i in the edge list • Estimate the slope using edge points that are not adjacent : • Left k-slope: direction from pi-k to pi • Right k-slope: direction from pito pi+k • K-curvature: diff. between the left and right k-slopes. • Length of digital curve • Distance between end points • S/D ratio (covered in curve fitting) ∑= −− −+−= n i iiii yyxxS 2 2 1 2 1 )()( 2 1 2 1 )()( xxyyD nn −+−=
  • 9. 9 Representation using lists • Chain Codes : specifies direction of contour at each edge along the edge list • Directions are quantized • Starting at first edge and going clockwise around the contour the direction is specified using one of the directions
  • 10. 10 Chain Codes • Example • Limitations • Limited set of directions • Sensitive to noise
  • 11. 11 Slope Representation • Continuous version of Chain code , also called y-s plot • Algorithm: 1.Start at the first edge and go clockwise 2.Estimate slope (y) and arc length (s) 3.Plot the slope Versus the arc length • Horizontal line segments in y-s space correspond to segments in the contour • Line segments at other orientations correspond to circular arcs • Portions of the plot that are not straight line segments correspond to other curve primitives
  • 13. 13 Centroidal Profile Representation • Plot the distance from the centroid to the boundary as a function of angle
  • 14. 14 Curve Fitting • Four Models • Line Segments • Circular arcs • Conic sections • Cubic splines • Note: We proceed with the basic assumption that the edge locations are sufficiently accurate that selected edge points can be used to determine the fit. We will later consider methods based on approximation that can handle such errors.
  • 15. 15 Goodness of a fit • Let di be the distance of edge point i from line. • Maximum absolute error : measures how much the points deviate from the curve in the worst case. • Mean squared error : gives an overall measure of the deviation of the curve from the edge points.
  • 16. 16 Goodness of a fit contd… • Normalized maximum absolute error: the ratio of the maximum absolute error to the length of the curve (error becomes independent of the length of the curve ,i.e unitless ). • Ratio of curve length to the end point distance: a good measure of the complexity of the curve. • Number of Sign Changes: in the error is a good indicator of the appropriateness of the curve as a model for the edges in the contour.
  • 17. 17 Curve fitting methods • The use of straight line segments (polylines) is appropriate if the image consists of straight lines. It is the starting point for fitting other models. • Circular arcs are a useful representation for estimating curvature • Conic sections provide a convenient way to represent sequences of line segments and circular as well as elliptic and hyperbolic arcs . • Cubic splines are good to model smooth curves
  • 18. 18 Polyline Representation • A polyline is a sequence of line segments joined end to end. The ends of each line are edge points in the original edge list. The points where line segments are joined are called vertices. • A quick revision • Equation of line passing from two points (x1, y1), (x2, y2): • Distance d of edge point (u, v) from the line: • D is the distance between (x1, y1) and (x2, y2).
  • 19. 19 Polyline Representation types • Splitting • Merging • Split and Merge Algorithm • Hop-Along Algorithm
  • 20. 20 Splitting (Top Down) • Algorithm : (1) Take the line segment connecting the end points of the contour (if the contour is closed, consider the line segment connecting the two farthest points) (2) Find the farthest edge point from the line segment (3) If the normalized maximum error of that point from the line segment is above a threshold, split the segment into two segments at that point (i.e., new vertex) (4)Repeat the same procedure for each of the two subsegments until the error is very small.
  • 23. 23 Merging (Bottom Up) • Algorithm : (1) Use the first two edge points to define a line segment. (2) Add a new edge point if it does not deviate too far from the current line segment. (3) Update the parameters of the line segment using least- squares. (4) Start a new line segment when edge points deviate too far from the line segment.
  • 24. 24 Tolerance Band • Algorithm: (1) Two line segments that are parallel to the line segment approximating the edge at a distance ε from the center are computed. (2) Edges are added to the current line segment as long as the new edges are inside the tolerance band. (3) The parameters of the line segment are recomputed as the edges are added to the segment. (4) The vertex at the end of the segment is the starting point for the next segment
  • 26. 26 Split and Merge • The accuracy of line segment approximations can be improved by interleaving merge and split operations. • Algorithm: (1) After recursive subdivision (split), allow adjacent segments to be replaced by a single segment (merge). (2) Alternate applications of split and merge until no segments are merged or split.
  • 28. 28 Hop Along Algorithm 1. Start with the first k edges from the list. 2. Fit a line segment between the first and the last edges in the sub list. 3. If the normalized maximum error is too large, shorten the sub list to the point of maximum error. Return to step 2. 4. If the line fit succeeds, compare the orientation of the current line segment with that of the previous line segment. If the lines have similar orientations, replace the two line segments with a single line segment. 5. Make the current line segment the previous line segment and advance the window of edges so that there are k edges in the sublist. Return to step 2.
  • 29. 29 Circular arcs • Subsequences of the line segments can be replaced by circular arcs if desired. Replacing by arcs involves fitting circular arcs through the end points of two or more line segments, i.e. fitting is done on vertices in the polyline • The circular arc is a fit between the first and last end points and one other point. There can be several methods depending on how the middle point is chosen .
  • 30. 30 Replacing line segments with arcs • Algorithm: 1.Initialize the window of vertices to the 3 end points of the first 2 line segments in the polyline. 2.Compute the ratio of the length of the part of the contour corresponding to the 2 line segments to the distance between the end points. If the ratio is large then leave the first line segment unchanged, advance the window of vertices by one vertex, and repeat this step. 3.Fit a circle through the 3 vertices. 4.Calculate the normalized error and number of sign changes.
  • 31. 31 Contd… 5. If the normalized maximum error is too large or the number of sign changes is too small then leave the first line segment unchanged, advance the window of vertices and return to step 2. 6.If the circle fit succeeds, then try to include the next line segment in the circular arc. Repeat this step until no more line segments can be sub-summed by this circular arc. 7.Advance the window to the next 3 polyline vertices after the end of the circular arc and return to step 2.
  • 32. 32 Error Calculation • To calculate error in fitting a circular arc , define distance of point Q (x1, y1) from the circle along a line passing through the center (x0, y0) • q = The distance from Q to the circular arc is d=q - r 2 01 2 01 )()( yyxx −+−
  • 33. 33 Conic Sections & Cubic Splines • Conic sections correspond to hyperbolas, parabolas, and ellipses (2nd degree polynomials). • Cubic splines correspond to 3rd degree polynomials. • Conic sections and cubic splines allow more complex contours to be represented using fewer segments. • Conic sections can be fit between three vertices in the polyline approximation.
  • 34. 34 Conic section between three points
  • 35. 35 Curve Approximation • Higher accuracy can be obtained by computing an approximation that is not forced to pass through particular edge points. • Approximation based methods use all the edge points to find a good fit (this is contrast to the previous methods that use only the interpolated edge points). • Methods to approximate curves depend on the reliability with which edge points can be grouped into contours. (1) Least-squares regression can be used if it is certain that the edge points grouped together belong to the same contour. (2) Robust regression is more appropriate if there are some grouping errors. (3) If grouping cannot be done easily using edge linking or following methods , then cluster analysis techniques like Hough transform are used
  • 36. 36 Least-squares line fit • Linear regression fits a line to the edge points by minimizing the sum of squares of the perpendicular distances of the edge points from the line being fit. ∑ +−= i ii yxX 22 )cossin( ρθθ
  • 37. 37 Some math…(solution to the regression problem)
  • 38. 38 Limitations • It works well for cases where the noise follows a Gaussian distribution. • It does not work well when there are outliers (edge points incorrectly linked to the contour) in the data (e.g., due to errors in edge linking ).
  • 39. 39 Robust Regression • Outliers can pull the regression line far away from its correct location. • Robust regression methods try various subsets of the data points and choose the subset that provides the best fit.
  • 40. 40 Least - Median Suares Regression • Algorithm: (assume that there are n data points and p parameters in the model) (1) Choose p points at random from the set of n data points. (2) Compute the fit of the model to the p points. (3) Compute the median of the square of the residuals. (4) Repeat until the median squared error is less than some threshold, or take the best median error result after some number of runs. • This algorithm can handle up to 50% outliers in the data set.
  • 41. 41 Hough Transform • Voting mechanism • Each point on the curve votes for several combinations of parameters, the parameters that win a majority of votes are winners • This technique assumes that a primitive edge detection is already performed on an image
  • 42. 42 The technique • Consider the equation of a straight line y= mx +c • Rewriting the equation c= y – mx • Let us assume that m and c are variables of interest and x and y are constants. The above equation represents a line in m-c space. • A point (x,y) corresponds to line in m-c space • If there are n points lying on the straight line (in x-y plane), then these will correspond to a family of lines in parameter space all passing through (m,c). This point gives parameters of original straight line
  • 43. 43 Hough Transform Algorithm 1. Quantize the parameter space appropriately 2. Assume that each cell in the parameter space is an accumulator. Initialize all cells to zero. 3. For each point (x,y) in the image space , increment by 1 each of the accumulators that satisfy the equation 4. Maxima in the accumulator array correspond to the parameters of model instances 5. If the peak in the parameter space covers more than 1 accumulator then the centroid of the region gives an estimate of the parameters
  • 44. 44 A Demonstration • The data is given on the left. The result of the Hough transform is a bright orange box on the right of the figure (the Hough space) which is the result of a large number of counts for that accumulator.
  • 45. 45 Limitations • Size of discrete parameter space increases exponentially as number of parameters increases hence Hough transform may be computationally very inefficient for complex models
  • 46. 46 Fourier Descriptors • Fourier coefficients are used to represent a closed contour since they are periodic. • Boundary of an object is expressed as a sequence of coordinates • We can represent each co ordinate pair as a complex number so that • For a closed curve u(n) is periodic • DFT • IDFT )](),([)( nynxnu = 1,....2,1,0),()()( −=+= Nnnjynxnu ∑ − = ∏ −≤≤= 1 0 /2 10,)()( N k Nknj Nnekanu ∑ − = ∏− −≤≤= 1 0 2 10,)( 1 )( N n N nkj Nnenu N ka
  • 47. 47 Fourier Descriptors (contd..) • The complex coefficients a(k) are called Fourier descriptors (FD) of the boundary • Low resolution approximation • Only first M coefficients are used ∑ − = ∏ −≤≤= 1 0 2 10,)()( M k N knj Nnekanu
  • 48. 48 Summary Contour Representation Using Interpolation Using Edge list Using Curve fitting Using Approximation Using Regression Using Hough Transform Using Fourier Descriptors
  • 49. 49 References • Rafael C. Gonzalez, Digital Image Processing • Ramesh C. Jain, et al., Machine Vision  • Adrian Low, Introductory Computer Vision and Image Processing