C# Class OpenCvSharp.HOGDescriptor

HOG (Histogram-of-Oriented-Gradients) Descriptor and Object Detector
Inheritance: OpenCvSharp.DisposableCvObject
Afficher le fichier Open project: shimat/opencvsharp Class Usage Examples

Méthodes publiques

Свойство Type Description
DaimlerPeopleDetector float[]
DefaultPeopleDetector float[]
SizeOf int

Méthodes publiques

Méthode Description
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

Méthodes protégées

Méthode Description
Dispose ( bool disposing ) : void

Clean up any resources being used.

Method Details

CheckDetectorSize() public méthode

public CheckDetectorSize ( ) : bool
Résultat bool

Compute() public méthode

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
Résultat float[]

ComputeGradient() public méthode

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
Résultat void

Detect() public méthode

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
Résultat System.Point[]

Detect() public méthode

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
Résultat System.Point[]

DetectMultiScale() public méthode

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.
Résultat Rect[]

DetectMultiScale() public méthode

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.
Résultat Rect[]

DetectMultiScaleROI() public méthode

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
Résultat void

DetectROI() public méthode

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
Résultat void

Dispose() protected méthode

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. ///
Résultat void

GetDaimlerPeopleDetector() public static méthode

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[]
Résultat float[]

GetDefaultPeopleDetector() public static méthode

Returns coefficients of the classifier trained for people detection (for default window size).
public static GetDefaultPeopleDetector ( ) : float[]
Résultat float[]

GetDescriptorSize() public méthode

public GetDescriptorSize ( ) : int
Résultat int

GetWinSigma() public méthode

public GetWinSigma ( ) : double
Résultat double

GroupRectangles() public méthode

public GroupRectangles ( Rect &rectList, double &weights, int groupThreshold, double eps ) : void
rectList Rect
weights double
groupThreshold int
eps double
Résultat void

HOGDescriptor() public méthode

Default constructor
public HOGDescriptor ( ) : System
Résultat System

HOGDescriptor() public méthode

Initializes from pointer
public HOGDescriptor ( IntPtr ptr ) : System
ptr System.IntPtr class HOGDescriptor*
Résultat System

HOGDescriptor() public méthode

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.
Résultat System

HOGDescriptor() public méthode

public HOGDescriptor ( string fileName ) : System
fileName string
Résultat System

Load() public méthode

public Load ( string fileName, string objName = null ) : bool
fileName string
objName string
Résultat bool

ReadALTModel() public méthode

read/parse Dalal's alt model file
public ReadALTModel ( string modelFile ) : void
modelFile string
Résultat void

Save() public méthode

public Save ( string fileName, string objName = null ) : void
fileName string
objName string
Résultat void

SetSVMDetector() public méthode

public SetSVMDetector ( float svmDetector ) : void
svmDetector float
Résultat void

Property Details

DaimlerPeopleDetector public_oe static_oe property

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
Résultat float[]

DefaultPeopleDetector public_oe static_oe property

Returns coefficients of the classifier trained for people detection (for default window size).
public static float[] DefaultPeopleDetector
Résultat float[]

SizeOf public_oe static_oe property

sizeof(HOGDescriptor)
public static int SizeOf
Résultat int