Go to the documentation of this file.00001 #ifndef brip_para_cvrg_h
00002 #define brip_para_cvrg_h
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035 #include <brip/brip_para_cvrg_params.h>
00036 #include <vil/vil_image_view.h>
00037 #include <vil/vil_image_resource_sptr.h>
00038 #include <vil/vil_rgb.h>
00039 #include <vcl_vector.h>
00040 class brip_para_cvrg : public brip_para_cvrg_params
00041 {
00042
00043
00044 public:
00045
00046
00047 brip_para_cvrg(float sigma = 1.0, float low = 6,
00048 float gauss_tail = .05,
00049 int proj_width = 7, int proj_height=1,
00050 int sup_radius = 1,
00051 bool verbose = true);
00052
00053 brip_para_cvrg(brip_para_cvrg_params& pdp);
00054 ~brip_para_cvrg();
00055 void do_coverage(vil_image_resource_sptr const& image);
00056
00057
00058 vil_image_view<float> get_float_detection_image(const float max = 255);
00059 vil_image_view<unsigned char> get_detection_image();
00060 vil_image_view<unsigned char> get_dir_image();
00061 vil_image_view<vil_rgb<unsigned char> > get_combined_image();
00062
00063 private:
00064 void init(vil_image_resource_sptr const & image);
00065 void init_variables();
00066 void set_kernel();
00067 void smooth_image();
00068 void avg(int x, int y, vil_image_view<float> const& smooth,
00069 vil_image_view<float>& avg);
00070 void grad0(int x, int y, vil_image_view<float> const& smooth,
00071 vil_image_view<float>& grad0);
00072 void grad45(int x, int y, vil_image_view<float> const& smooth,
00073 vil_image_view<float>& grad45);
00074 void grad90(int x, int y, vil_image_view<float> const& smooth,
00075 vil_image_view<float>& grad90);
00076 void grad135(int x, int y, vil_image_view<float> const& smooth,
00077 vil_image_view<float>& grad135);
00078 void compute_gradients();
00079 float project(int x, int y, int dir, vcl_vector<float>& projection);
00080 void remove_flat_peaks(int n, vcl_vector<float>& array);
00081 void non_maximum_supress(vcl_vector<float> const& array, vcl_vector<float>& sup_array);
00082 float parallel_coverage(vcl_vector<float> const& sup_array);
00083 void compute_parallel_coverage();
00084 void compute_image(vil_image_view<float> const& data,
00085 vil_image_view<unsigned char>& image);
00086
00087
00088 int proj_n_;
00089 int width_;
00090 int k_size_;
00091 vcl_vector<float> kernel_;
00092
00093 int xstart_, ystart_;
00094 int xsize_, ysize_;
00095 vil_image_view<float> smooth_;
00096 vil_image_view<float> avg_;
00097 vil_image_view<float> grad0_;
00098 vil_image_view<float> grad45_;
00099 vil_image_view<float> grad90_;
00100 vil_image_view<float> grad135_;
00101 vil_image_view<float> det_;
00102 vil_image_view<float> dir_;
00103
00104 vil_image_view<unsigned char> det_image_;
00105
00106 vil_image_view<unsigned char> dir_image_;
00107 vil_image_view<float> image_;
00108 vcl_vector<float> sup_proj_;
00109 vcl_vector<float> proj_0_;
00110 vcl_vector<float> proj_45_;
00111 vcl_vector<float> proj_90_;
00112 vcl_vector<float> proj_135_;
00113 };
00114
00115 #endif