java.lang.Object
imagingbook.common.geometry.line.AlgebraicLine
imagingbook.common.geometry.line.HessianLine
imagingbook.common.hough.HoughLine
- All Implemented Interfaces:
Primitive2d,ShapeProducer,Comparable<HoughLine>
This class represents a straight line of the form (x - xRef) * cos(angle) + (y - yRef) * sin(angle) = radius. It is
used by the Hough transform (see HoughTransformLines). It inherits from
HessianLine which is, in turn, a subclass of AlgebraicLine. It adds an arbitrary reference point
(xRef, yRef) and a counter (count) for pixel votes. Instances are immutable. See Sec. 12.2 of [1] for additional
details.
[1] W. Burger, M.J. Burge, Digital Image Processing – An Algorithmic Introduction, 3rd ed, Springer (2022).
- Version:
- 2022/08/24
-
Field Summary
Fields inherited from class imagingbook.common.geometry.line.AlgebraicLine
A, B, C -
Constructor Summary
ConstructorsConstructorDescriptionHoughLine(double angle, double radius, double xRef, double yRef, int count) Constructor, creates a newHoughLineinstance from the specifiedHessianLineparameters (angle, radius), an arbitrary reference point (xRef, yRef) and count.HoughLine(AlgebraicLine line) Convenience constructor, creates a newHoughLineinstance from a givenAlgebraicLine(or any subclass) instance with the same reference point as the original line and zero count.HoughLine(AlgebraicLine line, double xRef, double yRef, int count) Constructor, creates a newHoughLineinstance from a givenAlgebraicLine(or any subclass) instance. -
Method Summary
Modifier and TypeMethodDescriptionintRequired by theComparableinterface, used for sorting lines by their point count (in descending order, i.e., strong lines come first).static HoughLineintgetCount()doublegetXref()Returns the x-coordinate of the reference point.doublegetYref()Returns the y-coordinate of the reference point.toString()Methods inherited from class imagingbook.common.geometry.line.HessianLine
from, getAngle, getRadiusMethods inherited from class imagingbook.common.geometry.line.AlgebraicLine
equals, equals, from, from, from, getClosestLinePoint, getDistance, getDistance, getParameters, getShape, getShape, getSignedDistance, getSignedDistance, getSquareError, intersectMethods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface imagingbook.common.geometry.shape.ShapeProducer
getShape, getShapes, getShapes
-
Constructor Details
-
HoughLine
Constructor, creates a newHoughLineinstance from the specifiedHessianLineparameters (angle, radius), an arbitrary reference point (xRef, yRef) and count.- Parameters:
angle- the line's normal angle (seeHessianLine)radius- the line's radius (distance to reference point)xRef- reference point x-coordinateyRef- reference point y-coordinatecount- pixel votes for this line
-
HoughLine
Constructor, creates a newHoughLineinstance from a givenAlgebraicLine(or any subclass) instance. The line parameters are adjusted to the specified reference point (actually only parameter c is modified, since a change of reference point effects only a shift of the line). The two lines are equivalent, i.e., contain the same points (x,y). Thus the distance from a given point (x,y) is the same from the original line and the new line.- Parameters:
line- an existing line (AlgebraicLineor subclass)xRef- reference point x-coordinateyRef- reference point y-coordinatecount- pixel votes for this line
-
HoughLine
Convenience constructor, creates a newHoughLineinstance from a givenAlgebraicLine(or any subclass) instance with the same reference point as the original line and zero count.- Parameters:
line- aAlgebraicLineinstance
-
-
Method Details
-
from
-
getXref
Description copied from class:AlgebraicLineReturns the x-coordinate of the reference point. For aAlgebraicLine, the result is always zero. Inheriting classes (likeHoughLine) override this method.- Overrides:
getXrefin classAlgebraicLine- Returns:
- the x-coordinate reference
-
getYref
Description copied from class:AlgebraicLineReturns the y-coordinate of the reference point. For aAlgebraicLine, the result is always zero. Inheriting classes (likeHoughLine) override this method.- Overrides:
getYrefin classAlgebraicLine- Returns:
- the y-coordinate reference
-
getCount
-
compareTo
Required by theComparableinterface, used for sorting lines by their point count (in descending order, i.e., strong lines come first).- Specified by:
compareToin interfaceComparable<HoughLine>- Parameters:
other- anotherHoughLineinstance.
-
toString
- Overrides:
toStringin classHessianLine
-