首先我们进入HOGDescriptor所在的头文件,看看它的构造函数需要哪些参数。
- cellSize(8,8), nbins(9), derivAperture(1), winSigma(-1),
- histogramNormType(HOGDescriptor::L2Hys), L2HysThreshold(0.2), gammaCorrection(true),
- nlevels(HOGDescriptor::DEFAULT_NLEVELS)
- {}
- CV_WRAP HOGDescriptor(
- Size _winSize, 窗口大小
- Size _blockSize, 块大小
- Size _blockStride, 滑动增量
- Size _cellSize, 单元大小
- int _nbins, 方向
- int _derivAperture=1, 1
- double _winSigma=-1, -1
- int _histogramNormType=HOGDescriptor::L2Hys, HogDes::L2Hys
- double _L2HysThreshold=0.2, 0.2
- bool _gammaCorrection=false, true
- int _nlevels=HOGDescriptor::DEFAULT_NLEVELS)
- : winSize(_winSize), blockSize(_blockSize), blockStride(_blockStride), cellSize(_cellSize),
- nbins(_nbins), derivAperture(_derivAperture), winSigma(_winSigma),
- histogramNormType(_histogramNormType), L2HysThreshold(_L2HysThreshold),
- gammaCorrection(_gammaCorrection), nlevels(_nlevels)
- {}
- CV_WRAP HOGDescriptor(const String& filename)
- {
- load(filename);
- }
- HOGDescriptor(const HOGDescriptor& d)
- {
- d.copyTo(*this);
- }
我们看到HOGDescriptor一共有4个构造函数,前三个有CV_WRAP前缀,表示它们是从DLL里导出的函数,即我们在程序当中可以调用的函数;最后一个没有上述的前缀,所以我们暂时用不到,它其实就是一个拷贝构造函数。