fixed bug in gpu::PyrLKOpticalFlow::dense
authorVladislav Vinogradov <vlad.vinogradov@itseez.com>
Wed, 7 Nov 2012 13:13:19 +0000 (17:13 +0400)
committerVladislav Vinogradov <vlad.vinogradov@itseez.com>
Wed, 7 Nov 2012 13:13:19 +0000 (17:13 +0400)
vector index out of range

modules/gpu/src/pyrlk.cpp

index fc585f4..9b6ab08 100644 (file)
@@ -200,6 +200,9 @@ void cv::gpu::PyrLKOpticalFlow::dense(const GpuMat& prevImg, const GpuMat& nextI
         pyrDown(nextPyr_[level - 1], nextPyr_[level]);
     }
 
+    uPyr_.resize(2);
+    vPyr_.resize(2);
+
     ensureSizeIsEnough(prevImg.size(), CV_32FC1, uPyr_[0]);
     ensureSizeIsEnough(prevImg.size(), CV_32FC1, vPyr_[0]);
     ensureSizeIsEnough(prevImg.size(), CV_32FC1, uPyr_[1]);