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)
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

Réponses (1)

Image Analyst
Image Analyst le 30 Juil 2020

Catégories

En savoir plus sur Printing and Saving dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by