필터 지우기
필터 지우기

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 CenterFile Exchange에서 Image Processing Toolbox에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by