Commit cb207705 authored by Bellaktris's avatar Bellaktris

deleted redundunt code

parent 9eefb191
#include "test_precomp.hpp"
#define NO_COMPARISON
namespace cvtest
{
TEST(xphoto_dctimagedenoising, regression)
......@@ -29,44 +27,14 @@ namespace cvtest
cv::Mat currentResult, fastNlMeansResult;
#ifndef NO_COMPARISON
double currentTime = clock() / double(CLOCKS_PER_SEC);
#endif
cv::dctDenoising(src, currentResult, sigma[i], psize[i]);
#ifndef NO_COMPARISON
currentTime = clock() / double(CLOCKS_PER_SEC) - currentTime;
std::cout << "---- dct denoising time = " << currentTime << " (sec) ----" << std::endl;
#endif
cv::Mat sqrError1 = ( currentResult - previousResult )
cv::Mat sqrError = ( currentResult - previousResult )
.mul( currentResult - previousResult );
cv::Scalar mse1 = cv::sum(sqrError1) / cv::Scalar::all( sqrError1.total()*sqrError1.channels() );
double psnr1 = 10*log10(3*255*255/(mse1[0] + mse1[1] + mse1[2])) - psnr;
#ifndef NO_COMPARISON
std::cout << "---- dct PSNR rate = " << psnr1 << " ----" << std::endl;
#endif
#ifndef NO_COMPARISON
double fastNlMeansTime = clock() / double(CLOCKS_PER_SEC);
if ( src.channels() == 3 )
cv::fastNlMeansDenoisingColored(src, fastNlMeansResult);
else if ( src.channels() == 1 )
cv::fastNlMeansDenoising(src, fastNlMeansResult);
fastNlMeansTime = clock() / double(CLOCKS_PER_SEC) - fastNlMeansTime;
#ifdef NO_COMPARISON
std::cout << "---- nonlocal means denoising time = " << fastNlMeansTime << " (sec) ----" << std::endl;
#endif
cv::Mat sqrError2 = ( fastNlMeansResult - previousResult )
.mul( fastNlMeansResult - previousResult );
cv::Scalar mse2 = cv::sum(sqrError2) / cv::Scalar::all( sqrError2.total()*sqrError2.channels() );
double psnr2 = 10*log10(3*255*255/(mse2[0] + mse2[1] + mse2[2])) - psnr;
std::cout << "---- nonlocal means PSNR rate = " << psnr2 << " ----" << std::endl;
#endif
cv::Scalar mse = cv::sum(sqrError) / cv::Scalar::all( sqrError.total()*sqrError.channels() );
double psnr = 10*log10(3*255*255/(mse[0] + mse[1] + mse[2])) - psnr;
EXPECT_GE( psnr1, psnrThreshold[i] );
EXPECT_GE( psnr, psnrThreshold[i] );
}
}
}
\ No newline at end of file
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