can I use CV, for video frame Perspective correction?
I am using both opencv and imagemagick to do perspective correction, for Usb video camera, and sort out the problems.
1.image magick only do perspective correction for 3 frames per second, but CV do around 15/sec . its good. 2. but quality wise IM is better than OCV after perspective correction. its bad. I am using the functions as follows lambda = cv::Mat::zeros(input.rows, input.cols, input.type() );
inputQuad[0] = cv::Point2f(25,45);
inputQuad[1] = cv::Point2f(440,45);
inputQuad[2] = cv::Point2f(480,457);
inputQuad[3] = cv::Point2f(0,457);
outputQuad[0] = cv::Point2f(0,0);
outputQuad[1] = cv::Point2f(300,0);
outputQuad[2] = cv::Point2f(300,400);
outputQuad[3] = cv::Point2f(0,400);
lambda = getPerspectiveTransform(inputQuad, outputQuad);
output.rows=640;
output.cols=480;
warpPerspective(input,output,lambda,output.size());
if anything i did wrong guide me do to best.. thanks in advance
You have to use 5 parameters to improve quality of warpPerspective
Can you upload a sample image to test ?
What do you mean by the quality is better with Image Magick ? Do you mean the resulting image is more "rectangular" with Image Magick or is less blurry for example ? What is the name of the command you use with Image Magick ?
Have you tried with findHomography instead of getPerspectiveTransform ?
what is the 5th one? lberger
5th parameter defines how image is interpolated : cv::InterpolationFlags {