Part Based Models demo程序分析

程序主要用了这几个函数:

[dets, boxes] = imgdetect(im, model, 0.4);
bbox = bboxpred_get(model.bboxpred, dets, reduceboxes(model, boxes));
bbox = clipboxes(im, bbox);
top = nms(bbox, 0.5);
result = bbox(top,:);

其中[dets, boxes, info] = imgdetect(input, model, thresh, bbox, overlap)

调用了:gdetect(pyra, model, thresh, bbox, overlap);

pyra为Hog的金字塔特征值,model为模型参数,thresh为分数的阈值。后面两个参数可以不写。

之后我们会得到dets和boxes两个矩阵

代码里面的解释为:

% dets is a matrix with 6 columns and one row per detection.  Columns 1-4 
% give the pixel coordinates (x1,y1,x2,y2) of each detection bounding box.  
% Column 5 specifies the model component used for each detection and column 
% 6 gives the score of each detection.
%
% boxes is a matrix with one row per detection and each sequential group
% of 4 columns specifies the pixel coordinates of each model filter bounding
% box (i.e., where the parts were placed).  The index in the sequence is
% the same as the index in model.filters.

我的理解为dets为root filter检测的结果,boxes为part filter检测的结果

是root filter的检测结果其实已经不错了(就是hog的检查结果)

bboxpred_get用来得到预测的结果,我觉得更像是一个检测结果融合

clipboxes用来优化窗体结构,不影响结果

nms用来去除重叠的检测窗口

其实我觉得程序可以简化成这样:

[dets, boxes] = imgdetect(im, model, 0.4);
bbox = clipboxes(im, dets);
top = nms(bbox, 0.5);
result = bbox(top,:);
不过这样就没用用到parts model的意思了

完全就是hog检测了。没有意义了。自娱自乐写就好。

最后用:

showboxes(im, dets);
来显示检测的结果。

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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值