HOGDescriptor
OpenCV提供了HOGDescriptor函数用于特征提取, 常常被用于做物体检测.
其参数如下.
| 参数 | 含义 |
|---|---|
| _winSize | sets winSize with given value. |
| _blockSize | sets blockSize with given value. |
| _blockStride | sets blockStride with given value. |
| _cellSize | sets cellSize with given value. |
| _nbins | sets nbins with given value. |
| _derivAperture | sets derivAperture with given value. |
| _winSigma | sets winSigma with given value. |
| _histogramNormType | sets histogramNormType with given value. |
| _L2HysThreshold | sets L2HysThreshold with given value. |
| _gammaCorrection | sets gammaCorrection with given value. |
| _nlevels | sets nlevels with given value. |
| _signedGradient | sets signedGradient with given value. |
默认参数值为
1 | winSize(64,128), blockSize(16,16), blockStride(8,8), cellSize(8,8), nbins(9), derivAperture(1), winSigma(-1), histogramNormType(HOGDescriptor::L2Hys), L2HysThreshold(0.2), gammaCorrection(true), nlevels(HOGDescriptor::DEFAULT_NLEVELS) |
视频人体检测代码
1 | #!/usr/local/bin/python |
运行结果
视频人体检测
实时获取摄像头采集的图像并进行人体检测,效果如下.

发现该程序能够较为准确地检测人体.