JP2798013B2 - Two-dimensional code reading method and apparatus - Google Patents

Two-dimensional code reading method and apparatus

Info

Publication number
JP2798013B2
JP2798013B2 JP7216265A JP21626595A JP2798013B2 JP 2798013 B2 JP2798013 B2 JP 2798013B2 JP 7216265 A JP7216265 A JP 7216265A JP 21626595 A JP21626595 A JP 21626595A JP 2798013 B2 JP2798013 B2 JP 2798013B2
Authority
JP
Japan
Prior art keywords
dimensional code
center position
coordinates
candidate
processing step
Prior art date
Legal status (The legal status 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 status listed.)
Expired - Fee Related
Application number
JP7216265A
Other languages
Japanese (ja)
Other versions
JPH0962764A (en
Inventor
千明 戸高
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Nippon Chemi Con Corp
Original Assignee
Nippon Chemi Con Corp
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 Nippon Chemi Con Corp filed Critical Nippon Chemi Con Corp
Priority to JP7216265A priority Critical patent/JP2798013B2/en
Publication of JPH0962764A publication Critical patent/JPH0962764A/en
Application granted granted Critical
Publication of JP2798013B2 publication Critical patent/JP2798013B2/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Description

【発明の詳細な説明】DETAILED DESCRIPTION OF THE INVENTION

【0001】[0001]

【発明の属する技術分野】本発明は、各種の商品やその
他の物品またはこれらの包装等に表記されて、商品名等
の多彩な情報を表示する2次元コードの読取り方法及び
装置に関する。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a method and an apparatus for reading a two-dimensional code which displays various information such as a product name on various kinds of products or other articles or their packaging.

【0002】[0002]

【従来の技術】従来、この種の情報表示コードとして、
1次元バーコードが広く実施されている。この1次元バ
ーコードは、太・細バー・スペースの組合わせによりデ
ータを認識するように構成したものである。
2. Description of the Related Art Conventionally, as this kind of information display code,
One-dimensional barcodes are widely practiced. The one-dimensional barcode is configured to recognize data by a combination of a thick bar, a thin bar, and a space.

【0003】しかるに、このようなデータの認識を行う
1次元バーコードに対しては、コードの読取りに際し
て、印字精度に敏感となり、また誤り復元能力がないた
め、印字精度が少し悪かったり、汚れが付着している
と、読取り不能となることが多い。
However, a one-dimensional bar code for recognizing such data becomes sensitive to printing accuracy when reading the code, and has no error restoring ability. If they are attached, they often become unreadable.

【0004】このため、1次元バーコードでは、電子部
品、高密度実装基板、小型部品等にマーキングするスペ
ースがなく、十分な管理システムを構築することができ
ない。
[0004] Therefore, with a one-dimensional bar code, there is no space for marking electronic components, high-density mounting boards, small components, and the like, and a sufficient management system cannot be constructed.

【0005】また、1次元バーコードは、入力データ量
を増やすと、より大きなマーキングスペースを要し、ラ
ベル寸法も大きくなり、また多段化すると入力の手間も
増えることになる。
[0005] In addition, a one-dimensional barcode requires a larger marking space when the amount of input data is increased, and a label size is also increased.

【0006】さらに、電子部品、医療器具、セラミック
部品、金属部品等をコード管理する場合、前記1次元バ
ーコードを印刷したラベル貼着方式は実用的でないた
め、レーザーマーカー等でコードを直接マーキングする
ことが簡便であるが、1次元バーコードでは読取り率が
良くない難点がある。
Further, when managing codes of electronic parts, medical instruments, ceramic parts, metal parts, and the like, since the labeling method in which the one-dimensional bar code is printed is not practical, the codes are directly marked with a laser marker or the like. However, the one-dimensional barcode has a drawback that the reading rate is not good.

【0007】そして、1次元バーコードは、データベー
スを検索するためのIDコードでしかないため、1次元
バーコードシステムでは、アクセスネットワークの構築
やデータベースの更新が必要になり、導入・管理コスト
が増大する。
[0007] Since the one-dimensional barcode is only an ID code for searching the database, the one-dimensional barcode system requires the construction of an access network and the updating of the database, and the introduction and management costs increase. I do.

【0008】そこで、近年においては、前述した多くの
問題点を有する1次元バーコードに代えて、ダイナミッ
クに可変な2次元のマトリックスコードが提案された。
すなわち、この2次元コードは、白黒のセルからなるマ
トリックスとして表示され、これは0と1との2進数か
らなるコンピュータ言語である。
Therefore, in recent years, a dynamically variable two-dimensional matrix code has been proposed instead of the one-dimensional bar code having many problems described above.
That is, the two-dimensional code is displayed as a matrix of black and white cells, which is a computer language consisting of binary numbers 0 and 1.

【0009】従って、この2次元コードは、そのマトリ
ックスを実際にコード化された情報に応じて、ダイナミ
ックに拡大したり縮小したりすることができる。また、
この2次元コードは、その対象物に対して、コンピュー
タプリンタ、ラベル作成機、レーザービーム、化学的エ
ッチング、リソグラフ、フレキソグラフ、写真製版等に
よるプリントが可能である。そして、これらのプリント
された2次元コードは、CCDカメラにより簡便に読取
ることができる。
Therefore, this two-dimensional code can dynamically expand and contract its matrix in accordance with the actually coded information. Also,
The two-dimensional code can be printed on the object by a computer printer, a label making machine, a laser beam, chemical etching, lithography, flexography, photoengraving, or the like. These printed two-dimensional codes can be easily read by a CCD camera.

【0010】しかも、この2次元コードは、大小の寸法
を幅広く採用することができると共に、1文字から約
2,000文字までコード化することができるばかりで
なく、この2次元コードの読取りに際してのエラーの発
生率もきわめて少なくなるという利点を有している。
In addition, the two-dimensional code can adopt a large and small size widely, and can not only encode one character to about 2,000 characters, but also read the two-dimensional code. There is an advantage that the error occurrence rate is extremely low.

【0011】[0011]

【発明が解決しようとする課題】しかるに、従来より2
次元コードを読み取る手段として、種々の装置が知られ
ている。例えば、ガン式レーザスキャナ、ラスタスキャ
ン型ガン式レーザスキャナあるいはエリアセンサ式スキ
ャナ等である。
SUMMARY OF THE INVENTION However, the prior art
Various devices are known as means for reading a dimensional code. For example, a gun type laser scanner, a raster scan type gun type laser scanner, an area sensor type scanner or the like is used.

【0012】しかしながら、前者等のガン式レーザスキ
ャナは、レーザビームの方向や範囲が、2次元コードの
方向や範囲と一致するように、操作者が目で確認しつつ
読取り操作を行わなければならず、操作者の読取り作業
が面倒となり、また読取り効率も低下するという難点が
あった。
However, in the former gun type laser scanner, the operator must perform a reading operation while visually confirming that the direction and range of the laser beam match the direction and range of the two-dimensional code. However, there is a problem that the reading operation of the operator is troublesome and the reading efficiency is reduced.

【0013】また、後者のエリアセンサ式スキャナは、
構成そのものは自動読取りが可能なために、操作者の読
取り作業の面倒が無くなる利点はあるが、エリアセンサ
の素子配列方向に対して2次元コードの画像が傾斜して
結像する場合が多く発生し、このような場合に実質的な
解像度が低下して、高密度に記録されたコードの読取り
が困難となる難点があった。
The latter area sensor type scanner is
Although the configuration itself is capable of automatic reading, it has the advantage of eliminating the trouble of reading work by the operator, but the image of the two-dimensional code is often inclined and formed with respect to the element array direction of the area sensor. However, in such a case, there is a problem that the resolution is reduced substantially and it becomes difficult to read a code recorded at high density.

【0014】そこで、本発明の目的は、2次元コード
を、比較的簡単な処理操作によって、良好な解像度で効
率良く読取りかつ正確にデコードすることができる2次
元コードの読取り方法および装置を提供することにあ
る。
An object of the present invention is to provide a method and apparatus for reading a two-dimensional code which can efficiently read and decode a two-dimensional code efficiently with a good resolution by a relatively simple processing operation. It is in.

【0015】[0015]

【課題を解決するための手段】前記目的を達成するため
に、本発明に係る2次元コードの読取り方法は、2次元
コードを含む画像データから2次元コードの概略中心位
置候補の抽出を行い、所要の2次元コードの中心位置候
補群の決定を行う第1の処理工程と、前記第1の処理工
程で抽出された2次元コードの概略中心位置候補群を利
用して、2次元コードのガイドラインを探索して2次元
コードの4つの角座標を決定を行う第2の処理工程と、
前記第2の処理工程で求めた4つの角座標から2次元コ
ードのマトリクスの対応する座標を計算し、その画素値
から0または1のバイナリデータを判別し、さらにこの
マトリクスデータから2次元コードの規格に従って文字
データに変換するデコード処理を行う第3の処理工程と
を備えることを特徴とする。
In order to achieve the above object, a method for reading a two-dimensional code according to the present invention comprises extracting a candidate for the approximate center position of a two-dimensional code from image data containing the two-dimensional code, A first processing step of determining a required center position candidate group of the two-dimensional code, and a guideline of the two-dimensional code using the rough center position candidate group of the two-dimensional code extracted in the first processing step A second processing step of searching for and determining four corner coordinates of the two-dimensional code;
The corresponding coordinates of the matrix of the two-dimensional code are calculated from the four corner coordinates obtained in the second processing step, 0 or 1 binary data is determined from the pixel value, and the two-dimensional code of the two-dimensional code is determined from the matrix data. And a third processing step of performing a decoding process of converting the data into character data according to a standard.

【0016】この場合、前記第1の処理工程は、画像デ
ータから凹凸関数を作成して画像データのX方向および
Y方向の画素値の凹凸度を測定し、次いで前記凹凸度関
数からフィルタ長で移動平均して平滑化関数により画像
データの平滑化処理を行い、さらに前記平滑化関数から
条件付き極大値の座標を抽出して、2次元コードの中心
位置候補群の決定を行うように構成することができる。
In this case, in the first processing step, a concavo-convex function is created from the image data to measure the concavity and convexity of the pixel values in the X and Y directions of the image data, and then the filter length is calculated from the concavo-convexity function. The moving average is applied to perform smoothing processing of the image data by the smoothing function, and further, the coordinates of the conditional maximum value are extracted from the smoothing function to determine the center position candidate group of the two-dimensional code. be able to.

【0017】また、前記第2の処理工程は、概略中心位
置候補群の1つの候補座標から、2次元コードのもつガ
イドラインとクワイエットゾーンを利用して、ガイドラ
インと思われる線分の候補群を求め、次いで前記ガイド
ライン候補群から2次元コードのガイドラインの直交性
を利用して4つの候補座標群を計算し、そして前記4つ
の角候補群から幾つかの整合性をチェックして候補点を
ふるい落とし、4つの角座標の決定を行うように構成す
ることができる。
In the second processing step, a candidate group of line segments considered to be a guideline is obtained from one candidate coordinate of the approximate center position candidate group using a guide line and a quiet zone of the two-dimensional code. Then, four candidate coordinate groups are calculated from the guideline candidate group using the orthogonality of the guideline of the two-dimensional code, and some consistency is checked from the four corner candidate groups to remove candidate points, It can be configured to determine four corner coordinates.

【0018】一方、前記方法を実施するための本発明に
係る2次元コードの読取り装置は、CCDカメラにより
2次元コードを含む画像データを取込む手段と、得られ
た画像データから2次元コードの概略中心位置候補の抽
出を行う手段と、抽出された概略中心位置候補群を利用
して2次元コードの4つの角座標を決定する手段と、決
定された4つの角座標から2次元コードのマトリクスに
対応する座標を計算し、その画素値から0または1のバ
イナリデータを判別し、さらにこのマトリクスデータか
ら2次元コードの規格に従って文字データに変換するデ
コード処理をする手段とから構成することを特徴とす
る。
On the other hand, a two-dimensional code reading apparatus according to the present invention for carrying out the above-mentioned method comprises means for taking in image data including a two-dimensional code by a CCD camera, and two-dimensional code conversion from the obtained image data. Means for extracting approximate center position candidates, means for determining four corner coordinates of a two-dimensional code using the extracted group of approximate center positions, and a matrix of two-dimensional code from the determined four corner coordinates Means for calculating coordinates corresponding to the pixel data, discriminating 0 or 1 binary data from the pixel values, and further performing decoding processing for converting the matrix data into character data in accordance with the two-dimensional code standard. And

【0019】[0019]

【実施例】次に、本発明に係る2次元コードの読取り方
法につき、この方法を実施する装置との関係において、
添付図面を参照しながら以下詳細に説明する。
DESCRIPTION OF THE PREFERRED EMBODIMENTS Next, a method for reading a two-dimensional code according to the present invention will be described in relation to an apparatus for implementing the method.
This will be described in detail below with reference to the accompanying drawings.

【0020】図1は、本発明に係る2次元コードの読取
り方法を実施する装置の概略構成図である。すなわち、
図1に示す装置構成は、基本的にカメラ装置部10と、
画像処理装置部20と、コンピュータ処理部30とから
構成される。
FIG. 1 is a schematic configuration diagram of an apparatus for implementing a two-dimensional code reading method according to the present invention. That is,
The device configuration shown in FIG. 1 basically includes a camera device unit 10,
It comprises an image processing unit 20 and a computer processing unit 30.

【0021】しかるに、前記カメラ装置部10は、カメ
ラ固定治具12にCCDカメラ14を取付け、このCC
Dカメラ14の画像入力側にレンズ16および照明器具
18を設けた構成からなる。なお、前記CCDカメラ1
4の動作電源および照明器具18の電源は、それぞれ画
像処理装置部20に設けられている。
However, the camera unit 10 mounts a CCD camera 14 on a camera fixing jig 12 and
It has a configuration in which a lens 16 and a lighting device 18 are provided on the image input side of the D camera 14. The CCD camera 1
The operation power supply 4 and the power supply of the lighting fixture 18 are provided in the image processing device unit 20, respectively.

【0022】そこで、前記画像処理装置部20は、前記
CCDカメラ14の画像出力を信号ライン19を介して
入力するように接続された画像処理装置22と、CCD
カメラ用電源部24および照明用電源部26と、CRT
ディスプレイからなるモニタ装置28とから構成され
る。
The image processing unit 20 includes an image processing unit 22 connected to input an image output from the CCD camera 14 via a signal line 19, and a CCD.
Camera power supply 24 and illumination power supply 26, CRT
And a monitor device 28 comprising a display.

【0023】そして、前記コンピュータ処理部30は、
前記画像処理装置部20とダウンロードケーブル32を
介して接続されるパーソナルコンピュータ34で構成さ
れ、CRTディスプレイ36が付設されている。
The computer processing unit 30
It comprises a personal computer 34 connected to the image processing unit 20 via a download cable 32, and has a CRT display 36 attached.

【0024】次に、前記構成からなる2次元コードの読
取り装置によるデコード処理について説明する。
Next, a decoding process of the two-dimensional code reader having the above-described configuration by the reader will be described.

【0025】カメラ装置部10において、CCDカメラ
14で取込んだモノクロ256階調の画像データから、
画像処理装置部20およびコンピュータ処理部30を介
して2次元コードをデコードするため、次の3つの処理
を実行する。
In the camera unit 10, the image data of 256 grayscale levels captured by the CCD camera 14 is
In order to decode the two-dimensional code via the image processing unit 20 and the computer processing unit 30, the following three processes are executed.

【0026】第1の処理(中心位置候補群の決定処理)
前処理として、2次元コードの概略中心位置候補の抽出
を行う。この処理の目的は、2次元コードの中心位置座
標候補群を決定することである。すなわち、CCDカメ
ラ14から取込んだ画像データは、2次元コードのみが
写っているとは限らず、いろいろな雑音も含まれてい
る。従って、このような画像から2次元コードの特徴を
利用して、中心位置候補群を決定する処理である。
First processing (processing for determining a center position candidate group)
As preprocessing, a candidate for the approximate center position of the two-dimensional code is extracted. The purpose of this process is to determine a group of center position coordinate candidates for the two-dimensional code. That is, the image data captured from the CCD camera 14 does not always include only the two-dimensional code, and includes various noises. Therefore, the center position candidate group is determined from such an image using the features of the two-dimensional code.

【0027】第2の処理(切り出し処理)この処理の目
的は、概略中心位置候補群を利用して、2次元コードの
4つの角座標を決定することである。この処理も、2次
元コードの特徴を利用して、2次元コードのガイドライ
ンを探索し、そこから4つの角座標を計算によって求め
る方法を採る。
Second Processing (Cut-out Processing) The purpose of this processing is to determine four corner coordinates of a two-dimensional code using a group of approximate center position candidates. This process also employs a method of searching for a guideline of a two-dimensional code using characteristics of the two-dimensional code and calculating four corner coordinates therefrom.

【0028】第3の処理(デコード処理)この処理は、
切り出し処理で求めた4つの角座標から2次元コードの
マトリクスの対応する座標を計算し、その画素値から0
または1のバイナリデータを判別する。そして、このマ
トリクスデータから2次元コードの規格に従って文字デ
ータに変換している。この時、2次元コードのデコード
が完全に成功した場合、デコードした文字データを出力
する。しかし、デコードが不完全な場合、次の概略位置
座標から処理を開始する。
Third process (decoding process)
The corresponding coordinates of the matrix of the two-dimensional code are calculated from the four corner coordinates obtained by the clipping process, and 0 is calculated from the pixel value.
Or, determine 1 binary data. The matrix data is converted into character data according to the two-dimensional code standard. At this time, if the decoding of the two-dimensional code is completely successful, the decoded character data is output. However, when the decoding is incomplete, the processing is started from the next approximate position coordinates.

【0029】以上の3つの処理のフローチャートを図2
に示す。
FIG. 2 is a flowchart of the above three processes.
Shown in

【0030】次に、前述した3つの処理について、それ
ぞれ詳細について説明する。
Next, each of the above three processes will be described in detail.

【0031】1.中心位置候補群の決定処理について
の処理においては、例えば図3に示すように、CCDカ
メラ14で取込んだ画像データから、2次元コードの概
略中心位置座標の候補を幾つか挙げることである。図3
においては、4つの概略中心位置候補群1〜4が挙げら
れている。これらの概略中心位置候補群の決定に際して
は、次の3つの処理が行われる。
1. In the process of this <br/> processing for determining the center position candidates, for example, as shown in FIG. 3, the image data taken-in CCD camera 14, some candidates schematic center position coordinates of the two-dimensional code It is to list. FIG.
, Four approximate center position candidate groups 1 to 4 are listed. In determining these approximate center position candidate groups, the following three processes are performed.

【0032】すなわち、図4に示すように、(1) 凹凸度
測定処理、(2) 平滑化処理、(3) 極大値抽出処理を順次
行う。
That is, as shown in FIG. 4, (1) unevenness degree measurement processing, (2) smoothing processing, and (3) local maximum value extraction processing are sequentially performed.

【0033】(1)凹凸度測定処理この凹凸度測定処理
は、画像データPj,kから次式 (1-1),(1-2) に示す
凹凸度関数Wx(j),Wy(j) を作成する処理である。こ
の処理は、図5に示すように、2次元コードがある一定
の間隔で画素値の変化をもっていることに着目して、画
像データのX方向およびY方向の画素値の凹凸度を測定
する処理である。この時、重要なことは、2次元コード
を強調するために、2次元コード1セルの画素数(n−
1)とびに画像データをサンプルすることである。
(1) Asperity degree measurement processing This asperity degree measurement processing is based on the image data Pj, k and the asperity degree functions Wx (j) and Wy (j) shown in the following equations (1-1) and (1-2). Is the process of creating In this processing, as shown in FIG. 5, focusing on the fact that the two-dimensional code has a pixel value change at a certain interval, the degree of unevenness of the pixel values in the X and Y directions of the image data is measured. It is. At this time, it is important that the number of pixels of one cell of the two-dimensional code (n-
1) Sampling of image data at intervals.

【0034】[0034]

【数1】 (Equation 1)

【0035】なお、Wx(j) はX軸方向の凹凸度関数、
Wy(j) はY軸方向の凹凸度関数、ABS(h) はhの絶
対値を返す関数、Pj,k は座標(j,k )の画像データの
画素値である。
Here, Wx (j) is an unevenness degree function in the X-axis direction,
Wy (j) is the unevenness function in the Y-axis direction, ABS (h) is a function that returns the absolute value of h, and Pj, k is the pixel value of the image data at the coordinates (j, k).

【0036】(2)平滑化処理この平滑化処理は、図6
に示すように、前述した凹凸度関数Wx(j) ,Wy(j)
から、フィルタ長mで移動平均して、平滑化関数を次式
(1-3),(1-4) により算出する処理である。このフィルタ
長mは、図5に示したように、2次元コードのマトリク
スのセル数を表わすものである。
(2) Smoothing processing This smoothing processing is shown in FIG.
As shown in the above, the above-mentioned unevenness degree functions Wx (j) and Wy (j)
From above, moving average is performed with the filter length m, and the smoothing function is
This is a process calculated by (1-3) and (1-4). The filter length m represents the number of cells in a two-dimensional code matrix as shown in FIG.

【0037】[0037]

【数2】 (Equation 2)

【0038】(3)極大値抽出処理この極大値抽出処理
は、前述した平滑化関数をFx(j) ,Fy(j) から、そ
れぞれ条件付き極大値の座標(Xi,Yj )を抽出する処
理である。ここでの条件は、図7に示すように、最大値
の1/2未満の極大値を抽出しないということである。
従って、図8に示すように、概略中心位置候補は、Fx
(j) で抽出された極大値の個数NxとFy(j) で抽出さ
れた個数Nyの積の数だけ存在する。
(3) Maximum value extraction processing This maximum value extraction processing is processing for extracting the coordinate (Xi, Yj) of the conditional maximum value from the smoothing function Fx (j) and Fy (j), respectively. It is. The condition here is that, as shown in FIG. 7, a local maximum value less than 1/2 of the maximum value is not extracted.
Therefore, as shown in FIG. 8, the approximate center position candidate is Fx
There are as many as the product of the number Nx of the maximum values extracted in (j) and the number Ny extracted in Fy (j).

【0039】2.切り出し処理についてこの切り出し処
理は、前述したようにして得られた概略中心位置を基に
して、2次元コードの4つの角座標を決定する処理であ
る。この処理のフローチャートを示せば、図9に示す通
りであり、従ってこの処理においては、次の3つの処理
が行われる。
[0039] 2. The clipping processing for clipping process is a process based on the general center position obtained as described above, to determine the four angular coordinates of the two-dimensional code. A flowchart of this process is as shown in FIG. 9. Therefore, in this process, the following three processes are performed.

【0040】すなわち、図9に示すように、(1) ガイド
ラインのサーチ、(2) 直交性のチェック、(3) 4つの角
座標の決定を順次行う。
That is, as shown in FIG. 9, (1) a guideline search, (2) orthogonality check, and (3) determination of four corner coordinates are sequentially performed.

【0041】(1)ガイドラインのサーチこの処理にお
いては、ガイドラインらしい線分の抽出を行う。従っ
て、この場合、概略中心位置候補群の1つの候補座標
(Xc,Yc)から、2次元コードのもつガイドライン
とクワイエットゾーンを利用して、ガイドラインと思わ
れる線分の候補群を求める処理を行う。すなわち、図1
0に示すように、座標(Xc,Yc)を中心とし、半径
L/2の基本円と、X軸方向で接する2本の線(スキャ
ン1,スキャン2)に沿って画素値を抽出して行く。こ
の時、エッジ条件に合った座標をレジスタに格納してお
く。
(1) Guideline Search In this process, a line segment that is likely to be a guideline is extracted. Accordingly, in this case, a process of obtaining a candidate group of line segments that are considered to be guide lines from one candidate coordinate (Xc, Yc) of the approximate center position candidate group is performed using the guide line and the quiet zone of the two-dimensional code. . That is, FIG.
As shown in FIG. 0, pixel values are extracted along two lines (scan 1 and scan 2) that are centered on the coordinates (Xc, Yc) and are in contact with the basic circle having a radius of L / 2 in the X-axis direction. go. At this time, coordinates matching the edge condition are stored in a register.

【0042】しかるに、スキャン1とスキャン2で抽出
したエッジ座標を結んだ線分が、ライン(黒太線)とな
っているかどうかを、図11に示すように、スレッシュ
ホールド値(しきい値)を決めて、線分上の画素値を調
べ、チェックする。これにより、ラインであることが確
認されれば、ガイドライン候補群に加える。
As shown in FIG. 11, a threshold value (threshold value) is determined as to whether or not a line segment connecting the edge coordinates extracted in scan 1 and scan 2 is a line (thick black line). Then, the pixel value on the line segment is checked and checked. As a result, if the line is confirmed, it is added to the guideline candidate group.

【0043】この処理を、図12に示す方向1から8ま
で行う。この時のガイドライン候補群の線分1〜Nは、
次の通りである。
This processing is performed from directions 1 to 8 shown in FIG. The line segments 1 to N of the guideline candidate group at this time are:
It is as follows.

【0044】線分1 (X10, Y10),(X11, Y11)
線分2 (X20, Y20),(X21, Y21)線分3 (X
30, Y30),(X31, Y31)線分n (Xn0, Yn0),
(Xn1, Yn1)線分N (XN0, YN0),(XN1, YN
1)
Line 1 (X10, Y10), (X11, Y11)
Line segment 2 (X20, Y20), (X21, Y21) Line segment 3 (X
30, Y30), (X31, Y31) line segment n (Xn0, Yn0),
(Xn1, Yn1) line segment N (XN0, YN0), (XN1, YN
1)

【0045】また、この処理のフローチャートを示せ
ば、図13に示す通りである。
FIG. 13 is a flowchart of this process.

【0046】(2)直交性のチェックこの処理において
は、方程式化した線分の直交性をチェックする。従っ
て、この場合、前述したガイドライン候補群から、2次
元コードのガイドラインの直交性を利用して、4つの候
補(座標)群を計算する処理を行う。この場合、図14
に示すように、抽出ラインnとmのなす角度θを次式(2
-1),(2-1.1),(2-1.2) によって計算する。
(2) Checking the orthogonality In this process, the orthogonality of the line segment expressed as an equation is checked. Therefore, in this case, a process of calculating four candidate (coordinate) groups from the guideline candidate group described above using the orthogonality of the guideline of the two-dimensional code is performed. In this case, FIG.
, The angle θ between the extraction lines n and m is given by the following equation (2).
-1), (2-1.1), (2-1.2).

【0047】[0047]

【数3】 (Equation 3)

【0048】そして、前記式(2-1) 式により、θがほぼ
90度であれば、その交点(Xcj,Ycj)を、次式(2-
2),(2-2.1),(2-2.2),(2-2.3),(2-2.4) により計算す
る。
According to the above equation (2-1), if θ is approximately 90 degrees, the intersection (Xcj, Ycj) is calculated by the following equation (2-c).
2) Calculate using (2-2.1), (2-2.2), (2-2.3), and (2-2.4).

【0049】[0049]

【数4】 (Equation 4)

【0050】このようにして、前記式(2-2) により得ら
れた結果を、次の1〜N点(座標)に基づき4つの角候
補群に加える。
The result obtained by the above equation (2-2) is added to four corner candidate groups based on the following 1 to N points (coordinates).

【0051】点1 (Xc1,Yc1) 点2 (Xc2,Yc2) 点3 (Xc3,Yc3) 点n (Xcn,Ycn) 点N (XcN,YcN)Point 1 (Xc1, Yc1) Point 2 (Xc2, Yc2) Point 3 (Xc3, Yc3) Point n (Xcn, Ycn) Point N (XcN, YcN)

【0052】また、この処理のフローチャートを示せ
ば、図15に示す通りである。
FIG. 15 is a flowchart of this process.

【0053】(3)4つの角座標の決定 この処理においては、整合性の確認と座標予測とを行
う。すなわち、この場合、前述した4つの角候補群から
幾つかの整合性をチェックして、候補点をふるい落と
し、4つの角座標を決定する処理を行う。ここでの整合
性は、角度チェックと距離チェックとを適用する。
(3) Determination of Four Corner Coordinates In this process, the consistency is confirmed and the coordinates are predicted. That is, in this case, some consistency is checked from the four corner candidate groups described above, candidate points are eliminated, and a process of determining four corner coordinates is performed. Here, for the consistency, an angle check and a distance check are applied.

【0054】まず、角度チェックは、図16に示すよう
に、4つの角ならば中心位置からの角度が45度以下に
ならないということを利用して、候補点をふるい落とす
処理である。この場合、例えば図17に示すように、点
2と点4とが落とされる。
First, as shown in FIG. 16, the angle check is a process of eliminating candidate points by utilizing the fact that the angle from the center position does not become 45 degrees or less if there are four angles. In this case, for example, points 2 and 4 are dropped as shown in FIG.

【0055】次に、距離チェックは、4つの角のそれぞ
れの距離が定数値であることを利用して、候補点をふる
い落とす処理である。
Next, the distance check is a process of sifting out candidate points using the fact that the distances of the four corners are constant values.

【0056】以上の整合性のチェックで生き残った候補
点が、以下に示す4つの角座標である。
The candidate points that survive the above consistency check are the following four corner coordinates.

【0057】点1 (Xc1,Yc1) 点2 (Xc2,Yc2) 点3 (Xc3,Yc3) 点4 (Xc4,Yc4)Point 1 (Xc1, Yc1) Point 2 (Xc2, Yc2) Point 3 (Xc3, Yc3) Point 4 (Xc4, Yc4)

【0058】もし、候補点が、4つ未満しか残らなかっ
た場合には、残りを計算によって求める。
If less than four candidate points remain, the remaining points are obtained by calculation.

【0059】これらの処理のフローチャートを示せば、
図18に示す通りである。
If the flowchart of these processes is shown,
This is as shown in FIG.

【0060】3.デコード処理について 前述した切り出し処理において求められた4つの角座標
から、2次元コードのマトリクスの対応する座標を計算
し、その画素値から0または1のバイナリデータを判別
し、さらにこのマトリクスデータから2次元コードの規
格に従って文字データに変換するデコード処理を行うこ
とにより、2次元コードの適正なデコードを簡便かつ迅
速に達成することができる。
[0060] 3. Regarding the decoding process, the corresponding coordinates of the matrix of the two-dimensional code are calculated from the four corner coordinates obtained in the above-described clipping process, 0 or 1 binary data is determined from the pixel value, and 2 By performing the decoding process of converting the data into character data in accordance with the standard of the dimensional code, appropriate decoding of the two-dimensional code can be easily and quickly achieved.

【0061】以上、本発明の好適な実施例についてそれ
ぞれ説明したが、本発明は前記各実施例に限定されるこ
となく、本発明の精神を逸脱しない範囲内において種々
の設計変更をすることができる。
Although the preferred embodiments of the present invention have been described above, the present invention is not limited to the above-described embodiments, and various design changes can be made without departing from the spirit of the present invention. it can.

【0062】[0062]

【発明の効果】以上説明したように、本発明に係る2次
元コードの読取り方法および装置は、2次元コードを含
む画像データから2次元コードの概略中心位置候補の抽
出を行い、所要の2次元コードの中心位置候補群の決定
を行う第1の処理工程と、前記第1の処理工程で抽出さ
れた2次元コードの概略中心位置候補群を利用して、2
次元コードのガイドラインを探索して2次元コードの4
つの角座標を決定を行う第2の処理工程と、前記第2の
処理工程で求めた4つの角座標から2次元コードのマト
リクスの対応する座標を計算し、その画素値から0また
は1のバイナリデータを判別し、さらにこのマトリクス
データから2次元コードの規格に従って文字データに変
換するデコード処理を行う第3の処理工程とを備えた構
成とすることにより、従来より面倒とされたその読取り
およびデコード処理を、比較的簡単な処理操作によっ
て、良好な解像度で効率良くかつ正確に実現することが
できる。
As described above, the method and apparatus for reading a two-dimensional code according to the present invention extracts the approximate center position candidate of the two-dimensional code from the image data including the two-dimensional code, and obtains the required two-dimensional code. A first processing step of determining a group of candidate center positions of the code; and a two-dimensional code using the group of approximate center positions of the two-dimensional code extracted in the first processing step.
Search the guideline of the two-dimensional code and
A second processing step of determining one corner coordinate, and calculating a corresponding coordinate of a matrix of a two-dimensional code from the four corner coordinates obtained in the second processing step, and calculating 0 or 1 binary from the pixel value. A third processing step of discriminating data and converting the matrix data into character data in accordance with the standard of a two-dimensional code; The processing can be realized efficiently and accurately with a good resolution by a relatively simple processing operation.

【図面の簡単な説明】[Brief description of the drawings]

【図1】本発明に係る2次元コードの読取り方法を実施
する装置の概略構成図である。
FIG. 1 is a schematic configuration diagram of an apparatus for implementing a two-dimensional code reading method according to the present invention.

【図2】本発明に係る2次元コードの読取り方法を実施
するプログラムのフローチャート図である。
FIG. 2 is a flowchart of a program for executing a two-dimensional code reading method according to the present invention.

【図3】本発明に係る2次元コードの読取り方法におけ
る概略中心位置候補群の抽出例を示す説明図である。
FIG. 3 is an explanatory diagram showing an example of extracting a group of approximate center position candidates in the two-dimensional code reading method according to the present invention.

【図4】本発明に係る2次元コードの読取り方法におけ
る概略中心位置候補群の抽出を行うプログラムのフロー
チャート図である。
FIG. 4 is a flowchart of a program for extracting a general center position candidate group in the two-dimensional code reading method according to the present invention.

【図5】本発明に係る2次元コードの読取り方法におけ
る2次元コードのセルと画像データの画素数の関係を示
す説明図である。
FIG. 5 is an explanatory diagram showing a relationship between cells of a two-dimensional code and the number of pixels of image data in the two-dimensional code reading method according to the present invention.

【図6】本発明に係る2次元コードの読取り方法におけ
る概略中心位置候補群の抽出された画像データの平滑化
処理を示す波形図である。
FIG. 6 is a waveform diagram showing a smoothing process of image data extracted from a group of approximate center position candidates in the two-dimensional code reading method according to the present invention.

【図7】本発明に係る2次元コードの読取り方法におけ
る概略中心位置候補群の抽出された画像データを平滑化
処理した後の極大値抽出処理を示す波形図である。
FIG. 7 is a waveform diagram showing a local maximum value extraction process after smoothing the extracted image data of the approximate center position candidate group in the two-dimensional code reading method according to the present invention.

【図8】本発明に係る2次元コードの読取り方法におけ
る抽出された概略中心位置候補群の位置座標を示す説明
図である。
FIG. 8 is an explanatory diagram showing position coordinates of an extracted approximate center position candidate group in the two-dimensional code reading method according to the present invention.

【図9】本発明に係る2次元コードの読取り方法におけ
る抽出された概略中心位置候補群の位置座標の切り出し
処理を行うプログラムのフローチャート図である。
FIG. 9 is a flowchart of a program for extracting a position coordinate of an extracted approximate center position candidate group in the two-dimensional code reading method according to the present invention.

【図10】本発明に係る2次元コードの読取り方法にお
ける抽出された概略中心位置候補群の位置座標の切り出
し処理に際してのガイドラインのエッジ抽出を行う方法
を示す説明図である。
FIG. 10 is an explanatory diagram showing a method of extracting an edge of a guideline in a process of extracting position coordinates of an extracted approximate center position candidate group in the two-dimensional code reading method according to the present invention.

【図11】本発明に係る2次元コードの読取り方法にお
ける抽出された概略中心位置候補群の位置座標の切り出
し処理に際しての抽出エッジ間のラインチェックを行う
方法を示す説明図である。
FIG. 11 is an explanatory diagram showing a method of performing a line check between extracted edges in a process of extracting position coordinates of an extracted approximate center position candidate group in the two-dimensional code reading method according to the present invention.

【図12】本発明に係る2次元コードの読取り方法にお
ける抽出された概略中心位置候補群の位置座標の切り出
し処理に際してのガイドラインサーチを行う方法を示す
説明図である。
FIG. 12 is an explanatory diagram showing a method of performing a guideline search in a process of extracting position coordinates of an extracted approximate center position candidate group in the two-dimensional code reading method according to the present invention.

【図13】本発明に係る2次元コードの読取り方法にお
ける抽出された概略中心位置候補群の位置座標の切り出
し処理に際してのガイドラインサーチを行うプログラム
のフローチャート図である。
FIG. 13 is a flowchart of a program for performing a guideline search at the time of extracting position coordinates of the extracted approximate center position candidate group in the two-dimensional code reading method according to the present invention.

【図14】本発明に係る2次元コードの読取り方法にお
ける抽出された概略中心位置候補群の位置座標の切り出
し処理に際してのガイドラインサーチでの2つのガイド
ライン候補群の角度を示す説明図である。
FIG. 14 is an explanatory diagram showing angles of two guideline candidate groups in a guideline search in a process of extracting position coordinates of the extracted approximate center position candidate group in the two-dimensional code reading method according to the present invention.

【図15】本発明に係る2次元コードの読取り方法にお
ける抽出された概略中心位置候補群の位置座標の切り出
し処理に際してのガイドラインの直交性のチェックを行
うプログラムのフローチャート図である。
FIG. 15 is a flowchart of a program for checking the orthogonality of the guideline in the process of extracting the position coordinates of the extracted approximate center position candidate group in the two-dimensional code reading method according to the present invention.

【図16】本発明に係る2次元コードの読取り方法にお
ける抽出された概略中心位置候補群の位置座標としての
4つの角候補点の角度を示す説明図である。
FIG. 16 is an explanatory diagram showing angles of four corner candidate points as position coordinates of an extracted approximate center position candidate group in the two-dimensional code reading method according to the present invention.

【図17】本発明に係る2次元コードの読取り方法にお
ける抽出された概略中心位置候補群の位置座標としての
4つの角候補点の角度によるふるい落としを示す説明図
である。
FIG. 17 is an explanatory diagram showing the sieving by the angles of four corner candidate points as the position coordinates of the extracted approximate center position candidate group in the two-dimensional code reading method according to the present invention.

【図18】本発明に係る2次元コードの読取り方法にお
ける抽出された概略中心位置候補群の位置座標としての
4つの角座標の決定を行うプログラムのフローチャート
図である。
FIG. 18 is a flowchart of a program for determining four corner coordinates as position coordinates of an extracted group of approximate center position candidates in the two-dimensional code reading method according to the present invention.

【符号の説明】[Explanation of symbols]

10 カメラ装置部 12 カメラ固定治具 14 CCDカメラ 16 レンズ 18 照明器具 20 画像処理装置部 22 画像処理装置 24 カメラ用電源部 26 照明用電源部 28 モニタ装置 30 コンピュータ処理部 32 ダウンロードケーブル 34 パーソナルコンピュータ 36 CRTディスプレイ DESCRIPTION OF SYMBOLS 10 Camera apparatus part 12 Camera fixing jig 14 CCD camera 16 Lens 18 Lighting equipment 20 Image processing apparatus part 22 Image processing apparatus 24 Camera power supply part 26 Illumination power supply part 28 Monitoring device 30 Computer processing part 32 Download cable 34 Personal computer 36 CRT display

Claims (4)

(57)【特許請求の範囲】(57) [Claims] 【請求項1】 2次元コードを含む画像データから2次
元コードの概略中心位置候補の抽出を行い、所要の2次
元コードの中心位置候補群の決定を行う第1の処理工程
と、前記第1の処理工程で抽出された2次元コードの概
略中心位置候補群を利用して、2次元コードのガイドラ
インを探索して2次元コードの4つの角座標を決定を行
う第2の処理工程と、前記第2の処理工程で求めた4つ
の角座標から2次元コードのマトリクスの対応する座標
を計算し、その画素値から0または1のバイナリデータ
を判別し、さらにこのマトリクスデータから2次元コー
ドの規格に従って文字データに変換するデコード処理を
行う第3の処理工程とを備えることを特徴とする2次元
コードの読取り方法。
A first processing step of extracting an approximate center position candidate of the two-dimensional code from image data including the two-dimensional code, and determining a required group of center position candidates of the two-dimensional code; A second processing step of searching for a guideline of the two-dimensional code and determining four corner coordinates of the two-dimensional code by using the group of approximate center position candidates of the two-dimensional code extracted in the processing step; The corresponding coordinates of the matrix of the two-dimensional code are calculated from the four corner coordinates obtained in the second processing step, 0 or 1 binary data is determined from the pixel value, and the standard of the two-dimensional code is determined from the matrix data. And a third processing step of performing a decoding process of converting the data into character data according to the following.
【請求項2】 第1の処理工程は、画像データから凹凸
関数を作成して画像データのX方向およびY方向の画素
値の凹凸度を測定し、次いで前記凹凸度関数からフィル
タ長で移動平均して平滑化関数により画像データの平滑
化処理を行い、さらに前記平滑化関数から条件付き極大
値の座標を抽出して、2次元コードの中心位置候補群の
決定を行うように構成してなる請求項1記載の2次元コ
ードの読取り方法。
2. A first processing step comprises: forming a concavo-convex function from image data, measuring the concavity and convexity of pixel values in the X and Y directions of the image data, and then performing a moving average with a filter length from the concavity and convexity function Then, a smoothing function is performed on the image data by the smoothing function, and the coordinates of the conditional maximum value are extracted from the smoothing function to determine a center position candidate group of the two-dimensional code. The method for reading a two-dimensional code according to claim 1.
【請求項3】 第2の処理工程は、概略中心位置候補群
の1つの候補座標から、2次元コードのもつガイドライ
ンとクワイエットゾーンを利用して、ガイドラインと思
われる線分の候補群を求め、次いで前記ガイドライン候
補群から2次元コードのガイドラインの直交性を利用し
て4つの候補座標群を計算し、そして前記4つの角候補
群から幾つかの整合性をチェックして候補点をふるい落
とし、4つの角座標の決定を行うように構成してなる請
求項1記載の2次元コードの読取り方法。
A second processing step of obtaining, from one candidate coordinate of the approximate center position candidate group, a candidate group of line segments considered as a guideline using the guideline and the quiet zone of the two-dimensional code; Next, four candidate coordinate groups are calculated from the guideline candidate group using the orthogonality of the guideline of the two-dimensional code, and some consistency is checked from the four corner candidate groups, and candidate points are eliminated. 2. The method for reading a two-dimensional code according to claim 1, wherein the method is configured to determine two corner coordinates.
【請求項4】 CCDカメラにより2次元コードを含む
画像データを取込む手段と、得られた画像データから2
次元コードの概略中心位置候補の抽出を行う手段と、抽
出された概略中心位置候補群を利用して2次元コードの
4つの角座標を決定する手段と、決定された4つの角座
標から2次元コードのマトリクスに対応する座標を計算
し、その画素値から0または1のバイナリデータを判別
し、さらにこのマトリクスデータから2次元コードの規
格に従って文字データに変換するデコード処理をする手
段とから構成することを特徴とする2次元コードの読取
り装置。
4. A means for capturing image data containing a two-dimensional code by a CCD camera,
Means for extracting approximate center position candidates of the dimensional code, means for determining four corner coordinates of the two-dimensional code using the extracted group of approximate center position candidates, and two-dimensional coordinates from the determined four corner coordinates Means for calculating coordinates corresponding to the code matrix, determining 0 or 1 binary data from the pixel values, and further performing decoding processing for converting the matrix data into character data in accordance with the two-dimensional code standard. An apparatus for reading a two-dimensional code, characterized in that:
JP7216265A 1995-08-24 1995-08-24 Two-dimensional code reading method and apparatus Expired - Fee Related JP2798013B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP7216265A JP2798013B2 (en) 1995-08-24 1995-08-24 Two-dimensional code reading method and apparatus

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP7216265A JP2798013B2 (en) 1995-08-24 1995-08-24 Two-dimensional code reading method and apparatus

Publications (2)

Publication Number Publication Date
JPH0962764A JPH0962764A (en) 1997-03-07
JP2798013B2 true JP2798013B2 (en) 1998-09-17

Family

ID=16685845

Family Applications (1)

Application Number Title Priority Date Filing Date
JP7216265A Expired - Fee Related JP2798013B2 (en) 1995-08-24 1995-08-24 Two-dimensional code reading method and apparatus

Country Status (1)

Country Link
JP (1) JP2798013B2 (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP4588098B2 (en) * 2009-04-24 2010-11-24 善郎 水野 Image / sound monitoring system

Also Published As

Publication number Publication date
JPH0962764A (en) 1997-03-07

Similar Documents

Publication Publication Date Title
EP1456811B1 (en) Reconstruction of virtual raster
EP0669593A2 (en) Two-dimensional code recognition method
EP0338677B1 (en) Image processing method for shape recognition
CN107423652A (en) System and method for document process
JPH0312750B2 (en)
CN111783495B (en) Bar code identification method and device, electronic equipment and storage medium
JP4198392B2 (en) Two-dimensional code reading device, image input device, two-dimensional code reading method, image input method, program thereof, and recording medium recording the program
CN114581442A (en) Product detection method and device for MES system
US20230342575A1 (en) Methods and systems of harvesting data for training machine learning (ml) model
JP2798013B2 (en) Two-dimensional code reading method and apparatus
JP2002150213A (en) Bar code reader
CN109190735B (en) Two-dimensional code generation method, system and device for cylindrical surface
CN115909351B (en) Container number identification method and device based on deep learning
JP2007052471A (en) Two-dimensional pattern reader and two-dimensional pattern reading method
CN114140391A (en) Method for realizing rapid detection of onboard display screen module based on machine vision
JP2000193435A (en) Image processing method for object
CN117152754A (en) Information code identification method, device, equipment and storage medium
CN117392657A (en) Pointer instrument reading identification method, device, equipment and readable storage medium
CN116665196A (en) Weld joint radiographic inspection negative sensitivity identification method, equipment and storage medium
CN117496584A (en) Eyeball tracking light spot detection method and device based on deep learning
JP2514663B2 (en) Optical character reader
CN117788782A (en) Material code identification method, device and system
JPH0252328A (en) Image information reader
CN115588197A (en) Data acquisition system and method based on OCR
CN116109580A (en) Circuit orifice plate detection method and device, electronic equipment and storage medium

Legal Events

Date Code Title Description
S531 Written request for registration of change of domicile

Free format text: JAPANESE INTERMEDIATE CODE: R313531

R350 Written notification of registration of transfer

Free format text: JAPANESE INTERMEDIATE CODE: R350

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20080703

Year of fee payment: 10

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20090703

Year of fee payment: 11

LAPS Cancellation because of no payment of annual fees