mirror of
https://github.com/zxing/zxing.git
synced 2025-03-05 20:48:51 -08:00
use correct vector size after possible erases
git-svn-id: https://zxing.googlecode.com/svn/trunk@1817 59b500cc-1b3d-0410-9834-0bbf25fbcc57
This commit is contained in:
parent
308cb7096a
commit
f17a43df81
|
@ -343,11 +343,11 @@ vector<Ref<FinderPattern> > FinderPatternFinder::selectBestPatterns() {
|
|||
if (possibleCenters_.size() > 3) {
|
||||
// Throw away all but those first size candidate points we found.
|
||||
float totalModuleSize = 0.0f;
|
||||
for (size_t i = 0; i < startSize; i++) {
|
||||
for (size_t i = 0; i < possibleCenters_.size(); i++) {
|
||||
float size = possibleCenters_[i]->getEstimatedModuleSize();
|
||||
totalModuleSize += size;
|
||||
}
|
||||
float average = totalModuleSize / (float) startSize;
|
||||
float average = totalModuleSize / (float) possibleCenters_.size();
|
||||
sort(possibleCenters_.begin(), possibleCenters_.end(), CenterComparator(average));
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue