Jafar
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
activeSegmentSearch.hpp
Go to the documentation of this file.
00001 
00014 #ifndef ACTIVESEGMENTSEARCH_HPP
00015 #define ACTIVESEGMENTSEARCH_HPP
00016 
00017 #include "jmath/random.hpp"
00018 #include "jmath/jblas.hpp"
00019 #include "image/roi.hpp"
00020 
00021 #include "rtslam/gaussian.hpp"
00022 #include "rtslam/rtSlam.hpp"
00023 
00024 #include <iostream>
00025 
00026 namespace jafar {
00027    namespace rtslam {
00028       using namespace jblas;
00029 
00030 
00038       class ActiveSegmentSearchGrid {
00039 
00040             friend std::ostream& operator <<(std::ostream & s, ActiveSegmentSearchGrid const & grid);
00041 
00042          private:
00043             veci2 imgSize;
00044             veci2 gridSize;
00045             veci2 cellSize;
00046             veci2 offset;
00047             mati projectionsCount;
00048             mati emptyCellsTile_tmp;
00049             int separation;
00050             int margin;
00051             int cells_h;
00052          public:
00053             typedef std::vector<std::vector<observation_ptr_t> > Grid;
00054             Grid projections;
00055 
00056          public:
00065             ActiveSegmentSearchGrid(const int & imgSize_h, const int & imgSize_v, const int & nCells_h, const int & nCells_v, const int & margin = 0,
00066                 const int & separation = 0);
00067 
00072             void clear();
00073 
00078             void renew();
00079 
00084             void addObs(const vec4 & pix, observation_ptr_t obsPtr);
00085 
00091             bool getRoi(image::ConvexRoi & roi);
00092 
00098             void setFailed(const image::ConvexRoi & roi);
00099 
00100 
00101          private:
00105             template<class Vec>
00106         veci4 pix2cell(const Vec & pix) {
00107           veci4 cell;
00108                cell(0) = (pix(0) - offset(0)) / cellSize(0);
00109           cell(1) = (pix(1) - offset(1)) / cellSize(1);
00110           cell(2) = (pix(2) - offset(0)) / cellSize(0);
00111           cell(3) = (pix(3) - offset(1)) / cellSize(1);
00112                return cell;
00113             }
00114 
00118             veci2 cellOrigin(const veci2 & cell);
00119 
00123             vec2 cellCenter(const veci2 & cell);
00124 
00128             bool pickEmptyCell(veci2 & cell);
00129 
00133             void cell2roi(const veci2 & cell, image::ConvexRoi & roi);
00134 
00135       };
00136 
00137 #if 0
00138 
00142       class ActiveSearch {
00143          public:
00144             vecb visibleObs;
00145             vecb selectedObs;
00146 
00158             std::map<double, observation_ptr_t> projectAll(const sensor_ptr_t & senPtr, size_t & numVis);
00159 
00167             void predictApp(const observation_ptr_t & obsPtr);
00168 
00172             void scanObs(const observation_ptr_t & obsPtr, const image::ConvexRoi & roi);
00173       };
00174 #endif
00175    }
00176 }
00177 
00178 #endif // ACTIVESEGMENTSEARCH_HPP
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines

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