1 // This is gel/vifa/vifa_coll_lines_params.h
2 #ifndef VIFA_COLL_LINES_PARAMS_H
3 #define VIFA_COLL_LINES_PARAMS_H
4 
5 //-----------------------------------------------------------------------------
6 //:
7 // \file
8 // \brief Parameter mixin for collinearity tests.
9 //
10 // \author Roddy Collins, from DDB in TargetJr
11 //
12 // \date May 2001
13 //
14 // \verbatim
15 //  Modifications:
16 //   MPP Mar 2003, Ported to VXL
17 // \endverbatim
18 //-----------------------------------------------------------------------------
19 
20 #include <vbl/vbl_ref_count.h>
21 #include <vbl/vbl_smart_ptr.h>
22 #include <vul/vul_timestamp.h>
23 #include <gevd/gevd_param_mixin.h>
24 
25 
26 //: Container holding parameters for collinearizing lines
27 class vifa_coll_lines_params : public gevd_param_mixin,
28                                public vul_timestamp,
29                                public vbl_ref_count
30 {
31   float midpt_distance_;
32   float angle_tolerance_;
33   float discard_threshold_;
34   float endpt_distance_;
35 
36  public:
37   //: Distance of midpoint of qualified edge segment to projected line.
midpt_distance()38   float midpt_distance() const { return midpt_distance_; }
39 
40   //: Maximum angular difference (in degrees).
angle_tolerance()41   float angle_tolerance() const { return angle_tolerance_; }
42 
43   //: Minimum of supported to spanning length.
discard_threshold()44   float discard_threshold() const { return discard_threshold_; }
45 
46   //: Endpoints within this distance are accepted no matter what the angular difference is.
endpt_distance()47   float endpt_distance() const { return endpt_distance_; }
48 
49   //: Default constructor
50   vifa_coll_lines_params(float midpt_distance = 1.0f,
51                          float angle_tolerance = 5.0f,
52                          float discard_threshold = 0.3f,
53                          float endpt_distance = 3.0f
54                         );
55 
56   //: Copy constructor
57   vifa_coll_lines_params(const vifa_coll_lines_params& old_params);
58 
59   //: Output contents
60   void print_info() const;
61 };
62 
63 
64 typedef vbl_smart_ptr<vifa_coll_lines_params>  vifa_coll_lines_params_sptr;
65 
66 
67 #endif  // VIFA_COLL_LINES_PARAMS_H
68