Merge remote-tracking branch 'origin/2.4' into merge-2.4
Conflicts: doc/tutorials/definitions/noContent.rst doc/tutorials/gpu/gpu-basics-similarity/gpu-basics-similarity.rst doc/tutorials/introduction/android_binary_package/dev_with_OCV_on_Android.rst doc/tutorials/introduction/how_to_write_a_tutorial/how_to_write_a_tutorial.rst modules/core/include/opencv2/core/core.hpp modules/core/include/opencv2/core/internal.hpp modules/core/include/opencv2/core/version.hpp modules/gpu/CMakeLists.txt modules/highgui/perf/perf_output.cpp modules/highgui/test/test_video_io.cpp modules/ocl/include/opencv2/ocl/ocl.hpp modules/ocl/perf/main.cpp modules/ocl/src/hog.cpp modules/ocl/src/initialization.cpp modules/ocl/src/moments.cpp modules/ocl/src/opencl/moments.cl modules/ocl/test/main.cpp modules/ocl/test/test_moments.cpp modules/python/test/test.py modules/ts/include/opencv2/ts/ts_perf.hpp modules/ts/src/precomp.hpp modules/ts/src/ts_perf.cpp
This commit is contained in:
@@ -54,6 +54,35 @@ string fourccToString(int fourcc)
|
||||
return format("%c%c%c%c", fourcc & 255, (fourcc >> 8) & 255, (fourcc >> 16) & 255, (fourcc >> 24) & 255);
|
||||
}
|
||||
|
||||
#ifdef HAVE_MSMF
|
||||
const VideoFormat g_specific_fmt_list[] =
|
||||
{
|
||||
/*VideoFormat("wmv", CV_FOURCC_MACRO('d', 'v', '2', '5')),
|
||||
VideoFormat("wmv", CV_FOURCC_MACRO('d', 'v', '5', '0')),
|
||||
VideoFormat("wmv", CV_FOURCC_MACRO('d', 'v', 'c', ' ')),
|
||||
VideoFormat("wmv", CV_FOURCC_MACRO('d', 'v', 'h', '1')),
|
||||
VideoFormat("wmv", CV_FOURCC_MACRO('d', 'v', 'h', 'd')),
|
||||
VideoFormat("wmv", CV_FOURCC_MACRO('d', 'v', 's', 'd')),
|
||||
VideoFormat("wmv", CV_FOURCC_MACRO('d', 'v', 's', 'l')),
|
||||
VideoFormat("wmv", CV_FOURCC_MACRO('H', '2', '6', '3')),
|
||||
VideoFormat("wmv", CV_FOURCC_MACRO('M', '4', 'S', '2')),
|
||||
VideoFormat("avi", CV_FOURCC_MACRO('M', 'J', 'P', 'G')),
|
||||
VideoFormat("mp4", CV_FOURCC_MACRO('M', 'P', '4', 'S')),
|
||||
VideoFormat("mp4", CV_FOURCC_MACRO('M', 'P', '4', 'V')),
|
||||
VideoFormat("wmv", CV_FOURCC_MACRO('M', 'P', '4', '3')),
|
||||
VideoFormat("wmv", CV_FOURCC_MACRO('M', 'P', 'G', '1')),
|
||||
VideoFormat("wmv", CV_FOURCC_MACRO('M', 'S', 'S', '1')),
|
||||
VideoFormat("wmv", CV_FOURCC_MACRO('M', 'S', 'S', '2')),*/
|
||||
#if !defined(_M_ARM)
|
||||
VideoFormat("wmv", CV_FOURCC_MACRO('W', 'M', 'V', '1')),
|
||||
VideoFormat("wmv", CV_FOURCC_MACRO('W', 'M', 'V', '2')),
|
||||
#endif
|
||||
VideoFormat("wmv", CV_FOURCC_MACRO('W', 'M', 'V', '3')),
|
||||
VideoFormat("avi", CV_FOURCC_MACRO('H', '2', '6', '4')),
|
||||
//VideoFormat("wmv", CV_FOURCC_MACRO('W', 'V', 'C', '1')),
|
||||
VideoFormat()
|
||||
};
|
||||
#else
|
||||
const VideoFormat g_specific_fmt_list[] =
|
||||
{
|
||||
VideoFormat("avi", VideoWriter::fourcc('X', 'V', 'I', 'D')),
|
||||
@@ -63,17 +92,17 @@ const VideoFormat g_specific_fmt_list[] =
|
||||
VideoFormat("mkv", VideoWriter::fourcc('X', 'V', 'I', 'D')),
|
||||
VideoFormat("mkv", VideoWriter::fourcc('M', 'P', 'E', 'G')),
|
||||
VideoFormat("mkv", VideoWriter::fourcc('M', 'J', 'P', 'G')),
|
||||
|
||||
VideoFormat("mov", VideoWriter::fourcc('m', 'p', '4', 'v')),
|
||||
VideoFormat()
|
||||
};
|
||||
#endif
|
||||
|
||||
}
|
||||
|
||||
class CV_HighGuiTest : public cvtest::BaseTest
|
||||
{
|
||||
protected:
|
||||
void ImageTest(const string& dir);
|
||||
void ImageTest (const string& dir);
|
||||
void VideoTest (const string& dir, const cvtest::VideoFormat& fmt);
|
||||
void SpecificImageTest (const string& dir);
|
||||
void SpecificVideoTest (const string& dir, const cvtest::VideoFormat& fmt);
|
||||
@@ -242,19 +271,19 @@ void CV_HighGuiTest::VideoTest(const string& dir, const cvtest::VideoFormat& fmt
|
||||
|
||||
for(;;)
|
||||
{
|
||||
IplImage * img = cvQueryFrame( cap );
|
||||
IplImage* img = cvQueryFrame( cap );
|
||||
|
||||
if (!img)
|
||||
break;
|
||||
|
||||
frames.push_back(cv::cvarrToMat(img, true));
|
||||
|
||||
if (writer == 0)
|
||||
if (writer == NULL)
|
||||
{
|
||||
writer = cvCreateVideoWriter(tmp_name.c_str(), fmt.fourcc, 24, cvGetSize(img));
|
||||
if (writer == 0)
|
||||
if (writer == NULL)
|
||||
{
|
||||
ts->printf(ts->LOG, "can't create writer (with fourcc : %d)\n",
|
||||
ts->printf(ts->LOG, "can't create writer (with fourcc : %s)\n",
|
||||
cvtest::fourccToString(fmt.fourcc).c_str());
|
||||
cvReleaseCapture( &cap );
|
||||
ts->set_failed_test_info(ts->FAIL_MISMATCH);
|
||||
@@ -290,15 +319,22 @@ void CV_HighGuiTest::VideoTest(const string& dir, const cvtest::VideoFormat& fmt
|
||||
double psnr = PSNR(img1, img);
|
||||
if (psnr < thresDbell)
|
||||
{
|
||||
printf("Too low psnr = %gdb\n", psnr);
|
||||
// imwrite("img.png", img);
|
||||
// imwrite("img1.png", img1);
|
||||
ts->printf(ts->LOG, "Too low frame %d psnr = %gdb\n", i, psnr);
|
||||
ts->set_failed_test_info(ts->FAIL_MISMATCH);
|
||||
|
||||
//imwrite("original.png", img);
|
||||
//imwrite("after_test.png", img1);
|
||||
//Mat diff;
|
||||
//absdiff(img, img1, diff);
|
||||
//imwrite("diff.png", diff);
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
printf("Before saved release for %s\n", tmp_name.c_str());
|
||||
cvReleaseCapture( &saved );
|
||||
printf("After release\n");
|
||||
|
||||
ts->printf(ts->LOG, "end test function : ImagesVideo \n");
|
||||
}
|
||||
|
Reference in New Issue
Block a user