C# Класс OpenCvSharp.HOGDescriptor

HOG (Histogram-of-Oriented-Gradients) Descriptor and Object Detector
Наследование: OpenCvSharp.DisposableCvObject
Показать файл Открыть проект Примеры использования класса

Открытые свойства

Свойство Тип Описание
DaimlerPeopleDetector float[]
DefaultPeopleDetector float[]
SizeOf int

Открытые методы

Метод Описание
CheckDetectorSize ( ) : bool

Compute ( OpenCvSharp.Mat img, Size winStride = null, Size padding = null, System.Point locations = null ) : float[]

ComputeGradient ( OpenCvSharp.Mat img, OpenCvSharp.Mat grad, OpenCvSharp.Mat angleOfs, Size paddingTL = null, Size paddingBR = null ) : void

Detect ( OpenCvSharp.Mat img, double hitThreshold, Size winStride = null, Size padding = null, System.Point searchLocations = null ) : System.Point[]

Performs object detection without a multi-scale window.

Detect ( OpenCvSharp.Mat img, double &weights, double hitThreshold, Size winStride = null, Size padding = null, System.Point searchLocations = null ) : System.Point[]

Performs object detection without a multi-scale window.

DetectMultiScale ( OpenCvSharp.Mat img, double hitThreshold, Size winStride = null, Size padding = null, double scale = 1.05, int groupThreshold = 2 ) : Rect[]

Performs object detection with a multi-scale window.

DetectMultiScale ( OpenCvSharp.Mat img, double &foundWeights, double hitThreshold, Size winStride = null, Size padding = null, double scale = 1.05, int groupThreshold = 2 ) : Rect[]

Performs object detection with a multi-scale window.

DetectMultiScaleROI ( OpenCvSharp.Mat img, Rect &foundLocations, DetectionROI &locations, double hitThreshold, int groupThreshold ) : void

evaluate specified ROI and return confidence value for each location in multiple scales

DetectROI ( OpenCvSharp.Mat img, System.Point locations, System.Point &foundLocations, double &confidences, double hitThreshold, Size winStride = null, Size padding = null ) : void

evaluate specified ROI and return confidence value for each location

GetDaimlerPeopleDetector ( ) : float[]

This method returns 1981 SVM coeffs obtained from daimler's base. To use these coeffs the detection window size should be (48,96)

GetDefaultPeopleDetector ( ) : float[]

Returns coefficients of the classifier trained for people detection (for default window size).

GetDescriptorSize ( ) : int

GetWinSigma ( ) : double

GroupRectangles ( Rect &rectList, double &weights, int groupThreshold, double eps ) : void

HOGDescriptor ( ) : System

Default constructor

HOGDescriptor ( IntPtr ptr ) : System

Initializes from pointer

HOGDescriptor ( Size winSize = null, Size blockSize = null, Size blockStride = null, Size cellSize = null, int nbins = 9, int derivAperture = 1, double winSigma = -1, HistogramNormType histogramNormType = HistogramNormType.L2Hys, double l2HysThreshold = 0.2, bool gammaCorrection = true, int nlevels = DefaultNlevels ) : System

Creates the HOG descriptor and detector.

HOGDescriptor ( string fileName ) : System

Load ( string fileName, string objName = null ) : bool

ReadALTModel ( string modelFile ) : void

read/parse Dalal's alt model file

Save ( string fileName, string objName = null ) : void

SetSVMDetector ( float svmDetector ) : void

Защищенные методы

Метод Описание
Dispose ( bool disposing ) : void

Clean up any resources being used.

Описание методов

CheckDetectorSize() публичный Метод

public CheckDetectorSize ( ) : bool
Результат bool

Compute() публичный Метод

public Compute ( OpenCvSharp.Mat img, Size winStride = null, Size padding = null, System.Point locations = null ) : float[]
img OpenCvSharp.Mat
winStride Size
padding Size
locations System.Point
Результат float[]

ComputeGradient() публичный Метод

public ComputeGradient ( OpenCvSharp.Mat img, OpenCvSharp.Mat grad, OpenCvSharp.Mat angleOfs, Size paddingTL = null, Size paddingBR = null ) : void
img OpenCvSharp.Mat
grad OpenCvSharp.Mat
angleOfs OpenCvSharp.Mat
paddingTL Size
paddingBR Size
Результат void

Detect() публичный Метод

Performs object detection without a multi-scale window.
public Detect ( OpenCvSharp.Mat img, double hitThreshold, Size winStride = null, Size padding = null, System.Point searchLocations = null ) : System.Point[]
img OpenCvSharp.Mat Source image. CV_8UC1 and CV_8UC4 types are supported for now.
hitThreshold double Threshold for the distance between features and SVM classifying plane. /// Usually it is 0 and should be specfied 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. It must be a multiple of block stride.
padding Size Mock parameter to keep the CPU interface compatibility. It must be (0,0).
searchLocations System.Point
Результат System.Point[]

Detect() публичный Метод

Performs object detection without a multi-scale window.
public Detect ( OpenCvSharp.Mat img, double &weights, double hitThreshold, Size winStride = null, Size padding = null, System.Point searchLocations = null ) : System.Point[]
img OpenCvSharp.Mat Source image. CV_8UC1 and CV_8UC4 types are supported for now.
weights double
hitThreshold double Threshold for the distance between features and SVM classifying plane. /// Usually it is 0 and should be specfied 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. It must be a multiple of block stride.
padding Size Mock parameter to keep the CPU interface compatibility. It must be (0,0).
searchLocations System.Point
Результат System.Point[]

DetectMultiScale() публичный Метод

Performs object detection with a multi-scale window.
public DetectMultiScale ( OpenCvSharp.Mat img, double hitThreshold, Size winStride = null, Size padding = null, double scale = 1.05, int groupThreshold = 2 ) : Rect[]
img OpenCvSharp.Mat Source image. CV_8UC1 and CV_8UC4 types are supported for now.
hitThreshold double Threshold for the distance between features and SVM classifying plane.
winStride Size Window stride. It must be a multiple of block stride.
padding Size Mock parameter to keep the CPU interface compatibility. It must be (0,0).
scale double Coefficient of the detection window increase.
groupThreshold int Coefficient to regulate the similarity threshold. /// When detected, some objects can be covered by many rectangles. 0 means not to perform grouping.
Результат Rect[]

DetectMultiScale() публичный Метод

Performs object detection with a multi-scale window.
public DetectMultiScale ( OpenCvSharp.Mat img, double &foundWeights, double hitThreshold, Size winStride = null, Size padding = null, double scale = 1.05, int groupThreshold = 2 ) : Rect[]
img OpenCvSharp.Mat Source image. CV_8UC1 and CV_8UC4 types are supported for now.
foundWeights double
hitThreshold double Threshold for the distance between features and SVM classifying plane.
winStride Size Window stride. It must be a multiple of block stride.
padding Size Mock parameter to keep the CPU interface compatibility. It must be (0,0).
scale double Coefficient of the detection window increase.
groupThreshold int Coefficient to regulate the similarity threshold. /// When detected, some objects can be covered by many rectangles. 0 means not to perform grouping.
Результат Rect[]

DetectMultiScaleROI() публичный Метод

evaluate specified ROI and return confidence value for each location in multiple scales
public DetectMultiScaleROI ( OpenCvSharp.Mat img, Rect &foundLocations, DetectionROI &locations, double hitThreshold, int groupThreshold ) : void
img OpenCvSharp.Mat
foundLocations Rect
locations DetectionROI
hitThreshold double
groupThreshold int
Результат void

DetectROI() публичный Метод

evaluate specified ROI and return confidence value for each location
public DetectROI ( OpenCvSharp.Mat img, System.Point locations, System.Point &foundLocations, double &confidences, double hitThreshold, Size winStride = null, Size padding = null ) : void
img OpenCvSharp.Mat
locations System.Point
foundLocations System.Point
confidences double
hitThreshold double
winStride Size
padding Size
Результат void

Dispose() защищенный Метод

Clean up any resources being used.
protected Dispose ( bool disposing ) : void
disposing bool /// If disposing equals true, the method has been called directly or indirectly by a user's code. Managed and unmanaged resources can be disposed. /// If false, the method has been called by the runtime from inside the finalizer and you should not reference other objects. Only unmanaged resources can be disposed. ///
Результат void

GetDaimlerPeopleDetector() публичный статический Метод

This method returns 1981 SVM coeffs obtained from daimler's base. To use these coeffs the detection window size should be (48,96)
public static GetDaimlerPeopleDetector ( ) : float[]
Результат float[]

GetDefaultPeopleDetector() публичный статический Метод

Returns coefficients of the classifier trained for people detection (for default window size).
public static GetDefaultPeopleDetector ( ) : float[]
Результат float[]

GetDescriptorSize() публичный Метод

public GetDescriptorSize ( ) : int
Результат int

GetWinSigma() публичный Метод

public GetWinSigma ( ) : double
Результат double

GroupRectangles() публичный Метод

public GroupRectangles ( Rect &rectList, double &weights, int groupThreshold, double eps ) : void
rectList Rect
weights double
groupThreshold int
eps double
Результат void

HOGDescriptor() публичный Метод

Default constructor
public HOGDescriptor ( ) : System
Результат System

HOGDescriptor() публичный Метод

Initializes from pointer
public HOGDescriptor ( IntPtr ptr ) : System
ptr System.IntPtr class HOGDescriptor*
Результат System

HOGDescriptor() публичный Метод

Creates the HOG descriptor and detector.
public HOGDescriptor ( Size winSize = null, Size blockSize = null, Size blockStride = null, Size cellSize = null, int nbins = 9, int derivAperture = 1, double winSigma = -1, HistogramNormType histogramNormType = HistogramNormType.L2Hys, double l2HysThreshold = 0.2, bool gammaCorrection = true, int nlevels = DefaultNlevels ) : System
winSize Size Detection window size. Align to block size and block stride.
blockSize Size Block size in pixels. Align to cell size. Only (16,16) is supported for now.
blockStride Size Block stride. It must be a multiple of cell size.
cellSize Size Cell size. Only (8, 8) is supported for now.
nbins int Number of bins. Only 9 bins per cell are supported for now.
derivAperture int
winSigma double Gaussian smoothing window parameter.
histogramNormType HistogramNormType
l2HysThreshold double L2-Hys normalization method shrinkage.
gammaCorrection bool Flag to specify whether the gamma correction preprocessing is required or not.
nlevels int Maximum number of detection window increases.
Результат System

HOGDescriptor() публичный Метод

public HOGDescriptor ( string fileName ) : System
fileName string
Результат System

Load() публичный Метод

public Load ( string fileName, string objName = null ) : bool
fileName string
objName string
Результат bool

ReadALTModel() публичный Метод

read/parse Dalal's alt model file
public ReadALTModel ( string modelFile ) : void
modelFile string
Результат void

Save() публичный Метод

public Save ( string fileName, string objName = null ) : void
fileName string
objName string
Результат void

SetSVMDetector() публичный Метод

public SetSVMDetector ( float svmDetector ) : void
svmDetector float
Результат void

Описание свойств

DaimlerPeopleDetector публичное статическое свойство

This field returns 1981 SVM coeffs obtained from daimler's base. To use these coeffs the detection window size should be (48,96)
public static float[] DaimlerPeopleDetector
Результат float[]

DefaultPeopleDetector публичное статическое свойство

Returns coefficients of the classifier trained for people detection (for default window size).
public static float[] DefaultPeopleDetector
Результат float[]

SizeOf публичное статическое свойство

sizeof(HOGDescriptor)
public static int SizeOf
Результат int