From b8283edfca5bb496e86cda8d19629e6945df043f Mon Sep 17 00:00:00 2001 From: Roman Donchenko Date: Wed, 20 Nov 2013 14:57:21 +0400 Subject: [PATCH] Fix the Qt sample, broken after #1722. --- samples/cpp/Qt_sample/main.cpp | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/samples/cpp/Qt_sample/main.cpp b/samples/cpp/Qt_sample/main.cpp index 8794539408..6969544a0c 100644 --- a/samples/cpp/Qt_sample/main.cpp +++ b/samples/cpp/Qt_sample/main.cpp @@ -4,7 +4,12 @@ #include #include + +#include +#include #include +#include +#include #if defined WIN32 || defined _WIN32 || defined WINCE #include @@ -20,8 +25,6 @@ #include #endif -#include - using namespace std; using namespace cv; @@ -193,7 +196,7 @@ static void foundCorners(vector *srcImagePoints, const Mat& source ss.str(""); //new coordinate system in the middle of the frame and reversed (camera coordinate system) - srcImagePoints->at(i) = cvPoint2D32f(srcImagePoints_temp.at(i).x-source->width/2,source->height/2-srcImagePoints_temp.at(i).y); + srcImagePoints->at(i) = cvPoint2D32f(srcImagePoints_temp.at(i).x-source.cols/2,source.rows/2-srcImagePoints_temp.at(i).y); } } @@ -261,8 +264,8 @@ int main(void) imshow("POSIT",source); - if (VideoCapture::get(video,CV_CAP_PROP_POS_AVI_RATIO)>0.99) - VideoCapture::get(video,CV_CAP_PROP_POS_AVI_RATIO,0); + if (video.get(CV_CAP_PROP_POS_AVI_RATIO) > 0.99) + video.set(CV_CAP_PROP_POS_AVI_RATIO, 0); } destroyAllWindows();