|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.c3d.image.Jimage
TeX \def\frac#1#2{(#1)\div(#2)} The class Jimage\footnote{\copyright Turing Institute, 1998} is an abstract class to support image processing operations. It also implements the java.awt ImageConsumer class enabling it to be loaded with image data from the java system. If Jimages are to be displayed, one obtains a statdard awt ImageProducer from the Jimage useing the {\tt getProducer} method. This can then be used to construct images that can be displayed in java awt windows. \subsection*{Numeric representation of pixels } The Java language only supports signed bytes and signed shorts. The internal representation of pixels is therefore always as signed numbers. Since the accuracy to which pixels are stored may vary between subclasses of the Jimage type, the following conventions are addopted. \begin{enumerate} \item When pixels are treated as real numbers, they are considered to be in the range $-1.0$ to plus $1.0$. All arithmetic operations on pixels should be compatible with this model. \item When 8 bit pixel data is input to the Jimage from the Java AWT, the 8 bit AWT data is interpreted such that a pixel value of 0 is treated as equal to -1.0 and a pixel value of 255 is treated as equal to 1.0. \item When data is stored internally as 16 bit pixels, these are treated as fixed point signed binary fractions. \end{enumerate} \begin{table} \caption{Table mapping different representations of pixels } \label{pixrep} \begin{tabular}{lrrrr} &unsigned& bytes& shorts& float\\ min value& 0 &-128& -2048& 0\\ maxval& 255& 127& 20477 &1\\ medianval $\mu$&127.5& -0.5 &-0.5 &0\\ range $\rho$&255 &255 &255 &1\\ \end{tabular} \end{table} As shown in table \ref{pixref} a pixel $p_r$in representation r is converted to a pixel $P_s$ in representation s by the operation: $$p_s=\mu_s+\frac{\rho_s(p_r-\mu_r)}{\rho_r}$$
Field Summary | |
static int |
ALPHAPLANE
|
static int |
BLUEPLANE
|
static int |
brho
TeX signed byte pixel range |
java.awt.image.ColorModel |
colorModel
|
static float |
fmax
|
static float |
fmin
|
static float |
fmu
TeX float median |
static float |
frho
|
static int |
GREENPLANE
|
int |
height
TeX The number of pixels high and wide that the image occupies. |
int |
hints
TeX required by image consumer but not used |
static int |
MONOCHROME
|
int |
planes
TeX The number of pixels high and wide that the image occupies. |
static int |
REDPLANE
|
static int |
RGB
|
static int |
smax
|
static int |
smin
|
static int |
srho
TeX signed short pixel range |
static int |
umin
TeX lowest value of an unsigned pixel |
static int |
urho
TeX unsigned byte pixel range |
int |
width
TeX The number of pixels high and wide that the image occupies. |
Constructor Summary | |
Jimage()
|
Method Summary | |
abstract Jimage |
abs()
|
int |
arity()
TeX Returns the number of planes in an image. |
static float |
bpixelTofpixel(byte bpixel)
|
static short |
bpixelTospixel(short b)
|
static int |
bpixelToupixel(byte b)
|
static byte |
bsaturate(double i)
TeX Return i in the range of byte pixels |
double |
cardinality()
TeX Returns the number of pixels in an image |
com.c3d.util.atomic.Universal |
concat(com.c3d.util.atomic.Universal b)
|
Jimage |
convolve(double[] k)
TeX convolve with symetrical seperable kernel. |
abstract Jimage |
convolve(double[][] kernel)
|
com.c3d.util.atomic.Universal |
divide(double n)
|
float |
fmodulus()
TeX Denote x.fmodulus() by $|x|$. |
abstract float |
fpixel(int x,
int y,
int plane)
TeX Returns the pixel in the range -1 to +1. |
static byte |
fpixelTobpixel(float fpixel)
|
static short |
fpixelTospixel(float fpixel)
TeX $$p_s=\mu_s+\frac{\rho_s(p_r-\mu_r)}{\rho_r}$$ |
static int |
fpixelToupixel(float fpixel)
|
static float |
fsaturate(double i)
|
static float |
fsaturate(float i)
TeX return i within the range of float pixels $(i |
java.awt.Image |
getAWTImage()
|
boolean |
getImage(java.lang.String fileName)
TeX Load the image from the specified file. |
java.awt.image.ImageProducer |
getProducer()
|
Jimage |
getScaledInstance(int nwidth,
int nheight)
TeX This replicates the functionality of the get scaled instance method of the AWT image class. |
Jimage |
getScaledInstance(int nwidth,
int nheight,
int ndepth)
TeX This method allows the depth as well as area of an image to be altered if it is reduced the planes are aggregated if increased they are interpolated |
int |
hashCode()
|
void |
imageComplete(int s)
|
float |
l1Norm()
TeX first sum the planes to a grey scale image and then return the sum of the absolute values of the pixels |
float |
l2Norm()
TeX first sum the planes to a grey scale image and then return the sqrt of the sum of the squared values of the pixels |
boolean |
lessthan(com.c3d.util.atomic.Universal b)
TeX one image less than another if all pixels less than corresponding ones, thus it can be implemented by injecting $<$ between the elements of a and b, and then applying $\times/$ to the result |
java.util.Enumeration |
members()
TeX The members ar the planes, so that $op / i$ for i an image will reduce the image to one with a single plane |
com.c3d.util.atomic.Universal |
minus(double n)
|
com.c3d.util.atomic.Numeric |
modulus()
|
com.c3d.util.atomic.Numeric |
numberOfElements()
TeX {\bf Methods implementing Struct} |
abstract Jimage |
oneOfThese()
TeX Returns an instance of the particular sub class of images to which the parent belongs |
com.c3d.util.atomic.Universal |
plus(double n)
|
void |
putJPEGImage(java.lang.String fileName,
int quality)
TeX Outputs the image to a jpeg file |
com.c3d.util.atomic.Universal |
reduce(com.c3d.operators.Doperator op)
|
Jimage |
RGB2YUV()
TeX $$ y=0.6 g + 0.3 r + 0.1 b$$ $$u = b-y$$ $$0=r-y-v$$ |
int |
rgbpixel(int x,
int y)
TeX Converts the plane information into a pixel in the direct colour model of java. |
void |
setColorModel(java.awt.image.ColorModel cm)
|
void |
setHints(int h)
|
abstract void |
setPixel(int x,
int y,
int plane,
double pix)
|
void |
setPixel(int x,
int y,
int plane,
int p)
|
void |
setPixel(int x,
int y,
int plane,
short p)
|
void |
setProperties(java.util.Hashtable props)
|
void |
setSubImage(int x,
int y,
int z,
Jimage im)
TeX Update an area of an image with another one. |
Jimage |
shift(int i)
|
abstract short |
spixel(int x,
int y,
int plane)
TeX return signed short pixel |
static byte |
spixelTobpixel(short s)
TeX convert a 12 bit short pixel to a signed byte |
static float |
spixelTofpixel(int spixel)
|
static float |
spixelTofpixel(short spixel)
|
static int |
spixelToupixel(int spixel)
TeX convert short pixel to unsigned |
Jimage |
sqr()
|
static short |
ssaturate(double i)
TeX Return i in the rang eof short pixels |
abstract Jimage |
subImage(int x,
int y,
int dx,
int dy)
|
com.c3d.util.atomic.Universal |
subscript(int i)
TeX Returns the ith plane |
com.c3d.util.atomic.Universal |
subscript(com.c3d.util.atomic.Universal I)
TeX Subscription by a number returns the Ith plane of the image. |
float |
sum(int z)
TeX Return the sum of the floating point pixels in the z plane |
com.c3d.util.atomic.Universal |
times(double n)
|
java.lang.String |
toString()
|
java.lang.String |
toString(char c)
|
abstract int |
upixel(int x,
int y,
int plane)
|
abstract com.c3d.util.atomic.Universal |
Upixel(int x,
int y,
int plane)
|
static byte |
upixelTobpixel(int upixel)
|
static float |
upixelTofpixel(int upixel)
|
static short |
upixelTospixel(int upixel)
TeX convert short pixel from unsigned |
static int |
usaturate(double i)
|
Jimage |
warp(Jimage dx,
Jimage dy)
TeX Images dx and dy contain the discrepancy in x and y positions from which source pixels to be obtained let $r$ be the result, $s$ the source then $$r_{i,j}=s_{i+dx_{i,j},j+dy_{i,j}}$$ |
Jimage |
YUV2RGB()
TeX $$b=u+y$$ $$r=u+v$$ $$g=(y-0.3r-0.1b)/0.6$$ |
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
notify,
notifyAll,
wait,
wait,
wait |
Field Detail |
public static final int umin
public static final int smin
public static final float fmin
public static final int smax
public static final float fmax
public static final int urho
public static final int brho
public static final int srho
public static final float frho
public static final float fmu
public int hints
public java.awt.image.ColorModel colorModel
public int height
public int width
public int planes
public static final int REDPLANE
public static final int GREENPLANE
public static final int BLUEPLANE
public static final int ALPHAPLANE
public static final int MONOCHROME
public static final int RGB
Constructor Detail |
public Jimage()
Method Detail |
public static byte fpixelTobpixel(float fpixel)
public static final byte spixelTobpixel(short s)
public static final short bpixelTospixel(short b)
public static int bpixelToupixel(byte b)
public static byte upixelTobpixel(int upixel)
public static short upixelTospixel(int upixel)
public static int spixelToupixel(int spixel)
public static float upixelTofpixel(int upixel)
public static float bpixelTofpixel(byte bpixel)
public static short fpixelTospixel(float fpixel)
public static float spixelTofpixel(int spixel)
public static int fpixelToupixel(float fpixel)
public static float spixelTofpixel(short spixel)
public static float fsaturate(float i)
public static float fsaturate(double i)
public static byte bsaturate(double i)
public static short ssaturate(double i)
public static int usaturate(double i)
public abstract float fpixel(int x, int y, int plane)
public abstract short spixel(int x, int y, int plane)
public abstract void setPixel(int x, int y, int plane, double pix)
public void setPixel(int x, int y, int plane, int p)
public void setPixel(int x, int y, int plane, short p)
public abstract int upixel(int x, int y, int plane)
public int rgbpixel(int x, int y)
public Jimage warp(Jimage dx, Jimage dy) throws java.lang.CloneNotSupportedException
public abstract com.c3d.util.atomic.Universal Upixel(int x, int y, int plane)
public abstract Jimage convolve(double[][] kernel)
public Jimage convolve(double[] k)
public abstract Jimage abs()
public abstract Jimage subImage(int x, int y, int dx, int dy)
public void setSubImage(int x, int y, int z, Jimage im)
public Jimage sqr()
public float l1Norm()
public float l2Norm()
public float sum(int z)
public float fmodulus()
public java.util.Enumeration members()
public Jimage RGB2YUV()
public Jimage YUV2RGB()
public java.awt.Image getAWTImage()
public java.awt.image.ImageProducer getProducer()
public abstract Jimage oneOfThese()
public Jimage getScaledInstance(int nwidth, int nheight, int ndepth)
public Jimage getScaledInstance(int nwidth, int nheight)
public boolean getImage(java.lang.String fileName)
public void putJPEGImage(java.lang.String fileName, int quality) throws java.io.IOException
public void setProperties(java.util.Hashtable props)
public void setHints(int h)
public void setColorModel(java.awt.image.ColorModel cm)
public void imageComplete(int s)
public com.c3d.util.atomic.Universal subscript(com.c3d.util.atomic.Universal I)
public com.c3d.util.atomic.Universal subscript(int i)
public int arity()
public double cardinality()
public boolean lessthan(com.c3d.util.atomic.Universal b)
public Jimage shift(int i)
public com.c3d.util.atomic.Numeric numberOfElements()
public java.lang.String toString(char c)
public java.lang.String toString()
public com.c3d.util.atomic.Numeric modulus()
public com.c3d.util.atomic.Universal reduce(com.c3d.operators.Doperator op)
public int hashCode()
public com.c3d.util.atomic.Universal times(double n)
public com.c3d.util.atomic.Universal plus(double n)
public com.c3d.util.atomic.Universal minus(double n)
public com.c3d.util.atomic.Universal divide(double n)
public com.c3d.util.atomic.Universal concat(com.c3d.util.atomic.Universal b)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |