【发布时间】:2016-04-17 05:08:43
【问题描述】:
这是我的回调函数代码。
function Next_Callback(hObject, eventdata, handles)
display('Click Next');
handles.imgLNum = strcat('I1_',num2str(handles.imageNumber),'.png');
handles.imgRNum = strcat('I2_',num2str(handles.imageNumber),'.png');
handles.imageLeft = strcat(handles.directory,handles.imgLNum);
handles.imageRight = strcat(handles.directory,handles.imgRNum);
axes(handles.img1);
imshow(handles.imageLeft);
axes(handles.img2);
imshow(handles.imageRight);
handles.imageNumber = handles.imageNumber+1;
我的 GUI 上有一个名为“下一步”的按钮,我想在单击时将下一个图像加载到轴中。 handles.imageLeft 和 handles.imageRight 有图像的路径。当第一次点击按钮时,轴会随图像更新。但随后单击按钮不会更新轴。但是控制台中会显示“单击下一步”文本,所以我知道正在调用回调函数。
【问题讨论】:
-
您需要先读取图片,例如
Img=imread(handles.imageRight),然后您可以调用imshow(Img)。imshow不能在路径上工作,只能在矩阵上工作。 -
我也试过了。但即便如此,我也会被困在同一个地方。
-
请编辑并显示您到底尝试了什么
-
Here 是我到目前为止所做的完整代码
-
好的,我没有看到问题,但我不会为你调试它,对不起...设置一些断点并走每一行,检查问题出在哪里...
标签: matlab matlab-guide