Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

the default flag for imread() is IMREAD_COLOR , and will force 3 channels

if you saved it as single channel grayscale image, using

pgm = imread("images/apple1.pgm", IMREAD_GRAYSCALE);

should retrieve it correctly.