Table of Contents

Class HOGDescriptor

Namespace
Emgu.CV
Assembly
Emgu.CV.dll

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 Size

Detection 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 Size

Block size in cells. Use (16, 16) for default.

blockStride Size

Block stride. Must be a multiple of cell size. Use (8,8) for default.

cellSize Size

Cell size. Use (8, 8) for default.

nbins int

Number of bins.

derivAperture int

Deriv Aperture

winSigma double

Gaussian smoothing window parameter.

L2HysThreshold double

L2-Hys normalization method shrinkage.

gammaCorrection bool

Do gamma correction preprocessing or not.

Properties

DescriptorSize

Get the size of the descriptor

public uint DescriptorSize { get; }

Property Value

uint

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 IInputArray

The image

winStride Size

Window stride. Must be a multiple of block stride. Use Size.Empty for default

padding Size

Padding. 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 IInputArray

The image to search in

hitThreshold double

Threshold 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 Size

Window stride. Must be a multiple of block stride.

padding Size

Padding

scale double

Coefficient of the detection window increase.

finalThreshold double

After 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 bool

If 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