txA);
    var gabor = function(div,imSize,lamda,theta,sigma,phase,contrast){
      var i,j,k,h;
      var freq = imSize/lamda;
      var phaseRad = phase * 2 * Math.PI;  
      var thetaRad = (theta / 180) * Math.PI;
      var s = sigma / imSize;    
      cvsA.width=cvsA.height=imSize;
      datA = ctxA.createImageData(imSize,imSize);
      for(i=0;i<imSize*4;i+=4)
        for(j=0;j<imSize*imSize*4;j+=imSize*4) {
          var i1 = (i-imSize*2)/imSize/4, j1 = (j-imSize*imSize*2)/imSize/imSize/4;
          