Main Page | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Class Members | File Members

brct_dense_reconstructor.h

Go to the documentation of this file.
00001 //--*-c++-*----
00002 #ifndef brct_dense_reconstructor_h_
00003 #define brct_dense_reconstructor_h_
00004 
00005 //:
00006 // \file
00007 // \brief A class to carry out dense stereo reconstruction
00008 //
00009 // \author J.L. Mundy
00010 // \verbatim
00011 //  Initial version April 14, 2004
00012 // \endverbatim
00013 //
00014 //////////////////////////////////////////////////////////////////////
00015 
00016 #include <vcl_vector.h>
00017 // not used? #include <vcl_string.h>
00018 #include <vil1/vil1_image.h>
00019 #include <vsol/vsol_point_2d_sptr.h>
00020 #include <vsrl/vsrl_image_correlation.h>
00021 #include <vsrl/vsrl_raster_dp_setup.h>
00022 #include <vsrl/vsrl_dense_matcher.h>
00023 
00024 class brct_dense_reconstructor : public vsrl_dense_matcher
00025 {
00026   vsrl_image_correlation image_correlation_;
00027   vsrl_raster_dp_setup **raster_array_;
00028   int num_raster_;
00029   int correlation_range_; // the correlation range of the data
00030 
00031  public:
00032 
00033   // constructor
00034   brct_dense_reconstructor(vil1_image const& im1, vil1_image const& img2);
00035 
00036   // destructor
00037   ~brct_dense_reconstructor();
00038   //: set search range
00039   void set_search_range(const int range);
00040 
00041   //: set correlation window radius
00042   void set_correlation_window_radius(const int radius);
00043 
00044   //: set inner null cost
00045   void set_inner_cost(const double inner_cost);
00046 
00047   //: set outer null cost
00048   void set_outer_cost(const double outer_cost);
00049 
00050   //: set continuity cost
00051   void set_continuity_cost(const double continuity_cost);
00052 
00053   //: set up dense matching data
00054   void initial_calculations();
00055 
00056   //: performs the dynamic program on the specified raster
00057   void evaluate_raster(const int i);
00058 
00059   //: do all rasters
00060   void execute();
00061 
00062   //: print parameters
00063   void print_params();
00064 
00065   //: get vsol points corresponding to a line from image 0
00066   vcl_vector<vsol_point_2d_sptr> points0(const int i, const int del = 5);
00067 
00068   //: get vsol points corresponding to a line from image 1
00069   vcl_vector<vsol_point_2d_sptr> points1(const int i, const int del = 5);
00070 
00071   //: get the assigned coordinate
00072   virtual  int get_assignment(int x, int y);
00073 
00074   //: get the disparity of pixel x,y
00075   virtual int get_disparity(int x, int y);
00076 
00077   //: get the correlation values within the search range
00078   void get_correlation(const int x, const int y, vcl_vector<int>& xpos, vcl_vector<double>& corr);
00079 
00080   //: write an image of the disparity
00081   void write_disparity_image(char *filename);
00082 
00083   //: print out the correlation costs for point x,y
00084   void print_correlation_cost(const int x, const int y);
00085 };
00086 
00087 #endif // brct_dense_reconstructor_h_

Generated on Thu Jan 10 14:54:03 2008 for contrib/brl/bmvl/brct by  doxygen 1.4.4