mirror of
https://github.com/zxing/zxing.git
synced 2024-11-09 20:44:03 -08:00
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:
parent
75dbbb00dd
commit
78c2a9c440
|
@ -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) {
|
||||||
|
|
|
@ -44,7 +44,7 @@ public final class FinderPattern extends ResultPoint {
|
||||||
return estimatedModuleSize;
|
return estimatedModuleSize;
|
||||||
}
|
}
|
||||||
|
|
||||||
int getCount() {
|
public int getCount() {
|
||||||
return count;
|
return count;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue