给定人体照片,使用基于HOG算法进行检测,尝试改变检测参数,获得最优结果,并对结果进行分析

本文探讨了如何通过调整HOG算法的detectMultiScale参数来优化人体检测。通过移除padding并改变scale值,提高了检测准确性。实验表明,去除不必要的padding能减少误检,而适当增大scale能避免检测到过多的腿部区域,从而得到更精确的检测结果。
摘要由CSDN通过智能技术生成

给定人体照片,使用基于HOG算法进行检测,尝试改变检测参数,获得最优结果,并对结果进行分析

#!/usr/bin/env python
'''
example to detect upright people in images using HOG features
Usage:
    peopledetect.py <image_names>
Press any key to continue, ESC to stop.
'''
# Python 2/3 compatibility
from __future__ import print_function
import numpy as np
import cv2 as cv
def inside(r, q):
    rx, ry, rw, rh = r
    qx, qy, qw, qh = q
    return rx > qx and ry > qy and rx + rw < qx + qw and ry + rh < qy + qh
def draw_detections(img, rects, thickness=1):
    for x, y, w, h in rects:
        # the HOG detector returns slightly larger rectangles than the real objects.
        # so
  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值