The Image.Grey structure


Synopsis

signature IMAGE_GREY
structure Image.Grey : IMAGE_GREY
The Image.Grey structure implements processing and analysis functions specific to grey level images (real Image.image).

Interface

type image = real Array2.array

val normalize : (real * real) -> image -> image
val maximizeContrast : image -> image

val writePGMA : image * string -> unit
val writePGM : image * string -> unit
val readPGM : string -> image

val + : image * image -> image
val - : image * image -> image
val * : image * image -> image
val / : image * image -> image

val product : image * image -> image

val histogram : image -> int list

val jointHistogram : image * image -> int Array2.array

val shrink : image * real -> image

val convolveRows : real vector -> image -> image
val convolveCols : real vector -> image -> image
val convolve : real Array2.array -> image -> image

Details

type image = real Array2.array
The grey image type.

val normalize : (min real * max real) -> img image -> image
Normalize pixels in img from the range (min,max) to the range (0.0,1.0). If any pixel value is outside of (min,max), raise Fail.

val maximizeContrast : image -> image
Normalize pixels to the range (0.0,1.0).

val writePGMA : image * string -> unit
Write an image to file using the PGMA (ASCII PGM) file format.

val writePGM : image * string -> unit
Write an image to file using the PGM (binary) file format.

val readPGM : string -> image
Read an image from disk (either PGM or PGMA format).

val + : image * image -> image
val - : image * image -> image
val * : image * image -> image
val / : image * image -> image
Pixel-wise arithmetic of two images.

val product : image * image -> image
Compute the product of two images, as if they are matrices.

val histogram : image -> int list
Map pixel values from (0.0,1.0) to the discrete range (0,255) and compute the 256-level histogram of that image. If any pixel value in the input image is outside (0.0,1.0), raise Fail.

val jointHistogram : image * image -> int Array2.array
Map pixel values in both input images from (0.0,1.0) to the discrete range (0,255) and compute the 256-level joint histogram of those images. If any pixel value in the input images is outside (0.0,1.0), raise Fail.

val shrink : image * threshold real -> image
Shrink the magnitude of each pixel value in an image. For each pixel value p, if |p| is less than threshold the resultant pixel value will be 0.0, otherwise it will be p - threshold only if p > 0.0, or p + threshold only if p < 0.0.

val convolveRows : kernel real vector -> image -> image
Perform row-wise 1D discrete periodic convolution with kernel.

val convolveCols : kernel real vector -> image -> image
Perform column-wise 1D discrete periodic convolution with kernel.

val convolve : kernel real Array2.array -> image -> image
Perform 2D discrete periodic convolution with kernel.


Last modified: Sat Dec 17 19:32:27 Mountain Standard Time 2005
rlpm [ -at- ] cs.unm.edu