com.java4less.vision
Class Barcode1DReader

java.lang.Object
  |
  +--com.java4less.vision.Barcode1DReader

public class Barcode1DReader
extends java.lang.Object

 Class for scanning images and reading barcodes.
 
 
 Example of use:

 // load image to scan in a BufferedImage object   
 BufferedImage myImage=....;

 Barcode1DReader reader=new Barcode1DReader();
 reader.setSymbologies(Barcode1DReader.CODE128);
 BarcodeData[] barcodes=reader.scan(new RImage(myImage));
 
 


Field Summary
 boolean applyContrast
          apply contrast algorithm
static int CODE128
           
static int CODE39
           
static int EAN13
           
static int EAN8
           
static int IDENTCODE
           
static int INTERLEAVED25
           
 boolean isBWImage
          is a black and white image?
 int minBars
          minimum number of bars that make a barcode
static int UPCA
           
static int UPCE
           
 
Constructor Summary
Barcode1DReader()
           
 
Method Summary
 boolean isRemoveNoise()
           
 BarcodeData[] scan(RImage inputImage)
           
 BarcodeData[] scan(RImage inputImage, boolean returnCandidates)
          scan image looking for barcodes
 void setProgressListener(IProgressListener l)
          Set progress listener for getting progress information
 void setRemoveNoise(boolean removeNoise)
          if true, all standalone white pixels surrounded by 8 black ones, will be converted to white
 void setSymbologies(int s)
          set of symbologies to be recognized
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CODE128

public static int CODE128

EAN8

public static int EAN8

EAN13

public static int EAN13

UPCA

public static int UPCA

UPCE

public static int UPCE

CODE39

public static int CODE39

INTERLEAVED25

public static int INTERLEAVED25

IDENTCODE

public static int IDENTCODE

minBars

public int minBars
minimum number of bars that make a barcode


applyContrast

public boolean applyContrast
apply contrast algorithm


isBWImage

public boolean isBWImage
is a black and white image?

Constructor Detail

Barcode1DReader

public Barcode1DReader()
Method Detail

setSymbologies

public void setSymbologies(int s)
set of symbologies to be recognized

Parameters:
s -

setProgressListener

public void setProgressListener(IProgressListener l)
Set progress listener for getting progress information

Parameters:
l -

scan

public BarcodeData[] scan(RImage inputImage)
                   throws VisionException
Parameters:
inputImage -
Returns:
returnCandidates, set it to true to get also the list of candidates
Throws:
VisionException

scan

public BarcodeData[] scan(RImage inputImage,
                          boolean returnCandidates)
                   throws VisionException
scan image looking for barcodes

Returns:
VisionException

isRemoveNoise

public boolean isRemoveNoise()

setRemoveNoise

public void setRemoveNoise(boolean removeNoise)
if true, all standalone white pixels surrounded by 8 black ones, will be converted to white

Parameters:
removeNoise -