00001 #ifndef vepl_threshold_h_ 00002 #define vepl_threshold_h_ 00003 //: 00004 // \file 00005 // \brief set pixel to given value if above/below certain threshold 00006 // 00007 // This class actually implements two threshold operations, namely the 00008 // `classical' single threshold mapping where pixel values not larger than 00009 // T are mapped to L, values larger than T to H; and the `clipping' 00010 // operation where only pixel values below T are mapped to L, the others 00011 // left unchanged. 00012 // 00013 // For the first version, the constructor must be given three parameters: 00014 // T, L and H. For the second version, two parameters: T and L. 00015 // In the second situation, there clearly must be an implicit conversion 00016 // from DataIn to DataOut. Note that this is not necessary in the 00017 // first situation, because all output pixels will be either L or H. 00018 // 00019 // Note that the input image data type must support "operator<=()"; thus 00020 // thresholding of colour images makes no sense (unless you define a 00021 // sensible "<=" for RGB triples). 00022 // 00023 // \author Peter Vanroose, K.U.Leuven (ESAT/PSI) 00024 // \date 7 October 2002 00025 // 00026 // \verbatim 00027 // Modifications 00028 // Peter Vanroose - 20 aug 2003 - changed parameter and return types from vil_image_view_base_sptr to vil_image_resource_sptr 00029 // \endverbatim 00030 00031 #include <vil/vil_image_resource.h> 00032 00033 //: set pixel to given value if above/below certain threshold 00034 vil_image_resource_sptr vepl_threshold(vil_image_resource_sptr , double threshold=128.0, double below=1.0, double above=0.0); 00035 00036 #endif // vepl_threshold_h_