public interface Image
Modifier and Type | Method and Description |
---|---|
void |
add(java.awt.image.BufferedImage bim)
Add pixel values from bim into the data array.
|
void |
add(Image other)
Add pixel values from the other Image into the current data array.
|
int[] |
addPixel(int x,
int y,
int[] px)
More efficient than the sequence getPixel, add for each band, setPixel.
|
void |
addProportion(Image other,
double fractionThis,
double fractionOther)
Add proportion of pixel values from the other Image to a proportion of
the current data array.
|
void |
addTranslated(java.awt.image.BufferedImage bim,
double dx,
double dy)
Add pixel values from bim into the data array, offset by vector (dx, dy).
|
void |
addTranslated(java.awt.image.BufferedImage bim,
int dx,
int dy)
Add pixel values from bim into the data array, offset by vector (dx, dy).
|
void |
applyCurve(java.util.List<java.awt.Point> points)
Apply a tone curve to all channels.
|
void |
autoCrop()
Automatically remove any rectangular margin of black (0, 0, 0) pixels
from the image, thereby cropping it.
|
void |
autoStretch(boolean allChannelsSame)
Stretch the contrast in the image so the full range of levels is used.
|
void |
autoStretch(boolean allChannelsSame,
java.awt.Point topLeft,
java.awt.Point bottomRight)
Stretch the contrast in the image so the full range of levels is used.
|
ByteMask |
autoThreshold()
Threshold automatically.
|
void |
averageVertically()
Replace every pixel of every vertical line in the image by the average
of the levels along the line.
|
void |
averageVertically(int yMin,
int yMax)
Replace every pixel of every vertical line in the image by the average of
the levels along the line, within two y coordinate limits.
|
void |
blurGaussian(int nx,
int ny,
javax.swing.ProgressMonitor monitor)
Do Gaussian blurring of the given image with 1D profiles of width nx
(horizontal) and ny (vertical).
|
Image |
clone() |
Image |
convertToImage16() |
Image |
convertToImage32() |
Image |
convertToImage64() |
Image |
convertToImage8() |
void |
convertToMonochrome()
Reduce the number of bands from 3 to 1, converting RGB to monochrome,
using 0.325 x red + 0.5 * green + 0.175 * blue.
|
void |
convertToMonochrome(double... f)
Reduce the number of bands to 1, combining channels, using
sum_i (f[i]/I x px[i]), where I = sum_i (f[i]).
|
void |
convolve(double[] horz,
double[] vert,
javax.swing.ProgressMonitor monitor)
Convolve the given image with the given 1D arrays (horizontal and
vertical - may be different).
|
void |
convolve(Kernel kernel,
javax.swing.ProgressMonitor monitor)
Perform a 2D linear convolution with the given kernel.
|
void |
correctBackground(double scale,
int cellFactor)
Level the background of the image by dividing the image into n x n cells
and using the modal values of the histogram in every cell.
|
void |
crop(java.awt.Point pt1,
java.awt.Point pt2)
Crop the Image by a rectangle defined by the diagonally opposite points.
|
void |
deconvolve(Kernel kernel,
int nPasses,
double weight,
javax.swing.ProgressMonitor monitor)
Deconvolve this image with the given kernel, using van Cittert's method.
|
void |
dispose()
Release all resources.
|
void |
divide(int n)
Divide all pixel values (in all bands) in the Image by n.
|
void |
divideByFlatField(Image flat)
Divide by a flat field image.
|
void |
drawRim(int width,
java.awt.Color colour)
Draw a rim around the image, of the given width and colour
|
void |
fit(int width,
int height)
Scale the image so it fits into the given width and height (in pixels),
without changing its proportions.
|
void |
flipHorizontal()
Flip the image horizontally.
|
void |
flipVertical()
Flip the image vertically.
|
int |
getBitsPerChannel()
Get the number of bits per channel.
|
int |
getBytesPerChannel()
Get the number of bytes per channel.
|
Calibration |
getCalibration()
Get a reference to the Calibration object for this image.
|
RangeInt[] |
getChannelRanges()
Find the range of values in each channel, as pairs of int values.
|
RangeDouble[] |
getChannelRangesDouble()
Find the range of values in each channel, as pairs of double values.
|
double |
getEv()
Exposure value, 0 if not set and this is the case when an image is first
constructed: it is necessary to call setEv () to set the field.
|
java.lang.String |
getFilePath()
Get the path of the file from which this image was loaded or to which it
was last saved.
|
int |
getHeight()
Get the height, in pixels, of the Image.
|
java.lang.String |
getImageTypeAsString()
For displaying image information.
|
int |
getMaxLevel()
Get highest level that can occur in each channel.
|
Metadata |
getMetadata()
Get metadata associated with the image.
|
int |
getNBands()
Get the number of bands (channels) in the Image.
|
int[] |
getPixel(int x,
int y)
Get array of int pixel values for all bands at the given integer (x, y)
position.
|
double[] |
getPixelDouble(int x,
int y)
Get array of double pixel values for all bands at the given integer
(x, y) position.
|
double[] |
getPixelDoubleInterpolated(double x,
double y)
Get array of double pixel values for all bands at the given fractional
(x, y) position.
|
int[] |
getPixelInterpolated(double x,
double y)
Get array of int pixel values for all bands at the given fractional
(x, y) position.
|
RangeInt |
getRange()
Get the minimum and maximum values occurring across all channels, as a
pair of int values.
|
RangeInt |
getRangeByRescanning()
Get overall range of values across all channels, as a pair of int values.
|
RangeDouble |
getRangeByRescanningDouble()
Get overall range of values across all channels, as a pair of double values.
|
RangeDouble |
getRangeDouble()
Get the minimum and maximum values occurring across all channels, as a
pair of double values.
|
int |
getWidth()
Get the width, in pixels, of the Image.
|
Image |
gnomonicProjection(int focalLength_mm,
double detectorWidth_mm,
double detectorHeight_mm)
Project from sphere to plane.
|
Image |
inverseGnomonicProjection(int focalLength_mm,
double detectorWidth_mm,
double detectorHeight_mm)
Project from plane to sphere.
|
void |
invert()
Invert the colour at every pixel in the image.
|
boolean |
isRaw()
Whether the image data are still in RAW format, as from a DSLR camera.
|
void |
keepOnlyDifferingPixels(Image other,
int threshold)
Keep only pixels in this image which differ by more than the threshold
amount (in at least one band) from pixels at the same position in the
other image.
|
void |
meanFilter(int halfWidth,
javax.swing.ProgressMonitor monitor)
Replace every pixel in the image by the mean value of its n x n
neighbourhood, where n = 2.halfWidth + 1.
|
void |
medianFilter(int halfWidth,
javax.swing.ProgressMonitor monitor)
Replace every pixel in the image by the median value of its n x n
neighbourhood, where n = 2.halfWidth + 1.
|
void |
multiply(double f)
Multiply all pixel values (in all bands) in the Image by factor f,
truncating the result if pixels contain integer values.
|
void |
multiply(Image other)
Multiply pixel values of current image by those of another.
|
void |
multiply(Image other,
double f1,
double f2)
Multiply fraction f1 of this image by f2 of the other.
|
void |
nearestExtremeFilter(int halfWidth,
javax.swing.ProgressMonitor monitor)
Replace every pixel in the image by the nearest of the max and min of its
n x n neighbourhood, where n = 2.halfWidth + 1.
|
void |
neutraliseBackground()
Equate the histogram modes of all channels by stretching from the overall
maximum value.
|
Image |
plotResponseCurve(java.util.List<Image> images)
Uses the images to compute the camera response curve and display it as a
graph, as described in "On Being ‘Undigital’ With
Digital Cameras: Extending Dynamic Range By Combining Differently Exposed
Pictures" by S.
|
void |
rankFilter(int halfWidth,
javax.swing.ProgressMonitor monitor)
Replace every pixel in the image by its rank in its n x n neighbourhood,
where n = 2.halfWidth + 1.
|
void |
reapplyColour(Image intensityImage,
Image colourImage)
For combining a monochrome intensity image with a multi-band colour
information image, the 2 images having been created by splitIntensity ().
|
void |
replaceBrighterPixels(Image source)
Assuming the source image has the same dimensions, replace in the present
image any pixels which are brighter in the source (in all channels).
|
void |
rotate(Angle angle)
Rotate the image anticlockwise by the given angle about its centre.
|
void |
rotate(double angleDegs)
Rotate the image anticlockwise by the given angle (in degrees) about
its centre.
|
Image |
rotate180()
Rotate the image by exactly 180 degrees - faster than the
more general method because it requires no pixel interpolation.
|
Image |
rotate270()
Rotate the image by exactly 90 degrees clockwise - faster than the
more general method because it requires no pixel interpolation.
|
Image |
rotate90()
Rotate the image by exactly 90 degrees anticlockwise - faster than the
more general method because it requires no pixel interpolation.
|
void |
saturate(int amount)
Apply a given amount of saturation (arbitrary scale, -100 ..
|
void |
save(java.lang.String filePath)
Save on disc: slower version, has to work out the range of values
occurring in the Image.
|
void |
save(java.lang.String filePath,
RangeDouble range)
Save on disc: faster version if the range of values occurring in the
Image is already known.
|
void |
save(java.lang.String filePath,
RangeInt range)
Save on disc: faster version if the range of values occurring in the
Image is already known.
|
void |
saveAsFITS(java.lang.String filePath) |
void |
scale(double factor,
boolean interpolating)
Scale the image in x and y by the given factor
|
void |
scale(double factor,
boolean interpolating,
java.awt.Point centre)
Scale the image in x and y by the given factor, keeping the centre fixed.
|
java.awt.image.BufferedImage |
scaleDownForDisplay(int factor)
Create a BufferedImage compatible with the display and scale the current
Image down into it by an integer factor (maximum speed).
|
void |
set(java.awt.image.BufferedImage bim)
Set pixel values from bim into the data array.
|
void |
setCalibration(Calibration calib)
Associate a Calibration object with this image.
|
boolean |
setEv()
Try to set exposure value (private field _Ev) from metadata, as
1/f-number-squared x exposure (s) x ISO.
|
void |
setFilePath(java.lang.String filePath)
Record the path to the file in which the image was last saved.
|
void |
setMetadata(Metadata theData)
Associate metadata with the image.
|
void |
setPixel(int x,
int y,
int[] px)
Does nothing if (x, y) is outside the image.
|
void |
setPixel(int x,
int y,
int band,
int px)
Set value into a single band of a pixel without changing the other bands.
|
void |
setPixelDouble(int x,
int y,
double[] px)
Does nothing if (x, y) is outside the image.
|
void |
setPixelDouble(int x,
int y,
int band,
double px)
Set value into a single band of a pixel without changing the other bands.
|
void |
showInfo()
Display information about the current image in a dialogue.
|
Image[] |
splitChannels()
Convert image to an array of monochrome images.
|
Image[] |
splitIntensity()
Create a monochrome image in which each pixel has the value I = sum of the
band levels of the current image plus a colour image in which the pixel in
each band has the value maxLevel * bandLevel / I.
|
void |
subtract(Image image)
Subtract pixel values of other image from this image data array, raising
result by minimum possible so it is always positive.
|
void |
subtractToZero(Image image)
Subtract pixel values of other image from this image data array, clipping
negative results to zero.
|
void |
swapQuadrants()
Rearrange the 4 quadrants of the image - useful for viewing Fourier
Transform results.
|
ByteMask |
threshold(Threshold thresh)
Threshold the image to detect pixels in the range(s) specified by the
given threshold.
|
java.lang.String |
toFoldedString(java.lang.String lineEnd)
Return complete metadata in a form suitable for display.
|
java.lang.String |
toString() |
void |
translate(double dx,
double dy)
Displace the image content by the given offset vector, interpolating
between pixels.
|
void |
translate(int dx,
int dy)
Displace the image content by the given offset vector, a whole number of
pixels.
|
void |
varianceFilter(int halfWidth,
javax.swing.ProgressMonitor monitor)
Replace every pixel in the image by the variance of its n x n
neighbourhood, where n = 2.halfWidth + 1.
|
void add(Image other) throws IncompatibleImageException
IncompatibleImageException
void add(java.awt.image.BufferedImage bim) throws IncompatibleImageException
IncompatibleImageException
int[] addPixel(int x, int y, int[] px)
void addProportion(Image other, double fractionThis, double fractionOther) throws IncompatibleImageException
IncompatibleImageException
void addTranslated(java.awt.image.BufferedImage bim, int dx, int dy) throws IncompatibleImageException
IncompatibleImageException
void addTranslated(java.awt.image.BufferedImage bim, double dx, double dy) throws IncompatibleImageException
IncompatibleImageException
void applyCurve(java.util.List<java.awt.Point> points)
void autoCrop()
void autoStretch(boolean allChannelsSame)
void autoStretch(boolean allChannelsSame, java.awt.Point topLeft, java.awt.Point bottomRight)
ByteMask autoThreshold()
void averageVertically()
void averageVertically(int yMin, int yMax)
void blurGaussian(int nx, int ny, javax.swing.ProgressMonitor monitor)
Image clone()
Image convertToImage8()
Image convertToImage16()
Image convertToImage32()
Image convertToImage64()
void convertToMonochrome()
void convertToMonochrome(double... f)
void convolve(Kernel kernel, javax.swing.ProgressMonitor monitor)
void convolve(double[] horz, double[] vert, javax.swing.ProgressMonitor monitor)
void correctBackground(double scale, int cellFactor)
void crop(java.awt.Point pt1, java.awt.Point pt2)
void deconvolve(Kernel kernel, int nPasses, double weight, javax.swing.ProgressMonitor monitor)
void dispose()
void divide(int n)
void divideByFlatField(Image flat)
void drawRim(int width, java.awt.Color colour)
void fit(int width, int height)
void flipHorizontal()
void flipVertical()
Calibration getCalibration()
int getBitsPerChannel()
int getBytesPerChannel()
RangeInt[] getChannelRanges()
RangeDouble[] getChannelRangesDouble()
double getEv()
java.lang.String getFilePath()
int getHeight()
java.lang.String getImageTypeAsString()
int getMaxLevel()
Metadata getMetadata()
int getNBands()
int[] getPixel(int x, int y)
double[] getPixelDouble(int x, int y)
double[] getPixelDoubleInterpolated(double x, double y)
int[] getPixelInterpolated(double x, double y)
RangeInt getRange()
RangeDouble getRangeDouble()
RangeInt getRangeByRescanning()
RangeDouble getRangeByRescanningDouble()
int getWidth()
Image gnomonicProjection(int focalLength_mm, double detectorWidth_mm, double detectorHeight_mm)
Image inverseGnomonicProjection(int focalLength_mm, double detectorWidth_mm, double detectorHeight_mm)
void invert()
boolean isRaw()
void keepOnlyDifferingPixels(Image other, int threshold)
void meanFilter(int halfWidth, javax.swing.ProgressMonitor monitor)
void medianFilter(int halfWidth, javax.swing.ProgressMonitor monitor)
void multiply(double f)
void multiply(Image other)
void multiply(Image other, double f1, double f2)
void nearestExtremeFilter(int halfWidth, javax.swing.ProgressMonitor monitor)
void neutraliseBackground()
Image plotResponseCurve(java.util.List<Image> images)
void rankFilter(int halfWidth, javax.swing.ProgressMonitor monitor)
void reapplyColour(Image intensityImage, Image colourImage)
void replaceBrighterPixels(Image source)
void rotate(double angleDegs)
void rotate(Angle angle)
Image rotate180()
Image rotate270()
Image rotate90()
void saturate(int amount)
void save(java.lang.String filePath)
void save(java.lang.String filePath, RangeInt range)
void save(java.lang.String filePath, RangeDouble range)
void saveAsFITS(java.lang.String filePath)
void scale(double factor, boolean interpolating)
void scale(double factor, boolean interpolating, java.awt.Point centre)
java.awt.image.BufferedImage scaleDownForDisplay(int factor)
void set(java.awt.image.BufferedImage bim) throws IncompatibleImageException
IncompatibleImageException
void setCalibration(Calibration calib)
boolean setEv()
void setFilePath(java.lang.String filePath)
void setMetadata(Metadata theData)
void setPixel(int x, int y, int[] px)
void setPixel(int x, int y, int band, int px)
void setPixelDouble(int x, int y, double[] px)
void setPixelDouble(int x, int y, int band, double px)
void showInfo()
Image[] splitChannels()
Image[] splitIntensity()
void subtract(Image image) throws IncompatibleImageException
IncompatibleImageException
void subtractToZero(Image image) throws IncompatibleImageException
IncompatibleImageException
void swapQuadrants()
ByteMask threshold(Threshold thresh)
void translate(int dx, int dy)
void translate(double dx, double dy)
java.lang.String toString()
toString
in class java.lang.Object
java.lang.String toFoldedString(java.lang.String lineEnd)
void varianceFilter(int halfWidth, javax.swing.ProgressMonitor monitor)