View Source Evision.CascadeClassifier (Evision v0.1.8)

Link to this section Summary

cv

Python prototype (for reference):

Loads a classifier from a file.

Positional Arguments

Python prototype (for reference):

Positional Arguments
Positional Arguments
Keyword Arguments
  • scaleFactor: double.
  • minNeighbors: int.
  • flags: int.
  • minSize: Size.
  • maxSize: Size.
  • outputRejectLevels: bool.
Return
  • objects: [Rect]
  • rejectLevels: [int]
  • levelWeights: [double]

Has overloading in C++

Positional Arguments
Keyword Arguments
  • scaleFactor: double.
  • minNeighbors: int.
  • flags: int.
  • minSize: Size.
  • maxSize: Size.
  • outputRejectLevels: bool.
Return
  • objects: [Rect]
  • rejectLevels: [int]
  • levelWeights: [double]

Has overloading in C++

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

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

Checks whether the classifier has been loaded.

Python prototype (for reference):

Python prototype (for reference):

Python prototype (for reference):

Loads a classifier from a file.

Reads a classifier from a FileStorage node.

Link to this section cv

Python prototype (for reference):

CascadeClassifier() -> <CascadeClassifier object>
Link to this function

cascadeClassifier(filename)

View Source

Loads a classifier from a file.

Positional Arguments
  • filename: String.

    Name of the file from which the classifier is loaded.

Python prototype (for reference):

CascadeClassifier(filename) -> <CascadeClassifier object>
Link to this function

convert(oldcascade, newcascade)

View Source
Positional Arguments

Python prototype (for reference):

convert(oldcascade, newcascade) -> retval
Link to this function

detectMultiScale2(self, image)

View Source
Positional Arguments
  • image: Evision.Mat.

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

Keyword Arguments
  • 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: int.

    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. If maxSize == minSize model is evaluated on single scale.

Return
  • objects: [Rect].

    Vector of rectangles where each rectangle contains the detected object, the rectangles may be partially outside the original image.

  • numDetections: [int].

    Vector of detection numbers for the corresponding objects. An object's number of detections is the number of neighboring positively classified rectangles that were joined together to form the object.

Has overloading in C++

Python prototype (for reference):

detectMultiScale2(image[, scaleFactor[, minNeighbors[, flags[, minSize[, maxSize]]]]]) -> objects, numDetections
Link to this function

detectMultiScale2(self, image, opts)

View Source
Positional Arguments
  • image: Evision.Mat.

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

Keyword Arguments
  • 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: int.

    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. If maxSize == minSize model is evaluated on single scale.

Return
  • objects: [Rect].

    Vector of rectangles where each rectangle contains the detected object, the rectangles may be partially outside the original image.

  • numDetections: [int].

    Vector of detection numbers for the corresponding objects. An object's number of detections is the number of neighboring positively classified rectangles that were joined together to form the object.

Has overloading in C++

Python prototype (for reference):

detectMultiScale2(image[, scaleFactor[, minNeighbors[, flags[, minSize[, maxSize]]]]]) -> objects, numDetections
Link to this function

detectMultiScale3(self, image)

View Source
Positional Arguments
Keyword Arguments
  • scaleFactor: double.
  • minNeighbors: int.
  • flags: int.
  • minSize: Size.
  • maxSize: Size.
  • outputRejectLevels: bool.
Return
  • objects: [Rect]
  • rejectLevels: [int]
  • levelWeights: [double]

Has overloading in C++

This function allows you to retrieve the final stage decision certainty of classification. For this, one needs to set outputRejectLevels on true and provide the rejectLevels and levelWeights parameter. For each resulting detection, levelWeights will then contain the certainty of classification at the final stage. This value can then be used to separate strong from weaker classifications. A code sample on how to use it efficiently can be found below:

Mat img;
vector<double> weights;
vector<int> levels;
vector<Rect> detections;
CascadeClassifier model("/path/to/your/model.xml");
model.detectMultiScale(img, detections, levels, weights, 1.1, 3, 0, Size(), Size(), true);
cerr << "Detection " << detections[0] << " with weight " << weights[0] << endl;

Python prototype (for reference):

detectMultiScale3(image[, scaleFactor[, minNeighbors[, flags[, minSize[, maxSize[, outputRejectLevels]]]]]]) -> objects, rejectLevels, levelWeights
Link to this function

detectMultiScale3(self, image, opts)

View Source
Positional Arguments
Keyword Arguments
  • scaleFactor: double.
  • minNeighbors: int.
  • flags: int.
  • minSize: Size.
  • maxSize: Size.
  • outputRejectLevels: bool.
Return
  • objects: [Rect]
  • rejectLevels: [int]
  • levelWeights: [double]

Has overloading in C++

This function allows you to retrieve the final stage decision certainty of classification. For this, one needs to set outputRejectLevels on true and provide the rejectLevels and levelWeights parameter. For each resulting detection, levelWeights will then contain the certainty of classification at the final stage. This value can then be used to separate strong from weaker classifications. A code sample on how to use it efficiently can be found below:

Mat img;
vector<double> weights;
vector<int> levels;
vector<Rect> detections;
CascadeClassifier model("/path/to/your/model.xml");
model.detectMultiScale(img, detections, levels, weights, 1.1, 3, 0, Size(), Size(), true);
cerr << "Detection " << detections[0] << " with weight " << weights[0] << endl;

Python prototype (for reference):

detectMultiScale3(image[, scaleFactor[, minNeighbors[, flags[, minSize[, maxSize[, outputRejectLevels]]]]]]) -> objects, rejectLevels, levelWeights
Link to this function

detectMultiScale(self, image)

View Source

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

Positional Arguments
  • image: Evision.Mat.

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

Keyword Arguments
  • 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: int.

    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. If maxSize == minSize model is evaluated on single scale.

Return
  • objects: [Rect].

    Vector of rectangles where each rectangle contains the detected object, the rectangles may be partially outside the original image.

Python prototype (for reference):

detectMultiScale(image[, scaleFactor[, minNeighbors[, flags[, minSize[, maxSize]]]]]) -> objects
Link to this function

detectMultiScale(self, image, opts)

View Source

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

Positional Arguments
  • image: Evision.Mat.

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

Keyword Arguments
  • 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: int.

    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. If maxSize == minSize model is evaluated on single scale.

Return
  • objects: [Rect].

    Vector of rectangles where each rectangle contains the detected object, the rectangles may be partially outside the original image.

Python prototype (for reference):

detectMultiScale(image[, scaleFactor[, minNeighbors[, flags[, minSize[, maxSize]]]]]) -> objects

Checks whether the classifier has been loaded.

Python prototype (for reference):

empty() -> retval

Python prototype (for reference):

getFeatureType() -> retval
Link to this function

getOriginalWindowSize(self)

View Source

Python prototype (for reference):

getOriginalWindowSize() -> retval
Link to this function

isOldFormatCascade(self)

View Source

Python prototype (for reference):

isOldFormatCascade() -> retval

Loads a classifier from a file.

Positional Arguments
  • filename: String.

    Name of the file from which the classifier is loaded. The file may contain an old HAAR classifier trained by the haartraining application or a new cascade classifier trained by the traincascade application.

Python prototype (for reference):

load(filename) -> retval

Reads a classifier from a FileStorage node.

Positional Arguments
  • node: FileNode

Note: The file may contain a new cascade classifier (trained by the traincascade application) only.

Python prototype (for reference):

read(node) -> retval

Link to this section Functions

Raising version of cascadeClassifier/0.

Link to this function

cascadeClassifier!(filename)

View Source

Raising version of cascadeClassifier/1.

Link to this function

convert!(oldcascade, newcascade)

View Source

Raising version of convert/2.

Link to this function

detectMultiScale2!(self, image)

View Source

Raising version of detectMultiScale2/2.

Link to this function

detectMultiScale2!(self, image, opts)

View Source

Raising version of detectMultiScale2/3.

Link to this function

detectMultiScale3!(self, image)

View Source

Raising version of detectMultiScale3/2.

Link to this function

detectMultiScale3!(self, image, opts)

View Source

Raising version of detectMultiScale3/3.

Link to this function

detectMultiScale!(self, image)

View Source

Raising version of detectMultiScale/2.

Link to this function

detectMultiScale!(self, image, opts)

View Source

Raising version of detectMultiScale/3.

Raising version of empty/1.

Raising version of getFeatureType/1.

Link to this function

getOriginalWindowSize!(self)

View Source

Raising version of getOriginalWindowSize/1.

Link to this function

isOldFormatCascade!(self)

View Source

Raising version of isOldFormatCascade/1.

Raising version of load/2.

Raising version of read/2.