4
4
* modified port of jViolaJones for Java (http://code.google.com/p/jviolajones/) and OpenCV for C++ (https://github.com/opencv/opencv) to JavaScript
5
5
*
6
6
* https://github.com/foo123/HAAR.js
7
- * @version : 1.0.5
7
+ * @version : 1.0.6
8
8
*
9
9
* Supports parallel "map-reduce" computation both in browser and node using parallel.js library
10
10
* https://github.com/adambom/parallel.js (included)
@@ -28,7 +28,7 @@ else if ( !(name in root) ) /* Browser/WebWorker/.. */
28
28
* modified port of jViolaJones for Java (http://code.google.com/p/jviolajones/) and OpenCV for C++ (https://github.com/opencv/opencv) to JavaScript
29
29
*
30
30
* https://github.com/foo123/HAAR.js
31
- * @version : 1.0.5
31
+ * @version : 1.0.6
32
32
*
33
33
* Supports parallel "map-reduce" computation both in browser and node using parallel.js library
34
34
* https://github.com/adambom/parallel.js (included)
@@ -37,7 +37,7 @@ else if ( !(name in root) ) /* Browser/WebWorker/.. */
37
37
"use strict" ;
38
38
39
39
// the export object
40
- var HAAR = { VERSION : "1.0.5 " } , Detector , Feature , proto = 'prototype' , undef = undefined ;
40
+ var HAAR = { VERSION : "1.0.6 " } , Detector , Feature , proto = 'prototype' , undef = undefined ;
41
41
42
42
var // typed arrays substitute
43
43
Array32F = ( typeof Float32Array !== "undefined" ) ? Float32Array : Array ,
@@ -454,7 +454,8 @@ function detectSingleStep(self)
454
454
total_x2 = inv_area * ( squares [ p3 ] - squares [ p2 ] - squares [ p1 ] + squares [ p0 ] ) ;
455
455
456
456
vnorm = total_x2 - total_x * total_x ;
457
- vnorm = ( vnorm > 1 ) ? Sqrt ( vnorm ) : /*vnorm*/ 1 ;
457
+ if ( 0 >= vnorm ) continue ;
458
+ vnorm = /*(vnorm > 1) ?*/ Sqrt ( vnorm ) /*: /*vnorm* / 1*/ ;
458
459
459
460
pass = true ;
460
461
for ( s = 0 ; s < sl ; ++ s )
@@ -948,7 +949,7 @@ Detector[proto] = {
948
949
epsilon = ( typeof epsilon == 'undefined' ) ? 0.2 : ( + epsilon ) ;
949
950
doCannyPruning = ( typeof doCannyPruning == 'undefined' ) ? false : ( ! ! doCannyPruning ) ;
950
951
951
- maxScale = self . maxScale = Min ( /* scaledSelection.*/ width / sizex , /* scaledSelection.*/ height / sizey ) ;
952
+ maxScale = self . maxScale = Min ( scaledSelection . width / sizex , scaledSelection . height / sizey ) ;
952
953
scale = self . scale = baseScale ;
953
954
self . min_neighbors = min_neighbors ;
954
955
self . scale_inc = scale_inc ;
@@ -1054,7 +1055,7 @@ Detector[proto] = {
1054
1055
self . epsilon = ( typeof epsilon == 'undefined' ) ? 0.2 : ( + epsilon ) ;
1055
1056
self . doCannyPruning = ( typeof doCannyPruning == 'undefined' ) ? false : ( ! ! doCannyPruning ) ;
1056
1057
1057
- maxScale = self . maxScale = Min ( self /* .scaledSelection*/ . width / sizex , self /* .scaledSelection*/ . height / sizey ) ;
1058
+ maxScale = self . maxScale = Min ( self . scaledSelection . width / sizex , self . scaledSelection . height / sizey ) ;
1058
1059
self . scale = baseScale ;
1059
1060
self . min_neighbors = min_neighbors ;
1060
1061
self . scale_inc = scale_inc ;
0 commit comments