Detecting logical widths is more complex for non-binary barcodes. The Black Ice Barcode SDK/ActiveX uses 4 different models to detect the optimal thresholding values for the decisions. These algorithms always use global threshold values for each barcode. The following descriptions correspond to the non-binary barcodes with 3 different width types, but it easily can be generalized to barcodes with more than 3 different bar widths.
· The first model assume that the barcode is a perfect barcode. In this model each physical width corresponds to a logical width. This method is fast, and very easy, but unfortunately works well for only perfect (after noise removal) barcodes (such as software generated (not scanned) barcodes).
· The second model is similar to the model used for binary barcodes. The algorithm finds the thinnest and the thickest bars (or spaces) and divides the range between them to 3 equal parts. Bars (or spaces) falling into the first part are classified as thin bars (or spaces), bars (or spaces) falling into the second part are classified as middle-narrow bars (or spaces), and the others are classified as narrow bars.
· The third model assume that a maximum point of the distribution method corresponds to each width type. The algorithm tries to detect these maximum points, and interpolates the threshold values between the maximum points.
· The fourth model assume that a non-zero “island” of the physical values corresponds to each logical width, and between two non-zero “islands” there is a zero “island”. The algorithm tries to detect these zero-islands and counts the threshold values of them.
The read/decode methods of the Black Ice Barcode SDK/ActiveX first try to read and decode an unknown type of barcode as a binary barcode, and as a non-binary barcode as well, and returns the value and coding name with the highest probability. During reading and decoding all of the models above are used.