contrib/gel/gevd/gevd_detector_params.h
Go to the documentation of this file.
00001 #ifndef gevd_detector_params_h_
00002 #define gevd_detector_params_h_
00003 //:
00004 // \file
00005 // \brief non-display-based interface class
00006 //
00007 // The parameter mixin for VanDuc's edge detector.
00008 //
00009 // - float smooth : The standard deviation of the Gaussian smoothing kernel.
00010 //
00011 // - float noise_weight: A weighting factor that determines the relative
00012 //                     proportion of sensor noise level and texture noise level
00013 //                     as measured in a ROI in the center of the image. The
00014 //                     nominal value of 0.5 gives equal weight to both.
00015 //
00016 // - float noise_multiplier: Overall scale factor for noise
00017 //
00018 // - bool automatic_threshold: If true then the noise level is determined from
00019 //                            image measurements.
00020 //
00021 // - float filterFactor:  An overall scale factor for determining
00022 //                       gradient threshold Nominally 2.0.
00023 //
00024 // - float contourFactor, junctionFactor: Scale factors for determining the
00025 //                                       gradient threshold. Nominally 1.0.
00026 //                                       contourFactor is in effect for edgels
00027 //                                       on contours (boundaries).
00028 //                                       junctionFactor is in effect during the
00029 //                                       extension of contours at endpoints.
00030 //                                       To extend contours aggressively, use a
00031 //                                       low value of junctionFactor, i.e., .5.
00032 //
00033 // - bool  junctionp:  If true, then recover junctions by extending contours.
00034 //                    Nominally true.
00035 //
00036 // - Contour Following:
00037 // - float hysteresisFactor:     A scale factor which is multiplied by the
00038 //                              image noise level to determine the minimum
00039 //                              gradient threshold in following an edgel contour.
00040 //                              Nominally 2.0.
00041 //
00042 // - int minLength:              The minimum length contour to constructed.
00043 //
00044 // - float minJump:              A scale factor which is multiplied by the
00045 //                              image noise level to determine the gradient
00046 //                              threshold at a junction. Nominally 1.0.
00047 //
00048 // - float maxGap:               The width of a gap which can be crossed in
00049 //                              forming a junction with another edgel contour.
00050 //                              Nominally sqrt(5) = 2.24.
00051 //
00052 // - bool spacingp:              If true, then equalize the sub-pixel locations
00053 //                              of each edgel by averaging the adjacent left
00054 //                              a right neighbor locations. Nominally true.
00055 //
00056 // - bool borderp:               If true, insert virtual contours at the border
00057 //                              to close regions. Nominally false.
00058 //
00059 //
00060 // \author Joseph L. Mundy - GE Corporate Research and Development
00061 // \date   November 1997
00062 //-----------------------------------------------------------------------------
00063 
00064 #include "gevd_param_mixin.h"
00065 
00066 class gevd_detector_params : public gevd_param_mixin
00067 {
00068  public:
00069 
00070   gevd_detector_params(float smooth_sigma = 1.0f, float noise_w = -0.5f,
00071                        float noise_m = 2.0f, bool automatic_t = false,
00072                        int aggressive_jc = 1, int minl = 4,
00073                        float maxgp = 4.0f, float minjmp = 0.1f,
00074                        float contour_f = 2.0f, float junction_f = 1.0f,
00075                        bool recover_j = true, bool equal_spacing=true,
00076                        bool follow_b = true,
00077                        bool peaks_only=false,
00078                        bool valleys_only=false,
00079                        float ang = 10.0f, float sep = 1.0f, int min_corner_len = 5,
00080                        int cyc = 2, int ndim = 2);
00081 
00082   gevd_detector_params(const gevd_detector_params& old_params);
00083   ~gevd_detector_params() {}
00084 
00085   bool SanityCheck();
00086 #if 0//not implemented in vxl
00087   void Describe(ParamModifier& mod);
00088 #endif
00089   void set_noise_weight(float noise_weight);
00090   void set_noise_multiplier(float noise_multiplier);
00091   void set_automatic_threshold(bool automatic_threshold);
00092   void set_aggressive_junction_closure(int aggressive_junction_closure);
00093   void set_close_borders(bool close_borders);
00094 
00095  protected:
00096   void InitParams(float smooth_sigma, float noise_w,
00097                   float noise_m, bool automatic_t,
00098                   int aggressive_jc, int minl,
00099                   float maxgp, float minjmp,
00100                   float contour_f, float junction_f,
00101                   bool recover_j, bool equal_spacing,
00102                   bool follow_b,
00103                   bool peaks_only,
00104                   bool valleys_only,
00105                   float ang, float sep, int min_corner_len,
00106                   int cyc, int ndim);
00107 
00108  public:
00109   //
00110   // Parameters for detecting edgel chains
00111   //
00112   float smooth; // !< Smoothing kernel sigma
00113   float noise_weight; //!< The weight between sensor noise and texture noise
00114   float noise_multiplier; // !< The overal noise threshold scale factor
00115   bool   automatic_threshold; // !< Determine the threshold values from image
00116   int aggressive_junction_closure; //!< Close junctions aggressively
00117   int minLength;                // !< minimum chain length
00118   float contourFactor;  //!< Threshold along contours
00119   float junctionFactor; //!< Threshold at junctions
00120   float filterFactor;   // !< ratio of sensor to texture noise
00121   bool junctionp; // !< recover missing junctions
00122   float minJump;  // !< change in strength at junction
00123   float maxGap;   // !< Bridge small gaps up to max_gap across.
00124   bool spacingp;  // !< equalize spacing?
00125   bool borderp;   // !< insert virtual border for closure?
00126   //
00127   // Fold detection parameters
00128   //
00129   bool peaks_only; //!< Only return peaks, d^2I/dn^2 < 0, n is normal dir to ridge
00130   bool valleys_only; //!< Only return valeys, d^2I/dn^2 > 0
00131   //
00132   // Parameters for corner detection on edgel chains
00133   //
00134   float corner_angle; // !< smallest angle at corner
00135   float separation; // !< |mean1-mean2|/sigma
00136   int min_corner_length; // !< min length to find corners
00137   int cycle; // !< number of corners in a cycle
00138   int ndimension; // !< spatial dimension of edgel chains.
00139 };
00140 
00141 #endif // gevd_detector_params_h_