HaarCascade Class |
Namespace: Accord.Vision.Detection
The HaarCascade type exposes the following members.
Name | Description | |
---|---|---|
HaarCascade(Int32, Int32) |
Constructs a new Haar Cascade.
| |
HaarCascade(Int32, Int32, HaarCascadeStage) |
Constructs a new Haar Cascade.
|
Name | Description | |
---|---|---|
HasTiltedFeatures |
Gets a value indicating whether this cascade has tilted features.
| |
Height |
Gets the stages' base height.
| |
Stages |
Gets the classification stages.
| |
Width |
Gets the stages' base width.
|
Name | Description | |
---|---|---|
Clone |
Creates a new object that is a copy of the current instance.
| |
Equals | Determines whether the specified object is equal to the current object. (Inherited from Object.) | |
Finalize | Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (Inherited from Object.) | |
FromXml(Stream) |
Loads a HaarCascade from a OpenCV-compatible XML file.
| |
FromXml(TextReader) |
Loads a HaarCascade from a OpenCV-compatible XML file.
| |
FromXml(String) |
Loads a HaarCascade from a OpenCV-compatible XML file.
| |
GetHashCode | Serves as the default hash function. (Inherited from Object.) | |
GetType | Gets the Type of the current instance. (Inherited from Object.) | |
MemberwiseClone | Creates a shallow copy of the current Object. (Inherited from Object.) | |
ToCode(TextWriter, String) |
Saves a HaarCascade to C# code.
| |
ToCode(String, String) |
Saves a HaarCascade to C# code.
| |
ToString | Returns a string that represents the current object. (Inherited from Object.) |
Name | Description | |
---|---|---|
HasMethod |
Checks whether an object implements a method with the given name.
(Defined by ExtensionMethods.) | |
IsEqual |
Compares two objects for equality, performing an elementwise
comparison if the elements are vectors or matrices.
(Defined by Matrix.) | |
To(Type) | Overloaded.
Converts an object into another type, irrespective of whether
the conversion can be done at compile time or not. This can be
used to convert generic types to numeric types during runtime.
(Defined by ExtensionMethods.) | |
ToT | Overloaded.
Converts an object into another type, irrespective of whether
the conversion can be done at compile time or not. This can be
used to convert generic types to numeric types during runtime.
(Defined by ExtensionMethods.) |
The Viola-Jones object detection framework is the first object detection framework to provide competitive object detection rates in real-time proposed in 2001 by Paul Viola and Michael Jones. Although it can be trained to detect a variety of object classes, it was motivated primarily by the problem of face detection.
The implementation of this code has used Viola and Jones' original publication, the OpenCV Library and the Marilena Project as reference. OpenCV is released under a BSD license, it is free for both academic and commercial use. Please be aware that some particular versions of the Haar object detection framework are patented by Viola and Jones and may be subject to restrictions for use in commercial applications.
References:
To load an OpenCV-compatible XML definition for a Haar cascade, you can use HaarCascade's FromXml static method. An example would be:
String path = @"C:\Users\haarcascade-frontalface_alt2.xml";
HaarCascade cascade1 = HaarCascade.FromXml(path);
After the cascade has been loaded, it is possible to create a new HaarObjectDetector using the cascade. Please see HaarObjectDetector for more details. It is also possible to generate embeddable C# definitions from a cascade, avoiding the need to load XML files on program startup. Please see ToCode(String, String) method or HaarCascadeWriter class for details.