1
0
mirror of https://github.com/opencv/opencv.git synced 2026-07-30 15:53:03 +04:00

ocl: tests: RNG usage refactoring

This commit is contained in:
Alexander Alekhin
2013-10-02 20:18:48 +04:00
parent 8224f9843e
commit de0f310e81
19 changed files with 316 additions and 486 deletions
+6 -8
View File
@@ -85,9 +85,7 @@ PARAM_TEST_CASE(mog, UseGray, LearningRate, bool)
virtual void SetUp()
{
useGray = GET_PARAM(0);
learningRate = GET_PARAM(1);
useRoi = GET_PARAM(2);
}
};
@@ -103,7 +101,7 @@ TEST_P(mog, Update)
ASSERT_FALSE(frame.empty());
cv::ocl::MOG mog;
cv::ocl::oclMat foreground = createMat_ocl(frame.size(), CV_8UC1, useRoi);
cv::ocl::oclMat foreground = createMat_ocl(rng, frame.size(), CV_8UC1, useRoi);
cv::BackgroundSubtractorMOG mog_gold;
cv::Mat foreground_gold;
@@ -120,7 +118,7 @@ TEST_P(mog, Update)
cv::swap(temp, frame);
}
mog(loadMat_ocl(frame, useRoi), foreground, (float)learningRate);
mog(loadMat_ocl(rng, frame, useRoi), foreground, (float)learningRate);
mog_gold(frame, foreground_gold, learningRate);
@@ -165,7 +163,7 @@ TEST_P(mog2, Update)
cv::ocl::MOG2 mog2;
mog2.bShadowDetection = detectShadow;
cv::ocl::oclMat foreground = createMat_ocl(frame.size(), CV_8UC1, useRoi);
cv::ocl::oclMat foreground = createMat_ocl(rng, frame.size(), CV_8UC1, useRoi);
cv::BackgroundSubtractorMOG2 mog2_gold;
mog2_gold.set("detectShadows", detectShadow);
@@ -183,7 +181,7 @@ TEST_P(mog2, Update)
cv::swap(temp, frame);
}
mog2(loadMat_ocl(frame, useRoi), foreground);
mog2(loadMat_ocl(rng, frame, useRoi), foreground);
mog2_gold(frame, foreground_gold);
@@ -218,12 +216,12 @@ TEST_P(mog2, getBackgroundImage)
cap >> frame;
ASSERT_FALSE(frame.empty());
mog2(loadMat_ocl(frame, useRoi), foreground);
mog2(loadMat_ocl(rng, frame, useRoi), foreground);
mog2_gold(frame, foreground_gold);
}
cv::ocl::oclMat background = createMat_ocl(frame.size(), frame.type(), useRoi);
cv::ocl::oclMat background = createMat_ocl(rng, frame.size(), frame.type(), useRoi);
mog2.getBackgroundImage(background);
cv::Mat background_gold;