yolo检测结果数据整理

fid = fopen('output.txt','r');
bb = textscan(fid,'%s');
fclose(fid);
T=zeros(1163,8);
%disp(bb{1,1}{10,1});
%[x,y]=find(strcmp(bb{1,1}, 'FPS:0.0'));  
%disp(x(:,2));
aa=strfind(bb{1,1},'left=');
cc=strfind(bb{1,1},'FPS:0.0');
dd=strfind(bb{1,1},'Objects:');
%disp(aa{17,1});
j1=0;
for i=1:9670
    if aa{i,1}==1
        j1=j1+1;
    end
end
%disp(j1);
j2=0;
for k=1:9670
    if (dd{k,1}==1)&(cc{k+1,1}==1)
        j2=j2+1;
    end
end
%disp(j2);
num=0;
boxnum=0; 
box=0;
%num1=0;
for kk=1:9670
    if(cc{kk,1}==1)   
        boxnum=boxnum+box;
        if(box==0)
            boxnum=boxnum+1;
        end
            box=0;
            num=num+1;
            T(boxnum,1)=num;   
            T(boxnum,2)=box; 
    end 
        if(aa{kk,1}==1)     
            T(boxnum+box,1)=num;
            T(boxnum+box,2)=box+1;
            T(boxnum+box,3)=str2num(cell2mat(regexp(bb{1,1}{kk+4,1},pat,'match')));
            pat='\w*(?=,)';
            %str2num(cell2mat(regexp(bb{1,1}{kk+4,1},pat,'match')))
            T(boxnum+box,4)=str2double(strrep(bb{1,1}{kk-1,1},'%',''))/100;
            %class(bb{1,1}{kk-1,1});
            %disp(str2double(strrep(bb{1,1}{kk-1,1},'%',''))/100);
            T(boxnum+box,5)=str2num(cell2mat(regexp(bb{1,1}{kk,1},pat,'match')));
            T(boxnum+box,6)=str2num(cell2mat(regexp(bb{1,1}{kk+1,1},pat,'match')));
            T(boxnum+box,7)=str2num(cell2mat(regexp(bb{1,1}{kk+2,1},pat,'match')));
            T(boxnum+box,8)=str2num(cell2mat(regexp(bb{1,1}{kk+3,1},pat,'match')));
            box=box+1;
        end
        %disp(num);
end    
%cell2mat(bb{1,1});
%[x(:,1),y]=find(strcmp(bb{1,1}, 'FPS:0.0'));  
%[x(:,2),y]=find(strcmp(bb{1,1}, 'Objects:'));
%[x(:,3),y]=find(strcmp(bb{1,1}, 'tvmonitor:'));


评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值