Removed unnecessary process for conversion to 4-channel format.

This commit is contained in:
Jin Ma 2013-09-07 10:40:30 +08:00
parent 172242a94e
commit 2fb0d23104

View File

@ -63,14 +63,11 @@ using std::tr1::get;
#endif #endif
#if BUILD_WITH_VIDEO_INPUT_SUPPORT #if BUILD_WITH_VIDEO_INPUT_SUPPORT
static void cvtFrameFmt(vector<Mat>& input, vector<Mat>& output, int output_cn) static void cvtFrameFmt(vector<Mat>& input, vector<Mat>& output)
{ {
for(int i = 0; i< (int)(input.size()); i++) for(int i = 0; i< (int)(input.size()); i++)
{ {
if(output_cn == 1) cvtColor(input[i], output[i], COLOR_RGB2GRAY);
cvtColor(input[i], output[i], COLOR_RGB2GRAY);
else
cvtColor(input[i], output[i], COLOR_RGB2RGBA);
} }
} }
//prepare data for CPU //prepare data for CPU
@ -87,7 +84,7 @@ static void prepareData(VideoCapture& cap, int cn, vector<Mat>& frame_buffer)
} }
if(cn == 1) if(cn == 1)
cvtFrameFmt(frame_buffer_init, frame_buffer, 1); cvtFrameFmt(frame_buffer_init, frame_buffer);
else else
frame_buffer = frame_buffer_init; frame_buffer = frame_buffer_init;
} }