public abstract class OrientationSlidingWindow<D extends boofcv.struct.image.ImageSingleBand> 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 int |
radius |
protected int |
radiusScale |
protected boofcv.struct.ImageRectangle |
rect |
protected boofcv.struct.convolve.Kernel2D_F32 |
weights |
protected double |
windowSize |
| Constructor and Description |
|---|
OrientationSlidingWindow(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.
|
int |
getRadius() |
boofcv.struct.convolve.Kernel2D_F32 |
getWeights() |
void |
setImage(D derivX,
D derivY)
Specifies input image data for estimating orientation.
|
void |
setRadius(int radius)
Specify the size of the region that is considered.
|
void |
setScale(double scale)
Specifies scale at which the orientation is estimated.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetImageTypeprotected int radius
protected int radiusScale
protected D extends boofcv.struct.image.ImageSingleBand derivX
protected D extends boofcv.struct.image.ImageSingleBand 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(int numAngles,
double windowSize,
boolean isWeighted)
numAngles - 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 int getRadius()
public void setRadius(int radius)
radius - public boofcv.struct.convolve.Kernel2D_F32 getWeights()
public void setScale(double scale)
RegionOrientationsetScale in interface RegionOrientationscale - Scale of the orientation region.public void setImage(D derivX, D derivY)
OrientationGradientsetImage in interface OrientationGradient<D extends boofcv.struct.image.ImageSingleBand>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)