Azzera filtri
Azzera filtri

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

1 visualizzazione (ultimi 30 giorni)
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

Risposta accettata

Image Analyst
Image Analyst il 5 Dic 2014
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 Commenti
siti
siti il 8 Dic 2014
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 il 8 Dic 2014
What variable name contains the string that is the folder name?

Accedi per commentare.

Più risposte (0)

Categorie

Scopri di più su Image Processing Toolbox in Help Center e File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by