boofcv.alg.weights
Interface WeightPixel_F32
-
- All Known Implementing Classes:
- WeightPixelGaussian_F32, WeightPixelKernel_F32, WeightPixelUniform_F32
public interface WeightPixel_F32Used to get the weight for a pixel from a kernel in 2D space. The kernel is assumed to be centered around 0 and has the specified radius. The kernel has a width of radius*2 + 1. The information stored inside this interface could be represented as a 2D array, but the interface allows a simple return to be used if the value is constant.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method and Description intgetRadiusX()Returns the kernel's radius along the x-axisintgetRadiusY()Returns the kernel's radius along the y-axisvoidsetRadius(int radiusX, int radiusY)Change the kernel's sizefloatweight(int x, int y)Access the weight using coordinates.floatweightIndex(int index)Faster way to access the weight.
-
-
-
Method Detail
-
weightIndex
float weightIndex(int index)
Faster way to access the weight. Refers to the index in a row major matrix.
x = (index % widthX) - radiusX
y = (index / widthX) - radiusY
- Parameters:
index- index of grid element- Returns:
- the weight
-
weight
float weight(int x, int y)Access the weight using coordinates.- Parameters:
x- x-coordinate: range = -radius to radius, inclusivey- y-coordinate: range = -radius to radius, inclusive- Returns:
- the weight
-
setRadius
void setRadius(int radiusX, int radiusY)Change the kernel's size- Parameters:
radiusX- Radius along x-axisradiusY- Radius along y-axis
-
getRadiusX
int getRadiusX()
Returns the kernel's radius along the x-axis- Returns:
- Radius of kernel
-
getRadiusY
int getRadiusY()
Returns the kernel's radius along the y-axis- Returns:
- Radius of kernel
-
-
DataMelt 3.0 © DataMelt by jWork.ORG