Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Hi!
This assert means, that your source image (img_1) should have 3 or 4 channels for this type of conversion. I'm think, you don't read properly img_1 source image. Check the paths for this image. You can call img_1.empty() to find out was image read or not.
BTW, imread allows you to specify color type of loaded image, as described here, by default it is BGR image, so you should use CV_BGR2GRAY conversion type.