J4L PDF417 Vision for the Java Platform [TM]
Copyright J4L (http://www.java4less.com)
2007
Installation
J4L PDF417 Vision is a Java component
which can read (scan) pdf417 barcodes images. It support the following features:
- Finding all barcodes in large
images (for example in a scanned page or document)
- Supports binary, text and numeric
encoding.
- Supports Macro PDF 417 fields.
The requirements are:
- Java 1.4 or 1.5 (let us know if
you need a version for 1.3 or 1.2)
Know limitations are:
- Best result are achieved with
black barcodes on white background.
- Shadowed or blurred barcodes can
be unreadable.
- Barcodes can be rotated but better
results will be achieved in the upright position.
Installation
In order to use the component you
only need to add rvision.jar and rpdf417vision.jar to your classpath. If you
need to scan large images and get a outOfMemory error you will need to increase
the Java heap Size using the Java.exe parameter -Xmx.
Javadoc pages
The Javadoc pages are located in
the javadoc subdirectory of the component's ZIP file.
Examples
The use of the component is very
simple. You must follow these steps:
- Create PDF417Reader instance:
PDF417Reader reader=new PDF417Reader();
- Load your image into a BufferedImage
class. The application PDF417Sample.java includes a method called loadImage()
you can use for this purpose.
Image image=loadImage("myFile.gif");
- Create a RImage instance and call
the read() method of the PDF417Reader
PDF417Data[] barcodes=reader.scan(new
RImage((BufferedImage) im));
- Read the result array. The member
of the array are PDF417Data objects which contain the following information:
- Value ( of the barcode) and position
( x , y).
- Confidence ( getConfidence() method):
returns 0 if no errors have been detected, a value less than 0 if errors have
been detected and a value >0 if errors have been detected and corrected.
If the confidence is < 0 or >= than the Error Correction Level you can
assume the read value is not correct.
- Error Correction Level (getECLevel()
method). Returns the maximum number of errors that can be corrected.
- getMacroPDFField() allows you
to read the Macro PDF 417 fields. See sample application PDF417Sample.java.
If no barcode has been found the array returned by read() will be empty.
The component includes a simple test
program called PDF417Sample.java that will scan all file located in the images
subdiretory.
You can optimize the scanning process
by setting some system properties:
-
com.java4less.vision.maxarea=90000.
Ignore objects larger than 90000 pixels.
-
com.java4less.vision.minarea=30.
Ignore objects smaller than 30 pixels.
-
com.java4less.vision.minBarLength=15.
Ignore start/stop bars shorter than 15pixels.
-
com.java4less.vision.maxBarLength=1000.
Ignore start/stop bars longer than 1000 pixels.
Depending on the size of the object
and the image resolution you use, you can modify these values to speed up the
scanning process.