Main Page   Class Hierarchy   Alphabetical List   Compound List   Compound Members  

prapi::Image Class Reference

#include <Image.h>

List of all members.


Detailed Description

Image is a static class which includes funtions for image analysis.


Static Public Methods

template<class T, class U> util::Matrix< T > convolve (const util::Matrix< T > &mat, const ConvolutionMask< U > &mask, BorderAction borderAction=BORDER_CROP) throw (ImageException&)
 Perform a two-dimensional convolution on the matrix using the given convolution mask.

template<class T> util::List< util::Matrix<
T > > 
split (const util::Matrix< T > &mat, int width, int height, int startx=0, int starty=0)
 Split an matrix into sub-matrices.

template<class T, class U> util::List< util::Matrix<
T > > 
split (const util::Matrix< T > &mat, const util::Matrix< U > &mask, int width, int height, util::List< std::string > &coordinates, U value=-1) throw (ImageException&)
 Split an matrix into sub-matrices.

template<class T> util::Matrix< T > scaleRange (const util::Matrix< T > &input, T max)
 Scale the values in a matrix to the range [0,max].

template<class T> util::Matrix< T > invert (const util::Matrix< T > &image)
 Invert the values in an image.

template<class T, class U> void mask (util::Matrix< T > &mat, const util::Matrix< U > &mask)
 Perform a mask operation on an image.

template<class T, int comps> util::Matrix< T > getChannel (int c, const util::Matrix< Color< T, comps > > &mat)
 Get a color channel from a multi-channel image.

template<class T, int comps> void setChannel (int c, const util::Matrix< T > &chn, util::Matrix< Color< T, comps > > &mat) throw (ImageException&)
 Set a color channel in a multi-channel image.

template<class T, int comps> util::Matrix< Color< double,
comps > > 
normalize (const util::Matrix< Color< T, comps > > &mat)
 Normalize a color image.

template<class T, class U, int comps> util::Matrix< Color< double,
comps > > 
transform (const util::Matrix< Color< U, comps > > &mat, const util::Matrix< T > &tr) throw (util::MatrixException&)
 Premultiply each color in a multi-channel color image by a matrix.

template<class T, int comps> util::Matrix< T > average (const util::Matrix< Color< T, comps > > &mat)
 Get a one-channel average (intensity) image from a multi-channel color image.

util::Matrix< Color< double, 3 > > XYZToCIELAB (const util::Matrix< Color< double, 3 > > &mat, const Color< double, 3 > &whitePoint)
 Convert a color image from the CIE XYZ color space to CIE LAB.

template<class T> util::Matrix< Color< T, 3 > > RGBToHSV (const util::Matrix< Color< T, 3 > > &mat)
 Convert an image in the RGB color space to HSV.

template<class T> util::Matrix< Color< T, 3 > > HSVToRGB (const util::Matrix< Color< T, 3 > > &mat)
 Convert an image in the HSV color space to RGB.


Member Function Documentation

template<class T, int comps>
util::Matrix< T > prapi::Image::average const util::Matrix< Color< T, comps > > &    mat [static]
 

Get a one-channel average (intensity) image from a multi-channel color image.

The returned image is of the same size as the input image, and contains the average of each color channel at each pixel.

template<class T, class U>
util::Matrix< T > prapi::Image::convolve const util::Matrix< T > &    mat,
const ConvolutionMask< U > &    mask,
BorderAction    borderAction = BORDER_CROP
throw (ImageException&) [static]
 

Perform a two-dimensional convolution on the matrix using the given convolution mask.

Parameters:
mat  The matrix which wanted to operate.
mask  the convolution mask
borderAction  how to handle the borders
Returns:
the result of the convolution

template<class T, int comps>
util::Matrix< T > prapi::Image::getChannel int    c,
const util::Matrix< Color< T, comps > > &    mat
[static]
 

Get a color channel from a multi-channel image.

Parameters:
c  The index of the color channel.
mat  A color image.

template<class T>
util::Matrix< Color< T, 3 > > prapi::Image::HSVToRGB const util::Matrix< Color< T, 3 > > &    mat [static]
 

Convert an image in the HSV color space to RGB.

See also:
ColorTransform::HSVtoRGB

template<class T>
util::Matrix< T > prapi::Image::invert const util::Matrix< T > &    image [static]
 

Invert the values in an image.

The inversion is performed by finding the maximum value, and subtracting all pixel values from it.

template<class T, class U>
void prapi::Image::mask util::Matrix< T > &    mat,
const util::Matrix< U > &    mask
[static]
 

Perform a mask operation on an image.

Sets all pixels in mat to zero that have a corresponding zero in mask. Mat and mask must be of equal sizes.

Parameters:
mat  The image to be masked.
mask  The mask, with non-zero values on pixels that should be preserved.

template<class T, int comps>
util::Matrix< Color< double, comps > > prapi::Image::normalize const util::Matrix< Color< T, comps > > &    mat [static]
 

Normalize a color image.

Return an image where each color channel has been divided by the sum of all channels.

template<class T>
util::Matrix< Color< T, 3 > > prapi::Image::RGBToHSV const util::Matrix< Color< T, 3 > > &    mat [static]
 

Convert an image in the RGB color space to HSV.

See also:
ColorTransform::RGBtoHSV

template<class T, int comps>
void prapi::Image::setChannel int    c,
const util::Matrix< T > &    chn,
util::Matrix< Color< T, comps > > &    mat
throw (ImageException&) [static]
 

Set a color channel in a multi-channel image.

Parameters:
c  The index of the color channel.
chn  the color channel (whose size must be equal to the color image)
mat  the color image.
Exceptions:
ImageException  & if channel and image sizes differ

template<class T, class U>
util::List< util::Matrix< T > > prapi::Image::split const util::Matrix< T > &    mat,
const util::Matrix< U > &    mask,
int    width,
int    height,
util::List< std::string > &    coordinates,
  value = -1
throw (ImageException&) [static]
 

Split an matrix into sub-matrices.

The maximum number of sub-matrices is taken starting from the first possible left corner, which means first place where are 1 in the binary matrix. The sub-matrices are stored in a list in horizontal raster-scan order.

Parameters:
mat  The matrix wanted to split.
width  the width of the sub-matrices
height  the height of the sub-matrices
mat  The binary image which indictaes the placment of areas to split.
coordinates  The list of strings where the coordinates will be saved. The order is the same as in matrices.
value  The value from which value areas are wanted. If -1 all nonzero areas will be split.

template<class T>
util::List< util::Matrix< T > > prapi::Image::split const util::Matrix< T > &    mat,
int    width,
int    height,
int    startx = 0,
int    starty = 0
[static]
 

Split an matrix into sub-matrices.

The maximum number of sub-matrices is taken starting from the given upper left corner. The sub-matrices are stored in a list in horizontal raster-scan order.

Parameters:
mat  The matrix wanted to split.
width  the width of the sub-matrices
height  the height of the sub-matrices
startx  the x coordinate for the start position (upper left corner)
starty  the y coordinate for the start position (upper left corner)

template<class T, class U, int comps>
util::Matrix< Color< double, comps > > prapi::Image::transform const util::Matrix< Color< U, comps > > &    mat,
const util::Matrix< T > &    tr
throw (util::MatrixException&) [static]
 

Premultiply each color in a multi-channel color image by a matrix.

Return a new image with each color value transformed by the linear tranformation.

Matrix< Color< double, 3 > > prapi::Image::XYZToCIELAB const util::Matrix< Color< double, 3 > > &    mat,
const Color< double, 3 > &    whitePoint
[static]
 

Convert a color image from the CIE XYZ color space to CIE LAB.

Parameters:
mat  the color image to be converted
whitePoint  the XYZ coordinates of the white point of the image equipment.
See also:
ColorTransform::XYZtoCIELAB


The documentation for this class was generated from the following files:
Documentation generated on 11.09.2003 with Doxygen.
The documentation is copyrighted material.
Copyright © Topi Mäenpää 2003. All rights reserved.