Tiny logic improvement

git-svn-id: https://zxing.googlecode.com/svn/trunk@123 59b500cc-1b3d-0410-9834-0bbf25fbcc57
This commit is contained in:
srowen 2007-12-18 21:44:08 +00:00
parent 74ff130112
commit f7ef069a47

View file

@ -76,9 +76,9 @@ public final class BlackPointEstimator {
}
// Find a valley between them that is low and closer to the white peak
int bestValley = secondPeak;
int bestValley = secondPeak - 1;
int bestValleyScore = Integer.MAX_VALUE;
for (int i = secondPeak; i > firstPeak; i--) {
for (int i = secondPeak - 1; i > firstPeak; i--) {
int distance = secondPeak - i + 3;
int score = distance * histogram[i];
if (score < bestValleyScore) {