var DOM={body:$("body"),canvas:$("canvas"),imageLoader:$("#image-loader")},_CAN=DOM.canvas;_CAN.width=_CAN.height=1E3;var _CON=_CAN.getContext("2d"),iL,filterManager,process=function(){},exec=!1,last,Controller,CFolder={},init,initialized=!1,ControllerRememberer=new PermanentStorage; ControllerRememberer.fetch(function(k){log("Preset loaded.","[PermanentStorage]");Controller=new dat.GUI({load:JSON.parse(k),preset:"default"});init=function(){last=this.src="front/male/1.jpg";initialized=!0;CFolder.src=Controller.addFolder("Source Picture");Controller.remember(this);CFolder.src.add(this,"src",this._images).listen()};LOADER.init();process=function(){if(initialized&&this instanceof HTMLImageElement){console.time("PROCESS");LOADER.start();this.src!=last&&(reactiveFaceTracking.zones= [],reactiveFeatureTracking.zones=[],exec=!1,last=this.src);exec||(this.defaultWidth=this.width,this.defaultHeight=this.height,exec=!0);_CON.clearRect(0,0,_CAN.width,_CAN.height);filterManager.get("resolution").apply();filterManager.get("contrast").apply();filterManager.get("grayscale").apply();filterManager.get("sobel").apply();filterManager.get("gaussian").apply();filterManager.get("canny").apply();var b,f,d,c,g,h,e,a;b=e=0;for(f=reactiveFeatureTracking.zones.length;b=e)for(a=!0,d=0;d< b&&(c=reactiveFeatureTracking.zones[d],a=reactiveFeatureTracking.zones[b],a=c.x>=a.x+a.w||c.y>=a.y+a.h||c.x+c.w<=a.x||c.y+c.h<=a.y,a);d++);a&&e++;3= e)for(a=!0,d=0;d=a.x+a.w||c.y>=a.y+a.h||c.x+c.w<=a.x||c.y+c.h<=a.y,a);d++);a&&e++;1