 
     neighbourSize = params._imagedCenterNeighbourSize;
 
-    for( ; iterations > 0;  iterations-- ) {
-        float  residual;
-        float2 bestPointOut;
-        residual = idCostFunction( tagIndex,
-                                   iterations,
-                                   outerEllipse,
-                                   center,
-                                   vCutSize,
-                                   neighbourSize,
-                                   bestPointOut,
-                                   bestHomographyOut,
-                                   params,
-                                   cctag_pointer_buffer );
-
-        if( residual == FLT_MAX ) return false;
-        center        =  bestPointOut;
-        neighbourSize /= (float)((gridNSample-1)/2) ;
-    }
+    float  residual;
+    float2 bestPointOut;
+    residual = idCostFunction( tagIndex,
+                               iterations,
+                               outerEllipse,
+                               center,
+                               vCutSize,
+                               neighbourSize,
+                               bestPointOut,
+                               bestHomographyOut,
+                               params,
+                               cctag_pointer_buffer );
+
+    if( residual == FLT_MAX ) return false;
+    center        =  bestPointOut;
+    neighbourSize /= (float)((gridNSample-1)/2) ;
     return true;
 }
 

}

__device__
void extractSignalUsingHomography( const CutStruct&                   cut,
                                   CutSignals*                        signals,
                                   cv::cuda::PtrStepSzb               src,

namespace identification {

__device__
inline
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

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