From ef431f70b640acb969a90b44ed5ffef5a2774719 Mon Sep 17 00:00:00 2001 From: "marina.kolpakova" Date: Thu, 11 Oct 2012 16:26:32 +0400 Subject: [PATCH] fix buggy threshold zeroing if feature has zero area --- modules/gpu/src/cuda/isf-sc.cu | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/gpu/src/cuda/isf-sc.cu b/modules/gpu/src/cuda/isf-sc.cu index f755f85499..f74673c05a 100644 --- a/modules/gpu/src/cuda/isf-sc.cu +++ b/modules/gpu/src/cuda/isf-sc.cu @@ -103,7 +103,7 @@ namespace icf { float sarea = (scaledRect.z - scaledRect.x) * (scaledRect.w - scaledRect.y); const float expected_new_area = farea * relScale * relScale; - float approx = __fdividef(sarea, expected_new_area); + float approx = (sarea == 0)? 1: __fdividef(sarea, expected_new_area); float rootThreshold = (node.threshold & 0x0FFFFFFFU) * approx * level.scaling[(node.threshold >> 28) > 6]; @@ -226,7 +226,7 @@ namespace icf { dprintf("%d: impact scaned %f\n" ,threadIdx.x, impact); confidence += impact; - if(__any((confidence <= stages[(st + threadIdx.x)]))) st += stEnd; + if(__any((confidence <= stages[(st + threadIdx.x)]))) st += 2048; } if(st == stEnd && !threadIdx.x)