J4L-PDF417 Vision for .NET
Copyright J4L (http://www.java4less.com)
2007
Installation
J4L PDF417 Vision is a .NET 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:
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 rvisionPDF*.dll to your project.
Examples
The delivered ZIP file includes a
sample applicaion (PDF417Sample*.exe) that scans all images in the "images"
subdirectory and displays the result in the standard output (MSDOS console).
The use of the component is very
simple. You must follow these steps:
- Create a PDF417Reader instance:
[c#]
PDF417Reader reader=new PDF417Reader();
- Load your image into an Image
class (format must be PixelFormat.Format24bppRgb). The application PDF417Sample.cs
includes a method called loadImage() you can use for this purpose.
[c#]
Image image=loadImage("myFile.gif");
// see loadImage method in PDF417Sample.cs
- Create a RImage instance and call
the Read() method of the PDF417Reader
[c#]
PDF417Data[]
barcodes=reader.Read(new RImage(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.cs.
If no barcode has been found the array returned by read() will be empty.
You can optimize the scanning process
by setting some system properties:
- J4L.Vision.Util.SystemProperties.setProperty("maxArea","90000");.
Ignore objects larger than 90000 pixels.
-
J4L.Vision.Util.SystemProperties.setProperty("minArea","30");.
Ignore objects smaller than 30 pixels.
-
J4L.Vision.Util.SystemProperties.setProperty("minBarLength","15");.
Ignore start/stop bars shorter than 15 pixels.
-
J4L.Vision.Util.SystemProperties.setProperty("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.