From 2fb0d23104a4d6e7607269b51357974eae4a52e6 Mon Sep 17 00:00:00 2001 From: Jin Ma Date: Sat, 7 Sep 2013 10:40:30 +0800 Subject: [PATCH] Removed unnecessary process for conversion to 4-channel format. --- modules/ocl/perf/perf_bgfg.cpp | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/modules/ocl/perf/perf_bgfg.cpp b/modules/ocl/perf/perf_bgfg.cpp index ec96c9007..ecf112702 100644 --- a/modules/ocl/perf/perf_bgfg.cpp +++ b/modules/ocl/perf/perf_bgfg.cpp @@ -63,14 +63,11 @@ using std::tr1::get; #endif #if BUILD_WITH_VIDEO_INPUT_SUPPORT -static void cvtFrameFmt(vector& input, vector& output, int output_cn) +static void cvtFrameFmt(vector& input, vector& output) { for(int i = 0; i< (int)(input.size()); i++) { - if(output_cn == 1) - cvtColor(input[i], output[i], COLOR_RGB2GRAY); - else - cvtColor(input[i], output[i], COLOR_RGB2RGBA); + cvtColor(input[i], output[i], COLOR_RGB2GRAY); } } //prepare data for CPU @@ -87,7 +84,7 @@ static void prepareData(VideoCapture& cap, int cn, vector& frame_buffer) } if(cn == 1) - cvtFrameFmt(frame_buffer_init, frame_buffer, 1); + cvtFrameFmt(frame_buffer_init, frame_buffer); else frame_buffer = frame_buffer_init; }