Hi All
I would like to know what image/matrix format is preferred by Octave.
All the imaging functions seem to be written for images in
[0, 1]. This could be rather confusing, for example:
octave:128> I = imread('lena256.jpg'); % read image
octave:129> colormap(gray(256)); % set colormap to 256 gray scales
octave:130> imshow(I) % display lena
octave:131> histeq(I) % oops! expected I in [0,1]
error: `n' undefined near line 30 column 16
So imshow does not handle images in [0,1] (it handles only indexed
images), but the other functions expect images in [0,1]:
octave:140> [p,m] = gray2ind(I/255, 256)
works correctly, while
octave:140> [p,m] = gray2ind(I, 256)
doesn't.
It is, for example, very counterintuitive that the following code
doesn't work:
imshow(imread('image.jpg'))
MATLAB handles the different images with 'classes', but I do not think
Octave has that functionality.
Thanks in advance.
Regards
Stéfan van der Walt
|