T
- the data type of the input image.public class HoughTransforms<T extends RealType<T> & Comparable<T>> extends Object
Modifier and Type | Field and Description |
---|---|
static int |
DEFAULT_THETA |
Constructor and Description |
---|
HoughTransforms() |
Modifier and Type | Method and Description |
---|---|
static double |
getIntercept(long rho,
long theta)
Method used to convert the {rho, theta} output of the
voteLines(net.imglib2.RandomAccessibleInterval<T>, net.imglib2.RandomAccessibleInterval<U>) algorithm into a more useful
y-intercept value. |
static double |
getSlope(long theta)
Method used to convert the {rho, theta} output of the
voteLines(net.imglib2.RandomAccessibleInterval<T>, net.imglib2.RandomAccessibleInterval<U>) algorithm into a more useful slope
value. |
static long[] |
getVotespaceSize(Dimensions dimensions)
Returns the size of the vote space output image given an input
RandomAccessibleInterval . |
static long[] |
getVotespaceSize(Dimensions dimensions,
int nTheta)
Returns the size of the vote space output image given an input
RandomAccessibleInterval . |
static long[] |
getVotespaceSize(int nRho,
int nTheta)
Returns the size of the voteSpace output image given desired
nRho
and nTheta values. |
static <T extends IntegerType<T>> |
pickLinePeaks(RandomAccessibleInterval<T> voteSpace,
long threshold)
Pick vote space peaks with a
LocalExtrema . |
static <T extends Comparable<T>> |
pickLinePeaks(RandomAccessibleInterval<T> voteSpace,
T minPeak)
Pick vote space peaks with a
LocalExtrema . |
static <T extends Comparable<T>,U extends IntegerType<U>> |
voteLines(RandomAccessibleInterval<T> input,
RandomAccessibleInterval<U> votespace)
Runs a Hough Line Tranform on an image and populates the vote space
parameter with the results.
|
static <T extends Comparable<T>,U extends IntegerType<U>> |
voteLines(RandomAccessibleInterval<T> input,
RandomAccessibleInterval<U> votespace,
int nTheta)
Runs a Hough Line Tranform on an image and populates the vote space
parameter with the results.
|
static <T extends Comparable<T>,U extends IntegerType<U>> |
voteLines(RandomAccessibleInterval<T> input,
RandomAccessibleInterval<U> votespace,
int nTheta,
int nRho)
Runs a Hough Line Tranform on an image and populates the vote space
parameter with the results.
|
static <T,U extends IntegerType<U>> |
voteLines(RandomAccessibleInterval<T> input,
RandomAccessibleInterval<U> votespace,
int nTheta,
int nRho,
Predicate<T> filter)
Runs a Hough Line Tranform on an image and populates the vote space
parameter with the results.
|
static <T extends Comparable<T>,U extends IntegerType<U>> |
voteLines(RandomAccessibleInterval<T> input,
RandomAccessibleInterval<U> votespace,
int nTheta,
int nRho,
T threshold)
Runs a Hough Line Tranform on an image and populates the vote space
parameter with the results.
|
public static final int DEFAULT_THETA
public static long[] getVotespaceSize(Dimensions dimensions)
RandomAccessibleInterval
.dimensions
- - the Dimensions
over which the Hough Line Transform
will be runlong[]
- the dimensions of the vote space imagepublic static long[] getVotespaceSize(Dimensions dimensions, int nTheta)
RandomAccessibleInterval
.dimensions
- - the Dimensions
over which the Hough Line Transform
will be runnTheta
- - the number of theta bins.long[]
- the dimensions of the vote space imagepublic static long[] getVotespaceSize(int nRho, int nTheta)
nRho
and nTheta
values.nRho
- - the number of bins for rho resolutionnTheta
- - the number of bins for theta resolutionlong[]
- the dimensions of the vote space image.public static <T extends IntegerType<T>> List<Point> pickLinePeaks(RandomAccessibleInterval<T> voteSpace, long threshold)
LocalExtrema
.voteSpace
- - the RandomAccessibleInterval
containing the output
of a Hough Transform votethreshold
- - the IntegerType
at and below which maxima will be
ignoredList<Point>
- a list of all of the local maxima of the
voteSpace
public static <T extends Comparable<T>> List<Point> pickLinePeaks(RandomAccessibleInterval<T> voteSpace, T minPeak)
LocalExtrema
.voteSpace
- - the RandomAccessibleInterval
containing the output
of a Hough Transform voteminPeak
- - the Comparable
at and below which maxima will be
ignoredList<Point>
- a list of all of the local maxima of the
voteSpace
.public static <T extends Comparable<T>,U extends IntegerType<U>> void voteLines(RandomAccessibleInterval<T> input, RandomAccessibleInterval<U> votespace)
input
- - the RandomAccessibleInterval
to run the Hough Line
Transform overvotespace
- - the RandomAccessibleInterval
in which the results
are storedpublic static <T extends Comparable<T>,U extends IntegerType<U>> void voteLines(RandomAccessibleInterval<T> input, RandomAccessibleInterval<U> votespace, int nTheta)
input
- - the RandomAccessibleInterval
to run the Hough Line
Transform overvotespace
- - the RandomAccessibleInterval
in which the results
are storednTheta
- - the number of bins for theta resolutionpublic static <T extends Comparable<T>,U extends IntegerType<U>> void voteLines(RandomAccessibleInterval<T> input, RandomAccessibleInterval<U> votespace, int nTheta, int nRho)
input
- - the RandomAccessibleInterval
to run the Hough Line
Transform overvotespace
- - the RandomAccessibleInterval
in which the results
are storednTheta
- - the number of bins for theta resolutionnRho
- - the number of bins for rho resolutionpublic static <T extends Comparable<T>,U extends IntegerType<U>> void voteLines(RandomAccessibleInterval<T> input, RandomAccessibleInterval<U> votespace, int nTheta, int nRho, T threshold)
input
- - the RandomAccessibleInterval
to run the Hough Line
Transform overvotespace
- - the RandomAccessibleInterval
in which the results
are storednTheta
- - the number of bins for theta resolutionnRho
- - the number of bins for rho resolutionthreshold
- - the minimum value allowed by the populator. Any input less
than this value will be disregarded by the populator.public static <T,U extends IntegerType<U>> void voteLines(RandomAccessibleInterval<T> input, RandomAccessibleInterval<U> votespace, int nTheta, int nRho, Predicate<T> filter)
Vote space here has two dimensions: rho
and theta
.
theta
is measured in radians [-pi/2 pi/2)
, rho
is
measured in [-rhoMax, rhoMax)
.
Lines are modeled as
l(t) = | x | = rho * | cos(theta) | + t * | sin(theta) | | y | | -sin(theta) | | cos(theta) |
In other words, rho
represents the signed minimum distance from
the image origin to the line, and theta
indicates the angle
between the row-axis and the minimum offset vector.
For a given point, then, votes are placed along the curve
rho = y * sin( theta ) + x * cos( theta )
It is important to note that the interval of the first dimension of the
vote space image is NOT [-maxRho, maxRho)
but instead
[0, maxRho * 2)
; the same applies to the second dimension of the
vote space as well. Thus if pickLinePeaks(net.imglib2.RandomAccessibleInterval<T>, long)
is not
used to retrieve the maxima from the vote space, the vote space will have
to be translated by -maxRho
in dimension 0 to get the correct
rho
and theta
values from the vote space.
input
- - the RandomAccessibleInterval
to run the Hough Line
Transform overvotespace
- - the RandomAccessibleInterval
in which the results
are storednTheta
- - the number of bins for theta resolutionnRho
- - the number of bins for rho resolutionfilter
- - a Predicate
judging whether or not the a value is
above the minimum value allowed by the populator. Any input
less than or equal to this value will be disregarded by the
populator.public static double getIntercept(long rho, long theta)
voteLines(net.imglib2.RandomAccessibleInterval<T>, net.imglib2.RandomAccessibleInterval<U>)
algorithm into a more useful
y-intercept value. Used with getSlope(long)
to create
line equations.rho
- - the rho
of the linetheta
- - the theta
of the linedouble
- the y-intercept of the linepublic static double getSlope(long theta)
voteLines(net.imglib2.RandomAccessibleInterval<T>, net.imglib2.RandomAccessibleInterval<U>)
algorithm into a more useful slope
value. Used with getIntercept(long, long)
to create line
equations.theta
- - the theta
of the linedouble
- the y-intercept of the lineCopyright © 2015–2022 ImgLib2. All rights reserved.