mirror of
https://github.com/zxing/zxing.git
synced 2024-11-10 04:54:04 -08:00
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:
parent
2cd81bae2a
commit
99ca70d7f3
|
@ -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");
|
||||||
|
|
Loading…
Reference in a new issue