7.1
7.1.1
7.1.2
7.1.3
7.1.4
7.2 .
7.2.1 .
7.2.2 .
7.2.3 .
7.3 .
7.3.1 () .
7.3.2 .
7.1
IPT , . .. 4, 4:
1) ISBW .
2) ISGRAY - .
3) ISIND - .
4) ISRGB - .
7.1.1 .
ISBW
: flag=isbw(s)
: 1, , , 0 .
, :
1) ;
2) double, 0 1, uint8;
3) , MATLAB logical.
: isind, isgray, isrgb, islogical, logical.
7.1.2 .
ISGRAY
: flag=isgray(s);
: 1, 0 .
, :
1) ;
2) double, [0,1].
3) uint8 .
4) : isind, isbw, isrgb, islogical, logical.
7.1.3 .
ISIND
: flag=isind(s);
: isind 1, s 0 .
, , :
1) ;
2) double, , ;
3) uint8 .
:
Isbw, isgray isind? . ? , . .
, , ..
|
|
Isbw, isgray isinit.
, 0- 1-.
, 0- 1-, .
%examp2m
%, Isbw, isgray isind
Im=[1 0 1 0 1];
% double,
Isbw(Im);
ans
%
%=0
Isgray(Im);
ans
%=1
Isind(Im);
ans
%=0
Im=logical(Im);
% double,
Isbw(Im);
ans
%=1
Isgray(Im);
ans
%=1
Isind(Im);
ans
%=0
Im=[1 0 1 0 1];
Im=uint8(Im);
% double,
Isbw(Im);
ans
%=0
Isgray(Im);
ans
%=1
Isind(Im);
ans
%=1
Im=logical(im);
% uint8,
Isbw(Im);
ans
%=1
Isgray(Im);
ans
%=1
Isind(Im);
ans
%=0
7.1.4 .
: ISRGB.
: flag=isrgb(s);
: isrgb 1, s 0 .
, , :
1) MxNx3, M , N .
2) double, [0,1];
3) uint8;
4)
7.2
. IPT , .
7.2.1 .
.
:IM2BW
: BW=im2bw(s, threshold); BW=im2bw(x, map, threshold)
: im2bw .
. BW 2 0( ), threshold, 1( ), , threshold(). [0,1]. .
? BW=im2bw(s, threshold) s BW.
BW=im2bw(x, map, threshold) x map BW.
? double uint8. uint8.
? .
7.2.2 .
: IND2GRAY
: I=ind2gray(x, map)
: ind2gray I, R-, G-, B- map, x, .
|
|
? Y- YIQ.
YIQ rgb2gray rgb2ntsc.
x I .
7.2.3 .
: GRAY2IND
: [x, map]=gray2ind(I, n)
: gray2ind x map, I. map [0,1]. n=64.
gray2ind gray(n). n<=256, x uint8. x double.
7.3 .
, , :
7.3.1 .
x=dither(RGB, map,Qm,Qe); BW=dither(I).
x map , .
7.3.2 .
RGB2IND
4- , :
1)
2)
3)
4)
7.3.3 .
IND2RGB
: RGB=ind2rgb(x, map)
: uint8 double, RGB double.
..