Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

please check for img.channels() (must be 3) or img.empty() (must be false) after each imread() call.

your image was either not bgr or simply failed to load.

(note, that you can only use ascii strings for filenames here !)

please check for img.channels() (must be 3) or img.empty() (must be false) after each imread() call.

your image was either not bgr or simply failed to load.

(note, that you can only use ascii strings for filenames here !)

also, you have to reserve memory for your filenames with scanf , like:

char filename[255];

(it might simply be, you're UB lacking that)

please check for img.channels() (must be 3) or img.empty() (must be false) after each imread() call.

your image was either not bgr or simply failed to load.

(note, that you can only use ascii strings for filenames here !)

also, you have to reserve memory for your filenames with scanf , like:

char filename[255];

(it might simply be, you're UB lacking that)that, please see here)