Class HOGDescriptor
A HOG descriptor
public class HOGDescriptor : UnmanagedObject, IDisposable
- Inheritance
-
HOGDescriptor
- Implements
- Inherited Members
Constructors
HOGDescriptor()
Create a new HOGDescriptor
public HOGDescriptor()
HOGDescriptor(Size, Size, Size, Size, int, int, double, double, bool)
Create a new HOGDescriptor using the specific parameters.
public HOGDescriptor(Size winSize, Size blockSize, Size blockStride, Size cellSize, int nbins = 9, int derivAperture = 1, double winSigma = -1, double L2HysThreshold = 0.2, bool gammaCorrection = true)
Parameters
winSize
SizeDetection window size. Must be aligned to block size and block stride. Must match the size of the training image. Use (64, 128) for default.
blockSize
SizeBlock size in cells. Use (16, 16) for default.
blockStride
SizeBlock stride. Must be a multiple of cell size. Use (8,8) for default.
cellSize
SizeCell size. Use (8, 8) for default.
nbins
intNumber of bins.
derivAperture
intDeriv Aperture
winSigma
doubleGaussian smoothing window parameter.
L2HysThreshold
doubleL2-Hys normalization method shrinkage.
gammaCorrection
boolDo gamma correction preprocessing or not.
Properties
DescriptorSize
Get the size of the descriptor
public uint DescriptorSize { get; }
Property Value
Methods
Compute(IInputArray, Size, Size, Point[])
Computes HOG descriptors of given image.
public float[] Compute(IInputArray image, Size winStride = default, Size padding = default, Point[] locations = null)
Parameters
image
IInputArrayThe image
winStride
SizeWindow stride. Must be a multiple of block stride. Use Size.Empty for default
padding
SizePadding. Use Size.Empty for default
locations
Point[]Locations for the computation. Can be null if not needed
Returns
- float[]
The descriptor vector
DetectMultiScale(IInputArray, double, Size, Size, double, double, bool)
Performs object detection with increasing detection window.
public MCvObjectDetection[] DetectMultiScale(IInputArray image, double hitThreshold = 0, Size winStride = default, Size padding = default, double scale = 1.05, double finalThreshold = 2, bool useMeanshiftGrouping = false)
Parameters
image
IInputArrayThe image to search in
hitThreshold
doubleThreshold for the distance between features and SVM classifying plane. Usually it is 0 and should be specified in the detector coefficients (as the last free coefficient). But if the free coefficient is omitted (which is allowed), you can specify it manually here.
winStride
SizeWindow stride. Must be a multiple of block stride.
padding
SizePadding
scale
doubleCoefficient of the detection window increase.
finalThreshold
doubleAfter detection some objects could be covered by many rectangles. This coefficient regulates similarity threshold. 0 means don't perform grouping. Should be an integer if not using meanshift grouping.
useMeanshiftGrouping
boolIf true, it will use meanshift grouping.
Returns
- MCvObjectDetection[]
The regions where positives are found
DisposeObject()
Release the unmanaged memory associated with this HOGDescriptor
protected override void DisposeObject()
GetDefaultPeopleDetector()
Return the default people detector
public static float[] GetDefaultPeopleDetector()
Returns
- float[]
The default people detector
SetSVMDetector(float[])
Set the SVM detector
public void SetSVMDetector(float[] detector)
Parameters
detector
float[]The SVM detector