I am confusing,why this code don't work
mask = imread("mask.jpg")>200;
cvtColor(mask, red, COLOR_GRAY2BGR);
It cannot run normally and will pop an abort window.But if I specify the color space when load the mask like
mask1 = imread("mask.jpg",IMREAD_GRAYSCALE)>200;
cvtColor(mask1, red, COLOR_GRAY2BGR);
Then the code is work well. I think this problem is result to the mask is not grayscale image. But how to know the color space of a image in OpenCV?