Effacer les filtres
Effacer les filtres

Info

Cette question est clôturée. Rouvrir pour modifier ou répondre.

How can I use pushbuttons in GUI to categorize a "like" or "dislike" of a image

1 vue (au cours des 30 derniers jours)
Rachel Larsen
Rachel Larsen le 14 Déc 2018
Clôturé : MATLAB Answer Bot le 20 Août 2021
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?

Réponses (1)

GT
GT le 15 Déc 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

Cette question est clôturée.

Community Treasure Hunt

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

Start Hunting!

Translated by