MATLAB GUI 如何把已好的程序写入,。。。。。求高手指教 程序如下
global im %使用全局变量im
I=imcrop(im,[0 0 260 100]);
x=rgb2gray(I);X=double(x);
%set(handles,axes2)
axes(handles.axes2);
c=blkproc(x,[4,4],'min(x(:))');
cc=imresize(c, [260 100], 'bicubic');
d=x-cc';
imshow(uint8(d),[])
这个是我改写的。。。运行不了求高手指教
global im
%选择图片路径
[filename,pathname]= ...
uigetfile({'*.jpg;''*.bmp;''*.gif'},'选择图片');
%合成文件+文件名
str=[pathname filename];
%读取图片
im=imread(str);
%使用第一个axes
axes(handles.axes1);
%显示图片
imshow(im)
这个是读取图片的程序处理提问
答案:从你的读取图片路径来看 没有问题 那么接下来的程序 应该是这样
function pushbutton1_Callback(hObject, eventdata, handles)
global im
%选择图片路径
[filename,pathname]= ...
uigetfile({'*.jpg;''*.bmp;''*.gif'},'选择图片');
%合成文件+文件名
str=[pathname filename];
%读取图片
im=imread(str);
%使用第一个axes
axes(handles.axes1);
%显示图片
imshow(im);%%%%%%%%%读取路径图片
function pushbutton2_Callback(hObject, eventdata, handles)
I=imcrop(im,[0 0 260 100]);
x=rgb2gray(I);
X=double(x);
c=blkproc(x,[4,4],'min(x(:))');
cc=imresize(c, [260 100], 'bicubic');
d=x-cc';
axes(handles.axes2);
imshow(uint8(d),[])
imshow(uint8(d),[])
上一个:Matlab中,运行程序出现The length of X must match the number of rows of Y是怎么回事?
下一个:我看到一个matlab程序,其中 load theo.txt xtheo=theo(:,1); 这两句是什么意思,特别是第二句的含义