[vlfeat] 15/44: hog.c: fix a bug in the bilinear interpolated variant of the descriptor

Dima Kogan dima at secretsauce.net
Wed Sep 16 21:05:29 UTC 2015


This is an automated email from the git hooks/post-receive script.

dkogan-guest pushed a commit to branch master
in repository vlfeat.

commit 115c86cef8771c1c6cd231e0e20e118c2f027bdc
Author: Andrea Vedaldi <vedaldi at gmail.com>
Date:   Thu Oct 9 01:32:39 2014 +0100

    hog.c: fix a bug in the bilinear interpolated variant of the descriptor
    
    Fortunately this variant is seldom used in practice.
---
 vl/hog.c | 14 ++++++--------
 1 file changed, 6 insertions(+), 8 deletions(-)

diff --git a/vl/hog.c b/vl/hog.c
index 36eeeee..2c9b938 100644
--- a/vl/hog.c
+++ b/vl/hog.c
@@ -682,6 +682,7 @@ vl_hog_put_image (VlHog * self,
       }
 
       for (o = 0 ; o < 2 ; ++o) {
+        float ow ;
         /*
          Accumulate the gradient. hx is the distance of the
          pixel x to the cell center at its left, in units of cellSize.
@@ -703,24 +704,21 @@ vl_hog_put_image (VlHog * self,
         wx1 = 1.0 - wx2 ;
         wy1 = 1.0 - wy2 ;
 
-        wx1 *= orientationWeights[o] ;
-        wx2 *= orientationWeights[o] ;
-        wy1 *= orientationWeights[o] ;
-        wy2 *= orientationWeights[o] ;
+        ow = orientationWeights[o] ;
 
         /*VL_PRINTF("%d %d - %d %d %f %f - %f %f %f %f - %d \n ",x,y,binx,biny,hx,hy,wx1,wx2,wy1,wy2,o);*/
 
         if (binx >= 0 && biny >=0) {
-          at(binx,biny,orientation) += grad * wx1 * wy1 ;
+          at(binx,biny,orientation) += grad * ow * wx1 * wy1 ;
         }
         if (binx < (signed)self->hogWidth - 1 && biny >=0) {
-          at(binx+1,biny,orientation) += grad * wx2 * wy1 ;
+          at(binx+1,biny,orientation) += grad * ow * wx2 * wy1 ;
         }
         if (binx < (signed)self->hogWidth - 1 && biny < (signed)self->hogHeight - 1) {
-          at(binx+1,biny+1,orientation) += grad * wx2 * wy2 ;
+          at(binx+1,biny+1,orientation) += grad * ow * wx2 * wy2 ;
         }
         if (binx >= 0 && biny < (signed)self->hogHeight - 1) {
-          at(binx,biny+1,orientation) += grad * wx1 * wy2 ;
+          at(binx,biny+1,orientation) += grad * ow * wx1 * wy2 ;
         }
       } /* next o */
     } /* next x */

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-science/packages/vlfeat.git



More information about the debian-science-commits mailing list