Commit d538fbf17513d905331a85cc0206f8da4da78a42
1 parent
41df5d5d
code tweaks
Showing
1 changed file
with
3 additions
and
6 deletions
openbr/plugins/quantize.cpp
| ... | ... | @@ -309,16 +309,13 @@ class RecursiveProductQuantizationDistance : public Distance |
| 309 | 309 | similarity += lut[j*256*256 + aData[j]*256+bData[j]]; |
| 310 | 310 | |
| 311 | 311 | evidence += similarity; |
| 312 | - if (evidence < t) return 0; | |
| 313 | - | |
| 314 | - // similarity = max(similarity, 0.f); | |
| 315 | 312 | const int subSize = (size-1)/4; |
| 316 | - if (subSize == 0) return similarity; | |
| 317 | - return max(similarity | |
| 313 | + if ((evidence < t) || (subSize == 0)) return similarity; | |
| 314 | + return similarity | |
| 318 | 315 | + compareRecursive(a, b, i+1+0*subSize, subSize, evidence) |
| 319 | 316 | + compareRecursive(a, b, i+1+1*subSize, subSize, evidence) |
| 320 | 317 | + compareRecursive(a, b, i+1+2*subSize, subSize, evidence) |
| 321 | - + compareRecursive(a, b, i+1+3*subSize, subSize, evidence),0.f); | |
| 318 | + + compareRecursive(a, b, i+1+3*subSize, subSize, evidence); | |
| 322 | 319 | } |
| 323 | 320 | }; |
| 324 | 321 | ... | ... |