Commit 8eb40877 authored by Alexander Shishkov's avatar Alexander Shishkov

updated tests and test data

parent 286d6ffe
#include "test_precomp.hpp" #include "test_precomp.hpp"
CV_TEST_MAIN("ximpgroc") CV_TEST_MAIN("")
...@@ -5,10 +5,11 @@ namespace cvtest ...@@ -5,10 +5,11 @@ namespace cvtest
TEST(ximpgroc_StructuredEdgeDetection, regression) TEST(ximpgroc_StructuredEdgeDetection, regression)
{ {
cv::String dir = cvtest::TS::ptr()->get_data_path(); cv::String subfolder = "cv/ximgproc/";
cv::String dir = cvtest::TS::ptr()->get_data_path() + subfolder;
int nTests = 12; int nTests = 12;
float threshold = 0.01f; float threshold = 0.01f;
cv::String modelName = dir + "model.yml.gz"; cv::String modelName = dir + "model.yml.gz";
cv::Ptr<cv::ximgproc::StructuredEdgeDetection> pDollar = cv::Ptr<cv::ximgproc::StructuredEdgeDetection> pDollar =
cv::ximgproc::createStructuredEdgeDetection(modelName); cv::ximgproc::createStructuredEdgeDetection(modelName);
...@@ -17,6 +18,7 @@ TEST(ximpgroc_StructuredEdgeDetection, regression) ...@@ -17,6 +18,7 @@ TEST(ximpgroc_StructuredEdgeDetection, regression)
{ {
cv::String srcName = dir + cv::format( "sources/%02d.png", i + 1); cv::String srcName = dir + cv::format( "sources/%02d.png", i + 1);
cv::Mat src = cv::imread( srcName, 1 ); cv::Mat src = cv::imread( srcName, 1 );
ASSERT_TRUE(!src.empty());
cv::String previousResultName = dir + cv::format( "results/%02d.png", i + 1 ); cv::String previousResultName = dir + cv::format( "results/%02d.png", i + 1 );
cv::Mat previousResult = cv::imread( previousResultName, 0 ); cv::Mat previousResult = cv::imread( previousResultName, 0 );
......
...@@ -7,7 +7,7 @@ namespace cvtest ...@@ -7,7 +7,7 @@ namespace cvtest
cv::String dir = cvtest::TS::ptr()->get_data_path() + "dct_image_denoising/"; cv::String dir = cvtest::TS::ptr()->get_data_path() + "dct_image_denoising/";
int nTests = 1; int nTests = 1;
double thresholds[] = {0.1}; double thresholds[] = {0.2};
int psize[] = {8}; int psize[] = {8};
double sigma[] = {9.0}; double sigma[] = {9.0};
...@@ -16,11 +16,13 @@ namespace cvtest ...@@ -16,11 +16,13 @@ namespace cvtest
{ {
cv::String srcName = dir + cv::format( "sources/%02d.png", i + 1); cv::String srcName = dir + cv::format( "sources/%02d.png", i + 1);
cv::Mat src = cv::imread( srcName, 1 ); cv::Mat src = cv::imread( srcName, 1 );
ASSERT_TRUE(!src.empty());
cv::String previousResultName = dir + cv::format( "results/%02d.png", i + 1 ); cv::String previousResultName = dir + cv::format( "results/%02d.png", i + 1 );
cv::Mat previousResult = cv::imread( previousResultName, 1 ); cv::Mat previousResult = cv::imread( previousResultName, 1 );
ASSERT_TRUE(!src.empty());
cv::Mat currentResult, fastNlMeansResult; cv::Mat currentResult;
cv::dctDenoising(src, currentResult, sigma[i], psize[i]); cv::dctDenoising(src, currentResult, sigma[i], psize[i]);
......
...@@ -12,6 +12,7 @@ namespace cvtest ...@@ -12,6 +12,7 @@ namespace cvtest
{ {
cv::String srcName = dir + cv::format( "sources/%02d.png", i + 1); cv::String srcName = dir + cv::format( "sources/%02d.png", i + 1);
cv::Mat src = cv::imread( srcName, 1 ); cv::Mat src = cv::imread( srcName, 1 );
ASSERT_TRUE(!src.empty());
cv::String previousResultName = dir + cv::format( "results/%02d.png", i + 1 ); cv::String previousResultName = dir + cv::format( "results/%02d.png", i + 1 );
cv::Mat previousResult = cv::imread( previousResultName, 1 ); cv::Mat previousResult = cv::imread( previousResultName, 1 );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment