Package boofcv.alg.transform.pyramid
Class PyramidOps
java.lang.Object
boofcv.alg.transform.pyramid.PyramidOps
Various operations related to image pyramids.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic <O extends ImageGray<O>>
O[]declareOutput
(ImagePyramid<?> pyramid, ImageType<O> outputType) Creates an array of single band images for each layer in the provided pyramid.filter
(ImagePyramid<I> input, FilterImageInterface<I, O> filter, O[] output) Runs an image filter through each layer in the pyramid.gradient
(ImagePyramid<I> input, ImageGradient<I, O> gradient, O[] derivX, O[] derivY) Computes the gradient for each image the pyramid.hessian
(O[] derivX, O[] derivY, ImageHessian<O> hessian, O[] derivXX, O[] derivYY, O[] derivXY) Computes the hessian (2nd order derivative) for each image the pyramid.static <O extends ImageGray<O>>
voidreshapeOutput
(ImagePyramid<?> pyramid, O[] output) Reshapes each image in the array to match the layers in the pyramidstatic <T extends ImageGray<T>>
voidscaleDown2
(T input, T output) Scales down the input by a factor of 2.static <T extends ImageGray<T>>
voidscaleImageUp
(T input, T output, int scale, InterpolatePixelS<T> interp) Scales an image up using interpolation
-
Constructor Details
-
PyramidOps
public PyramidOps()
-
-
Method Details
-
declareOutput
public static <O extends ImageGray<O>> O[] declareOutput(ImagePyramid<?> pyramid, ImageType<O> outputType) Creates an array of single band images for each layer in the provided pyramid. Each image will be the same size as the corresponding layer in the pyramid.- Type Parameters:
O
- Output image type- Parameters:
pyramid
- (Input) Image pyramidoutputType
- (Input) Output image type- Returns:
- An array of images
-
reshapeOutput
Reshapes each image in the array to match the layers in the pyramid- Type Parameters:
O
- Image type- Parameters:
pyramid
- (Input) Image pyramidoutput
- (Output) List of images which is to be resized
-
filter
public static <I extends ImageGray<I>,O extends ImageGray<O>> void filter(ImagePyramid<I> input, FilterImageInterface<I, O> filter, O[] output) Runs an image filter through each layer in the pyramid.
It is assumed that the output has the same scales as the input. If not initialized then it will be initialized. If already initialized it is assumed to be setup for the same input image size.
- Parameters:
input
- Input pyramid.filter
- Filter being applied to the pyramid.output
- Output pyramid where filter results are saved.
-
gradient
public static <I extends ImageGray<I>,O extends ImageGray<O>> void gradient(ImagePyramid<I> input, ImageGradient<I, O> gradient, O[] derivX, O[] derivY) Computes the gradient for each image the pyramid.
It is assumed that the gradient has the same scales as the input. If not initialized then it will be initialized. If already initialized it is assumed to be setup for the same input image size.
- Parameters:
input
- Input pyramid.gradient
- Computes image gradientderivX
- Pyramid where x-derivative is stored.derivY
- Pyramid where y-derivative is stored.
-
hessian
public static <I extends ImageGray<I>,O extends ImageGray<O>> void hessian(O[] derivX, O[] derivY, ImageHessian<O> hessian, O[] derivXX, O[] derivYY, O[] derivXY) Computes the hessian (2nd order derivative) for each image the pyramid.
- Parameters:
derivX
- (Input) Pyramid where x-derivative is stored.derivY
- (Input) Pyramid where y-derivative is stored.hessian
- (Input) Computes hessian from gradientderivXX
- (Output) Second derivative XXderivYY
- (Output) Second derivative YYderivXY
- (Output) Second derivative XY
-
scaleDown2
Scales down the input by a factor of 2. Every other pixel along both axises is skipped. -
scaleImageUp
public static <T extends ImageGray<T>> void scaleImageUp(T input, T output, int scale, InterpolatePixelS<T> interp) Scales an image up using interpolation- Parameters:
scale
- How much larger the output image will be.
-