用matlab生成样本

(1)生成正样本

%% 读取文件夹是需要提取样本的视频采集图片,里面的1.txt是人工标出的目标坐标

%格式如下:

img_1.jpg 2 4 527 215 524 238 535 238 537 215 4 575 218 571 238 581 238 580 218
img_2.jpg 2 4 535 217 532 236 543 237 543 218 4 486 216 483 238 496 238 497 219
img_3.jpg 2 4 496 218 494 236 506 237 503 217 4 446 217 443 241 459 240 455 219
img_4.jpg 2 4 458 218 455 238 462 239 465 219 4 411 219 405 238 417 236 417 216
img_5.jpg 2 4 420 219 421 241 430 238 428 218 4 370 219 368 241 379 241 379 219
img_6.jpg 2 4 381 216 379 236 391 236 388 217 4 329 220 329 242 342 240 340 219
img_7.jpg 2 4 340 217 340 240 354 239 351 217 4 297 220 294 239 307 241 306 223
img_8.jpg 2 4 305 217 305 238 318 239 314 219 4 281 226 277 248 290 247 290 227
img_9.jpg 1 4 275 229 272 252 283 253 286 230

……

%%下面是生成正样本

strPath = 'D:\program\matlab projects\traffic collection\20120905\11\';
strNegPath = 'D:\program\matlab projects\traffic collection\20120905\pos_vehicle\pos_vehicle_11\';

fid=fopen([strPath,'detectionGt.txt']);
if fid<=0
    disp('cannot open the file');
    return;
end

 fid2=fopen('D:\program\matlab projects\traffic collection\20120905\pos_vehicle\pos_vehicle_11\info.txt','w+');
 if fid2<=0
     disp('cannot write the file');
     return;
 end
numNeg = 0;

for i=1:1000
    a= fscanf(fid,'%s

  • 1
    点赞
  • 10
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值