1. 程式人生 > >根據ground truth在原圖中分割子圖

根據ground truth在原圖中分割子圖

true temp pri round %0 tlab matlab clas int

base_path = ‘D:\image\people‘;
bb = importdata(‘output.txt‘);
output_img = cell(99);
for i = 1:100%length(temp_img)
    nz	= strcat(‘%0‘,num2str(4),‘d‘);
    temp_id = sprintf(nz,i);
    id = strcat(temp_id,‘.jpg‘);
    img_path = fullfile(base_path,id);
    temp_img = imread(img_path);
    output_img = temp_img(bb.data(i,2):bb.data(i,4),bb.data(i,1):bb.data(i,3),:);
    filename = strcat(‘D:\image\output\‘,temp_id,‘.jpg‘);
    imwrite(output_img,filename);
end

  

根據ground truth在原圖中分割子圖