Package boofcv.struct.sparse
Class SparseGradientSafe<T extends ImageGray<T>,G extends GradientValue>
java.lang.Object
boofcv.struct.sparse.SparseGradientSafe<T,G>
- All Implemented Interfaces:
SparseImageGradient<T,
,G> SparseImageOperator<T>
public class SparseGradientSafe<T extends ImageGray<T>,G extends GradientValue>
extends Object
implements SparseImageGradient<T,G>
Wraps around other
SparseImageGradient
classes and checks to see if
the image is in bounds or not. If it is out of bounds the return value is set to one.-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptioncompute
(int x, int y) Computes the gradient at the specified point.boolean
isInBounds
(int x, int y) Checks to see if the entire sample region is contained inside the image or not.void
Specifies the image being processed.
-
Constructor Details
-
SparseGradientSafe
-
-
Method Details
-
setImage
Description copied from interface:SparseImageOperator
Specifies the image being processed.- Specified by:
setImage
in interfaceSparseImageOperator<T extends ImageGray<T>>
- Parameters:
input
- Image being processed
-
isInBounds
public boolean isInBounds(int x, int y) Description copied from interface:SparseImageOperator
Checks to see if the entire sample region is contained inside the image or not. Depending on the implementation it might be able to handle out of bounds pixels or not.- Specified by:
isInBounds
in interfaceSparseImageOperator<T extends ImageGray<T>>
-
compute
Description copied from interface:SparseImageGradient
Computes the gradient at the specified point.- Specified by:
compute
in interfaceSparseImageGradient<T extends ImageGray<T>,
G extends GradientValue> - Parameters:
x
- x-axis pixel coordinatey
- y-axis pixel coordinate- Returns:
- Gradient at that point.
-
getGradientType
- Specified by:
getGradientType
in interfaceSparseImageGradient<T extends ImageGray<T>,
G extends GradientValue>
-