contrib/mul/mfpf/mfpf_draw_pose_lines.cxx
Go to the documentation of this file.
00001 #include "mfpf_draw_pose_lines.h"
00002 //:
00003 // \file
00004 // \brief Function to draw a feature point on an image
00005 // \author Tim Cootes
00006 
00007 #include <mbl/mbl_draw_line.h>
00008 #include <vgl/vgl_point_2d.h>
00009 
00010 //: Draw an open polygon by jointing pose(ref_pts[i]) to pose(ref_pts[i+1])
00011 void mfpf_draw_pose_lines(vimt_image_2d_of<vxl_byte>& image,
00012                           const mfpf_pose& pose,
00013                           const vcl_vector<vgl_point_2d<double> >& ref_pts,
00014                           vxl_byte value,
00015                           unsigned width)
00016 {
00017   const vimt_transform_2d& w2im = image.world2im();
00018   vgl_point_2d<double> p = w2im(pose(ref_pts[0]));
00019   for (unsigned i=1;i<ref_pts.size();++i)
00020   {
00021     vgl_point_2d<double> q = w2im(pose(ref_pts[i]));
00022     mbl_draw_line(image.image(),p,q,value,width);
00023     p=q;
00024   }
00025 }
00026 
00027 //: Draw an open polygon by jointing pose(ref_pts[i]) to pose(ref_pts[i+1])
00028 void mfpf_draw_pose_lines(vimt_image_2d_of<vxl_byte>& image,
00029                           const mfpf_pose& pose,
00030                           const vcl_vector<vgl_point_2d<double> >& ref_pts,
00031                           vxl_byte r, vxl_byte g, vxl_byte b,
00032                           unsigned width)
00033 {
00034   const vimt_transform_2d& w2im = image.world2im();
00035   vgl_point_2d<double> p = w2im(pose(ref_pts[0]));
00036   for (unsigned i=1;i<ref_pts.size();++i)
00037   {
00038     vgl_point_2d<double> q = w2im(pose(ref_pts[i]));
00039     mbl_draw_line(image.image(),p,q,r,width);
00040     mbl_draw_line(image.image(),p,q,g,width);
00041     mbl_draw_line(image.image(),p,q,b,width);
00042     p=q;
00043   }
00044 }
00045