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 pixelspixels The pixels in a linear [r,g,b,a,...] array. widthnumber The image width. heightnumber The image height. initialScalenumber The initial scale to start the block scaling. scaleFactornumber The scale factor to scale the feature block. stepSizenumber The block step size. edgesDensitynumber 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. datanumber 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 edgesDensitynumber Percentage density edges inside the classifier block. integralImageSobelarray The integral image of a sobel image. inumber Vertical position of the pixel to be evaluated. jnumber Horizontal position of the pixel to be evaluated. widthnumber The image width. - Source:
Returns:
True whether the block at position i,j can be skipped, false otherwise.- Type
- boolean