         float relScale = level.relScale;
         float farea = (scaledRect.z - scaledRect.x) * (scaledRect.w - scaledRect.y);
 
-        dprintf("feature %d box %d %d %d %d\n", (node.threshold >> 28), scaledRect.x, scaledRect.y,
+        dprintf("%d: feature %d box %d %d %d %d\n",threadIdx.x, (node.threshold >> 28), scaledRect.x, scaledRect.y,
             scaledRect.z, scaledRect.w);
-        dprintf("rescale: %f [%f %f] selected %f\n",level.relScale, level.scaling[0], level.scaling[1],
+        dprintf("%d: rescale: %f [%f %f] selected %f\n",threadIdx.x, level.relScale, level.scaling[0], level.scaling[1],
             level.scaling[(node.threshold >> 28) > 6]);
 
         // rescale

        const float expected_new_area = farea * relScale * relScale;
        float approx =  sarea / expected_new_area;

        dprintf("new rect: %d box %d %d %d %d  rel areas %f %f\n", (node.threshold >> 28),
        scaledRect.x, scaledRect.y, scaledRect.z, scaledRect.w, farea * relScale * relScale, sarea);

        float rootThreshold = (node.threshold & 0x0FFFFFFFU) * approx;
        rootThreshold *= level.scaling[(node.threshold >> 28) > 6];

        dprintf("approximation %f %d -> %f %f\n", approx, (node.threshold & 0x0FFFFFFFU), rootThreshold,
            level.scaling[(node.threshold >> 28) > 6]);

        return rootThreshold;

        int fh = 120;

        dim3 block(32, 8);
        dim3 grid(fw, fh / 8, 47);

        const Level* l = (const Level*)levels.ptr();
        const Octave* oct = ((const Octave*)octaves.ptr());
