public class HoughLineTransform<S extends RealType<S>,T extends Type<T> & Comparable<T>> extends HoughTransform<S,T>
HoughTransform
to handle Hough Line voting over an edge map.
This implementation uses a threshold to determine whether a pixel at a certain point is
an edge or not. Comparison is strictly-greater-than. This implementation is fairly dumb
in that it does not take gradients into account. The threshold used is the default value
returned by calling the constructor for the Type
of the input Image
.
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)Modifier and Type | Field and Description |
---|---|
static int |
DEFAULT_THETA |
double |
dRho |
double |
dTheta |
pTime
Constructor and Description |
---|
HoughLineTransform(Image<T> inputImage,
ImageFactory<S> factory,
int inNRho,
int inNTheta)
Create a
HoughLineTransform to operate against a given Image , with
a specific ImageFactory for the vote space, and
specific rho- and theta-resolution. |
HoughLineTransform(Image<T> inputImage,
int inNRho,
int inNTheta,
S type)
Create a
HoughLineTransform to operate against a given Image , with
a specific Type of vote space and rho- and theta-resolution. |
HoughLineTransform(Image<T> inputImage,
int theta,
S type)
Create a
HoughLineTransform to operate against a given Image , with
a specific Type of vote space and theta-resolution. |
HoughLineTransform(Image<T> inputImage,
S type)
|
Modifier and Type | Method and Description |
---|---|
static int |
defaultRho(Image<?> inputImage)
Calculates a default number of rho bins, which corresponds to a resolution of one pixel.
|
ArrayList<double[]> |
getTranslatedPeakList() |
static <T extends Type<T> & Comparable<T>> |
integerHoughLine(Image<T> inputImage)
Creates a default
HoughLineTransform with vote space. |
static <T extends Type<T> & Comparable<T>> |
longHoughLine(Image<T> inputImage)
Creates a default
HoughLineTransform with LongType vote space. |
boolean |
process() |
void |
setThreshold(T inThreshold) |
static <T extends Type<T> & Comparable<T>> |
shortHoughLine(Image<T> inputImage)
Creates a default
HoughLineTransform with vote space. |
checkInput, getErrorMessage, getImage, getPeakList, getProcessingTime, getResult, pickPeaks, placeVote, placeVote, setErrorMsg, setExclusion
public static final int DEFAULT_THETA
public final double dTheta
public final double dRho
public HoughLineTransform(Image<T> inputImage, S type)
HoughLineTransform
to operate against a given Image
, with
a specific Type
of vote space.
Defaults are used for rho- and theta-resolution.public HoughLineTransform(Image<T> inputImage, int theta, S type)
HoughLineTransform
to operate against a given Image
, with
a specific Type
of vote space and theta-resolution.
Rho-resolution is set to the default.public HoughLineTransform(Image<T> inputImage, int inNRho, int inNTheta, S type)
HoughLineTransform
to operate against a given Image
, with
a specific Type
of vote space and rho- and theta-resolution.public HoughLineTransform(Image<T> inputImage, ImageFactory<S> factory, int inNRho, int inNTheta)
HoughLineTransform
to operate against a given Image
, with
a specific ImageFactory
for the vote space, and
specific rho- and theta-resolution.public static int defaultRho(Image<?> inputImage)
inputImage
- the Image
in question.public static <T extends Type<T> & Comparable<T>> HoughLineTransform<ShortType,T> shortHoughLine(Image<T> inputImage)
HoughLineTransform
with vote space.T
- the Type
of the Image
in question.inputImage
- the Image
to perform the Hough Line Transform against.HoughLineTransform
with IntType
vote space.public static <T extends Type<T> & Comparable<T>> HoughLineTransform<IntType,T> integerHoughLine(Image<T> inputImage)
HoughLineTransform
with vote space.T
- the Type
of the Image
in question.inputImage
- the Image
to perform the Hough Line Transform against.HoughLineTransform
with IntType
vote space.public static <T extends Type<T> & Comparable<T>> HoughLineTransform<LongType,T> longHoughLine(Image<T> inputImage)
HoughLineTransform
with LongType
vote space.T
- the Type
of the Image
in question.inputImage
- the Image
to perform the Hough Line Transform against.HoughLineTransform
with LongType
vote space.
Use this for voting against large images, but reasonably small vote space. If you need a big
voting space, it would be better to create a HoughLineTransform
instantiated with an
ImageFactory
capable of handling it.public void setThreshold(T inThreshold)
public boolean process()
public ArrayList<double[]> getTranslatedPeakList()
Copyright © 2015–2021 Fiji. All rights reserved.