【问题标题】:i want to show an image in axes3 which is the resultant of two images Matlab我想在axes3中显示一个图像,它是两个图像Matlab的结果
【发布时间】: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

【问题讨论】:

  • 很难用这么少的代码和这么少的信息来回答。图像是否已经导入数组?它们的尺寸相同吗?如果你有Img1Img2,为什么Img1+Img2 不工作? (我想如果您使用的是 GUI,那么您有足够的经验来了解 + 运算符的情况)

标签: matlab image-processing matlab-guide digital


【解决方案1】:
  • 您可以使用 uigetdir 获取要加载的图像的路径和名称。
  • 然后,您需要在加载的图像上执行算术运算,然后再尝试显示修改后的图像(例如,如果您将图像加在一起,请注意像素溢出 - 如果您有两个像素值为 256 并添加它们一起显示的结果将是 256 而不是 512,因此您需要使用 double 然后转换回 uint8)。

如果没有更多关于您想要什么的信息,实际上是不可能提供更多帮助的。如果您在使用 matlab 指南时遇到问题,那么我建议您在 youtube 上搜索教程并阅读 matlab 指南教程。如果您在此处提问之前先执行此操作,将会更快、更有益于您。 youtube - matlab guide

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2014-03-26
    • 1970-01-01
    • 2012-06-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多