SIP - Scilab Image Processing Toolbox >> SIP - Scilab Image Processing Toolbox > imshow
imshow
Displays images in the Scilab graphic window
Calling Sequence
imshow(Img, arg2 [, strf])
Parameters
- filename
- A string, the image filename to be created. The extension determines the type of the image.
- Img
- MxN matrix, a grayscale (0-1 range) or pseudo-color/indexed (1-Ncolors range) image.
- n
- A scalar, the number of levels of gray to display Img. 1x2 array
corresponding to the grayscale range to be considered.
- [low high]
- 1x2 array corresponding to the grayscale range to be considered.
- Map
- Mx3 matrix containing the image colormap (for indexed images). Entries may range from 0 to 1
- RGBImg
- MxNx3 hypermatrix in 0-1 range.
- strf
- this is used to e.g. put axes around your image. See the plot2d help page.
You may use this optional parameter in the assignment style, as in
imshow(img,strf='041') | | | |
Description
- imshow(Img, n)
- displays Img using n gray levels. Img is an MxN matrix in 0 -
(n-1) range. If n is omitted, it will be assumed to be 256.
- imshow(Img, [low high])
- displays Img using a grayscale within the
specified range. Elements <= low will map onto black, Elements
>= high will map onto white, and elements in between will map
as a shade of gray. If an empty matrix
'[]'
is used,
[low,high]
will be assumed to be [min(Img), max(Img)]
.
- imshow(Img, Map)
- displays Img using the specified colormap.
- imshow(RGBImg)
- displays the RGBImg MxNx3 (0-1) truecolor image.
- imshow('filename')
- displays the image
filename
in the scilab graphical
window. Any raster image format is accepted (see Remarks section).
Examples
initial_dir = PWD;
chdir (SIPDIR + 'images');
a = rand(100,100);
clf;
imshow(a);
imshow(a*255 + 1,hotcolormap(256));
imshow(a,[0.3 0.6]);
imshow(a,[]);
clf;
imshow('example.png');
chdir(initial_dir); | | | |
Remarks
In theory, imshow(filename)
will work with any raster
image format. In practice, it has been tested only for BMP,
GIF, JPEG, PNG, PCX, TIFF, XPM, and MIFF. Displaying other file
formats will probably work, but this case have not been tested by
the developers of the SIP toolbox.
Bugs and Shortcomings
The display of truecolor images is somewhat inefficient.
Images are stored in double precision matrices. Hopefully,
the next release will make usage of integer types.
Authors
- Ricardo Fabbri <ricardofabbri[at]users.sf.net>
Availability
The latest version of SIP can be found at
http://siptoolbox.sf.net