00001 #ifndef sdet_atmospheric_image_classifier_h_ 00002 #define sdet_atmospheric_image_classifier_h_ 00003 //: 00004 // \file 00005 // \brief A subclass of sdet_texture_classifier to determine image quality based on atmospheric effects such as clouds and haze 00006 // 00007 // \author J.L. Mundy 00008 // \date January 28, 2012 00009 //----------------------------------------------------------------------------- 00010 #include <sdet/sdet_texture_classifier.h> 00011 // 00012 // This classifier is based on learning textures for images with and without 00013 // significant atmospheric effects such as clouds and haze 00014 // The class assumes a set of categories associated with atmospheric-free 00015 // conditions such as urban, water, shadow, and two atmospheric categories: 00016 // cloud and haze. This classifier then produces a color image quality 00017 // blocked image. The color pixel values in the output are assigned as: 00018 // red - belief the high atmospheric effects occur in the block 00019 // green - belief the the block is free of atmospheric effects 00020 // blue - degree of uncertainty based on subjective logic theory 00021 // 00022 class sdet_atmospheric_image_classifier : public sdet_texture_classifier 00023 { 00024 public: 00025 sdet_atmospheric_image_classifier(sdet_texture_classifier_params const& params) : sdet_texture_classifier(params){} 00026 00027 ~sdet_atmospheric_image_classifier(){}; 00028 //: typically the atmospheric categories are "cld" and "haz" 00029 void set_atmospheric_categories(vcl_vector<vcl_string> const& atmos_cats) 00030 {atmos_categories_ = atmos_cats;} 00031 //: image of atmospheric quality expressed as colors 00032 vil_image_view<float> classify_image_blocks_qual(vcl_string const& img_path); 00033 vil_image_view<float> classify_image_blocks_qual(vil_image_view<float> const& image); 00034 00035 //: classify image quality based on expected model image and incoming image 00036 // Assumes that textons have been computed for the model generating the 00037 // expected image of a scene. The image is then classified according to 00038 // its similarity to the expected image, via the texton histogram for the 00039 // model. 00040 vil_image_view<float> 00041 classify_image_blocks_expected(vcl_string const& img_path, 00042 vcl_string const& exp_path); 00043 vil_image_view<float> 00044 classify_image_blocks_expected(vil_image_view<float> const& image, 00045 vil_image_view<float> const& exp); 00046 protected: 00047 void category_quality_color_mix(vcl_map<vcl_string, float>& probs, 00048 vnl_vector_fixed<float, 3> const& uncert, 00049 vnl_vector_fixed<float, 3>& color_mix); 00050 vcl_vector<vcl_string> atmos_categories_; 00051 bool atmos_cat(vcl_string const& cat); 00052 }; 00053 00054 #endif // sdet_atmospheric_image_classifier_h_