   cutStopTimer( timer );  ///< Stop timer
   printf("Maximum Detector time = %f ms\n",cutGetTimerValue( timer ));
 
-}
-
-__global__ void hysteresisPreparation(int *hysteresis, int3 size, const unsigned int t1, const unsigned int t2){
+  return(d_img);
+
+}
+
+
+__global__ void hysteresisPreparation(float *hysteresis, int3 size, const unsigned int t1, const unsigned int t2){
 
   ///pixel index of this thread
   int pixIdx = blockIdx.x * blockDim.x + threadIdx.x;
-  int pixel;
+  float pixel;
 
 
   ///output pixel index


}

__global__ void nonMaximumSupression_texture(float* image, int3 size){
///this is the kernel to calculate the non-maximum supression of the image. It is
///implemmented using texture fetching. The dependence of inter-block data makes

  
  sum.x = sum.y = 0;

  for(int k=-halfkernelsize;k<(halfkernelsize+1);k++){
    sum.x += (tex1Dfetch(texRef, pixIdx + k * (((pos.x+k)>=0)*((pos.x+k)<size.x))) * s_gauss[k+halfkernelsize]);
    sum.y += s_gauss[k+halfkernelsize];
  }

