Jafar
|
Mosaic represents a mosaic of aerial images. More...
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>
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 . | |
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 |
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.)
mosaicWidth | width of the mosaic image |
mosaicHeight | height of the mosaic image |
uShift | shift in u direction, in pixels, default value is 0 |
vShift | shift in v direction, in pixels, default value is 0 |
colSpace | color space of the mosaic image, default value is JfrImage_CS_GRAY |
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.
imgIn | image to be added |
imgMsk1 | mask 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. |
void jafar::traversability::Mosaic::addCorners | ( | const jafar::image::Image & | imgIn | ) |
Utility function to indicate the corners of the image.
imgIn | image, 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.
H_COutCIn | homography between input image and mosaic (H_C0Cn) |
imgIn | input image |
boundingRect | resulting bounding rectangle, returned by reference |
jafar::image::Image jafar::traversability::Mosaic::get | ( | void | ) | [inline] |
Returns the mosaic image.
Definition at line 51 of file trv_mosaic.hpp.
jblas::mat33 jafar::traversability::Mosaic::getH_C0Cn | ( | void | ) | [inline] |
Returns the actual "cumulative" homography 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 .
mosaicWidth | width of mosaic image |
mosaicHeight | height of mosaic image |
uShift | shift in u direction |
vShift | shift 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.
uShift | shift in u direction |
vShift | shift in v direction |
void jafar::traversability::Mosaic::setH_C0Cn | ( | const jblas::mat33 & | H_C0Cn | ) | [inline] |
Set the "cumulative" homography from outside (for experimental purposes)
H_C0Cn | 3x3 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.
img | (mosaic) image (only needed for its dimensions) |
boundingRect | bounding 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.
H_C0C1 | of type jblas::mat33 |
Definition at line 67 of file trv_mosaic.hpp.
Generated on Wed Oct 15 2014 00:37:51 for Jafar by doxygen 1.7.6.1 |