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