Package boofcv.alg.feature.orientation
Class OrientationHistogram<D extends ImageGray<D>>
java.lang.Object
boofcv.alg.feature.orientation.OrientationHistogram<D>
- All Implemented Interfaces:
OrientationGradient<D>
,RegionOrientation
- Direct Known Subclasses:
ImplOrientationHistogram_F32
,ImplOrientationHistogram_S16
,ImplOrientationHistogram_S32
public abstract class OrientationHistogram<D extends ImageGray<D>>
extends Object
implements OrientationGradient<D>
Estimates the orientation by creating a histogram of discrete angles around the entire circle. The angle with the largest sum of edge intensities is considered to be the direction of the region. If weighted a Gaussian kernel centered around the targeted pixel is used.
-
Field Summary
Modifier and TypeFieldDescriptionprotected double
protected double
protected D
protected D
protected boolean
protected int
protected double
protected int
protected ImageRectangle
protected double[]
protected double[]
protected Kernel2D_F32
-
Constructor Summary
ModifierConstructorDescriptionprotected
OrientationHistogram
(double objectToSample, int numAngles, boolean isWeighted) Constructor. -
Method Summary
Modifier and TypeMethodDescriptiondouble
compute
(double X, double Y) Computes the orientation of a region about its center.protected abstract void
Compute the score without using the optional weightsprotected abstract void
computeWeightedScore
(int c_x, int c_y) Compute the score using the weighting kernel.double
void
Specifies input image data for estimating orientation.void
setObjectRadius
(double objectRadius) Specifies the circle's radius that the orientation should bevoid
setObjectToSample
(double objectToSample) Specify the size of the region that is considered.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface boofcv.abst.feature.orientation.OrientationGradient
getImageType
Methods inherited from interface boofcv.abst.feature.orientation.RegionOrientation
copy
-
Field Details
-
objectToSample
protected double objectToSample -
radiusScale
protected int radiusScale -
derivX
-
derivY
-
rect
-
numAngles
protected int numAngles -
sumDerivX
protected double[] sumDerivX -
sumDerivY
protected double[] sumDerivY -
angleDiv
protected double angleDiv -
angleRound
protected double angleRound -
isWeighted
protected boolean isWeighted -
weights
-
-
Constructor Details
-
OrientationHistogram
protected OrientationHistogram(double objectToSample, int numAngles, boolean isWeighted) Constructor. Specify region size and if it is weighted or not.- Parameters:
objectToSample
- Converts the size of the object to the sample region sizenumAngles
- Number of discrete angles that the orientation is estimated inside of
-
-
Method Details
-
getObjectToSample
public double getObjectToSample() -
setObjectToSample
public void setObjectToSample(double objectToSample) Specify the size of the region that is considered. -
getWeights
-
setObjectRadius
public void setObjectRadius(double objectRadius) Description copied from interface:RegionOrientation
Specifies the circle's radius that the orientation should be- Specified by:
setObjectRadius
in interfaceRegionOrientation
- Parameters:
objectRadius
- Object's radius.
-
setImage
Description copied from interface:OrientationGradient
Specifies input image data for estimating orientation.- Specified by:
setImage
in interfaceOrientationGradient<D extends ImageGray<D>>
- Parameters:
derivX
- Image derivative along x-axis.derivY
- Image derivative along y-axis.
-
compute
public double compute(double X, double Y) Description copied from interface:RegionOrientation
Computes the orientation of a region about its center.- Specified by:
compute
in interfaceRegionOrientation
- Parameters:
X
- Center of the region in image pixels.Y
- Center of the region in image pixels.- Returns:
- Orientation in radians. Angle zero points along x-axis and pi/2 along y-axis.
-
computeUnweightedScore
protected abstract void computeUnweightedScore()Compute the score without using the optional weights -
computeWeightedScore
protected abstract void computeWeightedScore(int c_x, int c_y) Compute the score using the weighting kernel.
-