contrib/brl/bseg/brip/brip_para_cvrg_params.cxx
Go to the documentation of this file.
00001 #include "brip_para_cvrg_params.h"
00002 //:
00003 // \file
00004 #include <vcl_sstream.h>
00005 #include <vcl_iostream.h>
00006 
00007 //-----------------------------------------------------------------------------
00008 //
00009 //: Checks that parameters are within acceptable bounds
00010 //
00011 bool brip_para_cvrg_params::SanityCheck()
00012 {
00013   vcl_stringstream msg;
00014   bool valid = true;
00015 
00016   if (sigma_ <= 0)  // Standard deviation of the smoothing kernel
00017   {
00018     msg << "ERROR: Value of gaussian smoothing sigma is too low <=0" << vcl_ends;
00019     valid = false;
00020   }
00021 
00022   if (thresh_ <= 0)  // Noise weighting factor
00023   {
00024     msg << "ERROR: Value of noise weight must be >0" << vcl_ends;
00025     valid = false;
00026   }
00027 
00028   if (gauss_tail_ <= 0) // Cutoff for gaussian kernel radius
00029   {
00030     msg << "ERROR: Value of gauss tail fraction is too low <= 0" << vcl_ends;
00031     valid = false;
00032   }
00033 
00034   if (proj_width_ <= 0)  //Projection kernel width
00035   {
00036     msg << "ERROR: Value of projection kernel width must be >0" << vcl_ends;
00037     valid = false;
00038   }
00039 
00040   if (proj_height_ <= 0)  //Projection kernel height
00041   {
00042     msg << "ERROR: Value of projection kernel height must be >0" << vcl_ends;
00043     valid = false;
00044   }
00045 
00046   if (sup_radius_ <= 0)  //Max suppression radius
00047   {
00048     msg << "ERROR: Value of max suppression radius must be >0" << vcl_ends;
00049     valid = false;
00050   }
00051 
00052   msg << vcl_ends;
00053   SetErrorMsg(msg.str().c_str());
00054   return valid;
00055 }
00056 
00057 vcl_ostream& operator<<(vcl_ostream& os, const brip_para_cvrg_params& pcp)
00058 {
00059   return
00060   os << "brip_para_coverage_params:\n[---\n"
00061      << "sigma " << pcp.sigma_ << vcl_endl
00062      << "thresh " << pcp.thresh_ << vcl_endl
00063      << "proj half width " << pcp.proj_width_ << vcl_endl
00064      << "proj half height " << pcp.proj_height_ << vcl_endl
00065      << "non maximum suppression radius " << pcp.sup_radius_ << vcl_endl
00066      << "verbose " << pcp.verbose_ << vcl_endl
00067      << "---]" << vcl_endl;
00068 }