JPH07220081A - Segmenting method for graphic of image recognizing device - Google Patents

Segmenting method for graphic of image recognizing device

Info

Publication number
JPH07220081A
JPH07220081A JP6009975A JP997594A JPH07220081A JP H07220081 A JPH07220081 A JP H07220081A JP 6009975 A JP6009975 A JP 6009975A JP 997594 A JP997594 A JP 997594A JP H07220081 A JPH07220081 A JP H07220081A
Authority
JP
Japan
Prior art keywords
dimensional code
straight lines
image
straight line
graphic
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.)
Granted
Application number
JP6009975A
Other languages
Japanese (ja)
Other versions
JP3058791B2 (en
Inventor
Makoto Sugiyama
誠 杉山
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.)
TEC CORP
Original Assignee
TEC 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 TEC CORP filed Critical TEC CORP
Priority to JP6009975A priority Critical patent/JP3058791B2/en
Publication of JPH07220081A publication Critical patent/JPH07220081A/en
Application granted granted Critical
Publication of JP3058791B2 publication Critical patent/JP3058791B2/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Abstract

PURPOSE:To segment a two-dimensional code graphic with such constitution that at least adjacent two or four sides form straight lines or a graphic similar to that at high speed and accurately. CONSTITUTION:A two dimensional image is inputted in step S1, and edge detection is performed in step S2, and straight line sampling is performed by Hough transformation and least square approximation in step S3, and the combination of the straight lines is selected in step S4. In step S5, the size of the graphic is detected, and the sampling of remaining two straight lines are performed in step S6. and image recognition processing is performed in step S7, then, the coordinates of the four sides and four corners of a detection target graphic are decided. Processing is repeated by returning to the combination selection of the straight lines in step S4 until correct straight line detection or graphic recognition are performed in steps S5, S6. and S7.

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 of cutting out a figure of an image recognition device such as a two-dimensional code reading device.

【0002】[0002]

【従来の技術】この種の画像認識装置は、周囲の少なく
とも2辺或いは4辺が直線となる構成のマトリックス状
にデータを配した矩形の2次元コード図形又はそれに類
似した図形を含む画像を読取り、その読取った画像から
2次元コード図形又はそれに類似した図形を切出して認
識するようになっている。
2. Description of the Related Art An image recognition apparatus of this type reads an image containing a rectangular two-dimensional code figure in which data is arranged in a matrix having a configuration in which at least two sides or four sides are straight lines or a figure similar thereto. A two-dimensional code figure or a figure similar thereto is cut out from the read image and is recognized.

【0003】このような画像認識装置では、図12の
(a) に示すように読取った2次元画像1から切出し対象
の2次元図形2の位置を検出するようにしているが、こ
の位置検出には例えば特公昭62−3475号公報に見
られるようなパターンマッチング法がよく用いられてい
る。
In such an image recognition apparatus, as shown in FIG.
As shown in (a), the position of the two-dimensional figure 2 to be cut out is detected from the read two-dimensional image 1. This position detection is found in, for example, Japanese Patent Publication No. 62-3475. The pattern matching method is often used.

【0004】このパターンマッチング法は、図12の
(b) に示すような複数の標準パターン3,3,…を使用
し、この標準パターン3により2次元画像1をスキャン
し、その類似度を数値として表現し、得られる数値が2
次元画像1の数値に近い部分を切出して対象の2次元図
形2の位置を検出する方法である。
This pattern matching method is shown in FIG.
A plurality of standard patterns 3, 3, ... As shown in (b) are used, the two-dimensional image 1 is scanned by this standard pattern 3, and the degree of similarity is expressed as a numerical value.
This is a method of cutting out a portion of the two-dimensional image 1 close to the numerical value and detecting the position of the target two-dimensional figure 2.

【0005】また、位置検出としては例えば特公平1−
35385号公報に見られるような輪郭線縁追跡法もよ
く用いられている。
As for position detection, for example, Japanese Patent Publication No. 1-
A contour line edge tracking method as seen in Japanese Patent No. 35385 is also often used.

【0006】この輪郭線縁追跡法は、図形の輪郭の特徴
を捕らえる方法で、図13に示すように、黒画素部4と
白画素部5との縁、すなわちエッジを図中実線の矢印6
で示すように追跡しその輪郭を捕らえるというものであ
る。
This contour line edge tracing method is a method for catching the feature of the contour of a figure, and as shown in FIG.
It traces and captures the outline as shown in.

【0007】[0007]

【発明が解決しようとする課題】前述したパターンマッ
チング法は、ある特徴をもつ2次元画像1の中から対象
の2次元図形2を切出す方法としては非常に有効な方法
として知られている。従って周囲の少なくとも2辺が直
線となる構成のマトリックス状にデータを配した矩形の
2次元コード図形や周囲の4辺が直線となる構成のマト
リックス状にデータを配した矩形の2次元コード図形の
ように特徴をもった図形を切出す場合にも有効となる
が、しかし画像の読取りを行なった場合に2次元画像に
対して2次元コード図形が図12に示すように常に平行
に存在することは希で、多くの場合図14の(a) に示す
ように2次元画像1に対して2次元コード図形2が傾斜
して読取られる。
The above-mentioned pattern matching method is known as a very effective method for cutting out a target two-dimensional figure 2 from a two-dimensional image 1 having a certain characteristic. Therefore, a rectangular two-dimensional code figure in which data is arranged in a matrix having a configuration in which at least two sides are straight lines and a rectangular two-dimensional code figure in which data is arranged in a matrix configuration in which four sides are straight lines are provided. It is also effective when cutting out a figure having a characteristic as described above, but when an image is read, the two-dimensional code figure always exists in parallel to the two-dimensional image as shown in FIG. In most cases, the two-dimensional code figure 2 is read with an inclination with respect to the two-dimensional image 1 as shown in FIG.

【0008】このため実際にパターンマッチング法で2
次元コード図形2を切出すには、図14の(b) に示すよ
うに様々な傾斜角度の直線を表わす標準パターン7,
7,…を用意し、順に2次元画像1をスキャンして対象
の2次元図形2の位置を検出することになり、図形の切
出しに多大な時間を要するという問題があった。
For this reason, the pattern matching method is actually used.
In order to cut out the dimensional code figure 2, as shown in FIG. 14 (b), standard patterns 7 representing straight lines with various inclination angles,
.. are prepared and the two-dimensional image 1 is sequentially scanned to detect the position of the target two-dimensional figure 2, which causes a problem that it takes a lot of time to cut out the figure.

【0009】また、前述した輪郭線縁追跡法は、パター
ンマッチング法とは異なり、傾斜した直線の位置検出に
は何等問題はなく、また、2次元画像の中の特徴ある部
分のみを検索していくため図形の切出しに要する時間も
比較的短くて済むが、輪郭線縁追跡のための開始地点の
特定が難しいという問題があった。また、開始地点をう
まく取れても図15に示すように、傷8の付いた図形が
読み込まれると、図中点線の矢印9で示すように傷8の
部分を輪郭として追跡してしまい、本来の輪郭と違った
輪郭を認識してしまうという問題があった。
Further, unlike the pattern matching method, the above-described contour line edge tracing method has no problem in detecting the position of an inclined straight line, and searches only a characteristic portion in a two-dimensional image. Therefore, it takes a relatively short time to cut out a figure, but there is a problem that it is difficult to specify the starting point for contour edge tracking. Further, even if the starting point is successfully taken, if a figure with a scratch 8 is read in as shown in FIG. 15, the part of the scratch 8 is traced as a contour as shown by a dotted arrow 9 in the figure, and originally, There was a problem of recognizing a contour different from that of.

【0010】そこで本発明は、直線の位置検出にハフ変
換法と最小2乗近似法を用いることにより、周囲の少な
くとも2辺或いは4辺が直線となる構成のマトリックス
状にデータを配した矩形の2次元コード図形又はそれに
類似した図形を高速にかつ正確に切出すことができる画
像認識装置の図形の切出し方法を提供する。
Therefore, according to the present invention, by using the Hough transform method and the least-squares approximation method for detecting the position of a straight line, a rectangular shape in which data is arranged in a matrix shape in which at least two sides or four sides are straight Provided is a method of cutting out a figure of an image recognition device capable of cutting out a two-dimensional code figure or a figure similar thereto at high speed and accurately.

【0011】[0011]

【課題を解決するための手段と作用】請求項1対応の発
明は、周囲の少なくとも2辺が直線となる構成のマトリ
ックス状にデータを配した矩形の2次元コード図形又は
それに類似した図形を含む画像を読取り、その読取った
画像から2次元コード図形又はそれに類似した図形を切
出して認識する画像認識装置において、2次元コード図
形又はそれに類似した図形の画像に対してハフ変換法及
び最小2乗近似法により周囲の互いに交差する2本の直
線の位置を検出するステップと、このステップにて検出
した2本の直線の長さを検出するステップと、各ステッ
プで検出した2本の直線の位置と長さを元に周囲の互い
に交差する残り2本の直線の位置を検出するステップを
設け、各ステップにより2次元コード図形又はそれに類
似した図形を切出すことにある。
The invention according to claim 1 includes a rectangular two-dimensional code figure in which data is arranged in a matrix having a configuration in which at least two sides of the circumference are straight lines or a figure similar thereto. In an image recognition device for reading an image and recognizing a two-dimensional code figure or a figure similar to the image read out from the read image, a Hough transform method and a least-squares approximation are applied to the image of the two-dimensional code figure or a figure similar thereto. The position of the two straight lines that intersect each other by the method, the step of detecting the length of the two straight lines detected in this step, and the position of the two straight lines detected in each step. Based on the length, a step for detecting the positions of the remaining two straight lines that intersect each other is provided, and a two-dimensional code figure or a figure similar to it is cut out at each step. Lies in the fact.

【0012】請求項2対応の発明は、周囲の4辺が直線
となる構成のマトリックス状にデータを配した矩形の2
次元コード図形又はそれに類似した図形を含む画像を読
取り、その読取った画像から2次元コード図形又はそれ
に類似した図形を切出して認識する画像認識装置におい
て、2次元コード図形又はそれに類似した図形の画像に
対してハフ変換法及び最小2乗近似法により周囲の4本
の直線の位置を検出するステップを設け、ステップによ
り2次元コード図形又はそれに類似した図形を切出すこ
とにある。
According to the second aspect of the present invention, a rectangular 2 in which data is arranged in a matrix having a structure in which four sides are straight
An image recognition apparatus that reads a two-dimensional code figure or an image including a figure similar to the two-dimensional code figure and cuts out a two-dimensional code figure or a figure similar to the two-dimensional code figure from the read image and recognizes the two-dimensional code figure or a figure similar thereto. On the other hand, a step of detecting the positions of four surrounding straight lines by the Hough transform method and the least square approximation method is provided, and a two-dimensional code figure or a figure similar thereto is cut out by the step.

【0013】請求項3対応の発明は、請求項1又は2対
応の発明において、直線の位置を検出するステップは、
優先順位を持ったいくつかの直線候補を抽出し、その抽
出した直線候補の中から優先順位の高い順に順次組合わ
せを行なって正しい直線を検出することにある。
The invention according to claim 3 is the invention according to claim 1 or 2, wherein the step of detecting the position of the straight line comprises:
A certain straight line is detected by extracting some straight line candidates having priorities and sequentially combining the extracted straight line candidates in the order of higher priority.

【0014】[0014]

【実施例】以下、本発明の実施例を図面を参照して説明
する。
Embodiments of the present invention will be described below with reference to the drawings.

【0015】第1実施例 図1は矩形の2次元コード図形を読取ったときの2次元
画像領域11と画像領域11内の切出し対象となる2次
元コード図形12を示した図である。この2次元コード
図形12は周囲の2辺12a,12bが直線となる構成
のマトリックス状にデータを配した矩形の2次元コード
図形となっている。すなわち、データの範囲は実際には
図中一点鎖線で示す範囲まで配置されている。
First Embodiment FIG. 1 is a diagram showing a two-dimensional image area 11 when a rectangular two-dimensional code figure is read and a two-dimensional code figure 12 to be cut out in the image area 11. The two-dimensional code figure 12 is a rectangular two-dimensional code figure in which data is arranged in a matrix having a configuration in which the two sides 12a and 12b on the periphery are straight lines. That is, the range of data is actually arranged up to the range indicated by the alternate long and short dash line in the figure.

【0016】前記2次元コード図形12の直線となる2
つの辺12a,12bに対して、図2に示すように横方
向に一定の間隔でスキャンして図中○や△で示したエッ
ジ点を抽出する。また、2つの辺12a,12bに対し
て、図3に示すように縦方向に一定の間隔でスキャンし
て図中○や△で示したエッジ点を抽出する。
2 which is a straight line of the two-dimensional code figure 12
As shown in FIG. 2, the edges 12a and 12b are horizontally scanned at regular intervals to extract edge points indicated by ◯ and Δ in the figure. Further, as shown in FIG. 3, the two sides 12a and 12b are scanned in the vertical direction at regular intervals to extract edge points indicated by ◯ and Δ in the figure.

【0017】なお、横方向及び縦方向のスキャンを全画
面の全画素に対して行なうのではなく、一定の間隔で行
なうのは処理時間の短縮のためである。
The scanning in the horizontal direction and the vertical direction is not performed for all the pixels in the entire screen, but is performed at regular intervals in order to shorten the processing time.

【0018】このスキャンによりエッジ点が立上がりエ
ッジ(図中○で示すエッジ点)か立下がりエッジ(図中
△で示すエッジ点)の属性を決定する。
By this scanning, the attribute of the rising edge (edge point indicated by ◯ in the figure) or the falling edge (edge point indicated by Δ in the figure) is determined.

【0019】こうしてエッジ点が検出されると続いてハ
フ変換法による直線の抽出を行なう。ハフ変換法は画像
中の直線抽出アルゴリズムとして知られている。すなわ
ち、ハフ変換法は任意のサンプリング点を通る角度θの
直線の原点からの距離をRとし、その角度θに対応する
距離Rを全サンプリング点の全ての角度において計算
し、その全ての角度θと距離Rの組合わせのうち、多か
った組合わせの表わす直線を抽出直線とする手法であ
る。
When the edge point is detected in this way, a straight line is subsequently extracted by the Hough transform method. The Hough transform method is known as an algorithm for extracting straight lines from an image. That is, in the Hough transform method, the distance R from the origin of a straight line having an angle θ passing through arbitrary sampling points is calculated, and the distance R corresponding to the angle θ is calculated at all angles of all sampling points, and all the angles θ This is a method in which the straight line represented by the combination that has the largest number among the combinations of and the distance R is used as the extraction straight line.

【0020】このハフ変換をコンピュータで行なう場合
は、θとRをパラメータとする2次元配列を確保し、そ
の配列要素への投票を各サンプリング点から行なうこと
になる。このとき、θを細かく取ればその分演算回数が
増大し、処理速度の問題が生じる。また、Rを厳密に取
ると非常に大きな2次元配列を取る必要が出てくる。そ
こで、本実施例ではθとRを大まかに取り、厳密に直線
抽出を行なうステップを後に設けている。
When this Hough transform is performed by a computer, a two-dimensional array having θ and R as parameters is secured, and voting for the array element is performed from each sampling point. At this time, if θ is finely taken, the number of calculations increases, and a problem of processing speed arises. Further, if R is taken strictly, it becomes necessary to take a very large two-dimensional array. Therefore, in the present embodiment, a step of roughly taking θ and R and performing strict line extraction is provided later.

【0021】図4は図2においてハフ変換を行ない、直
線抽出を行なった結果を示す図であり、また、図5は図
3においてハフ変換を行ない、直線抽出を行なった結果
を示す図である。
FIG. 4 is a diagram showing the result of straight line extraction after the Hough transform in FIG. 2, and FIG. 5 is a diagram showing the result of straight line extraction after the Hough transform in FIG. .

【0022】図4においてハフ変換した直線13及び図
5においてハフ変換した直線14はθとRを大まかに取
っているため、実際の検出すべき直線とはやや異なった
角度及び距離の直線となる。
Since the Hough-transformed straight line 13 in FIG. 4 and the Hough-transformed straight line 14 in FIG. 5 roughly take θ and R, they are straight lines having angles and distances slightly different from the actual straight line to be detected. .

【0023】そこでこの直線を支持した各点をサンプリ
ング点として最小2乗近似を行ない、図4に示す精密な
直線15及び図5に示す精密な直線16を計算により求
める。
Therefore, the least squares approximation is carried out using each point supporting this straight line as a sampling point, and the precise straight line 15 shown in FIG. 4 and the precise straight line 16 shown in FIG. 5 are obtained by calculation.

【0024】ところで大まかなハフ変換を行なった場
合、立上がりエッジと立下がりエッジの混合した直線を
ハフ変換により検出する場合がある。このようなときに
この直線を支持したすべてのエッジ点をサンプリング点
として最小2乗近似を行なうと、図6に示すように実際
に検出すべき直線17と異なった直線18を検出してし
まう問題が発生する。
By the way, when rough Hough transformation is performed, a straight line in which rising edges and falling edges are mixed may be detected by Hough transformation. In such a case, if the least-squares approximation is performed using all edge points supporting this straight line as sampling points, a straight line 18 different from the straight line 17 to be actually detected is detected as shown in FIG. Occurs.

【0025】そこで本実施例では、横スキャン及び縦ス
キャンによるハフ変換を行なった後、図7に示すよう
に、そのハフ変換による検出直線が約90度で交差する
直線の組合わせ、すなわち、直線19と20を選び出
し、その直線19,20を支持したエッジ点の分布によ
りその図形の存在方向を図7に実線の矢印21,22で
示すように決定する。
Therefore, in this embodiment, after the Hough transform is performed by the horizontal scan and the vertical scan, as shown in FIG. 7, a combination of straight lines where the detected straight lines by the Hough transform intersect at about 90 degrees, that is, straight lines. 19 and 20 are selected, and the existing direction of the figure is determined by the distribution of the edge points supporting the straight lines 19 and 20 as shown by solid arrows 21 and 22 in FIG.

【0026】すなわち、ハフ変換により検出された2本
の直線の交点を中心としてどちらの方向にエッジ点が多
く存在しているかを調べて図形の存在方向を決定する。
That is, the direction in which a lot of edge points are present around the intersection of two straight lines detected by the Hough transform is determined to determine the existing direction of the figure.

【0027】こうして図形の存在方向が決定すれば、検
出すべき直線の立上がり、立下がりのどちらなのか明ら
かになり、それにあった属性のエッジ点のみをサンプリ
ング点として最小2乗近似を行なうことにより、正しい
直線を検出することができる。
When the direction of existence of the figure is determined in this way, it becomes clear whether the straight line to be detected is a rising edge or a falling edge, and by performing the least-squares approximation by using only the edge points having the attribute corresponding thereto as sampling points. , Can detect the correct straight line.

【0028】こうして図8に示すように2次元コード図
形12の周囲の2辺12a,12bに対応する直線2
3,24が厳密に決定されることになる。
Thus, as shown in FIG. 8, the straight line 2 corresponding to the two sides 12a and 12b around the two-dimensional code figure 12 is formed.
3,24 will be strictly determined.

【0029】そして検出する図形は、矩形の図形である
から、2本の直線23,24の対辺の位置にも四角25
が存在することになり、その端線26,27はハフ変換
で直線として認識可能である。
Since the figure to be detected is a rectangular figure, a square 25 is formed at the position on the opposite side of the two straight lines 23 and 24.
Is present, and the end lines 26 and 27 can be recognized as straight lines by Hough transform.

【0030】そして対辺位置の四角25がつながってい
ないとき、最小2乗近似法により求めた2本の直線2
3,24と互いに向かい合う位置に平行に、そして端点
28,29により仮想の端線を引き、その端線と距離、
角度が類似し、ハフ変換により検出された直線を端線2
6,27として決定する。
When the squares 25 on opposite sides are not connected, two straight lines 2 obtained by the least-squares approximation method
3 and 24 are parallel to the positions facing each other, and a virtual end line is drawn by the end points 28 and 29, and the end line and the distance,
A straight line that has a similar angle and is detected by the Hough transform is an end line 2
6,27.

【0031】このときの端線26,27の検出も最初に
2本の直線23,24を検出したときと同様、ハフ変換
から最小2乗近似を行なうことにより厳密な直線抽出を
行なう。
In the detection of the end lines 26 and 27 at this time, as in the first detection of the two straight lines 23 and 24, strict straight line extraction is performed by performing least square approximation from the Hough transform.

【0032】以上の処理を流れ図で示すと図9に示すよ
うになる。すなわち、最初のステップS1 で2次元画像
を入力し、次のステップS2 でエッジ検出を行ない、次
のステップS3 でハフ変換による直線抽出を行ない、次
のステップS4 で直線の組合わせ選択を行なう。そして
次のステップS5 で図形の大きさを検出し、次のステッ
プS6 で残りの2直線の抽出を行ない、最後にステップ
S7 で画像認識処理を行なう。ステップS3 のハフ変換
においては正確な直線検出を行なうために最小2乗近似
も行なう。
FIG. 9 is a flow chart showing the above processing. That is, a two-dimensional image is input in the first step S1, edge detection is performed in the next step S2, straight lines are extracted by Hough transform in the next step S3, and combinations of straight lines are selected in the next step S4. Then, the size of the figure is detected in the next step S5, the remaining two straight lines are extracted in the next step S6, and finally the image recognition processing is performed in step S7. In the Hough transform of step S3, least square approximation is also performed in order to detect an accurate straight line.

【0033】ステップS5 及びステップS6 ではそれぞ
れ図形の大きさの検出や残りの2直線の抽出を行なう
が、検出や抽出が失敗したときには再度ステップS4 の
直線組合わせ選択に戻り、再度直線の組合わせ選択を行
なう。
In steps S5 and S6, the size of the figure is detected and the remaining two straight lines are extracted. If the detection or extraction fails, the process returns to the straight line combination selection in step S4, and the straight line combination is again performed. Make a choice.

【0034】そして再度ステップS5 の図形の大きさの
検出、ステップS6 の残りの2直線の抽出を行なう。
Then, the size of the figure is detected again in step S5, and the remaining two straight lines are extracted in step S6.

【0035】また、ステップS7 の画像認識処理は、4
本の直線の位置及び大きさを検出した後に行なう処理全
体を示し、その処理において検出した図形の位置が正し
くないと判明した時には再度ステップS4 の直線組合わ
せ選択に戻り、再度直線の組合わせ選択を行なう。
Further, the image recognition processing in step S7 is 4
The whole process performed after detecting the position and size of the straight line of the book is shown. When the position of the figure detected in the process is found to be incorrect, the process returns to the straight line combination selection in step S4, and the straight line combination is selected again. Do.

【0036】そして再度ステップS5 の図形の大きさの
検出、ステップS6 の残りの2直線の抽出を行なってか
ら、ステップS7 の画像認識処理を行なう。
Then, the size of the figure is detected again in step S5, the remaining two straight lines are extracted in step S6, and then the image recognition processing in step S7 is performed.

【0037】ステップS7 の画像認識処理では検出対象
図形の4辺及び四隅座標が決定されることになる。
In the image recognition processing of step S7, the coordinates of the four sides and the four corners of the figure to be detected are determined.

【0038】このように、先ず、読取った2次元画像領
域11に対して一定の間隔で横スキャンと縦スキャンを
行なって2次元コード図形12の2つの辺12a,12
bに対する立上がりエッジ点と立下がりエッジ点の抽出
を行ない、各エッジ点の属性を決定する。
As described above, first, the read two-dimensional image area 11 is subjected to the horizontal scanning and the vertical scanning at a constant interval so that the two sides 12a, 12 of the two-dimensional code figure 12 are scanned.
The rising edge point and the falling edge point for b are extracted, and the attribute of each edge point is determined.

【0039】そして大まかなハフ変換を行なって直線の
抽出を行ない、続いて抽出した直線が約90度で交差す
る直線の組合わせを選び出し、その直線を支持したエッ
ジ点の分布によりその図形の存在方向を決定する。
Then, a rough Hough transform is performed to extract straight lines, and then a combination of straight lines intersecting the extracted straight lines at about 90 degrees is selected, and the existence of the figure is determined by the distribution of edge points supporting the straight lines. Determine the direction.

【0040】そして検出すべき直線の立上がり、立下が
りを明確にしてから検出直線にあった属性のエッジ点の
みをサンプリング点として最小2乗近似を行ない、正し
い直線を検出する。
After the rising and falling edges of the straight line to be detected are clarified, the least square approximation is performed using only the edge points having the attributes on the detected straight line as sampling points to detect the correct straight line.

【0041】続いて検出した2本の直線から矩形の図形
であることを利用して対辺の位置にある2本の直線をハ
フ変換で認識する。このときもハフ変換から最小2乗近
似を行なうことにより正しい直線を検出する。
Next, by utilizing the fact that it is a rectangular figure from the two detected straight lines, the two straight lines on the opposite side are recognized by the Hough transform. At this time as well, the correct straight line is detected by performing the least-squares approximation from the Hough transform.

【0042】こうして検出対象図形の4辺及び四隅座標
を決定し、2次元画像11から2次元コード図形12を
切り出す。
In this way, the four sides and the four corners of the figure to be detected are determined, and the two-dimensional code figure 12 is cut out from the two-dimensional image 11.

【0043】このように大まかなハフ変換を行なった
後、約90度で交差する直線の組合わせを選択し、図形
の存在方向を決定してから最小2乗近似により正しい直
線を検出する方法を取っているので、処理時間が短く高
速な2次元コード図形の切り出しができ、また、傷等が
あっても正確に2次元コード図形の切り出しができる。
After the rough Hough transform is performed in this way, a combination of straight lines intersecting at about 90 degrees is selected, the direction of existence of the figure is determined, and then a correct straight line is detected by least square approximation. Since the two-dimensional code figure is taken, the processing time is short and the two-dimensional code figure can be cut out at high speed, and the two-dimensional code figure can be cut out accurately even if there is a scratch or the like.

【0044】第2実施例 これは図10に示すように読取った2次元画像領域31
内に周囲の4辺32a,32b,32c,32dが直線
となる構成のマトリックス状にデータを配した矩形の2
次元コード図形32がある場合の図形切り出しについて
述べる。
Second Embodiment This is a two-dimensional image area 31 read as shown in FIG.
A rectangular 2 in which data is arranged in a matrix in which the four sides 32a, 32b, 32c, 32d of the periphery are straight lines.
The cutout of a figure when the dimension code figure 32 is present will be described.

【0045】この2次元コード図形32は2辺32a,
32bが直線33,34としてつながっているのみでな
く、その2辺32a,32bの対辺である2辺32c,
32dも直線35,36としてつながっている。すなわ
ち、この2次元コード図形32は4辺すべてが直線33
〜36で囲まれた図形ということになる。
This two-dimensional code figure 32 has two sides 32a,
32b is not only connected as straight lines 33 and 34, but is also opposite to the two sides 32a and 32b.
32d is also connected as straight lines 35 and 36. That is, the two-dimensional code figure 32 has straight lines 33 on all four sides.
It is a figure surrounded by ~ 36.

【0046】第1実施例では、2本の直線を抽出した
後、図形の大きさ、端点を元に対辺の端線を決定してい
た。これは対辺が黒画素の連続する直線でないため、そ
れから得られる端線はつながった直線に比べて直線とし
ての特徴が弱く、画像全体から端線を正しく検出するこ
とが難しいためであった。
In the first embodiment, after extracting two straight lines, the end line of the opposite side is determined based on the size and end point of the figure. This is because since the opposite side is not a continuous line of black pixels, the end line obtained from it is less characteristic as a straight line than a continuous line, and it is difficult to correctly detect the end line from the entire image.

【0047】しかし、本実施例においては2本の直線3
3,34及び2本の端線35,36ともに同等の強い直
線としての特徴を持っている。
However, in this embodiment, two straight lines 3
3, 34 and the two end lines 35, 36 both have the characteristic of being strong straight lines.

【0048】従って、本実施例において図形の切り出し
は、図11に流れ図を示すように、ステップS2 でエッ
ジ検出を行なうと、続いてステップS13にて検出対象図
形の4辺すべてをハフ変換による直線の抽出で検出する
ことができる。
Therefore, in the present embodiment, when cutting out a figure, as shown in the flow chart in FIG. 11, when edge detection is performed in step S2, all four sides of the figure to be detected are straightened by Hough transformation in step S13. Can be detected by extraction.

【0049】そして最終的な正しい直線抽出は第1実施
例同様、ハフ変換による直線の抽出後に、ステップS14
にて最小2乗近似法を用いて複数の優先順位をもった直
線候補の組合わせを選択し、ステップS7 にて正しい画
像認識が行なわれるまで、ステップS14の処理を繰り返
し、最終的にステップS7 にて正しい画像認識が行なわ
れることになる。
As in the first embodiment, the final correct straight line extraction is step S14 after the straight line is extracted by the Hough transform.
At step S7, a combination of straight line candidates having a plurality of priorities is selected by using the least squares approximation method, and step S14 is repeated until correct image recognition is performed at step S7, and finally step S7. Correct image recognition will be performed at.

【0050】この実施例においては、第1実施例に比べ
て図形の大きさ検出や残りの2直線の抽出というステッ
プが不要となるため、処理量が減少し、さらに図形切り
出しの高速化を図ることができる。勿論、本実施例にお
いても第1実施例同様、傷等に対しても正確な2次元コ
ード図形の切り出しができる。
In this embodiment, the steps of detecting the size of the figure and extracting the remaining two straight lines are not necessary as compared with the first embodiment, so the processing amount is reduced and the figure cutting out speed is further increased. be able to. Of course, also in this embodiment, as in the first embodiment, it is possible to accurately cut out a two-dimensional code figure even with respect to a scratch or the like.

【0051】なお、前記各実施例は、周囲の2辺或いは
4辺が直線となる構成のマトリックス状にデータを配し
た矩形の2次元コード図形の切り出しについて述べたが
必ずしもこれに限定するものではなく、2次元コード図
形に類似した周囲の2辺或いは4辺が直線となる構成の
図形の切り出しにも適用できるのは勿論である。
In each of the above embodiments, the cutting out of a rectangular two-dimensional code figure in which data is arranged in a matrix having a structure in which two or four sides are straight is described, but the present invention is not necessarily limited to this. Of course, the present invention can also be applied to the cutting out of a graphic having a configuration in which two or four sides around it are similar to a two-dimensional code graphic.

【0052】[0052]

【発明の効果】以上、本発明によれば、直線の位置検出
にハフ変換法と最小2乗近似法を用いることにより、周
囲の少なくとも2辺或いは4辺が直線となる構成のマト
リックス状にデータを配した矩形の2次元コード図形又
はそれに類似した図形を高速にかつ正確に切出すことが
できる画像認識装置の図形の切出し方法を提供できる。
As described above, according to the present invention, by using the Hough transform method and the least-squares approximation method for detecting the position of a straight line, data can be formed in a matrix with a configuration in which at least two sides or four sides are straight lines. It is possible to provide a method of cutting out a figure of an image recognition device capable of cutting out a rectangular two-dimensional code figure or a figure similar thereto in a fast and accurate manner.

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

【図1】本発明の第1実施例の2次元画像領域と2次元
コード図形を示す図。
FIG. 1 is a diagram showing a two-dimensional image area and a two-dimensional code figure according to a first embodiment of the present invention.

【図2】同実施例の横スキャンによるエッジ点抽出を説
明するための図。
FIG. 2 is a diagram for explaining edge point extraction by horizontal scanning according to the embodiment.

【図3】同実施例の縦スキャンによるエッジ点抽出を説
明するための図。
FIG. 3 is a diagram for explaining edge point extraction by vertical scanning according to the embodiment.

【図4】同実施例の横スキャンにより抽出したエッジ点
をもとにしたハフ変換と最小2乗近似による直線抽出を
説明するための図。
FIG. 4 is a diagram for explaining straight line extraction by Hough transform and least square approximation based on edge points extracted by horizontal scanning in the same embodiment.

【図5】同実施例の縦スキャンにより抽出したエッジ点
をもとにしたハフ変換と最小2乗近似による直線抽出を
説明するための図。
FIG. 5 is a diagram for explaining straight line extraction by Hough transform and least square approximation based on edge points extracted by vertical scanning in the same embodiment.

【図6】誤ったハフ変換による直線抽出を説明するため
の図。
FIG. 6 is a diagram for explaining straight line extraction by erroneous Hough transform.

【図7】同実施例の図形存在方向の検出を説明するため
の図。
FIG. 7 is a diagram for explaining detection of a figure existing direction of the embodiment.

【図8】同実施例において残った2つの直線の抽出を説
明するための図。
FIG. 8 is a diagram for explaining extraction of two remaining straight lines in the embodiment.

【図9】同実施例の図形切り出し処理を示す流れ図。FIG. 9 is a flowchart showing a graphic cutout process of the embodiment.

【図10】本発明の第2実施例の2次元画像領域と2次
元コード図形を示す図。
FIG. 10 is a diagram showing a two-dimensional image area and a two-dimensional code figure according to the second embodiment of the present invention.

【図11】同実施例の図形切り出し処理を示す流れ図。FIG. 11 is a flowchart showing a graphic cutout process of the embodiment.

【図12】第1従来例における図形切り出しを説明する
ための図。
FIG. 12 is a diagram for explaining graphic cutout in the first conventional example.

【図13】第2従来例における図形切り出しを説明する
ための図。
FIG. 13 is a diagram for explaining graphic cutout in the second conventional example.

【図14】第1従来例の課題を説明するための図。FIG. 14 is a diagram for explaining the problem of the first conventional example.

【図15】第2従来例の課題を説明するための図。FIG. 15 is a diagram for explaining the problem of the second conventional example.

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

11…2次元画像領域 12…2次元コード図形 11 ... Two-dimensional image area 12 ... Two-dimensional code figure

Claims (3)

【特許請求の範囲】[Claims] 【請求項1】 周囲の少なくとも2辺が直線となる構成
のマトリックス状にデータを配した矩形の2次元コード
図形又はそれに類似した図形を含む画像を読取り、その
読取った画像から前記2次元コード図形又はそれに類似
した図形を切出して認識する画像認識装置において、前
記2次元コード図形又はそれに類似した図形の画像に対
してハフ変換法及び最小2乗近似法により周囲の互いに
交差する2本の直線の位置を検出するステップと、この
ステップにて検出した2本の直線の長さを検出するステ
ップと、前記各ステップで検出した2本の直線の位置と
長さを元に周囲の互いに交差する残り2本の直線の位置
を検出するステップを設け、前記各ステップにより前記
2次元コード図形又はそれに類似した図形を切出すこと
を特徴とする画像認識装置の図形の切出し方法。
1. A rectangular two-dimensional code figure in which data is arranged in a matrix having a configuration in which at least two sides are straight lines, or an image including a figure similar thereto is read, and the two-dimensional code figure is read from the read image. Alternatively, in an image recognition device which recognizes a figure similar to it by slicing the two-dimensional code figure or an image of a figure similar to the two-dimensional code figure, the two straight lines intersecting each other by the Hough transform method and the least-squares approximation method. The step of detecting the position, the step of detecting the lengths of the two straight lines detected in this step, and the rest of the surroundings that intersect each other based on the positions and the lengths of the two straight lines detected in each of the steps An image recognition characterized by providing a step of detecting the positions of two straight lines, and cutting out the two-dimensional code figure or a figure similar thereto by each of the steps. A method for cutting out a graphic of a recognition device.
【請求項2】 周囲の4辺が直線となる構成のマトリッ
クス状にデータを配した矩形の2次元コード図形又はそ
れに類似した図形を含む画像を読取り、その読取った画
像から前記2次元コード図形又はそれに類似した図形を
切出して認識する画像認識装置において、前記2次元コ
ード図形又はそれに類似した図形の画像に対してハフ変
換法及び最小2乗近似法により周囲の4本の直線の位置
を検出するステップを設け、前記ステップにより前記2
次元コード図形又はそれに類似した図形を切出すことを
特徴とする画像認識装置の図形の切出し方法。
2. A rectangular two-dimensional code figure in which data is arranged in a matrix having a structure in which four sides are straight lines or an image including a figure similar thereto is read, and the two-dimensional code figure or the image is read from the read image. In an image recognition device which cuts out and recognizes a graphic similar thereto, the positions of four surrounding straight lines are detected by the Hough transform method and the least-squares approximation method for the image of the two-dimensional code graphic or a graphic similar thereto. A step is provided, and the step 2
A method for cutting out a figure of an image recognition apparatus, which is characterized by cutting out a dimensional code figure or a figure similar thereto.
【請求項3】 直線の位置を検出するステップは、優先
順位を持ったいくつかの直線候補を抽出し、その抽出し
た直線候補の中から優先順位の高い順に順次組合わせを
行なって正しい直線を検出することを特徴とする請求項
1又は2記載の画像認識装置の図形の切出し方法。
3. The step of detecting the position of a straight line extracts some straight line candidates having priorities and sequentially combines the extracted straight line candidates in descending order of priority to obtain a correct straight line. 3. The method of cutting out a figure of the image recognition device according to claim 1, wherein the figure is detected.
JP6009975A 1994-01-31 1994-01-31 Method of extracting figure of image recognition device Expired - Fee Related JP3058791B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP6009975A JP3058791B2 (en) 1994-01-31 1994-01-31 Method of extracting figure of image recognition device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP6009975A JP3058791B2 (en) 1994-01-31 1994-01-31 Method of extracting figure of image recognition device

Publications (2)

Publication Number Publication Date
JPH07220081A true JPH07220081A (en) 1995-08-18
JP3058791B2 JP3058791B2 (en) 2000-07-04

Family

ID=11734921

Family Applications (1)

Application Number Title Priority Date Filing Date
JP6009975A Expired - Fee Related JP3058791B2 (en) 1994-01-31 1994-01-31 Method of extracting figure of image recognition device

Country Status (1)

Country Link
JP (1) JP3058791B2 (en)

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2009140207A (en) * 2007-12-06 2009-06-25 Nec Corp Two-dimensional barcode reader, two-dimensional barcode reading method, program and recording medium
WO2013038656A1 (en) * 2011-09-15 2013-03-21 日本電気株式会社 Projection image automatic correction system, projection image automatic correction method and program
JP2017507030A (en) * 2014-02-06 2017-03-16 トルンプフ ヴェルクツォイクマシーネン ゲゼルシャフト ミット ベシュレンクテル ハフツング ウント コンパニー コマンディートゲゼルシャフトTrumpf Werkzeugmaschinen GmbH + Co. KG Method and machine for identifying an edge profile of an opening formed in a machining head
US9646221B2 (en) 2013-07-24 2017-05-09 Nec Corporation Image recognition apparatus and storage medium
US10270921B2 (en) 2015-11-30 2019-04-23 Brother Kogyo Kabushiki Kaisha Image analyzing apparatus determining representation form of code image using distances of code elements

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103679724B (en) * 2013-12-13 2016-06-15 中南大学 Slope approximant straight line detection method

Cited By (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2009140207A (en) * 2007-12-06 2009-06-25 Nec Corp Two-dimensional barcode reader, two-dimensional barcode reading method, program and recording medium
WO2013038656A1 (en) * 2011-09-15 2013-03-21 日本電気株式会社 Projection image automatic correction system, projection image automatic correction method and program
JPWO2013038656A1 (en) * 2011-09-15 2015-03-23 日本電気株式会社 Projected image automatic correction system, projected image automatic correction method and program
US9344695B2 (en) 2011-09-15 2016-05-17 Nec Corporation Automatic projection image correction system, automatic projection image correction method, and non-transitory storage medium
US9646221B2 (en) 2013-07-24 2017-05-09 Nec Corporation Image recognition apparatus and storage medium
JP2017507030A (en) * 2014-02-06 2017-03-16 トルンプフ ヴェルクツォイクマシーネン ゲゼルシャフト ミット ベシュレンクテル ハフツング ウント コンパニー コマンディートゲゼルシャフトTrumpf Werkzeugmaschinen GmbH + Co. KG Method and machine for identifying an edge profile of an opening formed in a machining head
US10270921B2 (en) 2015-11-30 2019-04-23 Brother Kogyo Kabushiki Kaisha Image analyzing apparatus determining representation form of code image using distances of code elements

Also Published As

Publication number Publication date
JP3058791B2 (en) 2000-07-04

Similar Documents

Publication Publication Date Title
JP3343864B2 (en) How to separate words
US5410611A (en) Method for identifying word bounding boxes in text
US5539841A (en) Method for comparing image sections to determine similarity therebetween
JPH07234915A (en) Image recognizing device
Clark et al. Rectifying perspective views of text in 3D scenes using vanishing points
JPH09179937A (en) Method for automatically discriminating boundary of sentence in document picture
JPH09179942A (en) Method for automatically recognizing drop word in document picture using no ocr
US10235576B2 (en) Analysis method of lane stripe images, image analysis device, and non-transitory computer readable medium thereof
JPH02306386A (en) Character recognizing device
JPH07220081A (en) Segmenting method for graphic of image recognizing device
JP3460356B2 (en) Method and apparatus for detecting circle or ellipse
JPH06203202A (en) Image processor
JP2000113106A (en) Document image processor
JP3311551B2 (en) Image data input processing method and apparatus
JPH0728935A (en) Document image processor
JP3077929B2 (en) Character extraction method
JP3095470B2 (en) Character recognition device
US11710331B2 (en) Systems and methods for separating ligature characters in digitized document images
JP3133797B2 (en) Character recognition method and apparatus
JPH05242224A (en) Fingerprint collating device
JP2003016385A (en) Image processor, method, program and storage medium
JP2813601B2 (en) Tabular document recognition device
JPH1069520A (en) Character recognition method and recording medium recording program
JPS622382A (en) Feature extracting devie for pattern
JP2005242825A (en) Business form reading device and business form direction determination method by business form reading device

Legal Events

Date Code Title Description
LAPS Cancellation because of no payment of annual fees