From bcce25900b7a9f9b8941e54d1ee2214684977fad Mon Sep 17 00:00:00 2001 From: Tomoaki Teshima Date: Mon, 19 Feb 2018 18:33:05 +0900 Subject: [PATCH] read in gray scale mode when writing a gray scale video --- modules/videoio/perf/perf_output.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/videoio/perf/perf_output.cpp b/modules/videoio/perf/perf_output.cpp index 0d04e5e0b5..43835a7910 100644 --- a/modules/videoio/perf/perf_output.cpp +++ b/modules/videoio/perf/perf_output.cpp @@ -28,7 +28,7 @@ PERF_TEST_P(VideoWriter_Writing, WriteFrame, { const string filename = getDataPath(get<0>(GetParam())); const bool isColor = get<1>(GetParam()); - Mat image = imread(filename, 1); + Mat image = imread(filename, isColor ? IMREAD_COLOR : IMREAD_GRAYSCALE ); #if defined(HAVE_MSMF) && !defined(HAVE_VFW) && !defined(HAVE_FFMPEG) // VFW has greater priority const string outfile = cv::tempfile(".wmv"); const int fourcc = VideoWriter::fourcc('W', 'M', 'V', '3');