Re: [SIP-users] imshow problem in 0.3.1
Advanced image processing toolbox for Scilab on Unix/Linux/Mac OS
Status: Beta
Brought to you by:
ricardofabbri
From: Ricardo F. <rf...@if...> - 2004-02-18 01:26:27
|
On Tue, 17 Feb 2004, Charlls Quarra wrote: > Hi, > > I have scilab 2.7 on RH9, i loaded SIP doing exec > loader.sce, then i did > > > --> A=imread('somegrayscaleimage.jpg'); > --> imshow(A) > > the graphics window shows empty! > > is this a known problem or its something else? Hi, SIP 0.3.1 changed the way it treats image ranges. The grayscale image you read is actually an indexed image with gray colormap. The correct way to read/display it would be: [A,map] = imread('grayimage.jpg'); imshow(A,map); The matrix A is not an image itself; its entries are indexes to the colormap "map". Therefore, indexes range from 1 to NC, where NC is the number of colors of the image. if you do a simple imshow(A) Then imshow will assume 0 is black, 1 is white, and all above 1 is white, so that's why your image is all blank. Alternatively, you may: A = imread('grayimage.jpg'); imshow(A,256); OR imshow(A/maxi(A)); OR even imshow(A,[]); The last command rescales A to occupy the 0-1 range. Ricardo. -- Ricardo Fabbri, Cybernetic Vision Research Group, USP, Brazil. WEB: cyvision.if.sc.usp.br/~rfabbri ICQ: 208974212 "With pain and suddeness is how Real Offsprings are born. But they must result from intense pleasure and a long period of development." |