Merge pull request #395 from bj-wanghz/bj-wanghz-patch-1

Fix LBP bug.
This commit is contained in:
Ibrahim Abd Elkader 2018-10-20 17:52:37 +02:00 committed by GitHub
commit e26046f576
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -84,7 +84,7 @@ int imlib_lbp_desc_distance(uint8_t *d0, uint8_t *d1)
{
uint32_t sum = 0;
for (int i=0; i<LBP_DESC_SIZE; i++) {
int w = lbp_weights[i%LBP_HIST_SIZE];
int w = lbp_weights[i/LBP_HIST_SIZE];
sum += w * ((((d0[i] - d1[i]) * (d0[i] - d1[i]))/IM_MAX((d0[i] + d1[i]),1)));
}
return sum;