public class GradientToEdgeFeatures
extends java.lang.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.
| Constructor and Description |
|---|
GradientToEdgeFeatures() |
| Modifier and Type | Method and Description |
|---|---|
static void |
direction(boofcv.struct.image.ImageFloat32 derivX,
boofcv.struct.image.ImageFloat32 derivY,
boofcv.struct.image.ImageFloat32 angle)
Computes the edge orientation using the
Math.atan(double) function. |
static void |
direction(boofcv.struct.image.ImageSInt16 derivX,
boofcv.struct.image.ImageSInt16 derivY,
boofcv.struct.image.ImageFloat32 angle)
Computes the edge orientation using the
Math.atan(double) function. |
static void |
direction(boofcv.struct.image.ImageSInt32 derivX,
boofcv.struct.image.ImageSInt32 derivY,
boofcv.struct.image.ImageFloat32 angle)
Computes the edge orientation using the
Math.atan(double) function. |
static void |
direction2(boofcv.struct.image.ImageFloat32 derivX,
boofcv.struct.image.ImageFloat32 derivY,
boofcv.struct.image.ImageFloat32 angle)
Computes the edge orientation using the
Math.atan2(double, double) function. |
static void |
direction2(boofcv.struct.image.ImageSInt16 derivX,
boofcv.struct.image.ImageSInt16 derivY,
boofcv.struct.image.ImageFloat32 angle)
Computes the edge orientation using the
Math.atan2(double, double) function. |
static void |
direction2(boofcv.struct.image.ImageSInt32 derivX,
boofcv.struct.image.ImageSInt32 derivY,
boofcv.struct.image.ImageFloat32 angle)
Computes the edge orientation using the
Math.atan2(double, double) function. |
static boofcv.struct.image.ImageSInt8 |
discretizeDirection4(boofcv.struct.image.ImageFloat32 angle,
boofcv.struct.image.ImageSInt8 discrete)
Converts an image containing edge angles (-pi/2 to pi/2) into a discrete set of angles.
|
static boofcv.struct.image.ImageSInt8 |
discretizeDirection8(boofcv.struct.image.ImageFloat32 angle,
boofcv.struct.image.ImageSInt8 discrete)
Converts an image containing edge angles (-pi to pi) into a discrete set of 8 angles.
|
static void |
intensityAbs(boofcv.struct.image.ImageFloat32 derivX,
boofcv.struct.image.ImageFloat32 derivY,
boofcv.struct.image.ImageFloat32 intensity)
Computes the edge intensity using a Euclidean norm.
|
static void |
intensityAbs(boofcv.struct.image.ImageSInt16 derivX,
boofcv.struct.image.ImageSInt16 derivY,
boofcv.struct.image.ImageFloat32 intensity)
Computes the edge intensity using a Euclidean norm.
|
static void |
intensityAbs(boofcv.struct.image.ImageSInt32 derivX,
boofcv.struct.image.ImageSInt32 derivY,
boofcv.struct.image.ImageFloat32 intensity)
Computes the edge intensity using a Euclidean norm.
|
static void |
intensityE(boofcv.struct.image.ImageFloat32 derivX,
boofcv.struct.image.ImageFloat32 derivY,
boofcv.struct.image.ImageFloat32 intensity)
Computes the edge intensity using a Euclidean norm.
|
static void |
intensityE(boofcv.struct.image.ImageSInt16 derivX,
boofcv.struct.image.ImageSInt16 derivY,
boofcv.struct.image.ImageFloat32 intensity)
Computes the edge intensity using a Euclidean norm.
|
static void |
intensityE(boofcv.struct.image.ImageSInt32 derivX,
boofcv.struct.image.ImageSInt32 derivY,
boofcv.struct.image.ImageFloat32 intensity)
Computes the edge intensity using a Euclidean norm.
|
static boofcv.struct.image.ImageFloat32 |
nonMaxSuppression4(boofcv.struct.image.ImageFloat32 intensity,
boofcv.struct.image.ImageSInt8 direction,
boofcv.struct.image.ImageFloat32 output)
Sets edge intensities to zero if the pixel has an intensity which is less than either of
the two adjacent pixels.
|
static boofcv.struct.image.ImageFloat32 |
nonMaxSuppression8(boofcv.struct.image.ImageFloat32 intensity,
boofcv.struct.image.ImageSInt8 direction,
boofcv.struct.image.ImageFloat32 output)
Sets edge intensities to zero if the pixel has an intensity which is less than either of
the two adjacent pixels.
|
static boofcv.struct.image.ImageFloat32 |
nonMaxSuppressionCrude4(boofcv.struct.image.ImageFloat32 intensity,
boofcv.struct.image.ImageFloat32 derivX,
boofcv.struct.image.ImageFloat32 derivY,
boofcv.struct.image.ImageFloat32 output)
Sets edge intensities to zero if the pixel has an intensity which is less than any of
the two adjacent pixels.
|
static boofcv.struct.image.ImageFloat32 |
nonMaxSuppressionCrude4(boofcv.struct.image.ImageFloat32 intensity,
boofcv.struct.image.ImageSInt16 derivX,
boofcv.struct.image.ImageSInt16 derivY,
boofcv.struct.image.ImageFloat32 output)
Sets edge intensities to zero if the pixel has an intensity which is less than any of
the two adjacent pixels.
|
static boofcv.struct.image.ImageFloat32 |
nonMaxSuppressionCrude4(boofcv.struct.image.ImageFloat32 intensity,
boofcv.struct.image.ImageSInt32 derivX,
boofcv.struct.image.ImageSInt32 derivY,
boofcv.struct.image.ImageFloat32 output)
Sets edge intensities to zero if the pixel has an intensity which is less than any of
the two adjacent pixels.
|
public static void intensityE(boofcv.struct.image.ImageFloat32 derivX,
boofcv.struct.image.ImageFloat32 derivY,
boofcv.struct.image.ImageFloat32 intensity)
derivX - Derivative along x-axis. Not modified.derivY - Derivative along y-axis. Not modified.intensity - Edge intensity.public static void intensityAbs(boofcv.struct.image.ImageFloat32 derivX,
boofcv.struct.image.ImageFloat32 derivY,
boofcv.struct.image.ImageFloat32 intensity)
derivX - Derivative along x-axis. Not modified.derivY - Derivative along y-axis. Not modified.intensity - Edge intensity.public static void direction(boofcv.struct.image.ImageFloat32 derivX,
boofcv.struct.image.ImageFloat32 derivY,
boofcv.struct.image.ImageFloat32 angle)
Math.atan(double) function.derivX - Derivative along x-axis. Not modified.derivY - Derivative along y-axis. Not modified.angle - Edge orientation in radians (-pi/2 to pi/2).public static void direction2(boofcv.struct.image.ImageFloat32 derivX,
boofcv.struct.image.ImageFloat32 derivY,
boofcv.struct.image.ImageFloat32 angle)
Math.atan2(double, double) function.derivX - Derivative along x-axis. Not modified.derivY - Derivative along y-axis. Not modified.angle - Edge orientation in radians (-pi to pi).public static void intensityE(boofcv.struct.image.ImageSInt16 derivX,
boofcv.struct.image.ImageSInt16 derivY,
boofcv.struct.image.ImageFloat32 intensity)
derivX - Derivative along x-axis. Not modified.derivY - Derivative along y-axis. Not modified.intensity - Edge intensity.public static void intensityAbs(boofcv.struct.image.ImageSInt16 derivX,
boofcv.struct.image.ImageSInt16 derivY,
boofcv.struct.image.ImageFloat32 intensity)
derivX - Derivative along x-axis. Not modified.derivY - Derivative along y-axis. Not modified.intensity - Edge intensity.public static void direction(boofcv.struct.image.ImageSInt16 derivX,
boofcv.struct.image.ImageSInt16 derivY,
boofcv.struct.image.ImageFloat32 angle)
Math.atan(double) function.derivX - Derivative along x-axis. Not modified.derivY - Derivative along y-axis. Not modified.angle - Edge orientation in radians (-pi/2 to pi/2).public static void direction2(boofcv.struct.image.ImageSInt16 derivX,
boofcv.struct.image.ImageSInt16 derivY,
boofcv.struct.image.ImageFloat32 angle)
Math.atan2(double, double) function.derivX - Derivative along x-axis. Not modified.derivY - Derivative along y-axis. Not modified.angle - Edge orientation in radians (-pi to pi).public static void intensityE(boofcv.struct.image.ImageSInt32 derivX,
boofcv.struct.image.ImageSInt32 derivY,
boofcv.struct.image.ImageFloat32 intensity)
derivX - Derivative along x-axis. Not modified.derivY - Derivative along y-axis. Not modified.intensity - Edge intensity.public static void intensityAbs(boofcv.struct.image.ImageSInt32 derivX,
boofcv.struct.image.ImageSInt32 derivY,
boofcv.struct.image.ImageFloat32 intensity)
derivX - Derivative along x-axis. Not modified.derivY - Derivative along y-axis. Not modified.intensity - Edge intensity.public static void direction(boofcv.struct.image.ImageSInt32 derivX,
boofcv.struct.image.ImageSInt32 derivY,
boofcv.struct.image.ImageFloat32 angle)
Math.atan(double) function.derivX - Derivative along x-axis. Not modified.derivY - Derivative along y-axis. Not modified.angle - Edge orientation in radians (-pi/2 to pi/2).public static void direction2(boofcv.struct.image.ImageSInt32 derivX,
boofcv.struct.image.ImageSInt32 derivY,
boofcv.struct.image.ImageFloat32 angle)
Math.atan2(double, double) function.derivX - Derivative along x-axis. Not modified.derivY - Derivative along y-axis. Not modified.angle - Edge orientation in radians (-pi to pi).public static boofcv.struct.image.ImageSInt8 discretizeDirection4(boofcv.struct.image.ImageFloat32 angle,
boofcv.struct.image.ImageSInt8 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
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.public static boofcv.struct.image.ImageSInt8 discretizeDirection8(boofcv.struct.image.ImageFloat32 angle,
boofcv.struct.image.ImageSInt8 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
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.public static boofcv.struct.image.ImageFloat32 nonMaxSuppression4(boofcv.struct.image.ImageFloat32 intensity,
boofcv.struct.image.ImageSInt8 direction,
boofcv.struct.image.ImageFloat32 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.
intensity - Edge intensities. Not modified.direction - 4-Discretized direction. See discretizeDirection4(boofcv.struct.image.ImageFloat32, boofcv.struct.image.ImageSInt8). Not modified.output - Filtered intensity. If null a new image will be declared and returned. Modified.public static boofcv.struct.image.ImageFloat32 nonMaxSuppression8(boofcv.struct.image.ImageFloat32 intensity,
boofcv.struct.image.ImageSInt8 direction,
boofcv.struct.image.ImageFloat32 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.
intensity - Edge intensities. Not modified.direction - 8-Discretized direction. See discretizeDirection8(boofcv.struct.image.ImageFloat32, boofcv.struct.image.ImageSInt8). Not modified.output - Filtered intensity. If null a new image will be declared and returned. Modified.public static boofcv.struct.image.ImageFloat32 nonMaxSuppressionCrude4(boofcv.struct.image.ImageFloat32 intensity,
boofcv.struct.image.ImageFloat32 derivX,
boofcv.struct.image.ImageFloat32 derivY,
boofcv.struct.image.ImageFloat32 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.
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.public static boofcv.struct.image.ImageFloat32 nonMaxSuppressionCrude4(boofcv.struct.image.ImageFloat32 intensity,
boofcv.struct.image.ImageSInt16 derivX,
boofcv.struct.image.ImageSInt16 derivY,
boofcv.struct.image.ImageFloat32 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.
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.public static boofcv.struct.image.ImageFloat32 nonMaxSuppressionCrude4(boofcv.struct.image.ImageFloat32 intensity,
boofcv.struct.image.ImageSInt32 derivX,
boofcv.struct.image.ImageSInt32 derivY,
boofcv.struct.image.ImageFloat32 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.
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.