#include <OvImageT.h>
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) |
| T | sumRegion (const OvImageT< T > &input, int rowLo=-1, int rowHi=-1, int columnLo=-1, int columnHi=-1, int channelLo=-1, int channelHi=-1) |
| T | sumSingleChannel (const OvImageT< T > &input, int channel) |
| T | sumAll (const OvImageT< T > &input) |
| T | L1Norm (const OvImageT< T > &input) |
| T | 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) |
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.
Constructor with no parameters to create empty image.
Constructor specifying height, width and number of color channels.
| height | desired height of the image | |
| width | desired width of image | |
| nColorChannels | desired number of color channels |
| 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.
| srcImage | source image whose dimensions are to be copied | |
| copyData | copies source data if set to true (default), otherwise returns zeroed image. |
| 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);
| 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. |
| 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.
| input | the input image | |
| inputChannel | the channel of the input to be copied | |
| outputChannel | the destination channel of the output |
| bool OvImageT< T >::copyFromAdapter | ( | const OvImageAdapter & | iadapter | ) |
Imports image from an OvImageAdapter (external image source).
| iadapter | a OvImageAdapter object |
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
| bool OvImageT< T >::copyMasked | ( | const OvImageT< bool > & | mask, | |
| const T & | value | |||
| ) |
Sets pixels equal to the input value wherever the mask is true.
| mask | a boolean image mask having the same size as the srcImage | |
| value | the scalar value to be assigned |
| 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.
| mask | a boolean image mask having the same size as the srcImage | |
| srcImage | the source image |
| 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.
| iadapter | a OvImageAdapter object |
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
| int OvImageT< T >::getChannels | ( | ) | const |
Returns the number of channels of the image.
| void OvImageT< T >::getDimensions | ( | int & | height, | |
| int & | width, | |||
| int & | nColorChannels | |||
| ) | const |
Returns the dimensions of the image.
| height | returns image height | |
| width | returns image width | |
| nColorChannels | returns number of channels |
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();
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)
| int OvImageT< T >::getHeight | ( | ) | const |
Returns the height of the image.
| 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);
| 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)) |
| int OvImageT< T >::getWidth | ( | ) | const |
Returns the width of the image.
| void OvImageT< T >::normalizeIntensityRange | ( | ) |
Rescale image intensities to lie between 0 and 1.
e.g,
i1.normalizeIntensityRange();
e.g., i1 *= i2;
e.g., iflag1 = !iflag2;
| 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;
| row | ||
| column | ||
| channel |
e.g., i1 += i2;
e.g., i1 -= i2;
e.g., i1 /= i2;
| 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;
Assignment operator to set all values of an image to a given scalar. e.g.,
OvImageT<float> i1(4,4,1);
i1 = 4.2;
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;
| void OvImageT< T >::print | ( | void | ) |
print image contents (only for debugging)
| 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);
| height | image height | |
| width | image width | |
| nColorChannels | number of channels |
| 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);
| height | image height | |
| width | image width | |
| nColorChannels | number of channels |
| 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);
| 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)). |
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)
| 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);
| 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)). |
| 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);
| 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)). |
| 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);
| size | height and width are both set equal to size | |
| sigma | halfwidth of the gaussian |
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)
| void OvImageT< T >::setToGray | ( | ) |
Converts multi-channel color image to single-channel gray image by averaging channels.
e.g.,
i1.setToGray();
| void OvImageT< T >::setToMeshgridX | ( | T | x1, | |
| T | x2, | |||
| T | y1, | |||
| T | y2, | |||
| T | dx = 1, |
|||
| T | 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);
| 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) |
| void OvImageT< T >::setToMeshgridY | ( | T | x1, | |
| T | x2, | |||
| T | y1, | |||
| T | y2, | |||
| T | dx = 1, |
|||
| T | 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);
| 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) |
| 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);
| lowerbound | lower bound on the desired random numbers | |
| upperbound | upper bound on the desired random numbers |
| const OvImageT<C> abs | ( | const OvImageT< C > & | i1 | ) | [friend] |
e.g., i2 = abs(i1);
| const OvImageT<C> acos | ( | const OvImageT< C > & | i1 | ) | [friend] |
e.g., i2 = acos(i1);
| const OvImageT<C> asin | ( | const OvImageT< C > & | i1 | ) | [friend] |
e.g., i2 = asin(i1);
| const OvImageT<C> atan | ( | const OvImageT< C > & | i1 | ) | [friend] |
e.g., i2 = atan(i1);
| const OvImageT<C> atan2 | ( | const OvImageT< C > & | iy, | |
| const OvImageT< C > & | ix | |||
| ) | [friend] |
e.g., i2 = atan2(iy,ix);
| const OvImageT<C> ceil | ( | const OvImageT< C > & | i1 | ) | [friend] |
e.g., i2 = ceil(i1);
| 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);
| kernel | a 2D image used as a kernel for convolution | |
| input | the input image |
| const OvImageT<C> cos | ( | const OvImageT< C > & | i1 | ) | [friend] |
e.g., i2 = cos(i1);
| const OvImageT<C> cosh | ( | const OvImageT< C > & | i1 | ) | [friend] |
e.g., i2 = cosh(i1);
| const OvImageT<C> exp | ( | const OvImageT< C > & | i1 | ) | [friend] |
e.g., i2 = exp(i1);
| 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);
| kernel | a 2D image used as a kernel for filtering | |
| input | the input image |
Flips image left-to-right (i.e., about a vertical axis).
e.g.,
i2 = flipLR(i1);
| input | the input image |
Flips image upside-down (i.e., about a horizontal axis).
e.g.,
i2 = flipUD(i1);
| input | the input image |
| const OvImageT<C> floor | ( | const OvImageT< C > & | i1 | ) | [friend] |
e.g., i2 = floor(i1);
| 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);
| 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)). |
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)
| 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);
| 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)). |
| 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);
| 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)). |
| 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);
| size | height and width are both set equal to size | |
| sigma | halfwidth of the gaussian |
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)
| T L1Norm | ( | const OvImageT< T > & | input | ) | [related] |
Find sum of absolute values of all pixels. e.g.,
temp = L1Norm(i1);
| input | the input image |
| T L2Norm | ( | const OvImageT< T > & | input | ) | [related] |
Find sqrt of sum of squared pixel values. e.g.,
temp = L2Norm(i1);
| input | the input image |
| const OvImageT<C> log | ( | const OvImageT< C > & | i1 | ) | [friend] |
e.g., i2 = log(i1);
| const OvImageT<C> log10 | ( | const OvImageT< C > & | i1 | ) | [friend] |
e.g., i2 = log10(i1);
| 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
| input | the input image | |
| dimension | [1 = along rows, 2 = along columns, 3 = along color channels (default)] |
| 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);
| input | the input image | |
| filterHeight | height of the filter | |
| filterWidth | width of the filter |
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)
| 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)
| input | the input image | |
| dimension | [1 = along rows, 2 = along columns, 3 = along color channels (default)] |
| 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);
| input | the input image | |
| filterHeight | height of the filter | |
| filterWidth | width of the filter |
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)
| 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);
| input | the input image | |
| filterHeight | height of the median filter | |
| filterWidth | width of the median filter |
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)
| 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);
| 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) |
| 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);
| 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) |
| 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
| input | the input image | |
| dimension | [1 = along rows, 2 = along columns, 3 = along color channels (default)] |
| 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);
| input | the input image | |
| filterHeight | height of the filter | |
| filterWidth | width of the filter |
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)
| const OvImageT<C> mod | ( | const OvImageT< C > & | i1, | |
| double | d | |||
| ) | [friend] |
e.g., i2 = mod(i1,5);
| const OvImageT<bool> operator && | ( | const OvImageT< bool > & | i1, | |
| const OvImageT< bool > & | i2 | |||
| ) | [friend] |
e.g., iflag1 = iflag2 && iflag3;
| const OvImageT<C> operator * | ( | const OvImageT< C > & | i1, | |
| const double | i2 | |||
| ) | [friend] |
e.g., i1 = i2*10;
| const OvImageT<C> operator * | ( | const double | i1, | |
| const OvImageT< C > & | i2 | |||
| ) | [friend] |
e.g., i1 = 10*i3;
| const OvImageT<C> operator * | ( | const OvImageT< C > & | i1, | |
| const OvImageT< C > & | i2 | |||
| ) | [friend] |
e.g., i1 = i2*i3;
| const OvImageT<C> operator+ | ( | const OvImageT< C > & | i1, | |
| const double | i2 | |||
| ) | [friend] |
e.g., i1 = i2+5.2;
| const OvImageT<C> operator+ | ( | const double | i1, | |
| const OvImageT< C > & | i2 | |||
| ) | [friend] |
e.g., i1 = 5.2+i3;
| const OvImageT<C> operator+ | ( | const OvImageT< C > & | i1, | |
| const OvImageT< C > & | i2 | |||
| ) | [friend] |
e.g., i1 = i2+i3;
| const OvImageT<C> operator- | ( | const OvImageT< C > & | i1, | |
| const double | i2 | |||
| ) | [friend] |
e.g., i1 = i2-5.2;
| const OvImageT<C> operator- | ( | const double | i1, | |
| const OvImageT< C > & | i2 | |||
| ) | [friend] |
e.g., i1 = 5.2-i3;
| const OvImageT<C> operator- | ( | const OvImageT< C > & | i1, | |
| const OvImageT< C > & | i2 | |||
| ) | [friend] |
e.g., i1 = i2-i3;
| const OvImageT<C> operator/ | ( | const OvImageT< C > & | i1, | |
| const double | i2 | |||
| ) | [friend] |
e.g., i1 = i2/5;
| const OvImageT<C> operator/ | ( | const double | i1, | |
| const OvImageT< C > & | i2 | |||
| ) | [friend] |
e.g., i1 = 1/i3;
| const OvImageT<C> operator/ | ( | const OvImageT< C > & | i1, | |
| const OvImageT< C > & | i2 | |||
| ) | [friend] |
e.g., i1 = i2/i3;
| const OvImageT<bool> operator< | ( | const OvImageT< C > & | i1, | |
| const double | i2 | |||
| ) | [friend] |
e.g., iresult = i1<2;
| const OvImageT<bool> operator< | ( | const double | i1, | |
| const OvImageT< C > & | i2 | |||
| ) | [friend] |
e.g., iresult = 2<i2;
| const OvImageT<bool> operator< | ( | const OvImageT< C > & | i1, | |
| const OvImageT< C > & | i2 | |||
| ) | [friend] |
e.g., iresult = i1<i2;
| const OvImageT<bool> operator<= | ( | const OvImageT< C > & | i1, | |
| const double | i2 | |||
| ) | [friend] |
e.g., iresult = i1<=2;
| const OvImageT<bool> operator<= | ( | const double | i1, | |
| const OvImageT< C > & | i2 | |||
| ) | [friend] |
e.g., iresult = 2<=i2;
| const OvImageT<bool> operator<= | ( | const OvImageT< C > & | i1, | |
| const OvImageT< C > & | i2 | |||
| ) | [friend] |
e.g., iresult = i1<=i2;
| const OvImageT<bool> operator== | ( | const OvImageT< C > & | i1, | |
| const double | i2 | |||
| ) | [friend] |
e.g., iresult = i1==2;
| const OvImageT<bool> operator== | ( | const double | i1, | |
| const OvImageT< C > & | i2 | |||
| ) | [friend] |
e.g., iresult = 2==i2;
| const OvImageT<bool> operator== | ( | const OvImageT< C > & | i1, | |
| const OvImageT< C > & | i2 | |||
| ) | [friend] |
e.g., iresult = i1==i2;
| const OvImageT<bool> operator> | ( | const OvImageT< C > & | i1, | |
| const double | i2 | |||
| ) | [friend] |
e.g., iresult = i1>2;
| const OvImageT<bool> operator> | ( | const double | i1, | |
| const OvImageT< C > & | i2 | |||
| ) | [friend] |
e.g., iresult = 2>i2;
| const OvImageT<bool> operator> | ( | const OvImageT< C > & | i1, | |
| const OvImageT< C > & | i2 | |||
| ) | [friend] |
e.g., iresult = i1>i2;
| const OvImageT<bool> operator>= | ( | const OvImageT< C > & | i1, | |
| const double | i2 | |||
| ) | [friend] |
e.g., iresult = i1>=2;
| const OvImageT<bool> operator>= | ( | const double | i1, | |
| const OvImageT< C > & | i2 | |||
| ) | [friend] |
e.g., iresult = 2>=i2;
| const OvImageT<bool> operator>= | ( | const OvImageT< C > & | i1, | |
| const OvImageT< C > & | i2 | |||
| ) | [friend] |
e.g., iresult = i1>=i2;
| const OvImageT<bool> operator|| | ( | const OvImageT< bool > & | i1, | |
| const OvImageT< bool > & | i2 | |||
| ) | [friend] |
e.g., iflag1 = iflag2 || iflag3;
| const OvImageT<C> pow | ( | double | p, | |
| const OvImageT< C > & | i1 | |||
| ) | [friend] |
e.g., i2 = pow(3,i1);
| const OvImageT<C> pow | ( | const OvImageT< C > & | i1, | |
| double | p | |||
| ) | [friend] |
e.g., i2 = pow(i1,2);
| 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);
| 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 |
| 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.
| 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) |
| 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.
| 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. |
| 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.
| 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. |
Converts multi-channel color image to single-channel gray image by averaging channels.
e.g.,
i2 = rgb2gray(i1);
| input | the input image |
| const OvImageT<C> round | ( | const OvImageT< C > & | i1 | ) | [friend] |
e.g., i2 = round(i1);
| 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.
| input | the input image | |
| columns | horizontal translation in pixels (default = 0) | |
| rows | vertical translation in pixels (default = 0) |
| const OvImageT<C> sin | ( | const OvImageT< C > & | i1 | ) | [friend] |
e.g., i2 = sin(i1);
| const OvImageT<C> sinh | ( | const OvImageT< C > & | i1 | ) | [friend] |
e.g., i2 = sinh(i1);
| const OvImageT<C> sqrt | ( | const OvImageT< C > & | i1 | ) | [friend] |
e.g., i2 = sqrt(i1);
| 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)
| input | the input image | |
| dimension | the dimension to sum along [1 = sum rows, 2 = sum columns, 3 = sum channels(default)] |
| T sumAll | ( | const OvImageT< T > & | input | ) | [related] |
Sums all image pixels. e.g.,
i2 = sumAll(i1);
| 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);
| 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)) |
| 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
| input | the input image | |
| channel | the channel to be summed |
| const OvImageT<C> tan | ( | const OvImageT< C > & | i1 | ) | [friend] |
e.g., i2 = tan(i1);
| const OvImageT<C> tanh | ( | const OvImageT< C > & | i1 | ) | [friend] |
e.g., i2 = tang(i1);
Transposes the image. Each color channel is independently transposed.
e.g.,
i2 = transpose(i1);
| input | the input image |
number of color channels or dimensions (e.g., 1 for grayscale, 3 for RGB)
int OvImageT< T >::mHeightTimesWidth [protected] |
mWidth*mHeight (for convenience)
mWidth*mHeight*mChannels (for convenience)
1.4.7