【发布时间】:2015-04-06 08:31:51
【问题描述】:
我想实现一个 gui 环境,当用户加载两个图像时,它会选择一个算术运算来应用于这两个图像。我被困在这个地方。告诉我我在“Case”值中使用什么代码来应用。
function pushbutton3_Callback(hObject, eventdata, handles)
% hObject handle to pushbutton3 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
contents = get(handles.popupmenu1,'String');
popupmenu4value = contents{get(handles.popupmenu1,'Value')};
% Hints: contents = cellstr(get(hObject,'String')) returns popupmenu1contents as cell array
% contents{get(hObject,'Value')} returns selected item from
popupmenu1
switch popupmenu4value
case 'Add'
%function of A
set(handles.figure1,'CurrentAxes',handles.axes3);
imshow(img2,[]);
case 'B'
%function of B
end
【问题讨论】:
-
很难用这么少的代码和这么少的信息来回答。图像是否已经导入数组?它们的尺寸相同吗?如果你有
Img1和Img2,为什么Img1+Img2不工作? (我想如果您使用的是 GUI,那么您有足够的经验来了解+运算符的情况)
标签: matlab image-processing matlab-guide digital