         dim3 threads(32, 8);
         dim3 grid(divUp(cols, threads.x), divUp(rows, threads.y));
 
+        cudaChannelFormatDesc desc = cudaCreateChannelDesc<float>();
+        cudaBindTexture2D(0, harrisDxTex, Dx.data, desc, Dx.cols, Dx.rows, Dx.step);
+        cudaBindTexture2D(0, harrisDyTex, Dy.data, desc, Dy.cols, Dy.rows, Dy.step);
+        harrisDxTex.filterMode = cudaFilterModePoint;
+        harrisDyTex.filterMode = cudaFilterModePoint;
+
         switch (border_type) 
         {
         case BORDER_REFLECT101:
             cornerHarris_kernel<<<grid, threads>>>(
-                    cols, rows, block_size, k, Dx, Dy, dst, 
-                    BrdReflect101(cols), BrdReflect101(rows));
+                    cols, rows, block_size, k, dst, BrdReflect101(cols), BrdReflect101(rows));
             break;
         }
+
         cudaSafeCall(cudaThreadSynchronize());
+        cudaSafeCall(cudaUnbindTexture(harrisDxTex));
+        cudaSafeCall(cudaUnbindTexture(harrisDyTex));
     }
 
 /////////////////////////////////////////// Corner Min Eigen Val /////////////////////////////////////////////////
 
+    texture<float, 2> minEigenValDxTex;
+    texture<float, 2> minEigenValDyTex;
+
     template <typename B>
-    __global__ void cornerMinEigenVal_kernel(const int cols, const int rows, const int block_size, const PtrStep Dx, 
-                                             const PtrStep Dy, PtrStep dst, B border_row, B border_col)
+    __global__ void cornerMinEigenVal_kernel(const int cols, const int rows, const int block_size, 
+                                             PtrStep dst, B border_row, B border_col)
     {
         const unsigned int x = blockIdx.x * blockDim.x + threadIdx.x;
         const unsigned int y = blockIdx.y * blockDim.y + threadIdx.y;


/////////////////////////////////////////// Corner Harris /////////////////////////////////////////////////

    template <typename B>
    __global__ void cornerHarris_kernel(const int cols, const int rows, const int block_size, const float k,
                                        const PtrStep Dx, const PtrStep Dy, PtrStep dst, B border_row, 
                                        B border_col)
    {
        const unsigned int x = blockIdx.x * blockDim.x + threadIdx.x;
        const unsigned int y = blockIdx.y * blockDim.y + threadIdx.y;

            for (int i = ibegin; i < iend; ++i)
            {
                int y = border_col.idx(i);
                for (int j = jbegin; j < jend; ++j)
                {
                    int x = border_row.idx(j);
                    float dx = tex2D(minEigenValDxTex, x, y);
                    float dy = tex2D(minEigenValDyTex, x, y);
                    a += dx * dx;
                    b += dx * dy;
                    c += dy * dy;
