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.