Cascade Filter

Block Category: Matching

Input Image Format

Input Image Requirements: None

Description: The Cascade Filter block performs object detection using Haar Cascade Classifiers. These cascade classifiers are used primarily for facial recognition and detection. For more information about Haar Cascade, see Face Detection with Haar Cascades.

The Cascade Filter block lets you select a cascade of classifiers to narrow down object detection and remove false positive detections from the results. For each subsequent classifier in the cascade, a more computationally intensive algorithm is used until the desired object is not found, and any remaining classifier is not used.

Cascade Classifiers: Indicates the XML files containing feature sets used to detect those features in the input image. When multiple classifiers are listed, the Cascade Filter block applies the classifiers in sequential order, and stops when the current classifier does not find any matches.

Increase the Contrast of the Image Prior Object Detection: Increases the contrast of the image.

Object Detection Parameters

Maximum Possible Object Size: Indicates that objects larger than the specified values are ignored.

Minimum Possible Object Size: Indicates that objects smaller than the specified values are ignored.

Neighbors: Specifies how many neighbors each candidate should have to retain it.

Scale Factor: Specifies how much the image size is reduced.

Example

In this example, the HaarsCascade_FrontalFace.XML classifier file is used to detect faces. The Draw Rectangle block draws boxes around the detected faces.

CascadeFilterExample

A second XML file for eye detection is then swept over the facial recognition region.

CascadeFilterExample2