dirt=fullfile('..\vtest\');%prth to sample folder
addpath(dirt);
imagefiles=dir(strcat(dirt,'*.jpg')); j=0;
for ii=1:length(imagefiles)
    i=imread(strcat(dirt,imagefiles(ii).name));
    img=i;
    imshow(img);title(i)
    h = imrect(gca);
    setResizable(h,1)
    position = wait(h)
    testdata(ii+j).img =i;
    testdata(ii+j).pos=position;
    testdata(ii+j).type='van';
    ii
end
j=ii