Common Vision Blox Foundation Package Tool
C-Style | C++ | .Net API (C#, VB, F#) | Python |
ZXBarcode.dll | Stemmer.Cvb.Foundation.ZxBarcode |
Common Vision Blox ZXBarcode is a simple and lightweight barcode and matrix code reader based on zxing-cpp (which is a fork of the zxing project).
ZXBarcode invariable requires monochrome input with 8 bits per pixel. Any other image data will need to be converted to match this description prior to passing it to the functions of the ZXBarcode library (for color images a shortcut exists by selecting a suitable image plane for processing). zxing-cpp (and therefore ZXBarcode) is capable of reading a number of different code types - for details refer to the Feature overview.
In case of 1D codes, the codes must be visible more or less upright (give or take about 30°) in the image to be read successfully (rotated by - roughly - 180° is not a problem). DataMatrix and PDF417 codes should not be significantly bent or distorted, otherwise reading is bound to fail.
ZXBarcode is classified as a Common Vision Blox tool because its functions are provided in a DLL, thus providing optimum flexibility when integrating the functions in other applications. Its classification as a tool does not imply any restrictions in terms of quality or functions, but is merely intended as a guide as to the type of programming required.
Image Processing Tool for reading barcodes and matrix codes
The exported functions can initially be differentiated according to the manner in which they access the image data. Functions without a particular suffix in their names (e.g. AriLog8to8) use linear image access. This makes them suitable for all image sources which allocate a linear memory for a plane of the image (e.g. b/w cameras).
If a function name is given the suffix »VPAT« (e.g. AriLogVPAT), the function can also be used with a non-linear memory (e.g. multi-tap cameras).
Functions can also be differentiated in terms of the type of their input and output images. »8to8« in the name means that both the input images and the output image have an 8-bit data type (e.g. AriLog8to8). The suffix »8to16« means that the input images have a depth of 8 bits, while the output image is 16 bits in depth.
If the function receives an existing and compatible output image this image will be used. Otherwise a new image will be created internally. Normally the function should create the output image itself, because this is the easiest way and the procedure is not very time critical. But sometimes it might be necessary to use already existing images instead.
When an output image is created within the function, the user must release it with the ReleaseImage function of the Image DLL. If the image is not released, a memory leak will occur.
If you use an existing image as input please internally a ShareImage is done and you have to release twice with ReleaseImage - first for the ShareImage and for your existing image. In any way if you are not sure please check the ReferenceCounter of your image object using the RefCount function of the Image DLL.
A brief example is provided below in form of an excerpt from the Visual C++ tutorial program »VCZXBarcode« under %cvb%Tutorial: