Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

global update

Added lots of new methods and modules
  • Loading branch information...
commit ef8c7b9323c0357d94df0ab21d02d14453e63a2e 1 parent 9b41bd1
@inspirit authored
View
2  build/jsfeat-min.js 100644 → 100755
@@ -1 +1 @@
-var jsfeat=jsfeat||{REVISION:"ALPHA"};self.Int32Array=self.Int32Array||Array;self.Uint32Array=self.Uint32Array||Array;self.Uint8Array=self.Uint8Array||Array;self.Float32Array=self.Float32Array||Array;(function(c){var a=2,g=4,b=8,e=16;var d=(function(){function h(i,k,j){this.width=i;this.height=k;this.buffer=new ArrayBuffer(i*k*j);this.data_u8=new Uint8Array(this.buffer);this.data_i32=new Int32Array(this.buffer);this.data_f32=new Float32Array(this.buffer)}return h})();var f=(function(){function h(i){this.levels=i;this.images=new Array(i);this.pyrdown=jsfeat.imgproc.pyrdown_fast_u8}h.prototype.allocate=function(j,m,l){var k=this.levels;while(--k>=0){this.images[k]=new d(j>>k,m>>k,l)}};h.prototype.build=function(m){var l=2,k=m,j=this.images[1];this.pyrdown(k.data_u8,k.width,k.height,j.data_u8);for(;l<this.levels;++l){k=j;j=this.images[l];this.pyrdown(k.data_u8,k.width,k.height,j.data_u8)}};return h})();c.U8_t=a;c.U32_t=g;c.I32_t=b;c.F32_t=e;c.img_t=d;c.img_pyr_t=f})(jsfeat);(function(b){var a=(function(){return{get_gaussian_kernel:function(n,k,d,j){var e=0,g=0,m=0,l=0,c=0;var f=0;var h=new Float32Array(n);if((n&1)==1&&n<=7&&k<=0){switch(n>>1){case 0:h[0]=1;f=1;break;case 1:h[0]=0.25,h[1]=0.5,h[2]=0.25;f=0.25+0.5+0.25;break;case 2:h[0]=0.0625,h[1]=0.25,h[2]=0.375,h[3]=0.25,h[4]=0.0625;f=0.0625+0.25+0.375+0.25+0.0625;break;case 3:h[0]=0.03125,h[1]=0.109375,h[2]=0.21875,h[3]=0.28125,h[4]=0.21875,h[5]=0.109375,h[6]=0.03125;f=0.03125+0.109375+0.21875+0.28125+0.21875+0.109375+0.03125;break}}else{l=k>0?k:((n-1)*0.5-1)*0.3+0.8;c=-0.5/(l*l);for(;e<n;++e){g=e-(n-1)*0.5;m=Math.exp(c*g*g);h[e]=m;f+=m}}if(j&jsfeat.U8_t){f=256/f;for(e=0;e<n;++e){d[e]=(h[e]*f+0.5)|0}}else{f=1/f;for(e=0;e<n;++e){d[e]=h[e]*f}}},qsort:function(o,G,p,q){var A=7;var r;var z=0,j=0,D=0,y=0,w=0,x=0,e=0,v=0,B=0;var u=0,s=0,h=0,g=0,l=0,F=0,E=0,C=0,f=0;var k=new Int32Array(48*2);if((p-G+1)<=1){return}k[0]=G;k[1]=p;while(z>=0){j=k[z<<1];D=k[(z<<1)+1];z--;for(;;){w=(D-j)+1;if(w<=A){for(e=j+1;e<=D;e++){for(v=e;v>j&&q(o[v],o[v-1]);v--){r=o[v];o[v]=o[v-1];o[v-1]=r}}break}else{f=0;u=j;h=D;l=j+(w>>1);if(w>40){B=w>>3;F=j,E=j+B,C=j+2*B;j=q(o[F],o[E])?(q(o[E],o[C])?E:(q(o[F],o[C])?C:F)):(q(o[C],o[E])?E:(q(o[F],o[C])?F:C));F=l-B,E=l,C=l+B;l=q(o[F],o[E])?(q(o[E],o[C])?E:(q(o[F],o[C])?C:F)):(q(o[C],o[E])?E:(q(o[F],o[C])?F:C));F=D-2*B,E=D-B,C=D;D=q(o[F],o[E])?(q(o[E],o[C])?E:(q(o[F],o[C])?C:F)):(q(o[C],o[E])?E:(q(o[F],o[C])?F:C))}F=j,E=l,C=D;l=q(o[F],o[E])?(q(o[E],o[C])?E:(q(o[F],o[C])?C:F)):(q(o[C],o[E])?E:(q(o[F],o[C])?F:C));if(l!=u){r=o[l];o[l]=o[u];o[u]=r;l=u}j=s=u+1;D=g=h;for(;;){while(j<=D&&!q(o[l],o[j])){if(!q(o[j],o[l])){if(j>s){r=o[s];o[s]=o[j];o[j]=r}f=1;s++}j++}while(j<=D&&!q(o[D],o[l])){if(!q(o[l],o[D])){if(D<g){r=o[g];o[g]=o[D];o[D]=r}f=1;g--}D--}if(j>D){break}r=o[j];o[j]=o[D];o[D]=r;f=1;j++;D--}if(f==0){j=u,D=h;for(e=j+1;e<=D;e++){for(v=e;v>j&&q(o[v],o[v-1]);v--){r=o[v];o[v]=o[v-1];o[v-1]=r}}break}w=Math.min((s-u),(j-s));for(y=0;y<w;y++){r=o[u+y];o[u+y]=o[j+y-w];o[j+y-w]=r}w=Math.min((h-g),(g-D));for(y=0;y<w;y++){r=o[j+y];o[j+y]=o[h+y-w+1];o[h+y-w+1]=r}w=(j-s);x=(g-D);if(w>1){if(x>1){if(w>x){++z;k[z<<1]=u;k[(z<<1)+1]=u+w-1;j=h-x+1,D=h}else{++z;k[z<<1]=h-x+1;k[(z<<1)+1]=h;j=u,D=u+w-1}}else{j=u,D=u+w-1}}else{if(x>1){j=h-x+1,D=h}else{break}}}}}},median:function(j,c,h){var d;var e=0,i=0,f=0,g=(c+h)>>1;for(;;){if(h<=c){return j[g]}if(h==(c+1)){if(j[c]>j[h]){d=j[c];j[c]=j[h];j[h]=d}return j[g]}e=((c+h)>>1);if(j[e]>j[h]){d=j[e];j[e]=j[h];j[h]=d}if(j[c]>j[h]){d=j[c];j[c]=j[h];j[h]=d}if(j[e]>j[c]){d=j[e];j[e]=j[c];j[c]=d}i=(c+1);d=j[e];j[e]=j[i];j[i]=d;f=h;for(;;){do{++i}while(j[c]>j[i]);do{--f}while(j[f]>j[c]);if(f<i){break}d=j[i];j[i]=j[f];j[f]=d}d=j[c];j[c]=j[f];j[f]=d;if(f<=g){c=i}else{if(f>=g){h=(f-1)}}}return 0}}})();b.math=a})(jsfeat);(function(b){var a=(function(){return{grayscale:function(g,h){var f=g.length|0,c=(f-16)|0;var d=0;for(var e=0;e<=c;e+=16,d+=4){h[d]=((g[e]*77)+(g[e+1]*151)+(g[e+2]*28))>>8;h[d+1]=((g[e+4]*77)+(g[e+5]*151)+(g[e+6]*28))>>8;h[d+2]=((g[e+8]*77)+(g[e+9]*151)+(g[e+10]*28))>>8;h[d+3]=((g[e+12]*77)+(g[e+13]*151)+(g[e+14]*28))>>8}for(;e<f;e+=4,++d){h[d]=((g[e]*77)+(g[e+1]*151)+(g[e+2]*28))>>8}},box_blur:function(g,x,l,u,r){var f=(2*r+1)|0;var c=new Int32Array(l*f+l);var n=(l*f)|0;var q=0,v=0;var t=0,s=0,e=0,d=0;var o=0,p=0;var m=0,k=(l*r-r)|0;for(;t<l;++t){c[n+t]=0}for(t=0;t<u;++t){o=0;p=m;for(s=0;s<f-1;++s){o+=g[m+s]}for(;s<=l-2;s+=2){o+=g[m+s];c[q+s]=o;c[n+s]+=o;o-=g[p++];o+=g[m+s+1];c[q+s+1]=o;c[n+s+1]+=o;o-=g[p++]}for(;s<l;++s){o+=g[m+s];c[q+s]=o;c[n+s]+=o;o-=g[p++]}if(t>=f-1){for(s=f-1;s<=l-2;s+=2){e=c[n+s];d=c[n+s+1];x[k+s]=e;x[k+s+1]=d;c[n+s]=e-c[v+s];c[n+s+1]=d-c[v+s+1]}for(;s<l;++s){e=c[n+s];x[k+s]=e;c[n+s]=e-c[v+s]}k+=l;v+=l;v=(v<n)*v}m+=l;q+=l;q=(q<n)*q}},gaussian_blur_u8:function(c,t,u,q,s,v){if(typeof v==="undefined"){v=0}if(typeof s==="undefined"){s=0}s=s==0?(Math.max(1,(4*v+1-1e-8)|0)*2+1)|0:s;var x=s>>1;var p=0,n=0,l=0,r=0,m=0,e=0,g=0,o=u<<1;var f=new Uint8Array(s+Math.max(q,u));var d=new Int32Array(s);jsfeat.math.get_gaussian_kernel(s,v,d,jsfeat.U8_t);for(;p<q;++p){r=c[e];for(n=0;n<x;++n){f[n]=r}for(n=0;n<=u-2;n+=2){f[n+x]=c[e+n];f[n+x+1]=c[e+n+1]}for(;n<u;++n){f[n+x]=c[e+n]}r=c[e+u-1];for(n=u;n<x+u;++n){f[n+x]=r}for(n=0;n<=u-2;n+=2){r=0,m=0;for(l=0;l<s;++l){r+=f[l+n]*d[l];m+=f[l+n+1]*d[l]}t[g+n]=r>>8;t[g+n+1]=m>>8}for(;n<u;++n){r=0;for(l=0;l<s;++l){r+=f[l+n]*d[l]}t[g+n]=r>>8}e+=u;g+=u}for(p=0;p<u;++p){r=t[p];for(n=0;n<x;++n){f[n]=r}l=p;for(n=0;n<=q-2;n+=2,l+=o){f[n+x]=t[l];f[n+x+1]=t[l+u]}for(;n<q;++n,l+=u){f[n+x]=t[l]}r=t[(q-1)*u+p];for(n=q;n<x+q;++n){f[n+x]=r}g=p;for(n=0;n<=q-2;n+=2,g+=o){r=0,m=0;for(l=0;l<s;++l){r+=f[l+n]*d[l];m+=f[l+n+1]*d[l]}t[g]=r>>8;t[g+u]=m>>8}for(;n<q;++n,g+=u){r=0;for(l=0;l<s;++l){r+=f[l+n]*d[l]}t[g]=r>>8}}},pyrdown_fast_u8:function(d,l,f,i){var e=l>>1,g=f>>1;var k=0,j=0,c=0,n=0,m=0;for(j=0;j<g;++j){n=c;for(k=0;k<=e-2;k+=2,m+=2,n+=4){i[m]=(d[n]+d[n+1]+d[n+l]+d[n+l+1]+2)>>2;i[m+1]=(d[n+2]+d[n+3]+d[n+l+2]+d[n+l+3]+2)>>2}for(;k<e;++k,++m,n+=2){i[m]=(d[n]+d[n+1]+d[n+l]+d[n+l+1]+2)>>2}c+=l<<1}},shar_derivatives:function(d,g,n,e){var f=n<<1,k=0,i=0,c=0;var q=0,o=0,m=0,p=0;var l=new Int32Array(n+2);var j=new Int32Array(n+2);for(;i<e;++i,o+=n){q=((i>0?i-1:1)*n)|0;m=((i<e-1?i+1:e-2)*n)|0;p=(i*f)|0;for(k=0,c=1;k<=n-2;k+=2,c+=2){l[c]=(((d[q+k])+(d[m+k]))*3+(d[o+k])*10);j[c]=((d[m+k])-(d[q+k]));l[c+1]=(((d[q+k+1])+(d[m+k+1]))*3+(d[o+k+1])*10);j[c+1]=((d[m+k+1])-(d[q+k+1]))}for(;k<n;++k,++c){l[c]=(((d[q+k])+(d[m+k]))*3+(d[o+k])*10);j[c]=((d[m+k])-(d[q+k]))}k=(n+1)|0;l[0]=l[1];l[k]=l[n];j[0]=j[1];j[k]=j[n];for(k=0;k<=n-2;k+=2){g[p++]=((l[k+2]-l[k]));g[p++]=(((j[k+2]+j[k])*3+j[k+1]*10));g[p++]=((l[k+3]-l[k+1]));g[p++]=(((j[k+3]+j[k+1])*3+j[k+2]*10))}for(;k<n;++k){g[p++]=((l[k+2]-l[k]));g[p++]=(((j[k+2]+j[k])*3+j[k+1]*10))}}}}})();b.imgproc=a})(jsfeat);(function(a){var b=(function(){var m=new Int32Array([0,3,1,3,2,2,3,1,3,0,3,-1,2,-2,1,-3,0,-3,-1,-3,-2,-2,-3,-1,-3,0,-3,1,-2,2,-1,3]);var e=new Int32Array([0,2,1,2,2,1,2,0,2,-1,1,-2,0,-2,-1,-2,-2,-1,-2,0,-2,1,-1,2]);var c=new Int32Array([0,1,1,1,1,0,1,-1,0,-1,-1,-1,-1,0,-1,1]);var f=new Uint8Array(512);var k=new Int32Array(25);var i=new Int32Array(25);var l=function(o,q,r){var n=0;var p=r==16?m:(r==12?e:c);for(;n<r;++n){o[n]=p[n<<1]+p[(n<<1)+1]*q}for(;n<25;++n){o[n]=o[n-r]}},d=function(n,q,o,u,s){var t=15,r=0,z=n[q];var p=s,x=0,y=0,w=0;for(;r<t;++r){u[r]=z-n[q+o[r]]}for(r=0;r<8;r+=2){x=Math.min(u[r+1],u[r+2]);if(x<=p){continue}x=Math.min(x,u[r+3]);x=Math.min(x,u[r+4]);p=Math.max(p,Math.min(x,u[r]));p=Math.max(p,Math.min(x,u[r+5]))}y=-p;for(r=0;r<8;r+=2){w=Math.max(u[r+1],u[r+2]);w=Math.max(w,u[r+3]);if(w>=y){continue}w=Math.max(w,u[r+4]);y=Math.min(y,Math.max(w,u[r]));y=Math.min(y,Math.max(w,u[r+5]))}return -y-1},j=function(n,q,o,u,s){var t=19,r=0,z=n[q];var p=s,x=0,y=0,w=0;for(;r<t;++r){u[r]=z-n[q+o[r]]}for(r=0;r<12;r+=2){x=Math.min(u[r+1],u[r+2]);if(x<=p){continue}x=Math.min(x,u[r+3]);x=Math.min(x,u[r+4]);x=Math.min(x,u[r+5]);x=Math.min(x,u[r+6]);p=Math.max(p,Math.min(x,u[r]));p=Math.max(p,Math.min(x,u[r+7]))}y=-p;for(r=0;r<12;r+=2){w=Math.max(u[r+1],u[r+2]);w=Math.max(w,u[r+3]);w=Math.max(w,u[r+4]);if(w>=y){continue}w=Math.max(w,u[r+5]);w=Math.max(w,u[r+6]);y=Math.min(y,Math.max(w,u[r]));y=Math.min(y,Math.max(w,u[r+7]))}return -y-1},h=function(n,q,o,u,s){var t=25,r=0,z=n[q];var p=s,x=0,y=0,w=0;for(;r<t;++r){u[r]=z-n[q+o[r]]}for(r=0;r<16;r+=2){x=Math.min(u[r+1],u[r+2]);x=Math.min(x,u[r+3]);if(x<=p){continue}x=Math.min(x,u[r+4]);x=Math.min(x,u[r+5]);x=Math.min(x,u[r+6]);x=Math.min(x,u[r+7]);x=Math.min(x,u[r+8]);p=Math.max(p,Math.min(x,u[r]));p=Math.max(p,Math.min(x,u[r+9]))}y=-p;for(r=0;r<16;r+=2){w=Math.max(u[r+1],u[r+2]);w=Math.max(w,u[r+3]);w=Math.max(w,u[r+4]);w=Math.max(w,u[r+5]);if(w>=y){continue}w=Math.max(w,u[r+6]);w=Math.max(w,u[r+7]);w=Math.max(w,u[r+8]);y=Math.min(y,Math.max(w,u[r]));y=Math.min(y,Math.max(w,u[r+9]))}return -y-1};var g=20;return{set_threshold:function(n){g=Math.min(Math.max(n,0),255);for(var o=-255;o<=255;++o){f[(o+255)]=(o<-g?1:(o>g?2:0))}return g},detect:function(z,W,aq,I,D,G){if(typeof G==="undefined"){G=16}if(typeof D==="undefined"){D=3}var C=(G/2)|0,y=(G+C+1)|0;var ao=0,am=0,ak=0,E=0,V=0,ap=0;var J=new Uint8Array(W*3);var F=new Int32Array((W+1)*3);var M=k;var L=i;var A=Math.max(3,D);var Y=Math.min((aq-2),(aq-D));var B=Math.max(3,D);var Z=Math.min((W-3),(W-D));var ag=0,O=0;var P=G==16?h:(G==12?j:d);var H=f;var r=g;var X=0,an=0,at=0,av=0,T=0,U=0,au=0,Q=0,ar=0;var S=0,R=0,q=0;l(M,W,G);var al=M[0];var aj=M[1];var ai=M[2];var ah=M[3];var af=M[4];var ae=M[5];var ad=M[6];var ac=M[7];var ab=M[8];var aa=M[9];var u=M[10];var t=M[11];var s=M[12];var p=M[13];var o=M[14];var n=M[15];for(ao=0;ao<W*3;++ao){J[ao]=0}for(ao=A;ao<Y;++ao){au=((ao*W)+B)|0;ap=(ao-3)%3;U=(ap*W)|0;T=(ap*(W+1))|0;for(am=0;am<W;++am){J[U+am]=0}av=0;if(ao<(Y-1)){am=B;for(;am<Z;++am,++au){X=z[au];an=(-X+255);at=(H[an+z[au+al]]|H[an+z[au+ab]]);if(at==0){continue}at&=(H[an+z[au+ai]]|H[an+z[au+u]]);at&=(H[an+z[au+af]]|H[an+z[au+s]]);at&=(H[an+z[au+ad]]|H[an+z[au+o]]);if(at==0){continue}at&=(H[an+z[au+aj]]|H[an+z[au+aa]]);at&=(H[an+z[au+ah]]|H[an+z[au+t]]);at&=(H[an+z[au+ae]]|H[an+z[au+p]]);at&=(H[an+z[au+ac]]|H[an+z[au+n]]);if(at&1){E=(X-r);ag=0;for(ak=0;ak<y;++ak){V=z[(au+M[ak])];if(V<E){++ag;if(ag>C){++av;F[T+av]=am;J[U+am]=P(z,au,M,L,r);break}}else{ag=0}}}if(at&2){E=(X+r);ag=0;for(ak=0;ak<y;++ak){V=z[(au+M[ak])];if(V>E){++ag;if(ag>C){++av;F[T+av]=am;J[U+am]=P(z,au,M,L,r);break}}else{ag=0}}}}}F[T+W]=av;if(ao==A){continue}ap=(ao-4+3)%3;Q=(ap*W)|0;T=(ap*(W+1))|0;ap=(ao-5+3)%3;ar=(ap*W)|0;av=F[T+W];for(ak=0;ak<av;++ak){am=F[T+ak];S=(am+1)|0;R=(am-1)|0;q=J[Q+am];if((q>J[Q+S]&&q>J[Q+R]&&q>J[ar+R]&&q>J[ar+am]&&q>J[ar+S]&&q>J[U+R]&&q>J[U+am]&&q>J[U+S])){I[O*3]=am;I[O*3+1]=(ao-1);I[O*3+2]=q;O++}}}return O}}})();a.fast_corners=b;b.set_threshold(20)})(jsfeat);(function(b){var a=(function(){var c=jsfeat.imgproc.shar_derivatives;return{track:function(n,s,am,aH,k,L,P,I,f,q){if(typeof P==="undefined"){P=30}if(typeof I==="undefined"){I=new Uint8Array(k)}if(typeof f==="undefined"){f=0.01}if(typeof q==="undefined"){q=0.0001}var e=(L-1)*0.5;var h=(L*L)|0;var X=h<<1;var r=n.images,Q=s.images;var g=r[0].data_u8,B=Q[0].data_u8;var K=r[0].width,ax=r[0].height,av=0,aD=0;var u=new Int32Array(h);var Z=new Int32Array(X);var aw=new Int32Array((K*ax)*2);var Y=0,G=0,aI=0,ap=0,aE=0,aq=0;var ai=0,aB=0,az=0,ac=0,ab=0;var A=0,v=0,V=0,T=0;var p=0,o=0,aA=0,ay=0;var O=0,N=0,H=0,F=0,af=0,ah=0,l=0;var d=0,w=0,M=0;var S=0,R=0,at=0,ar=0;var ae=14;var z=14;var W=z-5;var au=(1<<((W)-1));var aa=(1<<ae);var m=(1<<((z)-1));var U=1/(1<<20);var aG=0,aF=0,ao=0,an=0,aj=0,t=0,C=0;var al=0,ak=0,ad=0,ag=0,aC=0;var E=1.1920929e-7;f*=f;for(;O<k;++O){I[O]=1}var J=(n.levels-1)|0;af=J;for(;af>=0;--af){ai=(1/(1<<af));av=K>>af;aD=ax>>af;Y=av<<1;g=r[af].data_u8;B=Q[af].data_u8;w=(av-L)|0;M=(aD-L)|0;c(g,aw,av,aD);for(ah=0;ah<k;++ah){O=ah<<1;N=O+1;aB=am[O]*ai;az=am[N]*ai;if(af==J){ac=aB;ab=az}else{ac=aH[O]*2;ab=aH[N]*2}aH[O]=ac;aH[N]=ab;aB-=e;az-=e;p=aB|0;o=az|0;H=(p<=d)|(p>=w)|(o<=d)|(o>=M);if(H!=0){if(af==0){I[ah]=0}continue}S=aB-p;R=az-o;aG=(((1-S)*(1-R)*aa)+0.5)|0;aF=((S*(1-R)*aa)+0.5)|0;ao=(((1-S)*R*aa)+0.5)|0;an=(aa-aG-aF-ao);al=0,ak=0,ad=0;for(F=0;F<L;++F){G=((F+o)*av+p)|0;aI=G<<1;ap=(F*L)|0;aE=ap<<1;for(H=0;H<L;++H,++G,++ap,aI+=2){aj=((g[G])*aG+(g[G+1])*aF+(g[G+av])*ao+(g[G+av+1])*an);aj=(((aj)+au)>>(W));t=(aw[aI]*aG+aw[aI+2]*aF+aw[aI+Y]*ao+aw[aI+Y+2]*an);t=(((t)+m)>>(z));C=(aw[aI+1]*aG+aw[aI+3]*aF+aw[aI+Y+1]*ao+aw[aI+Y+3]*an);C=(((C)+m)>>(z));u[ap]=aj;Z[aE++]=t;Z[aE++]=C;al+=t*t;ak+=t*C;ad+=C*C}}al*=U;ak*=U;ad*=U;ag=al*ad-ak*ak;aC=(ad+al-Math.sqrt((al-ad)*(al-ad)+4*ak*ak))/X;if(aC<q||ag<E){if(af==0){I[ah]=0}continue}ag=1/ag;ac-=e;ab-=e;A=0;v=0;for(l=0;l<P;++l){aA=ac|0;ay=ab|0;H=(aA<=d)|(aA>=w)|(ay<=d)|(ay>=M);if(H!=0){if(af==0){I[ah]=0}break}S=ac-aA;R=ab-ay;aG=(((1-S)*(1-R)*aa)+0.5)|0;aF=((S*(1-R)*aa)+0.5)|0;ao=(((1-S)*R*aa)+0.5)|0;an=(aa-aG-aF-ao);at=0,ar=0;for(F=0;F<L;++F){aq=((F+ay)*av+aA)|0;ap=(F*L)|0;aE=ap<<1;for(H=0;H<L;++H,++aq,++ap){aj=((B[aq])*aG+(B[aq+1])*aF+(B[aq+av])*ao+(B[aq+av+1])*an);aj=(((aj)+au)>>(W));aj=(aj-u[ap]);at+=aj*Z[aE++];ar+=aj*Z[aE++]}}at*=U;ar*=U;V=((ak*ar-ad*at)*ag);T=((ak*at-al*ar)*ag);ac+=V;ab+=T;aH[O]=ac+e;aH[N]=ab+e;if(V*V+T*T<=f){break}if(l>0&&Math.abs(V+A)<0.01&&Math.abs(T+v)<0.01){aH[O]-=V*0.5;aH[N]-=T*0.5;break}A=V;v=T}}}}}})();b.optical_flow_lk=a})(jsfeat);
+var jsfeat=jsfeat||{REVISION:"ALPHA"};self.Int32Array=self.Int32Array||Array;self.Uint32Array=self.Uint32Array||Array;self.Uint8Array=self.Uint8Array||Array;self.Float32Array=self.Float32Array||Array;(function(k){var g=256,e=512,d=1024,o=2048,n=4096;var r=1,h=2,a=3,i=4;var q=new Int32Array([-1,1,4,-1,4,-1,-1,-1,8,-1,-1,-1,-1,-1,-1,-1,8]);var p=(function(){return function(s){return(s&65280)}})();var f=(function(){return function(s){return(s&255)}})();var b=(function(){return function(s){return q[(s&65280)>>8]}})();var m=(function(){function s(t){this.size=t|0;this.buffer=new ArrayBuffer(t);this.u8=new Uint8Array(this.buffer);this.i32=new Int32Array(this.buffer);this.f32=new Float32Array(this.buffer)}return s})();var j=(function(){function s(v,t,u){this.type=p(u)|0;this.channel=f(u)|0;this.cols=v|0;this.rows=t|0;this.buffer=new m((v*b(u)*f(u))*t);this.data=this.type&g?this.buffer.u8:(this.type&e?this.buffer.i32:this.buffer.f32)}s.prototype.set_data_type=function(t){this.type=p(t)|0;this.channel=f(t)|0;delete this.data;delete this.buffer;this.buffer=new m((this.cols*b(t)*f(t))*this.rows);this.data=this.type&g?this.buffer.u8:(this.type&e?this.buffer.i32:this.buffer.f32)};return s})();var l=(function(){function s(t){this.levels=t|0;this.data=new Array(t);this.pyrdown=jsfeat.imgproc.pyrdown}s.prototype.allocate=function(t,v,w){var u=this.levels;while(--u>=0){this.data[u]=new j(t>>u,v>>u,w)}};s.prototype.build=function(w,v){if(typeof v==="undefined"){v=true}var y=2,u=w,t=this.data[0];if(!v){var x=w.cols*w.rows;while(--x>=0){t.data[x]=w.data[x]}}t=this.data[1];this.pyrdown(u,t);for(;y<this.levels;++y){u=t;t=this.data[y];this.pyrdown(u,t)}};return s})();var c=(function(){function s(t,w,u,v){if(typeof t==="undefined"){t=0}if(typeof w==="undefined"){w=0}if(typeof u==="undefined"){u=0}if(typeof v==="undefined"){v=0}this.x=t;this.y=w;this.score=u;this.level=v}return s})();k.U8_t=g;k.S32_t=e;k.F32_t=d;k.S64_t=o;k.F64_t=n;k.C1_t=r;k.C2_t=h;k.C3_t=a;k.C4_t=i;k.get_data_type=p;k.get_channel=f;k.get_data_type_size=b;k.data_t=m;k.matrix_t=j;k.pyramid_t=l;k.point2d_t=c})(jsfeat);(function(b){var a=(function(){var f=(function(){function g(h){this.next=null;this.size=h|0;this.buffer=new ArrayBuffer(h);this.u8=new Uint8Array(this.buffer);this.i32=new Int32Array(this.buffer);this.f32=new Float32Array(this.buffer)}return g})();var e,c;var d=0;return{allocate:function(g,k){e=c=new f(k);for(var h=0;h<g;++h){var j=new f(k);c=c.next=j;d++}},get_buffer:function(g){var h=e;e=e.next;d--;if(g>h.size){h.buffer=new ArrayBuffer(g);h.u8=new Uint8Array(h.buffer);h.i32=new Int32Array(h.buffer);h.f32=new Float32Array(h.buffer);h.size=g}return h},put_buffer:function(g){c=c.next=g;d++}}})();b.cache=a;a.allocate(30,640*4)})(jsfeat);(function(b){var a=(function(){var c=new Int32Array(48*2);return{get_gaussian_kernel:function(p,m,e,l){var f=0,j=0,o=0,n=0,d=0;var g=0;var h=jsfeat.cache.get_buffer(p<<2);var k=h.f32;if((p&1)==1&&p<=7&&m<=0){switch(p>>1){case 0:k[0]=1;g=1;break;case 1:k[0]=0.25,k[1]=0.5,k[2]=0.25;g=0.25+0.5+0.25;break;case 2:k[0]=0.0625,k[1]=0.25,k[2]=0.375,k[3]=0.25,k[4]=0.0625;g=0.0625+0.25+0.375+0.25+0.0625;break;case 3:k[0]=0.03125,k[1]=0.109375,k[2]=0.21875,k[3]=0.28125,k[4]=0.21875,k[5]=0.109375,k[6]=0.03125;g=0.03125+0.109375+0.21875+0.28125+0.21875+0.109375+0.03125;break}}else{n=m>0?m:((p-1)*0.5-1)*0.3+0.8;d=-0.5/(n*n);for(;f<p;++f){j=f-(p-1)*0.5;o=Math.exp(d*j*j);k[f]=o;g+=o}}if(l&jsfeat.U8_t){g=256/g;for(f=0;f<p;++f){e[f]=(k[f]*g+0.5)|0}}else{g=1/g;for(f=0;f<p;++f){e[f]=k[f]*g}}jsfeat.cache.put_buffer(h)},qsort:function(o,J,s,u){var D=7;var v,r,q,p;var C=0,j=0,G=0,B=0,z=0,A=0,e=0,y=0,E=0;var x=0,w=0,h=0,g=0,l=0,I=0,H=0,F=0,f=0;var k=c;if((s-J+1)<=1){return}k[0]=J;k[1]=s;while(C>=0){j=k[C<<1];G=k[(C<<1)+1];C--;for(;;){z=(G-j)+1;if(z<=D){for(e=j+1;e<=G;e++){for(y=e;y>j&&u(o[y],o[y-1]);y--){v=o[y];o[y]=o[y-1];o[y-1]=v}}break}else{f=0;x=j;h=G;l=j+(z>>1);if(z>40){E=z>>3;I=j,H=j+E,F=j+(E<<1);r=o[I],q=o[H],p=o[F];j=u(r,q)?(u(q,p)?H:(u(r,p)?F:I)):(u(p,q)?H:(u(r,p)?I:F));I=l-E,H=l,F=l+E;r=o[I],q=o[H],p=o[F];l=u(r,q)?(u(q,p)?H:(u(r,p)?F:I)):(u(p,q)?H:(u(r,p)?I:F));I=G-(E<<1),H=G-E,F=G;r=o[I],q=o[H],p=o[F];G=u(r,q)?(u(q,p)?H:(u(r,p)?F:I)):(u(p,q)?H:(u(r,p)?I:F))}I=j,H=l,F=G;r=o[I],q=o[H],p=o[F];l=u(r,q)?(u(q,p)?H:(u(r,p)?F:I)):(u(p,q)?H:(u(r,p)?I:F));if(l!=x){v=o[l];o[l]=o[x];o[x]=v;l=x}j=w=x+1;G=g=h;r=o[l];for(;;){while(j<=G&&!u(r,o[j])){if(!u(o[j],r)){if(j>w){v=o[w];o[w]=o[j];o[j]=v}f=1;w++}j++}while(j<=G&&!u(o[G],r)){if(!u(r,o[G])){if(G<g){v=o[g];o[g]=o[G];o[G]=v}f=1;g--}G--}if(j>G){break}v=o[j];o[j]=o[G];o[G]=v;f=1;j++;G--}if(f==0){j=x,G=h;for(e=j+1;e<=G;e++){for(y=e;y>j&&u(o[y],o[y-1]);y--){v=o[y];o[y]=o[y-1];o[y-1]=v}}break}z=Math.min((w-x),(j-w));A=(j-z)|0;for(B=0;B<z;++B,++A){v=o[x+B];o[x+B]=o[A];o[A]=v}z=Math.min((h-g),(g-G));A=(h-z+1)|0;for(B=0;B<z;++B,++A){v=o[j+B];o[j+B]=o[A];o[A]=v}z=(j-w);A=(g-G);if(z>1){if(A>1){if(z>A){++C;k[C<<1]=x;k[(C<<1)+1]=x+z-1;j=h-A+1,G=h}else{++C;k[C<<1]=h-A+1;k[(C<<1)+1]=h;j=x,G=x+z-1}}else{j=x,G=x+z-1}}else{if(A>1){j=h-A+1,G=h}else{break}}}}}},median:function(k,d,i){var e;var f=0,j=0,g=0,h=(d+i)>>1;for(;;){if(i<=d){return k[h]}if(i==(d+1)){if(k[d]>k[i]){e=k[d];k[d]=k[i];k[i]=e}return k[h]}f=((d+i)>>1);if(k[f]>k[i]){e=k[f];k[f]=k[i];k[i]=e}if(k[d]>k[i]){e=k[d];k[d]=k[i];k[i]=e}if(k[f]>k[d]){e=k[f];k[f]=k[d];k[d]=e}j=(d+1);e=k[f];k[f]=k[j];k[j]=e;g=i;for(;;){do{++j}while(k[d]>k[j]);do{--g}while(k[g]>k[d]);if(g<j){break}e=k[j];k[j]=k[g];k[g]=e}e=k[d];k[d]=k[g];k[g]=e;if(g<=h){d=j}else{if(g>=h){i=(g-1)}}}return 0}}})();b.math=a})(jsfeat);(function(b){var a=(function(){return{affine_3point_transform:function(l,h,o,f,m,g,n,d,j,e,k,c,i){},perspective_4point_transform:function(B,w,ac,s,Z,v,ab,r,W,u,aa,p,U,t,Y,m,S){var J=w;var I=u;var H=ab;var G=J*I*H;var F=Y;var E=J*F;var D=I*E;var C=aa;var o=J*C;var l=v;var h=ac;var f=t;var d=h*f;var au=d*l;var T=f*l*C;var R=f*H;var O=f*C;var N=I*H;var M=F*I;var L=F*l;var K=C*l;var A=1/(R-O-N+M-L+K);var y=J*f;var x=h*l;var q=H*J;var n=F*q;var k=h*I;var g=d*C;var c=h*C*l;var V=H*F*I;var Q=F*h;var at=-(D-G+o*l-l*E-d*I+au-T+R*I)*A;var ar=(G-D-y*H+y*C+au-I*x+L*I-T)*A;var aq=J;var ap=(-C*E+n+k*H-d*H+g-c+L*C-V)*A;var ao=(-n+q*C-Q*I+g-c+Q*l+V-R*C)*A;var am=h;var ak=(-o+q+k-x+O-R-M+L)*A;var ai=(-E+o+d-k+L-K-R+N)*A;J=s;I=p;H=W;G=J*I*H;F=S;E=J*F;D=I*E;C=U;o=J*C;l=r;h=Z;f=m;d=h*f;au=d*l;T=f*l*C;R=f*H;O=f*C;N=I*H;M=F*I;L=F*l;K=C*l;A=1/(R-O-N+M-L+K);y=J*f;x=h*l;q=H*J;n=F*q;k=h*I;g=d*C;c=h*C*l;V=H*F*I;Q=F*h;var an=-(D-G+o*l-l*E-d*I+au-T+R*I)*A;var al=(G-D-y*H+y*C+au-I*x+L*I-T)*A;var aj=J;var ah=(-C*E+n+k*H-d*H+g-c+L*C-V)*A;var ag=(-n+q*C-Q*I+g-c+Q*l+V-R*C)*A;var af=h;var ae=(-o+q+k-x+O-R-M+L)*A;var ad=(-E+o+d-k+L-K-R+N)*A;I=ao-ai*am;H=at*ao;G=at*am;E=ap*ar;D=aq*ap;o=ar*ak;var j=aq*ak;f=1/(H-G*ai-E+D*ai+o*am-j*ao);au=-ap+am*ak;var P=-ap*ai+ao*ak;K=-ar+aq*ai;var z=at-j;x=at*ai-o;q=-ar*am+aq*ao;var i=G-D;var e=H-E;c=I*f;var av=K*f;var X=q*f;B[0]=an*c+al*(au*f)-aj*(P*f);B[1]=an*av+al*(z*f)-aj*(x*f);B[2]=-an*X-al*(i*f)+aj*(e*f);B[3]=ah*c+ag*(au*f)-af*(P*f);B[4]=ah*av+ag*(z*f)-af*(x*f);B[5]=-ah*X-ag*(i*f)+af*(e*f);B[6]=ae*c+ad*(au*f)-P*f;B[7]=ae*av+ad*(z*f)-x*f;B[8]=-ae*X-ad*(i*f)+e*f},invert_affine_transform:function(c,k){var i=c[0],h=c[1],g=c[2];var f=c[3],e=c[4],d=c[5];var j=1/(i*e-h*f);k[0]=j*e;k[1]=j*-h;k[2]=j*(h*d-g*e);k[3]=j*-f;k[4]=j*i;k[5]=j*(g*f-i*d)},invert_perspective_transform:function(c,k){var i=c[0],h=c[1],g=c[2];var f=c[3],e=c[4],d=c[5];var n=c[6],m=c[7],l=c[8];var j=1/(i*(e*l-d*m)-h*(f*l-d*n)+g*(f*m-e*n));k[0]=j*(e*l-d*m);k[1]=j*(g*m-h*l);k[2]=j*(h*d-g*e);k[3]=j*(d*n-f*l);k[4]=j*(i*l-g*n);k[5]=j*(g*f-i*d);k[6]=j*(f*m-e*n);k[7]=j*(h*n-i*m);k[8]=j*(i*e-h*f)}}})();b.transform=a})(jsfeat);(function(b){var a=(function(){var c=function(q,R,O,p){var z=[],r=0;var y=q.channel,v=q.cols,J=q.rows;var P=q.data,m=R.data;var I=v/O,H=J/p;var n=(I*H*65536)|0;var x=0,u=0,C=0,A=0,t=0,s=0,G=0,F=0,D=0,B=0;var Q=0,N=0,K=0,o=0,M=0,E=0;var l=jsfeat.cache.get_buffer((O*y)<<2);var g=jsfeat.cache.get_buffer((O*y)<<2);var L=l.i32;var j=g.i32;for(;x<O;x++){D=x*I,B=D+I;t=(D+1-0.000001)|0,s=B|0;t=Math.min(t,v-1);s=Math.min(s,v-1);if(t>D){z[r++]={si:((t-1)*y)|0,di:(x*y)|0,alpha:((t-D)*256)|0}}for(C=t;C<s;C++){z[r++]={si:(C*y)|0,di:(x*y)|0,alpha:256}}if(B-s>0.001){z[r++]={si:(s*y)|0,di:(x*y)|0,alpha:((B-s)*256)|0}}}for(x=0;x<O*y;x++){L[x]=j[x]=0}u=0;for(A=0;A<J;A++){Q=v*A;for(F=0;F<r;F++){K=z[F].di;o=z[F].alpha;t=z[F].si;for(G=0;G<y;G++){L[K+G]+=P[Q+t+G]*o}}if((u+1)*H<=A+1||A==J-1){M=(Math.max(A+1-(u+1)*H,0)*256)|0;E=256-M;N=O*u;if(M<=0){for(x=0;x<O*y;x++){m[N+x]=Math.min(Math.max((j[x]+L[x]*256)/n,0),255);j[x]=L[x]=0}}else{for(x=0;x<O*y;x++){m[N+x]=Math.min(Math.max((j[x]+L[x]*E)/n,0),255);j[x]=L[x]*M;L[x]=0}}u++}else{for(x=0;x<O*y;x++){j[x]+=L[x]*256;L[x]=0}}}jsfeat.cache.put_buffer(g);jsfeat.cache.put_buffer(l)};var f=function(p,R,N,o){var y=[],q=0;var x=p.channel,u=p.cols,I=p.rows;var O=p.data,m=R.data;var H=u/N,G=I/o;var Q=1/(H*G);var v=0,t=0,B=0,z=0,s=0,r=0,F=0,E=0,C=0,A=0;var P=0,M=0,J=0,n=0,L=0,D=0;var l=jsfeat.cache.get_buffer((N*x)<<2);var g=jsfeat.cache.get_buffer((N*x)<<2);var K=l.f32;var j=g.f32;for(;v<N;v++){C=v*H,A=C+H;s=(C+1-0.000001)|0,r=A|0;s=Math.min(s,u-1);r=Math.min(r,u-1);if(s>C){y[q++]={si:((s-1)*x)|0,di:(v*x)|0,alpha:(s-C)*Q}}for(B=s;B<r;B++){y[q++]={si:(B*x)|0,di:(v*x)|0,alpha:Q}}if(A-r>0.001){y[q++]={si:(r*x)|0,di:(v*x)|0,alpha:(A-r)*Q}}}for(v=0;v<N*x;v++){K[v]=j[v]=0}t=0;for(z=0;z<I;z++){P=u*z;for(E=0;E<q;E++){J=y[E].di;n=y[E].alpha;s=y[E].si;for(F=0;F<x;F++){K[J+F]+=O[P+s+F]*n}}if((t+1)*G<=z+1||z==I-1){L=Math.max(z+1-(t+1)*G,0);D=1-L;M=N*t;if(Math.abs(L)<0.001){for(v=0;v<N*x;v++){m[M+v]=j[v]+K[v];j[v]=K[v]=0}}else{for(v=0;v<N*x;v++){m[M+v]=j[v]+K[v]*D;j[v]=K[v]*L;K[v]=0}}t++}else{for(v=0;v<N*x;v++){j[v]+=K[v];K[v]=0}}}jsfeat.cache.put_buffer(g);jsfeat.cache.put_buffer(l)};var e=function(D,F,m,s,B,t,g,n){var z=0,y=0,x=0,A=0,u=0,l=0,G=0,E=0,C=0,v=t[0],r=0;var q=s<<1,p=s*3,o=s<<2;for(;z<B;++z){l=F[A];for(y=0;y<n;++y){D[y]=l}for(y=0;y<=s-2;y+=2){D[y+n]=F[A+y];D[y+n+1]=F[A+y+1]}for(;y<s;++y){D[y+n]=F[A+y]}l=F[A+s-1];for(y=s;y<n+s;++y){D[y+n]=l}for(y=0;y<=s-4;y+=4){l=D[y]*v,G=D[y+1]*v,E=D[y+2]*v,C=D[y+3]*v;for(x=1;x<g;++x){r=t[x];l+=D[x+y]*r;G+=D[x+y+1]*r;E+=D[x+y+2]*r;C+=D[x+y+3]*r}m[u+y]=l>>8;m[u+y+1]=G>>8;m[u+y+2]=E>>8;m[u+y+3]=C>>8}for(;y<s;++y){l=D[y]*v;for(x=1;x<g;++x){l+=D[x+y]*t[x]}m[u+y]=l>>8}A+=s;u+=s}for(z=0;z<s;++z){l=m[z];for(y=0;y<n;++y){D[y]=l}x=z;for(y=0;y<=B-2;y+=2,x+=q){D[y+n]=m[x];D[y+n+1]=m[x+s]}for(;y<B;++y,x+=s){D[y+n]=m[x]}l=m[(B-1)*s+z];for(y=B;y<n+B;++y){D[y+n]=l}u=z;for(y=0;y<=B-4;y+=4,u+=o){l=D[y]*v,G=D[y+1]*v,E=D[y+2]*v,C=D[y+3]*v;for(x=1;x<g;++x){r=t[x];l+=D[x+y]*r;G+=D[x+y+1]*r;E+=D[x+y+2]*r;C+=D[x+y+3]*r}m[u]=l>>8;m[u+s]=G>>8;m[u+q]=E>>8;m[u+p]=C>>8}for(;y<B;++y,u+=s){l=D[y]*v;for(x=1;x<g;++x){l+=D[x+y]*t[x]}m[u]=l>>8}}};var d=function(D,F,m,s,B,t,g,n){var z=0,y=0,x=0,A=0,u=0,l=0,G=0,E=0,C=0,v=t[0],r=0;var q=s<<1,p=s*3,o=s<<2;for(;z<B;++z){l=F[A];for(y=0;y<n;++y){D[y]=l}for(y=0;y<=s-2;y+=2){D[y+n]=F[A+y];D[y+n+1]=F[A+y+1]}for(;y<s;++y){D[y+n]=F[A+y]}l=F[A+s-1];for(y=s;y<n+s;++y){D[y+n]=l}for(y=0;y<=s-4;y+=4){l=D[y]*v,G=D[y+1]*v,E=D[y+2]*v,C=D[y+3]*v;for(x=1;x<g;++x){r=t[x];l+=D[x+y]*r;G+=D[x+y+1]*r;E+=D[x+y+2]*r;C+=D[x+y+3]*r}m[u+y]=l;m[u+y+1]=G;m[u+y+2]=E;m[u+y+3]=C}for(;y<s;++y){l=D[y]*v;for(x=1;x<g;++x){l+=D[x+y]*t[x]}m[u+y]=l}A+=s;u+=s}for(z=0;z<s;++z){l=m[z];for(y=0;y<n;++y){D[y]=l}x=z;for(y=0;y<=B-2;y+=2,x+=q){D[y+n]=m[x];D[y+n+1]=m[x+s]}for(;y<B;++y,x+=s){D[y+n]=m[x]}l=m[(B-1)*s+z];for(y=B;y<n+B;++y){D[y+n]=l}u=z;for(y=0;y<=B-4;y+=4,u+=o){l=D[y]*v,G=D[y+1]*v,E=D[y+2]*v,C=D[y+3]*v;for(x=1;x<g;++x){r=t[x];l+=D[x+y]*r;G+=D[x+y+1]*r;E+=D[x+y+2]*r;C+=D[x+y+3]*r}m[u]=l;m[u+s]=G;m[u+q]=E;m[u+p]=C}for(;y<B;++y,u+=s){l=D[y]*v;for(x=1;x<g;++x){l+=D[x+y]*t[x]}m[u]=l}}};return{grayscale:function(g,p){var k=g.length|0,q=(k-16)|0;var m=0;var o=4899,h=9617,l=1868;for(var n=0;n<=q;n+=16,m+=4){p[m]=(g[n]*o+g[n+1]*h+g[n+2]*l+8192)>>14;p[m+1]=(g[n+4]*o+g[n+5]*h+g[n+6]*l+8192)>>14;p[m+2]=(g[n+8]*o+g[n+9]*h+g[n+10]*l+8192)>>14;p[m+3]=(g[n+12]*o+g[n+13]*h+g[n+14]*l+8192)>>14}for(;n<k;n+=4,++m){p[m]=(g[n]*o+g[n+1]*h+g[n+2]*l+8192)>>14}},resample:function(l,m,i,k){var j=l.rows,g=l.cols;if(j>k&&g>i){if(l.type&jsfeat.U8_t&&m.type&jsfeat.U8_t&&j*g/(k*i)<256){c(l,m,i,k)}else{f(l,m,i,k)}}},box_blur:function(q,H,A,G){if(typeof G==="undefined"){G=1}var p=(2*A+1)|0;var t=q.cols,D=q.rows;var n=q.type;var g,s=(t*p+t)|0,E=q.data,o=H.data;var v=(t*p)|0;var z=0,F=0;var C=0,B=0,l,k;var x,y;var u=0,r=(t*A-A)|0;var m=jsfeat.cache.get_buffer(s<<2);if((n&jsfeat.U8_t)||(n&jsfeat.S32_t)){g=m.i32}else{g=m.f32}for(;C<t;++C){g[v+C]=0}for(C=0;C<D;++C){x=0;y=u;for(B=0;B<p-1;++B){x+=E[u+B]}for(;B<=t-2;B+=2){x+=E[u+B];g[z+B]=x;g[v+B]+=x;x-=E[y++];x+=E[u+B+1];g[z+B+1]=x;g[v+B+1]+=x;x-=E[y++]}for(;B<t;++B){x+=E[u+B];g[z+B]=x;g[v+B]+=x;x-=E[y++]}if(C>=p-1){for(B=p-1;B<=t-2;B+=2){l=g[v+B];k=g[v+B+1];o[r+B]=l*G;o[r+B+1]=k*G;g[v+B]=l-g[F+B];g[v+B+1]=k-g[F+B+1]}for(;B<t;++B){l=g[v+B];o[r+B]=l*G;g[v+B]=l-g[F+B]}r+=t;F+=t;F=(F<v)*F}u+=t;z+=t;z=(z<v)*z}jsfeat.cache.put_buffer(m)},gaussian_blur:function(g,s,r,v){if(typeof v==="undefined"){v=0}if(typeof r==="undefined"){r=0}r=r==0?(Math.max(1,(4*v+1-1e-8))*2+1)|0:r;var x=r>>1;var t=g.cols,p=g.rows;var u=g.type,n=u&jsfeat.U8_t;var m=g.data,j=s.data;var k,i,q=(r+Math.max(p,t))|0;var l=jsfeat.cache.get_buffer(q<<2);var o=jsfeat.cache.get_buffer(r<<2);if(n){k=l.u8;i=o.i32}else{if(u&jsfeat.S32_t){k=l.i32;i=o.f32}else{k=l.f32;i=o.f32}}jsfeat.math.get_gaussian_kernel(r,v,i,u);if(n){e(k,m,j,t,p,i,r,x)}else{d(k,m,j,t,p,i,r,x)}jsfeat.cache.put_buffer(l);jsfeat.cache.put_buffer(o)},pyrdown:function(i,o){var r=i.cols,m=i.rows;var l=r>>1,n=m>>1;var q=0,p=0,g=0,t=0,s=0;var k=i.data,j=o.data;for(p=0;p<n;++p){t=g;for(q=0;q<=l-2;q+=2,s+=2,t+=4){j[s]=(k[t]+k[t+1]+k[t+r]+k[t+r+1]+2)>>2;j[s+1]=(k[t+2]+k[t+3]+k[t+r+2]+k[t+r+3]+2)>>2}for(;q<l;++q,++s,t+=2){j[s]=(k[t]+k[t+1]+k[t+r]+k[t+r+1]+2)>>2}g+=r<<1}},scharr_derivatives:function(i,F){var o=i.cols,r=i.rows;var G=o<<1,n=0,l=0,t=0,D,C,B,A,z,v;var u=0,s=0,q=0,g=0;var m,k;var E=i.data;var j=jsfeat.cache.get_buffer((o+2)<<2);var p=jsfeat.cache.get_buffer((o+2)<<2);if(i.type&jsfeat.U8_t||i.type&jsfeat.S32_t){m=j.i32;k=p.i32}else{m=j.f32;k=p.f32}for(;l<r;++l,s+=o){u=((l>0?l-1:1)*o)|0;q=((l<r-1?l+1:r-2)*o)|0;g=(l*G)|0;for(n=0,t=1;n<=o-2;n+=2,t+=2){D=E[u+n],C=E[q+n];m[t]=((D+C)*3+(E[s+n])*10);k[t]=(C-D);D=E[u+n+1],C=E[q+n+1];m[t+1]=((D+C)*3+(E[s+n+1])*10);k[t+1]=(C-D)}for(;n<o;++n,++t){D=E[u+n],C=E[q+n];m[t]=((D+C)*3+(E[s+n])*10);k[t]=(C-D)}n=(o+1)|0;m[0]=m[1];m[n]=m[o];k[0]=k[1];k[n]=k[o];for(n=0;n<=o-4;n+=4){D=k[n+2],C=k[n+1],B=k[n+3],A=k[n+4],z=m[n+2],v=m[n+3];F[g++]=(z-m[n]);F[g++]=((D+k[n])*3+C*10);F[g++]=(v-m[n+1]);F[g++]=((B+C)*3+D*10);F[g++]=((m[n+4]-z));F[g++]=(((A+D)*3+B*10));F[g++]=((m[n+5]-v));F[g++]=(((k[n+5]+B)*3+A*10))}for(;n<o;++n){F[g++]=((m[n+2]-m[n]));F[g++]=(((k[n+2]+k[n])*3+k[n+1]*10))}}jsfeat.cache.put_buffer(j);jsfeat.cache.put_buffer(p)},sobel_derivatives:function(i,F){var o=i.cols,r=i.rows;var G=o<<1,n=0,l=0,t=0,D,C,B,A,z,v;var u=0,s=0,q=0,g=0;var m,k;var E=i.data;var j=jsfeat.cache.get_buffer((o+2)<<2);var p=jsfeat.cache.get_buffer((o+2)<<2);if(i.type&jsfeat.U8_t||i.type&jsfeat.S32_t){m=j.i32;k=p.i32}else{m=j.f32;k=p.f32}for(;l<r;++l,s+=o){u=((l>0?l-1:1)*o)|0;q=((l<r-1?l+1:r-2)*o)|0;g=(l*G)|0;for(n=0,t=1;n<=o-2;n+=2,t+=2){D=E[u+n],C=E[q+n];m[t]=((D+C)+(E[s+n]*2));k[t]=(C-D);D=E[u+n+1],C=E[q+n+1];m[t+1]=((D+C)+(E[s+n+1]*2));k[t+1]=(C-D)}for(;n<o;++n,++t){D=E[u+n],C=E[q+n];m[t]=((D+C)+(E[s+n]*2));k[t]=(C-D)}n=(o+1)|0;m[0]=m[1];m[n]=m[o];k[0]=k[1];k[n]=k[o];for(n=0;n<=o-4;n+=4){D=k[n+2],C=k[n+1],B=k[n+3],A=k[n+4],z=m[n+2],v=m[n+3];F[g++]=(z-m[n]);F[g++]=(D+k[n]+C*2);F[g++]=(v-m[n+1]);F[g++]=(B+C+D*2);F[g++]=(m[n+4]-z);F[g++]=(A+D+B*2);F[g++]=(m[n+5]-v);F[g++]=(k[n+5]+B+A*2)}for(;n<o;++n){F[g++]=(m[n+2]-m[n]);F[g++]=(k[n+2]+k[n]+k[n+1]*2)}}jsfeat.cache.put_buffer(j);jsfeat.cache.put_buffer(p)},compute_integral_image:function(g,l,y,u){var t=g.cols,w=g.rows,o=g.data;var r=t+1;var B,z,h,x,q=0,n=0,A,m;if(l&&y){for(;q<r;++q){l[q]=0,y[q]=0}h=(r+1)|0,x=1;for(q=0,m=0;q<w;++q,++h,++x){B=z=0;for(n=0;n<=t-2;n+=2,m+=2,h+=2,x+=2){A=o[m];B+=A,z+=A*A;l[h]=l[x]+B;y[h]=y[x]+z;A=o[m+1];B+=A,z+=A*A;l[h+1]=l[x+1]+B;y[h+1]=y[x+1]+z}for(;n<t;++n,++m,++h,++x){A=o[m];B+=A,z+=A*A;l[h]=l[x]+B;y[h]=y[x]+z}}}else{if(l){for(;q<r;++q){l[q]=0}h=(r+1)|0,x=1;for(q=0,m=0;q<w;++q,++h,++x){B=0;for(n=0;n<=t-2;n+=2,m+=2,h+=2,x+=2){B+=o[m];l[h]=l[x]+B;B+=o[m+1];l[h+1]=l[x+1]+B}for(;n<t;++n,++m,++h,++x){B+=o[m];l[h]=l[x]+B}}}else{if(y){for(;q<r;++q){y[q]=0}h=(r+1)|0,x=1;for(q=0,m=0;q<w;++q,++h,++x){z=0;for(n=0;n<=t-2;n+=2,m+=2,h+=2,x+=2){A=o[m];z+=A*A;y[h]=y[x]+z;A=o[m+1];z+=A*A;y[h+1]=y[x+1]+z}for(;n<t;++n,++m,++h,++x){A=o[m];z+=A*A;y[h]=y[x]+z}}}}}if(u){for(q=0;q<r;++q){u[q]=0}h=(r+1)|0,x=0;for(q=0,m=0;q<w;++q,++h,++x){for(n=0;n<=t-2;n+=2,m+=2,h+=2,x+=2){u[h]=o[m]+u[x];u[h+1]=o[m+1]+u[x+1]}for(;n<t;++n,++m,++h,++x){u[h]=o[m]+u[x]}}h=(r+t)|0,x=t;for(q=0;q<w;++q,h+=r,x+=r){u[h]+=u[x]}for(n=t-1;n>0;--n){h=n+w*r,x=h-r;for(q=w;q>0;--q,h-=r,x-=r){u[h]+=u[x]+u[x+1]}}}},equalize_histogram:function(j,r){var s=j.cols,q=j.rows,o=j.data,l=r.data,t=s*q;var p=0,n=0,k,g;var m=jsfeat.cache.get_buffer(256<<2);k=m.i32;for(;p<256;++p){k[p]=0}for(p=0;p<t;++p){++k[o[p]]}n=k[0];for(p=1;p<256;++p){n=k[p]+=n}g=255/t;for(p=0;p<t;++p){l[p]=(k[o[p]]*g+0.5)|0}jsfeat.cache.put_buffer(m)},canny:function(t,U,D,k){var B=t.cols,K=t.rows,R=t.data,n=U.data;var J=0,G=0,p=0,z=B<<1,Q=0,I=0,M=0,v=0,u=0,C=0;var g=0,T=0;var o=jsfeat.cache.get_buffer((K*z)<<2);var l=jsfeat.cache.get_buffer((3*(B+2))<<2);var m=jsfeat.cache.get_buffer(((K+2)*(B+2))<<2);var r=jsfeat.cache.get_buffer((K*B)<<2);var P=l.i32;var S=m.i32;var q=r.i32;var F=o.i32;var O=1,N=(B+2+1)|0,L=(2*(B+2)+1)|0,A=(B+2)|0,H=(A+1)|0,E=0;this.sobel_derivatives(t,F);if(D>k){J=D;D=k;k=J}J=(3*(B+2))|0;while(--J>=0){P[J]=0}J=((K+2)*(B+2))|0;while(--J>=0){S[J]=0}for(;G<B;++G,p+=2){v=F[p],u=F[p+1];P[N+G]=((v^(v>>31))-(v>>31))+((u^(u>>31))-(u>>31))}for(J=1;J<=K;++J,p+=z){if(J==K){G=L+B;while(--G>=L){P[G]=0}}else{for(G=0;G<B;G++){v=F[p+(G<<1)],u=F[p+(G<<1)+1];P[L+G]=((v^(v>>31))-(v>>31))+((u^(u>>31))-(u>>31))}}Q=(p-z)|0;S[H-1]=0;I=0;for(G=0;G<B;++G,Q+=2){M=P[N+G];if(M>D){v=F[Q];u=F[Q+1];C=v^u;v=((v^(v>>31))-(v>>31))|0;u=((u^(u>>31))-(u>>31))|0;g=v*13573;T=g+((v+v)<<15);u<<=15;if(u<g){if(M>P[N+G-1]&&M>=P[N+G+1]){if(M>k&&!I&&S[H+G-A]!=2){S[H+G]=2;I=1;q[E++]=H+G}else{S[H+G]=1}continue}}else{if(u>T){if(M>P[O+G]&&M>=P[L+G]){if(M>k&&!I&&S[H+G-A]!=2){S[H+G]=2;I=1;q[E++]=H+G}else{S[H+G]=1}continue}}else{C=C<0?-1:1;if(M>P[O+G-C]&&M>P[L+G+C]){if(M>k&&!I&&S[H+G-A]!=2){S[H+G]=2;I=1;q[E++]=H+G}else{S[H+G]=1}continue}}}}S[H+G]=0;I=0}S[H+B]=0;H+=A;G=O;O=N;N=L;L=G}G=H-A-1;for(J=0;J<A;++J,++G){S[G]=0}while(E>0){H=q[--E];H-=A+1;if(S[H]==1){S[H]=2,q[E++]=H}H+=1;if(S[H]==1){S[H]=2,q[E++]=H}H+=1;if(S[H]==1){S[H]=2,q[E++]=H}H+=A;if(S[H]==1){S[H]=2,q[E++]=H}H-=2;if(S[H]==1){S[H]=2,q[E++]=H}H+=A;if(S[H]==1){S[H]=2,q[E++]=H}H+=1;if(S[H]==1){S[H]=2,q[E++]=H}H+=1;if(S[H]==1){S[H]=2,q[E++]=H}}H=A+1;O=0;for(J=0;J<K;++J,H+=A){for(G=0;G<B;++G){n[O++]=(S[H+G]==2)*255}}jsfeat.cache.put_buffer(o);jsfeat.cache.put_buffer(l);jsfeat.cache.put_buffer(m);jsfeat.cache.put_buffer(r)},warp_perspective:function(q,Q,u,P){if(typeof P==="undefined"){P=0}var C=q.cols,F=q.rows,o=Q.cols,D=Q.rows;var K=q.data,l=Q.data;var t=0,s=0,O=0,v=0,G=0,r=0,E=0,w=0,i=0,h=0,g=0,M=0,J=0,k=0,j=0;var B=u[0],A=u[1],z=u[2],N=u[3],L=u[4],I=u[5],p=u[6],n=u[7],m=u[8];for(var H=0;s<D;++s){w=A*s+z,i=L*s+I,h=n*s+m;for(t=0;t<o;++t,++H,w+=B,i+=N,h+=p){g=1/h;r=w*g,E=i*g;v=r|0,G=E|0;if(r>0&&E>0&&v<(C-1)&&G<(F-1)){M=Math.max(r-v,0);J=Math.max(E-G,0);O=C*G+v;k=K[O]+M*(K[O+1]-K[O]);j=K[O+C]+M*(K[O+C+1]-K[O+C]);l[H]=k+J*(j-k)}else{l[H]=P}}}},warp_affine:function(k,J,o,I){if(typeof I==="undefined"){I=0}var t=k.cols,w=k.rows,j=J.cols,u=J.rows;var D=k.data,i=J.data;var n=0,m=0,H=0,p=0,z=0,l=0,v=0,F=0,C=0,h=0,g=0;var s=o[0],r=o[1],q=o[2],G=o[3],E=o[4],B=o[5];for(var A=0;m<u;++m){l=r*m+q;v=E*m+B;for(n=0;n<j;++n,++A,l+=s,v+=G){p=l|0;z=v|0;if(l>0&&v>0&&p<(t-1)&&z<(w-1)){F=Math.max(l-p,0);C=Math.max(v-z,0);H=t*z+p;h=D[H]+F*(D[H+1]-D[H]);g=D[H+t]+F*(D[H+t+1]-D[H+t]);i[A]=h+C*(g-h)}else{i[A]=I}}}}}})();b.imgproc=a})(jsfeat);(function(a){var b=(function(){var m=new Int32Array([0,3,1,3,2,2,3,1,3,0,3,-1,2,-2,1,-3,0,-3,-1,-3,-2,-2,-3,-1,-3,0,-3,1,-2,2,-1,3]);var e=new Int32Array([0,2,1,2,2,1,2,0,2,-1,1,-2,0,-2,-1,-2,-2,-1,-2,0,-2,1,-1,2]);var c=new Int32Array([0,1,1,1,1,0,1,-1,0,-1,-1,-1,-1,0,-1,1]);var f=new Uint8Array(512);var k=new Int32Array(25);var i=new Int32Array(25);var l=function(o,q,r){var n=0;var p=r==16?m:(r==12?e:c);for(;n<r;++n){o[n]=p[n<<1]+p[(n<<1)+1]*q}for(;n<25;++n){o[n]=o[n-r]}},d=function(n,q,o,u,s){var t=13,r=0,z=n[q];var p=s,x=0,y=0,w=0;for(;r<t;++r){u[r]=z-n[q+o[r]]}for(r=0;r<8;r+=2){x=Math.min(u[r+1],u[r+2]);if(x<=p){continue}x=Math.min(x,u[r+3]);x=Math.min(x,u[r+4]);p=Math.max(p,Math.min(x,u[r]));p=Math.max(p,Math.min(x,u[r+5]))}y=-p;for(r=0;r<8;r+=2){w=Math.max(u[r+1],u[r+2]);w=Math.max(w,u[r+3]);if(w>=y){continue}w=Math.max(w,u[r+4]);y=Math.min(y,Math.max(w,u[r]));y=Math.min(y,Math.max(w,u[r+5]))}return -y-1},j=function(n,q,o,u,s){var t=19,r=0,z=n[q];var p=s,x=0,y=0,w=0;for(;r<t;++r){u[r]=z-n[q+o[r]]}for(r=0;r<12;r+=2){x=Math.min(u[r+1],u[r+2]);if(x<=p){continue}x=Math.min(x,u[r+3]);x=Math.min(x,u[r+4]);x=Math.min(x,u[r+5]);x=Math.min(x,u[r+6]);p=Math.max(p,Math.min(x,u[r]));p=Math.max(p,Math.min(x,u[r+7]))}y=-p;for(r=0;r<12;r+=2){w=Math.max(u[r+1],u[r+2]);w=Math.max(w,u[r+3]);w=Math.max(w,u[r+4]);if(w>=y){continue}w=Math.max(w,u[r+5]);w=Math.max(w,u[r+6]);y=Math.min(y,Math.max(w,u[r]));y=Math.min(y,Math.max(w,u[r+7]))}return -y-1},h=function(n,q,o,u,s){var t=25,r=0,z=n[q];var p=s,x=0,y=0,w=0;for(;r<t;++r){u[r]=z-n[q+o[r]]}for(r=0;r<16;r+=2){x=Math.min(u[r+1],u[r+2]);x=Math.min(x,u[r+3]);if(x<=p){continue}x=Math.min(x,u[r+4]);x=Math.min(x,u[r+5]);x=Math.min(x,u[r+6]);x=Math.min(x,u[r+7]);x=Math.min(x,u[r+8]);p=Math.max(p,Math.min(x,u[r]));p=Math.max(p,Math.min(x,u[r+9]))}y=-p;for(r=0;r<16;r+=2){w=Math.max(u[r+1],u[r+2]);w=Math.max(w,u[r+3]);w=Math.max(w,u[r+4]);w=Math.max(w,u[r+5]);if(w>=y){continue}w=Math.max(w,u[r+6]);w=Math.max(w,u[r+7]);w=Math.max(w,u[r+8]);y=Math.min(y,Math.max(w,u[r]));y=Math.min(y,Math.max(w,u[r+9]))}return -y-1};var g=20;return{set_threshold:function(n){g=Math.min(Math.max(n,0),255);for(var o=-255;o<=255;++o){f[(o+255)]=(o<-g?1:(o>g?2:0))}return g},detect:function(P,L,F,I){if(typeof I==="undefined"){I=16}else{if(I!=16&&I!=12&&I!=8){I=16}}if(typeof F==="undefined"){F=3}var C=(I>>1),y=(I+C+1)|0;var z=P.data,aa=P.cols,av=P.rows;var at=0,aq=0,ao=0,G=0,Z=0,au=0;var D=jsfeat.cache.get_buffer(3*aa);var R=jsfeat.cache.get_buffer(((aa+1)*3)<<2);var M=D.u8;var H=R.i32;var Q=k;var O=i;var A=Math.max(3,F);var ac=Math.min((av-2),(av-F));var B=Math.max(3,F);var ad=Math.min((aa-3),(aa-F));var ak=0,S=0,E;var T=I==16?h:(I==12?j:d);var J=f;var r=g;var ab=0,ar=0,ax=0,az=0,X=0,Y=0,ay=0,U=0,aw=0;var W=0,V=0,q=0;l(Q,aa,I);var ap=Q[0];var an=Q[1];var am=Q[2];var al=Q[3];var aj=Q[4];var ai=Q[5];var ah=Q[6];var ag=Q[7];var af=Q[8];var ae=Q[9];var u=Q[10];var t=Q[11];var s=Q[12];var p=Q[13];var o=Q[14];var n=Q[15];for(at=0;at<aa*3;++at){M[at]=0}for(at=A;at<ac;++at){ay=((at*aa)+B)|0;au=(at-3)%3;Y=(au*aa)|0;X=(au*(aa+1))|0;for(aq=0;aq<aa;++aq){M[Y+aq]=0}az=0;if(at<(ac-1)){aq=B;for(;aq<ad;++aq,++ay){ab=z[ay];ar=(-ab+255);ax=(J[ar+z[ay+ap]]|J[ar+z[ay+af]]);if(ax==0){continue}ax&=(J[ar+z[ay+am]]|J[ar+z[ay+u]]);ax&=(J[ar+z[ay+aj]]|J[ar+z[ay+s]]);ax&=(J[ar+z[ay+ah]]|J[ar+z[ay+o]]);if(ax==0){continue}ax&=(J[ar+z[ay+an]]|J[ar+z[ay+ae]]);ax&=(J[ar+z[ay+al]]|J[ar+z[ay+t]]);ax&=(J[ar+z[ay+ai]]|J[ar+z[ay+p]]);ax&=(J[ar+z[ay+ag]]|J[ar+z[ay+n]]);if(ax&1){G=(ab-r);ak=0;for(ao=0;ao<y;++ao){Z=z[(ay+Q[ao])];if(Z<G){++ak;if(ak>C){++az;H[X+az]=aq;M[Y+aq]=T(z,ay,Q,O,r);break}}else{ak=0}}}if(ax&2){G=(ab+r);ak=0;for(ao=0;ao<y;++ao){Z=z[(ay+Q[ao])];if(Z>G){++ak;if(ak>C){++az;H[X+az]=aq;M[Y+aq]=T(z,ay,Q,O,r);break}}else{ak=0}}}}}H[X+aa]=az;if(at==A){continue}au=(at-4+3)%3;U=(au*aa)|0;X=(au*(aa+1))|0;au=(at-5+3)%3;aw=(au*aa)|0;az=H[X+aa];for(ao=0;ao<az;++ao){aq=H[X+ao];W=(aq+1)|0;V=(aq-1)|0;q=M[U+aq];if((q>M[U+W]&&q>M[U+V]&&q>M[aw+V]&&q>M[aw+aq]&&q>M[aw+W]&&q>M[Y+V]&&q>M[Y+aq]&&q>M[Y+W])){E=L[S];E.x=aq,E.y=(at-1),E.score=q;S++}}}jsfeat.cache.put_buffer(D);jsfeat.cache.put_buffer(R);return S}}})();a.fast_corners=b;b.set_threshold(20)})(jsfeat);(function(b){var a=(function(){var c=jsfeat.imgproc.scharr_derivatives;return{track:function(n,u,ao,aK,k,N,R,K,f,q){if(typeof R==="undefined"){R=30}if(typeof K==="undefined"){K=new Uint8Array(k)}if(typeof f==="undefined"){f=0.01}if(typeof q==="undefined"){q=0.0001}var e=(N-1)*0.5;var h=(N*N)|0;var Z=h<<1;var r=n.data,S=u.data;var g=r[0].data,F=S[0].data;var M=r[0].cols,aA=r[0].rows,ax=0,aG=0;var ay=jsfeat.cache.get_buffer(h<<2);var s=jsfeat.cache.get_buffer(Z<<2);var t=jsfeat.cache.get_buffer((aA*(M<<1))<<2);var w=ay.i32;var ab=s.i32;var az=t.i32;var aa=0,I=0,aL=0,ar=0,aH=0,at=0;var al=0,aE=0,aC=0,ae=0,ad=0;var E=0,z=0,X=0,V=0;var p=0,o=0,aD=0,aB=0;var Q=0,P=0,J=0,H=0,ah=0,aj=0,l=0;var d=0,A=0,O=0;var U=0,T=0,av=0,au=0;var ag=14;var C=14;var Y=C-5;var aw=(1<<((Y)-1));var ac=(1<<ag);var m=(1<<((C)-1));var W=1/(1<<20);var aJ=0,aI=0,aq=0,ap=0,ak=0,v=0,B=0;var an=0,am=0,af=0,ai=0,aF=0;var G=1.1920929e-7;f*=f;for(;Q<k;++Q){K[Q]=1}var L=(n.levels-1)|0;ah=L;for(;ah>=0;--ah){al=(1/(1<<ah));ax=M>>ah;aG=aA>>ah;aa=ax<<1;g=r[ah].data;F=S[ah].data;A=(ax-N)|0;O=(aG-N)|0;c(r[ah],az);for(aj=0;aj<k;++aj){Q=aj<<1;P=Q+1;aE=ao[Q]*al;aC=ao[P]*al;if(ah==L){ae=aE;ad=aC}else{ae=aK[Q]*2;ad=aK[P]*2}aK[Q]=ae;aK[P]=ad;aE-=e;aC-=e;p=aE|0;o=aC|0;J=(p<=d)|(p>=A)|(o<=d)|(o>=O);if(J!=0){if(ah==0){K[aj]=0}continue}U=aE-p;T=aC-o;aJ=(((1-U)*(1-T)*ac)+0.5)|0;aI=((U*(1-T)*ac)+0.5)|0;aq=(((1-U)*T*ac)+0.5)|0;ap=(ac-aJ-aI-aq);an=0,am=0,af=0;for(H=0;H<N;++H){I=((H+o)*ax+p)|0;aL=I<<1;ar=(H*N)|0;aH=ar<<1;for(J=0;J<N;++J,++I,++ar,aL+=2){ak=((g[I])*aJ+(g[I+1])*aI+(g[I+ax])*aq+(g[I+ax+1])*ap);ak=(((ak)+aw)>>(Y));v=(az[aL]*aJ+az[aL+2]*aI+az[aL+aa]*aq+az[aL+aa+2]*ap);v=(((v)+m)>>(C));B=(az[aL+1]*aJ+az[aL+3]*aI+az[aL+aa+1]*aq+az[aL+aa+3]*ap);B=(((B)+m)>>(C));w[ar]=ak;ab[aH++]=v;ab[aH++]=B;an+=v*v;am+=v*B;af+=B*B}}an*=W;am*=W;af*=W;ai=an*af-am*am;aF=(af+an-Math.sqrt((an-af)*(an-af)+4*am*am))/Z;if(aF<q||ai<G){if(ah==0){K[aj]=0}continue}ai=1/ai;ae-=e;ad-=e;E=0;z=0;for(l=0;l<R;++l){aD=ae|0;aB=ad|0;J=(aD<=d)|(aD>=A)|(aB<=d)|(aB>=O);if(J!=0){if(ah==0){K[aj]=0}break}U=ae-aD;T=ad-aB;aJ=(((1-U)*(1-T)*ac)+0.5)|0;aI=((U*(1-T)*ac)+0.5)|0;aq=(((1-U)*T*ac)+0.5)|0;ap=(ac-aJ-aI-aq);av=0,au=0;for(H=0;H<N;++H){at=((H+aB)*ax+aD)|0;ar=(H*N)|0;aH=ar<<1;for(J=0;J<N;++J,++at,++ar){ak=((F[at])*aJ+(F[at+1])*aI+(F[at+ax])*aq+(F[at+ax+1])*ap);ak=(((ak)+aw)>>(Y));ak=(ak-w[ar]);av+=ak*ab[aH++];au+=ak*ab[aH++]}}av*=W;au*=W;X=((am*au-af*av)*ai);V=((am*av-an*au)*ai);ae+=X;ad+=V;aK[Q]=ae+e;aK[P]=ad+e;if(X*X+V*V<=f){break}if(l>0&&Math.abs(X+E)<0.01&&Math.abs(V+z)<0.01){aK[Q]-=X*0.5;aK[P]-=V*0.5;break}E=X;z=V}}}jsfeat.cache.put_buffer(ay);jsfeat.cache.put_buffer(s);jsfeat.cache.put_buffer(t)}}})();b.optical_flow_lk=a})(jsfeat);(function(b){var a=(function(){var c=function(e,d){var f=(e.width*0.25+0.5)|0;return d.x<=e.x+f&&d.x>=e.x-f&&d.y<=e.y+f&&d.y>=e.y-f&&d.width<=(e.width*1.5+0.5)|0&&(d.width*1.5+0.5)|0>=e.width};return{edges_density:0.07,detect_single_scale:function(E,ad,af,q,d,f,D,B){var z=(B.size[0]*D)|0,N=(B.size[1]*D)|0,V=(0.5*D+1.5)|0,U=V;var Z,X,W,Q,O,T=(d-z)|0,R=(f-N)|0;var H=(d+1)|0,w,p,r,S;var e=1/(z*N);var t,o,l,u,s,ae,A,g=true,L,h,n,G,m;var M,K,J,I,v,C;var ac=0,ab=z,aa=N*H,Y=aa+z;var F=((z*N)*255*this.edges_density)|0;var P=[];for(O=0;O<R;O+=U){ac=O*H;for(Q=0;Q<T;Q+=V,ac+=V){p=E[ac]-E[ac+ab]-E[ac+aa]+E[ac+Y];if(q){w=(q[ac]-q[ac+ab]-q[ac+aa]+q[ac+Y]);if(w<F||p<20){Q+=V,ac+=V;continue}}p*=e;r=(ad[ac]-ad[ac+ab]-ad[ac+aa]+ad[ac+Y])*e-p*p;S=r>0?Math.sqrt(r):1;t=B.complexClassifiers;s=t.length;g=true;for(Z=0;Z<s;++Z){o=t[Z];L=o.threshold;l=o.simpleClassifiers;ae=l.length;h=0;for(X=0;X<ae;++X){u=l[X];n=0;m=u.features;A=m.length;if(u.tilted===1){for(W=0;W<A;++W){G=m[W];M=~~(Q+G[0]*D)+~~(O+G[1]*D)*H;v=~~(G[2]*D);C=~~(G[3]*D);K=v*H;J=C*H;n+=(af[M]-af[M+v+K]-af[M-C+J]+af[M+v-C+K+J])*G[4]}}else{for(W=0;W<A;++W){G=m[W];M=~~(Q+G[0]*D)+~~(O+G[1]*D)*H;v=~~(G[2]*D);C=~~(G[3]*D);J=C*H;n+=(E[M]-E[M+v]-E[M+J]+E[M+J+v])*G[4]}}h+=(n*e<u.threshold*S)?u.left_val:u.right_val}if(h<L){g=false;break}}if(g){P.push({x:Q,y:O,width:z,height:N,neighbor:1,confidence:h});Q+=V,ac+=V}}}return P},detect_multi_scale:function(e,m,f,h,d,n,i,g,k){if(typeof g==="undefined"){g=1.2}if(typeof k==="undefined"){k=1}var o=i.size[0];var j=i.size[1];var l=[];while(k*o<d&&k*j<n){l=l.concat(this.detect_single_scale(e,m,f,h,d,n,k,i));k*=g}return l},group_rectangles:function(g,l){if(typeof l==="undefined"){l=1}var y,v,q=g.length;var r=[];for(y=0;y<q;++y){r[y]={parent:-1,element:g[y],rank:0}}for(y=0;y<q;++y){if(!r[y].element){continue}var t=y;while(r[t].parent!=-1){t=r[t].parent}for(v=0;v<q;++v){if(y!=v&&r[v].element&&c(r[y].element,r[v].element)){var s=v;while(r[s].parent!=-1){s=r[s].parent}if(s!=t){if(r[t].rank>r[s].rank){r[s].parent=t}else{r[t].parent=s;if(r[t].rank==r[s].rank){r[s].rank++}t=s}var A,d=v;while(r[d].parent!=-1){A=d;d=r[d].parent;r[A].parent=t}d=y;while(r[d].parent!=-1){A=d;d=r[d].parent;r[A].parent=t}}}}}var w=[];var o=0;for(y=0;y<q;y++){v=-1;var e=y;if(r[e].element){while(r[e].parent!=-1){e=r[e].parent}if(r[e].rank>=0){r[e].rank=~o++}v=~r[e].rank}w[y]=v}var m=[];for(y=0;y<o+1;++y){m[y]={neighbors:0,x:0,y:0,width:0,height:0,confidence:0}}for(y=0;y<q;++y){var z=g[y];var k=w[y];if(m[k].neighbors==0){m[k].confidence=z.confidence}++m[k].neighbors;m[k].x+=z.x;m[k].y+=z.y;m[k].width+=z.width;m[k].height+=z.height;m[k].confidence=Math.max(m[k].confidence,z.confidence)}var h=[];for(y=0;y<o;++y){q=m[y].neighbors;if(q>=l){h.push({x:(m[y].x*2+q)/(2*q),y:(m[y].y*2+q)/(2*q),width:(m[y].width*2+q)/(2*q),height:(m[y].height*2+q)/(2*q),neighbors:m[y].neighbors,confidence:m[y].confidence})}}var p=[];q=h.length;for(y=0;y<q;++y){var z=h[y];var x=true;for(v=0;v<q;++v){var u=h[v];var f=(u.width*0.25+0.5)|0;if(y!=v&&z.x>=u.x-f&&z.y>=u.y-f&&z.x+z.width<=u.x+u.width+f&&z.y+z.height<=u.y+u.height+f&&(u.neighbors>Math.max(3,z.neighbors)||z.neighbors<3)){x=false;break}}if(x){p.push(z)}}return p}}})();b.haar=a})(jsfeat);(function(a){var b=(function(){var c=function(e,d){var f=(e.width*0.25+0.5)|0;return d.x<=e.x+f&&d.x>=e.x-f&&d.y<=e.y+f&&d.y>=e.y-f&&d.width<=(e.width*1.5+0.5)|0&&(d.width*1.5+0.5)|0>=e.width};return{interval:4,scale:1.1486,next:5,scale_to:1,prepare_cascade:function(f){var l=f.stage_classifier.length;for(var g=0;g<l;g++){var i=f.stage_classifier[g].feature;var d=f.stage_classifier[g].count;var h=f.stage_classifier[g]._feature=new Array(d);for(var e=0;e<d;e++){h[e]={size:i[e].size,px:new Array(i[e].size),pz:new Array(i[e].size),nx:new Array(i[e].size),nz:new Array(i[e].size)}}}},build_pyramid:function(e,p,x,t,m){if(typeof t==="undefined"){t=4}if(typeof m==="undefined"){m=true}if(m){var l=e.getContext("2d");var n=e.width*e.height;var v=l.getImageData(0,0,e.width,e.height);var k=v.data;var o=new Uint32Array(k.buffer);var j=jsfeat.cache.get_buffer(n);var f=j.u8;jsfeat.imgproc.grayscale(k,f);var h=(255<<24);var r=n,d=0;while(--r>=0){d=f[r];o[r]=h|(d<<16)|(d<<8)|d}l.putImageData(v,0,0);jsfeat.cache.put_buffer(j)}this.interval=t;this.scale=Math.pow(2,1/(this.interval+1));this.next=(this.interval+1)|0;this.scale_to=(Math.log(Math.min(e.width/p,e.height/x))/Math.log(this.scale))|0;var q=document.createElement("canvas");q.width=e.width;q.height=e.height;var s=q.getContext("2d");var w=new Array((this.scale_to+this.next*2)*4);w[0]={width:e.width,height:e.height,data:e.getContext("2d").getImageData(0,0,e.width,e.height).data};var u,g;for(r=1;r<=this.interval;++r){u=(e.width/Math.pow(this.scale,r))|0;g=(e.height/Math.pow(this.scale,r))|0;s.drawImage(e,0,0,e.width,e.height,0,0,u,g);w[r*4]={width:u,height:g,data:s.getImageData(0,0,u,g).data}}for(r=this.next;r<this.scale_to+this.next*2;++r){u=w[r*4-this.next*4].width>>1;g=w[r*4-this.next*4].height>>1;s.drawImage(e,0,0,e.width,e.height,0,0,u,g);w[r*4]={width:u,height:g,data:s.getImageData(0,0,u,g).data}}for(r=this.next*2;r<this.scale_to+this.next*2;++r){u=w[r*4-this.next*4].width>>1;g=w[r*4-this.next*4].height>>1;s.drawImage(e,1,0,e.width-1,e.height,0,0,u-2,g);w[r*4+1]={width:u,height:g,data:s.getImageData(0,0,u,g).data};s.drawImage(e,0,1,e.width,e.height-1,0,0,u,g-2);w[r*4+2]={width:u,height:g,data:s.getImageData(0,0,u,g).data};s.drawImage(e,1,1,e.width-1,e.height-1,0,0,u-2,g-2);w[r*4+3]={width:u,height:g,data:s.getImageData(0,0,u,g).data}}return w},detect:function(z,H){var g=this.interval;var J=this.scale;var l=this.next;var h=this.scale_to;var X=0,W=0,V=0,S=0,O=0,N=0,Q=0,w=0,F=0,E=0,R=0,Z=0,I=0,Y=0,t=0,U=0,e=0;var B=0,T,M,A,D,C,K=true,m=true;var u=1,s=1;var r=[0,1,0,1];var o=[0,0,1,1];var G=[];var v=[],d=[0,0,0];var L=[0,0,0];var P=[0,0,0];for(X=0;X<h;X++){t=(X<<2);U=z[t+(l<<3)].width-(H.width>>2);e=z[t+(l<<3)].height-(H.height>>2);L[0]=z[t].width<<2;L[1]=z[t+(l<<2)].width<<2;L[2]=z[t+(l<<3)].width<<2;P[0]=(z[t].width<<4)-(U<<4);P[1]=(z[t+(l<<2)].width<<3)-(U<<3);P[2]=(z[t+(l<<3)].width<<2)-(U<<2);w=H.stage_classifier.length;for(W=0;W<w;W++){A=H.stage_classifier[W].feature;M=H.stage_classifier[W]._feature;F=H.stage_classifier[W].count;for(V=0;V<F;V++){D=M[V];C=A[V];E=C.size|0;for(Q=0;Q<E;Q++){D.px[Q]=(C.px[Q]<<2)+C.py[Q]*L[C.pz[Q]];D.pz[Q]=C.pz[Q];D.nx[Q]=(C.nx[Q]<<2)+C.ny[Q]*L[C.nz[Q]];D.nz[Q]=C.nz[Q]}}}v[0]=z[t].data;v[1]=z[t+(l<<2)].data;for(Q=0;Q<4;Q++){v[2]=z[t+(l<<3)+Q].data;d[0]=(r[Q]<<3)+o[Q]*(z[t].width<<3);d[1]=(r[Q]<<2)+o[Q]*(z[t+(l<<2)].width<<2);d[2]=0;for(N=0;N<e;N++){for(O=0;O<U;O++){B=0;K=true;w=H.stage_classifier.length;for(W=0;W<w;W++){B=0;T=H.stage_classifier[W].alpha;M=H.stage_classifier[W]._feature;F=H.stage_classifier[W].count;for(V=0;V<F;V++){D=M[V];Z=v[D.pz[0]][d[D.pz[0]]+D.px[0]];I=v[D.nz[0]][d[D.nz[0]]+D.nx[0]];if(Z<=I){B+=T[V<<1]}else{m=true;E=D.size;for(Y=0;Y<E;Y++){if(D.pz[Y]>=0){R=v[D.pz[Y]][d[D.pz[Y]]+D.px[Y]];if(R<Z){if(R<=I){m=false;break}Z=R}}if(D.nz[Y]>=0){S=v[D.nz[Y]][d[D.nz[Y]]+D.nx[Y]];if(S>I){if(Z<=S){m=false;break}I=S}}}B+=(m)?T[(V<<1)+1]:T[V<<1]}}if(B<H.stage_classifier[W].threshold){K=false;break}}if(K){G.push({x:(O*4+r[Q]*2)*u,y:(N*4+o[Q]*2)*s,width:H.width*u,height:H.height*s,neighbor:1,confidence:B})}d[0]+=16;d[1]+=8;d[2]+=4}d[0]+=P[0];d[1]+=P[1];d[2]+=P[2]}}u*=J;s*=J}return G},group_rectangles:function(g,l){if(typeof l==="undefined"){l=1}var y,v,q=g.length;var r=[];for(y=0;y<q;++y){r[y]={parent:-1,element:g[y],rank:0}}for(y=0;y<q;++y){if(!r[y].element){continue}var t=y;while(r[t].parent!=-1){t=r[t].parent}for(v=0;v<q;++v){if(y!=v&&r[v].element&&c(r[y].element,r[v].element)){var s=v;while(r[s].parent!=-1){s=r[s].parent}if(s!=t){if(r[t].rank>r[s].rank){r[s].parent=t}else{r[t].parent=s;if(r[t].rank==r[s].rank){r[s].rank++}t=s}var A,d=v;while(r[d].parent!=-1){A=d;d=r[d].parent;r[A].parent=t}d=y;while(r[d].parent!=-1){A=d;d=r[d].parent;r[A].parent=t}}}}}var w=[];var o=0;for(y=0;y<q;y++){v=-1;var e=y;if(r[e].element){while(r[e].parent!=-1){e=r[e].parent}if(r[e].rank>=0){r[e].rank=~o++}v=~r[e].rank}w[y]=v}var m=[];for(y=0;y<o+1;++y){m[y]={neighbors:0,x:0,y:0,width:0,height:0,confidence:0}}for(y=0;y<q;++y){var z=g[y];var k=w[y];if(m[k].neighbors==0){m[k].confidence=z.confidence}++m[k].neighbors;m[k].x+=z.x;m[k].y+=z.y;m[k].width+=z.width;m[k].height+=z.height;m[k].confidence=Math.max(m[k].confidence,z.confidence)}var h=[];for(y=0;y<o;++y){q=m[y].neighbors;if(q>=l){h.push({x:(m[y].x*2+q)/(2*q),y:(m[y].y*2+q)/(2*q),width:(m[y].width*2+q)/(2*q),height:(m[y].height*2+q)/(2*q),neighbors:m[y].neighbors,confidence:m[y].confidence})}}var p=[];q=h.length;for(y=0;y<q;++y){var z=h[y];var x=true;for(v=0;v<q;++v){var u=h[v];var f=(u.width*0.25+0.5)|0;if(y!=v&&z.x>=u.x-f&&z.y>=u.y-f&&z.x+z.width<=u.x+u.width+f&&z.y+z.height<=u.y+u.height+f&&(u.neighbors>Math.max(3,z.neighbors)||z.neighbors<3)){x=false;break}}if(x){p.push(z)}}return p}}})();a.bbf=b})(jsfeat);
View
2,210 build/jsfeat.js
2,010 additions, 200 deletions not shown
View
3  cascades/bbf_face.js
3 additions, 0 deletions not shown
View
7 cascades/eye.js
7 additions, 0 deletions not shown
View
7 cascades/frontalface.js
7 additions, 0 deletions not shown
View
7 cascades/handfist.js
@@ -0,0 +1,7 @@
+/**
+ * this cascade is derived from https://github.com/mtschirs/js-objectdetect implementation
+ * @author Martin Tschirsich / http://www.tu-darmstadt.de/~m_t
+ */
+(function(global) {
+ global.handfist = {complexClassifiers:[{simpleClassifiers:[{features:[[3,3,9,16,-1.],[3,7,9,8,2.]],tilted:0,threshold:-0.0223442204296589,right_val:-0.9436557292938232,left_val:0.7737345099449158},{features:[[0,9,12,5,-1.],[6,9,6,5,2.]],tilted:0,threshold:-9.3714958056807518e-003,right_val:-0.9004204869270325,left_val:0.5525149106979370}],threshold:-0.3911409080028534},{simpleClassifiers:[{features:[[12,14,12,10,-1.],[12,14,6,5,2.],[18,19,6,5,2.]],tilted:0,threshold:0.0127444602549076,right_val:0.5557708144187927,left_val:-0.7241874933242798},{features:[[2,4,16,8,-1.],[2,8,16,4,2.]],tilted:0,threshold:-0.0203973893076181,right_val:-0.9134256243705750,left_val:0.3255875110626221},{features:[[9,6,15,14,-1.],[9,13,15,7,2.]],tilted:0,threshold:1.5015050303190947e-003,right_val:0.2950277030467987,left_val:-0.8422530293464661},{features:[[0,10,10,5,-1.],[5,10,5,5,2.]],tilted:0,threshold:-9.5540005713701248e-003,right_val:-0.8186870813369751,left_val:0.2949278056621552},{features:[[8,0,16,6,-1.],[8,0,16,3,2.]],tilted:1,threshold:-9.0454015880823135e-003,right_val:0.2449316978454590,left_val:-0.9253956079483032}],threshold:-0.8027257919311523},{simpleClassifiers:[{features:[[11,9,9,6,-1.],[14,12,3,6,3.]],tilted:1,threshold:0.0339135192334652,right_val:0.5952491760253906,left_val:-0.6010565757751465},{features:[[15,1,8,10,-1.],[15,6,8,5,2.]],tilted:0,threshold:-6.3976310193538666e-003,right_val:-0.9008722901344299,left_val:0.2902083992958069},{features:[[12,23,12,1,-1.],[18,23,6,1,2.]],tilted:0,threshold:3.5964029375463724e-003,right_val:0.3585815131664276,left_val:-0.6108912825584412},{features:[[0,8,16,11,-1.],[8,8,8,11,2.]],tilted:0,threshold:3.1002631294541061e-004,right_val:-0.9231098890304565,left_val:0.2521544992923737}],threshold:-0.6695849895477295},{simpleClassifiers:[{features:[[12,22,12,2,-1.],[18,22,6,2,2.]],tilted:0,threshold:8.9982077479362488e-003,right_val:0.5311666131019592,left_val:-0.6216139197349548},{features:[[6,7,10,5,-1.],[6,7,5,5,2.]],tilted:1,threshold:5.8961678296327591e-003,right_val:-0.8741096854209900,left_val:0.3589088022708893},{features:[[10,8,3,2,-1.],[10,9,3,1,2.]],tilted:0,threshold:-7.3489747592248023e-005,right_val:-0.8340616226196289,left_val:0.2021690011024475},{features:[[15,15,3,4,-1.],[15,15,3,2,2.]],tilted:1,threshold:-1.3183970004320145e-003,right_val:0.2309758067131043,left_val:-0.8218436241149902}],threshold:-0.9460288882255554},{simpleClassifiers:[{features:[[4,18,20,6,-1.],[4,18,10,3,2.],[14,21,10,3,2.]],tilted:0,threshold:5.8955969288945198e-003,right_val:0.3239434063434601,left_val:-0.7554979920387268},{features:[[3,1,20,14,-1.],[3,1,10,7,2.],[13,8,10,7,2.]],tilted:0,threshold:8.6170788854360580e-003,right_val:0.2782224118709564,left_val:-0.7028874754905701},{features:[[2,11,3,9,-1.],[3,14,1,3,9.]],tilted:0,threshold:-1.5837070532143116e-003,right_val:0.2773326933383942,left_val:-0.7751926779747009},{features:[[0,4,12,20,-1.],[0,4,6,10,2.],[6,14,6,10,2.]],tilted:0,threshold:7.9292394220829010e-003,right_val:0.2167312055826187,left_val:-0.7723438143730164},{features:[[16,15,6,2,-1.],[16,15,6,1,2.]],tilted:1,threshold:-1.4443190302699804e-003,right_val:0.2078661024570465,left_val:-0.8843228220939636},{features:[[11,8,7,2,-1.],[11,9,7,1,2.]],tilted:0,threshold:-4.8251380212605000e-004,right_val:-0.6776664853096008,left_val:0.2337501049041748},{features:[[20,15,4,6,-1.],[22,15,2,6,2.]],tilted:0,threshold:8.0077340826392174e-003,right_val:0.5163818001747131,left_val:-0.3731102049350739}],threshold:-1.0588489770889282},{simpleClassifiers:[{features:[[14,19,1,2,-1.],[14,20,1,1,2.]],tilted:0,threshold:-5.8145709772361442e-005,right_val:-0.6792302131652832,left_val:0.3404448032379150},{features:[[0,6,2,7,-1.],[1,6,1,7,2.]],tilted:0,threshold:-1.1419489746913314e-003,right_val:-0.5890597105026245,left_val:0.3598371148109436},{features:[[8,0,10,2,-1.],[8,0,5,2,2.]],tilted:1,threshold:5.8654937893152237e-003,right_val:0.1721540987491608,left_val:-0.9622359871864319},{features:[[5,8,16,7,-1.],[13,8,8,7,2.]],tilted:0,threshold:1.1028599692508578e-004,right_val:0.2389315962791443,left_val:-0.7706093192100525},{features:[[2,9,14,12,-1.],[9,9,7,12,2.]],tilted:0,threshold:0.0145609602332115,right_val:-0.8984915018081665,left_val:0.1552716046571732}],threshold:-0.7966647148132324},{simpleClassifiers:[{features:[[2,11,6,10,-1.],[2,11,3,5,2.],[5,16,3,5,2.]],tilted:0,threshold:3.9159432053565979e-003,right_val:0.2886646091938019,left_val:-0.7370954751968384},{features:[[0,3,4,9,-1.],[2,3,2,9,2.]],tilted:0,threshold:-4.6402178704738617e-003,right_val:-0.5601897239685059,left_val:0.3129867017269135},{features:[[7,10,10,8,-1.],[12,10,5,8,2.]],tilted:0,threshold:-4.2656981386244297e-003,right_val:0.2132489979267120,left_val:-0.8286197781562805},{features:[[8,16,16,8,-1.],[8,16,8,4,2.],[16,20,8,4,2.]],tilted:0,threshold:7.9925684258341789e-003,right_val:0.2340082973241806,left_val:-0.6752548217773438},{features:[[4,13,6,3,-1.],[6,15,2,3,3.]],tilted:1,threshold:-6.2725958414375782e-003,right_val:0.2019792944192886,left_val:-0.7839264273643494},{features:[[13,3,11,18,-1.],[13,12,11,9,2.]],tilted:0,threshold:-0.0288890209048986,right_val:0.1651563942432404,left_val:-0.7889788150787354},{features:[[10,7,5,4,-1.],[10,9,5,2,2.]],tilted:0,threshold:-1.5122259501367807e-003,right_val:-0.7596625089645386,left_val:0.1971655040979385},{features:[[11,17,6,3,-1.],[13,18,2,1,9.]],tilted:0,threshold:4.3620187789201736e-003,right_val:-0.9309347271919251,left_val:0.1344974040985107},{features:[[12,7,12,17,-1.],[15,7,6,17,2.]],tilted:0,threshold:-3.2192119397222996e-003,right_val:-0.6044244170188904,left_val:0.2437663972377777}],threshold:-1.0856239795684814},{simpleClassifiers:[{features:[[14,18,1,2,-1.],[14,19,1,1,2.]],tilted:0,threshold:-4.3883759644813836e-005,right_val:-0.6793813705444336,left_val:0.3130159080028534},{features:[[3,11,6,12,-1.],[3,11,3,6,2.],[6,17,3,6,2.]],tilted:0,threshold:6.2022951897233725e-004,right_val:0.1801322996616364,left_val:-0.8423554897308350},{features:[[22,13,2,7,-1.],[23,13,1,7,2.]],tilted:0,threshold:1.0972339659929276e-003,right_val:0.3450973927974701,left_val:-0.4771775007247925},{features:[[16,15,1,2,-1.],[16,15,1,1,2.]],tilted:1,threshold:-2.6349889230914414e-004,right_val:0.2153723984956741,left_val:-0.7629253864288330},{features:[[0,5,22,18,-1.],[0,14,22,9,2.]],tilted:0,threshold:-0.0542980991303921,right_val:0.1730009019374847,left_val:-0.8849576711654663},{features:[[13,19,3,3,-1.],[14,20,1,1,9.]],tilted:0,threshold:-2.1721520461142063e-003,right_val:0.1638997048139572,left_val:-0.8367894887924194},{features:[[15,0,5,2,-1.],[15,1,5,1,2.]],tilted:0,threshold:-1.6347350319847465e-003,right_val:-0.4079189002513886,left_val:0.3731253147125244},{features:[[5,15,4,5,-1.],[5,15,2,5,2.]],tilted:1,threshold:-2.9642079025506973e-003,right_val:0.1886135041713715,left_val:-0.7973154187202454}],threshold:-0.8849025964736939},{simpleClassifiers:[{features:[[12,16,2,8,-1.],[12,20,2,4,2.]],tilted:0,threshold:-2.6686030905693769e-003,right_val:-0.6534382104873657,left_val:0.2950133979320526},{features:[[0,18,2,4,-1.],[1,18,1,4,2.]],tilted:0,threshold:-7.9764809925109148e-004,right_val:-0.4435322880744934,left_val:0.3938421010971069},{features:[[8,3,12,4,-1.],[8,3,12,2,2.]],tilted:1,threshold:-5.1704752258956432e-003,right_val:0.2110860049724579,left_val:-0.7686781883239746},{features:[[6,17,3,2,-1.],[7,18,1,2,3.]],tilted:1,threshold:-1.5294969780370593e-003,right_val:0.1583137959241867,left_val:-0.8944628238677979},{features:[[1,0,10,6,-1.],[6,0,5,6,2.]],tilted:0,threshold:-6.3780639320611954e-003,right_val:-0.4529472887516022,left_val:0.3393965959548950},{features:[[12,9,3,2,-1.],[12,10,3,1,2.]],tilted:0,threshold:-2.6243639877066016e-004,right_val:-0.4983885884284973,left_val:0.2850841879844666},{features:[[11,1,12,11,-1.],[11,1,6,11,2.]],tilted:1,threshold:0.0361888185143471,right_val:-0.7394319772720337,left_val:0.2132015973329544},{features:[[21,13,2,10,-1.],[21,18,2,5,2.]],tilted:0,threshold:7.7682351693511009e-003,right_val:0.4112299978733063,left_val:-0.4052247107028961},{features:[[15,16,1,2,-1.],[15,16,1,1,2.]],tilted:1,threshold:-2.3738530580885708e-004,right_val:0.1911296993494034,left_val:-0.7753518819808960},{features:[[0,11,8,8,-1.],[0,11,4,4,2.],[4,15,4,4,2.]],tilted:0,threshold:4.2231627739965916e-003,right_val:0.1739158928394318,left_val:-0.7229338884353638}],threshold:-1.0250910520553589},{simpleClassifiers:[{features:[[11,11,7,6,-1.],[11,13,7,2,3.]],tilted:0,threshold:2.9137390665709972e-003,right_val:0.3337337076663971,left_val:-0.5349493026733398},{features:[[12,17,3,3,-1.],[13,18,1,1,9.]],tilted:0,threshold:-1.6270120395347476e-003,right_val:0.1722342073917389,left_val:-0.8804692029953003},{features:[[0,9,2,2,-1.],[1,9,1,2,2.]],tilted:0,threshold:-2.9037619242444634e-004,right_val:-0.5733091235160828,left_val:0.2734786868095398},{features:[[13,17,1,2,-1.],[13,18,1,1,2.]],tilted:0,threshold:-1.4552129869116470e-005,right_val:-0.5995762944221497,left_val:0.2491019070148468},{features:[[7,0,17,18,-1.],[7,9,17,9,2.]],tilted:0,threshold:0.0141834802925587,right_val:-0.8961830139160156,left_val:0.1507173925638199},{features:[[8,11,8,2,-1.],[8,11,8,1,2.]],tilted:1,threshold:-5.8600129705155268e-005,right_val:-0.7106314897537231,left_val:0.1771630048751831},{features:[[18,17,6,7,-1.],[21,17,3,7,2.]],tilted:0,threshold:7.3492531664669514e-003,right_val:0.2574213147163391,left_val:-0.5106546878814697},{features:[[2,19,8,1,-1.],[6,19,4,1,2.]],tilted:0,threshold:-1.7738100141286850e-003,right_val:0.1460683941841126,left_val:-0.8705360293388367}],threshold:-0.9740471243858337},{simpleClassifiers:[{features:[[12,10,10,6,-1.],[12,10,5,3,2.],[17,13,5,3,2.]],tilted:0,threshold:-8.5521116852760315e-003,right_val:-0.4556924998760223,left_val:0.3413020968437195},{features:[[5,20,18,4,-1.],[5,20,9,2,2.],[14,22,9,2,2.]],tilted:0,threshold:2.9570560436695814e-003,right_val:0.2246744036674500,left_val:-0.5616099834442139},{features:[[1,10,22,5,-1.],[12,10,11,5,2.]],tilted:0,threshold:-0.0195402801036835,right_val:0.1363316029310226,left_val:-0.8423789739608765},{features:[[1,11,12,1,-1.],[1,11,6,1,2.]],tilted:1,threshold:-3.2073149923235178e-003,right_val:0.1883326023817062,left_val:-0.7569847702980042},{features:[[12,0,12,24,-1.],[12,6,12,12,2.]],tilted:0,threshold:-8.4488727152347565e-003,right_val:-0.8026102185249329,left_val:0.1382011026144028},{features:[[4,15,5,6,-1.],[4,17,5,2,3.]],tilted:0,threshold:1.1350389831932262e-004,right_val:0.1435786038637161,left_val:-0.7027189135551453},{features:[[12,2,6,4,-1.],[14,4,2,4,3.]],tilted:1,threshold:-5.8187649119645357e-004,right_val:0.2510882019996643,left_val:-0.4507982134819031},{features:[[0,7,2,17,-1.],[1,7,1,17,2.]],tilted:0,threshold:-0.0161978900432587,right_val:-0.2079977989196777,left_val:0.6447368860244751},{features:[[13,15,3,9,-1.],[14,15,1,9,3.]],tilted:0,threshold:6.6894508199766278e-004,right_val:-0.7483944892883301,left_val:0.1998561024665833},{features:[[13,18,3,3,-1.],[14,19,1,1,9.]],tilted:0,threshold:-1.8372290069237351e-003,right_val:0.1146014034748077,left_val:-0.8788912892341614},{features:[[17,17,1,2,-1.],[17,18,1,1,2.]],tilted:0,threshold:-4.3397278204793110e-005,right_val:-0.5028128027915955,left_val:0.2129840999841690}],threshold:-1.4024209976196289},{simpleClassifiers:[{features:[[10,11,4,12,-1.],[10,11,2,6,2.],[12,17,2,6,2.]],tilted:0,threshold:-2.0713880658149719e-003,right_val:-0.5756726861000061,left_val:0.2486661970615387},{features:[[12,23,12,1,-1.],[18,23,6,1,2.]],tilted:0,threshold:3.6768750287592411e-003,right_val:0.2280506044626236,left_val:-0.5755078196525574},{features:[[13,10,3,4,-1.],[13,10,3,2,2.]],tilted:1,threshold:-3.0887479078955948e-004,right_val:-0.6454687118530273,left_val:0.2362288981676102},{features:[[0,0,24,24,-1.],[0,0,12,12,2.],[12,12,12,12,2.]],tilted:0,threshold:-0.0257820300757885,right_val:0.1617882996797562,left_val:-0.7496209144592285},{features:[[2,10,2,6,-1.],[2,13,2,3,2.]],tilted:0,threshold:-1.2850989587605000e-003,right_val:0.1440877020359039,left_val:-0.7813286781311035},{features:[[0,11,2,6,-1.],[0,14,2,3,2.]],tilted:0,threshold:3.3493789378553629e-003,right_val:-0.7505543231964111,left_val:0.1375873982906342},{features:[[0,1,24,1,-1.],[8,1,8,1,3.]],tilted:0,threshold:-2.6788329705595970e-003,right_val:-0.4255296885967255,left_val:0.2596372067928314},{features:[[13,7,4,2,-1.],[13,8,4,1,2.]],tilted:0,threshold:-2.8834199838456698e-005,right_val:-0.7050843238830566,left_val:0.1635348945856094},{features:[[0,13,3,10,-1.],[1,13,1,10,3.]],tilted:0,threshold:-1.6196980141103268e-003,right_val:-0.3415850102901459,left_val:0.3419960141181946},{features:[[1,10,10,10,-1.],[6,10,5,10,2.]],tilted:0,threshold:1.0517919436097145e-003,right_val:-0.7929052114486694,left_val:0.1479195058345795},{features:[[9,0,4,6,-1.],[9,0,4,3,2.]],tilted:1,threshold:-2.4886541068553925e-003,right_val:0.1043419018387795,left_val:-0.8937227129936218}],threshold:-1.1141099929809570},{simpleClassifiers:[{features:[[16,18,1,2,-1.],[16,19,1,1,2.]],tilted:0,threshold:-5.7590808864915743e-005,right_val:-0.6426038742065430,left_val:0.2734906971454620},{features:[[21,14,2,8,-1.],[22,14,1,8,2.]],tilted:0,threshold:7.1206100983545184e-004,right_val:0.2552855014801025,left_val:-0.5435984134674072},{features:[[0,7,21,9,-1.],[7,10,7,3,9.]],tilted:0,threshold:-0.3888005912303925,right_val:-0.1862079948186874,left_val:0.6930956840515137},{features:[[16,16,1,4,-1.],[16,17,1,2,2.]],tilted:0,threshold:2.5288251345045865e-004,right_val:-0.5620415806770325,left_val:0.2914173901081085},{features:[[19,15,2,6,-1.],[17,17,2,2,3.]],tilted:1,threshold:-2.1006830502301455e-003,right_val:0.1185996010899544,left_val:-0.6822040081024170},{features:[[6,0,15,4,-1.],[6,1,15,2,2.]],tilted:0,threshold:-3.2310429960489273e-003,right_val:-0.2774995863437653,left_val:0.3972072899341583},{features:[[9,16,1,4,-1.],[9,17,1,2,2.]],tilted:0,threshold:1.4478569937637076e-005,right_val:0.2119608968496323,left_val:-0.5476933717727661},{features:[[8,20,8,2,-1.],[8,20,4,1,2.],[12,21,4,1,2.]],tilted:0,threshold:-9.0244162129238248e-004,right_val:0.1194489970803261,left_val:-0.8646997213363648},{features:[[0,9,3,14,-1.],[1,9,1,14,3.]],tilted:0,threshold:-1.5906910412013531e-003,right_val:-0.3928124904632568,left_val:0.2919914126396179},{features:[[11,1,11,4,-1.],[11,1,11,2,2.]],tilted:1,threshold:7.4913240969181061e-003,right_val:-0.4020768105983734,left_val:0.2679530084133148}],threshold:-1.0776710510253906},{simpleClassifiers:[{features:[[15,20,1,2,-1.],[15,21,1,1,2.]],tilted:0,threshold:-7.1240079705603421e-005,right_val:-0.4779424071311951,left_val:0.2823083102703095},{features:[[2,18,1,2,-1.],[2,18,1,1,2.]],tilted:1,threshold:-2.6417701155878603e-004,right_val:-0.4036655128002167,left_val:0.3084900975227356},{features:[[0,14,12,6,-1.],[0,16,12,2,3.]],tilted:0,threshold:5.2890321239829063e-004,right_val:0.1605536937713623,left_val:-0.7423822879791260},{features:[[4,10,2,14,-1.],[4,10,1,7,2.],[5,17,1,7,2.]],tilted:0,threshold:3.8283021422103047e-004,right_val:0.1794416010379791,left_val:-0.6108828783035278},{features:[[22,3,2,15,-1.],[23,3,1,15,2.]],tilted:0,threshold:5.4077422246336937e-003,right_val:0.4017147123813629,left_val:-0.2767061889171600},{features:[[4,17,3,1,-1.],[5,18,1,1,3.]],tilted:1,threshold:-8.2620367174968123e-004,right_val:0.1641048043966293,left_val:-0.8456827998161316},{features:[[21,6,3,9,-1.],[21,9,3,3,3.]],tilted:0,threshold:-8.9606801047921181e-003,right_val:0.1270485967397690,left_val:-0.6698572039604187},{features:[[1,7,23,4,-1.],[1,9,23,2,2.]],tilted:0,threshold:-3.0286349356174469e-003,right_val:-0.7880274057388306,left_val:0.1227105036377907},{features:[[4,3,20,20,-1.],[4,13,20,10,2.]],tilted:0,threshold:-0.0262723900377750,right_val:0.1347829997539520,left_val:-0.7226560711860657},{features:[[14,13,7,4,-1.],[14,15,7,2,2.]],tilted:0,threshold:-5.0153239862993360e-004,right_val:-0.3537223935127258,left_val:0.2890014052391052},{features:[[2,6,2,2,-1.],[2,6,2,1,2.]],tilted:1,threshold:-1.9847620569635183e-004,right_val:-0.4667024016380310,left_val:0.2491115033626556}],threshold:-1.1201709508895874},{simpleClassifiers:[{features:[[13,15,6,4,-1.],[13,17,6,2,2.]],tilted:0,threshold:-1.6098109772428870e-003,right_val:-0.5425583124160767,left_val:0.2436411976814270},{features:[[17,0,7,24,-1.],[17,8,7,8,3.]],tilted:0,threshold:3.0391800682991743e-003,right_val:-0.7677937150001526,left_val:0.1427879035472870},{features:[[3,7,20,8,-1.],[13,7,10,8,2.]],tilted:0,threshold:-0.0111625995486975,right_val:0.1309580951929092,left_val:-0.7964649796485901},{features:[[0,7,22,1,-1.],[11,7,11,1,2.]],tilted:0,threshold:-1.6689340118318796e-003,right_val:-0.4947401881217957,left_val:0.2306797951459885},{features:[[7,9,8,2,-1.],[7,10,8,1,2.]],tilted:0,threshold:-8.8481552666053176e-004,right_val:-0.5158239006996155,left_val:0.2005017995834351},{features:[[2,0,3,18,-1.],[2,6,3,6,3.]],tilted:0,threshold:-2.6040559168905020e-003,right_val:-0.7818121910095215,left_val:0.1298092007637024},{features:[[2,13,3,5,-1.],[3,13,1,5,3.]],tilted:0,threshold:-2.3444599355570972e-004,right_val:0.1478334069252014,left_val:-0.5695487260818481},{features:[[14,16,3,4,-1.],[15,16,1,4,3.]],tilted:0,threshold:8.4604357834905386e-004,right_val:-0.8308842182159424,left_val:0.1037243008613586},{features:[[10,0,12,3,-1.],[10,1,12,1,3.]],tilted:0,threshold:-2.4807569570839405e-003,right_val:-0.2719523906707764,left_val:0.3425926864147186},{features:[[15,16,3,1,-1.],[16,17,1,1,3.]],tilted:1,threshold:-1.1127090547233820e-003,right_val:0.1176175028085709,left_val:-0.8275328278541565},{features:[[22,13,2,5,-1.],[23,13,1,5,2.]],tilted:0,threshold:1.4298419700935483e-003,right_val:0.2652699053287506,left_val:-0.3477616012096405},{features:[[11,14,4,6,-1.],[11,16,4,2,3.]],tilted:0,threshold:-1.4572150539606810e-003,right_val:0.1092033982276917,left_val:-0.8802363276481628}],threshold:-1.0063530206680298},{simpleClassifiers:[{features:[[14,15,1,2,-1.],[14,16,1,1,2.]],tilted:0,threshold:-1.4507149899145588e-005,right_val:-0.4580149054527283,left_val:0.2605004012584686},{features:[[6,3,6,5,-1.],[6,3,3,5,2.]],tilted:1,threshold:0.0136784398928285,right_val:0.1477705985307694,left_val:-0.7149971723556519},{features:[[2,8,1,2,-1.],[2,8,1,1,2.]],tilted:1,threshold:-7.3151881224475801e-005,right_val:-0.4995836019515991,left_val:0.2058611065149307},{features:[[9,17,4,4,-1.],[9,18,4,2,2.]],tilted:0,threshold:-6.7043182207271457e-004,right_val:0.1358278989791870,left_val:-0.7319483757019043},{features:[[10,6,4,5,-1.],[11,6,2,5,2.]],tilted:0,threshold:-1.1992789804935455e-003,right_val:-0.2521241009235382,left_val:0.4456472992897034},{features:[[2,21,12,2,-1.],[8,21,6,2,2.]],tilted:0,threshold:-0.0117351496592164,right_val:0.1424607038497925,left_val:-0.7972438931465149},{features:[[12,8,12,15,-1.],[16,8,4,15,3.]],tilted:0,threshold:-4.7361929900944233e-003,right_val:-0.5223402976989746,left_val:0.1624221056699753},{features:[[0,3,20,20,-1.],[0,13,20,10,2.]],tilted:0,threshold:-0.1084595024585724,right_val:0.1265926957130432,left_val:-0.7962973713874817},{features:[[16,17,4,2,-1.],[16,17,4,1,2.]],tilted:1,threshold:-3.2293208641931415e-004,right_val:0.0899520069360733,left_val:-0.7129234075546265},{features:[[21,14,2,5,-1.],[21,14,1,5,2.]],tilted:1,threshold:2.5980910286307335e-003,right_val:0.3197942078113556,left_val:-0.2800100147724152},{features:[[12,0,12,8,-1.],[12,0,12,4,2.]],tilted:1,threshold:-7.5798099860548973e-003,right_val:0.1406804025173187,left_val:-0.7153301239013672},{features:[[17,0,7,24,-1.],[17,6,7,12,2.]],tilted:0,threshold:-8.4003582596778870e-003,right_val:-0.6506950259208679,left_val:0.1168404966592789},{features:[[13,10,3,6,-1.],[13,12,3,2,3.]],tilted:0,threshold:3.6820198874920607e-003,right_val:0.3865979909896851,left_val:-0.2631436884403229}],threshold:-1.0373339653015137},{simpleClassifiers:[{features:[[8,11,9,9,-1.],[11,14,3,3,9.]],tilted:0,threshold:0.0240733902901411,right_val:0.2617827057838440,left_val:-0.4794333875179291},{features:[[17,18,7,6,-1.],[17,21,7,3,2.]],tilted:0,threshold:1.9582170061767101e-003,right_val:0.2301298975944519,left_val:-0.4434475898742676},{features:[[9,8,4,2,-1.],[9,9,4,1,2.]],tilted:0,threshold:-2.0559200493153185e-004,right_val:-0.7277694940567017,left_val:0.1224080994725227},{features:[[7,7,7,6,-1.],[7,9,7,2,3.]],tilted:0,threshold:1.0637210216373205e-003,right_val:0.6447200775146484,left_val:-0.1582341045141220},{features:[[2,9,1,9,-1.],[2,12,1,3,3.]],tilted:0,threshold:-3.5040560760535300e-004,right_val:0.2033808976411820,left_val:-0.5160586237907410},{features:[[1,0,1,20,-1.],[1,10,1,10,2.]],tilted:0,threshold:-1.5382179990410805e-003,right_val:-0.5412080287933350,left_val:0.2029495984315872},{features:[[5,11,4,3,-1.],[5,11,2,3,2.]],tilted:1,threshold:4.2215911671519279e-003,right_val:-0.6884710788726807,left_val:0.1420246958732605},{features:[[1,6,14,13,-1.],[8,6,7,13,2.]],tilted:0,threshold:4.0536639280617237e-003,right_val:-0.8890265226364136,left_val:0.0946411192417145},{features:[[11,6,6,4,-1.],[13,6,2,4,3.]],tilted:0,threshold:3.9104130119085312e-003,right_val:0.4553441107273102,left_val:-0.2211245000362396},{features:[[15,20,2,2,-1.],[15,20,2,1,2.]],tilted:1,threshold:-5.8839347911998630e-004,right_val:0.1466006040573120,left_val:-0.7423400878906250},{features:[[11,7,11,2,-1.],[11,8,11,1,2.]],tilted:0,threshold:4.7331111272796988e-004,right_val:-0.8416292071342468,left_val:0.0803736001253128},{features:[[14,0,7,4,-1.],[14,1,7,2,2.]],tilted:0,threshold:-1.4589539496228099e-003,right_val:-0.2989330887794495,left_val:0.2730404138565064}],threshold:-0.9257612824440002}],size:[24,24],tilted:true};
+})(jsfeat.haar);
View
7 cascades/handopen.js
@@ -0,0 +1,7 @@
+/**
+ * this cascade is derived from https://github.com/mtschirs/js-objectdetect implementation
+ * @author Martin Tschirsich / http://www.tu-darmstadt.de/~m_t
+ */
+(function(global) {
+ global.handopen = {complexClassifiers:[{simpleClassifiers:[{features:[[0,2,24,21,-1.],[6,2,12,21,2.]],tilted:0,threshold:1.5003059804439545e-001,right_val:6.7985910177230835e-001,left_val:-8.1184512376785278e-001},{features:[[21,1,2,6,-1.],[21,1,2,3,2.]],tilted:1,threshold:-2.6187319308519363e-003,right_val:-2.4056260287761688e-001,left_val:1.4523890614509583e-001},{features:[[0,0,2,25,-1.],[1,0,1,25,2.]],tilted:0,threshold:1.3353739632293582e-003,right_val:3.6618021130561829e-001,left_val:-6.0511720180511475e-001},{features:[[2,16,21,9,-1.],[2,19,21,3,3.]],tilted:0,threshold:3.1417140271514654e-003,right_val:2.5102201104164124e-001,left_val:-4.9187308549880981e-001},{features:[[3,0,19,8,-1.],[3,2,19,4,2.]],tilted:0,threshold:6.2333769164979458e-004,right_val:2.6779899001121521e-001,left_val:-4.6784201264381409e-001},{features:[[11,0,10,22,-1.],[11,0,5,22,2.]],tilted:0,threshold:5.8959048241376877e-002,right_val:1.9723750650882721e-001,left_val:-1.6091950237751007e-001},{features:[[4,0,10,22,-1.],[9,0,5,22,2.]],tilted:0,threshold:6.2947690486907959e-002,right_val:3.6813440918922424e-001,left_val:-3.6895948648452759e-001}],threshold:-1.4329270124435425e+000},{simpleClassifiers:[{features:[[0,0,24,25,-1.],[6,0,12,25,2.]],tilted:0,threshold:2.3747350275516510e-001,right_val:4.9667519330978394e-001,left_val:-6.5408688783645630e-001},{features:[[21,1,4,22,-1.],[21,1,2,22,2.]],tilted:0,threshold:5.0346520729362965e-003,right_val:3.3853441476821899e-001,left_val:-6.9200718402862549e-001},{features:[[0,1,4,22,-1.],[2,1,2,22,2.]],tilted:0,threshold:3.9370087906718254e-003,right_val:2.1448600292205811e-001,left_val:-6.5886509418487549e-001},{features:[[2,1,21,21,-1.],[9,1,7,21,3.]],tilted:0,threshold:5.0707049667835236e-003,right_val:5.9291750192642212e-002,left_val:-5.2522331476211548e-001},{features:[[2,0,19,8,-1.],[2,2,19,4,2.]],tilted:0,threshold:3.4051720285788178e-004,right_val:2.4072030186653137e-001,left_val:-5.2820461988449097e-001},{features:[[2,17,21,8,-1.],[2,19,21,4,2.]],tilted:0,threshold:1.2807789971702732e-005,right_val:1.9243550300598145e-001,left_val:-5.5176711082458496e-001},{features:[[2,11,6,3,-1.],[4,11,2,3,3.]],tilted:0,threshold:-5.3984248079359531e-003,right_val:-2.4212449789047241e-001,left_val:4.7871538996696472e-001},{features:[[9,1,7,24,-1.],[9,13,7,12,2.]],tilted:0,threshold:1.3651129603385925e-001,right_val:4.9736741185188293e-001,left_val:-1.6812080144882202e-001},{features:[[7,0,11,24,-1.],[7,12,11,12,2.]],tilted:0,threshold:-1.9071920216083527e-001,right_val:-2.9403430223464966e-001,left_val:6.0721081495285034e-001},{features:[[1,0,23,2,-1.],[1,1,23,1,2.]],tilted:0,threshold:1.2038889690302312e-004,right_val:2.4322469532489777e-001,left_val:-4.9244078993797302e-001},{features:[[9,11,6,3,-1.],[11,11,2,3,3.]],tilted:0,threshold:-6.1202510260045528e-003,right_val:-2.5555029511451721e-001,left_val:5.7662928104400635e-001}],threshold:-1.3557660579681396e+000},{simpleClassifiers:[{features:[[0,5,24,15,-1.],[8,5,8,15,3.]],tilted:0,threshold:1.8524490296840668e-001,right_val:3.3992278575897217e-001,left_val:-5.9384208917617798e-001},{features:[[23,0,2,25,-1.],[23,0,1,25,2.]],tilted:0,threshold:1.2689189752563834e-003,right_val:2.5343731045722961e-001,left_val:-6.4463311433792114e-001},{features:[[0,0,2,25,-1.],[1,0,1,25,2.]],tilted:0,threshold:8.5763330571353436e-004,right_val:2.4189129471778870e-001,left_val:-6.7231202125549316e-001},{features:[[5,5,15,15,-1.],[5,10,15,5,3.]],tilted:0,threshold:-1.6834350302815437e-002,right_val:-4.3302649259567261e-001,left_val:3.2584258913993835e-001},{features:[[3,23,19,2,-1.],[3,24,19,1,2.]],tilted:0,threshold:-2.4595179638708942e-005,right_val:-5.1088571548461914e-001,left_val:2.5265690684318542e-001},{features:[[2,5,21,15,-1.],[9,10,7,5,9.]],tilted:0,threshold:1.7257420113310218e-003,right_val:1.2177280336618423e-001,left_val:-4.4695881009101868e-001},{features:[[10,5,5,20,-1.],[10,15,5,10,2.]],tilted:0,threshold:4.7322191298007965e-002,right_val:4.1599690914154053e-001,left_val:-2.6065969467163086e-001},{features:[[9,0,7,22,-1.],[9,11,7,11,2.]],tilted:0,threshold:-9.2192016541957855e-002,right_val:-2.9402649402618408e-001,left_val:4.9446830153465271e-001},{features:[[0,0,24,4,-1.],[0,2,24,2,2.]],tilted:0,threshold:2.5826389901340008e-003,right_val:2.5506868958473206e-001,left_val:-4.6076709032058716e-001},{features:[[11,10,4,5,-1.],[12,10,2,5,2.]],tilted:0,threshold:-3.0530600342899561e-003,right_val:-2.3860910534858704e-001,left_val:5.1746541261672974e-001},{features:[[11,11,3,3,-1.],[12,11,1,3,3.]],tilted:0,threshold:1.4302280033007264e-003,right_val:5.9509581327438354e-001,left_val:-1.8288139998912811e-001},{features:[[1,0,24,25,-1.],[9,0,8,25,3.]],tilted:0,threshold:2.3731220513582230e-002,right_val:1.1410690099000931e-001,left_val:-8.0241280794143677e-001},{features:[[10,11,4,3,-1.],[11,11,2,3,2.]],tilted:0,threshold:-1.7200269503518939e-003,right_val:-3.3559548854827881e-001,left_val:4.9770259857177734e-001},{features:[[23,19,2,4,-1.],[23,19,1,4,2.]],tilted:1,threshold:2.4453289370285347e-005,right_val:2.5604829192161560e-001,left_val:-4.0247130393981934e-001},{features:[[2,19,4,2,-1.],[2,19,4,1,2.]],tilted:1,threshold:2.2456999431597069e-005,right_val:1.9648410379886627e-001,left_val:-5.7257527112960815e-001},{features:[[19,0,6,2,-1.],[19,0,6,1,2.]],tilted:1,threshold:-1.1040309800591785e-005,right_val:-5.3783118724822998e-001,left_val:1.9324329495429993e-001},{features:[[5,0,2,5,-1.],[5,0,1,5,2.]],tilted:1,threshold:-2.4118829969665967e-005,right_val:-5.0164592266082764e-001,left_val:2.0425009727478027e-001},{features:[[24,23,1,2,-1.],[24,24,1,1,2.]],tilted:0,threshold:-2.9135821387171745e-004,right_val:1.1119560152292252e-001,left_val:-7.6120328903198242e-001},{features:[[0,0,1,24,-1.],[0,12,1,12,2.]],tilted:0,threshold:2.2033160552382469e-002,right_val:-9.1618537902832031e-001,left_val:5.7622238993644714e-002},{features:[[24,7,1,18,-1.],[24,16,1,9,2.]],tilted:0,threshold:-1.2498879805207253e-002,right_val:1.3170750439167023e-001,left_val:-7.2695672512054443e-001}],threshold:-1.5641080141067505e+000},{simpleClassifiers:[{features:[[0,0,12,25,-1.],[6,0,6,25,2.]],tilted:0,threshold:8.8611230254173279e-002,right_val:3.5186940431594849e-001,left_val:-6.6486412286758423e-001},{features:[[1,7,24,11,-1.],[9,7,8,11,3.]],tilted:0,threshold:2.5681449100375175e-002,right_val:9.6691556274890900e-002,left_val:-8.6079347133636475e-001},{features:[[0,1,2,24,-1.],[1,1,1,24,2.]],tilted:0,threshold:2.2021760742063634e-005,right_val:1.1921170353889465e-001,left_val:-8.0106097459793091e-001},{features:[[0,13,25,12,-1.],[0,16,25,6,2.]],tilted:0,threshold:2.0681109745055437e-003,right_val:2.0666299760341644e-001,left_val:-6.6451412439346313e-001},{features:[[0,0,25,12,-1.],[0,3,25,6,2.]],tilted:0,threshold:1.6312770312651992e-003,right_val:2.5481811165809631e-001,left_val:-6.8381088972091675e-001},{features:[[1,0,24,25,-1.],[9,0,8,25,3.]],tilted:0,threshold:1.9836429506540298e-002,right_val:1.2496689707040787e-001,left_val:-9.5206391811370850e-001},{features:[[3,0,19,4,-1.],[3,1,19,2,2.]],tilted:0,threshold:2.2290700144367293e-005,right_val:1.9276830554008484e-001,left_val:-7.0204389095306396e-001},{features:[[1,23,24,2,-1.],[1,24,24,1,2.]],tilted:0,threshold:-2.2802520106779411e-005,right_val:-7.8502702713012695e-001,left_val:2.1565049886703491e-001},{features:[[10,5,4,20,-1.],[10,15,4,10,2.]],tilted:0,threshold:3.5834241658449173e-002,right_val:5.3787577152252197e-001,left_val:-3.8406941294670105e-001},{features:[[14,6,1,14,-1.],[14,6,1,7,2.]],tilted:1,threshold:1.0084280074806884e-004,right_val:2.4612200260162354e-001,left_val:-6.8384587764739990e-001},{features:[[4,23,15,2,-1.],[4,24,15,1,2.]],tilted:0,threshold:2.6884470134973526e-002,right_val:-2.6435000000000000e+003,left_val:-2.9663830995559692e-001},{features:[[24,0,1,24,-1.],[24,12,1,12,2.]],tilted:0,threshold:2.0637569949030876e-002,right_val:-7.9614728689193726e-001,left_val:5.3151738643646240e-001},{features:[[0,0,1,16,-1.],[0,8,1,8,2.]],tilted:0,threshold:-8.8602686300873756e-003,right_val:1.8032559752464294e-001,left_val:-7.8123009204864502e-001},{features:[[18,7,4,11,-1.],[18,7,2,11,2.]],tilted:0,threshold:-7.8016798943281174e-003,right_val:-1.0996480286121368e-001,left_val:1.7774020135402679e-001},{features:[[0,2,14,23,-1.],[7,2,7,23,2.]],tilted:0,threshold:1.1463870108127594e-001,right_val:-2.2767600417137146e-001,left_val:5.1441919803619385e-001},{features:[[24,23,1,2,-1.],[24,24,1,1,2.]],tilted:0,threshold:-2.6180568966083229e-004,right_val:1.1731670051813126e-001,left_val:-6.9460737705230713e-001},{features:[[0,23,1,2,-1.],[0,24,1,1,2.]],tilted:0,threshold:-2.8006930369883776e-004,right_val:1.0120259970426559e-001,left_val:-7.9735141992568970e-001}],threshold:-1.4591870307922363e+000},{simpleClassifiers:[{features:[[0,0,1,2,-1.],[0,1,1,1,2.]],tilted:0,threshold:2.9352991259656847e-004,right_val:-7.6414722204208374e-001,left_val:1.3833090662956238e-001},{features:[[24,5,1,20,-1.],[24,15,1,10,2.]],tilted:0,threshold:-1.5867210924625397e-002,right_val:5.1472321152687073e-002,left_val:-9.0028488636016846e-001},{features:[[0,5,1,20,-1.],[0,15,1,10,2.]],tilted:0,threshold:-1.6637140884995461e-002,right_val:1.0005489736795425e-001,left_val:-8.9705729484558105e-001},{features:[[3,1,19,24,-1.],[3,13,19,12,2.]],tilted:0,threshold:-3.3240309357643127e-001,right_val:-1.9235250353813171e-001,left_val:4.9737390875816345e-001},{features:[[5,0,15,24,-1.],[5,12,15,12,2.]],tilted:0,threshold:2.4854320287704468e-001,right_val:4.5927569270133972e-001,left_val:-2.7211311459541321e-001},{features:[[24,7,1,18,-1.],[24,16,1,9,2.]],tilted:0,threshold:1.1056589893996716e-002,right_val:-7.7563858032226563e-001,left_val:1.1864840239286423e-001},{features:[[8,8,8,10,-1.],[8,13,8,5,2.]],tilted:0,threshold:1.8648169934749603e-001,right_val:-1.1346250000000000e+003,left_val:-1.2418299913406372e-002},{features:[[24,7,1,18,-1.],[24,16,1,9,2.]],tilted:0,threshold:1.7597459256649017e-002,right_val:-8.4127980470657349e-001,left_val:2.5591930374503136e-002},{features:[[0,7,1,18,-1.],[0,16,1,9,2.]],tilted:0,threshold:1.1070669628679752e-002,right_val:-7.1428167819976807e-001,left_val:1.0083609819412231e-001},{features:[[0,13,25,12,-1.],[0,16,25,6,2.]],tilted:0,threshold:1.6768550500273705e-002,right_val:1.9811430573463440e-001,left_val:-3.3646050095558167e-001},{features:[[4,0,14,14,-1.],[4,7,14,7,2.]],tilted:0,threshold:4.3410068750381470e-001,right_val:-1.2339289550781250e+003,left_val:-9.3027588445693254e-004},{features:[[23,0,2,2,-1.],[23,1,2,1,2.]],tilted:0,threshold:4.6659549116156995e-004,right_val:-5.8821451663970947e-001,left_val:1.2081030011177063e-001},{features:[[0,0,25,2,-1.],[0,1,25,1,2.]],tilted:0,threshold:1.9694319926202297e-003,right_val:2.1227480471134186e-001,left_val:-3.2620209455490112e-001},{features:[[12,11,4,4,-1.],[13,11,2,4,2.]],tilted:0,threshold:-2.8702169656753540e-003,right_val:-1.4962139725685120e-001,left_val:4.8137769103050232e-001},{features:[[9,11,4,4,-1.],[10,11,2,4,2.]],tilted:0,threshold:-3.4756050445139408e-003,right_val:-1.3120299577713013e-001,left_val:5.2802997827529907e-001},{features:[[23,0,2,4,-1.],[23,1,2,2,2.]],tilted:0,threshold:-5.4196082055568695e-004,right_val:1.2100230157375336e-001,left_val:-5.3317350149154663e-001},{features:[[2,22,1,2,-1.],[2,22,1,1,2.]],tilted:1,threshold:-9.3427370302379131e-004,right_val:5.8498218655586243e-002,left_val:-8.8130372762680054e-001},{features:[[24,22,1,2,-1.],[24,23,1,1,2.]],tilted:0,threshold:-2.8417719295248389e-004,right_val:6.8724647164344788e-002,left_val:-6.2143480777740479e-001},{features:[[0,23,25,2,-1.],[0,24,25,1,2.]],tilted:0,threshold:-4.0356540121138096e-003,right_val:-2.3718340694904327e-001,left_val:2.6959720253944397e-001},{features:[[24,21,1,4,-1.],[24,23,1,2,2.]],tilted:0,threshold:7.0708477869629860e-004,right_val:-4.5742911100387573e-001,left_val:8.4266871213912964e-002}],threshold:-1.1637979745864868e+000},{simpleClassifiers:[{features:[[2,22,1,2,-1.],[2,22,1,1,2.]],tilted:1,threshold:4.6358350664377213e-004,right_val:-3.8676708936691284e-001,left_val:1.8896600604057312e-001},{features:[[23,0,2,25,-1.],[23,0,1,25,2.]],tilted:0,threshold:3.8987519219517708e-003,right_val:3.1238529086112976e-001,left_val:-3.9730489253997803e-001},{features:[[0,0,10,25,-1.],[5,0,5,25,2.]],tilted:0,threshold:5.8029189705848694e-002,right_val:1.5904699265956879e-001,left_val:-5.0608777999877930e-001},{features:[[1,0,24,25,-1.],[1,0,12,25,2.]],tilted:0,threshold:-5.4033267498016357e-001,right_val:1.1976829916238785e-001,left_val:-7.6801401376724243e-001},{features:[[0,1,1,24,-1.],[0,7,1,12,2.]],tilted:0,threshold:1.2194709852337837e-002,right_val:-8.2098531723022461e-001,left_val:6.5259806811809540e-002},{features:[[23,0,2,25,-1.],[23,0,1,25,2.]],tilted:0,threshold:8.4217172116041183e-004,right_val:3.1723741441965103e-002,left_val:-2.5191161036491394e-001},{features:[[0,1,2,24,-1.],[1,1,1,24,2.]],tilted:0,threshold:3.8863120134919882e-003,right_val:2.2988179326057434e-001,left_val:-3.1038621068000793e-001},{features:[[24,1,1,2,-1.],[24,1,1,1,2.]],tilted:1,threshold:8.8707922259345651e-004,right_val:-6.9049417972564697e-001,left_val:6.5289810299873352e-002},{features:[[1,1,2,1,-1.],[1,1,1,1,2.]],tilted:1,threshold:-4.1859821067191660e-004,right_val:1.8126510083675385e-001,left_val:-3.9824271202087402e-001},{features:[[24,0,1,22,-1.],[24,11,1,11,2.]],tilted:0,threshold:-1.7866320908069611e-002,right_val:7.5951322913169861e-002,left_val:-9.4715738296508789e-001},{features:[[0,0,1,24,-1.],[0,8,1,8,3.]],tilted:0,threshold:-1.1730570346117020e-002,right_val:7.1461476385593414e-002,left_val:-6.8169498443603516e-001},{features:[[5,5,15,15,-1.],[5,10,15,5,3.]],tilted:0,threshold:-1.8845280632376671e-002,right_val:-2.7402049303054810e-001,left_val:2.6420509815216064e-001},{features:[[1,0,2,1,-1.],[1,0,1,1,2.]],tilted:1,threshold:5.1623297622427344e-004,right_val:-6.5890562534332275e-001,left_val:8.9989356696605682e-002},{features:[[17,12,2,6,-1.],[18,12,1,3,2.],[17,15,1,3,2.]],tilted:0,threshold:-1.9588230643421412e-003,right_val:-1.2648980319499969e-001,left_val:4.4965040683746338e-001},{features:[[6,12,2,6,-1.],[6,12,1,3,2.],[7,15,1,3,2.]],tilted:0,threshold:-1.8352799816057086e-003,right_val:-1.2392920255661011e-001,left_val:4.4554790854454041e-001},{features:[[14,12,6,2,-1.],[16,12,2,2,3.]],tilted:0,threshold:-4.6895779669284821e-003,right_val:-1.3527210056781769e-001,left_val:4.2773500084877014e-001},{features:[[0,8,18,9,-1.],[6,8,6,9,3.]],tilted:0,threshold:1.9215959310531616e-001,right_val:-7.4916952848434448e-001,left_val:8.4252431988716125e-002},{features:[[23,11,2,4,-1.],[23,12,2,2,2.]],tilted:0,threshold:5.6411779951304197e-004,right_val:-5.6502771377563477e-001,left_val:7.7006638050079346e-002},{features:[[9,10,4,3,-1.],[10,10,2,3,2.]],tilted:0,threshold:2.8751920908689499e-003,right_val:4.1225358843803406e-001,left_val:-1.3198760151863098e-001},{features:[[7,18,12,4,-1.],[7,19,12,2,2.]],tilted:0,threshold:7.7192699536681175e-003,right_val:-8.4410911798477173e-001,left_val:7.7505782246589661e-002},{features:[[9,10,4,3,-1.],[10,10,2,3,2.]],tilted:0,threshold:-1.6325690085068345e-003,right_val:-1.5619030594825745e-001,left_val:3.3561250567436218e-001},{features:[[23,11,2,4,-1.],[23,12,2,2,2.]],tilted:0,threshold:-5.6915491586551070e-004,right_val:8.1965819001197815e-002,left_val:-3.4847769141197205e-001},{features:[[4,3,16,22,-1.],[4,14,16,11,2.]],tilted:0,threshold:-2.1694660186767578e-001,right_val:-1.4847409725189209e-001,left_val:3.1710639595985413e-001},{features:[[4,0,21,24,-1.],[4,12,21,12,2.]],tilted:0,threshold:2.5057300925254822e-001,right_val:3.4584110975265503e-001,left_val:-2.3321990668773651e-001}],threshold:-1.2382400035858154e+000},{simpleClassifiers:[{features:[[0,0,24,25,-1.],[8,0,8,25,3.]],tilted:0,threshold:3.6485868692398071e-001,right_val:2.0066380500793457e-001,left_val:-3.6243289709091187e-001},{features:[[20,6,2,8,-1.],[21,6,1,4,2.],[20,10,1,4,2.]],tilted:0,threshold:-3.7072061095386744e-003,right_val:-1.2000480294227600e-001,left_val:5.8469599485397339e-001},{features:[[3,6,2,8,-1.],[3,6,1,4,2.],[4,10,1,4,2.]],tilted:0,threshold:-3.7888090591877699e-003,right_val:-9.6978336572647095e-002,left_val:5.5193948745727539e-001},{features:[[6,4,16,21,-1.],[10,4,8,21,2.]],tilted:0,threshold:6.6407203674316406e-002,right_val:9.7074352204799652e-002,left_val:-1.8292060494422913e-001},{features:[[0,2,4,19,-1.],[2,2,2,19,2.]],tilted:0,threshold:3.8407989777624607e-003,right_val:1.3275340199470520e-001,left_val:-4.5010709762573242e-001},{features:[[24,0,1,20,-1.],[24,10,1,10,2.]],tilted:0,threshold:1.5176840126514435e-002,right_val:-8.2534867525100708e-001,left_val:8.6718283593654633e-002},{features:[[5,3,15,22,-1.],[5,14,15,11,2.]],tilted:0,threshold:2.1945759654045105e-001,right_val:3.5320338606834412e-001,left_val:-1.6291670501232147e-001},{features:[[9,0,7,20,-1.],[9,10,7,10,2.]],tilted:0,threshold:-7.7002197504043579e-002,right_val:-1.9850799441337585e-001,left_val:3.8327819108963013e-001},{features:[[1,0,22,2,-1.],[1,1,22,1,2.]],tilted:0,threshold:5.0508929416537285e-003,right_val:2.8920450806617737e-001,left_val:-1.9514580070972443e-001},{features:[[24,0,1,20,-1.],[24,10,1,10,2.]],tilted:0,threshold:-1.6207909211516380e-002,right_val:4.6221490949392319e-002,left_val:-7.8625917434692383e-001},{features:[[0,0,1,20,-1.],[0,10,1,10,2.]],tilted:0,threshold:1.6638509929180145e-002,right_val:-8.7408941984176636e-001,left_val:5.8282759040594101e-002},{features:[[24,0,1,22,-1.],[24,11,1,11,2.]],tilted:0,threshold:-4.7077341005206108e-003,right_val:-9.1372027993202209e-002,left_val:1.0838989913463593e-001},{features:[[0,0,1,22,-1.],[0,11,1,11,2.]],tilted:0,threshold:-1.7989320680499077e-002,right_val:7.1595683693885803e-002,left_val:-7.6009011268615723e-001},{features:[[1,17,24,8,-1.],[1,21,24,4,2.]],tilted:0,threshold:-2.2045580670237541e-002,right_val:-2.5301960110664368e-001,left_val:2.0044830441474915e-001},{features:[[3,0,19,18,-1.],[3,9,19,9,2.]],tilted:0,threshold:1.0939480364322662e-001,right_val:2.8172031044960022e-001,left_val:-1.9698250293731689e-001},{features:[[23,23,1,2,-1.],[23,24,1,1,2.]],tilted:0,threshold:3.2741879113018513e-004,right_val:-6.2705790996551514e-001,left_val:7.4757352471351624e-002},{features:[[1,23,1,2,-1.],[1,24,1,1,2.]],tilted:0,threshold:3.3313198946416378e-004,right_val:-6.4261537790298462e-001,left_val:6.0775469988584518e-002},{features:[[23,21,2,4,-1.],[23,22,2,2,2.]],tilted:0,threshold:4.3790769996121526e-004,right_val:-4.7836649417877197e-001,left_val:7.6970867812633514e-002},{features:[[0,21,2,4,-1.],[0,22,2,2,2.]],tilted:0,threshold:4.5484420843422413e-004,right_val:-4.8621150851249695e-001,left_val:9.0992778539657593e-002},{features:[[2,17,21,8,-1.],[2,19,21,4,2.]],tilted:0,threshold:7.2560198605060577e-003,right_val:1.9337640702724457e-001,left_val:-2.6507800817489624e-001},{features:[[10,11,4,2,-1.],[11,11,2,2,2.]],tilted:0,threshold:-2.2607750725001097e-003,right_val:-1.1367010325193405e-001,left_val:4.2049959301948547e-001},{features:[[12,12,3,2,-1.],[13,12,1,2,3.]],tilted:0,threshold:-1.1031399480998516e-003,right_val:-1.0477790236473083e-001,left_val:3.4452688694000244e-001},{features:[[4,2,14,4,-1.],[4,3,14,2,2.]],tilted:0,threshold:-1.9140050280839205e-003,right_val:9.9808588624000549e-002,left_val:-4.7198608517646790e-001},{features:[[9,4,8,2,-1.],[9,5,8,1,2.]],tilted:0,threshold:-2.2288530599325895e-003,right_val:5.8708198368549347e-002,left_val:-6.2563192844390869e-001},{features:[[10,10,2,6,-1.],[10,10,1,3,2.],[11,13,1,3,2.]],tilted:0,threshold:-2.1744300611317158e-003,right_val:-1.1335399746894836e-001,left_val:4.3151539564132690e-001},{features:[[13,8,2,8,-1.],[14,8,1,4,2.],[13,12,1,4,2.]],tilted:0,threshold:2.8203260153532028e-003,right_val:3.8637679815292358e-001,left_val:-9.0162709355354309e-002},{features:[[3,10,18,12,-1.],[9,14,6,4,9.]],tilted:0,threshold:3.4067618846893311e-001,right_val:-8.3676660060882568e-001,left_val:5.5690128356218338e-002},{features:[[0,11,25,3,-1.],[0,12,25,1,3.]],tilted:0,threshold:6.3827941194176674e-003,right_val:-7.8409391641616821e-001,left_val:3.7600088864564896e-002},{features:[[0,0,25,12,-1.],[0,3,25,6,2.]],tilted:0,threshold:1.1914909631013870e-001,right_val:-9.2239922285079956e-001,left_val:3.1439449638128281e-002},{features:[[24,5,1,10,-1.],[24,10,1,5,2.]],tilted:0,threshold:-4.3900958262383938e-003,right_val:2.1284699440002441e-002,left_val:-3.9533978700637817e-001},{features:[[0,5,1,10,-1.],[0,10,1,5,2.]],tilted:0,threshold:-6.1812077183276415e-004,right_val:-1.7483870685100555e-001,left_val:2.3230640590190887e-001},{features:[[13,22,1,2,-1.],[13,23,1,1,2.]],tilted:0,threshold:-1.9955119933001697e-004,right_val:1.0967289656400681e-001,left_val:-2.8087100386619568e-001}],threshold:-1.1826640367507935e+000},{simpleClassifiers:[{features:[[7,12,3,1,-1.],[8,12,1,1,3.]],tilted:0,threshold:8.8703620713204145e-004,right_val:4.3664848804473877e-001,left_val:-1.4286060631275177e-001},{features:[[15,11,4,5,-1.],[15,11,2,5,2.]],tilted:0,threshold:1.2350199744105339e-002,right_val:2.6076430082321167e-001,left_val:-8.0335199832916260e-002},{features:[[7,11,4,3,-1.],[8,11,2,3,2.]],tilted:0,threshold:-2.5250180624425411e-003,right_val:-1.2449479848146439e-001,left_val:4.5786809921264648e-001},{features:[[14,12,3,1,-1.],[15,12,1,1,3.]],tilted:0,threshold:-7.8186811879277229e-004,right_val:-1.0820990055799484e-001,left_val:4.1217720508575439e-001},{features:[[8,12,3,1,-1.],[9,12,1,1,3.]],tilted:0,threshold:6.6686311038210988e-004,right_val:3.7527379393577576e-001,left_val:-1.4924609661102295e-001},{features:[[23,0,2,25,-1.],[23,0,1,25,2.]],tilted:0,threshold:1.0244899895042181e-003,right_val:1.4233219623565674e-001,left_val:-4.8530641198158264e-001},{features:[[0,0,2,25,-1.],[1,0,1,25,2.]],tilted:0,threshold:1.2527270009741187e-003,right_val:1.6024069488048553e-001,left_val:-4.4631031155586243e-001},{features:[[23,21,2,1,-1.],[23,21,1,1,2.]],tilted:1,threshold:4.7616599476896226e-004,right_val:-2.8740549087524414e-001,left_val:1.4618170261383057e-001},{features:[[2,20,1,2,-1.],[2,20,1,1,2.]],tilted:1,threshold:4.2036260128952563e-004,right_val:-3.5512998700141907e-001,left_val:1.7892700433731079e-001},{features:[[23,0,2,2,-1.],[23,0,1,2,2.]],tilted:0,threshold:4.3912709224969149e-004,right_val:-3.6231538653373718e-001,left_val:1.3554279506206512e-001},{features:[[3,23,19,2,-1.],[3,24,19,1,2.]],tilted:0,threshold:-5.2080918103456497e-003,right_val:-1.6971330344676971e-001,left_val:3.0311760306358337e-001},{features:[[23,0,2,2,-1.],[23,0,1,2,2.]],tilted:0,threshold:-8.5600721649825573e-004,right_val:6.7641116678714752e-002,left_val:-7.8621208667755127e-001},{features:[[0,0,2,2,-1.],[1,0,1,2,2.]],tilted:0,threshold:4.3306438601575792e-004,right_val:-4.1017350554466248e-001,left_val:1.1879850178956985e-001},{features:[[23,0,2,2,-1.],[23,0,1,2,2.]],tilted:0,threshold:2.1799209207529202e-005,right_val:1.0719849914312363e-001,left_val:-1.8755300343036652e-001},{features:[[0,0,2,2,-1.],[1,0,1,2,2.]],tilted:0,threshold:2.2921649360796437e-005,right_val:1.8351049721240997e-001,left_val:-2.5931510329246521e-001},{features:[[3,0,19,24,-1.],[3,12,19,12,2.]],tilted:0,threshold:3.3169940114021301e-001,right_val:3.0729588866233826e-001,left_val:-1.7855569720268250e-001},{features:[[5,0,15,24,-1.],[5,12,15,12,2.]],tilted:0,threshold:-2.6880529522895813e-001,right_val:-1.6482029855251312e-001,left_val:4.1601109504699707e-001},{features:[[0,0,25,8,-1.],[0,4,25,4,2.]],tilted:0,threshold:2.0318999886512756e-002,right_val:2.1150949597358704e-001,left_val:-2.8030520677566528e-001},{features:[[2,0,21,3,-1.],[9,1,7,1,9.]],tilted:0,threshold:3.9052091538906097e-002,right_val:2.2723379731178284e-001,left_val:-1.9721250236034393e-001},{features:[[19,9,4,8,-1.],[21,9,2,4,2.],[19,13,2,4,2.]],tilted:0,threshold:7.9546272754669189e-003,right_val:4.7643399238586426e-001,left_val:-1.1499509960412979e-001},{features:[[1,10,23,3,-1.],[1,11,23,1,3.]],tilted:0,threshold:6.8952748551964760e-003,right_val:-8.2518738508224487e-001,left_val:6.1748500913381577e-002},{features:[[12,9,2,12,-1.],[13,9,1,6,2.],[12,15,1,6,2.]],tilted:0,threshold:-3.5556990187615156e-003,right_val:-9.3571491539478302e-002,left_val:2.7410700917243958e-001},{features:[[0,3,1,22,-1.],[0,14,1,11,2.]],tilted:0,threshold:2.0416190847754478e-002,right_val:-8.7137848138809204e-001,left_val:4.7507200390100479e-002},{features:[[5,0,15,21,-1.],[10,7,5,7,9.]],tilted:0,threshold:4.1883000731468201e-001,right_val:-6.9378608465194702e-001,left_val:4.1436489671468735e-002},{features:[[1,0,2,1,-1.],[2,0,1,1,2.]],tilted:0,threshold:-5.2820937708020210e-004,right_val:3.5777650773525238e-002,left_val:-8.0074387788772583e-001},{features:[[19,9,4,8,-1.],[21,9,2,4,2.],[19,13,2,4,2.]],tilted:0,threshold:-4.6537858434021473e-003,right_val:-1.2797290086746216e-001,left_val:3.5810899734497070e-001},{features:[[2,9,4,8,-1.],[2,9,2,4,2.],[4,13,2,4,2.]],tilted:0,threshold:9.7785359248518944e-003,right_val:4.5907780528068542e-001,left_val:-8.5733927786350250e-002},{features:[[19,8,4,8,-1.],[21,8,2,4,2.],[19,12,2,4,2.]],tilted:0,threshold:3.4061060287058353e-003,right_val:1.7149560153484344e-001,left_val:-6.7135937511920929e-002},{features:[[2,8,4,8,-1.],[2,8,2,4,2.],[4,12,2,4,2.]],tilted:0,threshold:-7.1988371200859547e-003,right_val:-1.2102840095758438e-001,left_val:4.5996940135955811e-001},{features:[[0,8,25,4,-1.],[0,9,25,2,2.]],tilted:0,threshold:1.1576360091567039e-002,right_val:-8.8701897859573364e-001,left_val:5.5191241204738617e-002},{features:[[0,11,2,4,-1.],[0,12,2,2,2.]],tilted:0,threshold:5.1951088244095445e-004,right_val:-4.9204811453819275e-001,left_val:6.7860089242458344e-002},{features:[[1,0,23,8,-1.],[1,2,23,4,2.]],tilted:0,threshold:2.5765900500118732e-003,right_val:1.2351959943771362e-001,left_val:-2.8460198640823364e-001},{features:[[5,3,15,18,-1.],[5,9,15,6,3.]],tilted:0,threshold:1.6835910081863403e-001,right_val:6.7276817560195923e-001,left_val:-6.5295182168483734e-002}],threshold:-1.1619060039520264e+000},{simpleClassifiers:[{features:[[0,0,12,25,-1.],[6,0,6,25,2.]],tilted:0,threshold:8.0734930932521820e-002,right_val:1.2320630252361298e-001,left_val:-5.0151252746582031e-001},{features:[[22,1,1,24,-1.],[22,7,1,12,2.]],tilted:0,threshold:4.9881008453667164e-003,right_val:2.2033059597015381e-001,left_val:-1.3929890096187592e-001},{features:[[2,1,1,24,-1.],[2,7,1,12,2.]],tilted:0,threshold:5.5222441442310810e-003,right_val:3.0543148517608643e-001,left_val:-1.6725270450115204e-001},{features:[[4,23,19,2,-1.],[4,24,19,1,2.]],tilted:0,threshold:-1.7651449888944626e-003,right_val:-1.1531510204076767e-001,left_val:1.4461129903793335e-001},{features:[[1,2,23,21,-1.],[1,9,23,7,3.]],tilted:0,threshold:6.0122009366750717e-002,right_val:-3.8055491447448730e-001,left_val:1.6416029632091522e-001},{features:[[1,2,24,21,-1.],[9,9,8,7,9.]],tilted:0,threshold:6.1538379639387131e-002,right_val:8.2790613174438477e-002,left_val:-5.2694129943847656e-001},{features:[[0,0,16,24,-1.],[8,0,8,24,2.]],tilted:0,threshold:4.9553498625755310e-001,right_val:-6.7714440822601318e-001,left_val:4.2942259460687637e-002},{features:[[24,7,1,18,-1.],[24,16,1,9,2.]],tilted:0,threshold:-1.3491280376911163e-002,right_val:2.5981629267334938e-002,left_val:-7.9471498727798462e-001},{features:[[0,7,1,18,-1.],[0,16,1,9,2.]],tilted:0,threshold:-1.3543509878218174e-002,right_val:4.7937188297510147e-002,left_val:-7.9188191890716553e-001},{features:[[0,0,25,12,-1.],[0,3,25,6,2.]],tilted:0,threshold:1.1810439638793468e-002,right_val:1.2301079928874969e-001,left_val:-2.8349700570106506e-001},{features:[[5,21,15,3,-1.],[10,22,5,1,9.]],tilted:0,threshold:1.3551290147006512e-002,right_val:1.8431070446968079e-001,left_val:-2.0479810237884521e-001},{features:[[9,19,8,2,-1.],[9,20,8,1,2.]],tilted:0,threshold:2.2155249025672674e-003,right_val:-6.4096707105636597e-001,left_val:6.0262829065322876e-002},{features:[[11,1,1,2,-1.],[11,2,1,1,2.]],tilted:0,threshold:2.3545439762528986e-004,right_val:-3.2437419891357422e-001,left_val:1.0644689947366714e-001},{features:[[6,0,13,6,-1.],[6,2,13,2,3.]],tilted:0,threshold:4.8105299356393516e-004,right_val:1.3155519962310791e-001,left_val:-3.0601179599761963e-001},{features:[[12,23,1,2,-1.],[12,24,1,1,2.]],tilted:0,threshold:-2.0008509454783052e-004,right_val:1.3613070547580719e-001,left_val:-3.0324178934097290e-001},{features:[[6,19,14,6,-1.],[6,21,14,2,3.]],tilted:0,threshold:2.3672120732953772e-005,right_val:1.3083159923553467e-001,left_val:-3.0009239912033081e-001},{features:[[5,12,6,1,-1.],[7,12,2,1,3.]],tilted:0,threshold:3.6291049327701330e-003,right_val:3.5764211416244507e-001,left_val:-1.1187619715929031e-001},{features:[[17,8,2,6,-1.],[18,8,1,3,2.],[17,11,1,3,2.]],tilted:0,threshold:1.9785349722951651e-003,right_val:3.7574121356010437e-001,left_val:-9.9919758737087250e-002},{features:[[6,8,2,6,-1.],[6,8,1,3,2.],[7,11,1,3,2.]],tilted:0,threshold:-1.8082730239257216e-003,right_val:-1.0428240150213242e-001,left_val:4.0861770510673523e-001},{features:[[23,24,2,1,-1.],[23,24,1,1,2.]],tilted:0,threshold:-5.0346890930086374e-004,right_val:6.1041310429573059e-002,left_val:-8.4599661827087402e-001},{features:[[0,24,2,1,-1.],[1,24,1,1,2.]],tilted:0,threshold:-3.7712400080636144e-004,right_val:3.3072318881750107e-002,left_val:-7.1247512102127075e-001},{features:[[15,9,4,3,-1.],[16,9,2,3,2.]],tilted:0,threshold:2.8025570791214705e-003,right_val:2.4936139583587646e-001,left_val:-8.1714242696762085e-002},{features:[[6,9,4,3,-1.],[7,9,2,3,2.]],tilted:0,threshold:-2.5709250476211309e-003,right_val:-9.7475007176399231e-002,left_val:3.5556420683860779e-001},{features:[[23,0,2,25,-1.],[23,0,1,25,2.]],tilted:0,threshold:4.7641480341553688e-003,right_val:1.5445269644260406e-001,left_val:-1.8403269350528717e-001},{features:[[0,21,2,4,-1.],[0,21,1,2,2.],[1,23,1,2,2.]],tilted:0,threshold:5.5376789532601833e-004,right_val:-5.3317540884017944e-001,left_val:6.3511990010738373e-002},{features:[[23,0,2,25,-1.],[23,0,1,25,2.]],tilted:0,threshold:4.3237060308456421e-002,right_val:-6.4554607868194580e-001,left_val:2.2280379198491573e-003},{features:[[0,0,2,25,-1.],[1,0,1,25,2.]],tilted:0,threshold:5.6785959750413895e-003,right_val:1.8174830079078674e-001,left_val:-1.8612809479236603e-001},{features:[[23,15,2,2,-1.],[23,15,1,2,2.]],tilted:0,threshold:4.3273830669932067e-004,right_val:-2.7003818750381470e-001,left_val:1.2502700090408325e-001},{features:[[8,19,9,3,-1.],[8,20,9,1,3.]],tilted:0,threshold:-3.7943569477647543e-003,right_val:4.5233760029077530e-002,left_val:-7.8249299526214600e-001},{features:[[23,15,2,2,-1.],[23,15,1,2,2.]],tilted:0,threshold:2.9963750857859850e-003,right_val:5.2830129861831665e-001,left_val:-7.6169371604919434e-002},{features:[[0,15,2,2,-1.],[1,15,1,2,2.]],tilted:0,threshold:3.5630981437861919e-004,right_val:-2.4754630029201508e-001,left_val:1.4209270477294922e-001},{features:[[8,5,9,20,-1.],[8,15,9,10,2.]],tilted:0,threshold:1.1159469932317734e-001,right_val:2.8498700261116028e-001,left_val:-1.2094090133905411e-001},{features:[[7,3,11,22,-1.],[7,14,11,11,2.]],tilted:0,threshold:-1.3539190590381622e-001,right_val:-2.0331899821758270e-001,left_val:2.9897761344909668e-001},{features:[[2,6,23,4,-1.],[2,8,23,2,2.]],tilted:0,threshold:-3.0475310049951077e-003,right_val:1.5314429998397827e-001,left_val:-2.2049249708652496e-001},{features:[[11,5,3,6,-1.],[11,8,3,3,2.]],tilted:0,threshold:-2.6199448620900512e-004,right_val:-2.2174119949340820e-001,left_val:1.8473750352859497e-001},{features:[[6,0,15,1,-1.],[11,0,5,1,3.]],tilted:0,threshold:1.9398240372538567e-002,right_val:-6.4281028509140015e-001,left_val:4.4195670634508133e-002},{features:[[0,0,1,18,-1.],[0,9,1,9,2.]],tilted:0,threshold:-1.5306820161640644e-002,right_val:3.3107019960880280e-002,left_val:-8.3298677206039429e-001},{features:[[9,0,12,1,-1.],[12,0,6,1,2.]],tilted:0,threshold:2.9064790578559041e-004,right_val:9.9145926535129547e-002,left_val:-1.6691260039806366e-001},{features:[[0,1,19,24,-1.],[0,13,19,12,2.]],tilted:0,threshold:2.1586589515209198e-001,right_val:2.2601340711116791e-001,left_val:-1.4913189411163330e-001},{features:[[23,15,1,10,-1.],[23,20,1,5,2.]],tilted:0,threshold:-1.1482139816507697e-003,right_val:-8.3940923213958740e-002,left_val:1.3337799906730652e-001},{features:[[0,6,24,12,-1.],[12,6,12,12,2.]],tilted:0,threshold:-1.2832109630107880e-001,right_val:-1.2779660522937775e-001,left_val:2.6057571172714233e-001},{features:[[15,11,2,4,-1.],[16,11,1,2,2.],[15,13,1,2,2.]],tilted:0,threshold:-1.3299930142238736e-003,right_val:-8.2496158778667450e-002,left_val:3.9536279439926147e-001},{features:[[0,0,2,6,-1.],[0,2,2,2,3.]],tilted:0,threshold:-1.3658769894391298e-003,right_val:8.1771567463874817e-002,left_val:-4.2845389246940613e-001}],threshold:-1.1686840057373047e+000},{simpleClassifiers:[{features:[[0,0,24,25,-1.],[12,0,12,25,2.]],tilted:0,threshold:-5.4697930812835693e-001,right_val:6.5116211771965027e-002,left_val:-7.4169278144836426e-001},{features:[[22,11,1,14,-1.],[22,18,1,7,2.]],tilted:0,threshold:-2.9348989482969046e-003,right_val:-1.0431099683046341e-001,left_val:2.0817759633064270e-001},{features:[[0,9,21,8,-1.],[7,9,7,8,3.]],tilted:0,threshold:4.2346090078353882e-002,right_val:1.0494910180568695e-001,left_val:-4.1431620717048645e-001},{features:[[5,12,20,3,-1.],[10,12,10,3,2.]],tilted:0,threshold:2.0167229231446981e-003,right_val:5.8207400143146515e-002,left_val:-2.9576519131660461e-001},{features:[[5,5,15,15,-1.],[5,10,15,5,3.]],tilted:0,threshold:-2.3280899971723557e-002,right_val:-2.0072369277477264e-001,left_val:2.4461050331592560e-001},{features:[[22,0,1,24,-1.],[22,6,1,12,2.]],tilted:0,threshold:5.2206241525709629e-003,right_val:1.1710409820079803e-001,left_val:-6.9155037403106689e-002},{features:[[2,0,1,24,-1.],[2,6,1,12,2.]],tilted:0,threshold:5.0357701256871223e-003,right_val:2.8217938542366028e-001,left_val:-1.5814490616321564e-001},{features:[[0,9,25,16,-1.],[0,13,25,8,2.]],tilted:0,threshold:1.7077940702438354e-001,right_val:-8.5689657926559448e-001,left_val:5.2497748285531998e-002},{features:[[0,0,3,1,-1.],[1,0,1,1,3.]],tilted:0,threshold:-3.2828870462253690e-004,right_val:6.7810378968715668e-002,left_val:-4.5315450429916382e-001},{features:[[18,11,2,6,-1.],[19,11,1,3,2.],[18,14,1,3,2.]],tilted:0,threshold:-2.2234760690480471e-003,right_val:-1.1181300133466721e-001,left_val:4.0166100859642029e-001},{features:[[5,11,2,6,-1.],[5,11,1,3,2.],[6,14,1,3,2.]],tilted:0,threshold:-2.2535501047968864e-003,right_val:-9.2809401452541351e-002,left_val:3.9260658621788025e-001},{features:[[20,10,4,8,-1.],[22,10,2,4,2.],[20,14,2,4,2.]],tilted:0,threshold:-7.9935323446989059e-003,right_val:-8.7345071136951447e-002,left_val:4.2978098988533020e-001},{features:[[1,10,4,8,-1.],[1,10,2,4,2.],[3,14,2,4,2.]],tilted:0,threshold:-9.5514543354511261e-003,right_val:-7.3955677449703217e-002,left_val:4.8636689782142639e-001},{features:[[24,13,1,6,-1.],[24,15,1,2,3.]],tilted:0,threshold:7.9448771430179477e-004,right_val:-4.4167259335517883e-001,left_val:9.2045426368713379e-002},{features:[[0,14,1,6,-1.],[0,16,1,2,3.]],tilted:0,threshold:5.6366110220551491e-004,right_val:-3.9137899875640869e-001,left_val:8.5762083530426025e-002},{features:[[8,1,15,15,-1.],[13,6,5,5,9.]],tilted:0,threshold:3.4115129709243774e-001,right_val:-6.5657228231430054e-001,left_val:2.1570369601249695e-002},{features:[[7,7,6,9,-1.],[9,7,2,9,3.]],tilted:0,threshold:-1.3932379893958569e-002,right_val:-9.4087198376655579e-002,left_val:3.7450811266899109e-001},{features:[[11,10,4,4,-1.],[12,10,2,4,2.]],tilted:0,threshold:-3.4664489794522524e-003,right_val:-1.0363130271434784e-001,left_val:3.3531159162521362e-001},{features:[[5,1,12,4,-1.],[9,5,4,4,3.]],tilted:1,threshold:1.1305399984121323e-001,right_val:-8.0388927459716797e-001,left_val:4.4492159038782120e-002},{features:[[3,13,22,3,-1.],[3,14,22,1,3.]],tilted:0,threshold:7.3196208104491234e-003,right_val:-7.5850278139114380e-001,left_val:2.6117980480194092e-002},{features:[[10,12,4,2,-1.],[11,12,2,2,2.]],tilted:0,threshold:-1.2547730002552271e-003,right_val:-1.2721140682697296e-001,left_val:2.6369830965995789e-001},{features:[[21,0,4,25,-1.],[21,0,2,25,2.]],tilted:0,threshold:5.4105562157928944e-003,right_val:1.2777450680732727e-001,left_val:-4.2188149690628052e-001},{features:[[0,0,4,25,-1.],[2,0,2,25,2.]],tilted:0,threshold:5.0612930208444595e-003,right_val:7.7225938439369202e-002,left_val:-4.5063719153404236e-001},{features:[[24,0,1,2,-1.],[24,0,1,1,2.]],tilted:1,threshold:-4.3663478572852910e-004,right_val:1.4423480629920959e-001,left_val:-3.0216220021247864e-001},{features:[[1,0,2,1,-1.],[1,0,1,1,2.]],tilted:1,threshold:-4.6671440941281617e-004,right_val:1.2610529363155365e-001,left_val:-3.0956488847732544e-001},{features:[[0,6,25,2,-1.],[0,7,25,1,2.]],tilted:0,threshold:3.1374259851872921e-003,right_val:-3.6539548635482788e-001,left_val:1.0157799720764160e-001},{features:[[1,0,2,1,-1.],[1,0,1,1,2.]],tilted:1,threshold:-2.2114549210527912e-005,right_val:-2.5539168715476990e-001,left_val:1.2883719801902771e-001},{features:[[11,12,3,1,-1.],[12,12,1,1,3.]],tilted:0,threshold:3.6453141365200281e-004,right_val:2.3675279319286346e-001,left_val:-1.4327269792556763e-001},{features:[[1,12,21,3,-1.],[1,13,21,1,3.]],tilted:0,threshold:6.0733011923730373e-003,right_val:-6.9410818815231323e-001,left_val:4.9781698733568192e-002},{features:[[18,19,6,6,-1.],[18,22,6,3,2.]],tilted:0,threshold:-2.6409518904983997e-003,right_val:-1.3221520185470581e-001,left_val:1.1159580200910568e-001},{features:[[11,22,1,2,-1.],[11,23,1,1,2.]],tilted:0,threshold:-1.2848649930674583e-004,right_val:1.2487880140542984e-001,left_val:-2.5748521089553833e-001},{features:[[16,19,9,6,-1.],[16,22,9,3,2.]],tilted:0,threshold:-2.7002869173884392e-002,right_val:2.2851640358567238e-002,left_val:-2.1309000253677368e-001},{features:[[5,23,14,2,-1.],[5,24,14,1,2.]],tilted:0,threshold:-5.5548627860844135e-003,right_val:-1.2400159984827042e-001,left_val:3.4896078705787659e-001},{features:[[2,0,21,2,-1.],[2,1,21,1,2.]],tilted:0,threshold:4.3782647699117661e-003,right_val:2.1142059564590454e-001,left_val:-1.5955279767513275e-001},{features:[[0,14,17,3,-1.],[0,15,17,1,3.]],tilted:0,threshold:5.0675170496106148e-003,right_val:-6.7377299070358276e-001,left_val:5.1273059099912643e-002},{features:[[24,22,1,3,-1.],[24,23,1,1,3.]],tilted:0,threshold:3.8793749990873039e-004,right_val:-7.1641021966934204e-001,left_val:4.5997820794582367e-002},{features:[[1,15,1,10,-1.],[1,20,1,5,2.]],tilted:0,threshold:-1.4580220449715853e-003,right_val:-1.4839789271354675e-001,left_val:2.1615679562091827e-001},{features:[[7,1,11,24,-1.],[7,13,11,12,2.]],tilted:0,threshold:2.4079500138759613e-001,right_val:3.0170598626136780e-001,left_val:-1.1823660135269165e-001},{features:[[8,0,9,24,-1.],[8,12,9,12,2.]],tilted:0,threshold:-1.8808209896087646e-001,right_val:-1.3705970346927643e-001,left_val:3.1144750118255615e-001},{features:[[24,20,1,4,-1.],[24,22,1,2,2.]],tilted:0,threshold:-7.0596951991319656e-004,right_val:8.5756696760654449e-002,left_val:-4.3143850564956665e-001},{features:[[1,8,4,8,-1.],[1,8,2,4,2.],[3,12,2,4,2.]],tilted:0,threshold:7.6330509036779404e-003,right_val:4.0618151426315308e-001,left_val:-8.5229426622390747e-002},{features:[[22,23,3,2,-1.],[23,23,1,2,3.]],tilted:0,threshold:-5.4063898278400302e-004,right_val:5.3362339735031128e-002,left_val:-2.7844938635826111e-001},{features:[[0,8,1,10,-1.],[0,13,1,5,2.]],tilted:0,threshold:8.0850580707192421e-004,right_val:2.2427199780941010e-001,left_val:-1.5673060715198517e-001},{features:[[24,9,1,16,-1.],[24,13,1,8,2.]],tilted:0,threshold:-9.0161375701427460e-003,right_val:2.5498120114207268e-002,left_val:-7.6493132114410400e-001},{features:[[0,9,1,16,-1.],[0,13,1,8,2.]],tilted:0,threshold:5.7115959934890270e-003,right_val:-6.1655932664871216e-001,left_val:6.0737568885087967e-002}],threshold:-1.2197940349578857e+000},{simpleClassifiers:[{features:[[5,21,15,3,-1.],[10,21,5,3,3.]],tilted:0,threshold:1.8004509806632996e-001,right_val:-1.2683170166015625e+003,left_val:7.1775932156015188e-005},{features:[[3,23,22,2,-1.],[3,24,22,1,2.]],tilted:0,threshold:-3.2704269979149103e-003,right_val:-2.1053729951381683e-001,left_val:2.1751649677753448e-001},{features:[[3,12,2,6,-1.],[3,12,1,3,2.],[4,15,1,3,2.]],tilted:0,threshold:2.8901069890707731e-003,right_val:4.4793319702148438e-001,left_val:-9.4649657607078552e-002},{features:[[1,0,24,25,-1.],[7,0,12,25,2.]],tilted:0,threshold:2.6834228634834290e-001,right_val:1.3912549614906311e-001,left_val:-3.4015381336212158e-001},{features:[[4,9,2,6,-1.],[4,9,1,3,2.],[5,12,1,3,2.]],tilted:0,threshold:-2.9544678982347250e-003,right_val:-8.2894280552864075e-002,left_val:4.5975801348686218e-001},{features:[[5,19,19,6,-1.],[5,22,19,3,2.]],tilted:0,threshold:-8.4115490317344666e-002,right_val:6.5024472773075104e-002,left_val:-2.7309590578079224e-001},{features:[[4,9,2,6,-1.],[4,9,1,3,2.],[5,12,1,3,2.]],tilted:0,threshold:2.6462629903107882e-003,right_val:4.3064919114112854e-001,left_val:-8.5304662585258484e-002},{features:[[7,11,18,9,-1.],[13,14,6,3,9.]],tilted:0,threshold:2.3374849557876587e-001,right_val:-7.0049768686294556e-001,left_val:3.1148020178079605e-002},{features:[[0,0,24,1,-1.],[12,0,12,1,2.]],tilted:0,threshold:1.3991080224514008e-002,right_val:-3.8017541170120239e-001,left_val:6.3895016908645630e-002},{features:[[7,11,18,6,-1.],[13,13,6,2,9.]],tilted:0,threshold:1.5294119715690613e-002,right_val:8.8719643652439117e-002,left_val:-1.3300269842147827e-001},{features:[[10,12,3,2,-1.],[11,12,1,2,3.]],tilted:0,threshold:1.3851210242137313e-003,right_val:3.4786149859428406e-001,left_val:-8.3899021148681641e-002},{features:[[11,11,4,3,-1.],[12,11,2,3,2.]],tilted:0,threshold:4.0411897934973240e-003,right_val:3.8513410091400146e-001,left_val:-9.6694447100162506e-002},{features:[[10,11,4,3,-1.],[11,11,2,3,2.]],tilted:0,threshold:-1.5105110360309482e-003,right_val:-1.4276629686355591e-001,left_val:2.7030730247497559e-001},{features:[[7,24,12,1,-1.],[10,24,6,1,2.]],tilted:0,threshold:1.1216199956834316e-002,right_val:-7.4331712722778320e-001,left_val:5.2318520843982697e-002},{features:[[0,0,2,4,-1.],[0,1,2,2,2.]],tilted:0,threshold:4.6090059913694859e-004,right_val:-4.4167301058769226e-001,left_val:6.1226818710565567e-002},{features:[[4,9,18,9,-1.],[10,12,6,3,9.]],tilted:0,threshold:2.4240539968013763e-001,right_val:-8.2463300228118896e-001,left_val:3.5296630114316940e-002},{features:[[0,0,3,4,-1.],[0,1,3,2,2.]],tilted:0,threshold:-6.0484587447717786e-004,right_val:7.1387499570846558e-002,left_val:-4.0272709727287292e-001},{features:[[10,0,15,25,-1.],[15,0,5,25,3.]],tilted:0,threshold:3.5710370540618896e-001,right_val:-6.8163007497787476e-001,left_val:1.8752589821815491e-002},{features:[[0,8,16,9,-1.],[4,8,8,9,2.]],tilted:0,threshold:1.1522459983825684e-001,right_val:-6.7330968379974365e-001,left_val:4.6177390962839127e-002},{features:[[16,0,8,6,-1.],[16,3,8,3,2.]],tilted:0,threshold:3.8151650223881006e-003,right_val:8.8695816695690155e-002,left_val:-1.2972660362720490e-001},{features:[[0,20,21,2,-1.],[0,21,21,1,2.]],tilted:0,threshold:1.3831140240654349e-003,right_val:-3.3529379963874817e-001,left_val:9.5345683395862579e-002},{features:[[14,22,1,2,-1.],[14,22,1,1,2.]],tilted:1,threshold:5.1254231948405504e-004,right_val:-2.7034878730773926e-001,left_val:1.0987920314073563e-001},{features:[[0,0,11,12,-1.],[0,4,11,4,3.]],tilted:0,threshold:6.1746072024106979e-003,right_val:1.4264079928398132e-001,left_val:-2.1200719475746155e-001},{features:[[8,0,10,15,-1.],[8,5,10,5,3.]],tilted:0,threshold:1.0676769912242889e-001,right_val:-7.0405578613281250e-001,left_val:4.1373148560523987e-002},{features:[[4,24,12,1,-1.],[7,24,6,1,2.]],tilted:0,threshold:9.7706951200962067e-003,right_val:-6.3800191879272461e-001,left_val:4.0702451020479202e-002},{features:[[12,6,2,10,-1.],[13,6,1,5,2.],[12,11,1,5,2.]],tilted:0,threshold:2.8201229870319366e-003,right_val:2.6788440346717834e-001,left_val:-9.4522736966609955e-002},{features:[[0,22,1,3,-1.],[0,23,1,1,3.]],tilted:0,threshold:4.1142830741591752e-004,right_val:-6.3001567125320435e-001,left_val:4.7475989907979965e-002},{features:[[23,10,2,8,-1.],[23,14,2,4,2.]],tilted:0,threshold:1.5934780240058899e-003,right_val:1.6400060057640076e-001,left_val:-1.0703609883785248e-001},{features:[[0,0,24,1,-1.],[12,0,12,1,2.]],tilted:0,threshold:-1.1865469627082348e-002,right_val:8.3961293101310730e-002,left_val:-3.5861191153526306e-001},{features:[[23,0,2,25,-1.],[23,0,1,25,2.]],tilted:0,threshold:4.1225277818739414e-003,right_val:1.4402189850807190e-001,left_val:-2.3882789909839630e-001},{features:[[1,3,20,9,-1.],[11,3,10,9,2.]],tilted:0,threshold:-1.3517889380455017e-001,right_val:-6.7431576550006866e-002,left_val:4.7490730881690979e-001},{features:[[14,8,2,8,-1.],[15,8,1,4,2.],[14,12,1,4,2.]],tilted:0,threshold:2.7560358867049217e-003,right_val:2.9079490900039673e-001,left_val:-7.1827188134193420e-002},{features:[[10,2,5,4,-1.],[10,4,5,2,2.]],tilted:0,threshold:-4.2972611263394356e-003,right_val:5.6816298514604568e-002,left_val:-5.5687338113784790e-001},{features:[[14,0,2,3,-1.],[14,0,1,3,2.]],tilted:1,threshold:-1.2103000335628167e-004,right_val:1.1837910115718842e-001,left_val:-1.3359540700912476e-001},{features:[[11,3,2,14,-1.],[11,3,1,7,2.],[12,10,1,7,2.]],tilted:0,threshold:-2.4500500876456499e-003,right_val:-1.2817199528217316e-001,left_val:2.5945881009101868e-001},{features:[[23,10,2,8,-1.],[23,14,2,4,2.]],tilted:0,threshold:-1.7446579877287149e-003,right_val:-1.3044109940528870e-001,left_val:2.6169461011886597e-001},{features:[[10,23,1,2,-1.],[10,24,1,1,2.]],tilted:0,threshold:-1.6035139560699463e-004,right_val:1.2862069904804230e-001,left_val:-2.4382220208644867e-001},{features:[[9,19,10,6,-1.],[9,21,10,2,3.]],tilted:0,threshold:1.8494970572646707e-004,right_val:1.1913470178842545e-001,left_val:-2.3383130133152008e-001},{features:[[3,0,19,3,-1.],[3,1,19,1,3.]],tilted:0,threshold:2.8866168577224016e-004,right_val:1.5361200273036957e-001,left_val:-2.0316019654273987e-001},{features:[[24,0,1,16,-1.],[24,8,1,8,2.]],tilted:0,threshold:1.1300699785351753e-002,right_val:-7.8750622272491455e-001,left_val:6.2957696616649628e-002},{features:[[7,4,11,3,-1.],[7,5,11,1,3.]],tilted:0,threshold:5.8404598385095596e-003,right_val:-8.5410207509994507e-001,left_val:1.7734849825501442e-002},{features:[[23,0,2,24,-1.],[24,0,1,12,2.],[23,12,1,12,2.]],tilted:0,threshold:-8.3003882318735123e-003,right_val:-4.5239541679620743e-002,left_val:2.2870020568370819e-001},{features:[[5,5,15,3,-1.],[10,5,5,3,3.]],tilted:0,threshold:1.0016419691964984e-003,right_val:9.6414111554622650e-002,left_val:-2.9350730776786804e-001},{features:[[23,0,2,25,-1.],[23,0,1,25,2.]],tilted:0,threshold:-1.0042509995400906e-002,right_val:4.5914249494671822e-003,left_val:-5.9852880239486694e-001},{features:[[0,0,2,25,-1.],[1,0,1,25,2.]],tilted:0,threshold:4.0912739932537079e-003,right_val:1.2923860549926758e-001,left_val:-2.1593970060348511e-001},{features:[[23,7,2,3,-1.],[23,7,1,3,2.]],tilted:0,threshold:5.0562847172841430e-004,right_val:-2.5665798783302307e-001,left_val:1.5741920471191406e-001},{features:[[0,7,2,3,-1.],[1,7,1,3,2.]],tilted:0,threshold:5.2078161388635635e-004,right_val:-2.3445880413055420e-001,left_val:1.4819410443305969e-001},{features:[[23,8,2,1,-1.],[23,8,1,1,2.]],tilted:0,threshold:1.6813799738883972e-003,right_val:4.9866899847984314e-001,left_val:-6.6810980439186096e-002},{features:[[0,8,2,1,-1.],[1,8,1,1,2.]],tilted:0,threshold:1.4866109704598784e-003,right_val:4.2053240537643433e-001,left_val:-6.4803972840309143e-002},{features:[[12,6,2,12,-1.],[13,6,1,6,2.],[12,12,1,6,2.]],tilted:0,threshold:-2.1427311003208160e-003,right_val:-9.4888381659984589e-002,left_val:2.1503530442714691e-001},{features:[[1,19,15,3,-1.],[6,19,5,3,3.]],tilted:0,threshold:1.2026890181005001e-002,right_val:1.6060090065002441e-001,left_val:-1.7491519451141357e-001},{features:[[22,23,3,2,-1.],[23,23,1,2,3.]],tilted:0,threshold:5.4962979629635811e-004,right_val:-3.6075818538665771e-001,left_val:7.9216390848159790e-002}],threshold:-1.1867749691009521e+000},{simpleClassifiers:[{features:[[10,13,5,9,-1.],[10,16,5,3,3.]],tilted:0,threshold:2.0191150251775980e-003,right_val:1.7960040271282196e-001,left_val:-2.1191939711570740e-001},{features:[[13,12,5,8,-1.],[11,14,5,4,2.]],tilted:1,threshold:2.5026449002325535e-003,right_val:7.0980481803417206e-002,left_val:-1.2992329895496368e-001},{features:[[10,0,5,20,-1.],[10,10,5,10,2.]],tilted:0,threshold:-5.3158570080995560e-002,right_val:-1.7133300006389618e-001,left_val:2.7662891149520874e-001},{features:[[12,16,3,8,-1.],[12,20,3,4,2.]],tilted:0,threshold:1.1209100193809718e-005,right_val:2.5325238704681396e-001,left_val:-1.4314560592174530e-001},{features:[[8,2,8,20,-1.],[8,7,8,10,2.]],tilted:0,threshold:-7.1482710540294647e-002,right_val:5.4300498217344284e-002,left_val:-6.9515037536621094e-001},{features:[[8,19,10,4,-1.],[8,21,10,2,2.]],tilted:0,threshold:2.8659540694206953e-003,right_val:-2.9052281379699707e-001,left_val:4.6016551554203033e-002},{features:[[9,17,3,6,-1.],[9,20,3,3,2.]],tilted:0,threshold:1.9679629986057989e-005,right_val:2.0140969753265381e-001,left_val:-1.7965799570083618e-001},{features:[[0,23,25,2,-1.],[0,24,25,1,2.]],tilted:0,threshold:-5.2277408540248871e-003,right_val:-1.6386799514293671e-001,left_val:2.5270029902458191e-001},{features:[[1,7,2,6,-1.],[1,7,1,3,2.],[2,10,1,3,2.]],tilted:0,threshold:3.0542609747499228e-003,right_val:5.0366252660751343e-001,left_val:-7.1575798094272614e-002},{features:[[24,22,1,2,-1.],[24,23,1,1,2.]],tilted:0,threshold:-2.9728360823355615e-004,right_val:5.1399130374193192e-002,left_val:-5.2938801050186157e-001},{features:[[0,11,4,3,-1.],[2,11,2,3,2.]],tilted:0,threshold:-1.0779739823192358e-003,right_val:-9.3900568783283234e-002,left_val:3.7530121207237244e-001},{features:[[24,22,1,2,-1.],[24,23,1,1,2.]],tilted:0,threshold:-2.2623709810432047e-005,right_val:-1.1134230345487595e-001,left_val:1.6981379687786102e-001},{features:[[0,22,1,2,-1.],[0,23,1,1,2.]],tilted:0,threshold:-2.6898880605585873e-004,right_val:6.3903756439685822e-002,left_val:-5.2503097057342529e-001},{features:[[4,0,17,2,-1.],[4,1,17,1,2.]],tilted:0,threshold:4.3080640025436878e-003,right_val:2.1191169321537018e-001,left_val:-1.6974890232086182e-001},{features:[[0,1,1,2,-1.],[0,2,1,1,2.]],tilted:0,threshold:2.8652910259552300e-004,right_val:-5.3953951597213745e-001,left_val:6.9832988083362579e-002},{features:[[17,21,8,4,-1.],[17,23,8,2,2.]],tilted:0,threshold:-1.8647660035640001e-003,right_val:-1.0709100216627121e-001,left_val:7.9187482595443726e-002},{features:[[0,0,2,24,-1.],[1,0,1,24,2.]],tilted:0,threshold:1.0851949919015169e-003,right_val:8.5343867540359497e-002,left_val:-3.9847779273986816e-001},{features:[[22,20,2,2,-1.],[22,20,1,2,2.]],tilted:0,threshold:4.0944988722912967e-004,right_val:-1.4176020026206970e-001,left_val:5.4056350141763687e-002},{features:[[1,20,2,2,-1.],[2,20,1,2,2.]],tilted:0,threshold:4.2084971209987998e-004,right_val:-2.5249311327934265e-001,left_val:1.3462479412555695e-001},{features:[[21,20,4,1,-1.],[21,20,2,1,2.]],tilted:1,threshold:1.6839290037751198e-004,right_val:9.5340102910995483e-002,left_val:-2.2796970605850220e-001},{features:[[4,20,1,4,-1.],[4,20,1,2,2.]],tilted:1,threshold:1.4562309661414474e-004,right_val:1.2245950102806091e-001,left_val:-3.1346321105957031e-001},{features:[[11,14,3,3,-1.],[12,15,1,1,9.]],tilted:0,threshold:1.6215200303122401e-003,right_val:2.5915551185607910e-001,left_val:-1.2621709704399109e-001},{features:[[12,23,1,2,-1.],[12,24,1,1,2.]],tilted:0,threshold:-3.3472100767539814e-005,right_val:1.6651690006256104e-001,left_val:-1.8671259284019470e-001},{features:[[12,8,2,8,-1.],[13,8,1,4,2.],[12,12,1,4,2.]],tilted:0,threshold:-2.5778179988265038e-003,right_val:-8.0635949969291687e-002,left_val:2.5478971004486084e-001},{features:[[1,5,18,9,-1.],[7,8,6,3,9.]],tilted:0,threshold:2.2081619501113892e-001,right_val:-6.6497838497161865e-001,left_val:5.3643438965082169e-002},{features:[[23,10,2,2,-1.],[23,10,1,2,2.]],tilted:0,threshold:3.1700119143351912e-004,right_val:-1.5417550504207611e-001,left_val:7.9098179936408997e-002},{features:[[0,0,1,16,-1.],[0,8,1,8,2.]],tilted:0,threshold:1.2999719940125942e-002,right_val:-8.1742262840270996e-001,left_val:3.6135278642177582e-002},{features:[[12,8,2,8,-1.],[13,8,1,4,2.],[12,12,1,4,2.]],tilted:0,threshold:1.3553650351241231e-003,right_val:1.7422780394554138e-001,left_val:-9.7845867276191711e-002},{features:[[5,17,15,2,-1.],[10,17,5,2,3.]],tilted:0,threshold:8.5435097571462393e-004,right_val:1.0333210229873657e-001,left_val:-2.8668859601020813e-001},{features:[[5,1,18,3,-1.],[11,2,6,1,9.]],tilted:0,threshold:1.9186370074748993e-002,right_val:1.4288300275802612e-001,left_val:-2.0520329475402832e-001},{features:[[12,0,1,2,-1.],[12,1,1,1,2.]],tilted:0,threshold:1.8162580090574920e-004,right_val:-2.5909510254859924e-001,left_val:1.3736839592456818e-001},{features:[[0,3,25,22,-1.],[0,14,25,11,2.]],tilted:0,threshold:1.9275680184364319e-001,right_val:2.1485829353332520e-001,left_val:-1.5659409761428833e-001},{features:[[1,2,15,3,-1.],[6,3,5,1,9.]],tilted:0,threshold:1.2056250125169754e-002,right_val:2.1334210038185120e-001,left_val:-2.2499039769172668e-001},{features:[[12,8,2,8,-1.],[13,8,1,4,2.],[12,12,1,4,2.]],tilted:0,threshold:-1.0883549693971872e-003,right_val:-7.4455857276916504e-002,left_val:1.2353979796171188e-001},{features:[[11,8,2,8,-1.],[11,8,1,4,2.],[12,12,1,4,2.]],tilted:0,threshold:-2.4255490861833096e-003,right_val:-9.9332652986049652e-002,left_val:3.1007918715476990e-001},{features:[[14,2,1,18,-1.],[14,8,1,6,3.]],tilted:0,threshold:9.0482030063867569e-003,right_val:2.4705639481544495e-001,left_val:-8.5626669228076935e-002},{features:[[1,12,18,9,-1.],[7,15,6,3,9.]],tilted:0,threshold:2.3379500210285187e-001,right_val:-6.3548052310943604e-001,left_val:4.8708219081163406e-002},{features:[[7,3,12,3,-1.],[7,4,12,1,3.]],tilted:0,threshold:4.6182200312614441e-003,right_val:-6.5930128097534180e-001,left_val:3.2066959887742996e-002},{features:[[8,1,9,1,-1.],[11,1,3,1,3.]],tilted:0,threshold:7.6137272117193788e-005,right_val:1.1577039957046509e-001,left_val:-2.3533040285110474e-001},{features:[[5,0,15,1,-1.],[10,0,5,1,3.]],tilted:0,threshold:1.7868179827928543e-002,right_val:-6.0223627090454102e-001,left_val:5.7103220373392105e-002},{features:[[8,9,2,8,-1.],[8,9,1,4,2.],[9,13,1,4,2.]],tilted:0,threshold:-2.1019289270043373e-003,right_val:-1.0575859993696213e-001,left_val:2.6925888657569885e-001},{features:[[15,9,2,6,-1.],[16,9,1,3,2.],[15,12,1,3,2.]],tilted:0,threshold:3.3772839233279228e-003,right_val:3.5539248585700989e-001,left_val:-5.3210329264402390e-002},{features:[[6,5,3,12,-1.],[7,9,1,4,9.]],tilted:0,threshold:1.0936450213193893e-002,right_val:2.4860809743404388e-001,left_val:-1.1338409781455994e-001},{features:[[5,11,15,3,-1.],[5,12,15,1,3.]],tilted:0,threshold:6.7958370782434940e-003,right_val:-9.6363908052444458e-001,left_val:3.0205719172954559e-002},{features:[[7,9,11,3,-1.],[7,10,11,1,3.]],tilted:0,threshold:4.3736519291996956e-003,right_val:-6.4715677499771118e-001,left_val:2.9778029769659042e-002},{features:[[16,21,9,4,-1.],[16,23,9,2,2.]],tilted:0,threshold:1.0398699901998043e-002,right_val:-3.6711278557777405e-001,left_val:4.1304989717900753e-003},{features:[[5,11,4,1,-1.],[6,11,2,1,2.]],tilted:0,threshold:-1.0460240300744772e-003,right_val:-8.5172623395919800e-002,left_val:2.8792479634284973e-001},{features:[[12,23,1,2,-1.],[12,24,1,1,2.]],tilted:0,threshold:3.9401830872520804e-004,right_val:-6.4034730195999146e-001,left_val:3.9254769682884216e-002},{features:[[0,21,9,4,-1.],[0,23,9,2,2.]],tilted:0,threshold:-2.0856719929724932e-003,right_val:-1.6981109976768494e-001,left_val:1.4763970673084259e-001},{features:[[23,10,2,3,-1.],[23,10,1,3,2.]],tilted:0,threshold:3.7645150441676378e-003,right_val:4.0955379605293274e-001,left_val:-6.3431486487388611e-002},{features:[[0,10,2,3,-1.],[1,10,1,3,2.]],tilted:0,threshold:4.8305589007213712e-004,right_val:-2.3883299529552460e-001,left_val:1.5586610138416290e-001},{features:[[22,0,2,12,-1.],[22,6,2,6,2.]],tilted:0,threshold:4.0211779996752739e-003,right_val:1.7619979381561279e-001,left_val:-1.2030039727687836e-001},{features:[[2,0,1,12,-1.],[2,6,1,6,2.]],tilted:0,threshold:2.5966949760913849e-003,right_val:2.4293899536132813e-001,left_val:-1.4575859904289246e-001},{features:[[22,4,3,6,-1.],[22,7,3,3,2.]],tilted:0,threshold:-8.9815730461850762e-004,right_val:-1.6364639997482300e-001,left_val:2.2666700184345245e-001},{features:[[0,4,3,6,-1.],[0,7,3,3,2.]],tilted:0,threshold:-6.2149699078872800e-004,right_val:-1.6018569469451904e-001,left_val:2.0900680124759674e-001},{features:[[1,1,23,4,-1.],[1,3,23,2,2.]],tilted:0,threshold:2.3780961055308580e-003,right_val:1.1902090162038803e-001,left_val:-2.4557930231094360e-001}],threshold:-1.1352620124816895e+000},{simpleClassifiers:[{features:[[0,1,24,23,-1.],[12,1,12,23,2.]],tilted:0,threshold:6.0245269536972046e-001,right_val:-7.8507578372955322e-001,left_val:5.2337121218442917e-002},{features:[[24,11,1,14,-1.],[24,18,1,7,2.]],tilted:0,threshold:6.6552129574120045e-003,right_val:-5.4219800233840942e-001,left_val:7.1143716573715210e-002},{features:[[5,19,15,6,-1.],[10,21,5,2,9.]],tilted:0,threshold:2.7373209595680237e-002,right_val:1.5262730419635773e-001,left_val:-2.2720469534397125e-001},{features:[[1,24,24,1,-1.],[1,24,12,1,2.]],tilted:0,threshold:1.3735990040004253e-002,right_val:-3.0287069082260132e-001,left_val:1.2475749850273132e-001},{features:[[1,4,1,12,-1.],[1,10,1,6,2.]],tilted:0,threshold:2.5980870705097914e-003,right_val:2.7191510796546936e-001,left_val:-1.2733310461044312e-001},{features:[[18,5,7,12,-1.],[18,11,7,6,2.]],tilted:0,threshold:-1.0497280210256577e-001,right_val:-1.9078690093010664e-003,left_val:-7.0821052789688110e-001},{features:[[0,1,7,24,-1.],[0,7,7,12,2.]],tilted:0,threshold:1.1283349990844727e-001,right_val:-7.8128588199615479e-001,left_val:4.2468018829822540e-002},{features:[[18,10,2,4,-1.],[19,10,1,2,2.],[18,12,1,2,2.]],tilted:0,threshold:1.7136579845100641e-003,right_val:4.2818519473075867e-001,left_val:-8.5178561508655548e-002},{features:[[5,10,2,4,-1.],[5,10,1,2,2.],[6,12,1,2,2.]],tilted:0,threshold:-1.2761510442942381e-003,right_val:-7.8054942190647125e-002,left_val:3.7203249335289001e-001},{features:[[18,10,2,4,-1.],[19,10,1,2,2.],[18,12,1,2,2.]],tilted:0,threshold:-1.6786810010671616e-003,right_val:-9.5365412533283234e-002,left_val:4.5170649886131287e-001},{features:[[5,10,2,4,-1.],[5,10,1,2,2.],[6,12,1,2,2.]],tilted:0,threshold:1.0452580172568560e-003,right_val:3.1057640910148621e-001,left_val:-1.0327780246734619e-001},{features:[[20,24,4,1,-1.],[20,24,2,1,2.]],tilted:0,threshold:-1.2748680310323834e-003,right_val:6.3396677374839783e-002,left_val:-5.9134918451309204e-001},{features:[[2,11,18,3,-1.],[8,11,6,3,3.]],tilted:0,threshold:-9.1730579733848572e-003,right_val:5.8642920106649399e-002,left_val:-5.1909697055816650e-001},{features:[[24,11,1,14,-1.],[24,18,1,7,2.]],tilted:0,threshold:-8.5946340113878250e-003,right_val:3.9074189960956573e-002,left_val:-6.7389839887619019e-001},{features:[[0,9,18,9,-1.],[6,12,6,3,9.]],tilted:0,threshold:1.7572590708732605e-001,right_val:-4.8357391357421875e-001,left_val:7.0220336318016052e-002},{features:[[24,11,1,14,-1.],[24,18,1,7,2.]],tilted:0,threshold:1.2705760309472680e-003,right_val:1.6797809302806854e-001,left_val:-1.1456940323114395e-001},{features:[[11,1,3,8,-1.],[11,5,3,4,2.]],tilted:0,threshold:-2.1443589503178373e-005,right_val:-1.7952880263328552e-001,left_val:2.1516430377960205e-001},{features:[[24,0,1,22,-1.],[24,11,1,11,2.]],tilted:0,threshold:1.9370870664715767e-002,right_val:-8.3156830072402954e-001,left_val:2.8284879401326180e-002},{features:[[0,0,1,22,-1.],[0,11,1,11,2.]],tilted:0,threshold:-2.0381100475788116e-002,right_val:2.6280429214239120e-002,left_val:-9.0958088636398315e-001},{features:[[0,0,25,12,-1.],[0,3,25,6,2.]],tilted:0,threshold:2.6016689836978912e-002,right_val:1.7443889379501343e-001,left_val:-2.0010340213775635e-001},{features:[[5,0,15,18,-1.],[5,9,15,9,2.]],tilted:0,threshold:1.0690639913082123e-001,right_val:2.2835870087146759e-001,left_val:-1.6266860067844391e-001},{features:[[1,15,23,10,-1.],[1,20,23,5,2.]],tilted:0,threshold:-3.4786250442266464e-002,right_val:-2.0116269588470459e-001,left_val:2.0793099701404572e-001},{features:[[10,22,1,2,-1.],[10,23,1,1,2.]],tilted:0,threshold:-1.9677329692058265e-004,right_val:1.1807250231504440e-001,left_val:-3.1131440401077271e-001},{features:[[20,24,4,1,-1.],[20,24,2,1,2.]],tilted:0,threshold:6.5192329930141568e-004,right_val:-1.7708389461040497e-001,left_val:8.2236677408218384e-002},{features:[[1,24,4,1,-1.],[3,24,2,1,2.]],tilted:0,threshold:-1.4959790278226137e-003,right_val:4.2847748845815659e-002,left_val:-7.1390831470489502e-001},{features:[[23,6,1,12,-1.],[23,12,1,6,2.]],tilted:0,threshold:2.7109330985695124e-003,right_val:2.0900200307369232e-001,left_val:-1.0781349986791611e-001},{features:[[0,5,1,20,-1.],[0,10,1,10,2.]],tilted:0,threshold:7.5823841616511345e-003,right_val:-5.6809967756271362e-001,left_val:5.3877390921115875e-002},{features:[[9,20,15,3,-1.],[14,21,5,1,9.]],tilted:0,threshold:1.0195979848504066e-002,right_val:1.4719660580158234e-001,left_val:-1.9075849652290344e-001},{features:[[1,20,15,3,-1.],[6,21,5,1,9.]],tilted:0,threshold:1.3070380315184593e-002,right_val:1.9392399489879608e-001,left_val:-2.1738119423389435e-001},{features:[[11,1,3,2,-1.],[11,2,3,1,2.]],tilted:0,threshold:2.6393428561277688e-004,right_val:-2.2604019939899445e-001,left_val:1.5437519550323486e-001},{features:[[7,0,10,6,-1.],[7,2,10,2,3.]],tilted:0,threshold:5.4196250857785344e-005,right_val:1.2521779537200928e-001,left_val:-2.8408589959144592e-001},{features:[[20,12,4,6,-1.],[22,12,2,3,2.],[20,15,2,3,2.]],tilted:0,threshold:-6.9367061369121075e-003,right_val:-6.5932586789131165e-002,left_val:4.2877939343452454e-001},{features:[[1,12,4,6,-1.],[1,12,2,3,2.],[3,15,2,3,2.]],tilted:0,threshold:-6.9427280686795712e-003,right_val:-7.1486473083496094e-002,left_val:4.7249019145965576e-001},{features:[[11,10,12,3,-1.],[11,11,12,1,3.]],tilted:0,threshold:5.5062561295926571e-003,right_val:-7.6667702198028564e-001,left_val:3.3114258199930191e-002},{features:[[0,7,1,10,-1.],[0,12,1,5,2.]],tilted:0,threshold:1.6204440034925938e-003,right_val:2.3542539775371552e-001,left_val:-1.1487250030040741e-001},{features:[[23,7,2,10,-1.],[23,12,2,5,2.]],tilted:0,threshold:-1.9016009755432606e-003,right_val:-1.3353340327739716e-001,left_val:2.0602910220623016e-001},{features:[[0,7,2,10,-1.],[0,12,2,5,2.]],tilted:0,threshold:-3.1080169137567282e-003,right_val:-1.5519270300865173e-001,left_val:2.9334270954132080e-001},{features:[[22,3,2,3,-1.],[22,3,1,3,2.]],tilted:0,threshold:2.5391200324520469e-005,right_val:8.8196061551570892e-002,left_val:-1.6706739366054535e-001},{features:[[1,3,2,3,-1.],[2,3,1,3,2.]],tilted:0,threshold:6.0073379427194595e-004,right_val:-2.3356419801712036e-001,left_val:1.3103710114955902e-001},{features:[[22,1,2,2,-1.],[22,1,2,1,2.]],tilted:1,threshold:1.8550510285422206e-003,right_val:-4.8561948537826538e-001,left_val:3.6863099783658981e-002},{features:[[0,0,8,8,-1.],[2,0,4,8,2.]],tilted:0,threshold:1.4426410198211670e-002,right_val:3.0212250351905823e-001,left_val:-1.0693179816007614e-001},{features:[[24,3,1,6,-1.],[24,5,1,2,3.]],tilted:0,threshold:7.1379961445927620e-004,right_val:-3.4755659103393555e-001,left_val:6.6108718514442444e-002},{features:[[0,1,1,9,-1.],[0,4,1,3,3.]],tilted:0,threshold:7.4721040436998010e-004,right_val:-2.9426920413970947e-001,left_val:9.3699723482131958e-002},{features:[[13,5,2,10,-1.],[14,5,1,5,2.],[13,10,1,5,2.]],tilted:0,threshold:-2.7122199535369873e-003,right_val:-1.0037600249052048e-001,left_val:2.5431159138679504e-001},{features:[[1,0,3,3,-1.],[2,1,1,1,9.]],tilted:0,threshold:1.3803270412608981e-003,right_val:-3.4946250915527344e-001,left_val:7.2880066931247711e-002},{features:[[24,3,1,8,-1.],[24,7,1,4,2.]],tilted:0,threshold:-5.0929130520671606e-004,right_val:-1.0336030274629593e-001,left_val:1.5379770100116730e-001},{features:[[6,5,11,3,-1.],[6,6,11,1,3.]],tilted:0,threshold:5.4643009789288044e-003,right_val:-7.4866658449172974e-001,left_val:3.4406248480081558e-002},{features:[[15,10,2,6,-1.],[16,10,1,3,2.],[15,13,1,3,2.]],tilted:0,threshold:-1.5927649801596999e-003,right_val:-1.0934740304946899e-001,left_val:2.9663398861885071e-001},{features:[[5,24,12,1,-1.],[9,24,4,1,3.]],tilted:0,threshold:1.4028839766979218e-002,right_val:-6.6694360971450806e-001,left_val:3.9743378758430481e-002},{features:[[5,17,15,1,-1.],[10,17,5,1,3.]],tilted:0,threshold:2.7329521253705025e-004,right_val:8.0982193350791931e-002,left_val:-3.1862759590148926e-001},{features:[[2,22,10,2,-1.],[2,22,5,1,2.],[7,23,5,1,2.]],tilted:0,threshold:2.9240400181151927e-004,right_val:2.0133419334888458e-001,left_val:-1.2847329676151276e-001}],threshold:-1.0871520042419434e+000},{simpleClassifiers:[{features:[[0,11,1,14,-1.],[0,18,1,7,2.]],tilted:0,threshold:8.0609228461980820e-003,right_val:-6.0697358846664429e-001,left_val:5.8666739612817764e-002},{features:[[23,13,1,10,-1.],[23,18,1,5,2.]],tilted:0,threshold:-1.5501689631491899e-003,right_val:-4.8750329762697220e-002,left_val:1.7384129762649536e-001},{features:[[1,13,1,10,-1.],[1,18,1,5,2.]],tilted:0,threshold:1.2496999697759748e-003,right_val:3.3550319075584412e-001,left_val:-1.4429050683975220e-001},{features:[[23,3,1,20,-1.],[23,8,1,10,2.]],tilted:0,threshold:-4.8539130948483944e-003,right_val:-8.0262362957000732e-002,left_val:1.8641370534896851e-001},{features:[[1,3,1,20,-1.],[1,8,1,10,2.]],tilted:0,threshold:4.7115739434957504e-003,right_val:3.3180761337280273e-001,left_val:-1.5105469524860382e-001},{features:[[15,10,2,6,-1.],[16,10,1,3,2.],[15,13,1,3,2.]],tilted:0,threshold:1.7103999853134155e-003,right_val:2.3733739554882050e-001,left_val:-8.0037981271743774e-002},{features:[[2,3,10,18,-1.],[7,3,5,18,2.]],tilted:0,threshold:3.5812970250844955e-002,right_val:9.4173669815063477e-002,left_val:-3.5066539049148560e-001},{features:[[5,3,15,18,-1.],[5,9,15,6,3.]],tilted:0,threshold:-1.4962269924581051e-002,right_val:-1.7400909960269928e-001,left_val:2.0005929470062256e-001},{features:[[8,10,2,6,-1.],[8,10,1,3,2.],[9,13,1,3,2.]],tilted:0,threshold:2.7363249100744724e-003,right_val:3.8100358843803406e-001,left_val:-9.7571246325969696e-002},{features:[[20,5,4,8,-1.],[22,5,2,4,2.],[20,9,2,4,2.]],tilted:0,threshold:7.6132859103381634e-003,right_val:2.6586711406707764e-001,left_val:-5.4448898881673813e-002},{features:[[3,13,6,12,-1.],[3,19,6,6,2.]],tilted:0,threshold:-1.7225209623575211e-002,right_val:-1.2890140712261200e-001,left_val:2.4964700639247894e-001},{features:[[12,17,3,6,-1.],[12,20,3,3,2.]],tilted:0,threshold:-3.5690729419002309e-005,right_val:1.1350779980421066e-001,left_val:-1.3402619957923889e-001},{features:[[0,9,2,4,-1.],[0,10,2,2,2.]],tilted:0,threshold:5.5417261319234967e-004,right_val:-4.1190868616104126e-001,left_val:7.9089917242527008e-002},{features:[[19,1,6,20,-1.],[21,1,2,20,3.]],tilted:0,threshold:5.3478521294891834e-003,right_val:1.0175509750843048e-001,left_val:-9.6101686358451843e-002},{features:[[0,1,6,20,-1.],[2,1,2,20,3.]],tilted:0,threshold:7.4408110231161118e-003,right_val:2.0994450151920319e-001,left_val:-1.4914409816265106e-001},{features:[[24,13,1,2,-1.],[24,13,1,1,2.]],tilted:1,threshold:-4.4247441110201180e-004,right_val:9.5609091222286224e-002,left_val:-1.4710159599781036e-001},{features:[[1,13,2,1,-1.],[1,13,1,1,2.]],tilted:1,threshold:-4.5897331438027322e-004,right_val:1.4493109285831451e-001,left_val:-2.4636960029602051e-001},{features:[[22,14,3,10,-1.],[23,14,1,10,3.]],tilted:0,threshold:1.4815660193562508e-002,right_val:-3.6167469620704651e-001,left_val:1.3317920267581940e-002},{features:[[0,14,3,10,-1.],[1,14,1,10,3.]],tilted:0,threshold:2.4954939362942241e-005,right_val:1.8010890483856201e-001,left_val:-1.7566919326782227e-001},{features:[[1,6,24,12,-1.],[7,6,12,12,2.]],tilted:0,threshold:4.9202781170606613e-002,right_val:4.5933071523904800e-002,left_val:-5.4308730363845825e-001},{features:[[0,0,25,2,-1.],[0,1,25,1,2.]],tilted:0,threshold:5.7320448104292154e-004,right_val:9.2909567058086395e-002,left_val:-3.1106668710708618e-001},{features:[[14,1,1,2,-1.],[14,2,1,1,2.]],tilted:0,threshold:2.3219949798658490e-004,right_val:-2.1587720513343811e-001,left_val:7.1580216288566589e-002},{features:[[5,8,2,6,-1.],[5,8,1,3,2.],[6,11,1,3,2.]],tilted:0,threshold:1.8309779698029160e-003,right_val:3.0750191211700439e-001,left_val:-9.6833512187004089e-002},{features:[[19,22,2,1,-1.],[19,22,1,1,2.]],tilted:1,threshold:-1.4543849974870682e-003,right_val:1.9532160833477974e-002,left_val:-4.4618600606918335e-001},{features:[[6,22,1,2,-1.],[6,22,1,1,2.]],tilted:1,threshold:-1.0844180360436440e-003,right_val:4.4560171663761139e-002,left_val:-6.3614559173583984e-001},{features:[[14,1,1,2,-1.],[14,2,1,1,2.]],tilted:0,threshold:-1.0226800077361986e-004,right_val:4.7297880053520203e-002,left_val:-1.9193719327449799e-001},{features:[[10,1,1,2,-1.],[10,2,1,1,2.]],tilted:0,threshold:3.4586260881042108e-005,right_val:-1.8605320155620575e-001,left_val:1.6979439556598663e-001},{features:[[21,8,4,8,-1.],[23,8,2,4,2.],[21,12,2,4,2.]],tilted:0,threshold:9.2637836933135986e-003,right_val:4.3833279609680176e-001,left_val:-6.7655943334102631e-002},{features:[[0,8,4,8,-1.],[0,8,2,4,2.],[2,12,2,4,2.]],tilted:0,threshold:9.4706043601036072e-003,right_val:4.5724090933799744e-001,left_val:-7.1250461041927338e-002},{features:[[10,0,12,1,-1.],[14,0,4,1,3.]],tilted:0,threshold:1.3785040006041527e-002,right_val:-5.7532930374145508e-001,left_val:3.3277660608291626e-002},{features:[[5,0,12,1,-1.],[9,0,4,1,3.]],tilted:0,threshold:1.1125699616968632e-002,right_val:-5.1709657907485962e-001,left_val:6.2793843448162079e-002},{features:[[16,1,9,6,-1.],[16,4,9,3,2.]],tilted:0,threshold:1.3041479978710413e-003,right_val:7.9484373331069946e-002,left_val:-1.2779800593852997e-001},{features:[[0,7,22,11,-1.],[11,7,11,11,2.]],tilted:0,threshold:-7.1009919047355652e-002,right_val:-1.0819730162620544e-001,left_val:3.0970141291618347e-001},{features:[[5,2,15,6,-1.],[10,4,5,2,9.]],tilted:0,threshold:2.3755250498652458e-002,right_val:1.5606459975242615e-001,left_val:-2.1370269358158112e-001},{features:[[9,2,2,18,-1.],[9,2,1,9,2.],[10,11,1,9,2.]],tilted:0,threshold:4.2583458125591278e-003,right_val:3.0855301022529602e-001,left_val:-9.9179089069366455e-002},{features:[[14,8,2,8,-1.],[15,8,1,4,2.],[14,12,1,4,2.]],tilted:0,threshold:-2.9643340967595577e-003,right_val:-7.8191861510276794e-002,left_val:3.2569590210914612e-001},{features:[[9,8,2,8,-1.],[9,8,1,4,2.],[10,12,1,4,2.]],tilted:0,threshold:-2.6034889742732048e-003,right_val:-1.1317720264196396e-001,left_val:3.4033051133155823e-001},{features:[[11,0,12,1,-1.],[14,0,6,1,2.]],tilted:0,threshold:1.0820809984579682e-003,right_val:1.7554299533367157e-001,left_val:-1.2465389817953110e-001},{features:[[8,5,6,20,-1.],[8,15,6,10,2.]],tilted:0,threshold:5.7707168161869049e-002,right_val:2.2689869999885559e-001,left_val:-1.4793549478054047e-001},{features:[[1,14,24,6,-1.],[1,17,24,3,2.]],tilted:0,threshold:4.4605578295886517e-003,right_val:-1.9520080089569092e-001,left_val:1.7826089262962341e-001},{features:[[8,19,9,4,-1.],[8,20,9,2,2.]],tilted:0,threshold:-1.0610480094328523e-003,right_val:8.2996547222137451e-002,left_val:-3.7853738665580750e-001},{features:[[14,21,1,2,-1.],[14,22,1,1,2.]],tilted:0,threshold:-3.4135719033656642e-005,right_val:9.1380283236503601e-002,left_val:-1.3351039588451385e-001},{features:[[7,19,11,2,-1.],[7,20,11,1,2.]],tilted:0,threshold:1.6886419616639614e-003,right_val:-4.0701639652252197e-001,left_val:7.7249847352504730e-002},{features:[[5,22,15,3,-1.],[5,23,15,1,3.]],tilted:0,threshold:3.5142740234732628e-003,right_val:3.5281270742416382e-001,left_val:-9.5770522952079773e-002},{features:[[0,24,4,1,-1.],[2,24,2,1,2.]],tilted:0,threshold:2.3527929442934692e-005,right_val:1.2634140253067017e-001,left_val:-2.4744519591331482e-001},{features:[[23,20,2,1,-1.],[23,20,1,1,2.]],tilted:1,threshold:-1.2832640204578638e-003,right_val:2.2744800895452499e-002,left_val:-6.1840718984603882e-001},{features:[[9,9,2,8,-1.],[9,9,1,4,2.],[10,13,1,4,2.]],tilted:0,threshold:1.7268180381506681e-003,right_val:2.8422999382019043e-001,left_val:-1.1576849967241287e-001},{features:[[12,5,2,14,-1.],[13,5,1,7,2.],[12,12,1,7,2.]],tilted:0,threshold:-2.8906469233334064e-003,right_val:-7.6792337000370026e-002,left_val:1.6367140412330627e-001},{features:[[11,4,8,7,-1.],[13,6,4,7,2.]],tilted:1,threshold:-4.6315401792526245e-002,right_val:4.0850590914487839e-002,left_val:-7.4018758535385132e-001},{features:[[24,23,1,2,-1.],[24,24,1,1,2.]],tilted:0,threshold:5.7796889450401068e-004,right_val:-6.3632518053054810e-001,left_val:2.2493729367852211e-002},{features:[[0,23,1,2,-1.],[0,24,1,1,2.]],tilted:0,threshold:2.3074440832715482e-005,right_val:1.9955199956893921e-001,left_val:-1.6102099418640137e-001},{features:[[23,20,2,1,-1.],[23,20,1,1,2.]],tilted:1,threshold:3.7793751107528806e-004,right_val:-1.3862569630146027e-001,left_val:8.1283740699291229e-002},{features:[[2,20,1,2,-1.],[2,20,1,1,2.]],tilted:1,threshold:3.8195648812688887e-004,right_val:-2.4290829896926880e-001,left_val:1.3359279930591583e-001},{features:[[16,1,8,6,-1.],[16,4,8,3,2.]],tilted:0,threshold:5.8516408316791058e-003,right_val:1.1935660243034363e-001,left_val:-1.1702840030193329e-001},{features:[[0,23,24,1,-1.],[8,23,8,1,3.]],tilted:0,threshold:-6.6102901473641396e-003,right_val:-6.5725468099117279e-002,left_val:4.5771899819374084e-001},{features:[[6,22,15,1,-1.],[11,22,5,1,3.]],tilted:0,threshold:1.5774279600009322e-003,right_val:9.2294909060001373e-002,left_val:-1.7396670579910278e-001},{features:[[10,8,4,4,-1.],[11,8,2,4,2.]],tilted:0,threshold:-3.3255841117352247e-003,right_val:-9.2243947088718414e-002,left_val:3.4227269887924194e-001},{features:[[4,9,18,3,-1.],[4,10,18,1,3.]],tilted:0,threshold:7.9220151528716087e-003,right_val:-9.0017801523208618e-001,left_val:3.3358339220285416e-002},{features:[[6,12,2,1,-1.],[7,12,1,1,2.]],tilted:0,threshold:-1.5816869563423097e-004,right_val:-1.1450929939746857e-001,left_val:2.8342399001121521e-001},{features:[[12,1,1,2,-1.],[12,2,1,1,2.]],tilted:0,threshold:3.4481548937037587e-005,right_val:-1.8168149888515472e-001,left_val:1.6481010615825653e-001},{features:[[7,23,8,1,-1.],[9,23,4,1,2.]],tilted:0,threshold:2.0665400370489806e-005,right_val:1.3373629748821259e-001,left_val:-2.1995100378990173e-001},{features:[[12,15,1,10,-1.],[12,20,1,5,2.]],tilted:0,threshold:-1.1080419644713402e-002,right_val:-6.6116742789745331e-002,left_val:4.8246449232101440e-001},{features:[[1,17,11,8,-1.],[1,19,11,4,2.]],tilted:0,threshold:-1.7540570115670562e-003,right_val:9.9385917186737061e-002,left_val:-3.2195270061492920e-001},{features:[[5,5,15,18,-1.],[5,11,15,6,3.]],tilted:0,threshold:-4.3996911495923996e-002,right_val:-1.2036679685115814e-001,left_val:2.2565670311450958e-001},{features:[[1,1,8,6,-1.],[1,4,8,3,2.]],tilted:0,threshold:2.7804148849099874e-003,right_val:1.6074460744857788e-001,left_val:-1.7865939438343048e-001},{features:[[24,3,1,10,-1.],[24,8,1,5,2.]],tilted:0,threshold:-6.3753691501915455e-003,right_val:3.9249900728464127e-002,left_val:-6.4006751775741577e-001}],threshold:-1.1262429952621460e+000},{simpleClassifiers:[{features:[[2,10,6,2,-1.],[4,10,2,2,3.]],tilted:0,threshold:-5.5710230953991413e-003,right_val:-1.1429090052843094e-001,left_val:3.6355179548263550e-001},{features:[[10,0,5,18,-1.],[10,9,5,9,2.]],tilted:0,threshold:-4.2533349245786667e-002,right_val:-1.4519970118999481e-001,left_val:2.9995280504226685e-001},{features:[[4,5,17,20,-1.],[4,15,17,10,2.]],tilted:0,threshold:1.8632240593433380e-001,right_val:3.0858990550041199e-001,left_val:-1.7916500568389893e-001},{features:[[10,3,6,9,-1.],[10,6,6,3,3.]],tilted:0,threshold:7.9207762610167265e-004,right_val:1.5244559943675995e-001,left_val:-2.2290030121803284e-001},{features:[[7,0,11,18,-1.],[7,9,11,9,2.]],tilted:0,threshold:3.7020680308341980e-001,right_val:1.8848129882812500e+003,left_val:4.9322400242090225e-002},{features:[[21,9,2,4,-1.],[22,9,1,2,2.],[21,11,1,2,2.]],tilted:0,threshold:-1.4178600395098329e-003,right_val:-1.0939670354127884e-001,left_val:3.7516620755195618e-001},{features:[[9,4,6,6,-1.],[9,6,6,2,3.]],tilted:0,threshold:9.9071431905031204e-003,right_val:-5.6801307201385498e-001,left_val:1.1609580367803574e-001},{features:[[22,0,3,24,-1.],[23,0,1,24,3.]],tilted:0,threshold:1.2393960496410728e-003,right_val:1.3559770584106445e-001,left_val:-1.6311010718345642e-001},{features:[[0,0,3,24,-1.],[1,0,1,24,3.]],tilted:0,threshold:1.0521570220589638e-003,right_val:2.7264788746833801e-001,left_val:-1.3373890519142151e-001},{features:[[1,6,24,12,-1.],[7,6,12,12,2.]],tilted:0,threshold:4.4079091399908066e-002,right_val:4.0246348828077316e-002,left_val:-5.9660512208938599e-001},{features:[[5,0,12,3,-1.],[5,1,12,1,3.]],tilted:0,threshold:2.9262369498610497e-003,right_val:3.5247230529785156e-001,left_val:-1.0696300119161606e-001},{features:[[8,2,14,4,-1.],[8,3,14,2,2.]],tilted:0,threshold:-3.0069800559431314e-003,right_val:6.5251968801021576e-002,left_val:-4.8501899838447571e-001},{features:[[0,4,1,21,-1.],[0,11,1,7,3.]],tilted:0,threshold:-1.1685189791023731e-002,right_val:4.8711609095335007e-002,left_val:-6.4442038536071777e-001},{features:[[21,4,4,16,-1.],[21,4,2,16,2.]],tilted:0,threshold:1.9985749386250973e-003,right_val:5.2013739943504333e-002,left_val:-2.7951678633689880e-001},{features:[[0,4,4,16,-1.],[2,4,2,16,2.]],tilted:0,threshold:2.6772189885377884e-003,right_val:9.9645562469959259e-002,left_val:-4.2468771338462830e-001},{features:[[16,0,1,2,-1.],[16,1,1,1,2.]],tilted:0,threshold:6.8805456976406276e-005,right_val:-1.7418420314788818e-001,left_val:1.2885080277919769e-001},{features:[[1,4,2,1,-1.],[1,4,1,1,2.]],tilted:1,threshold:-5.4919061949476600e-004,right_val:1.2902539968490601e-001,left_val:-2.4935460090637207e-001},{features:[[23,3,1,14,-1.],[23,10,1,7,2.]],tilted:0,threshold:-3.6701560020446777e-003,right_val:-7.0212572813034058e-002,left_val:1.4826999604701996e-001},{features:[[1,7,1,8,-1.],[1,11,1,4,2.]],tilted:0,threshold:-1.1337900068610907e-003,right_val:-1.4618510007858276e-001,left_val:3.0599281191825867e-001},{features:[[23,8,2,10,-1.],[23,13,2,5,2.]],tilted:0,threshold:2.3506619036197662e-003,right_val:1.4266289770603180e-001,left_val:-8.9912116527557373e-002},{features:[[0,8,2,10,-1.],[0,13,2,5,2.]],tilted:0,threshold:2.8336180839687586e-003,right_val:2.5490570068359375e-001,left_val:-1.5099850296974182e-001},{features:[[23,22,2,1,-1.],[23,22,1,1,2.]],tilted:1,threshold:-1.2854239903390408e-003,right_val:4.2431071400642395e-002,left_val:-8.5387921333312988e-001},{features:[[2,22,1,2,-1.],[2,22,1,1,2.]],tilted:1,threshold:4.2762109660543501e-004,right_val:-2.9406520724296570e-001,left_val:1.0683789849281311e-001},{features:[[21,3,4,20,-1.],[23,3,2,10,2.],[21,13,2,10,2.]],tilted:0,threshold:1.6246499493718147e-002,right_val:2.4584819376468658e-001,left_val:-6.3655123114585876e-002},{features:[[0,3,4,20,-1.],[0,3,2,10,2.],[2,13,2,10,2.]],tilted:0,threshold:1.7573300749063492e-002,right_val:4.3239068984985352e-001,left_val:-1.0204940289258957e-001},{features:[[13,14,3,1,-1.],[14,14,1,1,3.]],tilted:0,threshold:3.9662708877585828e-004,right_val:1.4920459687709808e-001,left_val:-8.3214908838272095e-002},{features:[[0,21,4,3,-1.],[1,21,2,3,2.]],tilted:0,threshold:-3.6139058647677302e-004,right_val:1.2784530222415924e-001,left_val:-2.6586309075355530e-001},{features:[[21,10,4,2,-1.],[21,10,2,2,2.]],tilted:0,threshold:6.9180950522422791e-003,right_val:2.7569389343261719e-001,left_val:-7.3350369930267334e-002},{features:[[0,10,4,2,-1.],[2,10,2,2,2.]],tilted:0,threshold:6.1709531582891941e-003,right_val:3.1572508811950684e-001,left_val:-1.0247000306844711e-001},{features:[[23,8,2,12,-1.],[23,8,1,12,2.]],tilted:0,threshold:-7.1866158396005630e-004,right_val:-4.6928219497203827e-002,left_val:2.6965659856796265e-001},{features:[[0,7,2,11,-1.],[1,7,1,11,2.]],tilted:0,threshold:-7.2996778180822730e-004,right_val:-9.4768881797790527e-002,left_val:4.4648209214210510e-001},{features:[[13,0,12,24,-1.],[17,8,4,8,9.]],tilted:0,threshold:4.4531229138374329e-001,right_val:-5.9585410356521606e-001,left_val:2.9124239459633827e-002},{features:[[4,21,1,2,-1.],[4,21,1,1,2.]],tilted:1,threshold:-1.4287939993664622e-003,right_val:3.9988748729228973e-002,left_val:-7.4422240257263184e-001},{features:[[13,0,12,24,-1.],[17,8,4,8,9.]],tilted:0,threshold:1.2369489669799805e-001,right_val:9.1279089450836182e-002,left_val:-5.8587580919265747e-002},{features:[[0,0,12,24,-1.],[4,8,4,8,9.]],tilted:0,threshold:4.2855501174926758e-001,right_val:-7.4231338500976563e-001,left_val:4.5858480036258698e-002},{features:[[18,11,1,3,-1.],[18,12,1,1,3.]],tilted:0,threshold:2.5031169570866041e-005,right_val:9.3773640692234039e-002,left_val:-1.0736320167779922e-001},{features:[[6,11,1,3,-1.],[6,12,1,1,3.]],tilted:0,threshold:4.9963229685090482e-005,right_val:2.1811039745807648e-001,left_val:-1.4796620607376099e-001},{features:[[18,11,2,4,-1.],[19,11,1,2,2.],[18,13,1,2,2.]],tilted:0,threshold:2.9644069727510214e-003,right_val:5.7993519306182861e-001,left_val:-4.4790871441364288e-002},{features:[[5,11,2,4,-1.],[5,11,1,2,2.],[6,13,1,2,2.]],tilted:0,threshold:1.5743350377306342e-003,right_val:3.8991490006446838e-001,left_val:-7.9150870442390442e-002},{features:[[12,17,6,3,-1.],[12,18,6,1,3.]],tilted:0,threshold:6.0039688833057880e-003,right_val:-9.5635467767715454e-001,left_val:2.3944819346070290e-002},{features:[[0,12,2,4,-1.],[0,13,2,2,2.]],tilted:0,threshold:4.2808058788068593e-004,right_val:-3.6652448773384094e-001,left_val:7.5896047055721283e-002},{features:[[23,0,2,6,-1.],[23,0,2,3,2.]],tilted:1,threshold:1.1229339987039566e-002,right_val:-4.8159009218215942e-001,left_val:2.3623889312148094e-002},{features:[[2,0,6,2,-1.],[2,0,3,2,2.]],tilted:1,threshold:-1.5405230224132538e-003,right_val:-2.9972699284553528e-001,left_val:1.0571250319480896e-001},{features:[[15,0,8,1,-1.],[17,0,4,1,2.]],tilted:0,threshold:5.5489651858806610e-003,right_val:-4.7681280970573425e-001,left_val:1.7742669209837914e-002},{features:[[2,0,8,1,-1.],[4,0,4,1,2.]],tilted:0,threshold:4.0579969063401222e-003,right_val:-4.6888938546180725e-001,left_val:6.8737268447875977e-002},{features:[[12,10,11,3,-1.],[12,11,11,1,3.]],tilted:0,threshold:5.0152339972555637e-003,right_val:-7.2317951917648315e-001,left_val:1.9214930012822151e-002},{features:[[8,10,2,6,-1.],[8,10,1,3,2.],[9,13,1,3,2.]],tilted:0,threshold:1.7280939500778913e-003,right_val:3.2534700632095337e-001,left_val:-1.0325799882411957e-001},{features:[[1,23,24,2,-1.],[1,23,12,2,2.]],tilted:0,threshold:-2.4781659245491028e-002,right_val:8.6045600473880768e-002,left_val:-3.1078928709030151e-001},{features:[[8,8,2,12,-1.],[8,8,1,6,2.],[9,14,1,6,2.]],tilted:0,threshold:-1.8893589731305838e-003,right_val:-1.3323649764060974e-001,left_val:2.3782789707183838e-001},{features:[[7,13,11,3,-1.],[7,14,11,1,3.]],tilted:0,threshold:4.2236722074449062e-003,right_val:-6.6566771268844604e-001,left_val:5.0405610352754593e-002},{features:[[11,0,2,4,-1.],[11,0,2,2,2.]],tilted:1,threshold:-1.4858880080282688e-002,right_val:-6.4919866621494293e-002,left_val:6.0808688402175903e-001},{features:[[16,0,1,2,-1.],[16,1,1,1,2.]],tilted:0,threshold:1.7625730251893401e-003,right_val:6.1008471250534058e-001,left_val:-2.6388010010123253e-002},{features:[[8,0,1,2,-1.],[8,1,1,1,2.]],tilted:0,threshold:6.5077590988948941e-005,right_val:-1.9105610251426697e-001,left_val:1.8001219630241394e-001},{features:[[13,0,12,8,-1.],[13,2,12,4,2.]],tilted:0,threshold:-2.4088749196380377e-003,right_val:7.4184507131576538e-002,left_val:-2.3599469661712646e-001},{features:[[3,6,16,2,-1.],[7,6,8,2,2.]],tilted:0,threshold:2.9149129986763000e-003,right_val:1.2283849716186523e-001,left_val:-2.8016430139541626e-001},{features:[[13,12,1,12,-1.],[9,16,1,4,3.]],tilted:1,threshold:6.2007219530642033e-003,right_val:1.3337619602680206e-001,left_val:-1.2533469498157501e-001},{features:[[4,0,12,1,-1.],[7,0,6,1,2.]],tilted:0,threshold:1.1466739699244499e-002,right_val:-7.6637887954711914e-001,left_val:4.2434468865394592e-002},{features:[[3,2,20,16,-1.],[13,2,10,8,2.],[3,10,10,8,2.]],tilted:0,threshold:-3.5191178321838379e-002,right_val:-1.2784330546855927e-001,left_val:1.8971160054206848e-001},{features:[[1,1,6,24,-1.],[1,9,6,8,3.]],tilted:0,threshold:4.5229779061628506e-005,right_val:1.9156099855899811e-001,left_val:-2.0386409759521484e-001},{features:[[23,23,2,2,-1.],[23,23,1,2,2.]],tilted:0,threshold:3.5897540510632098e-004,right_val:-2.2871449589729309e-001,left_val:7.3452822864055634e-002},{features:[[0,23,2,2,-1.],[1,23,1,2,2.]],tilted:0,threshold:2.1426780222100206e-005,right_val:1.7463220655918121e-001,left_val:-2.3904530704021454e-001},{features:[[21,14,4,8,-1.],[21,14,2,8,2.]],tilted:0,threshold:5.4916929453611374e-002,right_val:-8.3265262842178345e-001,left_val:5.7207080535590649e-003},{features:[[0,14,4,8,-1.],[2,14,2,8,2.]],tilted:0,threshold:-1.6181350219994783e-003,right_val:-7.9697981476783752e-002,left_val:4.8578798770904541e-001},{features:[[22,3,3,11,-1.],[23,3,1,11,3.]],tilted:0,threshold:1.8090730300173163e-003,right_val:1.8998570740222931e-001,left_val:-5.5137149989604950e-002},{features:[[6,9,2,10,-1.],[6,9,1,5,2.],[7,14,1,5,2.]],tilted:0,threshold:-3.4946738742291927e-004,right_val:-1.5550769865512848e-001,left_val:1.9685539603233337e-001},{features:[[8,19,11,6,-1.],[8,21,11,2,3.]],tilted:0,threshold:2.9834950692020357e-004,right_val:9.0075306594371796e-002,left_val:-2.1016369760036469e-001},{features:[[9,20,6,2,-1.],[9,21,6,1,2.]],tilted:0,threshold:1.4741290360689163e-003,right_val:-5.2060151100158691e-001,left_val:5.4677028208971024e-002},{features:[[24,17,1,8,-1.],[24,21,1,4,2.]],tilted:0,threshold:6.1138661112636328e-004,right_val:1.8061339855194092e-001,left_val:-1.1104019731283188e-001},{features:[[10,4,2,4,-1.],[10,6,2,2,2.]],tilted:0,threshold:-2.2484369765152223e-005,right_val:-1.7276780307292938e-001,left_val:1.8097889423370361e-001},{features:[[24,17,1,8,-1.],[24,21,1,4,2.]],tilted:0,threshold:1.8067440250888467e-003,right_val:-3.5405930876731873e-001,left_val:7.0003516972064972e-002},{features:[[0,17,1,8,-1.],[0,21,1,4,2.]],tilted:0,threshold:4.2339949868619442e-004,right_val:2.4823880195617676e-001,left_val:-1.6226269304752350e-001},{features:[[16,8,2,8,-1.],[17,8,1,4,2.],[16,12,1,4,2.]],tilted:0,threshold:4.7990549355745316e-003,right_val:4.2028531432151794e-001,left_val:-5.3161401301622391e-002},{features:[[7,8,2,8,-1.],[7,8,1,4,2.],[8,12,1,4,2.]],tilted:0,threshold:1.0556719498708844e-003,right_val:2.5979140400886536e-001,left_val:-1.3919970393180847e-001},{features:[[7,6,12,12,-1.],[7,9,12,6,2.]],tilted:0,threshold:4.1018951684236526e-002,right_val:4.8265969753265381e-001,left_val:-5.3697388619184494e-002}],threshold:-1.1986110210418701e+000}],size:[25,25],tilted:true};
+})(jsfeat.haar);
View
7 cascades/mouth.js
7 additions, 0 deletions not shown
View
7 cascades/profileface.js
7 additions, 0 deletions not shown
View
7 cascades/upperbody.js
7 additions, 0 deletions not shown
View
4 compile/build.xml 100644 → 100755
@@ -4,10 +4,14 @@
<filelist id="filelist" dir="../src">
<file name="jsfeat.js"/>
<file name="jsfeat_struct.js" />
+ <file name="jsfeat_cache.js" />
<file name="jsfeat_math.js" />
+ <file name="jsfeat_transform.js" />
<file name="jsfeat_imgproc.js" />
<file name="jsfeat_fast_corners.js" />
<file name="jsfeat_optical_flow_lk.js" />
+ <file name="jsfeat_haar.js" />
+ <file name="jsfeat_bbf.js" />
</filelist>
</concat>
</target>
View
2  src/jsfeat.js 100644 → 100755
@@ -9,4 +9,4 @@ var jsfeat = jsfeat || { REVISION: 'ALPHA' };
self.Int32Array = self.Int32Array || Array;
self.Uint32Array = self.Uint32Array || Array;
self.Uint8Array = self.Uint8Array || Array;
-self.Float32Array = self.Float32Array || Array;
+self.Float32Array = self.Float32Array || Array;
View
394 src/jsfeat_bbf.js
@@ -0,0 +1,394 @@
+/**
+ * BBF: Brightness Binary Feature
+ *
+ * @author Eugene Zatepyakin / http://inspirit.ru/
+ *
+ * this code is a rewrite from https://github.com/liuliu/ccv implementation
+ * @author Liu Liu / http://liuliu.me/
+ *
+ * The original paper refers to: YEF∗ Real-Time Object Detection, Yotam Abramson and Bruno Steux
+ */
+
+(function(global) {
+ "use strict";
+ //
+ var bbf = (function() {
+
+ var _group_func = function(r1, r2) {
+ var distance = (r1.width * 0.25 + 0.5)|0;
+
+ return r2.x <= r1.x + distance &&
+ r2.x >= r1.x - distance &&
+ r2.y <= r1.y + distance &&
+ r2.y >= r1.y - distance &&
+ r2.width <= (r1.width * 1.5 + 0.5)|0 &&
+ (r2.width * 1.5 + 0.5)|0 >= r1.width;
+ }
+
+ return {
+
+ interval: 4,
+ scale: 1.1486,
+ next: 5,
+ scale_to: 1,
+
+ // make features local copy
+ // to avoid array allocation with each scale
+ // this is strange but array works faster than Int32 version???
+ prepare_cascade: function(cascade) {
+ var sn = cascade.stage_classifier.length;
+ for (var j = 0; j < sn; j++) {
+ var orig_feature = cascade.stage_classifier[j].feature;
+ var f_cnt = cascade.stage_classifier[j].count;
+ var feature = cascade.stage_classifier[j]._feature = new Array(f_cnt);
+ for (var k = 0; k < f_cnt; k++) {
+ feature[k] = {"size" : orig_feature[k].size,
+ "px" : new Array(orig_feature[k].size),
+ "pz" : new Array(orig_feature[k].size),
+ "nx" : new Array(orig_feature[k].size),
+ "nz" : new Array(orig_feature[k].size)};
+ }
+ }
+ },
+
+ build_pyramid: function(canvas, min_width, min_height, interval, do_grayscale) {
+ if (typeof interval === "undefined") { interval = 4; }
+ if (typeof do_grayscale === "undefined") { do_grayscale = true; }
+
+ // need to convert to grayscale
+ if(do_grayscale) {
+ var ctx_input = canvas.getContext('2d');
+ var in_size = canvas.width * canvas.height;
+ var img_data_input = ctx_input.getImageData(0, 0, canvas.width, canvas.height);
+ var data_input = img_data_input.data;
+ var data_u32 = new Uint32Array(data_input.buffer);
+ var gray_n = jsfeat.cache.get_buffer(in_size);
+ var gray_data = gray_n.u8;
+ jsfeat.imgproc.grayscale(data_input, gray_data);
+ var alpha = (0xff << 24);
+ var i = in_size,pix=0;
+ while (--i >= 0) {
+ pix = gray_data[i];
+ data_u32[i] = alpha | (pix << 16) | (pix << 8) | pix;
+ }
+ ctx_input.putImageData(img_data_input, 0, 0);
+ jsfeat.cache.put_buffer(gray_n);
+ }
+ //
+
+ this.interval = interval;
+ this.scale = Math.pow(2, 1 / (this.interval + 1));
+ this.next = (this.interval + 1)|0;
+ this.scale_to = (Math.log(Math.min(canvas.width / min_width, canvas.height / min_height)) / Math.log(this.scale))|0;
+
+ var _canvas = document.createElement('canvas');
+ _canvas.width = canvas.width;
+ _canvas.height = canvas.height;
+ var _ctx = _canvas.getContext('2d');
+
+ var ret = new Array((this.scale_to + this.next * 2) * 4);
+ ret[0] = { "width" : canvas.width,
+ "height" : canvas.height,
+ "data" : canvas.getContext("2d").getImageData(0, 0, canvas.width, canvas.height).data };
+ var nw, nh;
+ for (i = 1; i <= this.interval; ++i) {
+ nw = (canvas.width / Math.pow(this.scale, i))|0;
+ nh = (canvas.height / Math.pow(this.scale, i))|0;
+ _ctx.drawImage(canvas, 0, 0, canvas.width, canvas.height, 0, 0, nw, nh);
+ ret[i * 4] = { "width" : nw,
+ "height" : nh,
+ "data" : _ctx.getImageData(0, 0, nw, nh).data };
+ }
+ for (i = this.next; i < this.scale_to + this.next * 2; ++i) {
+ nw = ret[i * 4 - this.next * 4].width >> 1;
+ nh = ret[i * 4 - this.next * 4].height >> 1;
+ _ctx.drawImage(canvas, 0, 0, canvas.width, canvas.height, 0, 0, nw, nh);
+ ret[i * 4] = { "width" : nw,
+ "height" : nh,
+ "data" : _ctx.getImageData(0, 0, nw, nh).data };
+ }
+ for (i = this.next * 2; i < this.scale_to + this.next * 2; ++i) {
+ nw = ret[i * 4 - this.next * 4].width >> 1;
+ nh = ret[i * 4 - this.next * 4].height >> 1;
+
+ _ctx.drawImage(canvas, 1, 0, canvas.width-1, canvas.height, 0, 0, nw-2, nh);
+
+ ret[i * 4 + 1] = { "width" : nw,
+ "height" : nh,
+ "data" : _ctx.getImageData(0, 0, nw, nh).data };
+
+ _ctx.drawImage(canvas, 0, 1, canvas.width, canvas.height-1, 0, 0, nw, nh-2);
+
+ ret[i * 4 + 2] = { "width" : nw,
+ "height" : nh,
+ "data" : _ctx.getImageData(0, 0, nw, nh).data };
+
+ _ctx.drawImage(canvas, 1, 1, canvas.width-1, canvas.height-1, 0, 0, nw-2, nh-2);
+
+ ret[i * 4 + 3] = { "width" : nw,
+ "height" : nh,
+ "data" : _ctx.getImageData(0, 0, nw, nh).data };
+ }
+
+ return ret;
+ },
+
+ detect: function(pyr, cascade) {
+ var interval = this.interval;
+ var scale = this.scale;
+ var next = this.next;
+ var scale_upto = this.scale_to;
+ var i=0,j=0,k=0,n=0,x=0,y=0,q=0,sn=0,f_cnt=0,q_cnt=0,p=0,pmin=0,nmax=0,f=0,i4=0,qw=0,qh=0;
+ var sum=0.0, alpha, feature, orig_feature, feature_k, feature_o, flag = true, shortcut=true;
+ var scale_x = 1.0, scale_y = 1.0;
+ var dx = [0, 1, 0, 1];
+ var dy = [0, 0, 1, 1];
+ var seq = [];
+
+ var u8 = [], u8o = [0,0,0];
+ var step = [0,0,0];
+ var paddings = [0,0,0];
+
+ for (i = 0; i < scale_upto; i++) {
+ i4 = (i<<2);
+ qw = pyr[i4 + (next << 3)].width - (cascade.width >> 2);
+ qh = pyr[i4 + (next << 3)].height - (cascade.height >> 2);
+ step[0] = pyr[i4].width << 2; step[1] = pyr[i4 + (next << 2)].width << 2; step[2] = pyr[i4 + (next << 3)].width << 2;
+ paddings[0] = (pyr[i4].width << 4) - (qw << 4);
+ paddings[1] = (pyr[i4 + (next << 2)].width << 3) - (qw << 3);
+ paddings[2] = (pyr[i4 + (next << 3)].width << 2) - (qw << 2);
+ sn = cascade.stage_classifier.length;
+ for (j = 0; j < sn; j++) {
+ orig_feature = cascade.stage_classifier[j].feature;
+ feature = cascade.stage_classifier[j]._feature;
+ f_cnt = cascade.stage_classifier[j].count;
+ for (k = 0; k < f_cnt; k++) {
+ feature_k = feature[k];
+ feature_o = orig_feature[k];
+ q_cnt = feature_o.size|0;
+ for (q = 0; q < q_cnt; q++) {
+ feature_k.px[q] = (feature_o.px[q] << 2) + feature_o.py[q] * step[feature_o.pz[q]];
+ feature_k.pz[q] = feature_o.pz[q];
+ feature_k.nx[q] = (feature_o.nx[q] << 2) + feature_o.ny[q] * step[feature_o.nz[q]];
+ feature_k.nz[q] = feature_o.nz[q];
+ }
+ }
+ }
+ u8[0] = pyr[i4].data; u8[1] = pyr[i4 + (next<<2)].data;
+ for (q = 0; q < 4; q++) {
+ u8[2] = pyr[i4 + (next<<3) + q].data;
+ u8o[0] = (dx[q]<<3) + dy[q] * (pyr[i4].width<<3); u8o[1] = (dx[q]<<2) + dy[q] * (pyr[i4 + (next<<2)].width<<2); u8o[2]=0;
+ for (y = 0; y < qh; y++) {
+ for (x = 0; x < qw; x++) {
+ sum = 0;
+ flag = true;
+ sn = cascade.stage_classifier.length;
+ for (j = 0; j < sn; j++) {
+ sum = 0;
+ alpha = cascade.stage_classifier[j].alpha;
+ feature = cascade.stage_classifier[j]._feature;
+ f_cnt = cascade.stage_classifier[j].count;
+ for (k = 0; k < f_cnt; k++) {
+ feature_k = feature[k];
+ pmin = u8[feature_k.pz[0]][u8o[feature_k.pz[0]] + feature_k.px[0]];
+ nmax = u8[feature_k.nz[0]][u8o[feature_k.nz[0]] + feature_k.nx[0]];
+ if (pmin <= nmax) {
+ sum += alpha[k << 1];
+ } else {
+ shortcut = true;
+ q_cnt = feature_k.size;
+ for (f = 0; f < q_cnt; f++) {
+ if (feature_k.pz[f] >= 0) {
+ p = u8[feature_k.pz[f]][u8o[feature_k.pz[f]] + feature_k.px[f]];
+ if (p < pmin) {
+ if (p <= nmax) {
+ shortcut = false;
+ break;
+ }
+ pmin = p;
+ }
+ }
+ if (feature_k.nz[f] >= 0) {
+ n = u8[feature_k.nz[f]][u8o[feature_k.nz[f]] + feature_k.nx[f]];
+ if (n > nmax) {
+ if (pmin <= n) {
+ shortcut = false;
+ break;
+ }
+ nmax = n;
+ }
+ }
+ }
+ sum += (shortcut) ? alpha[(k << 1) + 1] : alpha[k << 1];
+ }
+ }
+ if (sum < cascade.stage_classifier[j].threshold) {
+ flag = false;
+ break;
+ }
+ }
+ if (flag) {
+ seq.push({"x" : (x * 4 + dx[q] * 2) * scale_x,
+ "y" : (y * 4 + dy[q] * 2) * scale_y,
+ "width" : cascade.width * scale_x,
+ "height" : cascade.height * scale_y,
+ "neighbor" : 1,
+ "confidence" : sum});
+ }
+ u8o[0] += 16;
+ u8o[1] += 8;
+ u8o[2] += 4;
+ }
+ u8o[0] += paddings[0];
+ u8o[1] += paddings[1];
+ u8o[2] += paddings[2];
+ }
+ }
+ scale_x *= scale;
+ scale_y *= scale;
+ }
+
+ return seq;
+ },
+
+ // OpenCV method to group detected rectangles
+ group_rectangles: function(rects, min_neighbors) {
+ if (typeof min_neighbors === "undefined") { min_neighbors = 1; }
+ var i, j, n = rects.length;
+ var node = [];
+ for (i = 0; i < n; ++i) {
+ node[i] = {"parent" : -1,
+ "element" : rects[i],
+ "rank" : 0};
+ }
+ for (i = 0; i < n; ++i) {
+ if (!node[i].element)
+ continue;
+ var root = i;
+ while (node[root].parent != -1)
+ root = node[root].parent;
+ for (j = 0; j < n; ++j) {
+ if( i != j && node[j].element && _group_func(node[i].element, node[j].element)) {
+ var root2 = j;
+
+ while (node[root2].parent != -1)
+ root2 = node[root2].parent;
+
+ if(root2 != root) {
+ if(node[root].rank > node[root2].rank)
+ node[root2].parent = root;
+ else {
+ node[root].parent = root2;
+ if (node[root].rank == node[root2].rank)
+ node[root2].rank++;
+ root = root2;
+ }
+
+ /* compress path from node2 to the root: */
+ var temp, node2 = j;
+ while (node[node2].parent != -1) {
+ temp = node2;
+ node2 = node[node2].parent;
+ node[temp].parent = root;
+ }
+
+ /* compress path from node to the root: */
+ node2 = i;
+ while (node[node2].parent != -1) {
+ temp = node2;
+ node2 = node[node2].parent;
+ node[temp].parent = root;
+ }
+ }
+ }
+ }
+ }
+ var idx_seq = [];
+ var class_idx = 0;
+ for(i = 0; i < n; i++) {
+ j = -1;
+ var node1 = i;
+ if(node[node1].element) {
+ while (node[node1].parent != -1)
+ node1 = node[node1].parent;
+ if(node[node1].rank >= 0)
+ node[node1].rank = ~class_idx++;
+ j = ~node[node1].rank;
+ }
+ idx_seq[i] = j;
+ }
+
+ var comps = [];
+ for (i = 0; i < class_idx+1; ++i) {
+ comps[i] = {"neighbors" : 0,
+ "x" : 0,
+ "y" : 0,
+ "width" : 0,
+ "height" : 0,
+ "confidence" : 0};
+ }
+
+ // count number of neighbors
+ for(i = 0; i < n; ++i) {
+ var r1 = rects[i];
+ var idx = idx_seq[i];
+
+ if (comps[idx].neighbors == 0)
+ comps[idx].confidence = r1.confidence;
+
+ ++comps[idx].neighbors;
+
+ comps[idx].x += r1.x;
+ comps[idx].y += r1.y;
+ comps[idx].width += r1.width;
+ comps[idx].height += r1.height;
+ comps[idx].confidence = Math.max(comps[idx].confidence, r1.confidence);
+ }
+
+ var seq2 = [];
+ // calculate average bounding box
+ for(i = 0; i < class_idx; ++i) {
+ n = comps[i].neighbors;
+ if (n >= min_neighbors)
+ seq2.push({"x" : (comps[i].x * 2 + n) / (2 * n),
+ "y" : (comps[i].y * 2 + n) / (2 * n),
+ "width" : (comps[i].width * 2 + n) / (2 * n),
+ "height" : (comps[i].height * 2 + n) / (2 * n),
+ "neighbors" : comps[i].neighbors,
+ "confidence" : comps[i].confidence});
+ }
+
+ var result_seq = [];
+ n = seq2.length;
+ // filter out small face rectangles inside large face rectangles
+ for(i = 0; i < n; ++i) {
+ var r1 = seq2[i];
+ var flag = true;
+ for(j = 0; j < n; ++j) {
+ var r2 = seq2[j];
+ var distance = (r2.width * 0.25 + 0.5)|0;
+
+ if(i != j &&
+ r1.x >= r2.x - distance &&
+ r1.y >= r2.y - distance &&
+ r1.x + r1.width <= r2.x + r2.width + distance &&
+ r1.y + r1.height <= r2.y + r2.height + distance &&
+ (r2.neighbors > Math.max(3, r1.neighbors) || r1.neighbors < 3)) {
+ flag = false;
+ break;
+ }
+ }
+
+ if(flag)
+ result_seq.push(r1);
+ }
+ return result_seq;
+ }
+
+ };
+
+ })();
+
+ global.bbf = bbf;
+
+})(jsfeat);
View
71 src/jsfeat_cache.js
@@ -0,0 +1,71 @@
+/**
+ * @author Eugene Zatepyakin / http://inspirit.ru/
+ */
+
+(function(global) {
+ "use strict";
+ //
+
+ var cache = (function() {
+
+ // very primitive array cache, still need testing if it helps
+ // of course V8 has its own powerful cache sys but i'm not sure
+ // it caches several multichannel 640x480 buffer creations each frame
+
+ var _pool_node_t = (function () {
+ function _pool_node_t(size_in_bytes) {
+ this.next = null;
+ this.size = size_in_bytes|0;
+ this.buffer = new ArrayBuffer(size_in_bytes);
+ this.u8 = new Uint8Array(this.buffer);
+ this.i32 = new Int32Array(this.buffer);
+ this.f32 = new Float32Array(this.buffer);
+ }
+ return _pool_node_t;
+ })();
+
+ var _pool_head, _pool_tail;
+ var _pool_size = 0;
+
+ return {
+
+ allocate: function(capacity, data_size) {
+ _pool_head = _pool_tail = new _pool_node_t(data_size);
+ for (var i = 0; i < capacity; ++i) {
+ var node = new _pool_node_t(data_size);
+ _pool_tail = _pool_tail.next = node;
+
+ _pool_size++;
+ }
+ },
+
+ get_buffer: function(size_in_bytes) {
+ // assume we have enough free nodes
+ var node = _pool_head;
+ _pool_head = _pool_head.next;
+ _pool_size--;
+
+ if(size_in_bytes > node.size) {
+ node.buffer = new ArrayBuffer(size_in_bytes);
+ node.u8 = new Uint8Array(node.buffer);
+ node.i32 = new Int32Array(node.buffer);
+ node.f32 = new Float32Array(node.buffer);
+ node.size = size_in_bytes;
+ }
+
+ return node;
+ },
+
+ put_buffer: function(node) {
+ _pool_tail = _pool_tail.next = node;
+ _pool_size++;
+ }
+ };
+ })();
+
+ global.cache = cache;
+ // for now we dont need more than 30 buffers
+ // if having cache sys really helps we can add auto extending sys
+ cache.allocate(30, 640*4);
+
+})(jsfeat);
View
30 src/jsfeat_fast_corners.js 100644 → 100755
@@ -38,7 +38,7 @@ The references are:
},
_cmp_score_8 = function(src, off, pixel, d, threshold) {
- var N = 15, k = 0, v = src[off];
+ var N = 13, k = 0, v = src[off];
var a0 = threshold,a=0,b0=0,b=0;
for( ; k < N; ++k ) {
@@ -161,21 +161,28 @@ The references are:
return _threshold;
},
- detect: function(img, w, h, corners, border, pattern_size) {
- if (typeof pattern_size === "undefined") { pattern_size = 16; }
+ detect: function(src, corners, border, pattern_size) {
+ if (typeof pattern_size === "undefined") {
+ pattern_size = 16;
+ } else if(pattern_size != 16 && pattern_size!=12 && pattern_size!=8) {
+ pattern_size = 16;
+ }
if (typeof border === "undefined") { border = 3; }
- var K = (pattern_size/2)|0, N = (pattern_size + K + 1)|0;
+ var K = (pattern_size>>1), N = (pattern_size + K + 1)|0;
+ var img = src.data, w = src.cols, h = src.rows;
var i=0, j=0, k=0, vt=0, x=0, m3=0;
- var buf = new Uint8Array(w*3);
- var cpbuf = new Int32Array((w+1)*3);
+ var buf_node = jsfeat.cache.get_buffer(3 * w);
+ var cpbuf_node = jsfeat.cache.get_buffer(((w+1)*3)<<2);
+ var buf = buf_node.u8;//new Uint8Array(w*3);
+ var cpbuf = cpbuf_node.i32;//new Int32Array((w+1)*3);
var pixel = pixel_off;
var sd = score_diff;
var sy = Math.max(3, border);
var ey = Math.min((h-2), (h-border));
var sx = Math.max(3, border);
var ex = Math.min((w - 3), (w - border));
- var _count = 0, corners_cnt = 0;
+ var _count = 0, corners_cnt = 0, pt;
var score_func = pattern_size == 16 ? _cmp_score_16 : (pattern_size == 12 ? _cmp_score_12 : _cmp_score_8);
var thresh_tab = threshold_tab;
var threshold = _threshold;
@@ -307,13 +314,14 @@ The references are:
score > buf[pprev+jm1] && score > buf[pprev+j] && score > buf[pprev+jp1] &&
score > buf[curr+jm1] && score > buf[curr+j] && score > buf[curr+jp1]) ) {
// save corner
- corners[corners_cnt*3] = j;
- corners[corners_cnt*3+1] = (i-1);
- corners[corners_cnt*3+2] = score;
+ pt = corners[corners_cnt];
+ pt.x = j, pt.y = (i-1), pt.score = score;
corners_cnt++;
}
}
} // y loop
+ jsfeat.cache.put_buffer(buf_node);
+ jsfeat.cache.put_buffer(cpbuf_node);
return corners_cnt;
}
};
@@ -322,4 +330,4 @@ The references are:
global.fast_corners = fast_corners;
fast_corners.set_threshold(20); // set default
-})(jsfeat);
+})(jsfeat);
View
290 src/jsfeat_haar.js
@@ -0,0 +1,290 @@
+/**
+ * @author Eugene Zatepyakin / http://inspirit.ru/
+ *
+ * this code is a rewrite from https://github.com/mtschirs/js-objectdetect implementation
+ * @author Martin Tschirsich / http://www.tu-darmstadt.de/~m_t
+ */
+
+(function(global) {
+ "use strict";
+ //
+ var haar = (function() {
+
+ var _group_func = function(r1, r2) {
+ var distance = (r1.width * 0.25 + 0.5)|0;
+
+ return r2.x <= r1.x + distance &&
+ r2.x >= r1.x - distance &&
+ r2.y <= r1.y + distance &&
+ r2.y >= r1.y - distance &&
+ r2.width <= (r1.width * 1.5 + 0.5)|0 &&
+ (r2.width * 1.5 + 0.5)|0 >= r1.width;
+ }
+
+ return {
+
+ edges_density: 0.07,
+
+ detect_single_scale: function(int_sum, int_sqsum, int_tilted, int_canny_sum, width, height, scale, classifier) {
+ var win_w = (classifier.size[0] * scale)|0,
+ win_h = (classifier.size[1] * scale)|0,
+ step_x = (0.5 * scale + 1.5)|0,
+ step_y = step_x;
+ var i,j,k,x,y,ex=(width-win_w)|0,ey=(height-win_h)|0;
+ var w1=(width+1)|0,edge_dens,mean,variance,std;
+ var inv_area = 1.0 / (win_w * win_h);
+ var stages,stage,trees,tree,sn,tn,fn,found=true,stage_thresh,stage_sum,tree_sum,feature,features;
+ var fi_a,fi_b,fi_c,fi_d,fw,fh;
+
+ var ii_a=0,ii_b=win_w,ii_c=win_h*w1,ii_d=ii_c+win_w;
+ var edges_thresh = ((win_w*win_h) * 0xff * this.edges_density)|0;
+ // if too much gradient we also can skip
+ //var edges_thresh_high = ((win_w*win_h) * 0xff * 0.3)|0;
+
+ var rects = [];
+ for(y = 0; y < ey; y += step_y) {
+ ii_a = y * w1;
+ for(x = 0; x < ex; x += step_x, ii_a += step_x) {
+
+ mean = int_sum[ii_a]
+ - int_sum[ii_a+ii_b]
+ - int_sum[ii_a+ii_c]
+ + int_sum[ii_a+ii_d];
+
+ // canny prune
+ if(int_canny_sum) {
+ edge_dens = (int_canny_sum[ii_a]
+ - int_canny_sum[ii_a+ii_b]
+ - int_canny_sum[ii_a+ii_c]
+ + int_canny_sum[ii_a+ii_d]);
+ if(edge_dens < edges_thresh || mean < 20) {
+ x += step_x, ii_a += step_x;
+ continue;
+ }
+ }
+
+ mean *= inv_area;
+ variance = (int_sqsum[ii_a]
+ - int_sqsum[ii_a+ii_b]
+ - int_sqsum[ii_a+ii_c]
+ + int_sqsum[ii_a+ii_d]) * inv_area - mean * mean;
+
+ std = variance > 0. ? Math.sqrt(variance) : 1;
+
+ stages = classifier.complexClassifiers;
+ sn = stages.length;
+ found = true;
+ for(i = 0; i < sn; ++i) {
+ stage = stages[i];
+ stage_thresh = stage.threshold;
+ trees = stage.simpleClassifiers;
+ tn = trees.length;
+ stage_sum = 0;
+ for(j = 0; j < tn; ++j) {
+ tree = trees[j];
+ tree_sum = 0;
+ features = tree.features;
+ fn = features.length;
+ if(tree.tilted === 1) {
+ for(k=0; k < fn; ++k) {
+ feature = features[k];
+ fi_a = ~~(x + feature[0] * scale) + ~~(y + feature[1] * scale) * w1;
+ fw = ~~(feature[2] * scale);
+ fh = ~~(feature[3] * scale);
+ fi_b = fw * w1;
+ fi_c = fh * w1;
+
+ tree_sum += (int_tilted[fi_a]
+ - int_tilted[fi_a + fw + fi_b]
+ - int_tilted[fi_a - fh + fi_c]
+ + int_tilted[fi_a + fw - fh + fi_b + fi_c]) * feature[4];
+ }
+ } else {
+ for(k=0; k < fn; ++k) {
+ feature = features[k];
+ fi_a = ~~(x + feature[0] * scale) + ~~(y + feature[1] * scale) * w1;
+ fw = ~~(feature[2] * scale);
+ fh = ~~(feature[3] * scale);
+ fi_c = fh * w1;
+
+ tree_sum += (int_sum[fi_a]
+ - int_sum[fi_a+fw]
+ - int_sum[fi_a+fi_c]
+ + int_sum[fi_a+fi_c+fw]) * feature[4];
+ }
+ }
+ stage_sum += (tree_sum * inv_area < tree.threshold * std) ? tree.left_val : tree.right_val;
+ }
+ if (stage_sum < stage_thresh) {
+ found = false;
+ break;
+ }
+ }
+
+ if(found) {
+ rects.push({"x" : x,
+ "y" : y,
+ "width" : win_w,
+ "height" : win_h,
+ "neighbor" : 1,
+ "confidence" : stage_sum});
+ x += step_x, ii_a += step_x;
+ }
+ }
+ }
+ return rects;
+ },
+
+ detect_multi_scale: function(int_sum, int_sqsum, int_tilted, int_canny_sum, width, height, classifier, scale_factor, scale_min) {
+ if (typeof scale_factor === "undefined") { scale_factor = 1.2; }
+ if (typeof scale_min === "undefined") { scale_min = 1.0; }
+ var win_w = classifier.size[0];
+ var win_h = classifier.size[1];
+ var rects = [];
+ while (scale_min * win_w < width && scale_min * win_h < height) {
+ rects = rects.concat(this.detect_single_scale(int_sum, int_sqsum, int_tilted, int_canny_sum, width, height, scale_min, classifier));
+ scale_min *= scale_factor;
+ }
+ return rects;
+ },
+
+ // OpenCV method to group detected rectangles
+ group_rectangles: function(rects, min_neighbors) {
+ if (typeof min_neighbors === "undefined") { min_neighbors = 1; }
+ var i, j, n = rects.length;
+ var node = [];
+ for (i = 0; i < n; ++i) {
+ node[i] = {"parent" : -1,
+ "element" : rects[i],
+ "rank" : 0};
+ }
+ for (i = 0; i < n; ++i) {
+ if (!node[i].element)
+ continue;
+ var root = i;
+ while (node[root].parent != -1)
+ root = node[root].parent;
+ for (j = 0; j < n; ++j) {
+ if( i != j && node[j].element && _group_func(node[i].element, node[j].element)) {
+ var root2 = j;
+
+ while (node[root2].parent != -1)
+ root2 = node[root2].parent;
+
+ if(root2 != root) {
+ if(node[root].rank > node[root2].rank)
+ node[root2].parent = root;
+ else {
+ node[root].parent = root2;
+ if (node[root].rank == node[root2].rank)
+ node[root2].rank++;
+ root = root2;
+ }
+
+ /* compress path from node2 to the root: */
+ var temp, node2 = j;
+ while (node[node2].parent != -1) {
+ temp = node2;
+ node2 = node[node2].parent;
+ node[temp].parent = root;
+ }
+
+ /* compress path from node to the root: */
+ node2 = i;
+ while (node[node2].parent != -1) {
+ temp = node2;
+ node2 = node[node2].parent;
+ node[temp].parent = root;
+ }
+ }
+ }
+ }
+ }
+ var idx_seq = [];
+ var class_idx = 0;
+ for(i = 0; i < n; i++) {
+ j = -1;
+ var node1 = i;
+ if(node[node1].element) {
+ while (node[node1].parent != -1)
+ node1 = node[node1].parent;
+ if(node[node1].rank >= 0)
+ node[node1].rank = ~class_idx++;
+ j = ~node[node1].rank;
+ }
+ idx_seq[i] = j;
+ }
+
+ var comps = [];
+ for (i = 0; i < class_idx+1; ++i) {
+ comps[i] = {"neighbors" : 0,
+ "x" : 0,
+ "y" : 0,
+ "width" : 0,
+ "height" : 0,
+ "confidence" : 0};
+ }
+
+ // count number of neighbors
+ for(i = 0; i < n; ++i) {
+ var r1 = rects[i];
+ var idx = idx_seq[i];
+
+ if (comps[idx].neighbors == 0)
+ comps[idx].confidence = r1.confidence;
+
+ ++comps[idx].neighbors;
+
+ comps[idx].x += r1.x;
+ comps[idx].y += r1.y;
+ comps[idx].width += r1.width;
+ comps[idx].height += r1.height;
+ comps[idx].confidence = Math.max(comps[idx].confidence, r1.confidence);
+ }
+
+ var seq2 = [];
+ // calculate average bounding box
+ for(i = 0; i < class_idx; ++i) {
+ n = comps[i].neighbors;
+ if (n >= min_neighbors)
+ seq2.push({"x" : (comps[i].x * 2 + n) / (2 * n),
+ "y" : (comps[i].y * 2 + n) / (2 * n),
+ "width" : (comps[i].width * 2 + n) / (2 * n),
+ "height" : (comps[i].height * 2 + n) / (2 * n),
+ "neighbors" : comps[i].neighbors,
+ "confidence" : comps[i].confidence});
+ }
+
+ var result_seq = [];
+ n = seq2.length;
+ // filter out small face rectangles inside large face rectangles
+ for(i = 0; i < n; ++i) {
+ var r1 = seq2[i];
+ var flag = true;
+ for(j = 0; j < n; ++j) {
+ var r2 = seq2[j];
+ var distance = (r2.width * 0.25 + 0.5)|0;
+
+ if(i != j &&
+ r1.x >= r2.x - distance &&
+ r1.y >= r2.y - distance &&
+ r1.x + r1.width <= r2.x + r2.width + distance &&
+ r1.y + r1.height <= r2.y + r2.height + distance &&
+ (r2.neighbors > Math.max(3, r1.neighbors) || r1.neighbors < 3)) {
+ flag = false;
+ break;
+ }
+ }
+
+ if(flag)
+ result_seq.push(r1);
+ }
+ return result_seq;
+ }
+ };
+
+ })();
+
+ global.haar = haar;
+
+})(jsfeat);
View
1,008 src/jsfeat_imgproc.js 100644 → 100755
@@ -8,67 +8,440 @@
var imgproc = (function() {
+ var _resample_u8 = function(src, dst, nw, nh) {
+ var xofs = [],xofs_count=0;
+ var ch=src.channel,w=src.cols,h=src.rows;
+ var src_d=src.data,dst_d=dst.data;
+ var scale_x = w / nw, scale_y = h / nh;
+ var inv_scale_256 = (scale_x * scale_y * 0x10000)|0;
+ var dx=0,dy=0,sx=0,sy=0,sx1=0,sx2=0,i=0,k=0,fsx1=0.0,fsx2=0.0;
+ var a=0,b=0,dxn=0,alpha=0,beta=0,beta1=0;
+
+ var buf_node = jsfeat.cache.get_buffer((nw*ch)<<2);
+ var sum_node = jsfeat.cache.get_buffer((nw*ch)<<2);
+
+ var buf = buf_node.i32;
+ var sum = sum_node.i32;
+
+ for (; dx < nw; dx++) {
+ fsx1 = dx * scale_x, fsx2 = fsx1 + scale_x;
+ sx1 = (fsx1 + 1.0 - 1e-6)|0, sx2 = fsx2|0;
+ sx1 = Math.min(sx1, w - 1);
+ sx2 = Math.min(sx2, w - 1);
+
+ if(sx1 > fsx1) {
+ xofs[xofs_count++] = {"si": ((sx1 - 1)*ch)|0,
+ "di": (dx * ch)|0,
+ "alpha": ((sx1 - fsx1) * 0x100)|0};
+ }
+ for(sx = sx1; sx < sx2; sx++){
+ xofs[xofs_count++] = {"si": (sx * ch)|0,
+ "di": (dx * ch)|0,
+ "alpha": 256};
+ }
+ if(fsx2 - sx2 > 1e-3) {
+ xofs[xofs_count++] = {"si": (sx2 * ch)|0,
+ "di": (dx * ch)|0,
+ "alpha": ((fsx2 - sx2) * 256)|0};
+ }
+ }
+
+ for (dx = 0; dx < nw * ch; dx++) {
+ buf[dx] = sum[dx] = 0;
+ }
+ dy = 0;
+ for (sy = 0; sy < h; sy++) {
+ a = w * sy;
+ for (k = 0; k < xofs_count; k++) {
+ dxn = xofs[k].di;
+ alpha = xofs[k].alpha;
+ sx1 = xofs[k].si;
+ for (i = 0; i < ch; i++) {
+ buf[dxn + i] += src_d[a+sx1+i] * alpha;
+ }
+ }
+ if ((dy + 1) * scale_y <= sy + 1 || sy == h - 1) {
+ beta = (Math.max(sy + 1 - (dy + 1) * scale_y, 0.0) * 256)|0;
+ beta1 = 256 - beta;
+ b = nw * dy;
+ if (beta <= 0) {
+ for (dx = 0; dx < nw * ch; dx++) {
+ dst_d[b+dx] = Math.min(Math.max((sum[dx] + buf[dx] * 256) / inv_scale_256, 0), 255);
+ sum[dx] = buf[dx] = 0;
+ }
+ } else {
+ for (dx = 0; dx < nw * ch; dx++) {
+ dst_d[b+dx] = Math.min(Math.max((sum[dx] + buf[dx] * beta1) / inv_scale_256, 0), 255);
+ sum[dx] = buf[dx] * beta;
+ buf[dx] = 0;
+ }
+ }
+ dy++;
+ } else {
+ for(dx = 0; dx < nw * ch; dx++) {
+ sum[dx] += buf[dx] * 256;
+ buf[dx] = 0;
+ }
+ }
+ }
+
+ jsfeat.cache.put_buffer(sum_node);
+ jsfeat.cache.put_buffer(buf_node);
+ }
+
+ var _resample = function(src, dst, nw, nh) {
+ var xofs = [],xofs_count=0;
+ var ch=src.channel,w=src.cols,h=src.rows;
+ var src_d=src.data,dst_d=dst.data;
+ var scale_x = w / nw, scale_y = h / nh;
+ var scale = 1.0 / (scale_x * scale_y);
+ var dx=0,dy=0,sx=0,sy=0,sx1=0,sx2=0,i=0,k=0,fsx1=0.0,fsx2=0.0;
+ var a=0,b=0,dxn=0,alpha=0.0,beta=0.0,beta1=0.0;
+
+ var buf_node = jsfeat.cache.get_buffer((nw*ch)<<2);
+ var sum_node = jsfeat.cache.get_buffer((nw*ch)<<2);
+
+ var buf = buf_node.f32;
+ var sum = sum_node.f32;
+
+ for (; dx < nw; dx++) {
+ fsx1 = dx * scale_x, fsx2 = fsx1 + scale_x;
+ sx1 = (fsx1 + 1.0 - 1e-6)|0, sx2 = fsx2|0;
+ sx1 = Math.min(sx1, w - 1);
+ sx2 = Math.min(sx2, w - 1);
+
+ if(sx1 > fsx1) {
+ xofs[xofs_count++] = {"si": ((sx1 - 1)*ch)|0,
+ "di": (dx * ch)|0,
+ "alpha": (sx1 - fsx1) * scale};
+ }
+ for(sx = sx1; sx < sx2; sx++){
+ xofs[xofs_count++] = {"si": (sx * ch)|0,
+ "di": (dx * ch)|0,
+ "alpha": scale};
+ }
+ if(fsx2 - sx2 > 1e-3) {
+ xofs[xofs_count++] = {"si": (sx2 * ch)|0,
+ "di": (dx * ch)|0,
+ "alpha": (fsx2 - sx2) * scale};
+ }
+ }
+
+ for (dx = 0; dx < nw * ch; dx++) {
+ buf[dx] = sum[dx] = 0;
+ }
+ dy = 0;
+ for (sy = 0; sy < h; sy++) {
+ a = w * sy;
+ for (k = 0; k < xofs_count; k++) {
+ dxn = xofs[k].di;
+ alpha = xofs[k].alpha;
+ sx1 = xofs[k].si;
+ for (i = 0; i < ch; i++) {
+ buf[dxn + i] += src_d[a+sx1+i] * alpha;
+ }
+ }
+ if ((dy + 1) * scale_y <= sy + 1 || sy == h - 1) {
+ beta = Math.max(sy + 1 - (dy + 1) * scale_y, 0.0);
+ beta1 = 1.0 - beta;
+ b = nw * dy;
+ if (Math.abs(beta) < 1e-3) {
+ for (dx = 0; dx < nw * ch; dx++) {
+ dst_d[b+dx] = sum[dx] + buf[dx];
+ sum[dx] = buf[dx] = 0;
+ }
+ } else {
+ for (dx = 0; dx < nw * ch; dx++) {
+ dst_d[b+dx] = sum[dx] + buf[dx] * beta1;
+ sum[dx] = buf[dx] * beta;
+ buf[dx] = 0;
+ }
+ }
+ dy++;
+ } else {
+ for(dx = 0; dx < nw * ch; dx++) {
+ sum[dx] += buf[dx];
+ buf[dx] = 0;
+ }
+ }
+ }
+ jsfeat.cache.put_buffer(sum_node);
+ jsfeat.cache.put_buffer(buf_node);
+ }
+
+ var _convol_u8 = function(buf, src_d, dst_d, w, h, filter, kernel_size, half_kernel) {
+ var i=0,j=0,k=0,sp=0,dp=0,sum=0,sum1=0,sum2=0,sum3=0,f0=filter[0],fk=0;
+ var w2=w<<1,w3=w*3,w4=w<<2;
+ // hor pass
+ for (; i < h; ++i) {
+ sum = src_d[sp];
+ for (j = 0; j < half_kernel; ++j) {
+ buf[j] = sum;
+ }
+ for (j = 0; j <= w-2; j+=2) {
+ buf[j + half_kernel] = src_d[sp+j];
+ buf[j + half_kernel+1] = src_d[sp+j+1];
+ }
+ for (; j < w; ++j) {
+ buf[j + half_kernel] = src_d[sp+j];
+ }
+ sum = src_d[sp+w-1];
+ for (j = w; j < half_kernel + w; ++j) {
+ buf[j + half_kernel] = sum;
+ }
+ for (j = 0; j <= w-4; j+=4) {
+ sum = buf[j] * f0,
+ sum1 = buf[j+1] * f0,
+ sum2 = buf[j+2] * f0,
+ sum3 = buf[j+3] * f0;
+ for (k = 1; k < kernel_size; ++k) {
+ fk = filter[k];
+ sum += buf[k + j] * fk;
+ sum1 += buf[k + j+1] * fk;
+ sum2 += buf[k + j+2] * fk;
+ sum3 += buf[k + j+3] * fk;
+ }
+ dst_d[dp+j] = sum >> 8;
+ dst_d[dp+j+1] = sum1 >> 8;
+ dst_d[dp+j+2] = sum2 >> 8;
+ dst_d[dp+j+3] = sum3 >> 8;
+ }
+ for (; j < w; ++j) {
+ sum = buf[j] * f0;
+ for (k = 1; k < kernel_size; ++k) {
+ sum += buf[k + j] * filter[k];
+ }
+ dst_d[dp+j] = sum >> 8;
+ }
+ sp += w;
+ dp += w;
+ }
+
+ // vert pass
+ for (i = 0; i < w; ++i) {
+ sum = dst_d[i];
+ for (j = 0; j < half_kernel; ++j) {
+ buf[j] = sum;
+ }
+ k = i;
+ for (j = 0; j <= h-2; j+=2, k+=w2) {
+ buf[j+half_kernel] = dst_d[k];
+ buf[j+half_kernel+1] = dst_d[k+w];
+ }
+ for (; j < h; ++j, k+=w) {
+ buf[j+half_kernel] = dst_d[k];
+ }
+ sum = dst_d[(h-1)*w + i];
+ for (j = h; j < half_kernel + h; ++j) {
+ buf[j + half_kernel] = sum;
+ }
+ dp = i;
+ for (j = 0; j <= h-4; j+=4, dp+=w4) {
+ sum = buf[j] * f0,
+ sum1 = buf[j+1] * f0,
+ sum2 = buf[j+2] * f0,
+ sum3 = buf[j+3] * f0;
+ for (k = 1; k < kernel_size; ++k) {
+ fk = filter[k];
+ sum += buf[k + j] * fk;
+ sum1 += buf[k + j+1] * fk;
+ sum2 += buf[k + j+2] * fk;
+ sum3 += buf[k + j+3] * fk;
+ }
+ dst_d[dp] = sum >> 8;
+ dst_d[dp+w] = sum1 >> 8;
+ dst_d[dp+w2] = sum2 >> 8;
+ dst_d[dp+w3] = sum3 >> 8;
+ }
+ for (; j < h; ++j, dp+=w) {
+ sum = buf[j] * f0;
+ for (k = 1; k < kernel_size; ++k) {
+ sum += buf[k + j] * filter[k];
+ }
+ dst_d[dp] = sum >> 8;
+ }
+ }
+ }
+
+ var _convol = function(buf, src_d, dst_d, w, h, filter, kernel_size, half_kernel) {
+ var i=0,j=0,k=0,sp=0,dp=0,sum=0.0,sum1=0.0,sum2=0.0,sum3=0.0,f0=filter[0],fk=0.0;
+ var w2=w<<1,w3=w*3,w4=w<<2;
+ // hor pass
+ for (; i < h; ++i) {
+ sum = src_d[sp];
+ for (j = 0; j < half_kernel; ++j) {
+ buf[j] = sum;
+ }
+ for (j = 0; j <= w-2; j+=2) {
+ buf[j + half_kernel] = src_d[sp+j];
+ buf[j + half_kernel+1] = src_d[sp+j+1];
+ }
+ for (; j < w; ++j) {
+ buf[j + half_kernel] = src_d[sp+j];
+ }
+ sum = src_d[sp+w-1];
+ for (j = w; j < half_kernel + w; ++j) {
+ buf[j + half_kernel] = sum;
+ }
+ for (j = 0; j <= w-4; j+=4) {
+ sum = buf[j] * f0,
+ sum1 = buf[j+1] * f0,
+ sum2 = buf[j+2] * f0,
+ sum3 = buf[j+3] * f0;
+ for (k = 1; k < kernel_size; ++k) {
+ fk = filter[k];
+ sum += buf[k + j] * fk;
+ sum1 += buf[k + j+1] * fk;
+ sum2 += buf[k + j+2] * fk;
+ sum3 += buf[k + j+3] * fk;
+ }
+ dst_d[dp+j] = sum;
+ dst_d[dp+j+1] = sum1;
+ dst_d[dp+j+2] = sum2;
+ dst_d[dp+j+3] = sum3;
+ }
+ for (; j < w; ++j) {
+ sum = buf[j] * f0;
+ for (k = 1; k < kernel_size; ++k) {
+ sum += buf[k + j] * filter[k];
+ }
+ dst_d[dp+j] = sum;
+ }
+ sp += w;
+ dp += w;
+ }
+
+ // vert pass
+ for (i = 0; i < w; ++i) {
+ sum = dst_d[i];
+ for (j = 0; j < half_kernel; ++j) {
+ buf[j] = sum;
+ }
+ k = i;
+ for (j = 0; j <= h-2; j+=2, k+=w2) {
+ buf[j+half_kernel] = dst_d[k];
+ buf[j+half_kernel+1] = dst_d[k+w];
+ }
+ for (; j < h; ++j, k+=w) {
+ buf[j+half_kernel] = dst_d[k];
+ }
+ sum = dst_d[(h-1)*w + i];
+ for (j = h; j < half_kernel + h; ++j) {
+ buf[j + half_kernel] = sum;
+ }
+ dp = i;
+ for (j = 0; j <= h-4; j+=4, dp+=w4) {
+ sum = buf[j] * f0,
+ sum1 = buf[j+1] * f0,
+ sum2 = buf[j+2] * f0,
+ sum3 = buf[j+3] * f0;
+ for (k = 1; k < kernel_size; ++k) {
+ fk = filter[k];
+ sum += buf[k + j] * fk;
+ sum1 += buf[k + j+1] * fk;
+ sum2 += buf[k + j+2] * fk;
+ sum3 += buf[k + j+3] * fk;
+ }
+ dst_d[dp] = sum;
+ dst_d[dp+w] = sum1;
+ dst_d[dp+w2] = sum2;
+ dst_d[dp+w3] = sum3;
+ }
+ for (; j < h; ++j, dp+=w) {
+ sum = buf[j] * f0;
+ for (k = 1; k < kernel_size; ++k) {
+ sum += buf[k + j] * filter[k];
+ }
+ dst_d[dp] = sum;
+ }
+ }
+ }
+
return {
// TODO: add support for RGB/BGR order
+ // for raw arrays
grayscale: function(src, dst) {
var srcLength = src.length|0, srcLength_16 = (srcLength - 16)|0;
var j = 0;
- for (var i = 0; i <= srcLength_16; i += 16, j += 4) {
- dst[j] = ((src[i] * 77) + (src[i + 1] * 151) + (src[i + 2] * 28)) >> 8;
- dst[j + 1] = ((src[i + 4] * 77) + (src[i + 5] * 151) + (src[i + 6] * 28)) >> 8;
+ var coeff_r = 4899, coeff_g = 9617, coeff_b = 1868;
- dst[j + 2] = ((src[i + 8] * 77) + (src[i + 9] * 151) + (src[i + 10] * 28)) >> 8;
- dst[j + 3] = ((src[i + 12] * 77) + (src[i + 13] * 151) + (src[i + 14] * 28)) >> 8;
+ for (var i = 0; i <= srcLength_16; i += 16, j += 4) {
+ dst[j] = (src[i] * coeff_r + src[i+1] * coeff_g + src[i+2] * coeff_b + 8192) >> 14;
+ dst[j + 1] = (src[i+4] * coeff_r + src[i+5] * coeff_g + src[i+6] * coeff_b + 8192) >> 14;
+ dst[j + 2] = (src[i+8] * coeff_r + src[i+9] * coeff_g + src[i+10] * coeff_b + 8192) >> 14;
+ dst[j + 3] = (src[i+12] * coeff_r + src[i+13] * coeff_g + src[i+14] * coeff_b + 8192) >> 14;
}
for (; i < srcLength; i += 4, ++j) {
- dst[j] = ((src[i] * 77) + (src[i + 1] * 151) + (src[i + 2] * 28)) >> 8;
+ dst[j] = (src[i] * coeff_r + src[i+1] * coeff_g + src[i+2] * coeff_b + 8192) >> 14;
+ }
+ },
+ // derived from CCV library
+ resample: function(src, dst, nw, nh) {
+ var h=src.rows,w=src.cols;
+ if (h > nh && w > nw) {
+ // using the fast alternative (fix point scale, 0x100 to avoid overflow)
+ if (src.type&jsfeat.U8_t && dst.type&jsfeat.U8_t && h * w / (nh * nw) < 0x100) {
+ _resample_u8(src, dst, nw, nh);
+ } else {
+ _resample(src, dst, nw, nh);
+ }
}
},
- box_blur: function(src, dst, w, h, hwin) {
+ box_blur: function(src, dst, hwin, scale) {
+ if (typeof scale === "undefined") { scale = 1; }
var win = (2*hwin+1)|0;
- var _buf = new Int32Array(w*win+w);
+ var w = src.cols, h = src.rows;
+ var data_type = src.type;
+ var _buf,buf_sz=(w*win+w)|0,src_d=src.data,dst_d=dst.data;
var sums = (w*win)|0;
var next_row=0,oldest_row=0;
- var i=0, j=0, s0=0, s1=0;
- var hsum = 0, back=0;
-
+ var i=0, j=0, s0, s1;
+ var hsum,back;
var input = 0, output = (w*hwin - hwin) | 0;
+ // select correct data type
+ var buf_node = jsfeat.cache.get_buffer(buf_sz<<2);
+ if((data_type&jsfeat.U8_t) || (data_type&jsfeat.S32_t)) {
+ _buf = buf_node.i32;
+ } else {
+ _buf = buf_node.f32;
+ }
+
for(; i < w; ++i){ _buf[sums+i] = 0; }
for (i=0; i<h; ++i) {
hsum = 0;
back = input;
- for (j = 0; j < win-1; ++j) hsum += src[input+j];
+ for (j = 0; j < win-1; ++j) hsum += src_d[input+j];
for (; j <= w-2; j+=2) {
- hsum += src[input+j];
+ hsum += src_d[input+j];
_buf[next_row+j] = hsum;
_buf[sums+j] += hsum;
- hsum -= src[back++];
+ hsum -= src_d[back++];
//
- hsum += src[input+j+1];
+ hsum += src_d[input+j+1];
_buf[next_row+j+1] = hsum;
_buf[sums+j+1] += hsum;
- hsum -= src[back++];
+ hsum -= src_d[back++];
}
for (; j < w; ++j) {
- hsum += src[input+j];
+ hsum += src_d[input+j];
_buf[next_row+j] = hsum;
_buf[sums+j] += hsum;
- hsum -= src[back++];
+ hsum -= src_d[back++];
}
if (i >= win-1) {
for(j = win-1; j <= w-2; j+=2) {
s0 = _buf[sums+j]; s1 = _buf[sums+j+1];
- dst[output+j] = s0; dst[output+j+1] = s1;
+ dst_d[output+j] = s0*scale; dst_d[output+j+1] = s1*scale;
_buf[sums+j] = s0 - _buf[oldest_row+j];
_buf[sums+j+1] = s1 - _buf[oldest_row+j+1];
}
for(; j < w; ++j) {
s0 = _buf[sums+j];
- dst[output+j] = s0;
+ dst_d[output+j] = s0*scale;
_buf[sums+j] = s0 - _buf[oldest_row+j];
}
output += w;
@@ -79,120 +452,86 @@
next_row += w;
next_row = (next_row < sums) * next_row;
}
+
+ jsfeat.cache.put_buffer(buf_node);
},
- gaussian_blur_u8: function(src, dst, w, h, kernel_size, sigma) {
+ gaussian_blur: function(src, dst, kernel_size, sigma) {
if (typeof sigma === "undefined") { sigma = 0.0; }
if (typeof kernel_size === "undefined") { kernel_size = 0; }
- kernel_size = kernel_size == 0 ? (Math.max(1, (4.0 * sigma + 1.0 - 1e-8)|0) * 2 + 1)|0 : kernel_size;
+ kernel_size = kernel_size == 0 ? (Math.max(1, (4.0 * sigma + 1.0 - 1e-8)) * 2 + 1)|0 : kernel_size;
var half_kernel = kernel_size >> 1;
- var i=0,j=0,k=0,sum=0,sum1=0,sp=0,dp=0,w2=w<<1;
- var buf = new Uint8Array(kernel_size + Math.max(h, w));
- // we use int based kernel
- var filter = new Int32Array(kernel_size);
+ var w = src.cols, h = src.rows;
+ var data_type = src.type, is_u8 = data_type&jsfeat.U8_t;
+ var src_d = src.data, dst_d = dst.data;
+ var buf,filter,buf_sz=(kernel_size + Math.max(h, w))|0;
- jsfeat.math.get_gaussian_kernel(kernel_size, sigma, filter, jsfeat.U8_t);
+ var buf_node = jsfeat.cache.get_buffer(buf_sz<<2);
+ var filt_node = jsfeat.cache.get_buffer(kernel_size<<2);
- // hor pass
- for (; i < h; ++i) {
- sum = src[sp];
- for (j = 0; j < half_kernel; ++j) {
- buf[j] = sum;
- }
- for (j = 0; j <= w-2; j+=2) {
- buf[j + half_kernel] = src[sp+j];
- buf[j + half_kernel+1] = src[sp+j+1];
- }
- for (; j < w; ++j) {
- buf[j + half_kernel] = src[sp+j];
- }
- sum = src[sp+w-1];
- for (j = w; j < half_kernel + w; ++j) {
- buf[j + half_kernel] = sum;
- }
- for (j = 0; j <= w-2; j+=2) {
- sum = 0, sum1 = 0;
- for (k = 0; k < kernel_size; ++k) {
- sum += buf[k + j] * filter[k];
- sum1 += buf[k + j+1] * filter[k];
- }
- dst[dp+j] = sum >> 8;
- dst[dp+j+1] = sum1 >> 8;
- }
- for (; j < w; ++j) {
- sum = 0;
- for (k = 0; k < kernel_size; ++k) {
- sum += buf[k + j] * filter[k];
- }
- dst[dp+j] = sum >> 8;
- }
- sp += w;
- dp += w;
+ if(is_u8) {
+ buf = buf_node.u8;
+ filter = filt_node.i32;
+ } else if(data_type&jsfeat.S32_t) {
+ buf = buf_node.i32;
+ filter = filt_node.f32;
+ } else {
+ buf = buf_node.f32;
+ filter = filt_node.f32;
}
- // vert pass
- for (i = 0; i < w; ++i) {
- sum = dst[i];
- for (j = 0; j < half_kernel; ++j) {
- buf[j] = sum;
- }
- k = i;
- for (j = 0; j <= h-2; j+=2, k+=w2) {
- buf[j+half_kernel] = dst[k];
- buf[j+half_kernel+1] = dst[k+w];
- }
- for (; j < h; ++j, k+=w) {
- buf[j+half_kernel] = dst[k];
- }
- sum = dst[(h-1)*w + i];
- for (j = h; j < half_kernel + h; ++j) {
- buf[j + half_kernel] = sum;
- }
- dp = i;
- for (j = 0; j <= h-2; j+=2, dp+=w2) {
- sum = 0, sum1=0;
- for (k = 0; k < kernel_size; ++k) {
- sum += buf[k + j] * filter[k];
- sum1 += buf[k + j+1] * filter[k];
- }
- dst[dp] = sum >> 8;
- dst[dp+w] = sum1 >> 8;
- }
- for (; j < h; ++j, dp+=w) {
- sum = 0;
- for (k = 0; k < kernel_size; ++k) {
- sum += buf[k + j] * filter[k];
- }
- dst[dp] = sum >> 8;
- }
+ jsfeat.math.get_gaussian_kernel(kernel_size, sigma, filter, data_type);
+
+ if(is_u8) {
+ _convol_u8(buf, src_d, dst_d, w, h, filter, kernel_size, half_kernel);
+ } else {
+ _convol(buf, src_d, dst_d, w, h, filter, kernel_size, half_kernel);
}
- },
- pyrdown_fast_u8: function(src, w, h, dst) {
+ jsfeat.cache.put_buffer(buf_node);
+ jsfeat.cache.put_buffer(filt_node);
+ },
+ // assume we always need it for u8 image
+ pyrdown: function(src, dst) {
+ var w = src.cols, h = src.rows;
var w2 = w >> 1, h2 = h >> 1;
var x=0,y=0,sptr=0,sline=0,dptr=0;
+ var src_d = src.data, dst_d = dst.data;
for(y = 0; y < h2; ++y) {
sline = sptr;
for(x = 0; x <= w2-2; x+=2, dptr+=2, sline += 4) {
- dst[dptr] = (src[sline] + src[sline+1] +
- src[sline+w] + src[sline+w+1] + 2) >> 2;
- dst[dptr+1] = (src[sline+2] + src[sline+3] +
- src[sline+w+2] + src[sline+w+3] + 2) >> 2;
+ dst_d[dptr] = (src_d[sline] + src_d[sline+1] +
+ src_d[sline+w] + src_d[sline+w+1] + 2) >> 2;
+ dst_d[dptr+1] = (src_d[sline+2] + src_d[sline+3] +
+ src_d[sline+w+2] + src_d[sline+w+3] + 2) >> 2;
}
for(; x < w2; ++x, ++dptr, sline += 2) {
- dst[dptr] = (src[sline] + src[sline+1] +
- src[sline+w] + src[sline+w+1] + 2) >> 2;
+ dst_d[dptr] = (src_d[sline] + src_d[sline+1] +
+ src_d[sline+w] + src_d[sline+w+1] + 2) >> 2;
}
sptr += w << 1;
}
},
- shar_derivatives: function(img, dst, w, h) {
- var dstep = w<<1,x=0,y=0,x1=0;
+ // dst: [gx,gy,...]
+ scharr_derivatives: function(src, dst) {
+ var w = src.cols, h = src.rows;
+ var dstep = w<<1,x=0,y=0,x1=0,a,b,c,d,e,f;
var srow0=0,srow1=0,srow2=0,drow=0;
- var trow0 = new Int32Array(w+2);
- var trow1 = new Int32Array(w+2);
+ var trow0,trow1;
+ var img = src.data;
+
+ var buf0_node = jsfeat.cache.get_buffer((w+2)<<2);
+ var buf1_node = jsfeat.cache.get_buffer((w+2)<<2);
+
+ if(src.type&jsfeat.U8_t || src.type&jsfeat.S32_t) {
+ trow0 = buf0_node.i32;
+ trow1 = buf1_node.i32;
+ } else {
+ trow0 = buf0_node.f32;
+ trow1 = buf1_node.f32;
+ }
for(; y < h; ++y, srow1+=w) {
srow0 = ((y > 0 ? y-1 : 1)*w)|0;
@@ -200,32 +539,461 @@
drow = (y*dstep)|0;
// do vertical convolution
for(x = 0, x1 = 1; x <= w-2; x+=2, x1+=2) {
- trow0[x1] = ( ((img[srow0+x]) + (img[srow2+x]))*3 + (img[srow1+x])*10 );
- trow1[x1] = ( (img[srow2+x]) - (img[srow0+x]) );
+ a = img[srow0+x], b = img[srow2+x];
+ trow0[x1] = ( (a + b)*3 + (img[srow1+x])*10 );
+ trow1[x1] = ( b - a );
//
- trow0[x1+1] = ( ((img[srow0+x+1]) + (img[srow2+x+1]))*3 + (img[srow1+x+1])*10 );
- trow1[x1+1] = ( (img[srow2+x+1]) - (img[srow0+x+1]) );
+ a = img[srow0+x+1], b = img[srow2+x+1];
+ trow0[x1+1] = ( (a + b)*3 + (img[srow1+x+1])*10 );
+ trow1[x1+1] = ( b - a );
}
for(; x < w; ++x, ++x1) {
- trow0[x1] = ( ((img[srow0+x]) + (img[srow2+x]))*3 + (img[srow1+x])*10 );
- trow1[x1] = ( (img[srow2+x]) - (img[srow0+x]) );
+ a = img[srow0+x], b = img[srow2+x];
+ trow0[x1] = ( (a + b)*3 + (img[srow1+x])*10 );
+ trow1[x1] = ( b - a );
}
// make border
x = (w + 1)|0;
trow0[0] = trow0[1]; trow0[x] = trow0[w];
trow1[0] = trow1[1]; trow1[x] = trow1[w];
// do horizontal convolution, interleave the results and store them
- for(x = 0; x <= w-2; x+=2) {
- dst[drow++] = ( (trow0[x+2] - trow0[x]) );
- dst[drow++] = ( ((trow1[x+2] + trow1[x])*3 + trow1[x+1]*10) );
- dst[drow++] = ( (trow0[x+3] - trow0[x+1]) );
- dst[drow++] = ( ((trow1[x+3] + trow1[x+1])*3 + trow1[x+2]*10) );
+ for(x = 0; x <= w-4; x+=4) {
+ a = trow1[x+2], b = trow1[x+1], c = trow1[x+3], d = trow1[x+4],
+ e = trow0[x+2], f = trow0[x+3];
+ dst[drow++] = ( e - trow0[x] );
+ dst[drow++] = ( (a + trow1[x])*3 + b*10 );
+ dst[drow++] = ( f - trow0[x+1] );
+ dst[drow++] = ( (c + b)*3 + a*10 );
+
+ dst[drow++] = ( (trow0[x+4] - e) );
+ dst[drow++] = ( ((d + a)*3 + c*10) );
+ dst[drow++] = ( (trow0[x+5] - f) );
+ dst[drow++] = ( ((trow1[x+5] + c)*3 + d*10) );
}
for(; x < w; ++x) {
dst[drow++] = ( (trow0[x+2] - trow0[x]) );
dst[drow++] = ( ((trow1[x+2] + trow1[x])*3 + trow1[x+1]*10) );
}
}
+ jsfeat.cache.put_buffer(buf0_node);
+ jsfeat.cache.put_buffer(buf1_node);
+ },
+
+ // compute gradient using Sobel kernel [1 2 1] * [-1 0 1]^T
+ // dst: [gx,gy,...]
+ sobel_derivatives: function(src, dst) {
+ var w = src.cols, h = src.rows;
+ var dstep = w<<1,x=0,y=0,x1=0,a,b,c,d,e,f;
+ var srow0=0,srow1=0,srow2=0,drow=0;
+ var trow0,trow1;
+ var img = src.data;
+
+ var buf0_node = jsfeat.cache.get_buffer((w+2)<<2);
+ var buf1_node = jsfeat.cache.get_buffer((w+2)<<2);
+
+ if(src.type&jsfeat.U8_t || src.type&jsfeat.S32_t) {
+ trow0 = buf0_node.i32;
+ trow1 = buf1_node.i32;
+ } else {
+ trow0 = buf0_node.f32;
+ trow1 = buf1_node.f32;
+ }
+
+ for(; y < h; ++y, srow1+=w) {
+ srow0 = ((y > 0 ? y-1 : 1)*w)|0;
+ srow2 = ((y < h-1 ? y+1 : h-2)*w)|0;
+ drow = (y*dstep)|0;
+ // do vertical convolution
+ for(x = 0, x1 = 1; x <= w-2; x+=2, x1+=2) {
+ a = img[srow0+x], b = img[srow2+x];
+ trow0[x1] = ( (a + b) + (img[srow1+x]*2) );
+ trow1[x1] = ( b - a );
+ //
+ a = img[srow0+x+1], b = img[srow2+x+1];
+ trow0[x1+1] = ( (a + b) + (img[srow1+x+1]*2) );
+ trow1[x1+1] = ( b - a );
+ }
+ for(; x < w; ++x, ++x1) {
+ a = img[srow0+x], b = img[srow2+x];
+ trow0[x1] = ( (a + b) + (img[srow1+x]*2) );
+ trow1[x1] = ( b - a );
+ }
+ // make border
+ x = (w + 1)|0;
+ trow0[0] = trow0[1]; trow0[x] = trow0[w];
+ trow1[0] = trow1[1]; trow1[x] = trow1[w];
+ // do horizontal convolution, interleave the results and store them
+ for(x = 0; x <= w-4; x+=4) {
+ a = trow1[x+2], b = trow1[x+1], c = trow1[x+3], d = trow1[x+4],
+ e = trow0[x+2], f = trow0[x+3];
+ dst[drow++] = ( e - trow0[x] );
+ dst[drow++] = ( a + trow1[x] + b*2 );
+ dst[drow++] = ( f - trow0[x+1] );
+ dst[drow++] = ( c + b + a*2 );
+
+ dst[drow++] = ( trow0[x+4] - e );
+ dst[drow++] = ( d + a + c*2 );
+ dst[drow++] = ( trow0[x+5] - f );
+ dst[drow++] = ( trow1[x+5] + c + d*2 );
+ }
+ for(; x < w; ++x) {
+ dst[drow++] = ( trow0[x+2] - trow0[x] );
+ dst[drow++] = ( trow1[x+2] + trow1[x] + trow1[x+1]*2 );
+ }
+ }
+ jsfeat.cache.put_buffer(buf0_node);
+ jsfeat.cache.put_buffer(buf1_node);
+ },
+
+ // please note:
+ // dst_(type) size should be cols = src.cols+1, rows = src.rows+1
+ compute_integral_image: function(src, dst_sum, dst_sqsum, dst_tilted) {
+ var w0=src.cols,h0=src.rows,src_d=src.data;
+ var w1=w0+1;
+ var s,s2,p,pup,i=0,j=0,v,k;
+
+ if(dst_sum && dst_sqsum) {
+ // fill first row with zeros
+ for(; i < w1; ++i) {
+ dst_sum[i] = 0, dst_sqsum[i] = 0;
+ }
+ p = (w1+1)|0, pup = 1;
+ for(i = 0, k = 0; i < h0; ++i, ++p, ++pup) {
+ s = s2 = 0;
+ for(j = 0; j <= w0-2; j+=2, k+=2, p+=2, pup+=2) {
+ v = src_d[k];
+ s += v, s2 += v*v;
+ dst_sum[p] = dst_sum[pup] + s;
+ dst_sqsum[p] = dst_sqsum[pup] + s2;
+
+ v = src_d[k+1];
+ s += v, s2 += v*v;
+ dst_sum[p+1] = dst_sum[pup+1] + s;
+ dst_sqsum[p+1] = dst_sqsum[pup+1] + s2;
+ }
+ for(; j < w0; ++j, ++k, ++p, ++pup) {
+ v = src_d[k];
+ s += v, s2 += v*v;
+ dst_sum[p] = dst_sum[pup] + s;
+ dst_sqsum[p] = dst_sqsum[pup] + s2;
+ }
+ }
+ } else if(dst_sum) {
+ // fill first row with zeros
+ for(; i < w1; ++i) {
+ dst_sum[i] = 0;
+ }
+ p = (w1+1)|0, pup = 1;
+ for(i = 0, k = 0; i < h0; ++i, ++p, ++pup) {
+ s = 0;
+ for(j = 0; j <= w0-2; j+=2, k+=2, p+=2, pup+=2) {
+ s += src_d[k];
+ dst_sum[p] = dst_sum[pup] + s;
+ s += src_d[k+1];
+ dst_sum[p+1] = dst_sum[pup+1] + s;
+ }
+ for(; j < w0; ++j, ++k, ++p, ++pup) {
+ s += src_d[k];
+ dst_sum[p] = dst_sum[pup] + s;
+ }
+ }
+ } else if(dst_sqsum) {
+ // fill first row with zeros
+ for(; i < w1; ++i) {
+ dst_sqsum[i] = 0;
+ }
+ p = (w1+1)|0, pup = 1;
+ for(i = 0, k = 0; i < h0; ++i, ++p, ++pup) {
+ s2 = 0;
+ for(j = 0; j <= w0-2; j+=2, k+=2, p+=2, pup+=2) {
+ v = src_d[k];
+ s2 += v*v;
+ dst_sqsum[p] = dst_sqsum[pup] + s2;
+ v = src_d[k+1];
+ s2 += v*v;
+ dst_sqsum[p+1] = dst_sqsum[pup+1] + s2;
+ }
+ for(; j < w0; ++j, ++k, ++p, ++pup) {
+ v = src_d[k];
+ s2 += v*v;
+ dst_sqsum[p] = dst_sqsum[pup] + s2;
+ }
+ }
+ }
+
+ if(dst_tilted) {
+ // fill first row with zeros
+ for(i = 0; i < w1; ++i) {
+ dst_tilted[i] = 0;
+ }
+ // diagonal
+ p = (w1+1)|0, pup = 0;
+ for(i = 0, k = 0; i < h0; ++i, ++p, ++pup) {
+ for(j = 0; j <= w0-2; j+=2, k+=2, p+=2, pup+=2) {
+ dst_tilted[p] = src_d[k] + dst_tilted[pup];
+ dst_tilted[p+1] = src_d[k+1] + dst_tilted[pup+1];
+ }
+ for(; j < w0; ++j, ++k, ++p, ++pup) {
+ dst_tilted[p] = src_d[k] + dst_tilted[pup];
+ }
+ }
+ // diagonal
+ p = (w1+w0)|0, pup = w0;
+ for(i = 0; i < h0; ++i, p+=w1, pup+=w1) {
+ dst_tilted[p] += dst_tilted[pup];
+ }
+
+ for(j = w0-1; j > 0; --j) {
+ p = j+h0*w1, pup=p-w1;
+ for(i = h0; i > 0; --i, p-=w1, pup-=w1) {
+ dst_tilted[p] += dst_tilted[pup] + dst_tilted[pup+1];
+ }
+ }
+ }
+ },
+ equalize_histogram: function(src, dst) {
+ var w=src.cols,h=src.rows,src_d=src.data,dst_d=dst.data,size=w*h;
+ var i=0,prev=0,hist0,norm;
+
+ var hist0_node = jsfeat.cache.get_buffer(256<<2);
+ hist0 = hist0_node.i32;
+ for(; i < 256; ++i) hist0[i] = 0;
+ for (i = 0; i < size; ++i) {
+ ++hist0[src_d[i]];
+ }
+
+ prev = hist0[0];
+ for (i = 1; i < 256; ++i) {
+ prev = hist0[i] += prev;
+ }
+
+ norm =