     ellipse.projectiveTransform( mInvT, transformedEllipse );
 
     bool first_iteration = true;
+
+cerr << "TagIndex: " << tagIndex << " number of loops: " << iterations << endl;
+
     for( ; iterations>0; iterations-- ) {
         float neighSize = currentNeighbourSize * max( transformedEllipse.a(),
                                                       transformedEllipse.b() );

namespace identification {

__device__
float getPixelBilinear( cv::cuda::PtrStepSzb src, float2 xy )
{
    const int px = (int)xy.x; // floor of x
    const int py = (int)xy.y; // floor of y
#if 0
    if( px != clamp( px, src.cols-1 ) ) {
        printf("Should clamp px from %d to %d\n", px, clamp( px, src.cols-1 ) );
    }
    if( py != clamp( py, src.rows-1 ) ) {
        printf("Should clamp py from %d to %d\n", py, clamp( py, src.rows-1 ) );
    }
    px = clamp( px, src.cols-1 );
    py = clamp( py, src.rows-1 );
#endif

    // uint8_t p0 = src.ptr(py  )[px  ];
    const uint8_t p1 = src.ptr(py  )[px  ];

    if( i >= gridNSample ) return;
    if( j >= gridNSample ) return;

    const int idx = j * gridNSample + i;


    NearbyPoint* nPoint = &point_buffer[idx];
    identification::CutSignals* signals = &sig_buffer[idx * vCutsSize];

    float2 condCenter = make_float2( center.x - halfWidth + i*stepSize,
                                     center.y - halfWidth + j*stepSize );

    popart::geometry::matrix3x3  mInvT;
    mT.invert( mInvT ); // note: returns false if it fails
    mInvT.condition( condCenter );

    nPoint->point    = condCenter;
    nPoint->result   = 0.0f;
    nPoint->resSize  = 0;
    nPoint->readable = true;
