In multi QR code finder, only consider multiply-confirmed centers as intended, to avoid extreme amounts of computation in large images without barcodes

This commit is contained in:
Sean Owen 2022-07-05 18:34:45 -05:00
parent 75dbbb00dd
commit 78c2a9c440
2 changed files with 7 additions and 2 deletions

View file

@ -97,7 +97,12 @@ public final class MultiFinderPatternFinder extends FinderPatternFinder {
* @throws NotFoundException if 3 such finder patterns do not exist * @throws NotFoundException if 3 such finder patterns do not exist
*/ */
private FinderPattern[][] selectMultipleBestPatterns() throws NotFoundException { private FinderPattern[][] selectMultipleBestPatterns() throws NotFoundException {
List<FinderPattern> possibleCenters = getPossibleCenters(); List<FinderPattern> possibleCenters = new ArrayList<>();
for (FinderPattern fp : getPossibleCenters()) {
if (fp.getCount() >= 2) {
possibleCenters.add(fp);
}
}
int size = possibleCenters.size(); int size = possibleCenters.size();
if (size < 3) { if (size < 3) {

View file

@ -44,7 +44,7 @@ public final class FinderPattern extends ResultPoint {
return estimatedModuleSize; return estimatedModuleSize;
} }
int getCount() { public int getCount() {
return count; return count;
} }