How to get jpeg/png image for processing thanks to GUI?
1 visualización (últimos 30 días)
Mostrar comentarios más antiguos
Well I need to browse my folder, get an image (basically .jped or .png) and then processing that image (filter, segmentation etc). I already create my GUI

but my problem is how to get this image in my main code. Let's explain better.
I have this callback function:

and then on my main i just have I = browse; ---> Where browse is the name for this GUI but I don't get my image and then I can't process it, so how can I do? I'd like to obtain something like that on my workspace:

Thanks for any help :)
3 comentarios
Respuestas (2)
Image Analyst
el 17 de Dic. de 2017
See the FAQ: http://matlab.wikia.com/wiki/FAQ#How_can_I_share_data_between_callback_functions_in_my_GUI.28s.29.3F
If you just need to get the image out of an axes in a callback, you can use getimage().
0 comentarios
Jan
el 17 de Dic. de 2017
What is "my main" and "my workspace"? Remember, that each function has its own workspace.
You can use e.g. guidata to store a value in the figure (to be exact in the struct called "handles", when you use GUIDE). This can be used to share data between callbacks. It is recommended, not to create a variable ion the base workspace or in another function, because this remote creation of variables is hard to debug and prone to bugs. Prefer to process all data inside the GUI by using callbacks, e.g. a "Process" button. You know this behavior from almost all other programs running on your computer.
Maybe you want the GUI just to be a kind of "open file dialog" called from a main program. Then use an output from the dialog: https://blogs.mathworks.com/videos/2010/02/12/advanced-getting-an-output-from-a-guide-gui/. You can find such links asking your favorite internet search engine for "Matlab GUIDE output".
0 comentarios
Ver también
Categorías
Más información sobre Convert Image Type en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!