contrib/gel/mrc/vpgl/algo/vpgl_vsol_lens_warp.h
Go to the documentation of this file.
00001 // This is gel/mrc/vpgl/algo/vpgl_vsol_lens_warp.h
00002 #ifndef vpgl_vsol_lens_warp_h_
00003 #define vpgl_vsol_lens_warp_h_
00004 //:
00005 // \file
00006 // \brief Apply lens distortion to vsol objects
00007 // \author Matt Leotta
00008 // \date August 24, 2005
00009 //
00010 
00011 #include <vpgl/vpgl_lens_distortion.h>
00012 #include <vpgl/algo/vpgl_lens_warp_mapper.h>
00013 #include <vsol/vsol_spatial_object_2d_sptr.h>
00014 #include <vsol/vsol_point_2d_sptr.h>
00015 #include <vsol/vsol_line_2d_sptr.h>
00016 #include <vsol/vsol_curve_2d_sptr.h>
00017 #include <vsol/vsol_polyline_2d_sptr.h>
00018 #include <vsol/vsol_digital_curve_2d_sptr.h>
00019 #include <vsol/vsol_polygon_2d_sptr.h>
00020 
00021 
00022 //: Apply lens distortion to this vsol_spatial_object_2d and produce a new spatial object
00023 // \param undistort applies the inverse of the distortion
00024 // \param midpt_thresh is the threshold in the error of midpoints of line segments
00025 // \note if \p midpt_thresh is negative it is ignored
00026 vsol_spatial_object_2d_sptr
00027 vpgl_vsol_lens_warp(const vsol_spatial_object_2d_sptr& obj,
00028                     const vpgl_lens_distortion<double>& lens,
00029                     bool invert = false,
00030                     double midpt_thresh = -1.0);
00031 
00032 //: Apply lens distortion to this vsol_point_2d and produce a new point
00033 vsol_point_2d_sptr
00034 vpgl_vsol_lens_warp(const vsol_point_2d_sptr& pt,
00035                     const vpgl_lens_distortion<double>& lens,
00036                     bool invert = false,
00037                     double midpt_thresh = -1.0);
00038 
00039 
00040 //: Apply lens distortion to this vsol_line_2d and produce a new curve (polyline)
00041 vsol_curve_2d_sptr
00042 vpgl_vsol_lens_warp(const vsol_line_2d_sptr& ln,
00043                     const vpgl_lens_distortion<double>& lens,
00044                     bool invert = false,
00045                     double midpt_thresh = -1.0);
00046 
00047 
00048 //: Apply lens distortion to this vsol_polyline_2d and produce a new polyline
00049 vsol_polyline_2d_sptr
00050 vpgl_vsol_lens_warp(const vsol_polyline_2d_sptr& pln,
00051                     const vpgl_lens_distortion<double>& lens,
00052                     bool invert = false,
00053                     double midpt_thresh = -1.0);
00054 
00055 
00056 //: Apply lens distortion to this vsol_digital_curve_2d and produce a new digital curve
00057 vsol_digital_curve_2d_sptr
00058 vpgl_vsol_lens_warp(const vsol_digital_curve_2d_sptr& dc,
00059                     const vpgl_lens_distortion<double>& lens,
00060                     bool invert = false,
00061                     double midpt_thresh = -1.0);
00062 
00063 
00064 //: Apply lens distortion to this vsol_polygon_2d and produce a new polygon
00065 vsol_polygon_2d_sptr
00066 vpgl_vsol_lens_warp(const vsol_polygon_2d_sptr& pg,
00067                     const vpgl_lens_distortion<double>& lens,
00068                     bool invert = false,
00069                     double midpt_thresh = -1.0);
00070 
00071 //===============================================================
00072 
00073 //: Apply lens distortion to this vsol_spatial_object_2d in place
00074 // \return true if successful
00075 bool
00076 vpgl_vsol_lens_warp(vsol_spatial_object_2d_sptr& obj,
00077                     const vpgl_lens_distortion<double>& lens,
00078                     bool invert = false);
00079 
00080 
00081 //: Apply lens distortion to this vsol_point_2d in place
00082 // \return true if successful
00083 bool
00084 vpgl_vsol_lens_warp(vsol_point_2d_sptr& pt,
00085                     const vpgl_lens_distortion<double>& lens,
00086                     bool invert = false);
00087 
00088 
00089 //: Apply lens distortion to this vsol_line_2d in place
00090 // \return true if successful
00091 // \note only the end points are warped
00092 bool
00093 vpgl_vsol_lens_warp(vsol_line_2d_sptr& ln,
00094                     const vpgl_lens_distortion<double>& lens,
00095                     bool invert = false);
00096 
00097 
00098 //: Apply lens distortion to this vsol_polyline_2d in place
00099 // \return true if successful
00100 // \note only the segment end points are warped
00101 bool
00102 vpgl_vsol_lens_warp(vsol_polyline_2d_sptr& pln,
00103                     const vpgl_lens_distortion<double>& lens,
00104                     bool invert = false);
00105 
00106 
00107 //: Apply lens distortion to this vsol_digital_curve_2d in place
00108 // \return true if successful
00109 // \note only the sample points are warped
00110 bool
00111 vpgl_vsol_lens_warp(vsol_digital_curve_2d_sptr& dc,
00112                     const vpgl_lens_distortion<double>& lens,
00113                     bool invert = false);
00114 
00115 
00116 //: Apply lens distortion to this vsol_polygon_2d in place
00117 // \return true if successful
00118 // \note only the segment end points are warped
00119 bool
00120 vpgl_vsol_lens_warp(vsol_polygon_2d_sptr& pg,
00121                     const vpgl_lens_distortion<double>& lens,
00122                     bool invert = false);
00123 
00124 #endif // vpgl_vsol_lens_warp_h_