Commit a69f8f73681062a619faf81caf37794af2edd2c5

Authored by Josh Klontz
1 parent 28ccd80e

switched to L1 distance

Showing 1 changed file with 1 additions and 2 deletions
openbr/plugins/turk.cpp
@@ -147,10 +147,9 @@ class TurkDistance : public Distance @@ -147,10 +147,9 @@ class TurkDistance : public Distance
147 147
148 float compare(const Template &target, const Template &query) const 148 float compare(const Template &target, const Template &query) const
149 { 149 {
150 - const float stddev = .75;  
151 float score = 0; 150 float score = 0;
152 for (int i=0; i<values.size(); i++) 151 for (int i=0; i<values.size(); i++)
153 - score += 1 / (stddev*sqrt(2*CV_PI)) * exp(-0.5*pow((query.m().at<float>(0,i)-target.file.get<float>(key + "_" + values[i]))/stddev, 2)); 152 + score -= fabs(query.m().at<float>(i) - target.file.get<float>(key + "_" + values[i]));
154 return score; 153 return score;
155 } 154 }
156 }; 155 };