1 | initial version |
.....
is not a valid path, and you have to CHECK if imread actually returned a valid image.
2 | No.2 Revision |
.....
is not a valid path, path your image was never loaded, and you have to CHECK if imread actually returned a valid image.image:
image = imread(some_invalid_path);
if (image.empty())
// you can't go on !
then, if you load a grayscale (single channel) image, you cannot split() it into 3 channels.