Borrar filtros
Borrar filtros

Loading image into GUI

78 visualizaciones (últimos 30 días)
Jaanu
Jaanu el 5 de Jun. de 2012
Comentada: Image Analyst el 13 de Nov. de 2022
Hi,
How to load an image into GUI and display on Axis?
I need to load image dynamically.
Plz help me.
  1 comentario
Nicholus
Nicholus el 2 de Jul. de 2014
If you mean loading an image on matlab gui, just follow these simple steps. 1. copy and paste the image to the matlab directory, check it on top of your matlab desktop.(C:\MATLAB7\work\New Folder) located on top middle of matlab desktop.
2 run this command; A = imread ('file mame.jpg'); imshow(A)
Good luck!
The image will be displayed. Note, file name has extension of class, say jpg, tif etc.

Iniciar sesión para comentar.

Respuesta aceptada

Brandon Armstrong
Brandon Armstrong el 5 de Jun. de 2012
Make sure you make the axes active and then you can use the 'image' or 'imagesc' command. For example, I have a gui where depending on the the value of the slider, I update an image plot. The relevant code looks like:
usrvar = handles.zdata;
axes(handles.imageplot);
imagesc(handles.xdata, handles.ydata,usrvar);
'imageplot' is the tag of the axes in my gui, zdata is what I generate based on user values and is a 2D matrix,. xdata and ydata are usually just the indices of the matrix and aren't necessary.
See the help on 'image' about color maps and grid lines and other options you may or may not want.

Más respuestas (4)

Wasim Akhlaq
Wasim Akhlaq el 5 de Jun. de 2012
You can load an image in GUI MATLAB. see the help 'axes' and 'set' commands in matlab. I hope this will help you.

Sean de Wolski
Sean de Wolski el 5 de Jun. de 2012
Some of these will help.

Image Analyst
Image Analyst el 5 de Jun. de 2012

Amal
Amal el 13 de Nov. de 2022
Code to upload an image using the GUI interface in Matlab?
  1 comentario
Image Analyst
Image Analyst el 13 de Nov. de 2022
What about it? If you have code to offer people, then you can upload it to the File Exchange.
If you have any more questions, then attach your data and code to read it in with the paperclip icon after you read this:
I upload my images using copyfile because I have the servers I need mapped to drive letters in Windows. You might be able to upload using a URL if you have permission to write to that location.
Be specific in what you want with your questions, otherwise you'll get no answers.

Iniciar sesión para comentar.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by