Skip to content

Commit 388e695

Browse files
committed
v.1.0.5
* fix detection on selected region
1 parent f46a73a commit 388e695

File tree

5 files changed

+19
-16
lines changed

5 files changed

+19
-16
lines changed

beeld.config

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ tasks =[{}]
4242

4343
"@@ROOT@@" = "'undefined' !== typeof self ? self : this"
4444
"@@MODULE@@" = "HAAR"
45-
"@@VERSION@@" = "1.0.4"
45+
"@@VERSION@@" = "1.0.5"
4646

4747
@
4848

build/haar-detector.js

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
* modified port of jViolaJones for Java (http://code.google.com/p/jviolajones/) and OpenCV for C++ (https://github.com/opencv/opencv) to JavaScript
55
*
66
* https://github.com/foo123/HAAR.js
7-
* @version: 1.0.4
7+
* @version: 1.0.5
88
*
99
* Supports parallel "map-reduce" computation both in browser and node using parallel.js library
1010
* https://github.com/adambom/parallel.js (included)
@@ -28,7 +28,7 @@ else if ( !(name in root) ) /* Browser/WebWorker/.. */
2828
* modified port of jViolaJones for Java (http://code.google.com/p/jviolajones/) and OpenCV for C++ (https://github.com/opencv/opencv) to JavaScript
2929
*
3030
* https://github.com/foo123/HAAR.js
31-
* @version: 1.0.4
31+
* @version: 1.0.5
3232
*
3333
* Supports parallel "map-reduce" computation both in browser and node using parallel.js library
3434
* https://github.com/adambom/parallel.js (included)
@@ -37,7 +37,7 @@ else if ( !(name in root) ) /* Browser/WebWorker/.. */
3737
"use strict";
3838

3939
// the export object
40-
var HAAR = {VERSION : "1.0.4"}, Detector, Feature, proto = 'prototype', undef = undefined;
40+
var HAAR = {VERSION : "1.0.5"}, Detector, Feature, proto = 'prototype', undef = undefined;
4141

4242
var // typed arrays substitute
4343
Array32F = (typeof Float32Array !== "undefined") ? Float32Array : Array,
@@ -421,8 +421,8 @@ function detectSingleStep(self)
421421
tyw = ysize*w;
422422
tys = ystep*w;
423423
startty = starty*tys;
424-
xl = selw-xsize;
425-
yl = selh-ysize;
424+
xl = startx+selw-xsize;
425+
yl = starty+selh-ysize;
426426
swh = xsize*ysize;
427427
inv_area = 1.0/swh;
428428

@@ -487,7 +487,7 @@ function detectSingleStep(self)
487487
if (feature.tilt)
488488
{
489489
// tilted rectangle feature, Lienhart et al. extension
490-
for (kr = 0; kr < nb_rects; kr++)
490+
for (kr = 0; kr < nb_rects; ++kr)
491491
{
492492
r = rects[kr];
493493

@@ -948,7 +948,7 @@ Detector[proto] = {
948948
epsilon = (typeof epsilon == 'undefined') ? 0.2 : (+epsilon);
949949
doCannyPruning = (typeof doCannyPruning == 'undefined') ? false : (!!doCannyPruning);
950950

951-
maxScale = self.maxScale = Min(scaledSelection.width/sizex, scaledSelection.height/sizey);
951+
maxScale = self.maxScale = Min(/*scaledSelection.*/width/sizex, /*scaledSelection.*/height/sizey);
952952
scale = self.scale = baseScale;
953953
self.min_neighbors = min_neighbors;
954954
self.scale_inc = scale_inc;
@@ -1054,7 +1054,7 @@ Detector[proto] = {
10541054
self.epsilon = (typeof epsilon == 'undefined') ? 0.2 : (+epsilon);
10551055
self.doCannyPruning = (typeof doCannyPruning == 'undefined') ? false : (!!doCannyPruning);
10561056

1057-
maxScale = self.maxScale = Min(self.scaledSelection.width/sizex, self.scaledSelection.height/sizey);
1057+
maxScale = self.maxScale = Min(self/*.scaledSelection*/.width/sizex, self/*.scaledSelection*/.height/sizey);
10581058
self.scale = baseScale;
10591059
self.min_neighbors = min_neighbors;
10601060
self.scale_inc = scale_inc;

0 commit comments

Comments
 (0)