Info

La pregunta está cerrada. Vuélvala a abrir para editarla o responderla.

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

1 visualización (últimos 30 días)
Rachel Larsen
Rachel Larsen el 14 de Dic. de 2018
Cerrada: MATLAB Answer Bot el 20 de Ag. de 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?

Respuestas (1)

GT
GT el 15 de Dic. de 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

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by