Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Convert single channle image to 3 channel image C++ / OpenCV

Tags:

c++

opencv

Im using openCV C++

Im need to convert a single channel image to 3 channels image. So i can use this: cvCvtColor(result,gray,CV_BGR2GRAY);

I cannot do that because the result img is a single channel image. Any ideas?

like image 588
Harry Avatar asked Sep 01 '10 00:09

Harry


1 Answers

You should use CV_GRAY2BGR instead of CV_BGR2GRAY.

like image 147
Vadim Shender Avatar answered Oct 23 '22 21:10

Vadim Shender