Skip to content

Commit

Permalink
channels/private/gradientMex.cpp: improved boundary handling for grad…
Browse files Browse the repository at this point in the history
…Hist() softBin%2==1
  • Loading branch information
pdollar committed Aug 20, 2013
1 parent 9e42261 commit 8f1a978
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions channels/private/gradientMex.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,13 @@ void gradHist( float *M, float *O, float *H, int h, int w,
}
}
alFree(O0); alFree(O1); alFree(M0); alFree(M1);
// normalize boundary bins which only get 7/8 of weight of interior bins
if( softBin%2!=0 ) for( int o=0; o<nOrients; o++ ) {
x=0; for( y=0; y<hb; y++ ) H[o*nb+x*hb+y]*=8.f/7.f;
y=0; for( x=0; x<wb; x++ ) H[o*nb+x*hb+y]*=8.f/7.f;
x=wb-1; for( y=0; y<hb; y++ ) H[o*nb+x*hb+y]*=8.f/7.f;
y=hb-1; for( x=0; x<wb; x++ ) H[o*nb+x*hb+y]*=8.f/7.f;
}
}

/******************************************************************************/
Expand Down
Binary file modified channels/private/gradientMex.mexw64
Binary file not shown.

0 comments on commit 8f1a978

Please sign in to comment.