new ViolaJones()
ViolaJones utility.
- Source:
Members
-
<static> classifiers :array
-
Holds the HAAR cascade classifiers converted from OpenCV training.
Type:
- array
- Source:
-
<static> REGIONS_OVERLAP :number
-
Holds the minimum area of intersection that defines when a rectangle is from the same group. Often when a face is matched multiple rectangles are classified as possible rectangles to represent the face, when they intersects they are grouped as one face.
Type:
- number
- Default Value:
- 0.5
- Source:
Methods
-
<static> detect(pixels, width, height, initialScale, scaleFactor, stepSize, edgesDensity, data) → {array}
-
Detects through the HAAR cascade data rectangles matches.
Parameters:
Name Type Description pixels
pixels The pixels in a linear [r,g,b,a,...] array. width
number The image width. height
number The image height. initialScale
number The initial scale to start the block scaling. scaleFactor
number The scale factor to scale the feature block. stepSize
number The block step size. edgesDensity
number Percentage density edges inside the classifier block. Value from [0.0, 1.0], defaults to 0.2. If specified edge detection will be applied to the image to prune dead areas of the image, this can improve significantly performance. data
number The HAAR cascade data. - Source:
Returns:
Found rectangles.- Type
- array
-
<protected, static> isTriviallyExcluded(edgesDensity, integralImageSobel, i, j, width) → {boolean}
-
Fast check to test whether the edges density inside the block is greater than a threshold, if true it tests the stages. This can improve significantly performance.
Parameters:
Name Type Description edgesDensity
number Percentage density edges inside the classifier block. integralImageSobel
array The integral image of a sobel image. i
number Vertical position of the pixel to be evaluated. j
number Horizontal position of the pixel to be evaluated. width
number The image width. - Source:
Returns:
True whether the block at position i,j can be skipped, false otherwise.- Type
- boolean