JPH07334605A - Tilt detecting method - Google Patents

Tilt detecting method

Info

Publication number
JPH07334605A
JPH07334605A JP6175188A JP17518894A JPH07334605A JP H07334605 A JPH07334605 A JP H07334605A JP 6175188 A JP6175188 A JP 6175188A JP 17518894 A JP17518894 A JP 17518894A JP H07334605 A JPH07334605 A JP H07334605A
Authority
JP
Japan
Prior art keywords
rectangle
scanning
rectangular
pattern
angle
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
JP6175188A
Other languages
Japanese (ja)
Other versions
JP3350596B2 (en
Inventor
Koichi Ejiri
公一 江尻
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.)
Ricoh Co Ltd
Original Assignee
Ricoh Co Ltd
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 Ricoh Co Ltd filed Critical Ricoh Co Ltd
Priority to JP17518894A priority Critical patent/JP3350596B2/en
Publication of JPH07334605A publication Critical patent/JPH07334605A/en
Application granted granted Critical
Publication of JP3350596B2 publication Critical patent/JP3350596B2/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Abstract

PURPOSE:To fast detect a skew (tilt) angle by means of a rectangular pattern. CONSTITUTION:The scanning of a bar code pattern is carried on when the detection of tilt of a bar code is started (step 1), and it is decided whether a subject rectangular area is being scanned or not (step 2). If not scanned, the step 2 returns to the step 1. If scanned, the scanning distance (run length) is measured in the rectangular area (step 3). Then, it is decided whether the scanning of the rectangular are has been completed or not (step 4). If not completed, the step 4 returns to the step 1. If completed, a histogram is acquired (step 5). Then an estimated skew angle theta is calculated from the maximum value of the histogram (step 6).

Description

【発明の詳細な説明】Detailed Description of the Invention

【0001】[0001]

【産業上の利用分野】本発明は、傾き検出方法に関し、
より詳細には、情報量の多い場合でもスキュー(傾き)
を高速で検出するようにした傾き検出方法に関する。例
えば、バーコードの傾き検出や複写機における原稿傾き
検出にも適用される。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a tilt detecting method,
More specifically, skew (slope) even when there is a large amount of information
The present invention relates to a tilt detection method for detecting a high speed. For example, it is also applied to the detection of the inclination of a barcode and the detection of the inclination of a document in a copying machine.

【0002】[0002]

【従来の技術】一般に、スキュー検出は、事実上簡単に
しかなされていないが、文書画像では、例えば、特開平
2−116987号公報においては、画像の連結成分を
結ぶ直線を想定して、その方位をスキュー角度として検
出している。すなわち、前記公報のものは、文字認識装
置における文字行の傾きを検出する方法を記載したもの
で、文字画像データから文字行を抽出し、抽出された文
字行から各文字を切り出し、基準線抽出手段により文字
行の各文字の特定点における任意の直線を表わすパラメ
ータの組について、そのパラメータ空間上でヒストグラ
ムを取り、そのヒストグラム上の最頻度を与えるパラメ
ータの組が規定する直線を基準線とし、その基準線の傾
きを求めるようにしたもので、文字行を含む画像データ
の収集のために高度な画像入力手段を用いる必要がな
く、比較的少ない画像データから文字行の傾きを割り出
すことができるものである。
2. Description of the Related Art In general, skew detection is only performed practically simply, but in a document image, for example, in Japanese Patent Laid-Open No. 2-116987, a straight line connecting the connected components of the image is assumed and The azimuth is detected as the skew angle. That is, the above publication describes a method for detecting the inclination of a character line in a character recognition device. It extracts a character line from character image data, cuts out each character from the extracted character line, and extracts a reference line. By a means, for a set of parameters representing an arbitrary straight line at a specific point of each character of a character line, a histogram is taken on the parameter space, and a straight line defined by the set of parameters giving the highest frequency on the histogram is used as a reference line, Since the inclination of the reference line is obtained, it is not necessary to use an advanced image input means for collecting image data including a character line, and the inclination of the character line can be calculated from a relatively small amount of image data. It is a thing.

【0003】また、特開平5−174182号公報のも
のは、文書画像に対し外接矩形化処理を行い、文字列中
の1文字の外接矩形を選択し、選択した外接区矩形から
基準点を抽出し、注目する基準点から一定以内の距離に
ある他の基準点を結ぶことによりベクトルを求め、求め
たベクトルの平均の向きを文書の基準方向として、該基
準方向と入力時の基準方向との角度差を文書傾き角とす
るものである。
In Japanese Patent Laid-Open No. 5-174182, a circumscribing rectangle processing is performed on a document image, a circumscribing rectangle of one character in a character string is selected, and a reference point is extracted from the selected circumscribing section rectangle. Then, a vector is obtained by connecting another reference point within a certain distance from the reference point of interest, and the average direction of the obtained vector is set as the reference direction of the document, and the reference direction and the reference direction at the time of input are set. The angle difference is used as the document inclination angle.

【0004】さらに、特公昭60−57108号公報の
ものは、ファクシミリ送信機をマークシート読み取り装
置として用いるマークシート読み取り方式に関するもの
で、マークシート上に基準マーク,走査位置指定マー
ク,傾斜角度検出マークおよびマーク欄を配置し、前記
マークシートを走査したファクシミリ信号の中から、ま
ず、マークシートの傾斜角度を検出し、次に前記傾斜角
度に応じてマーク欄内を走査する複数本の走査線を選択
し、マーク処理を行うようにしたものである。すなわ
ち、特殊なマークをつけた帳票の傾き検出するために、
帳票の特定の部分に特定のマークを複数個有し、帳票の
読み取り方向はあらかじめ定められており、傾きの算出
方法は厳密には特定されていないが、大まかには、マー
クの出現順序を利用するものである。
Further, Japanese Patent Publication No. 60-57108 relates to a mark sheet reading system in which a facsimile transmitter is used as a mark sheet reading device, and a reference mark, a scanning position designation mark, a tilt angle detection mark and a mark column are provided on the mark sheet. Of the facsimile signals obtained by scanning the mark sheet, the tilt angle of the mark sheet is first detected, and then a plurality of scanning lines for scanning the mark column are selected according to the tilt angle to perform mark processing. Is to do. That is, in order to detect the inclination of the form with a special mark,
There are multiple specific marks on a specific part of the form, the reading direction of the form is predetermined, and the calculation method of the inclination is not strictly specified, but roughly the appearance order of the marks is used. To do.

【0005】また、傾き検出をバーコードに適用したも
のがある。一口にバーコードと言っても、いろいろな方
式のものが知られており、その応用も多様である。例え
ば、 白黒パターンを等間隔に配列したもの、 白黒のペアのパターンを配列したもの、 白黒パターンのピッチを変えて配列したもの、 などがその代表的なものである。文字情報そのものをコ
ード化するものとして、通常のバーコードとは異なる2
次元データコードがある。この2次元データコードのコ
ード化できる情報は、英数字,カナ文字,漢字ばかりで
なく、記号など、すべての字種を取り扱うことができる
もので、今まで線としてとらえていた情報の読み取りを
面として認識し、360度どの向きからも読み取りが可
能である。例えば、流通業における商品の値札など全方
向からも読み取れるので、ラベルの貼り方が乱雑でも問
題なく取り扱いができる。
Further, there is one in which inclination detection is applied to a bar code. There are various types of known barcodes, and their applications are diverse. Typical examples are black-and-white patterns arranged at equal intervals, black-and-white pair patterns arranged, and black-and-white patterns arranged at different pitches. Different from ordinary barcodes as encoding the character information itself 2
There is a dimensional data code. The information that can be encoded by this two-dimensional data code can handle not only alphanumeric characters, kana characters, and kanji but also all character types such as symbols. And can be read from any direction of 360 degrees. For example, since it can be read from all directions such as the price tag of a product in the distribution industry, it can be handled without problems even if the label is cluttered.

【0006】2次元バーコードの種類と特徴について
は、以下の〜の点が挙げられる。 Symbol Technology:多量の情報をコード化すること
を目的として開発されたが、専用のスキャナを対象とし
て設計されている。スキューへの対応は、読み取ったあ
と、メモリ上のコードの並び方を追跡する形で実施して
いる。 DATA Code:黒べたと白黒まだらの縁を利用して記録
範囲を指定する。記録される情報量は最大500バイト
に限定されている。
Regarding the types and characteristics of the two-dimensional bar code, the following points are mentioned. Symbol Technology: Developed to encode large amounts of information, but designed for dedicated scanners. The skew is dealt with by tracking the arrangement of the codes in the memory after reading. DATA Code: Specify the recording range using the edges of black solid and black and white mottle. The maximum amount of information that can be recorded is 500 bytes.

【0007】 Softstrip:専用のスキャナを対象とし
て設計された。白黒のペアーを単位として記録するので
記録密度は高い。 Vericode:コードを暗号化する目的で使われてい
る。 Philip dot Code:8×8の領域にビットコードを記
録する。プリント基盤などの特殊用途がある。 カルラコード:2×2の升目にビットコードを記録
する。
Softstrip: Designed for dedicated scanners. The recording density is high because recording is done in units of black and white pairs. Vericode: Used to encrypt the code. Philip dot code: A bit code is recorded in an 8 × 8 area. There are special applications such as print boards. Carla code: A bit code is recorded in a 2 × 2 square.

【0008】[0008]

【発明が解決しようとする課題】近年、文書管理などの
情報処理の高速化にともない、シート状対象物の傾きを
検出するために、特定の図形、例えば長方形を利用する
ものの、その図形が帳票の特定の部分に存在する必要が
なく、また、帳票自体が長方形であることを利用して、
明示的に長方形を印刷することなく、帳票の輪郭を利用
して傾き角度を高速に求める方法の実現が要求されてい
る。また、前述のように、傾き検出にもいろいろな方式
な知られており、その応用も多様である。しかし、ディ
ジタル複写機の登場によって、その使い方に変化が出て
きた。従来の使い方と複写機やカメラを使う場合の違い
を、以下の表1に示す。
In recent years, with the speeding up of information processing such as document management, a specific figure, for example, a rectangle is used to detect the inclination of a sheet-like object, but the figure is a form. It does not have to exist in a specific part of the
It is required to realize a method for obtaining a tilt angle at high speed by utilizing the contour of a form without explicitly printing a rectangle. Further, as described above, various methods are known for tilt detection, and their applications are diverse. However, with the advent of digital copiers, their usage has changed. Table 1 below shows the differences between the conventional method and the case of using a copying machine or a camera.

【0009】[0009]

【表1】 [Table 1]

【0010】前記表1から分かる従来方法と複写機での
応用との大きな違いとして、文書に適用されるバーコー
ドは、情報量が大きく、かつ認識に要する許容時間が短
いことが挙げられる。また、スキャナの形式が異なる上
に、情報量も多いので、コードパターンのスキュー(傾
き)も瞬時に補正されなければならないことである。
A major difference between the conventional method and the application in a copying machine, which can be seen from Table 1, is that the bar code applied to a document has a large amount of information and a short allowable time for recognition. In addition, since the scanner format is different and the amount of information is large, the skew (tilt) of the code pattern must be corrected in an instant.

【0011】本発明は、このような実情に鑑みてなされ
たもので、パターンの切り出しと、スキュー(傾き)角
度の検出を高速で実現する傾き検出方法を提供すること
を目的としている。
The present invention has been made in view of the above circumstances, and an object thereof is to provide a tilt detecting method for realizing pattern cutting and skew (tilt) angle detection at high speed.

【0012】[0012]

【課題を解決するための手段】本発明は、上記課題を解
決するために、(1)長方形のパターンに対して該長方
形の内部を通過する走査線の長さの頻度分布を求め、前
記長方形のスキューの角度を算出すること、更には、
(2)2次元状に拡がるバーコードを取り囲むか、ある
いは該バーコードに付随する長方形のパターンに対して
該長方形の内部を通過する走査線の長さの頻度分布を求
め、前記長方形のスキューの角度を算出すること、更に
は、(3)前記長方形のパターンが枠状の線あるいは境
界線であること、更には、(4)前記長方形の縁を構成
するパターンが、一定の周期の規則的パターンであるこ
と、或いは、(5)対象とする長方形領域を走査してい
るかどうかを判断する判断手段と、該判断手段により前
記長方形領域を走査している場合に、前記長方形内部の
走査距離をカウントする計数手段と、該計数手段による
カウントされた走査距離の頻度分布のヒストグラムを求
めるヒストグラム作成手段と、該ヒストグラム作成手段
により求められたヒストグラムの最大値から予想される
スキュー角度を求めるスキュー角度検出手段とから成る
こと、更には、(6)前記(5)において、前記長方形
領域のサイズを縦Hv、横Hhとし、長方形を任意の角
度θで走査し、該角度θで走査した時、前記長方形の入
力側の角を通過する走査線に対し、出力側の角からの垂
線の長さをLとする時、走査距離M=Hh/cosθで求
まり、頻度のピーク値に寄与する面積がS=Hvcosθ
−Hhsinθで求まり、L=Hhsinθの関係から、長方
形の上下のコーナー部分が寄与する面積は、上記頻度分
布のピーク以外の部分の面積が、2Hhsinθであると
いう関係式から求まり、前記いずれかの関係式よりスキ
ュー角度θを求めること、更には、(7)前記(6)に
おいて、前記関係式から求められたスキュー角度の平均
値を最もらしいスキュー角度としたことを特徴としたも
のである。
In order to solve the above-mentioned problems, the present invention (1) finds a frequency distribution of the lengths of scanning lines passing through the inside of the rectangle for a rectangular pattern, To calculate the skew angle of
(2) Obtain the frequency distribution of the lengths of scanning lines that pass through the inside of a rectangular pattern that surrounds the bar code that extends two-dimensionally or that accompanies the bar code, and calculate the skew of the rectangular line. Calculating the angle, (3) the rectangular pattern is a frame-shaped line or a boundary line, and (4) the patterns forming the edges of the rectangular are regular with a constant period. It is a pattern, or (5) determining means for determining whether or not the target rectangular area is being scanned, and the scanning distance inside the rectangle when the rectangular area is being scanned by the determining means. Counting means for counting, histogram creating means for obtaining a histogram of frequency distribution of scanning distances counted by the counting means, and histogram creating means Skew angle detecting means for obtaining a skew angle expected from the maximum value of the strogram, and (6) in (5), the size of the rectangular region is set to a vertical Hv and a horizontal Hh, and a rectangle is set to an arbitrary rectangle. When scanning is performed at an angle θ, and when scanning is performed at the angle θ, when the length of a perpendicular line from the output side corner to the scanning line passing through the input side corner of the rectangle is L, the scanning distance M = Hh / Cosθ, and the area that contributes to the frequency peak value is S = Hvcosθ
−Hhsinθ, and from the relation of L = Hhsinθ, the area contributed by the upper and lower corners of the rectangle is obtained from the relational expression that the area other than the peak of the frequency distribution is 2Hhsinθ, and any one of the above relations The skew angle θ is obtained from the equation, and (7) in (6), the average value of the skew angles obtained from the relational expression is used as the most plausible skew angle.

【0013】[0013]

【作用】本発明による傾き検出方法は、長方形のパター
ンである長方形領域の走査を行い、その長方形の内部の
走査距離(ランレングス)の頻度分布から、ヒストグラ
ムを求め、このヒストグラムの分布から予想されるスキ
ュー角度を求める。これにより、スキュー角度の検出を
高速で実現することができる。
The inclination detecting method according to the present invention scans a rectangular area which is a rectangular pattern, obtains a histogram from the frequency distribution of the scanning distance (run length) inside the rectangle, and predicts from this histogram distribution. Calculate the skew angle. This makes it possible to detect the skew angle at high speed.

【0014】[0014]

【実施例】実施例について、図面を参照して以下に説明
する。図1は、本発明による傾き検出方法の一実施例を
説明するための図である。特定のマークによって定義さ
れる長方形領域のサイズを、縦がHv、横がHhとす
る。この長方形を、任意の角度θで走査するとき、長方
形の内部の走査線の長さ(ランレングス)Mの分布は図
2のようなヒストグラムになる。すなわち、θが対角線
方向である場合を除いて、鋭いピークとなだらかな分布
曲線を併せ持つ。
Embodiments will be described below with reference to the drawings. FIG. 1 is a diagram for explaining an embodiment of a tilt detecting method according to the present invention. The size of the rectangular area defined by a specific mark is Hv in the vertical direction and Hh in the horizontal direction. When this rectangle is scanned at an arbitrary angle θ, the distribution of the scanning line length (run length) M inside the rectangle becomes a histogram as shown in FIG. That is, it has a sharp peak and a gentle distribution curve, except when θ is in the diagonal direction.

【0015】従って、分布のピーク値を持つ(あるいは
最大値を持つ)ランレングス値は、図1の一定幅の走査
区間(走査距離)Mに相当しており、 Hh/cosθ の値を持つ。従って、スキュー角度θが求まる。
Therefore, the run length value having the peak value (or the maximum value) of the distribution corresponds to the scanning section (scanning distance) M having a constant width in FIG. 1 and has the value of Hh / cos θ. Therefore, the skew angle θ is obtained.

【0016】さらに、ランレングスの頻度分布のピーク
値に寄与する面積(図2のグレイ部分)Sが、 Hvcosθ′−Hh sinθ′ となるはずであるから(走査の本数に対応)、これからス
キュー角度θ′が求まる。図1における面積Sは、図2
における面積Sに対応している。また、距離Lは、長方
形の入力側の角を通過する走査線に対し、出力側の角か
らの垂線の長さである。同様に、図2のなだらかな分布
の面積Nは、図1の上下の3角形の部分(N1+N2)に
対応し、全走査線数は2L=2Hh sinθだから、これ
を、 2Hh sinθ″ と置くと、スキュー角度θ″が求まる。
Further, since the area S (the gray portion in FIG. 2) that contributes to the peak value of the run length frequency distribution should be Hvcosθ'-Hh sinθ '(corresponding to the number of scans), the skew angle is calculated from this. θ'is obtained. The area S in FIG.
Corresponds to the area S in. Further, the distance L is the length of a perpendicular line from the output side corner with respect to the scanning line passing through the input side corner of the rectangle. Similarly, the area N of the gentle distribution in FIG. 2 corresponds to the upper and lower triangular portions (N 1 + N 2 ) in FIG. 1, and the total number of scanning lines is 2L = 2Hh sin θ, so this is 2Hh sin θ ″ Then, the skew angle θ ″ can be obtained.

【0017】図1において、角度θが大きくなるとLは
大きくなり、Mも大きくなる。これにともない、図2に
おいては、ヒストグラムの最大値は小さくなりつつMは
右側にシフトし、Nのなだらかな面積は右方向に拡大す
る。これと逆に、図1において、角度θが小さくなると
Lは小さくなり、Mも小さくなる。これにともない、図
2において、ヒストグラムの最大値は大きくなりつつM
は左側にシフトし、Nのなだらかな面積は左方向に縮小
する。すなわち、角度θがゼロであればLもゼロとな
り、Mは最小になる。これにともない、図2において
は、ヒストグラムの最大値は最も大きくなり、Nのなだ
らかな面積はなくなる。
In FIG. 1, as the angle θ becomes larger, L becomes larger and M becomes larger. Along with this, in FIG. 2, the maximum value of the histogram becomes smaller, M shifts to the right, and the gentle area of N expands to the right. On the contrary, in FIG. 1, when the angle θ becomes smaller, L becomes smaller and M becomes smaller. Along with this, the maximum value of the histogram in FIG.
Shifts to the left, and the gentle area of N shrinks to the left. That is, if the angle θ is zero, L is also zero and M is the minimum. Along with this, in FIG. 2, the maximum value of the histogram becomes the largest, and the smooth area of N disappears.

【0018】当然、スキュー角度θ,θ′,θ″は同一
の値であるはずであるから、これらの平均値が最も確か
らしいスキュー角度となる(θ=(θ+θ′+θ′)/
3)。しかし、ここで注意しなければならないのは、角
度θの正負の符号は不確定であることである。つまり、
求めた角度は、どちら方向に傾いているかわからない。
この測定精度は、図2の頻度分布の精度とランレングス
の精度とに依存する。したがって、対象となる長方形の
サイズは大きいほうが望ましく、かつ、その数が多いほ
うが望ましい。
Of course, since the skew angles θ, θ ′, θ ″ should be the same value, the average value of these is the most probable skew angle (θ = (θ + θ ′ + θ ′) /
3). However, it should be noted here that the positive and negative signs of the angle θ are indeterminate. That is,
I don't know which direction the calculated angle is.
This measurement accuracy depends on the accuracy of the frequency distribution and the accuracy of the run length shown in FIG. Therefore, it is desirable that the size of the target rectangle be large, and that the number be large.

【0019】図3は、本発明による傾き検出方法をバー
コードの傾き(スキュー)検出に適用した場合を示す図
である。図中のABCDは長方形の外側の4隅を示し、
EFGHは長方形の内側の4隅を示しており、長方形E
FGHの内部にバーコードのパターンを示している。こ
こで目的とするコードは2次元平面状に広がったパター
ンで、通常2次元バーコードと呼ばれている。このバー
コードは、長方形を単位とするパターンで構成されてい
る。
FIG. 3 is a diagram showing a case where the inclination detecting method according to the present invention is applied to the inclination (skew) detection of a bar code. ABCD in the figure indicates the four outer corners of the rectangle,
EFGH indicates the inner four corners of the rectangle, and the rectangle E
A barcode pattern is shown inside the FGH. The target code here is a pattern spread in a two-dimensional plane and is usually called a two-dimensional bar code. This bar code is composed of a pattern in units of rectangles.

【0020】図3における長方形EFGHの中央部は、
いわゆる2次元に広がったバーコードであり、上下の斜
線部はその存在範囲を示す図形であり、左右の画像はマ
ークのスタートまたはストップを表わす。通常の読み取
り光学系では、図3の矢印のような光スポットが走査
し、その過程でスタートとストップの記号を検知し、そ
の間に存在する信号列を検出する。一般に、走査は平行
に複数本連続して行われるから、信号列をメモリ上で再
配列することによって2次元のコードを復元できる。ま
た、マークの方位が著しく傾いている場合でも、従来の
光学系は8方向以上多様な方向の走査を試みるから、端
から端まで走査線が通ることを必要とする条件はほとん
どの場合満たされる。
The central portion of the rectangle EFGH in FIG.
It is a so-called two-dimensionally spread bar code, and the upper and lower diagonal lines are figures showing the existing range, and the left and right images represent the start or stop of the mark. In a normal reading optical system, a light spot as shown by an arrow in FIG. 3 scans, and in the process, a start and stop symbol is detected and a signal train existing therebetween is detected. Generally, a plurality of scans are continuously performed in parallel, so that a two-dimensional code can be restored by rearranging a signal sequence on a memory. Further, even when the azimuth of the mark is significantly inclined, the conventional optical system attempts to scan in various directions of 8 directions or more, so that the condition that the scanning line passes from end to end is satisfied in most cases. .

【0021】しかし、複写機やファクシミリのスキャナ
で、前記マークを読み取る場合は、走査は1回のみであ
る。したがって、画像が入力されたあと、メモリ上でマ
ークの傾き(スキュー)の検出と補正を行わなければな
らない。本発明は、このような1回の走査で検出するス
キューの検出に関するもので、特に、リアルタイムでの
検出を目指したものである。
However, when reading the mark with a scanner of a copying machine or a facsimile, the scanning is performed only once. Therefore, after the image is input, it is necessary to detect and correct the inclination (skew) of the mark on the memory. The present invention relates to the detection of skew detected by such a single scan, and particularly aims at detection in real time.

【0022】なお、図3においては、バーコードを取り
囲む長方形のパターンを示しているが、この長方形のパ
ターンは、バーコードを取り囲むことなく、近傍に設け
てもよい。また、図3においては、長方形のパターンが
一定の周期の規則的パターンである場合を示してある
が、単純な枠状の線であってもよいことは、図1からも
明らかである。複写機などでコピーするシート原稿の傾
きを検出する時に適用する場合には、シート原稿が長方
形であり、その境界線(エッジ)を利用することによ
り、スキュー角度を検出することができる。また、枠状
の線を黒い幅を有する枠状のものとしてもよい。また、
図3では、長方形ABCDを対象とする場合と、長方形
EFGHを対象とする場合の2通りの測定が可能であ
る。
Although FIG. 3 shows a rectangular pattern surrounding the barcode, this rectangular pattern may be provided in the vicinity without surrounding the barcode. Further, although FIG. 3 shows the case where the rectangular pattern is a regular pattern with a constant period, it is clear from FIG. 1 that it may be a simple frame-shaped line. When applied when detecting the inclination of a sheet original to be copied by a copying machine or the like, the sheet original has a rectangular shape, and the skew angle can be detected by using the boundary line (edge). Further, the frame-shaped line may be a frame-shaped line having a black width. Also,
In FIG. 3, two types of measurements are possible, one for the rectangle ABCD and one for the rectangle EFGH.

【0023】図4は、本発明による傾き検出方法を説明
するためのフローチャートである。以下、各ステップに
従って順に説明する。まず、バーコードの傾き検出を開
始すると、バーコードを取り囲む長方形のパターンの走
査を進める(step1)。次に、対象とする長方形領域を
走査しつつあるかどうかを判断する(step2)。すなわ
ち、バーコードが長方形の内部にあるかどうかを判断す
る。Noであれば、前記step1に戻り、Yesであれば、
次に長方形の内部の走査距離(ランレングス)をカウン
トする(step3)。次に、対象とする長方形領域の走査
が終了したかどうかを判断し(step4)、Noであれば、
前記step1へ戻り、Yesであれば、次にヒストグラムを
求める(step5)。さらに、ヒストグラムの最大値から
予想されるスキュー角度θを求める(step6)。
FIG. 4 is a flow chart for explaining the tilt detecting method according to the present invention. Hereinafter, each step will be described in order. First, when the barcode inclination detection is started, scanning of a rectangular pattern surrounding the barcode is advanced (step 1). Next, it is determined whether or not the target rectangular area is being scanned (step 2). That is, it is determined whether the barcode is inside the rectangle. If No, return to step 1 above, and if Yes,
Next, the scanning distance (run length) inside the rectangle is counted (step 3). Next, it is judged whether or not the scanning of the target rectangular area is completed (step 4).
Returning to the step 1, if Yes, then a histogram is obtained (step 5). Further, the skew angle θ expected from the maximum value of the histogram is calculated (step 6).

【0024】このように、本発明は、例えば、2次元状
に広がるバーコードに関して、このバーコードを取り囲
む、あるいは、これに付随する長方形状のパターンが存
在するとき、この長方形の内部を通過する走査線の長さ
の頻度分布から、長方形のスキューの角度を算出する。
また、長方形の縁を構成するパターンは、一定の周期の
規則的パターンであり、さらに、3つ以上の独立した計
測値を使ってスキュー角度を求め、得られた値の統計的
演算結果を、最もらしいスキュー角度とするものであ
る。
As described above, in the present invention, for example, regarding a two-dimensionally spread bar code, when a rectangular pattern surrounding the bar code or accompanying the bar code exists, the bar code passes through the inside of the rectangle. The skew angle of the rectangle is calculated from the frequency distribution of the lengths of the scanning lines.
Further, the pattern forming the edge of the rectangle is a regular pattern with a constant period, and further, the skew angle is obtained using three or more independent measurement values, and the statistical calculation result of the obtained value is This is the most likely skew angle.

【0025】このように、本発明による傾き検出方法
は、特定の図形(長方形)を利用するが、この図形が帳
票の特定の部分に存在する必要は必ずしもなく、帳票の
読み取り方向は自由である。すなわち、帳票を90度回
転して読み取らせても構わない。また、帳票の傾きの角
度算出方法は、前述のとおり3通りあり、これらによっ
て求められる角度は互いに独立である。従って、3つの
各角度を平均化することで検出誤差を小さく抑えること
ができる。さらに、帳票自体が長方形であることを利用
して明示的に長方形を印刷することなく、帳票の輪郭を
利用して傾き角度を求めることができる。あるいは、帳
票に存在する他の目的のための長方形(例えば表など)
を利用することも可能である。しかしながら、長方形を
読み終わるまで、傾き角度がわからないから、その間の
画像を蓄えるために十分なサイズの画像メモリが必要と
なる。
As described above, the inclination detecting method according to the present invention uses a specific figure (rectangle), but this figure does not necessarily have to exist in a specific portion of the form, and the direction of reading the form is arbitrary. . That is, the form may be rotated by 90 degrees and read. Further, as described above, there are three methods for calculating the inclination angle of the form, and the angles obtained by these are independent of each other. Therefore, the detection error can be suppressed to be small by averaging each of the three angles. Furthermore, the inclination angle can be obtained using the contour of the form without explicitly printing the rectangle by utilizing the fact that the form itself is rectangular. Or a rectangle for other purposes that exists in the form (eg a table)
It is also possible to use. However, since the tilt angle is not known until the reading of the rectangle is completed, an image memory of a sufficient size is necessary to store the image in the meantime.

【0026】[0026]

【発明の効果】以上の説明から明らかなように、本発明
によると、パターンである長方形領域の走査を行い、そ
の長方形内部の走査距離(ランレングス)の頻度分布か
ら、ヒストグラムを求め、このヒストグラムの分布から
予想されるスキュー角度を求める。これにより、スキュ
ー角度の検出を高速で実現することができる。
As is apparent from the above description, according to the present invention, a rectangular area that is a pattern is scanned, a histogram is obtained from the frequency distribution of the scanning distance (run length) inside the rectangle, and this histogram is obtained. The skew angle expected from the distribution of is calculated. This makes it possible to detect the skew angle at high speed.

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

【図1】 本発明による傾き検出方法の一実施例を説明
するための図である。
FIG. 1 is a diagram for explaining an embodiment of a tilt detection method according to the present invention.

【図2】 本発明における長方形領域の内部の走査線の
長さ分布を示す図である。
FIG. 2 is a diagram showing a length distribution of scanning lines inside a rectangular region in the present invention.

【図3】 本発明による傾き検出方法をバーコードの傾
き検出に適用した場合を示す図である。
FIG. 3 is a diagram showing a case where the inclination detection method according to the present invention is applied to inclination detection of a barcode.

【図4】 本発明による傾き検出方法を説明するための
フローチャートである。
FIG. 4 is a flow chart for explaining a tilt detection method according to the present invention.

Claims (7)

【特許請求の範囲】[Claims] 【請求項1】 長方形のパターンに対して該長方形の内
部を通過する走査線の長さの頻度分布を求め、前記長方
形のスキューの角度を算出することを特徴とする傾き検
出方法。
1. A tilt detecting method comprising: calculating a frequency distribution of lengths of scanning lines passing through the inside of a rectangular pattern and calculating a skew angle of the rectangular pattern.
【請求項2】 2次元状に拡がるバーコードを取り囲む
か、あるいは該バーコードに付随する長方形のパターン
に対して該長方形の内部を通過する走査線の長さの頻度
分布を求め、前記長方形のスキューの角度を算出するこ
とを特徴とする傾き検出方法。
2. A frequency distribution of the lengths of scanning lines which pass through the inside of a rectangular pattern which surrounds a two-dimensionally expanded bar code or which accompanies the rectangular code is calculated to obtain the rectangular pattern. An inclination detection method, characterized in that a skew angle is calculated.
【請求項3】 前記長方形のパターンが枠状の線あるい
は境界線であることを特徴とする請求項1又は2記載の
傾き検出方法。
3. The tilt detecting method according to claim 1, wherein the rectangular pattern is a frame-shaped line or a boundary line.
【請求項4】 前記長方形の縁を構成するパターンが、
一定の周期の規則的パターンであることを特徴とする請
求項1又は2記載の傾き検出方法。
4. The pattern forming the edges of the rectangle is
The inclination detecting method according to claim 1 or 2, wherein the inclination detecting pattern is a regular pattern having a constant period.
【請求項5】 対象とする長方形領域を走査しているか
どうかを判断する判断手段と、該判断手段により前記長
方形領域を走査している場合に、前記長方形内部の走査
距離をカウントする計数手段と、該計数手段によるカウ
ントされた走査距離の頻度分布のヒストグラムを求める
ヒストグラム作成手段と、該ヒストグラム作成手段によ
り求められたヒストグラムの最大値から予想されるスキ
ュー角度を求めるスキュー角度検出手段とから成ること
を特徴とする傾き検出方法。
5. A judging means for judging whether or not a rectangular area of interest is being scanned, and a counting means for counting a scanning distance inside the rectangle when the rectangular area is being scanned by the judging means. A histogram creating means for obtaining a histogram of the frequency distribution of the scanning distances counted by the counting means, and a skew angle detecting means for obtaining a skew angle expected from the maximum value of the histogram obtained by the histogram creating means. An inclination detection method characterized by:
【請求項6】 前記長方形領域のサイズを縦Hv、横H
hとし、長方形を任意の角度θで走査し、該角度θで走
査した時、前記長方形の入力側の角を通過する走査線に
対し、出力側の角からの垂線の長さをLとする時、走査
距離M=Hh/cosθで求まり、頻度のピーク値に寄与
する面積がS=Hvcosθ−Hhsinθで求まり、L=H
hsinθの関係から、長方形の上下のコーナー部分が寄
与する面積は、上記頻度分布のピーク以外の部分の面積
が、2Hhsinθであるという関係式から求まり、前記
いずれかの関係式よりスキュー角度θを求めることを特
徴とする請求項5記載の傾き検出方法。
6. The size of the rectangular area is Hv in the vertical direction and H in the horizontal direction.
h, the rectangle is scanned at an arbitrary angle θ, and when scanning is performed at the angle θ, the length of a perpendicular line from the output side corner to the scanning line passing through the input side corner of the rectangle is set to L. At this time, the scanning distance M = Hh / cosθ is obtained, and the area contributing to the peak value of the frequency is obtained by S = Hvcosθ−Hhsinθ, L = H
From the relationship of hsinθ, the area contributed by the upper and lower corners of the rectangle is obtained from the relational expression that the area of the portion other than the peak of the frequency distribution is 2Hhsinθ, and the skew angle θ is obtained from any of the relational expressions. The tilt detection method according to claim 5, wherein
【請求項7】 前記関係式から求められたスキュー角度
の平均値を最もらしいスキュー角度としたことを特徴と
する請求項6記載の傾き検出方法。
7. The tilt detecting method according to claim 6, wherein an average value of the skew angles obtained from the relational expression is used as the most probable skew angle.
JP17518894A 1994-04-13 1994-07-27 Tilt detection method Expired - Fee Related JP3350596B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP17518894A JP3350596B2 (en) 1994-04-13 1994-07-27 Tilt detection method

Applications Claiming Priority (3)

Application Number Priority Date Filing Date Title
JP7456294 1994-04-13
JP6-74562 1994-04-13
JP17518894A JP3350596B2 (en) 1994-04-13 1994-07-27 Tilt detection method

Publications (2)

Publication Number Publication Date
JPH07334605A true JPH07334605A (en) 1995-12-22
JP3350596B2 JP3350596B2 (en) 2002-11-25

Family

ID=26415718

Family Applications (1)

Application Number Title Priority Date Filing Date
JP17518894A Expired - Fee Related JP3350596B2 (en) 1994-04-13 1994-07-27 Tilt detection method

Country Status (1)

Country Link
JP (1) JP3350596B2 (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2010277446A (en) * 2009-05-29 2010-12-09 Toshiba Corp Apparatus and method for processing barcode
CN113158704A (en) * 2021-04-07 2021-07-23 福州符号信息科技有限公司 Method and system for rapidly positioning Dotcode code

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2010277446A (en) * 2009-05-29 2010-12-09 Toshiba Corp Apparatus and method for processing barcode
CN113158704A (en) * 2021-04-07 2021-07-23 福州符号信息科技有限公司 Method and system for rapidly positioning Dotcode code
CN113158704B (en) * 2021-04-07 2023-06-09 福州符号信息科技有限公司 Method and system for rapidly positioning Dotcode code

Also Published As

Publication number Publication date
JP3350596B2 (en) 2002-11-25

Similar Documents

Publication Publication Date Title
US6742708B2 (en) Fiducial mark patterns for graphical bar codes
JP4911340B2 (en) Two-dimensional code detection system and two-dimensional code detection program
EP0669593A2 (en) Two-dimensional code recognition method
US7636483B2 (en) Code type determining method and code boundary detecting method
US7949187B2 (en) Character string recognition method and device
JP2004533071A (en) Automatic extraction of graphical barcodes
US4878124A (en) Image inclination detecting method and apparatus
JPS60262284A (en) Image processing
JP4406027B2 (en) Barcode decoding method and apparatus
US6683983B1 (en) Document-inclination detector
JP5145833B2 (en) Two-dimensional code reading device, two-dimensional code reading method, two-dimensional code reading program, and recording medium
US6814291B1 (en) Robust barcode reader
US8267322B2 (en) Method and apparatus for correcting decoding errors in machine-readable symbols
JPH07334605A (en) Tilt detecting method
JP2008276458A (en) Character string recognition method and character string recognition device
JP2006261824A (en) Falsification detecting system and method for detecting falsification
JP2006235786A (en) Image processor, image processing method and computer program
US20100252636A1 (en) Optical recognition code, method for marking the same, method for reading out the same, and articles marked with the same
JP2007094584A (en) Method for detecting two dimensional code, detecting device, and detecting program
JP5470734B2 (en) Image processing apparatus and image processing program
JP5453594B2 (en) Symbol information reading apparatus and symbol information reading method
JP3932201B2 (en) Form type identification device and recording medium
WO2019172916A1 (en) Digital representation
JP2004341616A (en) Bar code reading device
JP2000172777A (en) Method for reading two-dimensional code, two- dimensional code reader and recording medium

Legal Events

Date Code Title Description
FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20080913

Year of fee payment: 6

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

Free format text: PAYMENT UNTIL: 20080913

Year of fee payment: 6

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

Free format text: PAYMENT UNTIL: 20090913

Year of fee payment: 7

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

Free format text: PAYMENT UNTIL: 20090913

Year of fee payment: 7

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

Free format text: PAYMENT UNTIL: 20100913

Year of fee payment: 8

LAPS Cancellation because of no payment of annual fees