00001
00002 #ifndef strk_art_info_model_h_
00003 #define strk_art_info_model_h_
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032 #include<vcl_vector.h>
00033 #include<vbl/vbl_ref_count.h>
00034 #include<vsol/vsol_point_2d_sptr.h>
00035 #include<vtol/vtol_face_2d_sptr.h>
00036 #include<vil1/vil1_memory_image_of.h>
00037 #include<strk/strk_tracking_face_2d_sptr.h>
00038 #include<strk/strk_art_info_model_sptr.h>
00039
00040 class strk_art_info_model : public vbl_ref_count
00041 {
00042 public:
00043 enum model_part_id{STEM=0, LONG_TIP, SHORT_TIP};
00044
00045 strk_art_info_model(vcl_vector<vtol_face_2d_sptr> const& faces,
00046 vsol_point_2d_sptr const stem_pivot,
00047 vil1_memory_image_of<float> & image);
00048
00049 strk_art_info_model(vcl_vector<vtol_face_2d_sptr> const& face,
00050 vsol_point_2d_sptr const stem_pivot,
00051 vil1_memory_image_of<float>& image,
00052 vil1_memory_image_of<float>& Ix,
00053 vil1_memory_image_of<float>& Iy);
00054
00055 strk_art_info_model(strk_art_info_model_sptr const& im);
00056
00057 strk_art_info_model(strk_art_info_model const& im);
00058
00059 ~strk_art_info_model();
00060
00061
00062 unsigned int n_faces() const { return faces_.size(); }
00063 strk_tracking_face_2d_sptr face(int i) const;
00064 strk_tracking_face_2d_sptr stem() const;
00065 strk_tracking_face_2d_sptr left_tip() const;
00066 strk_tracking_face_2d_sptr right_tip() const;
00067 vsol_point_2d_sptr stem_pivot() const;
00068 vcl_vector<vtol_face_2d_sptr> vtol_faces() const;
00069
00070 double total_model_info() const { return total_model_info_; }
00071
00072 bool transform(const double stem_tx, const double stem_ty,
00073 const double stem_angle,
00074 const double long_arm_pivot_angle,
00075 const double short_arm_pivot_angle,
00076 const double long_tip_angle,
00077 const double short_tip_angle);
00078
00079 bool compute_mutual_information(vil1_memory_image_of<float> const& image);
00080
00081 bool compute_mutual_information(vil1_memory_image_of<float> const& image,
00082 vil1_memory_image_of<float> const& Ix,
00083 vil1_memory_image_of<float> const& Iy);
00084 private:
00085
00086 strk_art_info_model();
00087 double arm_radius(strk_tracking_face_2d_sptr const& face);
00088 bool pivot_tip_face(strk_tracking_face_2d_sptr const& face,
00089 const double angle, const double radius);
00090
00091
00092 double total_model_info_;
00093 double long_arm_radius_;
00094 double short_arm_radius_;
00095 vsol_point_2d_sptr stem_pivot_;
00096 vcl_vector<strk_tracking_face_2d_sptr> faces_;
00097 };
00098
00099 #endif // strk_art_info_model_h_