mirror of
https://github.com/zxing/zxing.git
synced 2025-01-27 19:13:15 -08:00
Issue 488
git-svn-id: https://zxing.googlecode.com/svn/trunk@1503 59b500cc-1b3d-0410-9834-0bbf25fbcc57
This commit is contained in:
parent
4f4aea47ca
commit
249d75b2e8
|
@ -39,17 +39,17 @@ public:
|
||||||
ClosestToAverageComparator(float averageModuleSize) :
|
ClosestToAverageComparator(float averageModuleSize) :
|
||||||
averageModuleSize_(averageModuleSize) {
|
averageModuleSize_(averageModuleSize) {
|
||||||
}
|
}
|
||||||
int operator()(Ref<FinderPattern> a, Ref<FinderPattern> b) {
|
bool operator()(Ref<FinderPattern> a, Ref<FinderPattern> b) {
|
||||||
float dA = abs(a->getEstimatedModuleSize() - averageModuleSize_);
|
float dA = abs(a->getEstimatedModuleSize() - averageModuleSize_);
|
||||||
float dB = abs(b->getEstimatedModuleSize() - averageModuleSize_);
|
float dB = abs(b->getEstimatedModuleSize() - averageModuleSize_);
|
||||||
return dA < dB ? -1 : dA > dB ? 1 : 0;
|
return dA < dB;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
class CenterComparator {
|
class CenterComparator {
|
||||||
public:
|
public:
|
||||||
int operator()(Ref<FinderPattern> a, Ref<FinderPattern> b) {
|
bool operator()(Ref<FinderPattern> a, Ref<FinderPattern> b) {
|
||||||
return b->getCount() - a->getCount();
|
return a->getCount() < b->getCount();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue