Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

in general, no.

but beware, the default flag for imread(img_path, flag) is CV_LOAD_IMAGE_COLOR(==1), so that would leave you with 3 identical channels, even if your img is 1-channel gray on disk.

to avoid that problem, call imread(path, CV_LOAD_IMAGE_GRAYSCALE) // or 0 for the flag

if you want a 1-channel img here