Skip to content

Commit

Permalink
added minScale param that gets sent to jsfeat.haar.detect_multi_scale
Browse files Browse the repository at this point in the history
  • Loading branch information
kylemcdonald committed Nov 26, 2016
1 parent 9a2ddf9 commit 9ff0c47
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
4 changes: 2 additions & 2 deletions examples/ext_js/jsfeat_detect.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand All @@ -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);

Expand Down
3 changes: 2 additions & 1 deletion js/clm.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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];
Expand Down

0 comments on commit 9ff0c47

Please sign in to comment.