Package boofcv.alg.weights
Class WeightPixelKernel_F32
java.lang.Object
boofcv.alg.weights.WeightPixelKernel_F32
- All Implemented Interfaces:
WeightPixel_F32
- Direct Known Subclasses:
WeightPixelGaussian_F32
Weight which uses the values contained in a
Kernel2D_F32
. For performance reasons no checks are
done to see if a request has been made outside the kernel's radius. Those values should be zero.-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionint
Returns the kernel's radius along the x-axisint
Returns the kernel's radius along the y-axisfloat
weight
(int x, int y) Access the weight using coordinates.float
weightIndex
(int index) Faster way to access the weight.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface boofcv.alg.weights.WeightPixel_F32
isOdd, setRadius
-
Field Details
-
kernel
-
-
Constructor Details
-
WeightPixelKernel_F32
public WeightPixelKernel_F32()
-
-
Method Details
-
weightIndex
public float weightIndex(int index) Description copied from interface:WeightPixel_F32
Faster way to access the weight. Refers to the index in a row major matrix.
x = (index % widthX) - radiusX
y = (index / widthX) - radiusY
- Specified by:
weightIndex
in interfaceWeightPixel_F32
- Parameters:
index
- index of grid element- Returns:
- the weight
-
weight
public float weight(int x, int y) Description copied from interface:WeightPixel_F32
Access the weight using coordinates.- Specified by:
weight
in interfaceWeightPixel_F32
- Parameters:
x
- x-coordinate: range = -radius to radius, inclusivey
- y-coordinate: range = -radius to radius, inclusive- Returns:
- the weight
-
getRadiusX
public int getRadiusX()Description copied from interface:WeightPixel_F32
Returns the kernel's radius along the x-axis- Specified by:
getRadiusX
in interfaceWeightPixel_F32
- Returns:
- Radius of kernel
-
getRadiusY
public int getRadiusY()Description copied from interface:WeightPixel_F32
Returns the kernel's radius along the y-axis- Specified by:
getRadiusY
in interfaceWeightPixel_F32
- Returns:
- Radius of kernel
-