diff --git a/examples/ext_js/jsfeat_detect.js b/examples/ext_js/jsfeat_detect.js index 9dead754..b0671db1 100644 --- a/examples/ext_js/jsfeat_detect.js +++ b/examples/ext_js/jsfeat_detect.js @@ -24,7 +24,7 @@ var jsfeat_face = function(image) { var classifier = jsfeat.haar.frontalface; - this.findFace = function () { + this.findFace = function (minScale) { if (image.tagName == 'VIDEO' || image.tagName == 'IMG') { work_ctx.drawImage(image, 0, 0); } @@ -36,7 +36,7 @@ var jsfeat_face = function(image) { jsfeat.imgproc.compute_integral_image(img_u8, ii_sum, ii_sqsum, null); - var rects = jsfeat.haar.detect_multi_scale(ii_sum, ii_sqsum, ii_tilted, null, img_u8.cols, img_u8.rows, classifier, 1.15, 2); + var rects = jsfeat.haar.detect_multi_scale(ii_sum, ii_sqsum, ii_tilted, null, img_u8.cols, img_u8.rows, classifier, 1.15, minScale); rects = jsfeat.haar.group_rectangles(rects, 1); diff --git a/js/clm.js b/js/clm.js index 04fb7e1f..ed770552 100644 --- a/js/clm.js +++ b/js/clm.js @@ -12,6 +12,7 @@ var clm = { if (params.stopOnConvergence === undefined) params.stopOnConvergence = false; if (params.weightPoints === undefined) params.weightPoints = undefined; if (params.sharpenResponse === undefined) params.sharpenResponse = false; + if (params.minScale === undefined) params.minScale = 2; var numPatches, patchSize, numParameters, patchType; var gaussianPD; @@ -901,7 +902,7 @@ var clm = { );*/ var jf = new jsfeat_face(canvas); - var comp = jf.findFace(); + var comp = jf.findFace(params.minScale); if (comp.length > 0) { candidate = comp[0];