contrib/brl/bbas/bdgl/bdgl_region_algs.h
Go to the documentation of this file.
00001 #ifndef bdgl_region_algs_h_
00002 #define bdgl_region_algs_h_
00003 //-----------------------------------------------------------------------------
00004 //:
00005 // \file
00006 // \author J.L. Mundy
00007 // \date   July 17, 2004
00008 // \brief vdgl_digital_region algorithms
00009 //
00010 // \verbatim
00011 //  Modifications
00012 //   22-SEP-2004 - Peter Vanroose - bug fix: do not modify intensities of given
00013 //                                  regions with qsort in earth_mover_distance()
00014 // \endverbatim
00015 //
00016 //-----------------------------------------------------------------------------
00017 #include <vdgl/vdgl_digital_region_sptr.h>
00018 
00019 class bdgl_region_algs
00020 {
00021   bdgl_region_algs() {} //!< private default constructor: all methods are static
00022 
00023  public:
00024   ~bdgl_region_algs() {}
00025 
00026   //:Computes the Mahalanobis distance between two regions
00027   // Returns -1 if the distance cannot be reliably calculated.
00028   static float mahalanobis_distance(vdgl_digital_region_sptr const& r1,
00029                                     vdgl_digital_region_sptr const& r2);
00030   //:Computes the intensity distance between two regions
00031   // Returns -1 if the distance cannot be reliably calculated.
00032   static float intensity_distance(vdgl_digital_region_sptr const& r1,
00033                                   vdgl_digital_region_sptr const& r2);
00034 
00035   //:Computes a variant of the earth mover's distance with respect to intensity
00036   // Returns -1 if the distance cannot be reliably calculated.
00037   static float earth_mover_distance(vdgl_digital_region_sptr const& r1,
00038                                     vdgl_digital_region_sptr const& r2);
00039 
00040   //:Merges two digital regions and returns false if there is failure
00041   static bool merge(vdgl_digital_region_sptr const& r1,
00042                     vdgl_digital_region_sptr const& r2,
00043                     vdgl_digital_region_sptr& rm);
00044 };
00045 
00046 #endif