contrib/brl/bseg/sdet/sdet_texture_classifier_params.h
Go to the documentation of this file.
00001 // This is brl/bseg/sdet/sdet_texture_classifier_params.h
00002 #ifndef sdet_texture_classifier_params_h_
00003 #define sdet_texture_classifier_params_h_
00004 //:
00005 // \file
00006 // \brief parameter mixin for sdet_texture_classifier
00007 //
00008 // \author
00009 //    Joseph L. Mundy - December 10, 2011
00010 //    Brown University
00011 //
00012 //-----------------------------------------------------------------------------
00013 #include <gevd/gevd_param_mixin.h>
00014 #include <vcl_iosfwd.h>
00015 #include <vcl_vector.h>
00016 #include <vsl/vsl_binary_io.h>
00017 
00018 class sdet_texture_classifier_params : public gevd_param_mixin
00019 {
00020  public:
00021   sdet_texture_classifier_params();
00022   sdet_texture_classifier_params(unsigned n_scales,
00023                                  float scale_interval,
00024                                  float angle_interval,
00025                                  float lambda0,
00026                                  float lambda1,
00027                                  float laplace_radius,
00028                                  float gauss_radius,
00029                                  float cutoff_per,
00030                                  bool signed_response,
00031                                  bool mag,
00032                                  bool fast,
00033                                  unsigned k,
00034                                  unsigned n_samples,
00035                                  unsigned block_size,
00036                                  float weight_offset);
00037   sdet_texture_classifier_params(const sdet_texture_classifier_params& old_params);
00038  ~sdet_texture_classifier_params() {}
00039 
00040   bool SanityCheck();
00041  friend
00042   vcl_ostream& operator<<(vcl_ostream& os, const sdet_texture_classifier_params& imp);
00043  protected:
00044   void InitParams(unsigned n_scales,
00045                   float scale_interval,
00046                   float angle_interval,
00047                   float lambda0,
00048                   float lambda1,
00049                   float laplace_radius,
00050                   float gauss_radius,
00051                   float cutoff_per,
00052                   bool signed_response,
00053                   bool mag,
00054                   bool fast,
00055                   unsigned k,
00056                   unsigned n_samples,
00057                   unsigned block_size,
00058                   float weight_offset);
00059  public:
00060   // === Parameter blocks and parameters ===
00061 
00062   //: the number of scales used for the anisotropic filters
00063   unsigned n_scales_;
00064   //: the scale range for the anisotropic filters
00065   float scale_interval_;
00066   //: the angle interval for anisotropic filters
00067   float angle_interval_;
00068   //: the major radius of the anisotropic Gaussian filter
00069   float lambda0_;
00070   //: the minor radius of the anisotropic Gaussian filter
00071   float lambda1_;
00072   //: the radius of the isotropic Laplace filter
00073   float laplace_radius_;
00074   //: the radius of the isotropic Gaussian intensity spot filter
00075   float gauss_radius_;
00076   //: the residual value of the Gaussian tail considered negligible
00077   float cutoff_per_;
00078   //: should the filter response be signed vs. absolute value
00079   bool signed_response_;
00080   //: should the filter response be absolute value vs. signed or clipped
00081   bool mag_;
00082   //: should the fast algorithm be used to compute the filters
00083   bool fast_;
00084   //: the value of k for the k-means algorithm
00085   unsigned k_;
00086   //: the number of samples to be randomly selected from the training images
00087   unsigned n_samples_;
00088   //: the square block size for test images
00089   unsigned block_size_;
00090   //: a factor that controls the weighting of textons that appear in more than one class
00091   float weight_offset_;
00092 };
00093 
00094 //: Binary save vgl_point_2d to stream.
00095 void vsl_b_write(vsl_b_ostream &os,
00096                  const sdet_texture_classifier_params & tcp);
00097 
00098 //: Binary load vgl_point_2d from stream.
00099 void vsl_b_read(vsl_b_istream &is, sdet_texture_classifier_params & tcp);
00100 
00101 //: Print human readable summary of object to a stream
00102 void vsl_print_summary(vcl_ostream& os,
00103                        const sdet_texture_classifier_params & tcp);
00104 
00105 #endif // sdet_texture_classifier_params_h_