00001 #ifndef TRV_MOSAIC_HPP
00002 #define TRV_MOSAIC_HPP
00003
00004 #include "traversability/trv_homographyMosaic.hpp"
00005
00006 #include "kernel/jafarException.hpp"
00007 #include "jmath/jblas.hpp"
00008 #include "jmath/ublasExtra.hpp"
00009
00010 namespace jafar {
00011 namespace traversability {
00012
00021 class Mosaic
00022 {
00023
00024 protected:
00025 jafar::image::Image mMosaic;
00026 HomographyMosaic mH_mosaic;
00027 int mNumberOfTiles;;
00028 cv::Rect mBb;
00029
00030 public:
00042 Mosaic ( int mosaicWidth, int mosaicHeight, int uShift = 0, int vShift = 0,
00043 JfrImage_TypeColorSpace colSpace = JfrImage_CS_GRAY );
00044 ~Mosaic ( void );
00045
00046
00051 jafar::image::Image get ( void ) { return mMosaic; }
00056 jblas::mat33 getH_C0Cn ( void ) { return mH_mosaic.getH_C0Cn(); }
00057
00062 void setH_C0Cn ( const jblas::mat33 &H_C0Cn ) { mH_mosaic.setH_C0Cn(H_C0Cn); }
00067 void update ( const jblas::mat33 &H_C0C1 ) { mH_mosaic.update(H_C0C1); }
00068
00076 void initMosaic ( int mosaicWidth, int mosaicHeight, float uShift, float vShift );
00083 void reset ( float uShift=0.0, float vShift=0.0 );
00084
00092 void add ( const jafar::image::Image &imgIn, const jafar::image::Image &imgMsk1 );
00097 void addCorners ( const jafar::image::Image &imgIn );
00098
00099 protected:
00100
00109 void calcBoundingRect ( const jblas::mat33 &H_COutCIn, const jafar::image::Image &imgIn, cv::Rect &boundingRect );
00115 void shrinkBoundingRectToImage ( const jafar::image::Image &img, cv::Rect &boundingRect );
00116 };
00117
00118 }
00119 }
00120
00121 # endif
00122