Mat reshape not reducing channel number
Hi everyone,
I get the error: error: (-215) mask.depth() == CV_8U && (mcn == 1 || mcn == cn) in function copyTo
, when the following code runs. Why does reshape() not reduce the number of channels in mask to 1? I need a binary mask to find an object in the scene, however drawcontours() is giving me a grayscale 3 channel image, and my input image is 4 channels hence the error, but I thought reshape would fix this by reducing it to 1 channel. The printout of mcn states Mask has 3 channels.