19-4 ������������������������������

MATLAB imread OiΩŪvɮסA imwrite hiΩgJvɮסCoӫOiHBzv榡UCXءG

vɮ׮榡ɦWr
Ln Bitmap bmp 'bmp'
hƮ榡
]Hierarchical Data Format^
hdf 'hdf'
Joint Photographic Expert Group jpg jpge 'jpg' 'jpeg'
Ln Paintbrush pcx 'pcx'
i⦡ϧ
]Portable Network Graphics^
png 'png'
аOvɮ׮榡
]Tagged Image File Format^
tiff 'tif' 'tiff'
XɦL
]X Windows Dump^
xwd 'xwd'
ϧΥ洫榡
]Graphic Interchange Format^
gif 'gif'

imread OiHŪWz榡vɮסAöi楲nഫApU:

  1. j׼vAimread NƥH uint8 x}]jp mn^Ǧ^C
  2. ޼vAimread NƥH uint8 x}]jp mn^Ǧ^AæPɶǦ^@ǪLx}ACӤȤ[0,1]C
  3. mx}Aimread NƥH uint8 x}]jp mn3^Ǧ^C

ҦpAimread iŪXUCmvG

Example 1: 19-vܻPŪg/imread01.mRGB = imread('simulinkteam.jpg'); image(RGB); class(RGB) ans = uint8

Hint
WϨƹWO MathWorks q̭ SimulinkoiCb MATLAB 5.3ApGzw SimulinkAoɮ״Nb {MATLAB ڥؿ}\toolbox\simulink UC

imwrite OiNƼgvɦpU:

Example 2: 19-vܻPŪg/imwrite01.mload clown.mat imwrite(X, map, 'myClown.jpg'); !start myClown.jpg

Wz̫@CԭzN|Is@~tΤUε{Ӷ} myClown.jpg ɮסC]@~tέYO WindowsAhΨӶ} myClown.jpg ε{ܥiO Windows ۤ˵C^

Hint
󤣦Pɮ׮榡Aimread imwrite ΪkɭԻݥ[WB~ѼơAиԨuWC

imfinfo OiΩǦ^vɮתUTAӥB󤣦Pɮ׮榡Aimfinfo Ǧ^Tإi঳ҤPAҦpG

Example 3: 19-vܻPŪg/imfinfo01.minfo1=imfinfo('simulinkteam.jpg') info2=imfinfo('sbtree.gif') info1 = Filename: 'D:\users\jang\books\matlabProgramming4beginner\example\19-vܻPŪg\simulinkteam.jpg' FileModDate: '28-Mar-2000 17:30:36' FileSize: 24071 Format: 'jpg' FormatVersion: '' Width: 234 Height: 126 BitDepth: 24 ColorType: 'truecolor' FormatSignature: '' NumberOfSamples: 3 CodingMethod: 'Huffman' CodingProcess: 'Sequential' Comment: {'CREATOR: XV Version 3.10a Rev: 12/29/94 Quality = 95, Smoothing = 0 '} info2 = Filename: 'D:\users\jang\books\matlabProgramming4beginner\example\19-vܻPŪg\sbtree.gif' FileModDate: '10-Sep-1997 14:53:14' FileSize: 7121 Format: 'GIF' FormatVersion: '87a' Left: 1 Top: 1 Width: 99 Height: 80 BitDepth: 8 ColorType: 'indexed' FormatSignature: 'GIF87a' BackgroundColor: 1 AspectRatio: 0 ColorTable: [256x3 double] Interlaced: 'no'

`ipU:

Ū̥iN clown ƦsJ BMP ɮסAA imfinfo ŪXTAHtC


MATLAB{]pGJg