Package boofcv.alg.filter.blur
Class GBlurImageOps
java.lang.Object
boofcv.alg.filter.blur.GBlurImageOps
Generalized functions for applying different image blur operators. Invokes functions
from
BlurImageOps
, which provides type specific functions.-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic <T extends ImageBase<T>>
Tgaussian
(T input, T output, double sigmaX, int radiusX, double sigmaY, int radiusY, @Nullable ImageBase storage) Applies Gaussian blur to aImageGray
static <T extends ImageBase<T>>
TApplies Gaussian blur to aImageGray
static <T extends ImageBase<T>>
Tmean
(T input, T output, int radiusX, int radiusY, @Nullable ImageBase storage, @Nullable GrowArray workVert) Applies a mean box filter with re-weighted borders.static <T extends ImageBase<T>>
TApplies a mean box filter.static <T extends ImageBase<T>>
TmeanAdaptive
(T input, T output, int radiusX, int radiusY, double noiseVariance) Adaptive applies mean blur filter while maintaining edge sharpness with re-weighted image borders.static <T extends ImageBase<T>>
TmeanB
(T input, T output, int radiusX, int radiusY, @Nullable ImageBorder<T> border, @Nullable ImageBase storage, @Nullable GrowArray workVert) Applies a mean box filter with borders.static <T extends ImageBase<T>>
TmeanGeometric
(T input, T output, int radiusX, int radiusY) Applies a geometric mean box filter with re-weighted image borders.static <T extends ImageBase<T>>
TApplies a median filter.static <T extends ImageBase<T>>
TApplies a median filter.
-
Constructor Details
-
GBlurImageOps
public GBlurImageOps()
-
-
Method Details
-
mean
public static <T extends ImageBase<T>> T mean(T input, @Nullable T output, int radius, @Nullable @Nullable ImageBase storage, @Nullable @Nullable GrowArray workVert) Applies a mean box filter.- Type Parameters:
T
- Input image type.- Parameters:
input
- Input image. Not modified.output
- (Optional) Storage for output image, Can be null. Modified.radius
- Radius of the box blur function.storage
- (Optional) Storage for intermediate results. Same size as input image. Can be null.- Returns:
- Output blurred image.
-
mean
public static <T extends ImageBase<T>> T mean(T input, @Nullable T output, int radiusX, int radiusY, @Nullable @Nullable ImageBase storage, @Nullable @Nullable GrowArray workVert) Applies a mean box filter with re-weighted borders.- Type Parameters:
T
- Input image type.- Parameters:
input
- Input image. Not modified.output
- (Optional) Storage for output image, Can be null. Modified.radiusX
- Radius of the box blur function along the x-axisradiusY
- Radius of the box blur function along the y-axis.storage
- (Optional) Storage for intermediate results. Same size as input image. Can be null.- Returns:
- Output blurred image.
-
meanB
public static <T extends ImageBase<T>> T meanB(T input, @Nullable T output, int radiusX, int radiusY, @Nullable @Nullable ImageBorder<T> border, @Nullable @Nullable ImageBase storage, @Nullable @Nullable GrowArray workVert) Applies a mean box filter with borders.- Type Parameters:
T
- Input image type.- Parameters:
input
- Input image. Not modified.output
- (Optional) Storage for output image, Can be null. Modified.radiusX
- Radius of the box blur function along the x-axisradiusY
- Radius of the box blur function along the y-axisborder
- (Optional) Specified how the image borders are handled. If null then only the inner portion is processed.storage
- (Optional) Storage for intermediate results. Same size as input image. Can be null.- Returns:
- Output blurred image.
-
meanGeometric
public static <T extends ImageBase<T>> T meanGeometric(T input, @Nullable T output, int radiusX, int radiusY) Applies a geometric mean box filter with re-weighted image borders.- Type Parameters:
T
- Input image type.- Parameters:
input
- Input image. Not modified.output
- (Optional) Storage for output image, Can be null. Modified.radiusX
- Radius of the box blur function along the x-axisradiusY
- Radius of the box blur function along the y-axis.- Returns:
- Output blurred image.
-
meanAdaptive
public static <T extends ImageBase<T>> T meanAdaptive(T input, @Nullable T output, int radiusX, int radiusY, double noiseVariance) Adaptive applies mean blur filter while maintaining edge sharpness with re-weighted image borders.- Type Parameters:
T
- Input image type.- Parameters:
input
- Input image. Not modified.output
- (Optional) Storage for output image, Can be null. Modified.radiusX
- Radius of the box blur function along the x-axisradiusY
- Radius of the box blur function along the y-axis.noiseVariance
- Amount of additive pixel noise- Returns:
- Output blurred image.
-
median
public static <T extends ImageBase<T>> T median(T input, @Nullable T output, int radius, @Nullable @Nullable GrowArray<?> work) Applies a median filter.- Type Parameters:
T
- Input image type.- Parameters:
input
- Input image. Not modified.output
- (Optional) Storage for output image, Can be null. Modified.radius
- Size of the filter region.work
- (Optional) Creates local workspace arrays. Nullable.- Returns:
- Output blurred image.
-
median
public static <T extends ImageBase<T>> T median(T input, @Nullable T output, int radiusX, int radiusY, @Nullable @Nullable GrowArray<?> work) Applies a median filter.- Type Parameters:
T
- Input image type.- Parameters:
input
- Input image. Not modified.output
- (Optional) Storage for output image, Can be null. Modified.radiusX
- Size of the filter region. x-axisradiusY
- Size of the filter region. Y-axiswork
- (Optional) Creates local workspace arrays. Nullable.- Returns:
- Output blurred image.
-
gaussian
public static <T extends ImageBase<T>> T gaussian(T input, @Nullable T output, double sigma, int radius, @Nullable @Nullable ImageBase storage) Applies Gaussian blur to aImageGray
- Type Parameters:
T
- Input image type.- Parameters:
input
- Input image. Not modified.output
- (Optional) Storage for output image, Can be null. Modified.sigma
- Gaussian distribution's sigma. If ≤ 0 then will be selected based on radius.radius
- Radius of the Gaussian blur function. If ≤ 0 then radius will be determined by sigma.storage
- (Optional) Storage for intermediate results. Same size as input image. Can be null.- Returns:
- Output blurred image.
-
gaussian
public static <T extends ImageBase<T>> T gaussian(T input, @Nullable T output, double sigmaX, int radiusX, double sigmaY, int radiusY, @Nullable @Nullable ImageBase storage) Applies Gaussian blur to aImageGray
- Type Parameters:
T
- Input image type.- Parameters:
input
- Input image. Not modified.output
- (Optional) Storage for output image, Can be null. Modified.sigmaX
- Gaussian distribution's sigma along x-axis. If ≤ 0 then will be selected based on radius.radiusX
- Radius of the Gaussian blur function along x-axis. If ≤ 0 then radius will be determined by sigma.sigmaY
- Gaussian distribution's sigma along y-axis. If ≤ 0 then will be selected based on radius.radiusY
- Radius of the Gaussian blur function along y-axis. If ≤ 0 then radius will be determined by sigma.storage
- (Optional) Storage for intermediate results. Same size as input image. Can be null.- Returns:
- Output blurred image.
-