Possible Duplicate:
Executing cv::warpPerspective for a fake deskewing on a set of cv::Point
I am using OpenCV. I would like to transform an image, which have a parallelogram, to rectangle image. Please tell me how to do ?
Thanks.
Possible Duplicate:
Executing cv::warpPerspective for a fake deskewing on a set of cv::Point
I am using OpenCV. I would like to transform an image, which have a parallelogram, to rectangle image. Please tell me how to do ?
Thanks.
Take a look in the documentation of OpenCV regarding affine transformations. There are examples on there:
http://opencv.willowgarage.com/documentation/cpp/geometric_image_transformations.html
You want to shear the image (or part of it)
For this you could use an affine transform with the warpAffine function
void warpAffine(const Mat& src, Mat& dst, const Mat& M, Size dsize,
int flags=INTER_LINEAR, int borderMode=BORDER_CONSTANT,
const Scalar& borderValue=Scalar())
and read this Q&A: Performing shear with altered origin in OpenCV