20x240');Рpreview(vid);Р打开/拍摄程序Рset(handles.edit6,'String','...');Рhold off;Рglobal n;n=0;Рset(handles.radiobutton1,'value',1);Рset(handles.edit1,'String','10');Рset(handles.edit3,'String','0');Рset(handles.edit4,'String','0');Рset(handles.edit5,'String','0');Рglobal P;Рif P==8Р global vid;Р axes(handles.axes1);Р I=getsnapshot(vid);Р imshow(I);Р set(handles.edit7,'String','“摄像头拍摄图像”');РelseР [filename,pathname]=uigetfile({'*.jpg';'*.bmp';'*.tif';'*.*'},'打开图像...');Р if isequal(filename,0)|isequal(pathname,0)Р errordlg('图像文件未找到','File Error');Р elseР global file;Р global I;Р P=1;Р file=[pathname,filename];Р I=imread(file);Р axes(handles.axes1);Р imshow(I);Р set(handles.edit7,'String','“元件的原始图像”');Р endРendРset(handles.edit6,'String','OK');Р当标志位P为0时打开图像,P为8是通过摄像头拍摄图像。打开或拍摄的同时,进行标识为设置和一些现实的清零。