I wrote a DLL in PB to recognize and read barcodes in a given bitmap (BMP, JPG, PNG, TIF).
I'm looking for testers of this dll. I need to know:
- is it working (found any barcodes)?
- how many dpi and colors the picture had?
- has the barcode been rotated?
I think, 300DPI and B/W will be the minimum for recognition.
Actually, the dll can recognice three types of barcodes:
- Code39
- Code128 incl. checksum-calculation
- EAN13 incl. checksum-calculation
The barcodes have to be horizontal in the picture (or rotated by 180°). The y can be rotated by +- 5° to 10°.
Here is the download-link:
http://www.x-beliebig.info/Download/INBarcodeOCR.zip
Here is a quick documentation:
Code: Select all
; INBarcodeOCR documentation
;
; The DLL provides the following functions:
;
; GetBarcodesFile(Filename)
; --------------------------------------------------------------------
; Retrieves the barcodes in a given image-file (BMP, JPG, PNG, TIF)
; Returns the number of barcodes found
; Returns -1 for an error (file not found)
; Returns -2 if not registered
; GetBarcodesClipboard()
; --------------------------------------------------------------------
; Retrieves the barcodes in a given image in clipboard
; Returns the number of barcodes found
; Returns -1 for an error (no image in clipboard)
; Returns -2 if not registered
; GetBarcodesResult()
; --------------------------------------------------------------------
; Returns the result of the barcode OCR. Returns the following string:
; X TAB Y TAB Width TAB Height TAB Codetype TAB Code CR
; X TAB Y TAB Width TAB Height TAB Codetype TAB Code CR
; TAB = ASCII 9
; CR = ASCII 13
; GetBarcodeVersionInfo()
; --------------------------------------------------------------------
; Returns the version of this DLL
; RegisterBarcodeDLL(Password)
; --------------------------------------------------------------------
; Registers this DLL using a password you got after purchase.
; Returns 0 for success
; Returns -1 for failure
Code: Select all
; Test for INBarcodeOCR.dll
Filename.s = "c:\Bild.bmp"
If OpenLibrary(0, "INBarcodeOCR.dll")
; show version information
Debug "Version: " + PeekS(CallFunction(0, "GetBarcodeVersionInfo"))
; register the dll
If CallFunction(0, "RegisterBarcodeDLL", "beta") = 0
; start OCR and find all barcodes
Ret.l = CallFunction(0, "FindBarcodesFile", Filename.s)
If Ret.l > 0
; show the result
Result.s = PeekS(CallFunction(0, "GetBarcodesResult"))
Debug "Barcode result: " + Result.s
EndIf
If Ret.l = 0
Debug "No barcodes found"
EndIf
If Ret.l < 0
Debug "Error " + Str(Ret.l)
EndIf
Else
Debug "Wrong password" ; not correct registered
EndIf
CloseLibrary(0)
EndIf
The password for this DLL is "beta".
I look forward to get some feedback.
Kukulkan