contrib/brl/bseg/sdet/sdet_region_proc.h
Go to the documentation of this file.
00001 #ifndef sdet_region_proc_h_
00002 #define sdet_region_proc_h_
00003 //---------------------------------------------------------------------
00004 //:
00005 // \file
00006 // \brief a processor for extracting expanded resolution regions
00007 //
00008 // edgel_regions uses a flood fill algorithm and is thus
00009 // region labeling is only as localized as one pixel.
00010 //
00011 // \author
00012 //  J.L. Mundy - April 11, 2001
00013 //
00014 // \verbatim
00015 // Modifications
00016 //  8 May 2002 - Peter Vanroose - class name changed from region_proc to sdet_region_proc
00017 // \endverbatim
00018 //
00019 //-------------------------------------------------------------------------
00020 #include <vcl_vector.h>
00021 #include <vil1/vil1_image.h>
00022 #include <vil/vil_image_resource.h>
00023 #include <vil/vil_image_view.h>
00024 #include <vsol/vsol_box_2d_sptr.h>
00025 #include <vtol/vtol_intensity_face_sptr.h>
00026 #include <brip/brip_roi_sptr.h>
00027 #include <sdet/sdet_region_proc_params.h>
00028 class sdet_detector;
00029 class sdet_region_proc : public sdet_region_proc_params
00030 {
00031  public:
00032   //Constructors/destructor
00033   sdet_region_proc(sdet_region_proc_params& rpp);
00034 
00035   ~sdet_region_proc();
00036   //Accessors
00037   void set_image(vil1_image const& image,
00038                  vsol_box_2d_sptr const& box = vsol_box_2d_sptr());
00039 
00040   void set_image_resource(vil_image_resource_sptr const& image,
00041                           vsol_box_2d_sptr const& box = vsol_box_2d_sptr());
00042 
00043 
00044   vcl_vector<vtol_intensity_face_sptr>& get_regions(){return regions_;}
00045 
00046   //Utility Methods
00047   void extract_regions();
00048   void clear();
00049 
00050   vil1_image get_residual_image();
00051   vil_image_view<float> get_residual_image_view();
00052 
00053   //Debug methods
00054   vil1_image get_edge_image() const {return edge_image_;}
00055   vil_image_view<unsigned char> get_edge_image_view();
00056   vil_image_resource_sptr get_edge_image_resource();
00057  protected:
00058   //protected methods
00059   bool set_detector_image_vil(sdet_detector& d);
00060   bool set_detector_image_vil1(sdet_detector& d);
00061 
00062   //members
00063   bool regions_valid_;      //process state flag
00064   bool use_vil_image_;   //flag to determine image type
00065   vil1_image image_;  //input vil1_image
00066   vil_image_resource_sptr vimage_; //input vil image
00067   brip_roi_sptr roi_; //region of interest
00068   vil1_image clip_; //clipped image region
00069   vil_image_resource_sptr vclip_; //clipped image resource
00070   vil1_image edge_image_;//debug
00071   vcl_vector<vtol_intensity_face_sptr> regions_; //resulting intensity faces
00072 };
00073 
00074 #endif // sdet_region_proc_h_