contrib/oxl/osl/osl_edge_detector_params.cxx
Go to the documentation of this file.
00001 // This is oxl/osl/osl_edge_detector_params.cxx
00002 #include "osl_edge_detector_params.h"
00003 //:
00004 //  \file
00005 
00006 
00007 osl_edge_detector_params::osl_edge_detector_params()
00008   : sigma_(3.0f)
00009   , low_(6)
00010   , gauss_tail_(0.015f)
00011   , fill_gaps_(true)
00012   , verbose_(false)
00013 {
00014 }
00015 
00016 #if 0 // commented out
00017 // from osl_edge_detector
00018 osl_edge_detector_params::osl_edge_detector_params()
00019   : sigma_(1.0f)
00020   , low_(6)
00021   , gauss_tail_(0.05f)
00022   , grd_hist(false)
00023   , res(15)
00024   , verbose_(true)
00025 {
00026 }
00027 #endif
00028 
00029 osl_edge_detector_params::~osl_edge_detector_params() { }
00030 
00031 #if 0 // commented out
00032 //-----------------------------------------------------------------------------
00033 //
00034 //: Checks that parameters are within acceptable bounds
00035 //
00036 bool osl_edge_detector_params::SanityCheck()
00037 {
00038   vcl_strstream msg;
00039   bool valid = true;
00040 
00041   if (sigma_ <= 0)  // Standard deviation of the smoothing kernel
00042   {
00043     msg << "ERROR: Value of gaussian smoothing sigma is too low <=0" << vcl_ends;
00044     valid = false;
00045   }
00046 
00047   if (low_ <= 0)    // Noise weighting factor
00048   {
00049     msg << "ERROR: Value of noise weight must be >0" << vcl_ends;
00050     valid = false;
00051   }
00052 
00053   if (gauss_tail_ <= 0) // Cutoff for gaussian kernel radius
00054   {
00055     msg << "ERROR: Value of gauss tail fraction is too low <= 0" << vcl_ends;
00056     valid = false;
00057   }
00058   error_msg_ = msg.str();
00059   return valid;
00060 }
00061 #endif