J4L Barcode Vision for Delphi

Copyright J4L (http://www.java4less.com) 2012

Installation

J4L Barcode Vision for Delphi is a component which can read (scan) barcodes images. It support the following features:

 

The requirements are:

Know limitations are:

 

Demo/Evaluation version

 

The evaluation version contains a executable file (visionDemo.exe) which demonstrates the scanning process. It will scan all BMP and JPG files located in the *images subdirectories.

Run visionDemo.exe and click one of the scan buttons to test the demo version.

 

Installation of the registered version

 

The component is delivered in source code form only. It is made of a set of *.pas files you can compile as component or include in your application.

 

Examples for Vision 1D

 

The use of the component is very simple. You must follow these steps:

  1. Load for example a BMP or JPG image:

    bitMap1 := TBitMap.Create;
    bitMap1.LoadFromFile('myimage.bmp' );


    // for JPEG
    // jpeg := TJPegImage.Create;
    // jpeg.LoadFromFile( 'myfile.jpg');


  2. Create a TJ4LImage object:

    image:=TJ4LImage.create(bitMap1); // or TJ4LImage.create(jpeg);

  3. Create a TJ4LBarcode1DReader instance:

    reader:=TJ4LBarcode1DReader.create();

  4. Set the symbologies you expect to find in the image:

    // we will be looking for code 128 and code 39 barcodes
    reader.setSymbologies(CODE128 + CODE39);

  5. Call the scan() method of the TJ4LBarcode1DReader

    barcodes:=reader.scan(image);

  6. Read the result. The result is a TJ4LBarcodeDataArray object. The elements are TJ4LBarcodeData objects which contain the following information: Symbology (type of barcode), Value ( of the barcode) and position ( x , y).

    if (length(barcodes)>0) then
    for j:=0 to length(barcodes)-1 do
    begin
    WriteLn(Output,'Barcode found '+barcodes[j].toString());
    barcodes[j].free;
    barcodes[j]:=nil;
    end
    else WriteLn(Output,'No barcode found ');

You can optimize the scanning process by setting the following properties in the global RVisionConfiguration object:

Depending on the size of the object and the image resolution you use, you can modify these values to speed up the scanning process.


Examples for PDF417

The use of the component is:

  1. Load for example a BMP or JPG image:

    bitMap1 := TBitMap.Create;
    bitMap1.LoadFromFile('myimage.bmp' );


    // for JPEG
    // jpeg := TJPegImage.Create;
    // jpeg.LoadFromFile( 'myfile.jpg');


  2. Create a TJ4LImage object:

    image:=TJ4LImage.create(bitMap1); // or TJ4LImage.create(jpeg);

  3. Create a TJ4LBarcode1DReader instance:

    reader:=TJ4LPDF417Reader.create();

  4. Call the read() method of the TJ4LPDF417Reader

    barcodes:=reader.read(image);

  5. Read the result. The result is a TJ4LPDF417DataArray object. The elements are TJ4LPDF417Data objects which contain the following information:

    - method getValue(): to read the scanned value as an array of integers, return a TVectorInteger value which is defined as an array of integer.
    - methods getX() and getY(): position of the barcode in the image.
    - getConfidence(): 0 means no error has been deteced. A value > 0 means errors detected and corrected. A value < -1 means errors were not corrected.
    - getEClevel(): return maximum number of errors that can be corrected.
    - getMacroPDFStringField(f:integer): returns a Macro PDF417 field. The value for the parameter can be: MACROPDF_SEGMENT, MACROPDF_FILEID, MACROPDF_FILENAME, MACROPDF_SEGMENT_COUNT, MACROPDF_TIMESTAMP, MACROPDF_SENDER, MACROPDF_ADRESSEE,
    MACROPDF_FILESIZE or MACROPDF_CHECKSUM . These constants are defined in the J4LPDF417Data unit.

Examples for Datamatrix

The use of the component is:

  1. Load for example a BMP or JPG image:

    bitMap1 := TBitMap.Create;
    bitMap1.LoadFromFile('myimage.bmp' );


    // for JPEG
    // jpeg := TJPegImage.Create;
    // jpeg.LoadFromFile( 'myfile.jpg');


  2. Create a TJ4LImage object:

    image:=TJ4LImage.create(bitMap1); // or TJ4LImage.create(jpeg);

  3. Create a TJ4LDatamatrixReader instance:

    reader:=TJ4LDatamatrixReader.create();

  4. Call the read() method of the TJ4LDatamatrixReader

    barcodes:=reader.read(image);

  5. Read the result. The result is a TJ4LDatamatrixDataArray object. The elements are TJ4LDatamatrixData objects which contain the following information:
    - method getValue(): to read the scanned value as an array of integers, return a TVectorInteger value which is defined as an array of integer.
    - methods getX() and getY(): position of the barcode in the image.

 

 

Examples for QRCode

The use of the component for QRCode is:

  1. Load for example a BMP or JPG image:

    bitMap1 := TBitMap.Create;
    bitMap1.LoadFromFile('myimage.bmp' );


    // for JPEG
    // jpeg := TJPegImage.Create;
    // jpeg.LoadFromFile( 'myfile.jpg');


  2. Create a TJ4LImage object:

    image:=TJ4LImage.create(bitMap1); // or TJ4LImage.create(jpeg);

  3. Create a TJ4LQRCodeReader instance:

    reader:=TJ4L
    QRCodeReader.create();

  4. Call the read() method of the TJ4LQRCodeReader

    barcodes:=reader.read(image);
    reader.isBWImage:=false;
    // convert image to black and white

  5. Read the result. The result is a TJ4LQRCodeDataArray object. The elements are TJ4LQRCodeData objects which contain the following information:
    - method getValue(): to read the scanned value as an array of integers, return a TVectorInteger value which is defined as an array of integer.
    - method getValueAsString() returns the read value as an string.
    - properties x1 and y1: center of the upper left finding pattern of QRCode.
    - properties x2 and y2: center of the upper right finding pattern of QRCode.
    - properties x3 and y3: center of the bottom left finding pattern of QRCode.

 

Examples for Aztec Code

The use of the component for Aztec is:

  1. Load for example a BMP or JPG image:

    bitMap1 := TBitMap.Create;
    bitMap1.LoadFromFile('myimage.bmp' );


    // for JPEG
    // jpeg := TJPegImage.Create;
    // jpeg.LoadFromFile( 'myfile.jpg');


  2. Create a TJ4LImage object:

    image:=TJ4LImage.create(bitMap1); // or TJ4LImage.create(jpeg);

  3. Create a TJ4LAztecCodeReader instance:

    reader:=TJ4L
    AztecCodeReader.create();

  4. Call the read() method of the TJ4LAztecCodeReader

    barcodes:=reader.read(image);
    reader.isBWImage:=false;
    // convert image to black and white

  5. Read the result. The result is a TJ4LAztecDataArray object. The elements are TJ4LAztecData objects which contain the following information:
    - method getValue(): to read the scanned value as an array of integers, return a TVectorInteger value which is defined as an array of integer.
    - method getValueAsString() returns the read value as an string.
    - properties x1 and y1: center of the the Aztec Code barcode.