Images In MATLAB



Matlab is optimised for operating on matrices

Images are matrices!

Many useful built-in functions in the Matlab Image Processing Toolbox

Very easy to write your own image processing functions.


Here we can read,write and show the image by following commands..
1.  I=imread(‘images.jpg’) :  imread Read image from graphics file.
A = imread(FILENAME,FMT{.jpg,.png,.tift,.gif}) reads a grayscale or color image from the file specified by the string FILENAME. If the file is not in the current directory, or in a directory on the MATLAB path, specify the full pathname.
 
The return value A is an array containing the image data. If the file contains a grayscale image, A is an M-by-N array.
If the file contains a truecolor image, A is an M-by-N-by-3 array. For TIFF files containing color images that use the CMYK color space, A is an M-by-N-by-4 array.
2.  Imwrite(I,filename,format): imwrite Write image to graphics file.
    imwrite(A,FILENAME,FMT) writes the image A to the file specified by
    FILENAME in the format specified by FMT.
It converts the other format of pic into other format, like convert jpg into png.
3.  Imshow():imshow Display image in Handle Graphics figure. 
    imshow(I) displays the grayscale image I.

    imshow(I,[LOW HIGH]) displays the grayscale image I, specifying the display range for I in [LOW HIGH]. The value LOW (and any value less than LOW)
    displays as black, the value HIGH (and any value greater than HIGH) displays as white. Values in between are displayed as intermediate shades of gray,using the default number of gray levels.

    imshow(I,[]) displays the grayscale image I scaling the display based
    on the range of pixel values in I. imshow uses [min(I(:)) max(I(:))] as
    the display range, that is, the minimum value in I is displayed as
    black, and the maximum value is displayed as white.

    imshow(RGB) displays the truecolor image RGB.

    imshow(BW) displays the binary image BW. imshow displays pixels with the
    value 0 (zero) as black and pixels with the value 1 as white.

    imshow(X,MAP) displays the indexed image X with the colormap MAP.

No comments:

Post a Comment