   CUT_CHECK_ERROR("Memory unbind failed");
 
   cudaFree(d_hys);
+  cudaFree(modif);
+  cudaFree(tt);
   CUT_CHECK_ERROR("Memory free failed");
   
+  float *d_edges;
   d_edges = d_img;
   return(d_edges);
 

  dim3 DimBlock(THREADS_PER_BLOCK,1,1);
  dim3 DimGrid(blocksPerGrid,1,1);

  float *d_edges;
  float *d_hys;
  cudaMalloc((void**) &d_hys, (size.z*sizeof(float)));
  CUT_CHECK_ERROR("Memory hysteresis image creation failed");


    Lx = (-0.5*cross.z) + (0.5*cross.w);
    Ly = (0.5*cross.x) - (0.5*cross.y);
    Lxx = cross.z - (2.0*pixel) + cross.w;
    Lxy = (-0.25*diagonal.x) + (0.25*diagonal.y) + (0.25*diagonal.z) + (-0.25*diagonal.w);
    Lyy = cross.x -(2.0*pixel) + cross.y;

  }

  Lvv[pixIdx] = (((Lx*Lx)*Lxx) + (2.0*Lx*Ly*Lxy) + (Ly*Ly*Lyy))/((Lx*Lx) + (Ly*Ly));

}

