TWI286706B - Two-dimensional barcode card and the decoding method - Google Patents

Two-dimensional barcode card and the decoding method Download PDF

Info

Publication number
TWI286706B
TWI286706B TW91134672A TW91134672A TWI286706B TW I286706 B TWI286706 B TW I286706B TW 91134672 A TW91134672 A TW 91134672A TW 91134672 A TW91134672 A TW 91134672A TW I286706 B TWI286706 B TW I286706B
Authority
TW
Taiwan
Prior art keywords
matrix
code
information
dimensional barcode
boundary
Prior art date
Application number
TW91134672A
Other languages
Chinese (zh)
Other versions
TW200409043A (en
Inventor
Zhi-Guo Chang
Original Assignee
Shenzhen Syscan Technology Co
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Shenzhen Syscan Technology Co filed Critical Shenzhen Syscan Technology Co
Priority to TW91134672A priority Critical patent/TWI286706B/en
Publication of TW200409043A publication Critical patent/TW200409043A/en
Application granted granted Critical
Publication of TWI286706B publication Critical patent/TWI286706B/en

Links

Landscapes

  • Image Processing (AREA)
  • Editing Of Facsimile Originals (AREA)

Abstract

The present invention discloses a two-dimensional barcode card, which uses the positioning hole as the identification mark, and can be scanning accompanying with decoding, and with large information capacity, and simple decoding algorithm. The card includes the carrier and the code map of the two-dimensional barcode diagram attached on the carrier using matrix cells to store the information. The code map includes the upper boundary, the left and right boundaries having positioning holes, and the bit stream area. Moreover, the present invention discloses the decoding method for the code map, which is first to calculate the position and gradient of the upper boundary; then, estimating and calculating the central coordinates of the first pair of positioning holes based on the above calculation to obtain the central coordinates of the matrix cells; reading the bit stream information from the image; estimating based on the central coordinates of the previous pair of positioning holes and calculating the central coordinates of the next pair of positioning holes; reading one bit from the bit stream information for each matrix cell to pass the central coordinates for the upper and lower two matrix cells and calculate the coordinates of all matrix cells between two columns, and simultaneously reading the corresponding bit stream information.

Description

1286706 五、發明說明(1) 〈技術領域&gt; 本發明涉及一種用於存儲 可以被附著在各種載體上的二碼的資,,^ 碼的方法。 ’、馬卡’和解續该二維條 &lt;先前技術&gt; 二維條碼是一種能被掃描吉 號可用於存儲各種經過編碼2 S 3 ί形符號,該圖形符 紙張等載體上。與其他資訊-二,r訊,可以被附著在 有載體成本低廉,容易識讀等J式相比較,二維條碼具 常用二維條碼編碼方式有PDF4 ° 式。該QR編碼方式生成的二維 1 ( j碼方式和QR編碼方 排列的黑白矩陣單格存儲資訊豆螂碼,利用成矩陣 角上的三個”回&quot;型符號,(如第別4寸徵為分佈在圖形 識別幾率小,圖形中用於存儲 ,所示)。QR矩陣碼誤 採用數碼相機獲取圖像的應用二=貝,,面積大,.適合於 成的二維條碼識別演算法^雜琢^ _但是這種編碼方式生 圖像的應用場合,必須在整體 ^ t於以掃描方式獲取 始進行識別。 、’圖像掃描完之後才能開 PDF417編碼方式與QR編碼 碼方式利用相鄰的黑條和白條 ^ =類型不同,PDF417編 稱為條空(bar-space)比碼,它、又、比例值來存儲資訊, 有固定條空比的黑白間隔線條 58別特徵為圖形兩側具 PDF417編碼方式生成的二弟2圖所示)。 率,特徵識別演算法簡單,右具有最小的誤識別幾 有取大的交μ ^ 令錯旎力(理論上 $ 5頁 五、發明說明(2) ,大能夠容許50%的圖像破損), ^何失真具有最大的容忍度,可以圖形的線性和非線性 式的應用場合,可以在掃描圖像 =於各種圖像獲取 圖像的質量(印刷解析度)* |進行解碼; 識別設備成本高。 存儲容量相對較:;、 〈發明内容&gt; 本發明的目的在於提供一種存 -小〜、而且可以在掃描的同時進行解^ 6t量大、識別運算量 本發明的另一個目的在 〇 —維條碼卡。 卡中資訊的方法。 ^供—種解讀上述二維條碼 ^發明公開了 一種二維條碼 ί上的、利用矩陣格存儲資訊的-唯^括載體和附著在载 於:該碼圖包括上邊界、左碼碼圖,其特徵在 jblt stream )區;其上邊界是邊界、以及位元流 =的矩陣行,左邊界和右邊界是分圖沿送紙方向最前 =、常定位孔的矩陣列,而彳於碼圖兩側最外 間、上邊界之下。 &amp;則位於左右邊界之 本發明的二維條碼卡, 本發明可以採用一個 S $ U匕括如下特徵·· 乍為上政界,再分別用三列矩孔,一行黑矩陣 I ,二列矩陣格的兩側各是一 ^二左邊界和右邊 黑矩陣格和白矩陣袼的組合 二、 袼,而中間一列是 該矩陣格的邊長可以 R2/R1*L &gt;= 4 忙據以下公式選取: 1286706 五、發明說明(3) 其中,R 1為在該載體上印刷碼圖時的解析度; R 2為圖像感測器讀取碼圖時的解析度; L為矩陣格的設計邊長。 本發明的位元流區可以包括多個資訊塊,每個資訊塊 包括多個矩陣行及改錯碼。在位元流區中,資訊的排放方 式可以是以行為主,從上至下排列;也可以是以列為主, 從左至右或從右至左排列。1286706 V. INSTRUCTION DESCRIPTION (1) <Technical Field> The present invention relates to a method for storing two codes of codes that can be attached to various carriers. ', Maca' and the re-continuation of the two-dimensional strip &lt;Prior&gt; The two-dimensional barcode is a type that can be scanned and can be used to store various encoded 2 S 3 ί-shaped symbols on the carrier such as paper. And other information - two, r news, can be attached to the carrier with low cost, easy to read and other J-style comparison, two-dimensional bar code commonly used two-dimensional bar code encoding method PDF4 °. The QR code generated by the QR code method (the j code mode and the QR code side arrangement of the black and white matrix cells store the information cardamom code, using three "back" type symbols on the corner of the matrix, (such as the first 4 inches) The sign of distribution is small in the probability of pattern recognition, and the figure is used for storage, as shown in the figure. The application of QR matrix code error to obtain image by digital camera is two = shell, large area, suitable for 2D barcode recognition algorithm ^琢琢^ _ However, the application of this encoding method to the image must be recognized in the whole way by scanning. [After the image is scanned, the PDF417 encoding method and the QR encoding code can be used. The adjacent black bars and white bars are different in type. PDF417 is called bar-space ratio code. It and the scale value store information. The black and white interval lines with fixed space ratio are characterized by two graphics. The second side of the PDF417 encoding method is shown in Figure 2. The rate, feature recognition algorithm is simple, the right has the smallest misrecognition, and there are a large number of mismatches. (Theoretically, 5 pages, 5, invention Description (2), can tolerate 5 0% image breakage), ^What distortion has the greatest tolerance, can be graphical linear and non-linear applications, can be in the scanned image = the quality of the image obtained in various images (print resolution) * The decoding device performs the decoding; the recognition device is costly. The storage capacity is relatively::, <Description of the Invention> The object of the present invention is to provide a storage-small--and a large amount of recognition and a large amount of recognition operation while scanning. Another object of the invention is to provide a method for information in a card. The method for interpreting the information in the card is to provide a method for storing the information on the two-dimensional bar code ί, using a matrix lattice to store information. And attached to: the code map includes an upper boundary, a left code code map, characterized by a jblt stream) region; an upper boundary is a boundary, and a matrix row of the bit stream =, the left and right boundaries are sub-picture edges The paper feed direction is the front=, the matrix column of the normal positioning hole, and is located at the outermost and upper boundaries on both sides of the code image. &amp; is the two-dimensional barcode card of the present invention located at the left and right boundaries, and the present invention can adopt a S$ U匕The following characteristics are included: · 乍 is the upper political circle, and then three rows of rectangular holes, one row of black matrix I, two sides of the matrix of the two columns are one ^ two left boundary and the combination of the right black matrix lattice and the white matrix 二袼, and the middle column is the side length of the matrix lattice R2/R1*L &gt;= 4 Busy is selected according to the following formula: 1286706 V. Invention Description (3) where R 1 is when the code image is printed on the carrier Resolution: R 2 is the resolution of the image sensor when reading the code picture; L is the design side length of the matrix. The bit stream area of the present invention may include a plurality of information blocks, each of which includes multiple Matrix rows and error correction codes. In the bit stream area, the information can be discharged in a manner that is dominated by behavior, from top to bottom; or it can be column-based, from left to right or from right to left.

在載體上碼圖的左邊界之左邊和右邊界之右邊有空白 區。本發明還公開了一種二維條碼解碼方法,將附著在載 體上的、利用矩陣格存儲資訊的二維條碼碼圖恢復成二進 位資訊,其包括如下步驟: A ·探測碼圖的上邊界,計算並保存上邊界的傾斜度 B ·探測碼圖的左邊界和右邊界,並根據上邊界的傾 斜度估算出第一對定位孔的區域; C ·在估算的區域中統計白像素的數量,計算出第一 對定位孔的中心座標;There is a blank area to the left of the left border of the code map and to the right of the right border. The invention also discloses a two-dimensional barcode decoding method, which recovers a two-dimensional barcode code image stored on a carrier and uses the matrix lattice to store information into binary information, which comprises the following steps: A. The upper boundary of the sounding code map, Calculate and save the slope of the upper boundary B · the left and right boundaries of the probing pattern, and estimate the area of the first pair of positioning holes according to the inclination of the upper boundary; C · count the number of white pixels in the estimated area, Calculating a center coordinate of the first pair of positioning holes;

D ·計算出第一對定位孔之間、在一條直線上間距為 一個矩陣格邊長的矩陣格的中心座標,並根據該 中心座標從圖像中讀取每個矩陣格1位元(b i t )的位元流資訊; E ·根據前一對定位孔的中心座標,以及矩陣格的邊 長估計其下一對定位孔的區域,並且從中探測計 算出定位孔的中心座標,如果定位孔的中心座標D · Calculate the central coordinate of the matrix lattice between the first pair of positioning holes, which is spaced apart by a matrix on one line, and read each matrix 1 bit from the image according to the central coordinate (bit Bit stream information; E · Estimate the area of the next pair of positioning holes according to the center coordinates of the previous pair of positioning holes, and the side length of the matrix, and calculate the center coordinates of the positioning holes from the detection, if the positioning holes Center coordinates

第7頁 1286706 五、發明說明(4) 探測不成功則結束碼圖解讀,否則進入下一步; F ·根據該對定位孔的中心座標計算,並保存其之間 的矩陣格的中心座標,並根據所述中心座標讀取 相應位置的位元流資訊; G ·根據保存的兩行矩陣格的中心座標計算兩行之間 的所有矩陣格的座標,並讀取相應矩陣格的位元 流貢訊, Η ·回到步驟E。 本發明的二維條碼解碼方法還可以包括以下特徵: 在步驟C中,當白像素的個數大於(Ν - 1 ) * (Μ - 1 )、小 於(Ν + 1 ) * ( Μ + 1 )時,則認為該區域内有一個有效的定 位孔,其中Ν、Μ為矩陣格的兩邊之長。 在步驟D中,讀出碼圖中的總行數資訊,並根據所述總行 數結束解碼。 每讀取(S + Ε )個位元組資訊後進行糾錯運算,輸出糾錯成 功的S個位元組的正確資訊。 本發明的二維條碼卡,採用簡易矩陣碼存儲各種二進 位資訊,與QR編碼方式生成的二維條碼相比,識別演算法 簡單;可以在掃描的同時進行解碼。簡易矩陣碼採用定位 孔作為識別標誌,與PDF41 7相比同樣面積下存儲資訊的面 積大,提高了相同面積印刷載體的存儲容量。 本發明的簡易矩陣碼的解碼演算法,可以在掃描的同 時進行解碼,用定位孔作?圖形識別的定位標誌,識別速 度快、識別演算法簡單。Page 7 1286706 V. Description of invention (4) If the detection is unsuccessful, the code map is interpreted, otherwise it will enter the next step; F · Calculate according to the center coordinates of the pair of positioning holes, and save the center coordinates of the matrix between them, and Reading the bit stream information of the corresponding position according to the central coordinate; G · calculating the coordinates of all the matrix cells between the two rows according to the central coordinates of the saved two rows of matrix cells, and reading the bit stream of the corresponding matrix lattice News, Η · Go back to step E. The two-dimensional barcode decoding method of the present invention may further include the following features: In step C, when the number of white pixels is greater than (Ν - 1 ) * (Μ - 1 ), less than (Ν + 1 ) * ( Μ + 1 ) When it is considered, there is an effective positioning hole in the area, where Ν and Μ are the lengths of the two sides of the matrix. In step D, the total line number information in the code map is read and the decoding is ended based on the total number of lines. Each time (S + Ε ) of the byte information is read, an error correction operation is performed, and the correct information of the S bits of the error correction success is output. The two-dimensional barcode card of the present invention uses a simple matrix code to store various binary information. Compared with the two-dimensional barcode generated by the QR encoding method, the recognition algorithm is simple; the decoding can be performed while scanning. The simple matrix code uses the positioning hole as the identification mark, and the area of the information stored under the same area is larger than that of the PDF41 7, and the storage capacity of the print carrier of the same area is improved. The decoding algorithm of the simple matrix code of the present invention can be decoded at the same time of scanning, and is made by positioning holes. The positioning mark of the graphic recognition has a fast recognition speed and a simple recognition algorithm.

1286706 五、發明說明(5) &lt;實施方式&gt; 係採用C I S (接觸式圖像感測器)的掃描器光照均勻 ,獲取的圖像與原圖像相比非線性失真小,獲取的圖像質 量好,因此可以在二位條碼卡上設計一種結構最大限度簡 潔化的簡易矩陣碼,從而能提高相同面積印刷載體的存儲 容量。本發明的二維條碼卡包括載體和附著於載體之上的 由簡易矩陣碼編碼方式生成的碼圖(如第3圖所示),該 碼圖的邊界輪廓是矩形,圖中的箭頭表示掃描閱讀二維條 碼卡時的送紙方向,設與送紙方向平行的矩陣單元組成碼 圖的列,與送紙方向垂直的矩陣單元組成碼圖的行。 整個碼圖由大小相等的矩陣格組成,包括上邊界1 0、 左邊界12、右邊界14、定位孔20以及位元流(bit stream )區1 6。上邊界1 0是一行黑矩陣格。左邊界1 2和右邊界1 4 都由三列矩陣格組成,這三列矩陣格的兩側分別是一列黑 矩陣格,中間一列由黑白矩陣格間隔排列,其中,白矩陣 格即為定位孔20。在上邊界10之下、左邊界12和右邊界14 之間是位元流區1 6,位元流區1 6用於存放有效資訊,邊界 行和列用於圖像識讀時起定位作用。 帶有定位孔2 0的矩陣列,係可以由一個黑矩陣格和一 個白矩陣格間隔排列(如第3圖所示),也可以由多個黑 矩陣格和一個白矩陣格間隔排列,還可以由黑矩陣格和白 矩陣格以其他組合間隔排列,都屬於本發明公開和保護的 内容。1286706 V. DESCRIPTION OF THE INVENTION (5) &lt;Embodiment&gt; The scanner using CIS (Contact Image Sensor) has uniform illumination, and the acquired image has less nonlinear distortion than the original image, and the acquired image is obtained. The image quality is good, so a simple matrix code with a structure that is minimally simplistic can be designed on the two-digit barcode card, thereby increasing the storage capacity of the print carrier of the same area. The two-dimensional barcode card of the present invention comprises a carrier and a code map generated by a simple matrix code encoding method attached to the carrier (as shown in FIG. 3), the boundary contour of the code image is a rectangle, and the arrow in the figure indicates scanning. When reading the two-dimensional barcode card, the paper feed direction is set, and the matrix unit parallel to the paper feed direction constitutes a code map column, and the matrix unit perpendicular to the paper feed direction constitutes a code map row. The entire code map is composed of equal-sized matrix lattices, including an upper boundary 10, a left boundary 12, a right boundary 14, a positioning hole 20, and a bit stream region 16. The upper boundary 10 is a row of black matrix lattices. The left boundary 1 2 and the right boundary 1 4 are both composed of three columns of matrix lattices, and the two columns of the matrix lattice are respectively arranged in a row of black matrix grids, and the middle column is arranged by black and white matrix grids, wherein the white matrix grid is the positioning hole. 20. Below the upper boundary 10, between the left boundary 12 and the right boundary 14, is a bit stream area 16. The bit stream area 16 is used for storing valid information, and the boundary lines and columns are used for positioning when the image is read. . The matrix column with the positioning holes 20 may be arranged by a black matrix grid and a white matrix grid (as shown in FIG. 3), or may be arranged by a plurality of black matrix grids and a white matrix grid. It can be arranged by the black matrix grid and the white matrix grid at other combinations, which are all disclosed and protected by the present invention.

1286706 五、發明說明(6) 位元流區1 6的矩陣格為資訊的存儲單元,每個矩陣格 存放一個位元(b i t )的資訊,例如黑矩陣格存儲π 0 π ,白 矩陣格存儲” 1 ” 。位元流區1 6 中資訊的排放方式可以是以 行為主,從上至下排列,也可以是以列為主從左至右或者 從右至左排列。 碼圖的長度方向和寬度方向上都包括整數個矩陣格, 矩陣格可以是在行的方向和列的方向上,具有相同數量像 素的方格,也可以是在行的方向和列的方向上具有不相同 數量像素的矩形格,其矩陣格數可根據其附著載體的大小 決定,位元流區的長度和寬度位也因而嫁定。可以根據需 要在位流區加入改錯碼,改錯碼可以按照現有技術設計。 如前面所述,由C I S獲取的圖像非線性失真較小,也就是 說圖形内部結構的相對位置基本固定,因此從掃描獲得的 圖像中準確定位矩陣圖形成為識讀矩陣的唯一重要任務, 而位於碼圖兩侧、處於一條水平線上的左右定位孔2 0正是 為了達到此目的而設計的。當一對定位孔(左右各一個) 被識別出來後,該行所有其他矩陣格的中心位置也就能被 準確計算出來並保存,從而其位元流資訊即可直接獲得; 根據上一對定位孔的位置就可以估計並計算出、保存其下 面一對定位孔的位置,該行所有矩陣格的中心位置也就能 被準確計算出來,從而上述兩行之間的矩陣格的位置,及 其位元流資訊,即可根據矩陣格的邊長通過簡單的計算獲 得。因此用定位孔作為圖形識別的定位標誌,識別速度快 、識別演算法簡單、掃描和識別可以並行處理。1286706 V. Description of invention (6) The matrix lattice of the bit stream area 16 is a storage unit of information, and each matrix lattice stores information of one bit (bit), for example, a black matrix lattice stores π 0 π, and the white matrix lattice stores " 1 " . The information in the bit stream area 16 can be discharged by means of behavior, from top to bottom, or from left to right or from right to left. The code picture includes an integer number of matrix lattices in the length direction and the width direction. The matrix lattice may be a square having the same number of pixels in the direction of the row and the direction of the column, or may be in the direction of the row and the direction of the column. For a rectangular grid with different numbers of pixels, the number of matrix cells can be determined according to the size of the attached carrier, and the length and width of the bit stream region are thus grafted. The error correction code can be added in the bit stream area as needed, and the error correction code can be designed according to the prior art. As described above, the nonlinear distortion of the image acquired by the CIS is small, that is, the relative position of the internal structure of the graphic is substantially fixed, so that accurately positioning the matrix image from the image obtained by scanning becomes the only important task of the reading matrix. The left and right positioning holes 20 located on one horizontal line on both sides of the code pattern are designed for this purpose. When a pair of positioning holes (one on each side) are recognized, the center position of all other matrix cells of the row can be accurately calculated and saved, so that the bit stream information can be directly obtained; The position of the hole can estimate and calculate the position of the pair of positioning holes below it, and the center position of all the matrix cells of the row can be accurately calculated, so that the position of the matrix lattice between the two rows and The bit stream information can be obtained by simple calculation according to the side length of the matrix. Therefore, the positioning hole is used as the positioning mark for pattern recognition, the recognition speed is fast, the recognition algorithm is simple, and the scanning and recognition can be processed in parallel.

1286706 五、發明說明(7) -- 圖像感測器獲取的圖像有可能存在失真,例如n*n 像素的矩陣格失真成(N + 1 ) * ( N + 1 )個像素、或者失直 (N-l )*(N-1 )個像素的矩陣袼,可見N越小相對誤差^ $ 當N&lt; = 3時相對誤差將很容易達到30%乃至40% 。經驗表’ 明,當矩陣格的邊長為大於等於4個掃描像素時f有^土 的識別效果。設印刷的解析度為R 1,矩陣袼的設計邊7長# L個像素,圖像感測器的解析度為R2,則應滿足$2°/R1 ^ ^ =4 (平均每個矩陣格有4*“16個像素)才能可靠的識別 圖形。 每個定位孔是一個白矩陣格,其周圍有一圈同樣大小 的黑矩陣格’因此在一個足夠大的區域内包括且僅僅包括 一個白的小孔。統計該區域内的白像素的個數,同時將它 們的橫坐標與縱坐“分別累加’如果白像素的個數在(|^_ 1 ) * (M-1 )和(N+l ) * (M+1 )之間,則認為該區域内有 一個有效的定位孔,N、Μ為矩陣格的兩邊之長,單位是像 素。定位孔的中心座標通過上述座標累加值分別除以白像 素的個數獲得0根據上述原理,我們結合接觸式圖像感測 器(Contact Image Sensor)SV252A8 設計了一個具有實 際應用價值的方案,該方案用於將一個二進位的電腦文件 存於圖形中,便通過掃描讀取再識別恢復出原二進位文 件。 SV252A8的解析度為2〇〇DPI,共有448個圖像傳感單 元’它們按2 0 0 D P I的點間距排成一線。為了適應硬體特 性’以及最有效的提高相同載體面積上的存儲容量,我們1286706 V. INSTRUCTIONS (7) -- There may be distortion in the image acquired by the image sensor, for example, the matrix of n*n pixels is distorted into (N + 1 ) * ( N + 1 ) pixels, or For a matrix of straight (Nl)*(N-1) pixels, it can be seen that the smaller N is relative to the error ^$ When N&lt;= 3, the relative error will easily reach 30% or even 40%. The empirical table ′ shows that when the side length of the matrix lattice is greater than or equal to 4 scanning pixels, f has the effect of identifying soil. Let the resolution of the printing be R 1, the design side of the matrix 7 7 is longer than L pixels, and the resolution of the image sensor is R2, which should satisfy $2°/R1 ^ ^ = 4 (the average matrix has 4* "16 pixels" to reliably recognize graphics. Each positioning hole is a white matrix with a circle of black matrix of the same size around it. Therefore, it is included in a large enough area and includes only one small white. Hole. Count the number of white pixels in the area, and simultaneously add their abscissa and sit-in "if respectively" if the number of white pixels is at (|^_ 1 ) * (M-1 ) and (N+l ) * (M+1), it is considered that there is a valid positioning hole in the area, N, Μ is the length of the two sides of the matrix, and the unit is pixel. The center coordinate of the positioning hole is obtained by dividing the accumulated value of the above coordinate by the number of white pixels, respectively. According to the above principle, we have designed a practical application value with the contact image sensor SV252A8. The scheme is used to store a binary computer file in the graphic, and then recover the original binary file by scanning and reading. The resolution of the SV252A8 is 2〇〇DPI, and there are 448 image sensing units' which are arranged in a line at a dot pitch of 2 0 0 D P I . In order to adapt to the hardware characteristics and to most effectively increase the storage capacity on the same carrier area, we

1286706 ------------------ 五、發明說明(8) 採用的碼圖排列方式(如第4圖所示)。 每個矩陣格的邊長為4個像素,感測器兩端分別留出8 個像素作為冗餘像素’這樣當圖形出現一定偏斜時也能被 圖像感測器感應到。兩邊的定位孔以及定位孔兩侧的黑矩 陣格共姑用12個像素,剩下的4 0 8個像素構成位元流區16 用於存儲二進位資訊,每行有408/4 = 1〇2個矩陣格,可存 放二進位資訊1 0 2位元。 為了簡化圖形識項〉貝异法’可以將存放於位元流區1 6 的資訊按_定格式組織。例如位元流區按每二十行分為一 個區塊,每個區塊的資訊存儲容量為l〇2bits*20/8 = 255 by tes。為了纠正可能出現的錯誤,在每255個位元組中用 3 2個位元組存放由r e e d - s ο 1 〇 m糾錯演算法(一種高性能的 糾錯演算法)生成的改錯碼,因此每塊位元流區的實際容 量為2 2 3位元組,這些改錯碼最多可以糾正2 5 5位元組中的 任何1 6位元組的錯誤,糾錯比率為6 · 2 7 %。位元流區是整 數區塊(大於等於1 ),資訊位元組數不夠填滿最後一區 塊位元流區時,可用預先定義的位元組填充,在完成 r e e d - s ο 1 〇 m糾錯運算之後將填充位元組丢棄即可。 了以在位元流區1 6的起始處佔用一定的位元組,用以存放 一維條碼卡本身的特定資訊,例如版本號、資訊的位元組 長$等。版本號的作用是使軟體區別不同類型的資訊結構 /資訊的位元組長度的作用是使軟體識讀了第一塊資訊之 後就能知道圖形的總長度,以便決定何時停止掃描圖像。 本發明的二維條碼卡可以通過圖文掃描方式以行為單1286706 ------------------ V. Description of the invention (8) The arrangement of the code maps used (as shown in Figure 4). Each matrix has a side length of 4 pixels, and 8 pixels are left as redundant pixels at both ends of the sensor, so that the image sensor can also be sensed when the pattern is skewed. The positioning holes on both sides and the black matrix on both sides of the positioning hole use 12 pixels in total, and the remaining 408 pixels constitute the bit stream area 16 for storing binary information, each line has 408/4 = 1〇 Two matrix grids can store binary information of 1 0 2 bits. In order to simplify the graphical identification item, the information stored in the bit stream area 16 can be organized in a _ format. For example, the bit stream area is divided into blocks by every twenty lines, and the information storage capacity of each block is l〇2bits*20/8 = 255 by tes. In order to correct possible errors, 32 2 bytes are used to store the error code generated by the reed - s ο 1 〇m error correction algorithm (a high-performance error correction algorithm) in every 255 bytes. Therefore, the actual capacity of each bit stream area is 2 2 3 bytes, and these error codes can correct any 16-bit byte errors in the 2 5 5 bytes, and the error correction ratio is 6 · 2 7 %. The bit stream area is an integer block (greater than or equal to 1). When the number of information bytes is not enough to fill the last block bit stream area, it can be filled with a predefined byte, after completing reed - s ο 1 〇m The padding byte is discarded after the error correction operation. A certain number of bytes are occupied at the beginning of the bit stream area 16 for storing specific information of the one-dimensional bar code card itself, such as the version number, the bit length of the information, and the like. The role of the version number is to make the software distinguish the different types of information structure / the length of the information byte is to let the software know the total length of the graphic after reading the first piece of information, in order to decide when to stop scanning the image. The two-dimensional barcode card of the invention can be used as a behavioral list by means of graphic scanning

第12頁 1286706 五、發明說明(9) 位識讀,結合簡易矩陣碼的解碼軟體即可恢復出二進位資 訊,簡易矩陣碼的解碼方法見圖5,包括如下步驟: 1.探測碼圖的上邊界1 0,計算並保存上邊界1 0的傾斜度; 2 .探測左邊界1 2和右邊界1 4 ; 3. 根據上邊界的位置和傾斜度、左邊界1 2和右邊界1 4的位 置估算出第一對定位孔2 0的區域; 4. 在估算的定位孔20的區域中統計白像素的數量,當白圖 元的個數大於(N-1)*(N-1)、小於(N + 1)*(N+1) 時,則認為該區域内有一個有效的定位孔,其中N為矩 陣格的邊長;分別計算出左定位孔和右定位孔的中心座 標, 5. 因為同一行矩陣格的中心座標在一條直線上並且間距相 等,根據左定位孔和右定位孔的中心座標和上邊界的傾 斜度,計算並且保存第一行所有矩陣格的中心座標; 6. 根據第一行所有矩陣格的中心座標從圖像中讀取相應位 置的位元流資訊(例如像素為π黑π表示二進位資訊’’ 0 ’’ ,像素為π白π表示二進位資訊” 1π ); 7. 根據前一對定位孔的中心座標以及矩陣格的邊長估計下 一對定位孔的區域,並且從中探測計算出定位孔的中心 座標;如果定位孔的中心座標探測成功則進行下面的計 算,否則結束本次圖形識別; 8. 計算並且保存該行所有矩陣格的中心座標(與第5步的 計算方法相同); 9. 根據每一個矩陣格的中心座標從圖像中讀取相應位置的Page 12 1286706 V. Invention Description (9) Position reading, combined with the decoding software of the simple matrix code can recover the binary information, the decoding method of the simple matrix code is shown in Figure 5, including the following steps: 1. Probing the code map Upper boundary 1 0, calculate and save the slope of the upper boundary 10; 2. Detect the left boundary 1 2 and the right boundary 1 4; 3. According to the position and inclination of the upper boundary, the left boundary 1 2 and the right boundary 1 4 The position estimates the area of the first pair of positioning holes 20; 4. Counts the number of white pixels in the estimated area of the positioning hole 20, when the number of white primitives is greater than (N-1)*(N-1), If it is less than (N + 1)*(N+1), it is considered that there is a valid positioning hole in the area, where N is the side length of the matrix lattice; the central coordinates of the left positioning hole and the right positioning hole are respectively calculated, 5 Since the center coordinates of the same row matrix are on a straight line and the spacing is equal, the center coordinates of all the matrix cells of the first row are calculated and saved according to the inclinations of the center coordinates and the upper boundary of the left and right positioning holes; Read the corresponding bit from the image according to the center coordinates of all the matrix cells in the first row The bit stream information (for example, the pixel is π black π indicates binary information '' 0 '', the pixel is π white π indicates binary information "1π); 7. According to the center coordinates of the previous pair of positioning holes and the matrix The side length estimates the area of the pair of positioning holes, and the center coordinate of the positioning hole is calculated from the detection; if the center coordinate of the positioning hole is successfully detected, the following calculation is performed; otherwise, the pattern recognition is ended; 8. Calculate and save the line The center coordinates of all matrix lattices (same as the calculation method in step 5); 9. Read the corresponding position from the image according to the center coordinates of each matrix lattice

1286706 五、發明說明(ίο) 位元流貢訊, 1 0 .根據保存的兩行矩陣格的中心座標計算兩行之間的所 有矩陣格的座標(求上下兩個矩陣格中心座標的平均值 ),同時讀取相應的位元流資訊; 1 1 .回到第7步。 由於掃描獲得的圖像不可能與原圖像完全一致,圖像 中亮度變化劇烈的地方失真會很嚴重,原圖像中方形的定 位孔可能變成不規則的形狀,如果搜索方形的或類似方形 的小孔演算法將會比較複雜,由於採用了直接獲得矩陣格 的中心座標的做法,簡化了簡易矩陣碼的識別演算法。 如果位流區1 6中含有改錯碼,設每S個位元組附加E個 位元組改錯碼,則在每次讀取了( S + E )個位元組資訊後進 行糾錯運算,如果糾錯成功輸出S個位元組的正確資訊, 否則退出識別流程,也可以繼續進行識別。1286706 V. Invention Description (ίο) Bit Stream Gongxun, 1 0. Calculate the coordinates of all matrix lattices between two rows according to the central coordinates of the saved two-row matrix lattice (to find the average of the center coordinates of the upper and lower matrix lattices) ), simultaneously read the corresponding bit stream information; 1 1 . Back to step 7. Since the image obtained by the scan cannot be exactly the same as the original image, the distortion in the image where the brightness changes drastically is severe. The square positioning hole in the original image may become an irregular shape if the square or square is searched. The small hole algorithm will be more complicated, and the recognition algorithm of the simple matrix code is simplified by adopting the method of directly obtaining the central coordinates of the matrix lattice. If the bit stream area 16 contains an error correction code, and each E bit group is added with E byte error correction codes, error correction is performed after each (S + E) byte information is read. Operation, if the error correction succeeds in outputting the correct information of the S bytes, otherwise the recognition process is exited, and the identification can be continued.

1286706 圖式簡單說明 第1圖係為QR編碼方式生成的一種二維條碼碼圖。 第2圖係為PDF41 7編碼方式生成的一種二維條碼碼圖。 第3圖係為本發明的簡易矩陣碼編碼方式生成的一種二維 條碼碼圖。 第4圖係為應用本發明的二維條碼卡的一個實施例的矩陣 行圖元排列格式。 第5圖是本發明的簡易矩陣碼的解碼方法。 圖號簡單說明 10.......上邊界 12.......左邊界 14.......右邊界 16......位元流區 2 0.......定位孔1286706 Brief description of the diagram Figure 1 is a 2D barcode code diagram generated by QR code. Figure 2 is a 2D barcode code diagram generated by the PDF41 7 encoding method. Figure 3 is a two-dimensional bar code code diagram generated by the simple matrix code encoding method of the present invention. Figure 4 is a matrix row element arrangement format of an embodiment of a two-dimensional barcode card to which the present invention is applied. Fig. 5 is a diagram showing a decoding method of the simple matrix code of the present invention. Figure number is a brief description of 10.. Upper boundary 12....Left boundary 14....Right boundary 16...Bit flow area 2 0... .... positioning hole

Claims (1)

1286706 六、申請專利範圍 1 種二維條碼卡, 資訊的 界、左 2 4 矩陣格存儲 圖包括上邊 stream )區 該上邊界是 該左邊界和 孔的矩陣列 該位兀流區 如申請專利 定位孔是一 該左邊界和 陣格的兩側 和白矩陣格 如申請專利 其中,該位 括多個矩陣 如申請專利 其中,該位 上至下排列 左排列。 如申請專利 其中,該矩 R2/R1*L &gt;二 該R 1為在該 位於碼 右邊界 位於左 範圍第 個白矩 右邊界 各是一 組合排 範圍第 兀流區 行及改 範圍第 元流區 ,或者 範圍第 陣格的 4 載體上 其包括載體和附著在載體上,利用 二維條碼碼圖,其特徵在於:該碼 邊界、右邊界、以及位元流(b i t 圖沿送紙方向最前方的矩陣行; 是分別位於碼圖兩側最外沿具定位 右邊 1項 陣格 分別 列黑 列。 1項 包括 錯碼 1項 中資 是以 界之間、上邊界之下。 所述之二維條碼卡,其中,該 ;該上邊界是一行黑矩陣格; 包括三列矩陣格,而其三列矩 矩陣格,中間一列是黑矩陣格 或第2項所述之二維條碼卡, 多個資訊塊,而資訊塊中係包 〇 或第2項所述之二維條碼卡, 訊的排放方式可以行為主,從 列為主,從左至右、或從右至 1項或第2項所述之二維條碼卡, 邊長根據以下公式選取: 印刷碼圖時的解析度;1286706 VI. Patent application scope 1 type 2D barcode card, information boundary, left 2 4 matrix grid storage map including upper stream) area The upper boundary is the matrix column of the left boundary and the hole. The hole is a left border and a side of the array and a white matrix lattice as in the patent application, wherein the position includes a plurality of matrices as in the patent application, wherein the position is arranged vertically from left to right. For example, in the patent application, the moment R2/R1*L &gt; 2, the R 1 is the first white moment in the left range at the right edge of the code, and the right boundary is a combined row range turbulent zone row and a modified range element The flow zone, or the range of the 4th frame, includes a carrier and is attached to the carrier, and utilizes a two-dimensional bar code code map, which is characterized by: the code boundary, the right boundary, and the bit stream (bit map along the paper feed direction) The foremost matrix row; is located at the outermost edge of the code graph, and has the right column of the first row of the positioning column, respectively. The 1 item includes the error code 1 item is between the boundary and the upper boundary. a two-dimensional barcode card, wherein: the upper boundary is a row of black matrix lattices; comprising three columns of matrix lattices, and three columns of matrix matrices, the middle column is a black matrix grid or the two-dimensional barcode card of item 2 , multiple information blocks, and the information block contains the two-dimensional bar code card described in item 2, and the emission method of the message can be the main action, from the main column, from left to right, or from right to one or The two-dimensional barcode card described in item 2, the length of the side is according to the following formula Select: the resolution when printing the code map; 第16頁Page 16 1286706 六、申請專利範圍 R 2為圖像感測器讀取碼圖時的解析度; L為矩陣格的設計邊長。 6 ·如申請專利範圍第1項或第2項所述之二維條碼卡, 其中,該載體上的碼圖的左邊界之左邊和右邊界之右 邊有空白區。 7 · —種二維條碼解碼方法,將附著在載體上,利用矩陣 格存儲資訊的二維條碼碼圖恢復成二進位資訊,其包 括如下步驟: A ·探測碼圖的上邊界,計算並保存上邊界的傾斜度 9 B ·探測碼圖的左邊界和右邊界,並根據上邊界的傾 斜度估算出第一對定位孔的區域; C ·在估算的區域中統計白像素的數量,計算出第一 對定位孔的中心座標; D ·計算出第一對定位孔之間、在一條直線上間距為 一個矩陣格邊長的矩陣格的中心座標,並根據該 中心座標從圖像中讀取每個矩陣格1位元(b i t )的位元流資訊; E ·根據前一對定位孔的中心座標,以及矩陣格的邊 長估計其下一對定位孔的區域,並且從中探測計 算出定位孔的中心座標,如果定位孔的中心座標 探測不成功則結束碼圖解讀,否則進入下一步; F ·根據該對定位孔的中心座標計算,並保存其之間 的矩陣格的中心座標,並根據所述中心座標讀取1286706 VI. Patent Application Range R 2 is the resolution of the image sensor when reading the code map; L is the design side length of the matrix grid. 6. The two-dimensional barcode card of claim 1 or 2, wherein the left side of the left border of the code pattern on the carrier and the right side of the right border have a blank area. 7 · A two-dimensional barcode decoding method, which is attached to the carrier and restored to the binary information by using the matrix to store the information of the two-dimensional barcode code, which includes the following steps: A. The upper boundary of the detection code map is calculated and saved. The slope of the upper boundary is 9 B · The left and right boundaries of the code map are estimated, and the area of the first pair of positioning holes is estimated according to the inclination of the upper boundary; C · The number of white pixels is counted in the estimated area, and the calculation is performed. The center coordinate of the first pair of positioning holes; D · Calculate the center coordinates of the matrix lattice between the first pair of positioning holes, which are spaced apart by a matrix on one line, and read from the image according to the center coordinates Bit stream information of 1 bit (bit) of each matrix; E · Estimating the area of the next pair of positioning holes according to the central coordinates of the previous pair of positioning holes and the side length of the matrix, and calculating the positioning from the detection The center coordinate of the hole, if the center coordinate of the positioning hole is unsuccessful, the code map is interpreted, otherwise it will enter the next step; F · Calculate according to the center coordinate of the pair of positioning holes, and save between them Central coordinate grid matrix, and according to the center coordinate reading 1286706 六、申請專利範圍 相應位置的位元流資訊; G ·根據保存的兩行矩陣格的中心座標計算兩行之間 的所有矩陣格的座標,並讀取相應矩陣格的位元 流資訊; Η ·回到步驟E。 8 ·如申請專利範圍第7項所述之二維條碼解碼方法,其 中,在步驟C中,當白像素的個數大於(Ν-1)* (Μ-ΐ ) 、小於(Ν + 1 ) * ( Μ + 1 )時,則認為該區域内有一 個有效的定位孔,其中Ν、Μ為矩陣格的兩邊之長。 9 ·如申請專利範圍第7項所述之二維條碼解碼方法,其 中,在步驟D中讀出碼圖中的總行數資訊,並根據總 行數結束解碼。 1 0 ·如申請專利範圍第7項所述之二維條碼解碼方法, 其中,每讀取(S + Ε )個位元組資訊後進行糾錯 運算,輸出糾錯成功的S個位元組的正嫁資訊。1286706 6. The bit stream information of the corresponding position of the patent application scope; G · Calculate the coordinates of all the matrix cells between the two rows according to the central coordinates of the saved two-row matrix lattice, and read the bit stream information of the corresponding matrix lattice; Η · Go back to step E. 8. The two-dimensional barcode decoding method according to claim 7, wherein in step C, when the number of white pixels is greater than (Ν-1)*(Μ-ΐ), less than (Ν + 1) * ( Μ + 1 ), it is considered that there is a valid positioning hole in the area, where Ν and Μ are the lengths of the two sides of the matrix. 9. The two-dimensional barcode decoding method according to claim 7, wherein in step D, the total line number information in the code map is read, and the decoding is ended according to the total number of lines. 1 0. The two-dimensional barcode decoding method according to claim 7, wherein each time (S + Ε ) of the byte information is read, an error correction operation is performed, and the S-bits for successful error correction are output. Married information.
TW91134672A 2002-11-28 2002-11-28 Two-dimensional barcode card and the decoding method TWI286706B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
TW91134672A TWI286706B (en) 2002-11-28 2002-11-28 Two-dimensional barcode card and the decoding method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
TW91134672A TWI286706B (en) 2002-11-28 2002-11-28 Two-dimensional barcode card and the decoding method

Publications (2)

Publication Number Publication Date
TW200409043A TW200409043A (en) 2004-06-01
TWI286706B true TWI286706B (en) 2007-09-11

Family

ID=39459370

Family Applications (1)

Application Number Title Priority Date Filing Date
TW91134672A TWI286706B (en) 2002-11-28 2002-11-28 Two-dimensional barcode card and the decoding method

Country Status (1)

Country Link
TW (1) TWI286706B (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9501625B2 (en) 2012-09-10 2016-11-22 National Cheng Kung University Assistance system and method for taking medicine
TWI603590B (en) * 2008-10-10 2017-10-21 微軟技術授權有限責任公司 Method and digital media decoder for reducing dc gain mismatch and dc leakage
TWI676936B (en) * 2018-06-06 2019-11-11 偉詮電子股份有限公司 Barcode detection method and barcode detection system
US10872257B2 (en) 2018-06-06 2020-12-22 Weltrend Semiconductor Inc. Barcode detection method and barcode detection system for increasing detection efficiency

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
TWI391862B (en) * 2008-06-06 2013-04-01 Elan Microelectronics Corp A two-dimensional dot code, a decoding apparatus, and a method thereof

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
TWI603590B (en) * 2008-10-10 2017-10-21 微軟技術授權有限責任公司 Method and digital media decoder for reducing dc gain mismatch and dc leakage
US9501625B2 (en) 2012-09-10 2016-11-22 National Cheng Kung University Assistance system and method for taking medicine
TWI676936B (en) * 2018-06-06 2019-11-11 偉詮電子股份有限公司 Barcode detection method and barcode detection system
US10650204B2 (en) 2018-06-06 2020-05-12 Weltrend Semiconductor Inc. Barcode detection method and barcode detection system for increasing detection efficiency by using gray level flip counts
US10872257B2 (en) 2018-06-06 2020-12-22 Weltrend Semiconductor Inc. Barcode detection method and barcode detection system for increasing detection efficiency

Also Published As

Publication number Publication date
TW200409043A (en) 2004-06-01

Similar Documents

Publication Publication Date Title
JP4564813B2 (en) Two-dimensional barcode and code decoding method thereof
US7198194B2 (en) Two-dimensional code having superior decoding properties making it possible to control the level of error correcting codes, and a method for encoding and decoding the same
US10679175B2 (en) Two-dimensional code, system for creation of two-dimensional code, and analysis program
JP2005267598A5 (en)
JP4294025B2 (en) Method for generating interface surface and method for reading encoded data
EP2849115B1 (en) Method for decoding matrix-type two-dimensional code
JP4752413B2 (en) Two-dimensional code division display method, two-dimensional code reading method, and two-dimensional code reading apparatus
KR20060076160A (en) System and method for encoding high density geometric symbol set
CN106778996A (en) It is embedded with the generation system and method and reading system of the Quick Response Code of visual pattern
KR20090018811A (en) Multi-dimensional symbologies and related methods
CA2340882A1 (en) Method for embedding non-intrusive encoded data in printed matter and system for reading same
CN101398885A (en) Code reading device and code reading method
US8376235B2 (en) Blur resistant barcode
CN100356399C (en) Two-dimensional barcode card and its decoding method
TWI286706B (en) Two-dimensional barcode card and the decoding method
JP5676183B2 (en) Bar code reading apparatus and bar code reading method
JP4865844B2 (en) Two-dimensional code reading method, two-dimensional code for reading by the two-dimensional code reading method, and recording medium on which the two-dimensional code reading method is recorded
AU2010257220B2 (en) Data block offset encoding method for coordinates
WO2013027234A1 (en) Satellite dot type two-dimensional code and method for reading same
JP5187382B2 (en) Two-dimensional code division display method, two-dimensional code reading method, and two-dimensional code reading apparatus
CN102142077A (en) Data reader, data reading method and data recorder
JP3499183B2 (en) Digital information record carrier, digital information recording method and apparatus, and digital information decoding method and apparatus
CN112561014A (en) Encoding and decoding method for one-dimensional bar code
JP3504366B2 (en) Symbol information reading device
WO2012035552A2 (en) Generating a code system using haar wavelets

Legal Events

Date Code Title Description
MM4A Annulment or lapse of patent due to non-payment of fees