mirror of
https://github.com/opencv/opencv.git
synced 2024-11-28 21:20:18 +08:00
Merge pull request #1400 from ilya-lavrenov:ocl_test_mog
This commit is contained in:
commit
70711ac6c2
@ -142,7 +142,7 @@ PARAM_TEST_CASE(mog2, UseGray, DetectShadow, bool)
|
|||||||
|
|
||||||
TEST_P(mog2, Update)
|
TEST_P(mog2, Update)
|
||||||
{
|
{
|
||||||
std::string inputFile = string(cvtest::TS::ptr()->get_data_path()) + "gpu/768x576.avi";
|
std::string inputFile = string(cvtest::TS::ptr()->get_data_path()) + "gpu/video/768x576.avi";
|
||||||
cv::VideoCapture cap(inputFile);
|
cv::VideoCapture cap(inputFile);
|
||||||
ASSERT_TRUE(cap.isOpened());
|
ASSERT_TRUE(cap.isOpened());
|
||||||
|
|
||||||
@ -175,14 +175,9 @@ TEST_P(mog2, Update)
|
|||||||
mog2_gold(frame, foreground_gold);
|
mog2_gold(frame, foreground_gold);
|
||||||
|
|
||||||
if (detectShadow)
|
if (detectShadow)
|
||||||
{
|
EXPECT_MAT_SIMILAR(foreground_gold, foreground, 15e-3)
|
||||||
|
|
||||||
EXPECT_MAT_SIMILAR(foreground_gold, foreground, 1e-2);
|
|
||||||
}
|
|
||||||
else
|
else
|
||||||
{
|
EXPECT_MAT_NEAR(foreground_gold, foreground, 0)
|
||||||
EXPECT_MAT_NEAR(foreground_gold, foreground, 0);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -191,7 +186,7 @@ TEST_P(mog2, getBackgroundImage)
|
|||||||
if (useGray)
|
if (useGray)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
std::string inputFile = string(cvtest::TS::ptr()->get_data_path()) + "video/768x576.avi";
|
std::string inputFile = string(cvtest::TS::ptr()->get_data_path()) + "gpu/video/768x576.avi";
|
||||||
cv::VideoCapture cap(inputFile);
|
cv::VideoCapture cap(inputFile);
|
||||||
ASSERT_TRUE(cap.isOpened());
|
ASSERT_TRUE(cap.isOpened());
|
||||||
|
|
||||||
@ -229,4 +224,4 @@ INSTANTIATE_TEST_CASE_P(OCL_Video, mog2, testing::Combine(
|
|||||||
testing::Values(DetectShadow(true), DetectShadow(false)),
|
testing::Values(DetectShadow(true), DetectShadow(false)),
|
||||||
Values(true, false)));
|
Values(true, false)));
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -146,10 +146,10 @@ PARAM_TEST_CASE(TVL1, bool)
|
|||||||
|
|
||||||
TEST_P(TVL1, Accuracy)
|
TEST_P(TVL1, Accuracy)
|
||||||
{
|
{
|
||||||
cv::Mat frame0 = readImage("F:/mcw/opencv/opencv/samples/gpu/rubberwhale1.png", cv::IMREAD_GRAYSCALE);
|
cv::Mat frame0 = readImage("gpu/opticalflow/rubberwhale1.png", cv::IMREAD_GRAYSCALE);
|
||||||
ASSERT_FALSE(frame0.empty());
|
ASSERT_FALSE(frame0.empty());
|
||||||
|
|
||||||
cv::Mat frame1 = readImage("../../../opencv/samples/gpu/rubberwhale2.png", cv::IMREAD_GRAYSCALE);
|
cv::Mat frame1 = readImage("gpu/opticalflow/rubberwhale2.png", cv::IMREAD_GRAYSCALE);
|
||||||
ASSERT_FALSE(frame1.empty());
|
ASSERT_FALSE(frame1.empty());
|
||||||
|
|
||||||
cv::ocl::OpticalFlowDual_TVL1_OCL d_alg;
|
cv::ocl::OpticalFlowDual_TVL1_OCL d_alg;
|
||||||
|
Loading…
Reference in New Issue
Block a user