      */
     const int block_x = blockIdx.x * 32;
     const int block_y = blockIdx.y * blockDim.y;
-    const int y       = block_y + threadIdx.y;
-    const int x       = block_x + threadIdx.x;
+    const int y       = block_y + threadIdx.y + 1;
+    const int x       = block_x + threadIdx.x + 1;
 
     // int32_t x0 = x;
     // int32_t x1 = x+1;

    /* reject condition: tr(H)^2/det(H) < (r+1)^2/r */
    if( edgeval >= (d_edge_limit+1.0f)*(d_edge_limit+1.0f)/d_edge_limit ) {
#ifdef PRINT_EXTREMA_DEBUG_INFO
        printf("Found an extremum at %d %d (o=%d,l=%d) - edge tresh failed\n", x+1, y+1, debug_octave, level );
#endif // PRINT_EXTREMA_DEBUG_INFO
        return false;
    }

    inline __device__
    bool first_contrast_ok( const float val ) const
    {
        return ( fabsf( val ) >= 0.8f * 2.0f * d_threshold );
    }

    inline __device__
    int refine( float3& d, int3& n, const int width, const int height, const int maxlevel, bool last_it ) const
    {
        if( last_it ) return 0;

        float2 t;

        t.x = ((d.x >= 0.6f && n.x < width-2) ?  1.0f : 0.0f )
            + ((d.x <= -0.6f && n.x > 1)? -1.0f : 0.0f );
