Class GradientScharr

java.lang.Object
boofcv.alg.filter.derivative.GradientScharr

public class GradientScharr
extends Object
Implementation of the standard 3x3 Scharr operator. (1/32)*[-1;0;1]**[3 10 3] = (1/3)*[-3 10 -3;0 0 0;3 10 3]. This is by far the most widely used kernel, but apparently the original paper described more accurate kernels and kernels up to 5x5. Unfortunately, the thesis is in German [1] and other related papers require you to work through the math, so this implementation is sticking with the standard kernel only. Scharr is supposed to be more accurate then Sobel when dealing with optical flow. [1] Scharr, Hanno, 2000, Dissertation (in German), Optimal Operators in Digital Image Processing .
  • Field Details

    • kernelDerivX_I32

      public static Kernel2D_S32 kernelDerivX_I32
    • kernelDerivY_I32

      public static Kernel2D_S32 kernelDerivY_I32
    • kernelDerivX_F32

      public static Kernel2D_F32 kernelDerivX_F32
    • kernelDerivY_F32

      public static Kernel2D_F32 kernelDerivY_F32
  • Constructor Details

    • GradientScharr

      public GradientScharr()
  • Method Details

    • getKernelX

      public static Kernel2D getKernelX​(boolean isInteger)
      Returns the kernel for computing the derivative along the x-axis.
    • process

      public static <I extends ImageGray<I>,​ D extends ImageGray<D>> void process​(I input, D derivX, D derivY, @Nullable @Nullable ImageBorder border)
    • process

      public static void process​(GrayU8 orig, GrayS16 derivX, GrayS16 derivY, @Nullable @Nullable ImageBorder_S32<GrayU8> border)
      Computes the derivative in the X and Y direction using an integer Sobel edge detector.
      Parameters:
      orig - Input image. Not modified.
      derivX - Storage for image derivative along the x-axis. Modified.
      derivY - Storage for image derivative along the y-axis. Modified.
      border - Specifies how the image border is handled. If null the border is not processed.
    • process

      public static void process​(GrayS16 orig, GrayS16 derivX, GrayS16 derivY, @Nullable @Nullable ImageBorder_S32<GrayS16> border)
      Computes the derivative in the X and Y direction using an integer Sobel edge detector.
      Parameters:
      orig - Input image. Not modified.
      derivX - Storage for image derivative along the x-axis. Modified.
      derivY - Storage for image derivative along the y-axis. Modified.
      border - Specifies how the image border is handled. If null the border is not processed.
    • process

      public static void process​(GrayF32 orig, GrayF32 derivX, GrayF32 derivY, @Nullable @Nullable ImageBorder_F32 border)
      Computes the derivative in the X and Y direction using an integer Sobel edge detector.
      Parameters:
      orig - Input image. Not modified.
      derivX - Storage for image derivative along the x-axis. Modified.
      derivY - Storage for image derivative along the y-axis. Modified.
      border - Specifies how the image border is handled. If null the border is not processed.