template <typename In, typename Q>
class Homography
Homography is a transformation that describes the motion between two images, when the camera or the observed object moves.
Homography<In>()
Constructor. Template class In refers to the type of the input Point (int, double) .
void QuadToQuad(const Point_<In>& from0, const Point_<In>& from1, const Point_<In>& from2, const Point_<In>& from3, const Point_<In>& to0, const Point_<In>& to1, const Point_<In>& to2, const Point_<In>& to3)
Constructs an homography from points from0, from1, from2, from3 to points to0, to1, to2, to3.
void QuadToRectangle(const Point_<In>& from0, const Point_<In>& from1, const Point_<In>& from2, const Point_<In>& from3, const Size_<In>& sz)
Constructs an homography from points from0, from1, from2, from3 to rectangle of Size sz .
Point_<Q> Transform(const Point_<In>& from)
Applies the transformation to point from.
Image ApplyHomography(const Image& orig, const Color& back, const Point& from0, const Point& from1, const Point& from2, const Point& from3, const Point& to0, const Point& to1, const Point& to2, const Point& to3, bool bilinear = true, bool fit = true)
Applies an homography to image orig, setting back color for unknown points, from points from0, from1, from2, from3 to points to0, to1, to2, to3.bilinear indicates if using bilinear pixel interpolation, and fit indicates if the image is trimmed in the left and top sides.
Image ApplyHomography(const Image& orig, const Color& back, const Point& from0, const Point& from1, const Point& from2, const Point& from3, const Size& sz, bool bilinear = true)
Applies an homography to image orig, setting back color for unknown points, from points from0, from1, from2, from3 to points to an image of size to. bilinear indicates if using bilinear pixel interpolation. Points have to be set in clockwise direction, from left-top vertex.
|