All Packages Class Hierarchy This Package Previous Next Index
Class image.ImageProc
java.lang.Object
|
+----image.ImageProc
- public class ImageProc
- extends Object
Some common image processing functions
- Author:
- Di Zhong (Columbia University)
-
ImageProc()
-
-
averageSmooth(float[][], int)
- Smooth image by taking average over a window
-
dilation(boolean[][], float)
- Morphological operation: dilation.
-
erosion(boolean[][], float)
- Morphological operation: erosion.
-
fitline(int, int[], int[], Point, Point)
- FitLine from sample points
-
gaussianSmooth(float[][], float)
- Gaussian smooth, note original image array will be over written
-
gaussianSmooth0(float[][], float)
- Gaussian smooth, return smoothed image
-
getCenter(boolean[][])
- Compute the centroid of a given mask
-
luv2rgb(float, float, float)
- Convert L*u*v* to RGB
-
medianfilter(float[][][])
- Median filtering (3x3 window)
-
palette(float[][][], int, float[])
- Build quantization table (color palette) using kmeans clustering
-
perimeter(Polygon)
- Compute the perimeter of a given polygon
-
quantize(float[][][], float[][], float[])
- Quantize an image given a quantization table (color palette)
-
rgb2luv(int, int, int, float[])
- Convert RGB to L*u*v*
ImageProc
public ImageProc()
fitline
public static final void fitline(int npoints,
int xpoints[],
int ypoints[],
Point endpt0,
Point endpt1)
- FitLine from sample points
- Parameters:
- npoints - number of sample points
- xpoints - x-coordinates
- ypoints - y-coordinates
- eddpt0 - output, one end point
- eddpt1 - output, another end point
- See Also:
- fitpolys
rgb2luv
public static final void rgb2luv(int r,
int g,
int b,
float luv[])
- Convert RGB to L*u*v*
- Parameters:
- r - red value(0-255)
- g - green value(0-255)
- b - blue value(0-255)
- luv - output L*u*v* triple (i.e. float[3])
luv2rgb
public static final int[] luv2rgb(float l,
float u,
float v)
- Convert L*u*v* to RGB
- Parameters:
- l - L* value
- u - u* value
- v - v* value
medianfilter
public static final float[][][] medianfilter(float input[][][])
- Median filtering (3x3 window)
- Parameters:
- input - input image (float, 3 channels)
palette
public static final float[][] palette(float img[][][],
int ncolors,
float w[])
- Build quantization table (color palette) using kmeans clustering
- Parameters:
- img - image array (three channels)
- ncolors - number of colors
- w - weighting of three color channels
quantize
public static final void quantize(float img[][][],
float clrs[][],
float w[])
- Quantize an image given a quantization table (color palette)
- Parameters:
- img - image array (three channels), it will be overwritten
- clrs - color palette
- w - weighting of three color channels
- See Also:
- palette
gaussianSmooth
public static final void gaussianSmooth(float img[][],
float sigma)
- Gaussian smooth, note original image array will be over written
- Parameters:
- img - two dimensional image array (gray level)
- sigma - smooth coefficient
gaussianSmooth0
public static final float[][] gaussianSmooth0(float img[][],
float sigma)
- Gaussian smooth, return smoothed image
- Parameters:
- img - two dimensional image array (gray level)
- sigma - smooth coefficient
averageSmooth
public static final float[][] averageSmooth(float img[][],
int rad)
- Smooth image by taking average over a window
- Parameters:
- img - 2D float array of a gray-level image
- rad - radius of averaging widow
erosion
public static boolean[][] erosion(boolean mask[][],
float rad)
- Morphological operation: erosion. Return result mask array (return null if there is no pixel masked after erosison)
- Parameters:
- mask - 2D binary mask
- rad - radius of erosion operator
dilation
public static boolean[][] dilation(boolean mask[][],
float rad)
- Morphological operation: dilation. Return result mask array.
Note, return mask has the same size as original one.
If expanded mask is desierd, add margin before dilation
- Parameters:
- mask - 2D binary mask
- rad - radius of dilation operator
perimeter
public static float perimeter(Polygon p)
- Compute the perimeter of a given polygon
- Parameters:
- p - polygon
getCenter
public static Point getCenter(boolean p[][])
- Compute the centroid of a given mask
- Parameters:
- p - 2-d binary mask
All Packages Class Hierarchy This Package Previous Next Index