Class GradientToEdgeFeatures

java.lang.Object
boofcv.alg.feature.detect.edge.GradientToEdgeFeatures

public class GradientToEdgeFeatures extends Object

Give the image's gradient in the x and y direction compute the edge's intensity and orientation. Two ways are provided for computing the edge's intensity: euclidean norm and sum of absolute values (induced 1-norm). The former is the most accurate, while the later is much faster.

norm: sqrt( gx2 + gy2)
abs: |gx| + |gy| angle: atan( gy / gx )

When computing the angle care is taken to avoid divided by zero errors.

WARNING: Do not modify. Automatically generated by GenerateGradientToEdgeFeatures.

  • Constructor Details

    • GradientToEdgeFeatures

      public GradientToEdgeFeatures()
  • Method Details

    • intensityE

      public static void intensityE(GrayF32 derivX, GrayF32 derivY, GrayF32 intensity)
      Computes the edge intensity using a Euclidean norm.
      Parameters:
      derivX - Derivative along x-axis. Not modified.
      derivY - Derivative along y-axis. Not modified.
      intensity - Edge intensity.
    • intensityAbs

      public static void intensityAbs(GrayF32 derivX, GrayF32 derivY, GrayF32 intensity)
      Computes the edge intensity using a Euclidean norm.
      Parameters:
      derivX - Derivative along x-axis. Not modified.
      derivY - Derivative along y-axis. Not modified.
      intensity - Edge intensity.
    • direction

      public static void direction(GrayF32 derivX, GrayF32 derivY, GrayF32 angle)
      Computes the edge orientation using the Math.atan(double) function.
      Parameters:
      derivX - Derivative along x-axis. Not modified.
      derivY - Derivative along y-axis. Not modified.
      angle - Edge orientation in radians (-pi/2 to pi/2).
    • direction2

      public static void direction2(GrayF32 derivX, GrayF32 derivY, GrayF32 angle)
      Computes the edge orientation using the Math.atan2(double, double) function.
      Parameters:
      derivX - Derivative along x-axis. Not modified.
      derivY - Derivative along y-axis. Not modified.
      angle - Edge orientation in radians (-pi to pi).
    • nonMaxSuppressionCrude4

      public static GrayF32 nonMaxSuppressionCrude4(GrayF32 intensity, GrayF32 derivX, GrayF32 derivY, GrayF32 output)

      Sets edge intensities to zero if the pixel has an intensity which is less than any of the two adjacent pixels. Pixel adjacency is determined based upon the sign of the image gradient. Less precise than other methods, but faster.

      Parameters:
      intensity - Edge intensities. Not modified.
      derivX - Image derivative along x-axis.
      derivY - Image derivative along y-axis.
      output - Filtered intensity. If null a new image will be declared and returned. Modified.
      Returns:
      Filtered edge intensity.
    • intensityE

      public static void intensityE(GrayS16 derivX, GrayS16 derivY, GrayF32 intensity)
      Computes the edge intensity using a Euclidean norm.
      Parameters:
      derivX - Derivative along x-axis. Not modified.
      derivY - Derivative along y-axis. Not modified.
      intensity - Edge intensity.
    • intensityAbs

      public static void intensityAbs(GrayS16 derivX, GrayS16 derivY, GrayF32 intensity)
      Computes the edge intensity using a Euclidean norm.
      Parameters:
      derivX - Derivative along x-axis. Not modified.
      derivY - Derivative along y-axis. Not modified.
      intensity - Edge intensity.
    • direction

      public static void direction(GrayS16 derivX, GrayS16 derivY, GrayF32 angle)
      Computes the edge orientation using the Math.atan(double) function.
      Parameters:
      derivX - Derivative along x-axis. Not modified.
      derivY - Derivative along y-axis. Not modified.
      angle - Edge orientation in radians (-pi/2 to pi/2).
    • direction2

      public static void direction2(GrayS16 derivX, GrayS16 derivY, GrayF32 angle)
      Computes the edge orientation using the Math.atan2(double, double) function.
      Parameters:
      derivX - Derivative along x-axis. Not modified.
      derivY - Derivative along y-axis. Not modified.
      angle - Edge orientation in radians (-pi to pi).
    • nonMaxSuppressionCrude4

      public static GrayF32 nonMaxSuppressionCrude4(GrayF32 intensity, GrayS16 derivX, GrayS16 derivY, GrayF32 output)

      Sets edge intensities to zero if the pixel has an intensity which is less than any of the two adjacent pixels. Pixel adjacency is determined based upon the sign of the image gradient. Less precise than other methods, but faster.

      Parameters:
      intensity - Edge intensities. Not modified.
      derivX - Image derivative along x-axis.
      derivY - Image derivative along y-axis.
      output - Filtered intensity. If null a new image will be declared and returned. Modified.
      Returns:
      Filtered edge intensity.
    • intensityE

      public static void intensityE(GrayS32 derivX, GrayS32 derivY, GrayF32 intensity)
      Computes the edge intensity using a Euclidean norm.
      Parameters:
      derivX - Derivative along x-axis. Not modified.
      derivY - Derivative along y-axis. Not modified.
      intensity - Edge intensity.
    • intensityAbs

      public static void intensityAbs(GrayS32 derivX, GrayS32 derivY, GrayF32 intensity)
      Computes the edge intensity using a Euclidean norm.
      Parameters:
      derivX - Derivative along x-axis. Not modified.
      derivY - Derivative along y-axis. Not modified.
      intensity - Edge intensity.
    • direction

      public static void direction(GrayS32 derivX, GrayS32 derivY, GrayF32 angle)
      Computes the edge orientation using the Math.atan(double) function.
      Parameters:
      derivX - Derivative along x-axis. Not modified.
      derivY - Derivative along y-axis. Not modified.
      angle - Edge orientation in radians (-pi/2 to pi/2).
    • direction2

      public static void direction2(GrayS32 derivX, GrayS32 derivY, GrayF32 angle)
      Computes the edge orientation using the Math.atan2(double, double) function.
      Parameters:
      derivX - Derivative along x-axis. Not modified.
      derivY - Derivative along y-axis. Not modified.
      angle - Edge orientation in radians (-pi to pi).
    • nonMaxSuppressionCrude4

      public static GrayF32 nonMaxSuppressionCrude4(GrayF32 intensity, GrayS32 derivX, GrayS32 derivY, GrayF32 output)

      Sets edge intensities to zero if the pixel has an intensity which is less than any of the two adjacent pixels. Pixel adjacency is determined based upon the sign of the image gradient. Less precise than other methods, but faster.

      Parameters:
      intensity - Edge intensities. Not modified.
      derivX - Image derivative along x-axis.
      derivY - Image derivative along y-axis.
      output - Filtered intensity. If null a new image will be declared and returned. Modified.
      Returns:
      Filtered edge intensity.
    • discretizeDirection4

      public static GrayS8 discretizeDirection4(GrayF32 angle, GrayS8 discrete)

      Converts an image containing edge angles (-pi/2 to pi/2) into a discrete set of angles. The conversion is done by rounding the angle to the nearest orientation in the set.

      Discrete value to angle (degrees): 0=0,1=45,2=90,-1=-45

      Parameters:
      angle - Input image containing edge orientations. Orientations are assumed to be from -pi/2 to pi/2. Not modified.
      discrete - Output set of discretized angles. Values will be from -1 to 2, inclusive. If null a new image will be declared and returned. Modified.
      Returns:
      Discretized direction.
    • discretizeDirection8

      public static GrayS8 discretizeDirection8(GrayF32 angle, GrayS8 discrete)

      Converts an image containing edge angles (-pi to pi) into a discrete set of 8 angles. The conversion is done by rounding the angle to the nearest orientation in the set.

      Discrete value to angle (degrees): 0=0,1=45,2=90,3=135,4=180,-1=-45,-2=--90,-3=-135

      Parameters:
      angle - Input image containing edge orientations. Orientations are assumed to be from -pi to pi. Not modified.
      discrete - Output set of discretized angles. Values will be from -3 to 4, inclusive. If null a new image will be declared and returned. Modified.
      Returns:
      Discretized direction.
    • nonMaxSuppression4

      public static GrayF32 nonMaxSuppression4(GrayF32 intensity, GrayS8 direction, GrayF32 output)

      Sets edge intensities to zero if the pixel has an intensity which is less than either of the two adjacent pixels. Pixel adjacency is determined by the gradients discretized direction.

      Parameters:
      intensity - Edge intensities. Not modified.
      direction - 4-Discretized direction. See discretizeDirection4(GrayF32, GrayS8). Not modified.
      output - Filtered intensity. If null a new image will be declared and returned. Modified.
      Returns:
      Filtered edge intensity.
    • nonMaxSuppression8

      public static GrayF32 nonMaxSuppression8(GrayF32 intensity, GrayS8 direction, GrayF32 output)

      Sets edge intensities to zero if the pixel has an intensity which is less than either of the two adjacent pixels. Pixel adjacency is determined by the gradients discretized direction.

      Parameters:
      intensity - Edge intensities. Not modified.
      direction - 8-Discretized direction. See discretizeDirection8(GrayF32, GrayS8). Not modified.
      output - Filtered intensity. If null a new image will be declared and returned. Modified.
      Returns:
      Filtered edge intensity.