OvImageT< T > Class Template Reference

Internal image class with overloaded math operators and utility functions. More...

#include <OvImageT.h>

List of all members.

Public Member Functions

 OvImageT ()
 OvImageT (int height, int width, int nColorChannels)
 OvImageT (const OvImageT< T > &srcImage, bool CopyData=true)
template<typename C>
 OvImageT (const OvImageT< C > &srcImage, bool CopyData=true)
virtual ~OvImageT ()
void getDimensions (int &height, int &width, int &nColorChannels) const
int getHeight () const
int getWidth () const
int getChannels () const
void resetDimensions (int height, int width, int nColorChannels=1)
void reshape (int height, int width, int nColorChannels=1)
void normalizeIntensityRange ()
void print (void)
T & operator() (int row, int column=0, int channel=0)
OvImageT< T > & operator= (const OvImageT< T > &rhsImage)
OvImageT< T > & operator= (const T &rhs)
template<typename C>
OvImageT< T > & operator= (const OvImageT< C > &rhsImage)
bool copyFromAdapter (const OvImageAdapter &iadapter)
bool copyToAdapter (OvImageAdapter &iadapter)
bool copyMasked (const OvImageT< bool > &mask, const OvImageT< T > &srcImage)
bool copyMasked (const OvImageT< bool > &mask, const T &value)
bool copyChannel (OvImageT< T > &input, int inputchannel, int outputchannel)
const OvImageT< T > getSubImage (int rowLo=-1, int rowHi=-1, int columnLo=-1, int columnHi=-1, int channelLo=-1, int channelHi=-1)
OvImageT< T > & operator+= (const OvImageT< T > &rhs)
OvImageT< T > & operator+= (const T &rhs)
OvImageT< T > & operator-= (const OvImageT< T > &rhs)
OvImageT< T > & operator-= (const T &rhs)
OvImageT< T > & operator *= (const OvImageT< T > &rhs)
OvImageT< T > & operator *= (const T &rhs)
OvImageT< T > & operator/= (const OvImageT< T > &rhs)
OvImageT< T > & operator/= (const T &rhs)
OvImageT< T > & operator++ ()
OvImageT< T > & operator-- ()
const OvImageT< T > operator++ (int)
const OvImageT< T > operator-- (int)
const OvImageT< T > operator- ()
const OvImageT< T > operator+ ()
const OvImageT< bool > operator! () const
void setToRandom (double lowerbound, double upperbound)
void setToMeshgridX (T x1, T x2, T y1, T y2, T dx=1, T dy=1)
void setToMeshgridY (T x1, T x2, T y1, T y2, T dx=1, T dy=1)
void setToGaussian (int size, double sigma)
void setToGaborX (int size, double sigma, double period, double phaseshift)
void setToGaborY (int size, double sigma, double period, double phaseshift)
void setToGaborOriented (int size, double sigma, double period, double angle, double phaseshift)
OvImageT< double > getGaborPhaseStack ()
void setToGray ()

Protected Attributes

int mHeight
int mWidth
int mChannels
int mHeightTimesWidth
int mSize
T * mData

Friends

template<typename C>
const OvImageT< C > operator+ (const OvImageT< C > &i1, const OvImageT< C > &i2)
template<typename C>
const OvImageT< C > operator+ (const double i1, const OvImageT< C > &i2)
template<typename C>
const OvImageT< C > operator+ (const OvImageT< C > &i1, const double i2)
template<typename C>
const OvImageT< C > operator- (const OvImageT< C > &i1, const OvImageT< C > &i2)
template<typename C>
const OvImageT< C > operator- (const double i1, const OvImageT< C > &i2)
template<typename C>
const OvImageT< C > operator- (const OvImageT< C > &i1, const double i2)
template<typename C>
const OvImageT< C > operator * (const OvImageT< C > &i1, const OvImageT< C > &i2)
template<typename C>
const OvImageT< C > operator * (const double i1, const OvImageT< C > &i2)
template<typename C>
const OvImageT< C > operator * (const OvImageT< C > &i1, const double i2)
template<typename C>
const OvImageT< C > operator/ (const OvImageT< C > &i1, const OvImageT< C > &i2)
template<typename C>
const OvImageT< C > operator/ (const double i1, const OvImageT< C > &i2)
template<typename C>
const OvImageT< C > operator/ (const OvImageT< C > &i1, const double i2)
template<typename C>
const OvImageT< bool > operator< (const OvImageT< C > &i1, const OvImageT< C > &i2)
template<typename C>
const OvImageT< bool > operator< (const double i1, const OvImageT< C > &i2)
template<typename C>
const OvImageT< bool > operator< (const OvImageT< C > &i1, const double i2)
template<typename C>
const OvImageT< bool > operator<= (const OvImageT< C > &i1, const OvImageT< C > &i2)
template<typename C>
const OvImageT< bool > operator<= (const double i1, const OvImageT< C > &i2)
template<typename C>
const OvImageT< bool > operator<= (const OvImageT< C > &i1, const double i2)
template<typename C>
const OvImageT< bool > operator> (const OvImageT< C > &i1, const OvImageT< C > &i2)
template<typename C>
const OvImageT< bool > operator> (const double i1, const OvImageT< C > &i2)
template<typename C>
const OvImageT< bool > operator> (const OvImageT< C > &i1, const double i2)
template<typename C>
const OvImageT< bool > operator>= (const OvImageT< C > &i1, const OvImageT< C > &i2)
template<typename C>
const OvImageT< bool > operator>= (const double i1, const OvImageT< C > &i2)
template<typename C>
const OvImageT< bool > operator>= (const OvImageT< C > &i1, const double i2)
template<typename C>
const OvImageT< bool > operator== (const OvImageT< C > &i1, const OvImageT< C > &i2)
template<typename C>
const OvImageT< bool > operator== (const double i1, const OvImageT< C > &i2)
template<typename C>
const OvImageT< bool > operator== (const OvImageT< C > &i1, const double i2)
const OvImageT< bool > operator && (const OvImageT< bool > &i1, const OvImageT< bool > &i2)
const OvImageT< bool > operator|| (const OvImageT< bool > &i1, const OvImageT< bool > &i2)
template<typename C>
const OvImageT< C > cos (const OvImageT< C > &i1)
template<typename C>
const OvImageT< C > sin (const OvImageT< C > &i1)
template<typename C>
const OvImageT< C > tan (const OvImageT< C > &i1)
template<typename C>
const OvImageT< C > acos (const OvImageT< C > &i1)
template<typename C>
const OvImageT< C > asin (const OvImageT< C > &i1)
template<typename C>
const OvImageT< C > atan (const OvImageT< C > &i1)
template<typename C>
const OvImageT< C > atan2 (const OvImageT< C > &iy, const OvImageT< C > &ix)
template<typename C>
const OvImageT< C > cosh (const OvImageT< C > &i1)
template<typename C>
const OvImageT< C > sinh (const OvImageT< C > &i1)
template<typename C>
const OvImageT< C > tanh (const OvImageT< C > &i1)
template<typename C>
const OvImageT< C > exp (const OvImageT< C > &i1)
template<typename C>
const OvImageT< C > log (const OvImageT< C > &i1)
template<typename C>
const OvImageT< C > log10 (const OvImageT< C > &i1)
template<typename C>
const OvImageT< C > abs (const OvImageT< C > &i1)
template<typename C>
const OvImageT< C > ceil (const OvImageT< C > &i1)
template<typename C>
const OvImageT< C > floor (const OvImageT< C > &i1)
template<typename C>
const OvImageT< C > round (const OvImageT< C > &i1)
template<typename C>
const OvImageT< C > mod (const OvImageT< C > &i1, double d)
template<typename C>
const OvImageT< C > pow (const OvImageT< C > &i1, double p)
template<typename C>
const OvImageT< C > pow (double p, const OvImageT< C > &i1)
template<typename C>
const OvImageT< C > sqrt (const OvImageT< C > &i1)
const OvImageT< double > random (double lowerbound, double upperbound, int height, int width, int nColorChannels)
const OvImageT< double > meshgridX (double x1, double x2, double y1, double y2, double dx, double dy)
const OvImageT< double > meshgridY (double x1, double x2, double y1, double y2, double dx, double dy)
const OvImageT< double > gaussian (int size, double sigma)
const OvImageT< double > gaborX (int size, double sigma, double period, double phaseshift)
const OvImageT< double > gaborY (int size, double sigma, double period, double phaseshift)
const OvImageT< double > gaborOriented (int size, double sigma, double period, double angle, double phaseshift)

Related Functions

(Note that these are not member functions.)

const OvImageT< T > convolve2D (const OvImageT< T > &kernel, const OvImageT< T > &input)
const OvImageT< T > filter2D (const OvImageT< T > &kernel, const OvImageT< T > &input)
const OvImageT< T > medianFilter2D (const OvImageT< T > &input, int filterHeight, int filterWidth)
const OvImageT< T > minFilter2D (const OvImageT< T > &input, int filterHeight, int filterWidth)
const OvImageT< T > maxFilter2D (const OvImageT< T > &input, int filterHeight, int filterWidth)
const OvImageT< T > meanFilter2D (const OvImageT< T > &input, int filterHeight, int filterWidth)
const OvImageT< T > mean (const OvImageT< T > &input, int dimension=3)
const OvImageT< T > min (const OvImageT< T > &input, int dimension=3)
const OvImageT< T > max (const OvImageT< T > &input, int dimension=3)
const OvImageT< T > sum (const OvImageT< T > &input, int dimension=3)
sumRegion (const OvImageT< T > &input, int rowLo=-1, int rowHi=-1, int columnLo=-1, int columnHi=-1, int channelLo=-1, int channelHi=-1)
sumSingleChannel (const OvImageT< T > &input, int channel)
sumAll (const OvImageT< T > &input)
L1Norm (const OvImageT< T > &input)
L2Norm (const OvImageT< T > &input)
const OvImageT< T > transpose (const OvImageT< T > &input)
const OvImageT< T > flipLR (const OvImageT< T > &input)
const OvImageT< T > flipUD (const OvImageT< T > &input)
const OvImageT< T > rgb2gray (const OvImageT< T > &input)
const OvImageT< T > repmat (const OvImageT< T > &input, int height=1, int width=1, int channels=1)
const OvImageT< T > shiftImageXY (const OvImageT< T > &input, int columns=0, int rows=0)
const OvImageT< T > resizeNearestNbr (const OvImageT< T > &input, double scale, bool preSmooth=false)
const OvImageT< T > resizeBilinear (const OvImageT< T > &input, double scale, bool preSmooth=false)


Detailed Description

template<typename T>
class OvImageT< T >

Internal image class with overloaded math operators and utility functions.

The OvImageT class is a template class used internally by the library, although it can easily be used for your own purposes. Arithmetic, comparison, logical, etc. operators are overloaded to perform per-pixel operations using a simple syntax. Mathematical functions (e.g., sin, exp, pow, etc.) are also overloaded. Common image operations such as 2D convolution, linear and nonlinear filtering, and several standard Matlab-style functions have been provided.

Author:
Abhijit Ogale


Constructor & Destructor Documentation

template<typename T>
OvImageT< T >::OvImageT (  ) 

Constructor with no parameters to create empty image.

See also:
OvImageT(int height, int width, int nColorChannels)

OvImageT(const OvImageT<T>& srcImage, bool copyData)

OvImageT(const OvImageT<C>& srcImage, bool copyData)

template<typename T>
OvImageT< T >::OvImageT ( int  height,
int  width,
int  nColorChannels 
)

Constructor specifying height, width and number of color channels.

Parameters:
height desired height of the image
width desired width of image
nColorChannels desired number of color channels
See also:
OvImageT()

OvImageT(const OvImageT<T>& srcImage, bool copyData)

OvImageT(const OvImageT<C>& srcImage, bool copyData)

template<typename T>
OvImageT< T >::OvImageT ( const OvImageT< T > &  srcImage,
bool  copyData = true 
)

Copy constructor creates image with same size as the input image, with the option of copying data.

Parameters:
srcImage source image whose dimensions are to be copied
copyData copies source data if set to true (default), otherwise returns zeroed image.
See also:
OvImageT()

OvImageT(int height, int width, int nColorChannels)

OvImageT(const OvImageT<C>& srcImage, bool copyData)

template<typename T>
template<typename C>
OvImageT< T >::OvImageT ( const OvImageT< C > &  srcImage,
bool  copyData = true 
)

Copy constructor to copy between two different image template types T and C.

e.g.,

   OvImageT<int> i1(2,3,1);
   OvImageT<float> i2(i1);
 

Parameters:
srcImage source image whose dimensions are to be copied (of a different template type)
copyData copies source data if set to true (default), otherwise returns zeroed image.
See also:
OvImageT()

OvImageT(int height, int width, int nColorChannels)

OvImageT(const OvImageT<T>& srcImage, bool copyData)

template<typename T>
OvImageT< T >::~OvImageT (  )  [virtual]

Destructor of OvImageT.


Member Function Documentation

template<typename T>
bool OvImageT< T >::copyChannel ( OvImageT< T > &  input,
int  inputChannel,
int  outputChannel 
)

Copies a certain input channel to a certain output channel. Note: the input should have the same height and width as the caller.

Parameters:
input the input image
inputChannel the channel of the input to be copied
outputChannel the destination channel of the output
Returns:
true if successful

template<typename T>
bool OvImageT< T >::copyFromAdapter ( const OvImageAdapter iadapter  ) 

Imports image from an OvImageAdapter (external image source).

Parameters:
iadapter a OvImageAdapter object
Returns:
true if successful, false if failed

e.g., import and export using OpenCVAdapter, a class derived from OvImageAdapter.
    IplImage*img = cvLoadImage("test.jpg");
    OpenCVImageAdapter*opencvAdaptor = new OpenCVImageAdapter(img);
    OvImageT<float> i1;
    i1.copyFromAdapter(*opencvAdaptor); //Now the opencv image is copied to i1
    i1 = i1/2;	//divide all pixel values by 2
    i1.copyToAdapter(*opencvAdaptor); //copy back to opencv image
 
See also:
copyToAdapter(OvImageAdapter & iadapter)

template<typename T>
bool OvImageT< T >::copyMasked ( const OvImageT< bool > &  mask,
const T &  value 
)

Sets pixels equal to the input value wherever the mask is true.

Parameters:
mask a boolean image mask having the same size as the srcImage
value the scalar value to be assigned
Returns:
true if successful

template<typename T>
bool OvImageT< T >::copyMasked ( const OvImageT< bool > &  mask,
const OvImageT< T > &  srcImage 
)

Import source image values using a boolean image mask. Values are copied wherever mask is true.

Parameters:
mask a boolean image mask having the same size as the srcImage
srcImage the source image
Returns:
true if successful

template<typename T>
bool OvImageT< T >::copyToAdapter ( OvImageAdapter iadapter  ) 

Exports image to an OvImageAdapter (external image source). Note: This function will export only if the OvImageAdapter image has the same dimensions as the source image. It does not create or resize the OvImageAdapter.

Parameters:
iadapter a OvImageAdapter object
Returns:
true if successful, false if failed

e.g., import and export using OpenCVAdapter, a class derived from OvImageAdapter.
    IplImage*img = cvLoadImage("test.jpg");
    OpenCVImageAdapter*opencvAdaptor = new OpenCVImageAdapter(img);
    OvImageT<float> i1;
    i1.copyFromAdapter(*opencvAdaptor); //Now the opencv image is copied to i1
    i1 = i1/2;	//divide all pixel values by 2
    i1.copyToAdapter(*opencvAdaptor); //copy back to opencv image
 
See also:
copyFromAdapter(OvImageAdapter & iadapter)

template<typename T>
int OvImageT< T >::getChannels (  )  const

Returns the number of channels of the image.

Returns:
number of channels

template<typename T>
void OvImageT< T >::getDimensions ( int &  height,
int &  width,
int &  nColorChannels 
) const

Returns the dimensions of the image.

Parameters:
height returns image height
width returns image width
nColorChannels returns number of channels

template<typename T>
OvImageT< double > OvImageT< T >::getGaborPhaseStack (  ) 

Run Gabor filters with 4 orientation and 4 scales, and return the phases at each filter stacked as a 16 channel image.

    phases = i1.getGaborPhaseStack();
 
Returns:
an image with 16 channels with each channel containing the convolution with a gabor filter of certain orientation and scale.
See also:
OvImageT<T>::setGaborOriented(int size, double sigma, double period, double angle, double phaseshift)

gaborOriented(int size, double sigma, double period, double angle, double phaseshift)

OvImageT<T>::setToGaborX(int size, double sigma, double period, double phaseshift)

gaborX(int size, double sigma, double period, double phaseshift)

OvImageT<T>::setToGaussian(int size, double sigma)

gaborY(int size, double sigma, double period, double phaseshift)

gaussian(int size, double sigma)

template<typename T>
int OvImageT< T >::getHeight (  )  const

Returns the height of the image.

Returns:
height of the image

template<typename T>
const OvImageT< T > OvImageT< T >::getSubImage ( int  rowLo = -1,
int  rowHi = -1,
int  columnLo = -1,
int  columnHi = -1,
int  channelLo = -1,
int  channelHi = -1 
)

Copies and returns a rectangular sub-block of the image. e.g.,

    i2 = i1(10,20,5,30,0,1); 
 
Parameters:
rowLo starting row (if omitted or set to a negative value, the default value of 0 is used)
rowHi ending row (if omitted or set to a negative value, the default value used is (height-1) )
columnLo starting column (if omitted or set to a negative value, the default value of 0 is used)
columnHi ending column (if omitted or set to a negative value, the default value used is (width-1))
channelLo starting channel (if omitted or set to a negative value, the default value of 0 is used)
channelHi ending channel (if omitted or set to a negative value, the default value used is (number of channels-1))
Returns:
the copied subimage

template<typename T>
int OvImageT< T >::getWidth (  )  const

Returns the width of the image.

Returns:
width of the image

template<typename T>
void OvImageT< T >::normalizeIntensityRange (  ) 

Rescale image intensities to lie between 0 and 1.
e.g,

   i1.normalizeIntensityRange();
 

template<typename T>
OvImageT< T > & OvImageT< T >::operator *= ( const T &  rhs  ) 

e.g., i1 *= 2;

template<typename T>
OvImageT< T > & OvImageT< T >::operator *= ( const OvImageT< T > &  rhs  ) 

e.g., i1 *= i2;

template<typename T>
const OvImageT<bool> OvImageT< T >::operator! (  )  const

e.g., iflag1 = !iflag2;

template<typename T>
T & OvImageT< T >::operator() ( int  row,
int  column = 0,
int  channel = 0 
) [inline]

Access image data using a syntax like im(i,j,k) .

e.g.,
temp = im(1,2,1); //copy value of pixel at location row=1,col=2,channel=1 into variable temp
OR
im(1,2,0) = 5;

Parameters:
row 
column 
channel 

template<typename T>
const OvImageT< T > OvImageT< T >::operator+ (  ) 

e.g., i1 = +i2;

template<typename T>
const OvImageT< T > OvImageT< T >::operator++ ( int   ) 

e.g., i1++;

template<typename T>
OvImageT< T > & OvImageT< T >::operator++ (  ) 

e.g., ++i1;

template<typename T>
OvImageT< T > & OvImageT< T >::operator+= ( const T &  rhs  ) 

e.g., i1 += 3.2;

template<typename T>
OvImageT< T > & OvImageT< T >::operator+= ( const OvImageT< T > &  rhs  ) 

e.g., i1 += i2;

template<typename T>
const OvImageT< T > OvImageT< T >::operator- (  ) 

e.g., i1 = -i2;

template<typename T>
const OvImageT< T > OvImageT< T >::operator-- ( int   ) 

e.g., i1--;

template<typename T>
OvImageT< T > & OvImageT< T >::operator-- (  ) 

e.g., --i1;

template<typename T>
OvImageT< T > & OvImageT< T >::operator-= ( const T &  rhs  ) 

e.g., i1 -= 5.5;

template<typename T>
OvImageT< T > & OvImageT< T >::operator-= ( const OvImageT< T > &  rhs  ) 

e.g., i1 -= i2;

template<typename T>
OvImageT< T > & OvImageT< T >::operator/= ( const T &  rhs  ) 

e.g., i1 /= 10;

template<typename T>
OvImageT< T > & OvImageT< T >::operator/= ( const OvImageT< T > &  rhs  ) 

e.g., i1 /= i2;

template<typename T>
template<typename C>
OvImageT< T > & OvImageT< T >::operator= ( const OvImageT< C > &  rhsImage  ) 

Assignment operator to copy one image to another of a different data type. e.g.,

    OvImageT<float> i1(4,4,1);
    OvImageT<int> i2;
    i2 = i1;
 

template<typename T>
OvImageT< T > & OvImageT< T >::operator= ( const T &  rhs  ) 

Assignment operator to set all values of an image to a given scalar. e.g.,

    OvImageT<float> i1(4,4,1);
    i1 = 4.2;
 

template<typename T>
OvImageT< T > & OvImageT< T >::operator= ( const OvImageT< T > &  rhsImage  ) 

Assignment operator to copy one image to another of the same data type. e.g.,

    OvImageT<float> i1(4,4,1);
    OvImageT<float> i2;
    i2 = i1;
 

template<typename T>
void OvImageT< T >::print ( void   ) 

print image contents (only for debugging)

template<typename T>
void OvImageT< T >::resetDimensions ( int  height,
int  width,
int  nColorChannels = 1 
)

Resets the image to the specified dimensions and zeroes all pixel values. e.g.,

   i1.resetDimensions(5,10,3);
 
Parameters:
height image height
width image width
nColorChannels number of channels

template<typename T>
void OvImageT< T >::reshape ( int  height,
int  width,
int  nColorChannels = 1 
)

Reshapes the image without changing total size or pixel values. Alters the height, width and channels only if their product is equal to the product of the existing values.
i.e., only if height*width*channels = (old height)*(old width)*(old channels)
e.g,

   OvImageT<float> i1(2,8,1);
   i1.reshape(4,4,1);
 
Parameters:
height image height
width image width
nColorChannels number of channels

template<typename T>
void OvImageT< T >::setToGaborOriented ( int  size,
double  sigma,
double  period,
double  angle,
double  phaseshift = 0 
)

Sets the image to a gabor filter with arbitrary orientation e.g. (to use a filter with 45 degree orientation),

    i1.setToGaborOriented(10,3,3,45,0);
 
Parameters:
size height and width are both set equal to size
sigma halfwidth of the gaussian envelope
period the period of the sinusoid
angle the orientation of the sinusoid (degrees)
phaseshift (the phase of the sinusoid in degrees (default is 0)).
See also:
gaborOriented(int size, double sigma, double period, double angle, double phaseshift)

OvImageT<T>::setToGaborX(int size, double sigma, double period, double phaseshift)

gaborX(int size, double sigma, double period, double phaseshift)

OvImageT<T>::setToGaborX(int size, double sigma, double period, double phaseshift)

gaborY(int size, double sigma, double period, double phaseshift)

template<typename T>
void OvImageT< T >::setToGaborX ( int  size,
double  sigma,
double  period,
double  phaseshift = 0 
)

Sets the image to a horizontal gabor filter. e.g.,

    i1.setToGaborX(10,3,3,0);
 
Parameters:
size height and width are both set equal to size
sigma halfwidth of the gaussian envelope
period the period of the sinusoid
phaseshift (the phase of the sinusoid in degrees (default is 0)).
See also:
gaborX(int size, double sigma, double period, double phaseshift)

OvImageT<T>::setToGaborY(int size, double sigma, double period, double phaseshift)

gaborY(int size, double sigma, double period, double phaseshift)

OvImageT<T>::setToGaussian(int size, double sigma)

gaussian(int size, double sigma)

template<typename T>
void OvImageT< T >::setToGaborY ( int  size,
double  sigma,
double  period,
double  phaseshift = 0 
)

Sets the image to a vertical gabor filter. e.g.,

    i1.setToGaborY(10,3,3,0);
 
Parameters:
size height and width are both set equal to size
sigma halfwidth of the gaussian envelope
period the period of the sinusoid
phaseshift (the phase of the sinusoid in degrees (default is 0)).
See also:
gaborY(int size, double sigma, double period, double phaseshift)

OvImageT<T>::setToGaborX(int size, double sigma, double period, double phaseshift)

gaborX(int size, double sigma, double period, double phaseshift)

OvImageT<T>::setToGaussian(int size, double sigma)

gaussian(int size, double sigma)

template<typename T>
void OvImageT< T >::setToGaussian ( int  size,
double  sigma 
)

Sets the image to gaussian of half-width sigma and height and width equal to size. e.g.,

    i1.setToGaussian(10,3);
 
Parameters:
size height and width are both set equal to size
sigma halfwidth of the gaussian
See also:
gaussian(int size, double sigma)

OvImageT<T>::setToGaborX(int size, double sigma, double period, double phaseshift)

OvImageT<T>::setToGaborY(int size, double sigma, double period, double phaseshift)

gaborX(int size, double sigma, double period, double phaseshift)

gaborY(int size, double sigma, double period, double phaseshift)

template<typename T>
void OvImageT< T >::setToGray (  ) 

Converts multi-channel color image to single-channel gray image by averaging channels.

e.g.,
i1.setToGray();

template<typename T>
void OvImageT< T >::setToMeshgridX ( x1,
x2,
y1,
y2,
dx = 1,
dy = 1 
)

Set caller to an image of height y2-y1+1 and width x2-x1+1 with each pixel set to its x-coordinate (from x1 to x2). e.g.,

   i1.setToMeshgridX(1,5,1,4,2,1); //returns image of height 4, width 3, with each row equal to [1 3 5]
      OR using default step sizes
   i1.setToMeshgridX(5,8,1,12); 
 

Parameters:
x1 starting x-value
x2 ending x-value
y1 starting y-value
y2 ending y-value
dx stepsize along x (if omitted, default = 1)
dy stepsize along y (if omitted, default = 1)
See also:
setToMeshgridY(T x1, T x2, T y1, T y2, T dx, T dy)

meshgridX(double x1, double x2, double y1, double y2, double dx, double dy)

meshgridY(double x1, double x2, double y1, double y2, double dx, double dy)

template<typename T>
void OvImageT< T >::setToMeshgridY ( x1,
x2,
y1,
y2,
dx = 1,
dy = 1 
)

Set caller to an image of height y2-y1+1 and width x2-x1+1 with each pixel set to its x-coordinate (from x1 to x2). e.g.,

   i1.setToMeshgridY(1,5,1,4,2,1); //returns image of height 4, width 3, with each column equal to [1 2 3 4]
      OR using default step sizes
   i1.setToMeshgridY(5,8,7,12); 
 

Parameters:
x1 starting x-value
x2 ending x-value
y1 starting y-value
y2 ending y-value
dx stepsize along x (if omitted, default = 1)
dy stepsize along y (if omitted, default = 1)
See also:
setToMeshgridX(T x1, T x2, T y1, T y2, T dx, T dy)

meshgridX(double x1, double x2, double y1, double y2, double dx, double dy)

meshgridY(double x1, double x2, double y1, double y2, double dx, double dy)

template<typename T>
void OvImageT< T >::setToRandom ( double  lowerbound,
double  upperbound 
)

Sets image contents to random values ranging from lowerbound to upperbound (inclusive). e.g.,

   i1.setToRandom(10,20);
 
Parameters:
lowerbound lower bound on the desired random numbers
upperbound upper bound on the desired random numbers
See also:
random(double lowerbound, double upperbound, int height, int width, int nColorChannels)


Friends And Related Function Documentation

template<typename T>
template<typename C>
const OvImageT<C> abs ( const OvImageT< C > &  i1  )  [friend]

e.g., i2 = abs(i1);

template<typename T>
template<typename C>
const OvImageT<C> acos ( const OvImageT< C > &  i1  )  [friend]

e.g., i2 = acos(i1);

template<typename T>
template<typename C>
const OvImageT<C> asin ( const OvImageT< C > &  i1  )  [friend]

e.g., i2 = asin(i1);

template<typename T>
template<typename C>
const OvImageT<C> atan ( const OvImageT< C > &  i1  )  [friend]

e.g., i2 = atan(i1);

template<typename T>
template<typename C>
const OvImageT<C> atan2 ( const OvImageT< C > &  iy,
const OvImageT< C > &  ix 
) [friend]

e.g., i2 = atan2(iy,ix);

template<typename T>
template<typename C>
const OvImageT<C> ceil ( const OvImageT< C > &  i1  )  [friend]

e.g., i2 = ceil(i1);

template<typename T>
const OvImageT< T > convolve2D ( const OvImageT< T > &  kernel,
const OvImageT< T > &  input 
) [related]

Performs 2D convolution on the input image with a given kernel.
e.g.,

   OvImageT<float> ikernel, input, iresult;
   input = random(0,100,50,50,1);
   ikernel = gaussian(7, 3);
   iresult = convolve2D(ikernel, input);
 
Parameters:
kernel a 2D image used as a kernel for convolution
input the input image
Returns:
convolved image
See also:
filter2D(const OvImageT<T> & kernel, const OvImageT<T> & input)

template<typename T>
template<typename C>
const OvImageT<C> cos ( const OvImageT< C > &  i1  )  [friend]

e.g., i2 = cos(i1);

template<typename T>
template<typename C>
const OvImageT<C> cosh ( const OvImageT< C > &  i1  )  [friend]

e.g., i2 = cosh(i1);

template<typename T>
template<typename C>
const OvImageT<C> exp ( const OvImageT< C > &  i1  )  [friend]

e.g., i2 = exp(i1);

template<typename T>
const OvImageT< T > filter2D ( const OvImageT< T > &  kernel,
const OvImageT< T > &  input 
) [related]

Performs 2D filtering on the input image with a given kernel.
e.g.,

   OvImageT<float> ikernel, input, iresult;
   input = random(0,100,50,50,1);
   ikernel = gaussian(7, 3);
   iresult = filter2D(ikernel, input);
 
Parameters:
kernel a 2D image used as a kernel for filtering
input the input image
Returns:
filtered image
See also:
convolve2D(const OvImageT<T> & kernel, const OvImageT<T> & input)

template<typename T>
const OvImageT< T > flipLR ( const OvImageT< T > &  input  )  [related]

Flips image left-to-right (i.e., about a vertical axis).

e.g.,
i2 = flipLR(i1);

Parameters:
input the input image
Returns:
flipped image

template<typename T>
const OvImageT< T > flipUD ( const OvImageT< T > &  input  )  [related]

Flips image upside-down (i.e., about a horizontal axis).

e.g.,
i2 = flipUD(i1);

Parameters:
input the input image
Returns:
flipped image

template<typename T>
template<typename C>
const OvImageT<C> floor ( const OvImageT< C > &  i1  )  [friend]

e.g., i2 = floor(i1);

template<typename T>
const OvImageT<double> gaborOriented ( int  size,
double  sigma,
double  period,
double  angle,
double  phaseshift = 0 
) [friend]

Creates a gabor filter with arbitrary orientation e.g. (to use a filter with 45 degree orientation),

    i1 = gaborOriented(10,3,3,45,0);
 
Parameters:
size height and width are both set equal to size
sigma halfwidth of the gaussian envelope
period the period of the sinusoid
angle the orientation of the sinusoid (degrees)
phaseshift (the phase of the sinusoid in degrees (default is 0)).
See also:
OvImageT<T>::setGaborOriented(int size, double sigma, double period, double angle, double phaseshift)

OvImageT<T>::setToGaborX(int size, double sigma, double period, double phaseshift)

gaborX(int size, double sigma, double period, double phaseshift)

OvImageT<T>::setToGaborX(int size, double sigma, double period, double phaseshift)

gaborY(int size, double sigma, double period, double phaseshift)

template<typename T>
const OvImageT<double> gaborX ( int  size,
double  sigma,
double  period,
double  phaseshift 
) [friend]

Sets the image to a horizontal gabor filter. e.g.,

    i1 = gaborX(10,3,3,0);
 
Parameters:
size height and width are both set equal to size
sigma halfwidth of the gaussian envelope
period the period of the sinusoid
phaseshift (the phase of the sinusoid in degrees (default is 0)).
See also:
gaborY(int size, double sigma, double period, double phaseshift)

OvImageT<T>::setToGaborX(int size, double sigma, double period, double phaseshift)

OvImageT<T>::setToGaborY(int size, double sigma, double period, double phaseshift)

gaussian(int size, double sigma)

OvImageT<T>::setToGaussian(int size, double sigma)

template<typename T>
const OvImageT<double> gaborY ( int  size,
double  sigma,
double  period,
double  phaseshift 
) [friend]

Sets the image to a vertical gabor filter. e.g.,

    i1 = gaborY(10,3,3,0);
 
Parameters:
size height and width are both set equal to size
sigma halfwidth of the gaussian envelope
period the period of the sinusoid
phaseshift (the phase of the sinusoid in degrees (default is 0)).
Returns:
an image of type OvImageT<double>
See also:
gaborX(int size, double sigma, double period, double phaseshift)

OvImageT<T>::setToGaborY(int size, double sigma, double period, double phaseshift)

OvImageT<T>::setToGaborX(int size, double sigma, double period, double phaseshift)

gaussian(int size, double sigma)

OvImageT<T>::setToGaussian(int size, double sigma)

template<typename T>
const OvImageT<double> gaussian ( int  size,
double  sigma 
) [friend]

Creates image equal to gaussian of half-width sigma and height and width equal to size. e.g.,

    i1 = gaussian(10,3);
 
Parameters:
size height and width are both set equal to size
sigma halfwidth of the gaussian
Returns:
an image of type OvImageT<double>
See also:
OvImageT<T>::setToGaussian(int size, double sigma)

gaborX(int size, double sigma, double period, double phaseshift)

gaborY(int size, double sigma, double period, double phaseshift)

OvImageT<T>::setToGaborX(int size, double sigma, double period, double phaseshift)

OvImageT<T>::setToGaborY(int size, double sigma, double period, double phaseshift)

template<typename T>
T L1Norm ( const OvImageT< T > &  input  )  [related]

Find sum of absolute values of all pixels. e.g.,

    temp = L1Norm(i1);  
 
Parameters:
input the input image
Returns:
L1 norm

template<typename T>
T L2Norm ( const OvImageT< T > &  input  )  [related]

Find sqrt of sum of squared pixel values. e.g.,

    temp = L2Norm(i1);  
 
Parameters:
input the input image
Returns:
L2 norm

template<typename T>
template<typename C>
const OvImageT<C> log ( const OvImageT< C > &  i1  )  [friend]

e.g., i2 = log(i1);

template<typename T>
template<typename C>
const OvImageT<C> log10 ( const OvImageT< C > &  i1  )  [friend]

e.g., i2 = log10(i1);

template<typename T>
const OvImageT< T > max ( const OvImageT< T > &  input,
int  dimension = 3 
) [related]

Computes maximum of image pixels along a particular dimension [1 = along rows, 2 = along columns, 3 = along color channels (default)]

e.g.,
i2 = max(i1,3);
Here, i2 has the same height and width as i1, but only one color channel

i2 = max(i1,1);
Here, i2 has the same width and channels as i1, but only one row

Parameters:
input the input image
dimension [1 = along rows, 2 = along columns, 3 = along color channels (default)]
Returns:
image

template<typename T>
const OvImageT< T > maxFilter2D ( const OvImageT< T > &  input,
int  filterHeight,
int  filterWidth 
) [related]

Performs 2D maximum filtering on the input image, i.e., every output pixel is set to the maximum value within a rectangular block of pixels around it.

e.g.,

 
   i2 = maxFilter2D(i1, 5, 5); 
 
Parameters:
input the input image
filterHeight height of the filter
filterWidth width of the filter
Returns:
filtered image
See also:
medianFilter2D(const OvImageT<T> & input, int filterHeight, int filterWidth)

minFilter2D(const OvImageT<T> & input, int filterHeight, int filterWidth)

meanFilter2D(const OvImageT<T> & input, int filterHeight, int filterWidth)

filter2D(const OvImageT<T> & kernel, const OvImageT<T> & input)

convolve2D(const OvImageT<T> & kernel, const OvImageT<T> & input)

template<typename T>
const OvImageT< T > mean ( const OvImageT< T > &  input,
int  dimension = 3 
) [related]

Computes mean of image pixels along a particular dimension [1 = along rows, 2 = along columns, 3 = along color channels (default)]

e.g.,
i2 = mean(i1,3);
Here, i2 has the same height and width as i1, but only one color channel (since we have averaged all color channels together)

i2 = mean(i1,1);
Here, i2 has the same width and channels as i1, but only one row (since we have averaged all rows together)

Parameters:
input the input image
dimension [1 = along rows, 2 = along columns, 3 = along color channels (default)]
Returns:
image

template<typename T>
const OvImageT< T > meanFilter2D ( const OvImageT< T > &  input,
int  filterHeight,
int  filterWidth 
) [related]

Performs 2D mean filtering on the input image, i.e., every output pixel is set to the mean value of a rectangular block of pixels around it.

e.g.,

 
   i2 = meanFilter2D(i1, 5, 5); 
 
Parameters:
input the input image
filterHeight height of the filter
filterWidth width of the filter
Returns:
filtered image
See also:
medianFilter2D(const OvImageT<T> & input, int filterHeight, int filterWidth)

minFilter2D(const OvImageT<T> & input, int filterHeight, int filterWidth)

maxFilter2D(const OvImageT<T> & input, int filterHeight, int filterWidth)

filter2D(const OvImageT<T> & kernel, const OvImageT<T> & input)

convolve2D(const OvImageT<T> & kernel, const OvImageT<T> & input)

template<typename T>
const OvImageT< T > medianFilter2D ( const OvImageT< T > &  input,
int  filterHeight,
int  filterWidth 
) [related]

Performs 2D median filtering on the input image, i.e., every output pixel is set to the median value within a rectangular block of pixels around it.

e.g.,

 
   i2 = medianFilter2D(i1, 5, 5); 
 
Parameters:
input the input image
filterHeight height of the median filter
filterWidth width of the median filter
Returns:
filtered image
See also:
minFilter2D(const OvImageT<T> & input, int filterHeight, int filterWidth)

maxFilter2D(const OvImageT<T> & input, int filterHeight, int filterWidth)

meanFilter2D(const OvImageT<T> & input, int filterHeight, int filterWidth)

filter2D(const OvImageT<T> & kernel, const OvImageT<T> & input)

convolve2D(const OvImageT<T> & kernel, const OvImageT<T> & input)

template<typename T>
const OvImageT<double> meshgridX ( double  x1,
double  x2,
double  y1,
double  y2,
double  dx = 1,
double  dy = 1 
) [friend]

Creates an image of height y2-y1+1 and width x2-x1+1 with each pixel set to its x-coordinate (from x1 to x2). e.g.,

   i1 = meshgridX(1,5,1,4,2,1); //returns image of height 4, width 3, with each row equal to [1 3 5]
      OR using default step sizes
   i1 = meshgridX(5,8,1,12); 
 

Parameters:
x1 starting x-value
x2 ending x-value
y1 starting y-value
y2 ending y-value
dx stepsize along x (if omitted, default = 1)
dy stepsize along y (if omitted, default = 1)
Returns:
an image of type OvImageT<double>
See also:
meshgridY(double x1, double x2, double y1, double y2, double dx, double dy)

OvImageT<T>::setToMeshgridX(T x1, T x2, T y1, T y2, T dx, T dy)

OvImageT<T>::setToMeshgridY(T x1, T x2, T y1, T y2, T dx, T dy)

template<typename T>
const OvImageT<double> meshgridY ( double  x1,
double  x2,
double  y1,
double  y2,
double  dx = 1,
double  dy = 1 
) [friend]

Creates an image of height y2-y1+1 and width x2-x1+1 with each pixel set to its y-coordinate (from y1 to y2). e.g.,

   i1 = meshgridY(1,5,1,4,2,1); //returns image of height 4, width 3, with each column equal to [1 2 3 4]
      OR using default step sizes
   i1 = meshgridY(5,8,1,12); 
 

Parameters:
x1 starting x-value
x2 ending x-value
y1 starting y-value
y2 ending y-value
dx stepsize along x (if omitted, default = 1)
dy stepsize along y (if omitted, default = 1)
Returns:
an image of type OvImageT<double>
See also:
meshgridX(double x1, double x2, double y1, double y2, double dx, double dy)

OvImageT<T>::setToMeshgridY(T x1, T x2, T y1, T y2, T dx, T dy)

OvImageT<T>::setToMeshgridX(T x1, T x2, T y1, T y2, T dx, T dy)

template<typename T>
const OvImageT< T > min ( const OvImageT< T > &  input,
int  dimension = 3 
) [related]

Computes minimum of image pixels along a particular dimension [1 = along rows, 2 = along columns, 3 = along color channels (default)]

e.g.,
i2 = min(i1,3);
Here, i2 has the same height and width as i1, but only one color channel

i2 = min(i1,1);
Here, i2 has the same width and channels as i1, but only one row

Parameters:
input the input image
dimension [1 = along rows, 2 = along columns, 3 = along color channels (default)]
Returns:
image

template<typename T>
const OvImageT< T > minFilter2D ( const OvImageT< T > &  input,
int  filterHeight,
int  filterWidth 
) [related]

Performs 2D minimum filtering on the input image, i.e., every output pixel is set to the minimum value within a rectangular block of pixels around it.

e.g.,

 
   i2 = minFilter2D(i1, 5, 5); 
 
Parameters:
input the input image
filterHeight height of the filter
filterWidth width of the filter
Returns:
filtered image
See also:
medianFilter2D(const OvImageT<T> & input, int filterHeight, int filterWidth)

maxFilter2D(const OvImageT<T> & input, int filterHeight, int filterWidth)

meanFilter2D(const OvImageT<T> & input, int filterHeight, int filterWidth)

filter2D(const OvImageT<T> & kernel, const OvImageT<T> & input)

convolve2D(const OvImageT<T> & kernel, const OvImageT<T> & input)

template<typename T>
template<typename C>
const OvImageT<C> mod ( const OvImageT< C > &  i1,
double  d 
) [friend]

e.g., i2 = mod(i1,5);

template<typename T>
const OvImageT<bool> operator && ( const OvImageT< bool > &  i1,
const OvImageT< bool > &  i2 
) [friend]

e.g., iflag1 = iflag2 && iflag3;

template<typename T>
template<typename C>
const OvImageT<C> operator * ( const OvImageT< C > &  i1,
const double  i2 
) [friend]

e.g., i1 = i2*10;

template<typename T>
template<typename C>
const OvImageT<C> operator * ( const double  i1,
const OvImageT< C > &  i2 
) [friend]

e.g., i1 = 10*i3;

template<typename T>
template<typename C>
const OvImageT<C> operator * ( const OvImageT< C > &  i1,
const OvImageT< C > &  i2 
) [friend]

e.g., i1 = i2*i3;

template<typename T>
template<typename C>
const OvImageT<C> operator+ ( const OvImageT< C > &  i1,
const double  i2 
) [friend]

e.g., i1 = i2+5.2;

template<typename T>
template<typename C>
const OvImageT<C> operator+ ( const double  i1,
const OvImageT< C > &  i2 
) [friend]

e.g., i1 = 5.2+i3;

template<typename T>
template<typename C>
const OvImageT<C> operator+ ( const OvImageT< C > &  i1,
const OvImageT< C > &  i2 
) [friend]

e.g., i1 = i2+i3;

template<typename T>
template<typename C>
const OvImageT<C> operator- ( const OvImageT< C > &  i1,
const double  i2 
) [friend]

e.g., i1 = i2-5.2;

template<typename T>
template<typename C>
const OvImageT<C> operator- ( const double  i1,
const OvImageT< C > &  i2 
) [friend]

e.g., i1 = 5.2-i3;

template<typename T>
template<typename C>
const OvImageT<C> operator- ( const OvImageT< C > &  i1,
const OvImageT< C > &  i2 
) [friend]

e.g., i1 = i2-i3;

template<typename T>
template<typename C>
const OvImageT<C> operator/ ( const OvImageT< C > &  i1,
const double  i2 
) [friend]

e.g., i1 = i2/5;

template<typename T>
template<typename C>
const OvImageT<C> operator/ ( const double  i1,
const OvImageT< C > &  i2 
) [friend]

e.g., i1 = 1/i3;

template<typename T>
template<typename C>
const OvImageT<C> operator/ ( const OvImageT< C > &  i1,
const OvImageT< C > &  i2 
) [friend]

e.g., i1 = i2/i3;

template<typename T>
template<typename C>
const OvImageT<bool> operator< ( const OvImageT< C > &  i1,
const double  i2 
) [friend]

e.g., iresult = i1<2;

template<typename T>
template<typename C>
const OvImageT<bool> operator< ( const double  i1,
const OvImageT< C > &  i2 
) [friend]

e.g., iresult = 2<i2;

template<typename T>
template<typename C>
const OvImageT<bool> operator< ( const OvImageT< C > &  i1,
const OvImageT< C > &  i2 
) [friend]

e.g., iresult = i1<i2;

template<typename T>
template<typename C>
const OvImageT<bool> operator<= ( const OvImageT< C > &  i1,
const double  i2 
) [friend]

e.g., iresult = i1<=2;

template<typename T>
template<typename C>
const OvImageT<bool> operator<= ( const double  i1,
const OvImageT< C > &  i2 
) [friend]

e.g., iresult = 2<=i2;

template<typename T>
template<typename C>
const OvImageT<bool> operator<= ( const OvImageT< C > &  i1,
const OvImageT< C > &  i2 
) [friend]

e.g., iresult = i1<=i2;

template<typename T>
template<typename C>
const OvImageT<bool> operator== ( const OvImageT< C > &  i1,
const double  i2 
) [friend]

e.g., iresult = i1==2;

template<typename T>
template<typename C>
const OvImageT<bool> operator== ( const double  i1,
const OvImageT< C > &  i2 
) [friend]

e.g., iresult = 2==i2;

template<typename T>
template<typename C>
const OvImageT<bool> operator== ( const OvImageT< C > &  i1,
const OvImageT< C > &  i2 
) [friend]

e.g., iresult = i1==i2;

template<typename T>
template<typename C>
const OvImageT<bool> operator> ( const OvImageT< C > &  i1,
const double  i2 
) [friend]

e.g., iresult = i1>2;

template<typename T>
template<typename C>
const OvImageT<bool> operator> ( const double  i1,
const OvImageT< C > &  i2 
) [friend]

e.g., iresult = 2>i2;

template<typename T>
template<typename C>
const OvImageT<bool> operator> ( const OvImageT< C > &  i1,
const OvImageT< C > &  i2 
) [friend]

e.g., iresult = i1>i2;

template<typename T>
template<typename C>
const OvImageT<bool> operator>= ( const OvImageT< C > &  i1,
const double  i2 
) [friend]

e.g., iresult = i1>=2;

template<typename T>
template<typename C>
const OvImageT<bool> operator>= ( const double  i1,
const OvImageT< C > &  i2 
) [friend]

e.g., iresult = 2>=i2;

template<typename T>
template<typename C>
const OvImageT<bool> operator>= ( const OvImageT< C > &  i1,
const OvImageT< C > &  i2 
) [friend]

e.g., iresult = i1>=i2;

template<typename T>
const OvImageT<bool> operator|| ( const OvImageT< bool > &  i1,
const OvImageT< bool > &  i2 
) [friend]

e.g., iflag1 = iflag2 || iflag3;

template<typename T>
template<typename C>
const OvImageT<C> pow ( double  p,
const OvImageT< C > &  i1 
) [friend]

e.g., i2 = pow(3,i1);

template<typename T>
template<typename C>
const OvImageT<C> pow ( const OvImageT< C > &  i1,
double  p 
) [friend]

e.g., i2 = pow(i1,2);

template<typename T>
const OvImageT<double> random ( double  lowerbound,
double  upperbound,
int  height,
int  width,
int  nColorChannels = 1 
) [friend]

Creates an image filled with random numbers ranging from lowerbound to upperbound.
e.g.,

 
    i1 = random(20,30,3,3,1);
 

Parameters:
lowerbound lower bound on the desired random numbers
upperbound upper bound on the desired random numbers
height desired height of the image
width desired width of image
nColorChannels desired number of color channels
Returns:
a new image of type OvImageT<double>
See also:
OvImageT<T>::setToRandom(double lowerbound, double upperbound)

template<typename T>
const OvImageT< T > repmat ( const OvImageT< T > &  input,
int  height = 1,
int  width = 1,
int  channels = 1 
) [related]

Tiles input image height times along rows, width times along columns and channels times along color channels.

e.g.,
i2 = repmat(i1,2,2,1);
Here, i2 is twice as large as i1, and is basically a 2x2 tiled copy of i1.

Parameters:
input the input image
height number of vertical tiles (default = 1)
width number of horizontal tiles (default = 1)
channels number of color channel tiles (default = 1)
Returns:
image

template<typename T>
const OvImageT< T > resizeBilinear ( const OvImageT< T > &  input,
double  scale,
bool  preSmooth = false 
) [related]

Rescales the input image by a certain scale using bilinear interpolation and optional pre-smoothing.

e.g.,
i2 = resizeBilinear(i1, 0.5, true);
Here, i2 is half the size of i1 and presmoothing is set to true.
Pre-smoothing performs appropriate gaussian smoothing before rescaling and gives better results but is slower.

Parameters:
input the input image
scale the magnification factor (in the range 0.01 to 100)
preSmooth if true performs gaussian pre-smoothing. if false (default), no smoothing is performed.
Returns:
image
See also:
resizeNearestNbr(const OvImageT<T> & input, double scale, bool preSmooth)

template<typename T>
const OvImageT< T > resizeNearestNbr ( const OvImageT< T > &  input,
double  scale,
bool  preSmooth = false 
) [related]

Rescales the input image by a certain scale using the nearest-neighbor method and optional pre-smoothing.

e.g.,
i2 = resizeNearestNbr(i1, 0.5, true);
Here, i2 is half the size of i1 and presmoothing is set to true.
Pre-smoothing performs appropriate gaussian smoothing before rescaling and gives better results but is slower.

Parameters:
input the input image
scale the magnification factor (in the range 0.01 to 100)
preSmooth if true performs gaussian pre-smoothing. if false (default), no smoothing is performed.
Returns:
image
See also:
resizeBilinear(const OvImageT<T> & input, double scale, bool preSmooth)

template<typename T>
const OvImageT< T > rgb2gray ( const OvImageT< T > &  input  )  [related]

Converts multi-channel color image to single-channel gray image by averaging channels.

e.g.,
i2 = rgb2gray(i1);

Parameters:
input the input image
Returns:
gray image

template<typename T>
template<typename C>
const OvImageT<C> round ( const OvImageT< C > &  i1  )  [friend]

e.g., i2 = round(i1);

template<typename T>
const OvImageT< T > shiftImageXY ( const OvImageT< T > &  input,
int  columns = 0,
int  rows = 0 
) [related]

Creates a translated copy of an image.

e.g.,
i2 = shiftImageXY(i1,10,20);
Here, i2 is i1 shifted vertically to the right by 10 pixels and down by 20 pixels.
Note: i1 and i2 have the same dimensions.

Parameters:
input the input image
columns horizontal translation in pixels (default = 0)
rows vertical translation in pixels (default = 0)
Returns:
translated image

template<typename T>
template<typename C>
const OvImageT<C> sin ( const OvImageT< C > &  i1  )  [friend]

e.g., i2 = sin(i1);

template<typename T>
template<typename C>
const OvImageT<C> sinh ( const OvImageT< C > &  i1  )  [friend]

e.g., i2 = sinh(i1);

template<typename T>
template<typename C>
const OvImageT<C> sqrt ( const OvImageT< C > &  i1  )  [friend]

e.g., i2 = sqrt(i1);

template<typename T>
const OvImageT< T > sum ( const OvImageT< T > &  input,
int  dimension = 3 
) [related]

Sums image pixels along a particular dimension (1 = sum rows, 2 = sum columns, 3 = sum channels)

e.g.,
i2 = sum(i1,3);
Here, i2 has the same height and width as i1, but only one color channel (since we have summed all color channels together)

i2 = sum(i1,1);
Here, i2 has the same width and channels as i1, but only one row (since we have summed all rows together)

Parameters:
input the input image
dimension the dimension to sum along [1 = sum rows, 2 = sum columns, 3 = sum channels(default)]
Returns:
summed image

template<typename T>
T sumAll ( const OvImageT< T > &  input  )  [related]

Sums all image pixels. e.g.,

    i2 = sumAll(i1);  
 
Returns:
sum

template<typename T>
T sumRegion ( const OvImageT< T > &  input,
int  rowLo = -1,
int  rowHi = -1,
int  columnLo = -1,
int  columnHi = -1,
int  channelLo = -1,
int  channelHi = -1 
) [related]

Sums image pixels in a rectangular region. e.g.,

    i2 = sumRegion(i1,10,20,5,30,0,1); 
 
Parameters:
input the input image
rowLo starting row (if omitted or set to a negative value, the default value of 0 is used)
rowHi ending row (if omitted or set to a negative value, the default value used is (height-1) )
columnLo starting column (if omitted or set to a negative value, the default value of 0 is used)
columnHi ending column (if omitted or set to a negative value, the default value used is (width-1))
channelLo starting channel (if omitted or set to a negative value, the default value of 0 is used)
channelHi ending channel (if omitted or set to a negative value, the default value used is (number of channels-1))
Returns:
sum

template<typename T>
T sumSingleChannel ( const OvImageT< T > &  input,
int  channel 
) [related]

Sums image pixels in a single channel. e.g.,

    i2 = sumSingleChannel(i1,2);  //sums channel 2
 
Parameters:
input the input image
channel the channel to be summed
Returns:
sum

template<typename T>
template<typename C>
const OvImageT<C> tan ( const OvImageT< C > &  i1  )  [friend]

e.g., i2 = tan(i1);

template<typename T>
template<typename C>
const OvImageT<C> tanh ( const OvImageT< C > &  i1  )  [friend]

e.g., i2 = tang(i1);

template<typename T>
const OvImageT< T > transpose ( const OvImageT< T > &  input  )  [related]

Transposes the image. Each color channel is independently transposed.

e.g.,
i2 = transpose(i1);

Parameters:
input the input image
Returns:
transposed image


Member Data Documentation

template<typename T>
int OvImageT< T >::mChannels [protected]

number of color channels or dimensions (e.g., 1 for grayscale, 3 for RGB)

template<typename T>
T* OvImageT< T >::mData [protected]

Image data

template<typename T>
int OvImageT< T >::mHeight [protected]

height of the image

template<typename T>
int OvImageT< T >::mHeightTimesWidth [protected]

mWidth*mHeight (for convenience)

template<typename T>
int OvImageT< T >::mSize [protected]

mWidth*mHeight*mChannels (for convenience)

template<typename T>
int OvImageT< T >::mWidth [protected]

width of the image


The documentation for this class was generated from the following file:
Generated on Thu Feb 1 15:58:49 2007 for OpenVis3D by  doxygen 1.4.7