フィルターのクリア

How can i read images for filtering using if else condition in GUI?

1 回表示 (過去 30 日間)
siti
siti 2014 年 12 月 5 日
コメント済み: Image Analyst 2014 年 12 月 8 日
function popupmenu3_Callback(hObject, eventdata, handles)
popupimage=get(popupmenu3.handles,'value');
img=imread('flower.jpg');
img1=imread('balloon.jpg');
%average
if
popupimage==img
e=fspecial('average',[33])
A=imfilter(img,e);
axes(handles.axes2);
imshow(A);
else if popupimage==img1
e=fspecial('average',[33])
B=imfilter(img1,e);
axes(handles.axes2);
imshow(B);
end

採用された回答

Image Analyst
Image Analyst 2014 年 12 月 5 日
Try this:
selectedItem = get(popupmenu3.handles,'value');
img=imread('flower.jpg');
img1=imread('balloon.jpg');
%average
e=fspecial('average',[33])
axes(handles.axes2);
if selectedItem == 1
A=imfilter(img,e);
imshow(A);
elseif selectedItem == 2
B=imfilter(img1,e);
imshow(B);
end
  16 件のコメント
siti
siti 2014 年 12 月 8 日
i already store my images in the folder..but why it gives me this 'Reference to non-existent field 'images'. 'error?
Image Analyst
Image Analyst 2014 年 12 月 8 日
What variable name contains the string that is the folder name?

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeImage Processing Toolbox についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by