Jafar
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
Public Member Functions | Protected Member Functions | Protected Attributes
jafar::traversability::Mosaic Class Reference

Mosaic represents a mosaic of aerial images. More...


Detailed Description

Mosaic represents a mosaic of aerial images.

Internally, the ``cumulative'' homography H_{I_OI_n} between the first image I_0 and the actual I_n is maintained by an instantiation of HomographyMosaic . The mosaic image is stored in an image of type Image. (So the image is defined statically.) In a later step, the mosaic image should be made dynamic.

Definition at line 21 of file trv_mosaic.hpp.

#include <trv_mosaic.hpp>

Inheritance diagram for jafar::traversability::Mosaic:
Inheritance graph
[legend]

List of all members.

Public Member Functions

 Mosaic (int mosaicWidth, int mosaicHeight, int uShift=0, int vShift=0, JfrImage_TypeColorSpace colSpace=JfrImage_CS_GRAY)
 Constructor.
jafar::image::Image get (void)
 Returns the mosaic image.
jblas::mat33 getH_C0Cn (void)
 Returns the actual "cumulative" homography H_{I_OI_n}.
void setH_C0Cn (const jblas::mat33 &H_C0Cn)
 Set the "cumulative" homography from outside (for experimental purposes)
void update (const jblas::mat33 &H_C0C1)
 Update the "cumulative" homography by appending the last interframe homography H_C0C1.
void initMosaic (int mosaicWidth, int mosaicHeight, float uShift, float vShift)
 Set the homography to $ \left( \begin{array}{ccc} 1 & 0 & \mathtt{mosaicWidth/2.0 + uShift} \\ 0 & 1 & \mathtt{mosaicHeight/2.0 + vShift} \\ 0 & 0 & 1 \end{array} \right) $.
void reset (float uShift=0.0, float vShift=0.0)
 Same as initMosaic, but additionally sets the mosaic image to zero.
void add (const jafar::image::Image &imgIn, const jafar::image::Image &imgMsk1)
 Add a frame to the mosaic.
void addCorners (const jafar::image::Image &imgIn)
 Utility function to indicate the corners of the image.

Protected Member Functions

void calcBoundingRect (const jblas::mat33 &H_COutCIn, const jafar::image::Image &imgIn, cv::Rect &boundingRect)
 Calculate the bounding rectangle which contains the actual image (that has to be added to the mosaic) With the help of the bounding rectangle, one does not have to iterate through all pixels of the mosaic image in order to add an image to the mosaic.
void shrinkBoundingRectToImage (const jafar::image::Image &img, cv::Rect &boundingRect)
 Shrink the bounding rectangle to the visible area of the mosaic.

Protected Attributes

jafar::image::Image mMosaic
HomographyMosaic mH_mosaic
int mNumberOfTiles
cv::Rect mBb

Constructor & Destructor Documentation

jafar::traversability::Mosaic::Mosaic ( int  mosaicWidth,
int  mosaicHeight,
int  uShift = 0,
int  vShift = 0,
JfrImage_TypeColorSpace  colSpace = JfrImage_CS_GRAY 
)

Constructor.

It instantiates the image object where the mosaic is stored, and initializes the "cumulative" homography H_{I_OI_n}, taking into account a shift to place the first image of the mosaic to the desired spot. (By default, the homography starts in the image center.)

Parameters:
mosaicWidthwidth of the mosaic image
mosaicHeightheight of the mosaic image
uShiftshift in u direction, in pixels, default value is 0
vShiftshift in v direction, in pixels, default value is 0
colSpacecolor space of the mosaic image, default value is JfrImage_CS_GRAY

Member Function Documentation

void jafar::traversability::Mosaic::add ( const jafar::image::Image imgIn,
const jafar::image::Image imgMsk1 
)

Add a frame to the mosaic.

The "cumulative" homography H_C0Cn is used to project the image imgIn to the mosaic.

Parameters:
imgInimage to be added
imgMsk1mask that indicates the common field of view between imgIn and the precedent image Note that the imgMsk1 is not really needed for this function... However, it saves a few calculations.

Utility function to indicate the corners of the image.

Parameters:
imgInimage, whose corners have to be added
void jafar::traversability::Mosaic::calcBoundingRect ( const jblas::mat33 H_COutCIn,
const jafar::image::Image imgIn,
cv::Rect &  boundingRect 
) [protected]

Calculate the bounding rectangle which contains the actual image (that has to be added to the mosaic) With the help of the bounding rectangle, one does not have to iterate through all pixels of the mosaic image in order to add an image to the mosaic.

Parameters:
H_COutCInhomography between input image and mosaic (H_C0Cn)
imgIninput image
boundingRectresulting bounding rectangle, returned by reference

Returns the mosaic image.

Returns:
image of type jafar::image::Image

Definition at line 51 of file trv_mosaic.hpp.

Returns the actual "cumulative" homography H_{I_OI_n}.

Returns:
jblas::mat33 H_{I_OI_n}

Definition at line 56 of file trv_mosaic.hpp.

void jafar::traversability::Mosaic::initMosaic ( int  mosaicWidth,
int  mosaicHeight,
float  uShift,
float  vShift 
)

Set the homography to $ \left( \begin{array}{ccc} 1 & 0 & \mathtt{mosaicWidth/2.0 + uShift} \\ 0 & 1 & \mathtt{mosaicHeight/2.0 + vShift} \\ 0 & 0 & 1 \end{array} \right) $.

Parameters:
mosaicWidthwidth of mosaic image
mosaicHeightheight of mosaic image
uShiftshift in u direction
vShiftshift in v direciton
void jafar::traversability::Mosaic::reset ( float  uShift = 0.0,
float  vShift = 0.0 
)

Same as initMosaic, but additionally sets the mosaic image to zero.

"mosaicWidth" and "mosaicHeight" are retrieved here from the mosaic image object.

Parameters:
uShiftshift in u direction
vShiftshift in v direction
void jafar::traversability::Mosaic::setH_C0Cn ( const jblas::mat33 H_C0Cn) [inline]

Set the "cumulative" homography from outside (for experimental purposes)

Parameters:
H_C0Cn3x3 matrix of type jblas::mat33

Definition at line 62 of file trv_mosaic.hpp.

void jafar::traversability::Mosaic::shrinkBoundingRectToImage ( const jafar::image::Image img,
cv::Rect &  boundingRect 
) [protected]

Shrink the bounding rectangle to the visible area of the mosaic.

Parameters:
img(mosaic) image (only needed for its dimensions)
boundingRectbounding rectangle, calculated with calcBoundingRect
void jafar::traversability::Mosaic::update ( const jblas::mat33 H_C0C1) [inline]

Update the "cumulative" homography by appending the last interframe homography H_C0C1.

Parameters:
H_C0C1of type jblas::mat33

Definition at line 67 of file trv_mosaic.hpp.


The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines

Generated on Wed Oct 15 2014 00:37:51 for Jafar by doxygen 1.7.6.1
LAAS-CNRS