cvtColor output unexpected channel count
I am using OpenCV 2.4.6 on a Windows 8 64 bit machine using VS2012 c++/cli. I want to take a CV_8UC3 color image, convert it to grayscale and display it.
cvtColor is not outputting what I would expect. Based on the documentation, where OriginalMat is a CV_8UC3 image, both of the following should output a CV_8UC3 image:
cvtColor(OriginalMat,NewMat,CV_RGB2GRAY);
cvtColor(originalMat,NewMat,CV_RGB2GRAY,3);
Instead, both output a CV_8UC1 image.
Perhaps the documentation should be changed to reflect the fact that when working with grayscale, the output will always be single channel and any hard coded channel count will be ignored.
try to find someone posts questions, you can get your answer.
why would you expect, that cvtColor(OriginalMat,NewMat,CV_RGB2GRAY); outputs a 3chan image ?