Effacer les filtres
Effacer les filtres

Loading an image using a GUI in matlab

4 vues (au cours des 30 derniers jours)
sichangi
sichangi le 25 Mar 2011
currently, i am involved in a project whose purpose is to extract characters from a water meter image just like its done in OCR. I am using matlab. I have created a GUI using Guide, and i would like to load an image of a water meter into it and then process it in such a way that i extract the characters and save them in a word readable and editable form. I have used the uigetfile function but all it does is to open the directory where the images are but to get the image into a work space within the gui is problematic, please help

Réponse acceptée

Jarrod Rivituso
Jarrod Rivituso le 25 Mar 2011
When using GUIDE, the process for this is typically as follows.
1. In a callback, use uigetfile to grab file name and then load the data.
2. Add the data to the handles structure.
>> myData = imread('...')
>> handles.myData = myData;
3. Update the GUI's version of the handles structure using guidata.
>> guidata(hObject, handles)
4. Then, in subsequent callbacks, the data can be accessed in the handles structure:
>> image(handles.myData)
More info on guidata can be found here
There are other ways as well, but this approach is very common when using GUIDE. Hope this helps!

Plus de réponses (0)

Catégories

En savoir plus sur Programming dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by