Lens distortion correction division model 1p
 All Classes Files Functions Variables
ami::image< T > Class Template Reference

Class to store multiChannel images and basic methods. More...

#include <image.h>

Public Types

typedef std::vector< T >::iterator iterator
 

Public Member Functions

 image ()
 basic destructor More...
 
 image (const int width, const int height)
 image constructor taking memory More...
 
 image (const T *vector, const int width, const int height, const int channels)
 image from T vector More...
 
 image (const int width, const int height, const int nChannels, const T &a)
 image constructor taking memory and initialiting with a value More...
 
 image (const int width, const int height, const T &a, const T &b, const T &c)
 image constructor taking memory and initialiting the channels: R with a value, G with b value and B with c value More...
 
 image (const int width, const int height, const int nChannels)
 image constructor taking memory and initialiting with a value More...
 
 image (std::string name)
 Constructor from an image file. More...
 
 image (const image< bool > &img_in, bool isbool)
 
 image (const image< T > &img_in)
 image copy constructor More...
 
 ~image ()
 basic constructor More...
 
std::vector< T > * get_image ()
 
int width () const
 
int height () const
 
int nChannels () const
 
int size () const
 
T & operator[] (const int &i)
 operator [] to acces image value More...
 
T & operator() (const int &x, const int &y, const int &channel)
 operator () to acces image value More...
 
const T & operator[] (const int &i) const
 operator [] to acces image value More...
 
int write (std::string name)
 Function to write an image to disk. More...
 
int write_bool (std::string name)
 function to write to disk a 8/16 bit tif image from boolean image More...
 
int read (std::string name)
 Read an image selecting the library depend on the image format, returns 0 when it can't load the image. More...
 
imageoperator= (const image &image2)
 operator = (equality of images of different size is not allowed ) More...
 
void clear ()
 Function to put the image to 0 and clear its vectors. More...
 
void init (const int width, const int height, const int nChannels)
 initializes the image taking memory More...
 
void set_nchannels (int nchannel1)
 Change number of channels. More...
 
void set_size (int width, int height)
 Change the image dimensions. More...
 
void imageMirrored ()
 mirrored the image More...
 
image< T > const resize (const int width, const int height) const
 
image< T > const resize_no_omp (const int width, const int height) const
 
image< T > const linear_transform (const double H[3][3]) const
 function to apply a linear transform given by an homography H to the image. H goes to the output image to the input image More...
 
image< T > const sampling () const
 method to downsample the image by a factor of 2. We filter the image before downsampling
 
std::vector< int > get_roi () const
 
void roi_clear ()
 
void set_roi (const int x0, const int x1, const int y0, const int y1)
 function to set a subwindow border More...
 
void set_roi (const int x0, const int x1, const int y0, const int y1, const int c0, const int c1)
 function to set a subwindow border More...
 
void set_roi (const std::vector< int > roi)
 function to set a subwindow border More...
 
template<class U >
void get_roi_image (image< U > &image2) const
 
image< T > const get_roi_image (const std::vector< int > &roi2) const
 
template<class U >
void set_roi_image (const image< U > &image2)
 
iterator begin ()
 
iterator end ()
 
void rgb_to_hsv (image< unsigned char > &H, image< unsigned char > &S, image< unsigned char > &V)
 function to get colour model HSV from RGB (unsigned char version) More...
 
template<class U >
void hsv_to_rgb (image< U > &image)
 
get_value (const int x)
 get value to x position of vector More...
 
void set_value (const int x, T value)
 set value to x position of vector More...
 
template<class U >
void get_histogram (std::vector< U > &histograma, int channel)
 

Detailed Description

template<class T>
class ami::image< T >

Class to store multiChannel images and basic methods.

Author
Luis Alvarez

Constructor & Destructor Documentation

template<class T >
ami::image< T >::image ( )

basic destructor

Author
Luis Alvarez
template<class T >
ami::image< T >::image ( const int  width,
const int  height 
)

image constructor taking memory

Author
Luis Alvarez
template<class T >
ami::image< T >::image ( const T *  vector,
const int  width,
const int  height,
const int  channels 
)

image from T vector

Author
Carlos Falcon
template<class T >
ami::image< T >::image ( const int  width,
const int  height,
const int  nChannels,
const T &  a 
)

image constructor taking memory and initialiting with a value

Author
Luis Alvarez
template<class T >
ami::image< T >::image ( const int  width,
const int  height,
const T &  a,
const T &  b,
const T &  c 
)

image constructor taking memory and initialiting the channels: R with a value, G with b value and B with c value

Author
Carlos Falcon
template<class T >
ami::image< T >::image ( const int  width,
const int  height,
const int  nChannels 
)

image constructor taking memory and initialiting with a value

Author
Luis Alvarez
template<class T >
ami::image< T >::image ( std::string  name)

Constructor from an image file.

Parameters
[in]nameInput file name.
Author
Pedro Henriquez
Parameters
nameINPUT FILE NAME
template<class T >
ami::image< T >::image ( const image< T > &  img_in)

image copy constructor

Author
Carlos Falcon
template<class T >
ami::image< T >::~image ( )

basic constructor

Author
Luis Alvarez

Member Function Documentation

template<class T >
void ami::image< T >::clear ( )

Function to put the image to 0 and clear its vectors.

Author
Pedro Henriquez
template<class T >
template<class U >
void ami::image< T >::get_histogram ( std::vector< U > &  histograma,
int  channel 
)
Parameters
histogramahistograma de dimension 256
channelchannel to obtain the histogram
template<class T >
T ami::image< T >::get_value ( const int  x)

get value to x position of vector

Author
Carlos Falcon
template<class T >
void ami::image< T >::imageMirrored ( )

mirrored the image

Author
Javier Martin Abasolo
template<class T >
void ami::image< T >::init ( const int  width,
const int  height,
const int  nChannels 
)

initializes the image taking memory

Author
Carlos Falcon
template<class T >
image< T > const ami::image< T >::linear_transform ( const double  H[3][3]) const

function to apply a linear transform given by an homography H to the image. H goes to the output image to the input image

Author
Luis Alvarez
template<class T >
T & ami::image< T >::operator() ( const int &  x,
const int &  y,
const int &  channel 
)
inline

operator () to acces image value

Author
Javier Martin
template<class T >
image< T > & ami::image< T >::operator= ( const image< T > &  image2)

operator = (equality of images of different size is not allowed )

Author
Luis Alvarez
template<class T >
T & ami::image< T >::operator[] ( const int &  i)
inline

operator [] to acces image value

Author
Luis Alvarez
template<class T >
const T & ami::image< T >::operator[] ( const int &  i) const
inline

operator [] to acces image value

Author
Luis Alvarez
template<class T >
int ami::image< T >::read ( std::string  name)

Read an image selecting the library depend on the image format, returns 0 when it can't load the image.

Author
Pedro Henriquez and Daniel Santana-Cedres
template<class T >
image< T > const ami::image< T >::resize ( const int  width,
const int  height 
) const
Parameters
widthnew image width
heightnew image height
template<class T >
void ami::image< T >::rgb_to_hsv ( image< unsigned char > &  H,
image< unsigned char > &  S,
image< unsigned char > &  V 
)

function to get colour model HSV from RGB (unsigned char version)

Author
Carlos Falcon
template<class T >
void ami::image< T >::set_nchannels ( int  nchannel1)

Change number of channels.

Parameters
[in]nchannel1New number of channels.
Author
Pedro Henriquez
template<class T >
void ami::image< T >::set_roi ( const int  x0,
const int  x1,
const int  y0,
const int  y1 
)

function to set a subwindow border

Author
Luis Alvarez
template<class T >
void ami::image< T >::set_roi ( const int  x0,
const int  x1,
const int  y0,
const int  y1,
const int  c0,
const int  c1 
)

function to set a subwindow border

Author
Luis Alvarez
template<class T >
void ami::image< T >::set_roi ( const std::vector< int >  roi)

function to set a subwindow border

Author
Luis Alvarez
template<class T >
void ami::image< T >::set_size ( int  width,
int  height 
)

Change the image dimensions.

Parameters
[in]width,heightNew image dimensions.
Author
Pedro Henriquez
template<class T >
void ami::image< T >::set_value ( const int  x,
value 
)

set value to x position of vector

Author
Carlos Falcon
template<class T >
int ami::image< T >::write ( std::string  name)

Function to write an image to disk.

Parameters
[in]nameFilename of the image.
Author
Pedro Henriquez and Daniel Santana-Cedres
Parameters
nameimage file name
template<class T >
int ami::image< T >::write_bool ( std::string  name)

function to write to disk a 8/16 bit tif image from boolean image

Author
Carlos Falcon
Parameters
nameimage file name

The documentation for this class was generated from the following file: