Java CommandLineRunner: print result points

git-svn-id: https://zxing.googlecode.com/svn/trunk@1496 59b500cc-1b3d-0410-9834-0bbf25fbcc57
This commit is contained in:
flyashi 2010-07-29 18:54:36 +00:00
parent 2cd81bae2a
commit 99ca70d7f3

View file

@ -28,6 +28,7 @@ import com.google.zxing.client.result.ResultParser;
import com.google.zxing.common.BitArray; import com.google.zxing.common.BitArray;
import com.google.zxing.common.BitMatrix; import com.google.zxing.common.BitMatrix;
import com.google.zxing.common.HybridBinarizer; import com.google.zxing.common.HybridBinarizer;
import com.google.zxing.ResultPoint;
import java.awt.image.BufferedImage; import java.awt.image.BufferedImage;
import java.io.File; import java.io.File;
@ -238,6 +239,13 @@ public final class CommandLineRunner {
System.out.println(uri.toString() + " (format: " + result.getBarcodeFormat() + System.out.println(uri.toString() + " (format: " + result.getBarcodeFormat() +
", type: " + parsedResult.getType() + "):\nRaw result:\n" + result.getText() + ", type: " + parsedResult.getType() + "):\nRaw result:\n" + result.getText() +
"\nParsed result:\n" + parsedResult.getDisplayResult()); "\nParsed result:\n" + parsedResult.getDisplayResult());
System.out.println("Also, there were " + result.getResultPoints().length + " result points.");
for (int i = 0; i < result.getResultPoints().length; i++) {
ResultPoint rp = result.getResultPoints()[i];
System.out.println(" Point " + i + ": (" + rp.getX() + "," + rp.getY() + ")");
}
return result; return result;
} catch (NotFoundException nfe) { } catch (NotFoundException nfe) {
System.out.println(uri.toString() + ": No barcode found"); System.out.println(uri.toString() + ": No barcode found");