Borrar filtros
Borrar filtros

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

1 visualización (últimos 30 días)
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

Respuesta aceptada

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

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Image Processing Toolbox en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by