Package boofcv.alg.feature.detect.line
Class HoughTransformGradient<D extends ImageGray<D>>
java.lang.Object
boofcv.alg.feature.detect.line.HoughTransformGradient<D>
- Direct Known Subclasses:
HoughTransformGradient_MT
Base class for Hough transforms which use a pixel coordinate and the gradient to describe a line.
[1] Section 9.3 of E.R. Davies, "Machine Vision Theory Algorithms Practicalities," 3rd Ed. 2005
-
Constructor Summary
ConstructorDescriptionHoughTransformGradient
(NonMaxSuppression extractor, HoughTransformParameters parameters, Class<D> derivType) Specifies parameters of transform. -
Method Summary
Modifier and TypeMethodDescriptionprotected final void
addParameters
(ListIntPoint2D candidates, int x, int y, float amount) protected void
Searches for local maximas and converts into lines.float[]
Returns the intensity/edge count for each returned line.Lines after merging/pruning has occurredint
double
double
int
Returns the Hough transform image.protected void
mergeLines
(int width, int height) protected final void
parameterize
(ListIntPoint2D candidates, int x, int y, float derivX, float derivY) Takes the detected point along the line and its gradient and converts it into transform space.void
setMaxLines
(int maxLines) void
setMergeAngle
(double mergeAngle) void
setMergeDistance
(double mergeDistance) void
setRefineRadius
(int radius) <TD extends ImageGray<TD>>
voidComputes the Hough transform using the image gradient and a binary image which flags pixels as being edges or not.
-
Constructor Details
-
HoughTransformGradient
public HoughTransformGradient(NonMaxSuppression extractor, HoughTransformParameters parameters, Class<D> derivType) Specifies parameters of transform.- Parameters:
extractor
- Extracts local maxima from transform space. A set of candidates is provided, but can be ignored.
-
-
Method Details
-
transform
Computes the Hough transform using the image gradient and a binary image which flags pixels as being edges or not.- Parameters:
derivX
- (Input) Image derivative along x-axis.derivY
- (Input) Image derivative along y-axis.binary
- (Input) Non-zero pixels are considered to be line pixels.
-
extractLines
protected void extractLines()Searches for local maximas and converts into lines. -
mergeLines
protected void mergeLines(int width, int height) -
parameterize
protected final void parameterize(ListIntPoint2D candidates, int x, int y, float derivX, float derivY) Takes the detected point along the line and its gradient and converts it into transform space.- Parameters:
x
- point in image.y
- point in image.derivX
- gradient of point.derivY
- gradient of point.
-
addParameters
-
getTransform
Returns the Hough transform image.- Returns:
- Transform image.
-
getLinesAll
-
getFoundIntensity
public float[] getFoundIntensity()Returns the intensity/edge count for each returned line. Useful when doing post processing pruning.- Returns:
- Array containing line intensities.
-
setRefineRadius
public void setRefineRadius(int radius) -
getRefineRadius
public int getRefineRadius() -
getMergeAngle
public double getMergeAngle() -
setMergeAngle
public void setMergeAngle(double mergeAngle) -
getMergeDistance
public double getMergeDistance() -
setMergeDistance
public void setMergeDistance(double mergeDistance) -
getMaxLines
public int getMaxLines() -
setMaxLines
public void setMaxLines(int maxLines) -
getLinesMerged
Lines after merging/pruning has occurred -
getExtractor
-
getRefine
-
getParameters
-