public abstract class OrientationSlidingWindow<D extends boofcv.struct.image.ImageGray> extends java.lang.Object implements OrientationGradient<D>
Estimates the orientation by sliding window across all angles. All pixels which are pointing at an angle inside of this window have their gradient summed. The window with the largest normal is selected as the best window. The angle is then computed from the best window using atan2() and the summed gradient.
NOTE: There are probably additional performance enhancements that could be done.
| Modifier and Type | Field and Description |
|---|---|
protected double[] |
angles |
protected D |
derivX |
protected D |
derivY |
protected boolean |
isWeighted |
protected int |
numAngles |
protected double |
objectRadiusToScale |
protected int |
pixelRadius |
protected boofcv.struct.ImageRectangle |
rect |
protected boofcv.struct.convolve.Kernel2D_F32 |
weights |
protected double |
windowSize |
| Constructor and Description |
|---|
OrientationSlidingWindow(double objectRadiusToScale,
int numAngles,
double windowSize,
boolean isWeighted)
Configures orientation estimating algorithm.
|
| Modifier and Type | Method and Description |
|---|---|
double |
compute(double X,
double Y)
Computes the orientation of a region about its center.
|
protected abstract double |
computeOrientation()
Compute the angle without using the optional weights
|
protected abstract double |
computeWeightedOrientation(int c_x,
int c_y)
Compute the angle using the weighting kernel.
|
boofcv.struct.convolve.Kernel2D_F32 |
getWeights() |
void |
setImage(D derivX,
D derivY)
Specifies input image data for estimating orientation.
|
void |
setObjectRadius(double objRadius)
Specifies the circle's radius that the orientation should be
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetImageTypeprotected int pixelRadius
protected double objectRadiusToScale
protected D extends boofcv.struct.image.ImageGray derivX
protected D extends boofcv.struct.image.ImageGray derivY
protected boofcv.struct.ImageRectangle rect
protected int numAngles
protected double windowSize
protected double[] angles
protected boolean isWeighted
protected boofcv.struct.convolve.Kernel2D_F32 weights
public OrientationSlidingWindow(double objectRadiusToScale,
int numAngles,
double windowSize,
boolean isWeighted)
objectRadiusToScale - Convert object radius into scale factornumAngles - Number of discrete points in which the sliding window will be centered around.windowSize - Number of radians in the window being considered.isWeighted - Should points be weighted using a Gaussian kernel.public boofcv.struct.convolve.Kernel2D_F32 getWeights()
public void setObjectRadius(double objRadius)
RegionOrientationsetObjectRadius in interface RegionOrientationobjRadius - Object's radius.public void setImage(D derivX, D derivY)
OrientationGradientsetImage in interface OrientationGradient<D extends boofcv.struct.image.ImageGray>derivX - Image derivative along x-axis.derivY - Image derivative along y-axis.public double compute(double X,
double Y)
RegionOrientationcompute in interface RegionOrientationX - Center of the region in image pixels.Y - Center of the region in image pixels.protected abstract double computeOrientation()
protected abstract double computeWeightedOrientation(int c_x,
int c_y)