how can i take ginput from an image until close the figure and after closing figure how can start next image from folder
5 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
clear all
close all
% h = imshow('1.jpg');
% hp = impixelinfo;
% set(hp,'Position',[5 1 300 20]);
% pixel=[];
% for i=1:10
% [x,y]=ginput(1)
% pixel(i,:)=[x,y];
% end
%%
%DATASET
pixel=[];
folder{1}='D:\MathLab Works\Calltech\Database\Buddha\';
%%
nClass = size(folder,3);
class=0;
k=0;
for clNo = 1:nClass
folderName=folder{clNo};
fnames = dir(strcat(folderName,'*.jpg'));
label=0;
class=class+1;
for imgNo = 1:round(length(fnames))
fname = fnames(imgNo).name
fullpath = strcat(folderName,fname);
img = imread(fullpath);
% f = imagesc; %Some Figure
f=figure
imshow(img);
while size(findobj(f))>0
% 'me' %some action
label=label+1;
hold on
hp = impixelinfo;
set(hp,'Position',[5 1 300 20]);
for i=1:5
[x,y]=ginput(1)
plot(x,y,'*r')
k=k+1;
pixel(k,:)=[class,label,x,y];
end
% pause %some input
end
end
end
0 commentaires
Réponses (1)
Voir également
Catégories
En savoir plus sur Printing and Saving dans Help Center et File Exchange
Produits
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!