#include <OkanMos.h>
Public Member Functions | |
void | removeShade (IplImage *&i0, IplImage *&i1, CvMat *&m0, CvMat *&m1) |
void | makeMosaic (int interpolationType, uchar **im1Mask=NULL) |
uchar | makeUImagePixel (double x) |
OkanMos () | |
~OkanMos () | |
void | getMosaic (IplImage **im, uchar ***mask, double imLine[6]=NULL) |
void | setBaseImage (IplImage *i0, uchar **i0mask=NULL, double i0line[6]=NULL) |
void | addSucImage (IplImage *suc, CvMat *mbase, CvMat *msuc, int interpolationType, uchar **i1mask=NULL) |
Public Attributes | |
IplImage * | image [2] |
double | line [6] |
uchar ** | realMask |
CvMat * | homMat [2] |
double | shadeMul [3] |
double | shadeAdd [3] |
OkanMos::OkanMos | ( | ) |
Constructor. It makes everything NULL
OkanMos::~OkanMos | ( | ) |
Destructor. It only releases homMat field. You should release image[0] and realMask manually by using getMosaic
void OkanMos::removeShade | ( | IplImage *& | i0, | |
IplImage *& | i1, | |||
CvMat *& | m0, | |||
CvMat *& | m1 | |||
) |
Private member function to calculate shadeAdd and shadeMul fields for removing illumination differencies.
i0 | first image | |
i1 | second image | |
m0 | homography matrix to be used in transformation from first image to second image | |
m1 | homography matrix to be used in transformation from second image to first image |
void OkanMos::makeMosaic | ( | int | interpolationType, | |
uchar ** | im1Mask = NULL | |||
) |
Core function of this class. It creates a new image[0] from current image[0] and image[1]. It uses shadeAdd and shadeMul. It works according to interpolationType
interpolationType | It is used for interpolation type. use 0 or 1. 0 = Nearest Neighboorhod 1 = Bilinear interpolation |
uchar OkanMos::makeUImagePixel | ( | double | x | ) | [inline] |
It rounds x to an integer between 0 and 255. It is an inline function.
x | It will be converted |
void OkanMos::getMosaic | ( | IplImage ** | im, | |
uchar *** | mask, | |||
double | imLine[6] = NULL | |||
) |
Get method of image[0] and realMask
im | It will keep pointer to image after function. It is used as a return value | |
mask | It will keep pointer to mask after function. It is used as a return value |
void OkanMos::setBaseImage | ( | IplImage * | i0, | |
uchar ** | i0mask = NULL , |
|||
double | i0line[6] = NULL | |||
) |
Sets base image. Base image is image[0]. It takes a copy of i0. According to i0's size it allocates memory for realMask.
i0 | image pointer of base image |
void OkanMos::addSucImage | ( | IplImage * | suc, | |
CvMat * | mbase, | |||
CvMat * | msuc, | |||
int | interpolationType, | |||
uchar ** | i1mask = NULL | |||
) |
Adds a new image to the mosaic. It does not take copy of suc image. It makes a shallow copy. Please do not deallocate suc image before you add a new image to the mosaic
suc | new image. Do not deallocate it before calling another addSucImage | |
mbase | Homography matrix which transforms image[0] to suc if image[1] is NULL. Otherwise it transforms image[1] to suc | |
msuc | Homography matrix which transforms suc to image[0] if image[1] is NULL. Otherwise it transforms suc to image[1] | |
interpolationType | It is used for interpolation type. use 0 or 1. 0 = Nearest Neighboorhod 1 = Bilinear interpolation |
IplImage* OkanMos::image[2] |
Private member which keeps base image and last image added to mosaic
double OkanMos::line[6] |
Private member which keeps world file information
uchar** OkanMos::realMask |
Private member which keeps mask of mosaic. Valid pixels are 1 , incalids are 0.
CvMat* OkanMos::homMat[2] |
Private member which keeps homography matix for transormations. image[0] * homMat[0] => image[1] image[1] * homMat[1] => image[0]
double OkanMos::shadeMul[3] |
Private member used for removing illumination differencies. newValue = image[1] * shadeMul + shadeAdd
double OkanMos::shadeAdd[3] |
Private member used for removing illumination differencies. newValue = image[1] * shadeMul + shadeAdd