Info
이 질문은 마감되었습니다. 편집하거나 답변을 올리려면 질문을 다시 여십시오.
How can I use pushbuttons in GUI to categorize a "like" or "dislike" of a image
조회 수: 3 (최근 30일)
이전 댓글 표시
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
답변 (1개)
Gareth
2018년 12월 15일
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
이 질문은 마감되었습니다.
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!