條形碼或條碼(barcode)是由一組按必定編碼規則排列的條,空符號,用以表示必定的字符,數字及符號組成的信息。條碼系統是由條碼符號設計,製做及掃描閱讀組成的自動識別系 統。 條碼卡分爲一維碼和二維碼兩種。一維碼比較經常使用,如平常商品外包裝上的條碼就是一維碼。它的信息存儲量小,僅能存儲一個代號,使用時經過這個代號調 取計算機網絡中的數據。二維碼是近幾年發展起來的,它能在有限的空間內存儲更多的信息,包括文字、圖象、指紋、簽名等,並可脫離計算機使用。網絡
條碼種類不少,常見的大概有二十多種碼制,其中包括:
Code39 碼(標準39碼)、Codabar碼(庫德巴碼)、Code25碼(標準25碼)、ITF25碼(交叉25碼)、Matrix25碼(矩陣25碼)、 UPC-A碼、UPC-E碼、EAN-13碼(EAN-13國際商品條碼)、EAN-8碼(EAN-8國際商品條碼)、中國郵政碼(矩陣25碼的一種變 體)、Code-B碼、MSI碼、Code11碼、Code93碼、ISBN碼、ISSN碼、Code128碼(Code128碼,包括EAN128 碼)、Code39EMS(EMS專用的39碼)等一維條碼和PDF417等二維條碼。ide
ITF25條形碼識別編碼
ITF25條形碼圖片:計算機網絡
halcon代碼:設計
1 * 讀取ITF25碼 2 3 create_bar_code_model ([], [], BarCodeHandle) 4 dev_close_window () 5 dev_open_window (0, 0, 120, 300, 'black', WindowHandle) 6 7 read_image (Image,'D:/MyFile/halcon/條形碼識別/ITF25_1.jpg') 8 get_image_size (Image, Width, Height) 9 dev_set_window_extents (0, 0, Width-1, Height-1) 10 11 set_bar_code_param (BarCodeHandle,'check_char','present') 12 find_bar_code (Image, SymbolRegions, BarCodeHandle, '2/5 Interleaved', DecodedDataStrings) 13 disp_message (WindowHandle, DecodedDataStrings, 'window', 18, 12, 'black', 'false') 14 15 clear_bar_code_model (BarCodeHandle)
Code25條形碼識別3d
Code25條形碼圖片:code
halcon代碼:blog
1 * 讀取Code25碼 2 create_bar_code_model ([], [], BarCodeHandle) 3 dev_close_window () 4 dev_open_window (0, 0, 120, 300, 'black', WindowHandle) 5 6 dev_set_draw ('margin') 7 dev_set_line_width (3) 8 9 read_image (Image, 'D:/MyFile/halcon/條形碼識別/Code25_1.jpg') 10 get_image_size (Image, Width, Height) 11 dev_set_window_extents (0, 0, Width-1, Height-1) 12 dev_display (Image) 13 14 set_bar_code_param (BarCodeHandle, 'check_char','present') 15 find_bar_code (Image, SymbolRegions, BarCodeHandle, '2/5 Industrial', DecodedDataStrings) 16 disp_message (WindowHandle, DecodedDataStrings, 'window', 18, 12, 'black', 'false') 17 18 clear_bar_code_model (BarCodeHandle)