M-File Help: LineFeature | View code for LineFeature |
Line feature class
This class represents a line feature.
plot | Plot the line segment |
seglength | Determine length of line segment |
display | Display value |
char | Convert value to string |
rho | Offset of the line |
theta | Orientation of the line |
strength | Feature strength |
length | Length of the line |
Properties of a vector of LineFeature objects are returned as a vector. If L is a vector (Nx1) of LineFeature objects then L.rho is an Nx1 vector of the rho element of each feature.
Hough, RegionFeature, PointFeature
Create a line feature object
L = LineFeature() is a line feature object with null parameters.
L = LineFeature(rho, theta, strength) is a line feature object with the specified properties. LENGTH is undefined.
L = LineFeature(rho, theta, strength, length) is a line feature object with the specified properties.
L = LineFeature(l2) is a deep copy of the line feature l2.
Convert to string
s = L.char() is a compact string representation of the line feature. If L is a vector then the string has multiple lines, one per element.
Display value
L.display() displays a compact human-readable representation of the feature. If L is a vector then the elements are printed one per line.
Plot line
L.plot() overlay the line on current plot.
L.plot(ls) as above but the optional line style arguments ls are passed to plot.
Return points on line segments
p = L.points(edge) is the set of points that lie along the line in the edge image edge are determined.
Compute length of line segments
The Hough transform identifies lines but cannot determine their length. This method examines the edge pixels in the original image and determines the longest stretch of non-zero pixels along the line.
l2 = L.seglength(edge, gap) is a copy of the line feature object with the property length updated to the length of the line (pixels). Small gaps, less than gap pixels are tolerated.
l2 = L.seglength(edge) as above but the maximum allowable gap is 5 pixels.
© 1990-2012 Peter Corke.