![]() | [using it] | Interface Manipulation Package v4.0 (2008-06-25) | ![]() | ©copyright | ![]() |
java.lang.Objectjava.awt.Image
java.awt.image.BufferedImage
imp.ima.RgbImage
public class RgbImage
Encapsulates a RGB color image with standard algorithms.
Field Summary |
---|
Fields inherited from class java.awt.image.BufferedImage |
---|
TYPE_3BYTE_BGR, TYPE_4BYTE_ABGR, TYPE_4BYTE_ABGR_PRE, TYPE_BYTE_BINARY, TYPE_BYTE_GRAY, TYPE_BYTE_INDEXED, TYPE_CUSTOM, TYPE_INT_ARGB, TYPE_INT_ARGB_PRE, TYPE_INT_BGR, TYPE_INT_RGB, TYPE_USHORT_555_RGB, TYPE_USHORT_565_RGB, TYPE_USHORT_GRAY |
Fields inherited from class java.awt.Image |
---|
SCALE_AREA_AVERAGING, SCALE_DEFAULT, SCALE_FAST, SCALE_REPLICATE, SCALE_SMOOTH, UndefinedProperty |
Fields inherited from interface java.awt.Transparency |
---|
BITMASK, OPAQUE, TRANSLUCENT |
Constructor Summary | |
---|---|
RgbImage(BufferedImage image)
Creates an image from the RgbImage. |
|
RgbImage(int width,
int height,
int[] pixels)
Creates an image of the given sizes from the given buffer |
|
RgbImage(String location)
Creates an image reading the given URL. |
Method Summary | |
---|---|
RgbImage |
getChannel(String channel)
Returns maps of some image channels. |
RgbImage |
getCrop(int u,
int v,
int width,
int height)
Returns a sub-image of upper-left corner (u, v) and size (width, height). |
RgbImage |
getEdgeMap(int window,
int threshold,
String channel)
Returns maps related to the image edges. |
RgbImage |
getFiltered(RgbFilter filter)
Returns a filtered image of this. |
RgbImage |
getGamma(double gamma)
Returns a normalized intensity image. |
int |
getHeight()
Gets the image height |
RgbImage |
getNoisy(double magnitude)
Returns an image with an additional Gaussian noise. |
int[] |
getPixels()
Gets the image pixels The [width*height] image buffer contains row by row pixels of the form 0xRRGGBB where RR, GG and BB are red, green and blue byte values. |
RgbImage |
getRectification(double[] H)
Returns a geometrically rectification of the image. |
int[] |
getRegions(int window,
int threshold)
Returns a region's map of the image. |
RgbImage |
getScaled(int size)
Returns an image of lower/higher size (multi-scaling). |
RgbImage |
getSmooth(int window)
Returns a smoothed image. |
int |
getWidth()
Gets the image width |
void |
save(String location)
Saves the image in an URL. |
RgbImage |
subtract(double lambda,
double mu,
RgbImage val)
Returns an image whose values are (lambda this - mu val) for each pixel. |
String |
toString()
Returns a string view of the image with size and basic parameters as a string. |
Methods inherited from class java.awt.image.BufferedImage |
---|
addTileObserver, coerceData, copyData, createGraphics, getAlphaRaster, getColorModel, getData, getData, getGraphics, getHeight, getMinTileX, getMinTileY, getMinX, getMinY, getNumXTiles, getNumYTiles, getProperty, getProperty, getPropertyNames, getRaster, getRGB, getRGB, getSampleModel, getSource, getSources, getSubimage, getTile, getTileGridXOffset, getTileGridYOffset, getTileHeight, getTileWidth, getTransparency, getType, getWidth, getWritableTile, getWritableTileIndices, hasTileWriters, isAlphaPremultiplied, isTileWritable, releaseWritableTile, removeTileObserver, setData, setRGB, setRGB |
Methods inherited from class java.awt.Image |
---|
flush, getAccelerationPriority, getCapabilities, getScaledInstance, setAccelerationPriority |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public RgbImage(BufferedImage image)
public RgbImage(int width, int height, int[] pixels)
width
- Image width.height
- [optional, default is image width] Image height.pixels
- [optional, default is empty buffer] Optional pixels buffer as described in getPixels().public RgbImage(String location) throws IOException
IOException
Method Detail |
---|
public RgbImage getChannel(String channel)
channel
- Channel name: red | 0x000000RR red value of the pixel | ||||||||||||
green | 0x000000GG green value of the pixel | ||||||||||||
blue | 0x000000BB blue value of the pixel | ||||||||||||
intensity | Intensity value of the pixel | ||||||||||||
saturation | Saturation, the 0-100% RGB min/max ratio | ||||||||||||
hue | Hue i.e. the Smith hexagonal pyramid angle 0-180 in deg/2:
| ||||||||||||
monochrome | Intensity value of the pixel in the main direction of the color space | ||||||||||||
binary | Intensity optimal thresholding along the main direction of the color space |
public RgbImage getCrop(int u, int v, int width, int height)
public RgbImage getEdgeMap(int window, int threshold, String channel)
window
- [optional, default is 2] Smoothing window in pixel.threshold
- [optional, default is 10] Gradient threshold.channel
- Channel name: contrast | Contrast (Mexican hat operator) |
edges | Edges (gradient magnitude with non maxima suppression) |
gradient | Thresholded gradient magnitude |
orientation | Thresholded gradient orientation in [-Pi/2..Pi/2] returning o = 0.5 * 180 / Pi * orientation + 127 |
gradientX | Thresholded gradient horizontal component / 2 + 127 |
gradientY | Thresholded gradient vertical component / 2 + 127 |
curvature | Plessey curvature map |
corners | Thresholded corners map (Plessey curvature map maxima) |
public RgbImage getFiltered(RgbFilter filter)
public RgbImage getGamma(double gamma)
gamma
- [optional, default is 2] Intensity correction factor > 1: typically 2; the value 0 corresponds to an intensity equalization.
With a value < 0 the image itself is returned without correction.
public int getHeight()
getHeight
in interface RenderedImage
getHeight
in class BufferedImage
public RgbImage getNoisy(double magnitude)
magnitude
- Gaussian noise magnitudepublic int[] getPixels()
public RgbImage getRectification(double[] H)
H
- affine/projective transformation matrix.public int[] getRegions(int window, int threshold)
window
- [optional, default is 2] Smoothing window in pixel.threshold
- [optional, default is 10] Gradient threshold.
public RgbImage getScaled(int size)
size
- Size factor: public RgbImage getSmooth(int window)
window
- Smoothing window in pixel, default is 2.public int getWidth()
getWidth
in interface RenderedImage
getWidth
in class BufferedImage
public void save(String location) throws IOException
IOException
public RgbImage subtract(double lambda, double mu, RgbImage val)
lambda
- Multiplicative factor, default is 1.mu
- Multiplicative factor, default is 1.val
- An image of the same size.public String toString()
toString
in class BufferedImage