Go to the documentation of this file.00001
00002 #ifndef ImageMetric_h_
00003 #define ImageMetric_h_
00004 #ifdef VCL_NEEDS_PRAGMA_INTERFACE
00005 #pragma interface
00006 #endif
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
00033
00034 #include <vnl/vnl_fwd.h>
00035 #include <vgl/vgl_fwd.h>
00036 #include <vcl_iosfwd.h>
00037 class HomgPoint2D;
00038 class HomgLineSeg2D;
00039 class HomgLine2D;
00040 class FMatrix;
00041
00042 class ImageMetric
00043 {
00044 public:
00045
00046 ImageMetric() {}
00047 virtual ~ImageMetric() {}
00048
00049
00050
00051 virtual vgl_homg_point_2d<double> homg_to_imagehomg(vgl_homg_point_2d<double> const&) const;
00052 virtual vgl_homg_point_2d<double> imagehomg_to_homg(vgl_homg_point_2d<double> const&) const;
00053
00054 virtual HomgPoint2D homg_to_imagehomg(const HomgPoint2D&) const;
00055 virtual HomgPoint2D imagehomg_to_homg(const HomgPoint2D&) const;
00056
00057
00058
00059 virtual vgl_point_2d<double> homg_to_image(vgl_homg_point_2d<double> const&) const;
00060 virtual vnl_double_2 homg_to_image(const HomgPoint2D&) const;
00061
00062 virtual vgl_homg_point_2d<double> image_to_homg(vgl_point_2d<double> const&) const;
00063 virtual HomgPoint2D image_to_homg(const vnl_double_2&) const;
00064 virtual HomgPoint2D image_to_homg(double x, double y) const;
00065
00066 virtual vgl_homg_line_2d<double> homg_to_image_line(vgl_homg_line_2d<double> const&) const;
00067 virtual vgl_homg_line_2d<double> image_to_homg_line(vgl_homg_line_2d<double> const&) const;
00068
00069 virtual HomgLine2D homg_to_image_line(const HomgLine2D&) const;
00070 virtual HomgLine2D image_to_homg_line(const HomgLine2D&) const;
00071
00072 virtual HomgLineSeg2D image_to_homg_line(const HomgLineSeg2D&) const;
00073 virtual vgl_line_segment_2d<double> image_to_homg_line(vgl_line_segment_2d<double> const& l) const;
00074 virtual HomgLineSeg2D homg_line_to_image(const HomgLineSeg2D&) const;
00075 virtual vgl_line_segment_2d<double> homg_line_to_image(vgl_line_segment_2d<double> const& l) const;
00076
00077 virtual double perp_dist_squared(const HomgPoint2D&, const HomgLine2D&) const;
00078 virtual double perp_dist_squared(vgl_homg_point_2d<double> const&,
00079 vgl_homg_line_2d<double> const&) const;
00080 virtual HomgPoint2D perp_projection(const HomgLine2D & l, const HomgPoint2D & p) const;
00081 virtual vgl_homg_point_2d<double> perp_projection(vgl_homg_line_2d<double> const& l,
00082 vgl_homg_point_2d<double> const& p) const;
00083 virtual double distance_squared(const HomgPoint2D&, const HomgPoint2D&) const;
00084 virtual double distance_squared(const HomgLineSeg2D& segment, const HomgLine2D& line) const;
00085 virtual double distance_squared(const vgl_homg_point_2d<double>&, const vgl_homg_point_2d<double>&) const;
00086 virtual double distance_squared(vgl_line_segment_2d<double> const& segment,
00087 vgl_homg_line_2d<double> const& line) const;
00088
00089 virtual bool is_within_distance(const HomgPoint2D&, const HomgPoint2D&, double distance) const;
00090 virtual bool is_within_distance(vgl_homg_point_2d<double> const&,
00091 vgl_homg_point_2d<double> const&,
00092 double distance) const;
00093
00094
00095 virtual vnl_double_3x3 get_C() const;
00096 virtual vnl_double_3x3 get_C_inverse() const;
00097
00098 virtual bool is_linear() const;
00099 virtual bool can_invert_distance() const;
00100 virtual double image_to_homg_distance(double image_distance) const;
00101 virtual double homg_to_image_distance(double image_distance) const;
00102
00103 virtual vcl_ostream& print(vcl_ostream& s) const;
00104
00105
00106
00107
00108 static FMatrix decondition(const FMatrix& F, const ImageMetric* c1, const ImageMetric* c2);
00109
00110 inline friend vcl_ostream& operator<<(vcl_ostream& o, const ImageMetric& m) { return m.print(o); }
00111 };
00112
00113 #endif // ImageMetric_h_