Fixed an old misspelling and a few tiny tweaks

git-svn-id: https://zxing.googlecode.com/svn/trunk@956 59b500cc-1b3d-0410-9834-0bbf25fbcc57
This commit is contained in:
srowen 2009-05-27 10:03:23 +00:00
parent 58c367d9ea
commit dbb2c31a40

View file

@ -77,7 +77,7 @@ public class FinderPatternFinder {
// image, and then account for the center being 3 modules in size. This gives the smallest // image, and then account for the center being 3 modules in size. This gives the smallest
// number of pixels the center could be, so skip this often. When trying harder, look for all // number of pixels the center could be, so skip this often. When trying harder, look for all
// QR versions regardless of how dense they are. // QR versions regardless of how dense they are.
int iSkip = (int) (maxI / (MAX_MODULES * 4.0f) * 3); int iSkip = (3 * maxI) / (4 * MAX_MODULES);
if (iSkip < MIN_SKIP || tryHarder) { if (iSkip < MIN_SKIP || tryHarder) {
iSkip = MIN_SKIP; iSkip = MIN_SKIP;
} }
@ -111,7 +111,7 @@ public class FinderPatternFinder {
// expensive and didn't improve performance. // expensive and didn't improve performance.
iSkip = 2; iSkip = 2;
if (hasSkipped) { if (hasSkipped) {
done = haveMulitplyConfirmedCenters(); done = haveMultiplyConfirmedCenters();
} else { } else {
int rowSkip = findRowSkip(); int rowSkip = findRowSkip();
if (rowSkip > stateCount[2]) { if (rowSkip > stateCount[2]) {
@ -163,7 +163,7 @@ public class FinderPatternFinder {
iSkip = stateCount[0]; iSkip = stateCount[0];
if (hasSkipped) { if (hasSkipped) {
// Found a third one // Found a third one
done = haveMulitplyConfirmedCenters(); done = haveMultiplyConfirmedCenters();
} }
} }
} }
@ -446,7 +446,7 @@ public class FinderPatternFinder {
* at least {@link #CENTER_QUORUM} times each, and, the estimated module size of the * at least {@link #CENTER_QUORUM} times each, and, the estimated module size of the
* candidates is "pretty similar" * candidates is "pretty similar"
*/ */
private boolean haveMulitplyConfirmedCenters() { private boolean haveMultiplyConfirmedCenters() {
int confirmedCount = 0; int confirmedCount = 0;
float totalModuleSize = 0.0f; float totalModuleSize = 0.0f;
int max = possibleCenters.size(); int max = possibleCenters.size();
@ -464,7 +464,7 @@ public class FinderPatternFinder {
// and that we need to keep looking. We detect this by asking if the estimated module sizes // and that we need to keep looking. We detect this by asking if the estimated module sizes
// vary too much. We arbitrarily say that when the total deviation from average exceeds // vary too much. We arbitrarily say that when the total deviation from average exceeds
// 15% of the total module size estimates, it's too much. // 15% of the total module size estimates, it's too much.
float average = totalModuleSize / max; float average = totalModuleSize / (float) max;
float totalDeviation = 0.0f; float totalDeviation = 0.0f;
for (int i = 0; i < max; i++) { for (int i = 0; i < max; i++) {
FinderPattern pattern = (FinderPattern) possibleCenters.elementAt(i); FinderPattern pattern = (FinderPattern) possibleCenters.elementAt(i);