| org.geotools.coverage.processing.OperationJAI org.geotools.coverage.processing.operation.GradientMagnitude
GradientMagnitude | public class GradientMagnitude extends OperationJAI (Code) | | Edge detector which computes the magnitude of the image gradient vector in two orthogonal
directions. The result of the
"GradientMagnitude" operation may be defined as:
dst[x][y][b] =
(
SH(x,y,b)2 +
SV(x,y,b)2)
× scale
where
SH(x,y,b) and
SV(x,y,b) are the horizontal and vertical gradient images
generated from band b of the source image by correlating it with the supplied
orthogonal (horizontal and vertical) gradient masks.
Before to compute the gradients, the kernels are tested against artificials horizontal and
vertical gradients of one unit of sample / unit of localization. For example:
- For an image of elevation (meters) using a geographic coordinate system (degrees
of latitude and longitude), the units are meters/degree.
- For an image of temperature (°C) using a projected coordinate system (kilometers),
the units are °C/km.
Kernels are normalized by dividing all their coefficients by the result of this test. In other
words, kernels are normalized in such a way that applying the
"GradientMagnitude" operation on a horizontal or vertical gradient of 1 such "geophysical" units will give a result
of 1. This is an attempt to give geophysical meaning to the numbers produced by the
"GradientMagnitude" operation. This normalization depends of the coverage's
.
NOTE: When the masks are symetric (e.g. Sobel, Prewitt (or Smoothed),
isotropic, etc.), then the above-cited algorithm produces the same result
than the "normalization factor" × "spatial factor" published by:
Simpson, J.J. (1990), "On the accurate detection and enhancement of oceanic features
observed in satellite data" in Remote sensing environment, 33:17-33.
However, for non-symetric masks (e.g. Kirsch), then a difference is found.
Name: "GradientMagnitude"
JAI operator: "
"
Parameters:
Name |
Class |
Default value |
Minimum value |
Maximum value |
"Source" |
org.geotools.coverage.grid.GridCoverage2D |
N/A |
N/A |
N/A |
"Mask1" |
KernelJAI |
KernelJAI.GRADIENT_MASK_SOBEL_HORIZONTAL |
N/A |
N/A |
"Mask2" |
KernelJAI |
KernelJAI.GRADIENT_MASK_SOBEL_VERTICAL |
N/A |
N/A |
since: 2.2 version: $Id: GradientMagnitude.java 23157 2006-12-01 01:29:53Z desruisseaux $ author: Martin Desruisseaux See Also: org.geotools.coverage.processing.Operations.gradientMagnitude See Also: GradientMagnitudeDescriptor |
Constructor Summary | |
public | GradientMagnitude() Constructs a default gradient magnitude operation. |
GradientMagnitude | public GradientMagnitude()(Code) | | Constructs a default gradient magnitude operation.
|
deriveCategory | protected Category deriveCategory(Category[] categories, Parameters parameters)(Code) | | Derives the quantitative category for a band in the destination image.
This implementation computes the expected gradient range from the two
masks and the value range in the source grid coverage.
|
deriveGridCoverage | protected GridCoverage2D deriveGridCoverage(GridCoverage2D[] sources, Parameters parameters)(Code) | | Applies the operation on grid coverage. The default implementation looks for kernels
specified in the
org.geotools.coverage.processing.OperationJAI.Parameters.parametersparameter block and divide them by the distance between pixels, in the grid coverage's
coordinate reference system.
|
deriveUnit | protected Unit deriveUnit(Unit[] units, Parameters parameters)(Code) | | Derives the unit of data for a band in the destination image.
This method compute
sample /
axis where:
-
sample is the sample unit in source image.
-
axis is the coordinate reference system axis unit.
|
Methods inherited from org.geotools.coverage.processing.OperationJAI | protected RenderedImage createRenderedImage(ParameterBlockJAI parameters, RenderingHints hints)(Code)(Java Doc) protected Category deriveCategory(Category[] categories, Parameters parameters)(Code)(Java Doc) protected GridCoverage2D deriveGridCoverage(GridCoverage2D[] sources, Parameters parameters)(Code)(Java Doc) protected InternationalString deriveName(GridCoverage2D[] sources, int primarySourceIndex, Parameters parameters)(Code)(Java Doc) protected NumberRange deriveRange(NumberRange[] ranges, Parameters parameters)(Code)(Java Doc) protected GridSampleDimension[] deriveSampleDimension(GridSampleDimension[][] bandLists, Parameters parameters)(Code)(Java Doc) protected Unit deriveUnit(Unit[] units, Parameters parameters)(Code)(Java Doc) public Coverage doOperation(ParameterValueGroup parameters, Hints hints) throws CoverageProcessingException(Code)(Java Doc) public boolean equals(Object object)(Code)(Java Doc) public static JAI getJAI(RenderingHints hints)(Code)(Java Doc) protected static OperationDescriptor getOperationDescriptor(String name) throws OperationNotFoundException(Code)(Java Doc) protected Map getProperties(RenderedImage data, CoordinateReferenceSystem crs, InternationalString name, MathTransform gridToCRS, GridCoverage2D[] sources, Parameters parameters)(Code)(Java Doc) protected static int getQuantitative(Category[] categories)(Code)(Java Doc) protected ParameterBlockJAI prepareParameters(ParameterValueGroup parameters)(Code)(Java Doc) protected void resampleToCommonGeometry(GridCoverage2D[] sources, CoordinateReferenceSystem crs2D, MathTransform2D gridToCrs2D, Hints hints) throws InvalidGridGeometryException, CannotReprojectException(Code)(Java Doc)
|
|
|