(1) Display:
Image () can display 8-digit images directly, but 8-bit images and double-type data have different meanings in image ().
Binary graphs can be stored by uint8 or double;
Indexed image uint8 and double type display methods are not different. However, there is a deviation between the value of the 8-bit data matrix and the color category with a value of 1. Call format image (x); ColorMap (map);
For grayscale images, the Uint8 range 0~255,double range 0~1, the two modes of conversion: i8 = UINT (round (i64*255)); i64 = Double (i8)/255 ;
Imshow (F,[low,high]) all smaller than low display black, all larger than high display white;
Imshow (f,g) G denotes gray scale series;
Imshow (f,[]) Resolve Uint8 range 0~255 convert to 0~1;
(2) Read:
[r width, c height, d]=imread () different processing according to the file image type. The gray image is stored in a 8-bit matrix and the color graph matrix is converted to a double-precision matrix, and the RGB image is stored in a 8-bit RGB matrix.
The matlab read-in image is a uint8 type, and a double is used in the matrix, so it needs to be converted. Im2double (), Im2uint8 (),im2uint16 ();
(3) Access:
MATLAB defaults to storing the image double type, also supports Uint8 or uint16, the advantage is to save space.
Mat2gray () Converts an array of type double to 0~1, converting the matrix into a grayscale image to produce a double format.
The Isgray () function determines whether the matrix is an image data matrix.
(4) Conversion:
Gray2ind () Ind2gray () [X,map]=rgb2ind () Ind2rgb (X,map) Rgb2gray () IM2BW (rgb,level) threshold
(5) Write:
Imwrite (i, ' snight.jpg ') or imwrite (i, ' snight ', ' jpg ')
Basic operation of MATLAB image