Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

poitential fix for null pointer error. Test still screwed though.

  • Loading branch information...
commit fa6e6b4da18d62a9657689bb503d96791eeaefc0 1 parent b6468cf
@peterbraden authored
Showing with 9 additions and 1 deletion.
  1. +9 −1 lib/opencv.js
View
10 lib/opencv.js
@@ -20,7 +20,15 @@ var matrix = cv.Matrix.prototype;
matrix.detectObject = function(classifier, opts, cb){
opts = opts || {}
- var face_cascade = new cv.CascadeClassifier(classifier);
+ cv._detectObjectClassifiers = cv._detectObjectClassifiers || {}
+
+ if (cv._detectObjectClassifiers[classifier]){
+ var face_cascade = cv._detectObjectClassifiers[classifier];
+ } else{
+ var face_cascade = new cv.CascadeClassifier(classifier);
+ cv._detectObjectClassifiers[classifier] = face_cascade;
+ }
+
face_cascade.detectMultiScale(this, cb, opts.scale, opts.neighbors
, opts.min && opts.min[0], opts.min && opts.min[1]);
}
Please sign in to comment.
Something went wrong with that request. Please try again.