matlab 图像处理算法集合原创GUI文档格式.docx

上传人:b****6 文档编号:16809753 上传时间:2022-11-26 格式:DOCX 页数:36 大小:86.39KB
下载 相关 举报
matlab 图像处理算法集合原创GUI文档格式.docx_第1页
第1页 / 共36页
matlab 图像处理算法集合原创GUI文档格式.docx_第2页
第2页 / 共36页
matlab 图像处理算法集合原创GUI文档格式.docx_第3页
第3页 / 共36页
matlab 图像处理算法集合原创GUI文档格式.docx_第4页
第4页 / 共36页
matlab 图像处理算法集合原创GUI文档格式.docx_第5页
第5页 / 共36页
点击查看更多>>
下载资源
资源描述

matlab 图像处理算法集合原创GUI文档格式.docx

《matlab 图像处理算法集合原创GUI文档格式.docx》由会员分享,可在线阅读,更多相关《matlab 图像处理算法集合原创GUI文档格式.docx(36页珍藏版)》请在冰豆网上搜索。

matlab 图像处理算法集合原创GUI文档格式.docx

GUIallowsonlyone

%instancetorun(singleton)"

.

%Seealso:

GUIDE,GUIDATA,GUIHANDLES

%Edittheabovetexttomodifytheresponsetohelpimageprocessinggui

%LastModifiedbyGUIDEv2.521-May-201220:

51:

04

%Begininitializationcode-DONOTEDIT

gui_Singleton=1;

gui_State=struct('

gui_Name'

mfilename,...

'

gui_Singleton'

gui_Singleton,...

gui_OpeningFcn'

@imageprocessinggui_OpeningFcn,...

gui_OutputFcn'

@imageprocessinggui_OutputFcn,...

gui_LayoutFcn'

[],...

gui_Callback'

[]);

ifnargin&

&

ischar(varargin{1})

gui_State.gui_Callback=str2func(varargin{1});

end

ifnargout

[varargout{1:

nargout}]=gui_mainfcn(gui_State,varargin{:

});

else

gui_mainfcn(gui_State,varargin{:

%Endinitializationcode-DONOTEDIT

%---Executesjustbeforeimageprocessingguiismadevisible.

functionimageprocessinggui_OpeningFcn(hObject,eventdata,handles,varargin)

%Thisfunctionhasnooutputargs,seeOutputFcn.

%hObjecthandletofigure

%eventdatareserved-tobedefinedinafutureversionofMATLAB

%handlesstructurewithhandlesanduserdata(seeGUIDATA)

%varargincommandlineargumentstoimageprocessinggui(seeVARARGIN)

%Choosedefaultcommandlineoutputforimageprocessinggui

handles.output=hObject;

%Updatehandlesstructure

guidata(hObject,handles);

%UIWAITmakesimageprocessingguiwaitforuserresponse(seeUIRESUME)

%uiwait(handles.figure1);

%---Outputsfromthisfunctionarereturnedtothecommandline.

functionvarargout=imageprocessinggui_OutputFcn(hObject,eventdata,handles)

%varargoutcellarrayforreturningoutputargs(seeVARARGOUT);

%Getdefaultcommandlineoutputfromhandlesstructure

varargout{1}=handles.output;

%javaFrame=get(gcf,'

JavaFrame'

);

%set(javaFrame,'

Maximized'

1);

%--------------------------------------------------------------------

functionUntitled_1_Callback(hObject,eventdata,handles)

%hObjecthandletoUntitled_1(seeGCBO)

functionUntitled_5_Callback(hObject,eventdata,handles)

%hObjecthandletoUntitled_5(seeGCBO)

functionUntitled_15_Callback(hObject,eventdata,handles)

%hObjecthandletoUntitled_15(seeGCBO)

functionUntitled_25_Callback(hObject,eventdata,handles)

%hObjecthandletoUntitled_25(seeGCBO)

functionGradientimage_Callback(hObject,eventdata,handles)

%hObjecthandletoGradientimage(seeGCBO)

globalim

axes(handles.axes1);

clareset;

axes(handles.axes2);

axes(handles.axes3);

axes(handles.axes4);

P=im;

d=size(P);

if(d(3)>

1)

P=rgb2gray(P);

imshow(P);

title('

灰度图像'

P=double(P);

[Px,Py]=gradient(P);

G=sqrt(Px.*Px+Py.*Py);

P=G;

P=uint8(P);

梯度图像1'

tou=input('

inputthresholdtou='

bh=input('

inputaconstantintensitynearertowhitebh='

P1=P;

k=find(G>

=tou);

P1(k)=bh;

imshow(P1);

梯度图像2'

bl=input('

inputaconstantintensitynearertoblackbl='

P2=P;

h=find(G>

P2(h)=bh;

l=find(G<

tou);

P2(l)=bl;

imshow(P2);

梯度图像3'

P3=zeros(d

(1),d

(2));

fori=1:

d

(1)

forj=1:

d

(2)

if(G(i,j)>

=tou)

P3(i,j)=bh;

else

P3(i,j)=bl;

end

P3=uint8(P3);

imshow(P3);

梯度图像4'

functionUntitled_27_Callback(hObject,eventdata,handles)

%hObjecthandletoUntitled_27(seeGCBO)

functionUntitled_16_Callback(hObject,eventdata,handles)

%hObjecthandletoUntitled_16(seeGCBO)

functionUntitled_21_Callback(hObject,eventdata,handles)

%hObjecthandletoUntitled_21(seeGCBO)

functionUntitled_6_Callback(hObject,eventdata,handles)

%hObjecthandletoUntitled_6(seeGCBO)

functionUntitled_12_Callback(hObject,eventdata,handles)

%hObjecthandletoUntitled_12(seeGCBO)

functionUntitled_2_Callback(hObject,eventdata,handles)

%hObjecthandletoUntitled_2(seeGCBO)

globalS

[filename,pathname]=uigetfile({'

*.jpg'

;

'

*.bmp'

*.gif'

*.tif'

*.png'

*jpeg'

},'

选择图片'

ifisequal(filename,0)

disp('

Userselectedcanceled'

str=[pathnamefilename];

%globalS%设置一个全局变量S,保存初始图像路径,以便之后的还原操作

S=str;

im=imread(str);

imshow(im);

原图像'

handles.img=im;

guidata(hObject,handles);

functionsave_Callback(hObject,eventdata,handles)

%hObjecthandletosave(seeGCBO)

newfig1=figure;

new_h1=copyobj(handles.axes1,newfig1);

set(new_h1,'

Units'

default'

Position'

hp=getframe(new_h1);

[filename1,pathname1]=uiputfile({'

Bitmap(*.bmp)'

...

JPEG(*.jpg)'

GIF(*.gif)'

*.*'

'

AllFiles(*.*)'

},...

SavePicture1'

Picture1_1'

iffilename1==0

close(newfig1);

return

imwrite(hp.cdata,fullfile(pathname1,filename1));

functionquit_Callback(hObject,eventdata,handles)

%hObjecthandletoquit(seeGCBO)

clc;

closeall;

close(gcf);

clear;

functionlinearTran_Callback(hObject,eventdata,handles)

%hObjecthandletolinearTran(seeGCBO)

[mn]=size(P);

g=zeros(m,n);

%B=input('

inputthestorageofeachpixel:

B=8;

bmin=min(min(P));

bmax=max(max(P));

m

n

g(i,j)=(2.^B-1)*(P(i,j)-bmin)/(bmax-bmin);

g=uint8(g);

imshow(g);

经线性变换后的图像'

functionlimitlintran_Callback(hObject,eventdata,handles)

%hObjecthandletolimitlintran(seeGCBO)

axes(han

展开阅读全文
相关资源
猜你喜欢
相关搜索

当前位置:首页 > 成人教育 > 成考

copyright@ 2008-2022 冰豆网网站版权所有

经营许可证编号:鄂ICP备2022015515号-1