Table of Contents

Method DetectMultiScale

Namespace
OpenCvSharp
Assembly
OpenCvSharp.dll

DetectMultiScale(Mat, double, int, HaarDetectionTypes, Size?, Size?)

Detects objects of different sizes in the input image. The detected objects are returned as a list of rectangles.

public virtual Rect[] DetectMultiScale(Mat image, double scaleFactor = 1.1, int minNeighbors = 3, HaarDetectionTypes flags = (HaarDetectionTypes)0, Size? minSize = null, Size? maxSize = null)

Parameters

image Mat

Matrix of the type CV_8U containing an image where objects are detected.

scaleFactor double

Parameter specifying how much the image size is reduced at each image scale.

minNeighbors int

Parameter specifying how many neighbors each candidate rectangle should have to retain it.

flags HaarDetectionTypes

Parameter with the same meaning for an old cascade as in the function cvHaarDetectObjects. It is not used for a new cascade.

minSize Size?

Minimum possible object size. Objects smaller than that are ignored.

maxSize Size?

Maximum possible object size. Objects larger than that are ignored.

Returns

Rect[]

Vector of rectangles where each rectangle contains the detected object.

DetectMultiScale(Mat, out int[], out double[], double, int, HaarDetectionTypes, Size?, Size?, bool)

Detects objects of different sizes in the input image. The detected objects are returned as a list of rectangles.

public virtual Rect[] DetectMultiScale(Mat image, out int[] rejectLevels, out double[] levelWeights, double scaleFactor = 1.1, int minNeighbors = 3, HaarDetectionTypes flags = (HaarDetectionTypes)0, Size? minSize = null, Size? maxSize = null, bool outputRejectLevels = false)

Parameters

image Mat

Matrix of the type CV_8U containing an image where objects are detected.

rejectLevels int[]
levelWeights double[]
scaleFactor double

Parameter specifying how much the image size is reduced at each image scale.

minNeighbors int

Parameter specifying how many neighbors each candidate rectangle should have to retain it.

flags HaarDetectionTypes

Parameter with the same meaning for an old cascade as in the function cvHaarDetectObjects. It is not used for a new cascade.

minSize Size?

Minimum possible object size. Objects smaller than that are ignored.

maxSize Size?

Maximum possible object size. Objects larger than that are ignored.

outputRejectLevels bool

Returns

Rect[]

Vector of rectangles where each rectangle contains the detected object.