Package boofcv.alg.transform.ii
Class GIntegralImageOps
java.lang.Object
boofcv.alg.transform.ii.GIntegralImageOps
Provides a mechanism to call
IntegralImageOps
with unknown types at compile time.-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic <T extends ImageGray<T>>
doubleblock_unsafe
(T integral, int x0, int y0, int x1, int y1) Computes the value of a block inside an integral image without bounds checking.static <T extends ImageGray<T>>
doubleblock_zero
(T integral, int x0, int y0, int x1, int y1) Computes the value of a block inside an integral image and treats pixels outside of the image as zero.static <T extends ImageGray<T>>
Tconvolve
(T integral, IntegralKernel kernel, T output) General code for convolving a box filter across an image using the integral image.static <T extends ImageGray<T>>
TconvolveBorder
(T integral, IntegralKernel kernel, T output, int borderX, int borderY) Convolves the kernel only across the image's border.static <T extends ImageGray<T>>
doubleconvolveSparse
(T integral, IntegralKernel kernel, int x, int y) Convolves a kernel around a single point in the integral image.getIntegralType
(Class<I> inputType) Given the input image, return the type of image the integral image should be.transform
(I input, T transformed) Converts a regular image into an integral image.
-
Constructor Details
-
GIntegralImageOps
public GIntegralImageOps()
-
-
Method Details
-
getIntegralType
public static <I extends ImageGray<I>,II extends ImageGray<II>> Class<II> getIntegralType(Class<I> inputType) Given the input image, return the type of image the integral image should be. -
transform
public static <I extends ImageGray<I>,T extends ImageGray> T transform(I input, @Nullable T transformed) Converts a regular image into an integral image.- Parameters:
input
- Regular image. Not modified.transformed
- Integral image. If null a new image will be created. Modified.- Returns:
- Integral image.
-
convolve
General code for convolving a box filter across an image using the integral image.- Parameters:
integral
- Integral image.kernel
- Convolution kernel.output
- The convolved image. If null a new image will be declared and returned. Modified.- Returns:
- Convolved image.
-
convolveBorder
public static <T extends ImageGray<T>> T convolveBorder(T integral, IntegralKernel kernel, T output, int borderX, int borderY) Convolves the kernel only across the image's border.- Parameters:
integral
- Integral image. Not modified.kernel
- Convolution kernel.output
- The convolved image. If null a new image will be created. Modified.borderX
- Size of the image border along the horizontal axis.borderY
- size of the image border along the vertical axis.
-
convolveSparse
public static <T extends ImageGray<T>> double convolveSparse(T integral, IntegralKernel kernel, int x, int y) Convolves a kernel around a single point in the integral image.- Parameters:
integral
- Input integral image. Not modified.kernel
- Convolution kernel.x
- Pixel the convolution is performed at.y
- Pixel the convolution is performed at.- Returns:
- Value of the convolution
-
block_zero
public static <T extends ImageGray<T>> double block_zero(T integral, int x0, int y0, int x1, int y1) Computes the value of a block inside an integral image and treats pixels outside of the image as zero. The block is defined as follows: x0 < x ≤ x1 and y0 < y ≤ y1.
- Parameters:
integral
- Integral image.x0
- Lower bound of the block. Exclusive.y0
- Lower bound of the block. Exclusive.x1
- Upper bound of the block. Inclusive.y1
- Upper bound of the block. Inclusive.- Returns:
- Value inside the block.
-
block_unsafe
public static <T extends ImageGray<T>> double block_unsafe(T integral, int x0, int y0, int x1, int y1) Computes the value of a block inside an integral image without bounds checking. The block is defined as follows: x0 < x ≤ x1 and y0 < y ≤ y1.
- Parameters:
integral
- Integral image.x0
- Lower bound of the block. Exclusive.y0
- Lower bound of the block. Exclusive.x1
- Upper bound of the block. Inclusive.y1
- Upper bound of the block. Inclusive.- Returns:
- Value inside the block.
-