M-File Help: iint View code for iint

iint

Convert image to integer class

out = iint(im) is an image with unsigned 8-bit integer elements in the range 0 to 255 corresponding to the elements of the image im.

out = iint(im, class) as above but the output pixels belong to the integer class class.

Examples

Convert double precision image to 8-bit unsigned integer

im = rand(50, 50);
out = iint(im);

Convert double precision image to 16-bit unsigned integer

im = rand(50, 50);
out = iint(im, 'uint16');

Convert 8-bit unsigned integer image to 16-bit unsigned integer

im = randi(255, 50, 50, 'uint8');
out = iint(im, 'uint16');

Notes

See also

idouble


 

© 1990-2012 Peter Corke.