You are on page 1of 11

:

.
.1 : 0 1
.bw

.2 () :Grayscale image


gray
.
double,single ][0,1
uint8 ][0,255
uint16 ][0,65535
int16 ][-32768,32767

.3 : Indexed Image
double,single,uint8,uint16
ind
.
m*3 double RGB

.4 :Truecolor
rgb m*n*3
double,single,uint8,uint16
.

.
.
. colormap

: imread
( ) 8bit,16bit,24bit
imread :
)1 ( colormap )
;)rgb=imread(football.jpg
8bit rgb uint8
16bit tif,png imread uint16
)2 ( colormap )
,
.
imread double
uint8 . uint16
;) [x,map]=imread( trees.tif
imread
)Bmp (Microsoft windows Bitmap
)Gif (Graphics Interchange Format
)Jpeg (Joint Photographic Experts Group
)Png (Portable Network Graphics
)Tiff (Tagged Image File Format
:

index image truecolor


.

:

Gray
RGB

;)I=imread(pout.tif
;)RGB=cat(3,I,I,I

Gray
:

Ind


Ind
;)i=imread(cameraman.tif
;)[x,map]=gray2ind(i,16
)figure,imshow(x,map
Gray

Ind

RGB

;)[i,map]=imread(trees.tif
;)J=ind2gray(i,map
)figure,imshow(i,map),figure,imshow(j
RGB
;)[x,map]=imread(kids.tif
;)RGB=ind2rgb(x,map
Gray

RGB
:

;)I=imread(peppers.png
;)J=rgb2gray(I
)Figure.imshow(I),figure,imshow(J
Ind

;)RGB=imread(peppers.png
;)[x,map]=rgb2ind(RGB,128
)Figure,imshow(x,map
121
RGB 65536.


) im2bw(I,level
.
:
;)[x,map]=imread(trees.tif
;)BW = im2bw(x,map,0.4
)figure, imshow(x,map), figure, imshow(BW

dither
:1
;)I = imread(cameraman.tif
;)BW = dither(I
)figure, imshow(I
)figure, imshow(BW
:2
;)RGB=imread(peppers.png
;)I=dither(RGB,map
map 65536 .

:imwrite

, imwrite :
)3 ( colormap )
;)rgb=imread(football.jpg
)imwrite(rgb,foot.bmp
)4 ( colormap )
;) [x,map]=imread( trees.tif
)imwrite(x,map,trees.png
:
.
: .
:1 png bitdepth
1,2,4,8,16
24 =16

;)x=imread(pout.tif
)imwrite(x,pout.png,bitdepth,4


:2 jpg quality
( )100
;)[x,map]=imread(kids.tif
)imwrite(x,map,kids.jpg,quality,70

:
imshow , imtool
imshow
.

imtool
imshow
.
.1 : imshow


:
)imshow (moon.tif
or
imshow moon.tif


;moon= getimage
:
imshow initialmagnification
:
;)pout= imread(pout.tif
)imshow(pout, initialmagnification,150
: ( )
.%100


;)pout= imread(pout.tif
)]imshow(pout,[80 120
:
)subplot(m,n,p

.
m n p
:
;)[x1,map1]=imread(forest.tif
;)[x2,map2]=imread(trees.tif
)subplot(1,2,1),imshow(x1,map1
)subplot(1,2,2),imshow(x2,map2

:


( ) imshow
subimage :
:
)subplot(1,2,1) , subimage(x1,map1
)subplot(1,2,2) , subimage(x2,map2
.2 : imtool

:
;)moon= imread(moon.tif
)imtool(moon
imtool moon.tif

or

)imtool(moon.tif



;)moon= getimage(imgca
export to workspace File
: initialmagnification imshow
imtool File
import from workspace Filter

()
tools choose colormap


workspace variables
.
.
overview

image tool
overview .

inspect pixel values

pixel region
.

measure distance

,
,

Export to workspace

display image information :

)a : ( )uint8
.
)b :
.imfinfo
:
.
adjust contrast () ,

You might also like