?? 實例75.m
字號:
h0=figure('toolbar','none',...
'position',[198 56 350 468],...
'name','實例75');
h1=axes('parent',h0,...
'position',[0.12 0.45 0.75 0.5],...
'visible','off');
I=imread('flowers.tif');
imshow(I)
b1=uicontrol('parent',h0,...
'units','points',...
'tag','b1',...
'style','pushbutton',...
'string','減少顏色',...
'backgroundcolor',[0.75 0.75 0.75],...
'position',[30 100 50 20],...
'callback',[...
'cla,',...
'[X,map]=imread(''flowers.tif'');,',...
'[Y,map2]=imapprox(X,map,64);,',...
'image(Y),',...
'colormap(map2)']);
b2=uicontrol('parent',h0,...
'units','points',...
'tag','b2',...
'style','pushbutton',...
'string','顏色抖動',...
'backgroundcolor',[0.75 0.75 0.75],...
'position',[100 100 50 20],...
'callback',[...
'cla,',...
'I=imread(''flowers.tif'');,',...
'[X,map]=rgb2ind(I,128,''nodither'');,',...
'imshow(X)']);
b3=uicontrol('parent',h0,...
'units','points',...
'tag','b3',...
'style','pushbutton',...
'string','顏色轉換一',...
'backgroundcolor',[0.75 0.75 0.75],...
'position',[170 100 50 20],...
'callback',[...
'cla,',...
'I=imread(''flowers.tif'');,',...
'Y=rgb2ntsc(I);,',...
'J=Y(:,:,1);,',...
'imshow(J)']);
b4=uicontrol('parent',h0,...
'units','points',...
'tag','b4',...
'style','pushbutton',...
'string','關閉',...
'backgroundcolor',[0.75 0.75 0.75],...
'position',[170 50 50 20],...
'callback','close');
b5=uicontrol('parent',h0,...
'units','points',...
'tag','b5',...
'style','pushbutton',...
'string','顏色轉換三',...
'backgroundcolor',[0.75 0.75 0.75],...
'position',[100 50 50 20],...
'callback',[...
'cla,',...
'I=imread(''flowers.tif'');,',...
'J=rgb2ycbcr(I);,',...
'imshow(J)']);
b6=uicontrol('parent',h0,...
'units','points',...
'tag','b6',...
'style','pushbutton',...
'string','顏色轉換二',...
'backgroundcolor',[0.75 0.75 0.75],...
'position',[30 50 50 20],...
'callback',[...
'cla,',...
'I=imread(''flowers.tif'');,',...
'J=rgb2hsv(I);,',...
'imshow(J)']);
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -