From: Lucas Sá <luc...@gm...> - 2012-11-05 07:06:26
|
Today I noticed that the image package treats indexed images differently in functions within the module. Using [X, map] = *imread *will give me a matrix X with values from 0 to n-1, while all other image package functions expect index mapping from 1 to n, such as *imshow*, *ind2rgb*, *ind2gray*. This fact makes the execution of a simple *imshow('some_file.gif') *to show something different from the original image. imshow(*X+1*, map) would show it fine as well. The function ind2rgb, for example, even has a validation for indices less than 1 in line 43 of ind2rgb.m: ## Check if X is an indexed image. if (ndims (x) != 2 || any (x(:) != fix (x(:))) || *min (x(:)) < 1*) error ("ind2rgb: X must be an indexed image"); Is it normal that I am receving 0 values in X matrix? I am using octave 3.6.2 and graphicsmagick 1.3.16. |