jsky.image.operator
Class ImageOps

java.lang.Object
  extended by jsky.image.operator.ImageOps

public class ImageOps
extends java.lang.Object

Utility class for performing image operations.


Constructor Summary
ImageOps()
           
 
Method Summary
static javax.media.jai.PlanarImage clamp(javax.media.jai.PlanarImage im, double low, double high)
          Perform a clamp operation on the image and return the new image.
static javax.media.jai.PlanarImage crop(javax.media.jai.PlanarImage im, float x, float y, float width, float height)
          Apply a crop operation to the image and return the new image.
static double[] cutLevel(javax.media.jai.PlanarImage im, javax.media.jai.ROI roi, double ignore, double median)
          Perform a CutLevel operation on the image to estimate the best low and high cut levels using a median filter algorithm.
static double[][] extrema(javax.media.jai.PlanarImage im, javax.media.jai.ROI roi, int xPeriod, int yPeriod)
          Perform an extrema operation on the image to get the min and max pixel values.
static javax.media.jai.PlanarImage format(javax.media.jai.PlanarImage im, int dataType)
          Apply a format operation to the image to convert it to the given data type (by casting and "clamping").
static javax.media.jai.Histogram histogram(javax.media.jai.PlanarImage im, javax.media.jai.ROI roi, int xPeriod, int yPeriod, int[] numBins, double[] lowValue, double[] highValue)
          Get statistics on the given image, such as the min and max pixel values.
static javax.media.jai.PlanarImage lookup(javax.media.jai.PlanarImage im, javax.media.jai.LookupTableJAI lookupTable)
          Apply the lookup table to the given image and return the new image.
static double[] mean(javax.media.jai.PlanarImage im, javax.media.jai.ROI roi, int xPeriod, int yPeriod)
          Perform a "mean" operation on the image to get the mean pixel value of the given area of the image.
static double[] minMax(javax.media.jai.PlanarImage im, javax.media.jai.ROI roi, int xPeriod, int yPeriod, double ignore)
          Perform a minMax operation on the image to get the min and max pixel values.
static javax.media.jai.PlanarImage rescale(javax.media.jai.PlanarImage im, double factor, double offset, java.awt.RenderingHints hints)
          Apply a rescale operation to the image.
static javax.media.jai.PlanarImage rotate(javax.media.jai.PlanarImage im, float x, float y, float angle, javax.media.jai.Interpolation interpolation, java.awt.RenderingHints hints)
          Apply a rotate operation to the image and return the new image.
static javax.media.jai.PlanarImage scale(javax.media.jai.PlanarImage im, float xScale, float yScale, float xTrans, float yTrans, javax.media.jai.Interpolation interpolation, java.awt.RenderingHints hints)
          Apply a scale operation to the image and return the new image.
static javax.media.jai.PlanarImage translate(javax.media.jai.PlanarImage im, float x, float y, javax.media.jai.Interpolation interpolation)
          Apply a translate operation to the image and return the new image.
static javax.media.jai.PlanarImage transpose(javax.media.jai.PlanarImage im, javax.media.jai.operator.TransposeType type)
          Apply a transpose operation to the image and return the new image.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ImageOps

public ImageOps()
Method Detail

minMax

public static double[] minMax(javax.media.jai.PlanarImage im,
                              javax.media.jai.ROI roi,
                              int xPeriod,
                              int yPeriod,
                              double ignore)
Perform a minMax operation on the image to get the min and max pixel values. Only the specified region of the image is examined and any pixels with the given value are ignored. Any NaN values are ignored. A value of Double.NaN may also be specified for the bad pixel value, if none is known, although in that case, the extrema operator may be faster, since it is normally implemented in native code. The return value has type double[2], for holding the min and max values. Note that this operation currently only supports single banded images.


cutLevel

public static double[] cutLevel(javax.media.jai.PlanarImage im,
                                javax.media.jai.ROI roi,
                                double ignore,
                                double median)
Perform a CutLevel operation on the image to estimate the best low and high cut levels using a median filter algorithm. Only the specified region of the image is examined and any pixels with the given value are ignored and replaced with the given median value, which should be (minValue+maxValue)/2. Any NaN values are ignored. A value of Double.NaN may also be specified for the bad pixel value, if none is known. The return value has type double[2], for holding the min and max values. Note that this operation currently only supports single banded images.


extrema

public static double[][] extrema(javax.media.jai.PlanarImage im,
                                 javax.media.jai.ROI roi,
                                 int xPeriod,
                                 int yPeriod)
Perform an extrema operation on the image to get the min and max pixel values. Only the specified region of the image is examined. The return value has type double[2][#bands], where the first index is for the min and max values in each band.


mean

public static double[] mean(javax.media.jai.PlanarImage im,
                            javax.media.jai.ROI roi,
                            int xPeriod,
                            int yPeriod)
Perform a "mean" operation on the image to get the mean pixel value of the given area of the image. Only the specified region of the image is examined. The return value has type double[#bands].


rescale

public static javax.media.jai.PlanarImage rescale(javax.media.jai.PlanarImage im,
                                                  double factor,
                                                  double offset,
                                                  java.awt.RenderingHints hints)
Apply a rescale operation to the image.

Parameters:
im - the source image
factor - factor to multiple pixel values by
offset - value to add to pixel values
hints - optional rendering hint (may be needed to define an ImageLayout object to change the datatype of the resulting image)

format

public static javax.media.jai.PlanarImage format(javax.media.jai.PlanarImage im,
                                                 int dataType)
Apply a format operation to the image to convert it to the given data type (by casting and "clamping").


scale

public static javax.media.jai.PlanarImage scale(javax.media.jai.PlanarImage im,
                                                float xScale,
                                                float yScale,
                                                float xTrans,
                                                float yTrans,
                                                javax.media.jai.Interpolation interpolation,
                                                java.awt.RenderingHints hints)
Apply a scale operation to the image and return the new image.


rotate

public static javax.media.jai.PlanarImage rotate(javax.media.jai.PlanarImage im,
                                                 float x,
                                                 float y,
                                                 float angle,
                                                 javax.media.jai.Interpolation interpolation,
                                                 java.awt.RenderingHints hints)
Apply a rotate operation to the image and return the new image. The


crop

public static javax.media.jai.PlanarImage crop(javax.media.jai.PlanarImage im,
                                               float x,
                                               float y,
                                               float width,
                                               float height)
Apply a crop operation to the image and return the new image.


translate

public static javax.media.jai.PlanarImage translate(javax.media.jai.PlanarImage im,
                                                    float x,
                                                    float y,
                                                    javax.media.jai.Interpolation interpolation)
Apply a translate operation to the image and return the new image.


transpose

public static javax.media.jai.PlanarImage transpose(javax.media.jai.PlanarImage im,
                                                    javax.media.jai.operator.TransposeType type)
Apply a transpose operation to the image and return the new image.


lookup

public static javax.media.jai.PlanarImage lookup(javax.media.jai.PlanarImage im,
                                                 javax.media.jai.LookupTableJAI lookupTable)
Apply the lookup table to the given image and return the new image.


clamp

public static javax.media.jai.PlanarImage clamp(javax.media.jai.PlanarImage im,
                                                double low,
                                                double high)
Perform a clamp operation on the image and return the new image.


histogram

public static javax.media.jai.Histogram histogram(javax.media.jai.PlanarImage im,
                                                  javax.media.jai.ROI roi,
                                                  int xPeriod,
                                                  int yPeriod,
                                                  int[] numBins,
                                                  double[] lowValue,
                                                  double[] highValue)
Get statistics on the given image, such as the min and max pixel values.