Ask Your Question

Revision history [back]

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