Info
Diese Frage ist geschlossen. Öffnen Sie sie erneut, um sie zu bearbeiten oder zu beantworten.
How can I use pushbuttons in GUI to categorize a "like" or "dislike" of a image
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
I've been stuck on this problem and can't seem to find the right kind of tutorials online that would point me in the right direction.
My goal is to use a GUI that has two pushbuttons, a "like" and a "dislike" pushbutton.
I add the folder with all the images to my path so when my gui opens, the first image automatically pops up. Then I hit "like" or "dislike", and that information is saved as a logical corresponding to the image title in a structural array.
I've spent several hours working on creating practice GUI's that do other things to understand how everything works together, but I'm feeling in over my head maybe? Does anyone have any idea's, hints, or resources that they have in mind?
1 Kommentar
Antworten (1)
Gareth
am 15 Dez. 2018
Here is a very simple away around this... in the directory where you have the images try the following code:
im = imageDatastore(pwd); % creates imageDataStore with all the images
for i = 1:size(im.Files) % goes through each File
imshow(im.readimage(i)); % displays it)
answer = questdlg('Like/Dislike', ...
'Do you like', ...
'Like','Dislike','Like'); % prompts user for their opinion
mydata(i).file = im.Files(i);
% Handle response
switch answer
case 'Like'
mydata(i).like = 1;
case 'Dislike'
mydata(i).like = 0;
end
end
close all
0 Kommentare
Diese Frage ist geschlossen.
Siehe auch
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!