org.geotoolkit.image.jai
Class Hysteresis

Object
  extended by PlanarImage
      extended by OpImage
          extended by UntiledOpImage
              extended by Hysteresis
All Implemented Interfaces:
RenderedImage, ImageJAI, PropertyChangeEmitter, PropertySource, WritablePropertySource

public class Hysteresis
extends UntiledOpImage

Applies a hysteresis threshold on an image. This operation is defined by an upper threshold, high, and a lower threshold, low. If a pixel value is equals or higher than high, it is keep unchanged. If a pixel value is lower than low, it is replaced by the pad value. If a pixel value is between low and high, then this pixel is called "indeterminate". Its value is keep unchanged only if this pixel is either a neighbor of a pixel having a value equals or higher than high, or a neighbor of an other indeterminate pixel which has been determined close to a pixel having a value equals or higher than high in a previous iteration. This search is performed in an iterative manner until there is no more indeterminate pixels having satisfying neighbor.

Since:
2.1
Version:
3.00
Author:
Lionel Flahaut (IRD), Martin Desruisseaux (IRD)
Module:
coverage/geotk-coverage (download)    View source code for this class

Field Summary
protected  double high
          The upper threshold value, inclusive.
protected  double low
          The lower threshold value, inclusive.
static String OPERATION_NAME
          The name of this operation in the JAI registry.
protected  double padValue
          The value to give to filtered pixel.
 
Fields inherited from class OpImage
cache, cobbleSources, OP_COMPUTE_BOUND, OP_IO_BOUND, OP_NETWORK_BOUND, tileCacheMetric, tileRecycler
 
Fields inherited from class PlanarImage
colorModel, eventManager, height, minX, minY, properties, sampleModel, tileFactory, tileGridXOffset, tileGridYOffset, tileHeight, tileWidth, width
 
Constructor Summary
Hysteresis(RenderedImage source, ImageLayout layout, Map<?,?> configuration, double low, double high, double padValue)
          Constructs a new Hysterisis filter for the given image.
 
Method Summary
protected  void computeImage(Raster[] sources, WritableRaster dest, Rectangle destRect)
          Computes a rectangle of outputs.
 Vector<RenderedImage> getSources()
          Returns the source images.
 
Methods inherited from class UntiledOpImage
computeTile, getTileDependencies, mapDestRect, mapSourceRect
 
Methods inherited from class OpImage
addTileToCache, cancelTiles, computeRect, computeRect, computesUniqueTiles, createTile, dispose, getExpandedNumBands, getFormatTags, getOperationComputeType, getTile, getTileCache, getTileCacheMetric, getTileFromCache, getTileRecycler, getTiles, hasExtender, mapDestPoint, mapSourcePoint, prefetchTiles, queueTiles, recycleTile, setTileCache, vectorize, vectorize, vectorize
 
Methods inherited from class PlanarImage
addPropertyChangeListener, addPropertyChangeListener, addSink, addSink, addSource, addTileComputationListener, copyData, copyData, copyExtendedData, createColorModel, createSnapshot, createWritableRaster, finalize, getAsBufferedImage, getAsBufferedImage, getBounds, getColorModel, getData, getData, getDefaultColorModel, getExtendedData, getGraphics, getHeight, getImageID, getMaxTileX, getMaxTileY, getMaxX, getMaxY, getMinTileX, getMinTileY, getMinX, getMinY, getNumBands, getNumSources, getNumXTiles, getNumYTiles, getProperties, getProperty, getPropertyClass, getPropertyNames, getPropertyNames, getSampleModel, getSinks, getSource, getSourceImage, getSourceObject, getSplits, getTileComputationListeners, getTileFactory, getTileGridXOffset, getTileGridYOffset, getTileHeight, getTileIndices, getTileRect, getTiles, getTileWidth, getWidth, overlapsMultipleTiles, removeProperty, removePropertyChangeListener, removePropertyChangeListener, removeSink, removeSink, removeSinks, removeSource, removeSources, removeTileComputationListener, setImageLayout, setProperties, setProperty, setSource, setSources, tileXToX, tileXToX, tileYToY, tileYToY, toString, wrapRenderedImage, XToTileX, XToTileX, YToTileY, YToTileY
 
Methods inherited from class Object
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

OPERATION_NAME

public static final String OPERATION_NAME
The name of this operation in the JAI registry. This is "org.geotoolkit.Hysteresis".

See Also:
Constant Field Values

low

protected final double low
The lower threshold value, inclusive. Pixels having a value lower than this value will be set to the padValue.


high

protected final double high
The upper threshold value, inclusive. Pixels having a value equals or higher than this value will be keep unchanged.


padValue

protected final double padValue
The value to give to filtered pixel.

Constructor Detail

Hysteresis

public Hysteresis(RenderedImage source,
                  ImageLayout layout,
                  Map<?,?> configuration,
                  double low,
                  double high,
                  double padValue)
Constructs a new Hysterisis filter for the given image. While this constructor is public, it should usually not be invoked directly. You should use JAI factory methods instead.

Parameters:
source - The source image.
layout - The image layout.
configuration - The image properties and rendering hints.
low - The lower threshold value, inclusive.
high - The upper threshold value, inclusive.
padValue - The value to give to filtered pixel.
Method Detail

getSources

public Vector<RenderedImage> getSources()
Returns the source images.

Specified by:
getSources in interface RenderedImage
Overrides:
getSources in class PlanarImage

computeImage

protected void computeImage(Raster[] sources,
                            WritableRaster dest,
                            Rectangle destRect)
Computes a rectangle of outputs.

Specified by:
computeImage in class UntiledOpImage
Parameters:
sources - The source images. Should be an array of length 1.
dest - The raster to be filled in.
destRect - The region within the raster to be filled.


Copyright © 2009-2012 Geotoolkit.org. All Rights Reserved.