JPH11120288A - Shift detecting method for image - Google Patents
Shift detecting method for imageInfo
- Publication number
- JPH11120288A JPH11120288A JP9279112A JP27911297A JPH11120288A JP H11120288 A JPH11120288 A JP H11120288A JP 9279112 A JP9279112 A JP 9279112A JP 27911297 A JP27911297 A JP 27911297A JP H11120288 A JPH11120288 A JP H11120288A
- Authority
- JP
- Japan
- Prior art keywords
- vertical
- image
- horizontal
- value
- black run
- 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.)
- Withdrawn
Links
- 238000000034 method Methods 0.000 title claims abstract description 69
- 238000001514 detection method Methods 0.000 claims abstract description 79
- 238000000605 extraction Methods 0.000 claims abstract description 62
- 238000012545 processing Methods 0.000 claims description 103
- 238000006073 displacement reaction Methods 0.000 claims description 55
- 238000012937 correction Methods 0.000 claims description 27
- 238000011946 reduction process Methods 0.000 claims description 9
- 230000002194 synthesizing effect Effects 0.000 claims 1
- 239000000284 extract Substances 0.000 abstract description 5
- 238000010586 diagram Methods 0.000 description 13
- 238000011156 evaluation Methods 0.000 description 8
- 238000012015 optical character recognition Methods 0.000 description 3
- 102220560241 Calcium/calmodulin-dependent protein kinase type IV_S13A_mutation Human genes 0.000 description 2
- 238000012986 modification Methods 0.000 description 2
- 230000004048 modification Effects 0.000 description 2
- 230000003287 optical effect Effects 0.000 description 2
- 102220560218 Calcium/calmodulin-dependent protein kinase type IV_S12A_mutation Human genes 0.000 description 1
- 241000321384 Gymnadenia rhellicani Species 0.000 description 1
Landscapes
- Character Input (AREA)
Abstract
Description
【0001】[0001]
【発明の属する技術分野】本発明は、例えば表形式の文
書画像を処理する装置等に用いられ、同一の形式の複数
の文書画像の相互のずれを検出する方法に関するもので
ある。BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a method for detecting a mutual shift between a plurality of document images of the same format, which is used, for example, in an apparatus for processing a document image in a table format.
【0002】[0002]
【従来の技術】従来、このような分野の技術としては、
例えば、次のような文献に記載されるものがあった。 文献;橋本新一郎編著、文字認識概論、初版、昭57.3.2
0 発行、電気通信協会、P.199-204 帳票に記載された文書の画像について文字認識処理等の
処理を行うために、その文書の様式の情報に基づいて文
字行の切出しや文字の切出しを行い、文字認識処理を行
うことがある。この場合、帳票に特定の基準点を設け、
文字を読取りたいフィールドの位置を指定する。例え
ば、前記文献に記載されているように、帳票の特定の辺
を基準とするか、又は特別に設けられた基準マークを基
準点として読取りフィールドの位置を設定し、その後、
この読取りフィールドに対して光学式文字認識装置(以
下、OCRという)を用いて文字認識処理を行う。2. Description of the Related Art Conventionally, techniques in such a field include:
For example, there is one described in the following literature. Literature; edited by Hashimoto Shinichiro, Introduction to Character Recognition, First Edition, 57.3.2
0 Publication, Telecommunications Association, P.199-204 In order to perform processing such as character recognition on the image of the document described in the form, cut out character lines and characters based on the information on the format of the document. Perform character recognition processing. In this case, set a specific reference point on the form,
Specify the position of the field from which you want to read characters. For example, as described in the above-mentioned document, the position of the reading field is set with reference to a specific side of the form or with a specially provided reference mark as a reference point,
A character recognition process is performed on the read field using an optical character recognition device (hereinafter, referred to as OCR).
【0003】[0003]
【発明が解決しようとする課題】しかしながら、従来の
文字認識処理における読取りフィールドの位置の設定で
は、次のような課題があった。OCR専用に作成された
スキャナ及び帳票等を使用し、この帳票等の辺の位置を
特定できる場合は、従来のような読取りフィールドの位
置の設定方法が用いられるが、近年、帳票等の辺の位置
を特定できない汎用のスキャナを用いたり、或いはOC
Rの使用を前提としない汎用の帳票の処理を行う需要が
大きくなっている。ところが、汎用のスキャナを用いて
帳票の文書画像を読み込んだ場合、帳票等の辺の位置を
特定できないので、この文書画像中の文書の位置がこの
スキャナの読取りフィールドに対してずれることがあ
り、該帳票の辺の位置を判別して該取りフィールドの位
置を合わせることは困難である。又、汎用の帳票では、
OCR専用の帳票に設けられている基準マークが無い。
そのため、汎用のスキャナを用いたり、汎用の帳票の処
理を行う場合では、該汎用の帳票の様式の情報を設定し
た画像と、この様式の情報を利用して処理を行う必要の
ある画像との間のずれを該汎用の帳票から検出し、この
ずれを補整する必要があるという課題があった。However, setting the position of the read field in the conventional character recognition processing has the following problems. When the position of the side of the form or the like can be specified by using a scanner and a form created exclusively for the OCR, the conventional setting method of the position of the reading field is used. Use a general-purpose scanner whose position cannot be specified, or use an OC
There is an increasing demand for processing general-purpose forms that do not assume the use of R. However, when a document image of a form is read using a general-purpose scanner, the position of the side of the form cannot be specified, and the position of the document in the document image may be shifted with respect to the reading field of the scanner. It is difficult to determine the position of the side of the form and match the position of the take-out field. Also, in general-purpose forms,
There is no reference mark provided on the OCR-dedicated form.
Therefore, when a general-purpose scanner is used or a general-purpose form is processed, an image in which the format information of the general-purpose form is set and an image that needs to be processed using the information of the format are used. There has been a problem that it is necessary to detect a shift between the general-purpose forms and correct the shift.
【0004】[0004]
【課題を解決するための手段】前記課題を解決するため
に、本発明のうちの請求項1〜4に係る発明は、画像の
ずれ検出方法において、基準となる位置に罫線で表現さ
れた表中に第1の文書を記載した第1の帳票の画像を電
気信号化して第1の画像を作成しておく。そして、前記
第1の画像を所定の縮小率で縮小して第1の縮小画像を
生成する第1の画像縮小処理と、前記第1の縮小画像中
の横方向に所定の第1の長さ以上連続している黒画素で
構成された黒ランについて、該黒画素の数を該横方向に
集計した第1の横黒ラン・ヒストグラムを該横方向の走
査線毎に作成する第1の横黒ラン・ヒストグラム作成処
理と、前記第1の縮小画像中の縦方向に所定の第2の長
さ以上連続している黒画素で構成された黒ランについ
て、該黒画素の数を該縦方向に集計した第1の縦黒ラン
・ヒストグラムを該縦方向の走査線毎に作成する第1の
縦黒ラン・ヒストグラム作成処理と、前記第1の横黒ラ
ン・ヒストグラム上の単数又は複数のピークの縦方向の
位置と大きさとを粗い縦方向の特徴量として抽出する粗
縦特徴量抽出処理と、前記第1の縦黒ラン・ヒストグラ
ム上の単数又は複数のピークの横方向の位置と大きさと
を粗い横方向の特徴量として抽出する粗横特徴量抽出処
理と、前記粗い縦方向の特徴量として抽出された各ピー
クについて、前記第1の画像の該各ピークの位置に対応
する部分の横方向の各走査線上の黒画素を計数し、この
計数値が最大になる該走査線の位置を該各ピークにおけ
る精細な縦方向の特徴量として抽出する精細縦特徴量抽
出処理と、前記粗い横方向の特徴量として抽出された各
ピークについて、前記第1の画像の該各ピークの位置に
対応する部分の縦方向の各走査線上の黒画素を計数し、
この計数値が最大になる該走査線の位置を該各ピークに
おける精細な横方向の特徴量として抽出する精細横特徴
量抽出処理とを、行うようにしている。According to another aspect of the present invention, there is provided a method for detecting a displacement of an image, comprising a table represented by a ruled line at a reference position. An image of a first document in which a first document is described is converted into an electric signal to create a first image. And a first image reduction process for reducing the first image at a predetermined reduction rate to generate a first reduced image; and a predetermined first length in the horizontal direction in the first reduced image. For a black run composed of continuous black pixels as described above, a first horizontal black run histogram in which the number of the black pixels is totaled in the horizontal direction is created for each horizontal scanning line. Black run histogram creation processing, and for a black run composed of black pixels that are continuous in the first reduced image in a vertical direction for a predetermined second length or more, the number of the black pixels is calculated in the vertical direction. A first vertical black run / histogram creating process for creating the first vertical black run / histogram totalized for each vertical scanning line; and one or more peaks on the first horizontal black run / histogram Vertical feature that extracts the vertical position and size of the image as coarse vertical features An extraction process, a coarse / horizontal feature extraction process for extracting a horizontal position and a size of one or a plurality of peaks on the first vertical black run histogram as a coarse horizontal feature, For each of the peaks extracted as the characteristic amounts of the above, the number of black pixels on each of the horizontal scanning lines in a portion corresponding to the position of each of the peaks in the first image is counted. And a fine vertical feature value extraction process of extracting the position of each of the peaks as a fine vertical feature value of each of the peaks, and for each of the peaks extracted as the coarse horizontal feature value of each of the peaks of the first image. Count the black pixels on each vertical scanning line of the part corresponding to the position,
A fine horizontal feature value extraction process of extracting the position of the scanning line at which the count value becomes the maximum as a fine horizontal feature value at each peak is performed.
【0005】更に、前記第1の文書の位置に対する位置
のずれを検出する必要のある第2の文書を該第1の文書
と同一の形式の表中に記載した第2の帳票の画像を電気
信号化して第2の画像を作成しておく。そして、前記第
2の画像を前記第1の画像縮小処理と同一の縮小率で縮
小して第2の縮小画像を生成する第2の画像縮小処理
と、前記第2の縮小画像中の横方向に所定の第3の長さ
以上連続している黒画素で構成された黒ランについて、
該黒画素の数を該横方向に集計した第2の横黒ラン・ヒ
ストグラムを該横方向の走査線毎に作成する第2の横黒
ラン・ヒストグラム作成処理と、前記第2の縮小画像中
の縦方向に所定の第4の長さ以上連続している黒画素で
構成された黒ランについて、該黒画素の数を該縦方向に
集計した第2の縦黒ラン・ヒストグラムを該縦方向の走
査線毎に作成する第2の縦黒ラン・ヒストグラム作成処
理と、前記粗い縦方向の特徴量の各ピークの位置を複数
用意された所定値Yi(i=1,2,…,N)だけずら
した状態で前記第2の横黒ラン・ヒストグラムと縦方向
に比較し、最も差が小さいときの該所定値Ykを縦ずれ
仮検出値として生成する縦ずれ仮検出処理と、前記粗い
横方向の特徴量の各ピークの位置を複数用意された所定
値Xi(i=1,2,…,N)だけずらした状態で前記
第2の縦黒ラン・ヒストグラムと横方向に比較し、最も
差が小さいときの該所定値Xkを横ずれ仮検出値として
生成する横ずれ仮検出処理と、前記粗い縦方向の特徴量
の各ピークについて、該各ピークの位置を前記縦ずれ仮
検出値Ykだけずらした位置に対応する前記第2の画像
の部分の黒画素数を横方向の各走査線について計数し、
最も計数値が大きくなったときの走査線の位置と前記精
細な縦方向の特徴量として記録された該各ピークに対応
する走査線の位置との差をそれぞれとり、該各差の平均
値を該第2の画像の前記第1の画像に対する縦方向のず
れとして検出する縦ずれ検出処理と、前記粗い横方向の
特徴量の各ピークについて、該各ピークの位置を前記横
ずれ仮検出値Xkだけずらした位置に対応する前記第2
の画像の部分の黒画素数を縦方向の各走査線について計
数し、最も計数値が大きくなったときの走査線の位置と
前記精細な横方向の特徴量として記録された該各ピーク
に対応する走査線の位置との差をそれぞれとり、該各差
の平均値を該第2の画像の前記第1の画像に対する横方
向のずれとして検出する横ずれ検出処理と、前記縦ずれ
検出処理で検出された前記第2の画像の前記第1の画像
に対する縦方向のずれと前記横ずれ検出処理で検出され
た前記第2の画像の前記第1の画像に対する横方向のず
れとを合成することにより、前記第2の文書の前記第1
の文書の位置に対する位置のずれを検出するずれ検出処
理とを、行うようにしている。Further, an image of a second document in which a second document whose positional deviation from the position of the first document needs to be detected is described in a table of the same format as that of the first document, and the A second image is created by signalization. And a second image reduction process for reducing the second image at the same reduction rate as the first image reduction process to generate a second reduced image; and a horizontal direction in the second reduced image. A black run composed of black pixels continuous for a predetermined third length or more,
A second horizontal black run histogram creating process for creating a second horizontal black run histogram in which the number of the black pixels is totaled in the horizontal direction for each horizontal scanning line; For a black run composed of black pixels that are continuous for a predetermined fourth length or more in the vertical direction, a second vertical black run histogram in which the number of the black pixels is totaled in the vertical direction is calculated in the vertical direction. A second vertical black run / histogram generation process for each scanning line, and a plurality of predetermined positions Yi (i = 1, 2,..., N) of a plurality of peak positions of the coarse vertical feature amount. The second horizontal black run histogram is compared with the second horizontal black run histogram in the vertical direction in the shifted state, and the predetermined value Yk when the difference is the smallest is generated as a temporary vertical deviation detection value. Predetermined values Xi (i = 1, 2) in which a plurality of peak positions of the directional feature amount are prepared. ,..., N), the second vertical black run histogram is compared with the second vertical black run histogram in the horizontal direction, and the predetermined value Xk when the difference is the smallest is generated as a temporary lateral displacement detection value; For each peak of the coarse vertical feature amount, the number of black pixels in the second image portion corresponding to a position obtained by shifting the position of each peak by the vertical shift tentative detection value Yk is shown in each horizontal scanning line. For
The difference between the position of the scanning line when the count value is the largest and the position of the scanning line corresponding to each of the peaks recorded as the fine vertical feature amount is calculated, and the average value of each difference is calculated. A vertical displacement detection process for detecting a vertical displacement of the second image with respect to the first image, and for each peak of the coarse horizontal feature amount, the position of each peak is calculated by the lateral displacement temporary detection value Xk. The second position corresponding to the shifted position
The number of black pixels in the image portion is counted for each scanning line in the vertical direction, and the number of black pixels corresponding to the position of the scanning line when the count value is the largest and each of the peaks recorded as the fine horizontal feature amount And a vertical deviation detection process for detecting the average of the respective differences as a lateral deviation of the second image with respect to the first image. By combining the vertical displacement of the second image with respect to the first image and the lateral displacement of the second image detected by the lateral displacement detection processing with respect to the first image, The first of the second document
And a displacement detection process for detecting a displacement of the document from the position of the document.
【0006】このような構成を採用したことにより、第
1の画像縮小処理において、第1の画像が所定の縮小率
で縮小されて第1の縮小画像が生成される。第1の横黒
ラン・ヒストグラム作成処理において、前記第1の縮小
画像中の横方向の黒ランについて、該黒ランを横方向に
投影した第1のヒストグラムが該横方向の走査線毎に作
成される。第1の縦黒ラン・ヒストグラム作成処理にお
いて、前記第1の縮小画像中の縦方向の黒ランについ
て、該黒ランを該縦方向に投影した第2のヒストグラム
が該縦方向の走査線毎に作成される。粗縦特徴量抽出処
理において、前記第1のヒストグラム上の単数又は複数
のピークの縦方向の位置と大きさとが粗い縦方向の特徴
量として抽出される。粗横特徴量抽出処理において、前
記第2のヒストグラム上の単数又は複数のピークの横方
向の位置と大きさとが粗い横方向の特徴量として抽出さ
れる。精細縦特徴量抽出処理において、前記粗い縦方向
の特徴量として抽出された各ピークについて、前記第1
の画像の該各ピークの位置に対応する部分の横方向の各
走査線上の黒画素が計数され、この計数値が最大になる
該走査線の位置が該各ピークにおける精細な縦方向の特
徴量として抽出される。精細横特徴量抽出処理におい
て、前記粗い横方向の特徴量として抽出された各ピーク
について、前記第1の画像の該各ピークの位置に対応す
る部分の縦方向の各走査線上の黒画素が計数され、この
計数値が最大になる該走査線の位置が該各ピークにおけ
る精細な横方向の特徴量として抽出される。By employing such a configuration, in the first image reduction processing, the first image is reduced at a predetermined reduction ratio to generate a first reduced image. In a first horizontal black run / histogram creation process, for a horizontal black run in the first reduced image, a first histogram in which the black run is projected in the horizontal direction is created for each horizontal scan line. Is done. In the first vertical black run / histogram creation process, for a vertical black run in the first reduced image, a second histogram obtained by projecting the black run in the vertical direction is generated for each vertical scan line. Created. In the coarse vertical feature amount extraction processing, the vertical position and size of one or more peaks on the first histogram are extracted as coarse vertical feature amounts. In the coarse horizontal feature value extraction processing, the horizontal position and magnitude of one or more peaks on the second histogram are extracted as coarse horizontal feature values. In the fine vertical feature value extraction process, the first peak extracted as the coarse vertical feature value is subjected to the first
The black pixels on each scanning line in the horizontal direction of the portion corresponding to the position of each peak of the image are counted, and the position of the scanning line at which the counted value is the maximum is a fine vertical feature amount at each peak. Is extracted as In the fine horizontal feature amount extraction processing, for each peak extracted as the coarse horizontal feature amount, the number of black pixels on each vertical scanning line in a portion corresponding to the position of each peak in the first image is counted. Then, the position of the scanning line at which the count value becomes maximum is extracted as a fine horizontal feature amount at each peak.
【0007】第2の画像縮小処理において、第2の画像
が前記第1の画像縮小処理と同一の縮小率で縮小されて
第2の縮小画像が生成される。第2の横黒ラン・ヒスト
グラム作成処理において、前記第2の縮小画像中の横方
向の黒ランについて、該黒ランを該横方向に投影した第
3のヒストグラムが該横方向の走査線毎に作成される。
第2の縦黒ラン・ヒストグラム作成処理において、前記
第2の縮小画像中の縦方向の黒ランについて、該黒ラン
を縦方向に投影した第4のヒストグラムが該縦方向の走
査線毎に作成される。縦ずれ仮検出処理において、前記
粗い縦方向の特徴量の各ピークの位置を所定値Yi(i
=1,2,…,N)だけずらした状態で該各ピークを形
成する各ヒストグラムと前記第3のヒストグラムとが縦
方向に比較され、最も差が小さいときの該所定値Ykが
縦ずれ仮検出値として生成される。横ずれ仮検出処理に
おいて、前記粗い横方向の特徴量の各ピークの位置を所
定値Xi(i=1,2,…,N)だけずらした状態で該
各ピークを形成する各ヒストグラムと前記第4のヒスト
グラムとが横方向に比較され、最も差が小さいときの該
所定値Xkが横ずれ仮検出値として生成される。In the second image reduction processing, the second image is reduced at the same reduction ratio as in the first image reduction processing to generate a second reduced image. In the second horizontal black run / histogram creation process, for a horizontal black run in the second reduced image, a third histogram obtained by projecting the black run in the horizontal direction is generated for each horizontal scan line. Created.
In the second vertical black run / histogram creation processing, for the vertical black run in the second reduced image, a fourth histogram in which the black run is projected in the vertical direction is created for each vertical scan line. Is done. In the vertical displacement tentative detection processing, the position of each peak of the coarse vertical feature amount is determined by a predetermined value Yi (i
= 1, 2,..., N), the respective histograms forming the respective peaks and the third histogram are compared in the vertical direction, and the predetermined value Yk when the difference is the smallest is determined as the vertical deviation temporary. Generated as a detection value. In the lateral displacement temporary detection processing, the histograms forming the respective peaks in a state where the positions of the respective peaks of the coarse lateral feature amount are shifted by a predetermined value Xi (i = 1, 2,... Is compared in the horizontal direction, and the predetermined value Xk at the time when the difference is the smallest is generated as a temporary displacement detection value.
【0008】縦ずれ検出処理において、前記粗い縦方向
の特徴量の各ピークについて、該各ピークの位置を前記
縦ずれ仮検出値Ykだけずらした位置に対応する前記第
2の画像の部分の黒画素数が横方向の各走査線について
計数され、最も計数値が大きくなったときの走査線の位
置と前記精細な縦方向の特徴量として記録された該各ピ
ークに対応する走査線の位置との差がそれぞれとられ、
該各差の平均値が該第2の画像の前記第1の画像に対す
る縦方向のずれとして検出される。横ずれ検出処理にお
いて、前記粗い横方向の特徴量の各ピークについて、該
各ピークの位置を前記横ずれ仮検出値Xkだけずらした
位置に対応する前記第2の画像の部分の黒画素数が縦方
向の各走査線について計数され、最も計数値が大きくな
ったときの走査線の位置と前記精細な横方向の特徴量と
して記録された該各ピークに対応する走査線の位置との
差がそれぞれとられ、該各差の平均値が該第2の画像の
前記第1の画像に対する横方向のずれとして検出され
る。ずれ検出処理において、前記縦ずれ検出処理で検出
された前記第2の画像の前記第1の画像に対する縦方向
のずれと、前記横ずれ検出処理で検出された前記第2の
画像の前記第1の画像に対する横方向のずれとが合成さ
れ、前記第2の画像の前記第1の画像に対するずれを検
出されて前記第2の文書の前記第1の文書の位置に対す
る位置のずれが検出される。In the vertical displacement detection processing, for each peak of the coarse vertical feature amount, the black of the portion of the second image corresponding to a position where the position of each peak is shifted by the vertical displacement temporary detection value Yk. The number of pixels is counted for each scanning line in the horizontal direction, the position of the scanning line when the count value is the largest, and the position of the scanning line corresponding to each peak recorded as the fine vertical feature amount. The difference of each is taken,
The average value of the differences is detected as a vertical displacement of the second image with respect to the first image. In the lateral displacement detection process, for each peak of the coarse lateral feature amount, the number of black pixels in the portion of the second image corresponding to a position where the position of each peak is shifted by the temporary lateral displacement temporary detection value Xk is increased in the vertical direction. Is counted for each scanning line, and the difference between the position of the scanning line when the count value is the largest and the position of the scanning line corresponding to each peak recorded as the fine horizontal feature amount is respectively The average value of the differences is detected as a lateral shift of the second image with respect to the first image. In the displacement detection process, a vertical displacement of the second image detected in the vertical displacement detection process with respect to the first image, and a first displacement of the second image detected in the lateral displacement detection process. The displacement in the horizontal direction with respect to the image is combined, and the displacement of the second image with respect to the first image is detected, and the displacement of the second document with respect to the position of the first document is detected.
【0009】本発明のうちの請求項5に係る発明は、請
求項2に係る発明の粗縦特徴量抽出処理において抽出さ
れたピークの数が予め定められた数以下の場合は前記第
1の長さの値を小さく修正し、再度前記第1の横黒ラン
・ヒストグラム作成処理を必要回数行い、該ピークの数
が該予め定められた数よりも大きくなった時の該第1の
長さの値を横黒ラン閾値として記録する横黒ラン閾値修
正処理と、請求項1に係る発明の粗横特徴量抽出処理に
おいて抽出されたピークの数が予め定められた数以下の
場合は前記第2の長さの値を小さく修正し、再度第2の
縦黒ラン・ヒストグラム作成処理を必要回数行い、該ピ
ークの数が該予め定められた数よりも大きくなった時の
該第2の長さの値を縦黒ラン閾値として記録する縦黒ラ
ン閾値修正処理とを行う。そして、前記第2の横黒ラン
・ヒストグラム作成処理における前記所定の第3の長さ
として前記横黒ラン閾値を使用し、前記第2の縦黒ラン
・ヒストグラム作成処理における前記所定の第4の長さ
として前記縦黒ラン閾値を使用するようにしている。According to a fifth aspect of the present invention, in the case where the number of peaks extracted in the rough vertical feature amount extraction processing according to the second aspect of the present invention is equal to or less than a predetermined number, the first The length value is corrected to a small value, and the first horizontal black run histogram creation process is performed a required number of times again. The first length when the number of the peaks becomes larger than the predetermined number is obtained. And a horizontal black run threshold value correction process for recording the value of the horizontal black run threshold value as a horizontal black run threshold value. 2 is corrected to a smaller value, and the second vertical black run / histogram creation processing is performed a required number of times again. When the number of the peaks becomes larger than the predetermined number, the second length is calculated. Black run threshold correction processing to record the value of Do. Then, the horizontal black run threshold is used as the predetermined third length in the second horizontal black run / histogram creation processing, and the predetermined fourth length in the second vertical black run / histogram creation processing is used. The vertical black run threshold is used as the length.
【0010】このような構成を採用したことにより、粗
縦特徴量抽出処理において抽出されたピークの数が予め
定められた数以下の場合、横黒ラン閾値修正処理におい
て、前記第1の長さの値が小さく修正され、再度第1の
横黒ラン・ヒストグラム作成処理が必要回数行われ、該
ピークの数が該予め定められた数よりも大きくなった時
の該第1の長さの値が横黒ラン閾値として記録される。
前記粗横特徴量抽出処理において抽出されたピークの数
が予め定められた数以下の場合、縦黒ラン閾値修正処理
において、前記第2の長さの値が小さく修正され、再度
第2の縦黒ラン・ヒストグラム作成処理が必要回数行わ
れ、該ピークの数が該予め定められた数よりも大きくな
った時の該第2の長さの値が縦黒ラン閾値として記録さ
れる。そして、第2の横黒ラン・ヒストグラム作成処理
における所定の第3の長さとして前記横黒ラン閾値が使
用され、第2の縦黒ラン・ヒストグラム作成処理におけ
る所定の第4の長さとして前記縦黒ラン閾値が使用され
る。そのため、第1の文書が短い罫線で構成された様式
の文書であっても、粗い縦方向の特徴量、粗い横方向の
特徴量、精細な縦方向の特徴量、及び精細な横方向の特
徴量が抽出される。従って、前記課題を解決できるので
ある。By adopting such a configuration, when the number of peaks extracted in the rough vertical feature amount extraction processing is equal to or smaller than a predetermined number, the first length is corrected in the horizontal black run threshold correction processing. Is corrected to a small value, the first horizontal black run histogram creation process is performed a required number of times again, and the value of the first length when the number of peaks becomes larger than the predetermined number Is recorded as the horizontal black run threshold.
If the number of peaks extracted in the coarse / horizontal feature extraction processing is equal to or less than a predetermined number, the value of the second length is corrected to be small in the vertical black run threshold correction processing, and the second vertical A black run histogram creation process is performed a required number of times, and the value of the second length when the number of the peaks becomes larger than the predetermined number is recorded as a vertical black run threshold. Then, the horizontal black run threshold is used as a predetermined third length in the second horizontal black run / histogram creation processing, and the horizontal black run threshold is used as the predetermined fourth length in the second vertical black run / histogram creation processing. A vertical black run threshold is used. Therefore, even if the first document is a document of a style composed of short ruled lines, a coarse vertical feature, a coarse horizontal feature, a fine vertical feature, and a fine horizontal feature are provided. The quantity is extracted. Therefore, the above problem can be solved.
【0011】[0011]
【発明の実施の形態】第1の実施形態 図1は、本発明の第1の実施形態の画像のずれ検出方法
を実施するための画像のずれ検出装置の構成図である。
この画像のずれ検出装置は、第1の画像Aを予め定めら
れた率で縮小して解像度を低くした縮小画像S1を作成
する画像縮小部1を有している。画像Aは、フォーマッ
ト情報の登録時の文書等、位置の基準となる文書が記載
された帳票を光学的な手法等によって電気信号化したも
のである。画像縮小部1の出力側には、横黒ラン・ヒス
トグラム作成部2及び縦黒ラン・ヒストグラム作成部3
が接続されている。横黒ラン・ヒストグラム作成部2
は、縮小画像S1について、黒画素が予め定められた長
さ以上連続している黒ランを横方向の各走査線毎に検出
し、該黒ランを構成する画素数を計数して横黒ラン・ヒ
ストグラムS2を作成するものである。縦黒ラン・ヒス
トグラム作成部3は、縮小画像S1について、黒画素が
予め定められた長さ以上連続している黒ランを縦方向の
各走査線毎に検出し、該黒ランを構成する画素数を計数
して縦黒ラン・ヒストグラムS3を作成するものであ
る。DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS First Embodiment FIG. 1 is a block diagram of an image shift detecting device for implementing an image shift detecting method according to a first embodiment of the present invention.
The image shift detecting apparatus includes an image reducing unit 1 that reduces a first image A at a predetermined rate to create a reduced image S1 having a reduced resolution. The image A is a form in which a document serving as a position reference, such as a document at the time of registration of format information, is converted into an electric signal by an optical method or the like. On the output side of the image reduction unit 1, a horizontal black run / histogram creation unit 2 and a vertical black run / histogram creation unit 3
Is connected. Horizontal black run / histogram creation unit 2
In the reduced image S1, a black run in which black pixels are continuous for a predetermined length or more is detected for each scanning line in the horizontal direction, and the number of pixels constituting the black run is counted. -Create the histogram S2. The vertical black run / histogram creation unit 3 detects black runs in which black pixels continue for a predetermined length or more for each scanning line in the vertical direction for the reduced image S1, and detects pixels constituting the black runs. The number is counted to create the vertical black run histogram S3.
【0012】横黒ラン・ヒストグラム作成部2の出力側
には、横黒ラン・ヒストグラムS2から単数又は複数の
ピークを検出し、該ピークの位置と大きさを粗縦特徴量
S4として生成する粗縦特徴量抽出部4が接続されてい
る。粗縦特徴量抽出部4は、例えば横黒ラン・ヒストグ
ラムS2が一定値以上となる範囲をピークとし、この範
囲のヒストグラムの計数値の和を該ピークの大きさと
し、粗縦特徴量S4として抽出するものである。縦黒ラ
ン・ヒストグラム作成部3の出力側には、縦黒ラン・ヒ
ストグラムS3から単数又は複数のピークを検出し、該
ピークの位置と大きさを粗横特徴量S5として抽出する
粗横特徴量抽出部5が接続されている。粗横特徴量抽出
部5は、例えば縦黒ラン・ヒストグラムS3が一定値以
上となる範囲をピークとし、この範囲のヒストグラムの
計数値の和を該ピークの大きさとし、粗横特徴量S5と
して生成するものである。粗縦特徴量抽出部4の出力側
には、精細縦特徴量抽出部6が接続されている。精細縦
特徴量抽出部6は、粗縦特徴量S4の各ピークの範囲に
対応する画像Aの部分について各横方向の走査線毎に黒
画素数を計数し、最も計数値が大きくなる走査線の縦方
向の位置を該ピークにおける精細縦特徴量S6として抽
出するものである。粗横特徴量抽出部5の出力側には、
精細横特徴量抽出部7が接続されている。精細横特徴量
抽出部7は、粗横特徴量S5の各ピークの範囲に対応す
る画像Aの部分について各縦方向の走査線毎に黒画素数
を計数し、最も計数値が大きくなる走査線の横方向の位
置を該ピークにおける精細横特徴量S7として抽出する
ものである。又、粗縦特徴量抽出部4、粗横特徴量抽出
部5、精細縦特徴量抽出部6、及び精細横特徴量抽出部
7の各出力側には、粗縦特徴量S4、粗横特徴量S5、
精細縦特徴量S6、及び精細横特徴量S7を入力し、そ
れぞれ粗縦特徴量8a、粗横特徴量8b、精細縦特徴量
8c、及び精細横特徴量8dとして記録する位置特徴量
記録部8が接続されている。On the output side of the horizontal black run / histogram creation unit 2, one or more peaks are detected from the horizontal black run / histogram S2, and the position and magnitude of the peak are generated as a coarse / vertical feature amount S4. The vertical feature amount extraction unit 4 is connected. The rough vertical feature amount extraction unit 4 sets, for example, a range where the horizontal black run histogram S2 is equal to or more than a certain value as a peak, sets the sum of the count values of the histogram in this range as the size of the peak, and extracts the sum as the rough vertical feature amount S4. Is what you do. On the output side of the vertical black run / histogram creation unit 3, one or more peaks are detected from the vertical black run / histogram S3, and the position and magnitude of the peak are extracted as a coarse / horizontal feature S5. The extraction unit 5 is connected. For example, the coarse / horizontal feature extraction unit 5 sets a range where the vertical / black run histogram S3 is equal to or more than a certain value as a peak, sets the sum of the count values of the histogram in this range as the size of the peak, and generates the sum as the coarse / horizontal feature S5. Is what you do. On the output side of the coarse vertical characteristic amount extraction unit 4, a fine vertical characteristic amount extraction unit 6 is connected. The fine vertical feature amount extraction unit 6 counts the number of black pixels for each horizontal scanning line for the portion of the image A corresponding to each peak range of the coarse vertical feature amount S4, and the scanning line having the largest count value. Is extracted as the fine vertical feature amount S6 at the peak. On the output side of the coarse and horizontal feature amount extraction unit 5,
The fine horizontal feature quantity extraction unit 7 is connected. The fine horizontal feature amount extraction unit 7 counts the number of black pixels for each vertical scanning line in the portion of the image A corresponding to each peak range of the coarse horizontal feature amount S5, and the scanning line having the largest count value. Is extracted as the fine horizontal feature amount S7 at the peak. The output of the coarse / vertical feature extraction unit 4, the coarse / horizontal feature extraction unit 5, the fine / vertical feature extraction unit 6, and the fine / horizontal feature extraction unit 7 are respectively provided with a coarse / vertical feature S4, a coarse / horizontal feature. Quantity S5,
A position feature recording unit 8 that inputs the fine vertical feature S6 and the fine horizontal feature S7 and records them as the coarse vertical feature 8a, the coarse horizontal feature 8b, the fine vertical feature 8c, and the fine horizontal feature 8d, respectively. Is connected.
【0013】更に、この画像のずれ検出装置は、第2の
画像Bを画像縮小部1と同様の縮小率で縮小して解像度
を低くした縮小画像S11を作成する画像縮小部11を
有している。画像Bは、画像A上で作成されたフォーマ
ット情報を利用して処理対象の位置を特定する等のため
に、画像Aとのずれを検出する必要のある文書が記載さ
れた帳票を光学的な手法等により電気信号化したもので
ある。画像縮小部11の出力側には、横黒ラン・ヒスト
グラム作成部2及び縦黒ラン・ヒストグラム作成部3と
同様に、横黒ラン・ヒストグラムS12を作成する横黒
ラン・ヒストグラム作成部12及び縦黒ラン・ヒストグ
ラムS13を作成する縦黒ラン・ヒストグラム作成部1
3が接続されている。横黒ラン・ヒストグラム作成部1
2の出力側には、縦ずれ仮検出部14が接続されてい
る。縦ずれ仮検出部14は、粗縦特徴量8aの各ピーク
の位置を予め複数用意した所定値Yi(i=1,2,
…,N)だけずらし、そのピーク範囲について横黒ラン
・ヒストグラムS12の計数値の和と、粗縦特徴量8a
のピークの大きさとの差の絶対値を各ピーク毎に計算
し、それらの合計を評価値とする。そして、この評価値
が最も小さくなった前記所定値Yiの1つであるYkを
縦方向のずれの仮検出値S14として出力するものであ
る。縦黒ラン・ヒストグラム作成部13の出力側には、
横ずれ仮検出部15が接続されている。横ずれ仮検出部
15は、粗横特徴量8bの各ピークの位置を予め複数用
意した所定値Xi(i=1,2,…,N)だけずらし、
そのピーク範囲について縦黒ラン・ヒストグラムS13
の計数値の和と、粗横特徴量8bのピークの大きさとの
差の絶対値を各ピーク毎に計算し、それらの合計を評価
値とする。そして、その評価値が最も小さくなった前記
所定値Xiの1つであるXkを横方向のずれの仮検出値
S15として出力するものである。The image shift detecting apparatus further includes an image reducing unit 11 for reducing the second image B at a reduction rate similar to that of the image reducing unit 1 to create a reduced image S11 having a reduced resolution. I have. The image B is an optical form in which a document in which a deviation from the image A needs to be detected is described in order to specify the position of the processing target using the format information created on the image A. It is converted into an electric signal by a method or the like. On the output side of the image reducing unit 11, similarly to the horizontal black run / histogram creating unit 2 and the vertical black run / histogram creating unit 3, the horizontal black run / histogram creating unit 12 for creating the horizontal black run / histogram S12 and the vertical Vertical black run / histogram creation unit 1 for creating black run / histogram S13
3 are connected. Horizontal black run / histogram creation unit 1
The output side 2 is connected to a vertical displacement temporary detection unit 14. The vertical deviation temporary detection unit 14 determines a predetermined value Yi (i = 1, 2,
.., N) and the sum of the count values of the horizontal black run histogram S12 for the peak range and the coarse / vertical feature amount 8a
The absolute value of the difference from the peak size is calculated for each peak, and the sum thereof is used as the evaluation value. Then, Yk, which is one of the predetermined values Yi having the smallest evaluation value, is output as the temporary detection value S14 of the vertical displacement. On the output side of the vertical black run / histogram creation unit 13,
The temporary lateral displacement detection unit 15 is connected. The lateral deviation temporary detection unit 15 shifts the position of each peak of the coarse lateral characteristic amount 8b by a predetermined value Xi (i = 1, 2,..., N) prepared in advance,
Vertical black run histogram H13 for the peak range
, And the absolute value of the difference between the peak size of the coarse and horizontal feature quantity 8b is calculated for each peak, and the sum thereof is used as the evaluation value. Then, Xk, which is one of the predetermined values Xi having the smallest evaluation value, is output as a provisional detection value S15 of a lateral shift.
【0014】縦ずれ仮検出部14の出力側には、縦ずれ
検出部16が接続されている。縦ずれ検出部16は、粗
縦特徴量8aの各ピークの位置を縦方向のずれの仮検出
値S14(即ち、Yk)分だけずらし、そのずらした各
ピークの範囲について画像B上で各横方向の走査線毎に
黒画素数を計数し、計数値が最も大きくなる走査線の縦
方向の位置と、該ピークの位置に対応する精細縦特徴量
8cの値との差を取り、この差の全てのピークにおける
平均値を縦方向のずれの検出値S16として出力するも
のである。横ずれ仮検出部15の出力側には、横ずれ検
出部17が接続されている。横ずれ検出部17は、粗横
特徴量8bの各ピークの位置を横方向のずれの仮検出値
S15(即ち、Xk)分だけずらし、そのずらした各ピ
ークの範囲について画像B上で各縦方向の走査線毎に黒
画素数を計数し、計数値が最も大きくなる走査線の横方
向の位置と、該ピークの位置に対応する精細横特徴量8
dの値との差を取り、この差の全てのピークにおける平
均値を横方向のずれの検出値S17として出力するもの
である。縦ずれ検出部16及び横ずれ検出部17の各出
力側は、検出値S16と検出値S17とを合成し、画像
Bの画像Aに対する位置のずれを検出するずれ検出部1
8に接続されている。A vertical displacement detecting section 16 is connected to the output side of the vertical displacement temporary detecting section 14. The vertical shift detecting unit 16 shifts the position of each peak of the coarse vertical feature amount 8a by the tentative detection value S14 of the vertical shift (that is, Yk), and shifts each of the shifted peak ranges on the image B in the image B. The number of black pixels is counted for each scanning line in the direction, and the difference between the vertical position of the scanning line at which the count value is the largest and the value of the fine vertical feature value 8c corresponding to the peak position is calculated. Are output as the vertical deviation detection value S16. The output side of the provisional lateral displacement detection section 15 is connected to a lateral displacement detection section 17. The lateral shift detecting unit 17 shifts the position of each peak of the coarse and horizontal characteristic amount 8b by the temporary detected value S15 (ie, Xk) of the shift in the horizontal direction, and shifts each peak in the vertical direction on the image B for the range of the shifted peak. , The number of black pixels is counted for each scanning line, and the horizontal position of the scanning line at which the counted value is the largest, and the fine horizontal feature amount 8 corresponding to the peak position.
The difference from the value of d is taken, and the average value of all the peaks of this difference is output as the detected value S17 of the lateral shift. Each output side of the vertical shift detecting unit 16 and the horizontal shift detecting unit 17 synthesizes the detected value S16 and the detected value S17, and detects a position shift of the image B with respect to the image A.
8 is connected.
【0015】次に、図1の画像のずれ検出装置における
画像のずれ検出方法の処理内容を説明する。先ず、縦方
向の位置特徴抽出処理(1)、及び罫線位置比較処理
(2)を説明する。 (1) 位置特徴抽出処理 図2(a),(b),(c),(d)は、図1の画像の
ずれ検出装置における位置特徴抽出処理の例を説明する
図である。この位置特徴抽出処理では、次の(1−1)
〜(1−5)のような処理が行われる。 (1−1) 第1の画像縮小処理 画像縮小部1により、例えば図2(a)に示す画像Aを
例えば1/8 に縮小(即ち、縦方向の8画素を1画素に縮
小)し、図2(b)に示す縮小画像S1を作成する。こ
の場合、画像縮小部1は、縮小画像S1の任意の1画素
に対応する画像A上の8×8 画素の範囲に黒画素が1個
でもあれば、縮小画像S1上の該1画素を黒とすること
によって縮小する。但し、図2(b)は、見易くするた
め、縮小画像S1を8倍に拡大して表示したものであ
る。この縮小画像S1中の画素D12に対応する画像A
中の領域D11の領域には黒画素が含まれるので、画素
D12は黒画素とする。縮小画像S1中の画素D22に
ついては、対応する画像A中の領域D21には黒画素が
無いので、白画素とする。この画像縮小処理において、
画像Aを1/8 に縮小すると、画素数は原画像の1/64にな
り、後の処理において高速の処理が可能になる。Next, the processing contents of the image shift detecting method in the image shift detecting apparatus of FIG. 1 will be described. First, the vertical position feature extraction processing (1) and the ruled line position comparison processing (2) will be described. (1) Position Feature Extraction Process FIGS. 2A, 2B, 2C, and 2D are diagrams illustrating an example of the position feature extraction process in the image displacement detection device of FIG. In this position feature extraction processing, the following (1-1)
Processing such as (1-5) is performed. (1-1) First Image Reduction Processing The image A shown in FIG. 2A is reduced to, for example, 1/8 by the image reduction unit 1 (that is, eight pixels in the vertical direction are reduced to one pixel). A reduced image S1 shown in FIG. 2B is created. In this case, if there is at least one black pixel in the range of 8 × 8 pixels on the image A corresponding to any one pixel of the reduced image S1, the image reducing unit 1 converts the one pixel on the reduced image S1 to black. To reduce. However, FIG. 2 (b) shows the reduced image S1 enlarged eight times for easy viewing. Image A corresponding to pixel D12 in reduced image S1
Since the area of the middle area D11 includes a black pixel, the pixel D12 is a black pixel. The pixel D22 in the reduced image S1 is a white pixel because there is no black pixel in the corresponding area D21 in the image A. In this image reduction processing,
When the image A is reduced to 1/8, the number of pixels becomes 1/64 of the original image, and high-speed processing can be performed in the subsequent processing.
【0016】(1−2) 第1の横黒ラン・ヒストグラ
ム作成処理 横黒ラン・ヒストグラム作成部2は、図2(b)の縮小
画像S1について、例えば所定の第1の長さL1A以上
の長さ連続している黒画素で構成されたの黒ランを検出
し、この黒ランを構成する黒画素の数を横方向の走査線
毎に計数することにより、図2(c)に示す横黒ラン・
ヒストグラムS2を作成する。この時、長さL1Aは表
内に記入された文字を構成する黒画素をあまり検出しな
いくらい長く、且つ、ずれの検出に使用する罫線より短
くなるように予め設定する必要がある。これにより、文
字は殆ど検出されず、且つずれの検出に使用する罫線が
検出される。例えば図2(b)中の横方向の走査線HL
1では、縦方向の走査線VL1から走査線VL2に至る
長さL1Aよりも長い黒ランがあるので、この黒ランを
構成する黒画素の数が計数値になる。又、横方向の走査
線HL2では、長さL1A以上の長さの連続した黒画素
が無いので、計数値が0になる。(1-2) First Horizontal Black Run / Histogram Creation Processing The horizontal black run / histogram creation unit 2 generates, for example, a reduced image S1 of FIG. 2B having a predetermined first length L1A or more. By detecting a black run composed of black pixels having a continuous length and counting the number of black pixels constituting the black run for each horizontal scanning line, the horizontal run shown in FIG. Black orchid
A histogram S2 is created. At this time, the length L1A needs to be set in advance so as to be long enough not to detect the black pixels constituting the characters written in the table, and to be shorter than the ruled line used to detect the deviation. As a result, almost no characters are detected, and ruled lines used for detecting deviation are detected. For example, the horizontal scanning line HL in FIG.
In No. 1, since there is a black run longer than the length L1A from the vertical scanning line VL1 to the scanning line VL2, the number of black pixels constituting the black run is the count value. In the horizontal scanning line HL2, since there is no continuous black pixel having a length equal to or longer than the length L1A, the count value becomes zero.
【0017】(1−3) 粗縦特徴量抽出処理 粗縦特徴抽出部4では、図2(c)の横黒ラン・ヒスト
グラムS2から、破線Lhで示した第1の値より計数値
が大きくなる位置をピークの始点、及び破線Lhで示し
た値より計数値が小さくなる位置をピークの終点とし、
該始点から該終点までの間のヒストグラムの値の合計値
をピークの大きさとして検出する。例えば、図2(c)
に示したヒストグラムの一番上のピークP1では、帳票
の辺mから始点sまでの距離PS1、該辺mから終点e
までの距離PE1、及びピークP1の面積SPが粗縦特
徴量S4として抽出される。他の2つのピークP2,P
3についても同様である。 (1−4) 精細縦特徴抽出処理 精細縦特徴抽出部6では、例えば図2(c)中のピーク
P1に関しては、始点sから終点eの範囲に対応する画
像Aの部分について、図2(d)に示すように、横方向
に投影したヒストグラムを作る。そして、一番値が大き
くなる位置Mの辺mからの距離uを、このピークP1に
対応する精細縦特徴量S6として抽出する。図2(c)
中の他の2つのピークP2,P3に対応する精細縦特徴
量S6も同様に抽出する。 (1−5) 位置特徴量記録処理 位置特徴量記録部8は、粗縦特徴量S4及び精細縦特徴
量S6を、それぞれ粗縦特徴量8a及び精細縦特徴量8
cとして記録する。横方向についても、同様にして粗横
特徴量S5及び精細横特徴量S7が抽出され、それぞれ
粗横特徴量8b及び精細横特徴量8dとして位置特徴量
記録部8に記録される。(1-3) Rough Vertical Feature Extraction Processing In the rough vertical feature extraction unit 4, the count value is larger than the first value indicated by the broken line Lh from the horizontal black run histogram S2 in FIG. Is the start point of the peak, and the position where the count value is smaller than the value indicated by the broken line Lh is the end point of the peak,
A total value of the histogram values from the start point to the end point is detected as a peak size. For example, FIG.
At the top peak P1 of the histogram shown in FIG. 7, the distance PS1 from the side m to the start point s of the form, and the end point e from the side m
The distance PE1 and the area SP of the peak P1 are extracted as the coarse vertical feature amount S4. The other two peaks P2, P
The same applies to No. 3. (1-4) Fine Vertical Feature Extraction Process The fine vertical feature extraction unit 6 extracts, for example, the peak P1 in FIG. 2C from the image A corresponding to the range from the start point s to the end point e in FIG. As shown in d), a histogram projected in the horizontal direction is created. Then, the distance u from the side m of the position M where the value becomes the largest is extracted as the fine vertical feature amount S6 corresponding to the peak P1. FIG. 2 (c)
The fine vertical feature value S6 corresponding to the other two peaks P2 and P3 is similarly extracted. (1-5) Position feature amount recording processing The position feature amount recording unit 8 stores the coarse vertical feature amount S4 and the fine vertical feature amount S6 in the coarse vertical feature amount 8a and the fine vertical feature amount 8, respectively.
Record as c. Similarly, in the horizontal direction, the coarse horizontal feature value S5 and the fine horizontal feature value S7 are extracted, and are recorded in the position feature value recording unit 8 as the coarse horizontal feature value 8b and the fine horizontal feature value 8d, respectively.
【0018】(2) 罫線位置比較処理 図3(a),(b),(c),(d),(e)は図1の
画像のずれ検出装置におけるずれの仮検出処理の例を説
明する図、図4はずれの検出処理の例を説明する図であ
る。これらの図を参照しつつ、図2(a)の画像Aと図
4中の画像Bとの間の罫線位置を比較してずれを検出す
る罫線位置比較処理(2−1)〜(2−5)について説
明する。 (2−1) 第2の画像縮小処理 画像縮小部11により、第1の画像縮小処理と同様に、
例えば図4の画像Bを1/8 に縮小し、図3(a)に示す
縮小画像S11を作成する。 (2−2) 第2の横黒ラン・ヒストグラム作成処理 横黒ラン・ヒストグラム作成部12では、例えば所定の
第3の長さL2Aを閾値として第1の横黒ラン・ヒスト
グラム作成処理と同様の処理を行い、図3(b)に示す
横黒ラン・ヒストグラムS12を作成する。長さL2A
は、長さL1Aと同一値で良い。 (2−3) 縦ずれ仮検出処理 縦ずれ仮検出部14は、粗縦特徴量8aのピーク位置を
予め定められた所定値Y1,Y2,Y3だけずらして作
成した図3(c),(d),(e)に示すピークP1,
P2,P3と、図3(b)の横黒ラン・ヒストグラムS
12とを比較し、縦ずれの仮検出値S14を生成する。
以下、1番目のピークP1を処理して仮検出値S14を
生成する方法(2−3−a)〜(2−3−c)について
説明する。(2) Ruled line position comparison processing FIGS. 3 (a), (b), (c), (d) and (e) illustrate an example of the processing for temporarily detecting a deviation in the image deviation detecting apparatus of FIG. FIG. 4 is a diagram illustrating an example of a deviation detection process. With reference to these figures, the ruled line position comparison processing (2-1) to (2-) for comparing the ruled line positions between the image A in FIG. 2A and the image B in FIG. 5) will be described. (2-1) Second image reduction processing The image reduction unit 11 performs the same processing as the first image reduction processing.
For example, the image B in FIG. 4 is reduced to 1/8, and a reduced image S11 shown in FIG. (2-2) Second Horizontal Black Run / Histogram Creation Processing The horizontal black run / histogram creation unit 12 performs the same processing as the first horizontal black run / histogram creation processing using, for example, a predetermined third length L2A as a threshold. The process is performed to create a horizontal black run histogram S12 shown in FIG. Length L2A
May be the same value as the length L1A. (2-3) Temporary Vertical Displacement Detection Processing The temporary vertical deviation detecting unit 14 is prepared by shifting the peak position of the coarse vertical feature amount 8a by predetermined values Y1, Y2, and Y3 (FIGS. 3C and 3C). d), peaks P1 shown in (e),
P2, P3 and the horizontal black run histogram S in FIG.
12 to generate a tentative detection value S14 of vertical displacement.
Hereinafter, methods (2-3-a) to (2-3-c) of generating the provisional detection value S14 by processing the first peak P1 will be described.
【0019】(2−3−a) 図3(c)に示すよう
に、ピークP1の始点s及び終点eを帳票の辺mから所
定値Y1だけ下方へずらした場合、該始点sから該終点
eの範囲における図3(b)のヒストグラムの計数値の
合計は0である。この計数値の合計とピークP1の面積
Sとの差の絶対値は|0−S|=Sであり、このSがピ
ークP1の評価値になる。2番目及び3番目のピークP
2,P3についても同様の処理を行い、それらの合計を
ピークP1,P2,P3がY1ずれた場合の評価値とす
る。 (2−3−b) 図3(d)に示すように、ピークP1
の始点s及び終点eを帳票の辺mから所定値Y2だけ下
方へずらした場合、該始点sから該終点eの範囲におけ
る図3(b)のヒストグラムの計数値の合計はS”であ
る。この計数値の合計S”とピークP1の面積Sとの差
の絶対値は|S”−S|となり、S”とSとがほぼ等し
ければ0に近い。ピークP2,P3についても同様の処
理を行い、それらの合計をピークP1,P2,P3が所
定値Y2ずれた場合の評価値とする。 (2−3−c) 図3(e)に示すように、ピークP1
の始点s及び終点eを所定値Y3だけずらした場合も、
該始点sから該終点eの範囲における図3(b)のヒス
トグラムの計数値の合計は0になり、(2−3−a)の
所定値Y1だけずらした場合と同様である。この結果、
図2(c)に示すヒストグラムが図3(b)のヒストグ
ラムと最もよく一致するので、粗縦特徴量8bを所定値
Y2ずらしたものの評価値が最も小さくなり、この所定
値Y2が縦ずれの仮検出値S14として生成される。(2-3-a) As shown in FIG. 3C, when the starting point s and the ending point e of the peak P1 are shifted downward from the side m of the form by a predetermined value Y1, the starting point s and the ending point The sum of the count values of the histogram of FIG. 3B in the range of e is 0. The absolute value of the difference between the sum of the count values and the area S of the peak P1 is | 0−S | = S, and this S is the evaluation value of the peak P1. 2nd and 3rd peak P
The same processing is performed for P2 and P3, and the sum thereof is used as the evaluation value when the peaks P1, P2 and P3 deviate by Y1. (2-3-b) As shown in FIG.
Is shifted downward by a predetermined value Y2 from the side m of the form, the sum of the count values of the histogram of FIG. 3B in the range from the start point s to the end point e is S ″. The absolute value of the difference between the sum S "of the counted values and the area S of the peak P1 is | S" -S |, and is close to 0 if S "and S are substantially equal. The same processing is performed for the peaks P2 and P3, and the sum thereof is used as an evaluation value when the peaks P1, P2, and P3 are shifted by a predetermined value Y2. (2-3-c) As shown in FIG.
When the start point s and the end point e are shifted by a predetermined value Y3,
The sum of the count values of the histogram in FIG. 3B in the range from the start point s to the end point e is 0, which is the same as the case where the count is shifted by the predetermined value Y1 of (2-3-a). As a result,
Since the histogram shown in FIG. 2 (c) best matches the histogram shown in FIG. 3 (b), the evaluation value obtained by shifting the coarse vertical feature value 8b by a predetermined value Y2 becomes the smallest, and this predetermined value Y2 is It is generated as a temporary detection value S14.
【0020】(2−4) 縦ずれ検出処理 縦ずれ検出部16は、粗縦特徴量8bのピークP1の位
置を仮検出値S14(即ち、所定値Y2)だけずらした
範囲、即ち、始点sから終点eまでの間に対応する図4
の画像B上の範囲について、横方向の黒ランを構成する
画素のヒストグラムを作成し、最も大きな計数値となる
縦方向の位置M”を得る。そして、縦ずれ検出部16
は、その位置M”とそのピークに対応する図2(d)及
び図4中の精細縦特徴量の位置Mとの差(M”−M)を
そのピークの位置ずれとする。縦ずれ検出部16は、2
番目及び3番目のピークP2,P3についても同様の処
理を行い、全てのピークの位置ずれの平均値を画像Aと
画像Bとの間の縦方向のずれの検出値S16として出力
する。横方向についても、同様にして横ずれ検出部17
から画像Aと画像Bとの間の横方向のずれの検出値S1
7が出力される。(2-4) Vertical Displacement Detection Process The vertical displacement detection unit 16 shifts the position of the peak P1 of the coarse vertical feature value 8b by the temporary detection value S14 (ie, the predetermined value Y2), ie, the starting point s Fig. 4 corresponding to the time from to the end point e
For the range on the image B, a histogram of the pixels constituting the black run in the horizontal direction is created, and the vertical position M ″ at which the largest count value is obtained is obtained.
Sets the difference (M "-M) between the position M" and the position M of the fine vertical feature value in FIGS. 2D and 4 corresponding to the peak as the position shift of the peak. The vertical displacement detection unit 16
The same processing is performed for the third and third peaks P2 and P3, and the average value of the positional shifts of all the peaks is output as the detected value S16 of the vertical shift between the image A and the image B. Similarly, in the lateral direction, the lateral displacement detection unit 17
From the detected value S1 of the lateral displacement between the image A and the image B
7 is output.
【0021】(2−5) ずれ検出処理 ずれ検出部18は、検出値S16と検出値S17とを合
成し、画像Bの画像Aの位置に対するずれを検出する。
以上のように、この第1の実施形態では、縦ずれ検出部
16及び横ずれ検出部17において、画像Aの縮小画像
S1の縦方向及び横方向の黒ランのヒストグラムの位置
と画像Bの縮小画像S11の縦方向及び横方向の黒ラン
のヒストグラムの位置とをそれぞれ比較することによ
り、画像Aと画像Bとの間の縦方向のずれの検出値S1
6及び横方向のずれの検出値S17をそれぞれ検出する
ようにしたので、帳票の文書中に罫線があれば、該帳票
のエッジを検出可能な特別なスキャナを用いることな
く、一般のスキャナを使用しても、帳票のずれの検出が
可能となる。更に、複写された帳票等、帳票のエッジに
対する文書の位置が基準の位置に対してずれている場合
でも、正常に処理を行うことができる。又、本実施形態
では、第1及び第2の画像縮小処理において画像A,B
を縮小し、画素数を少なくしたので、後の各処理におい
て高速の処理が可能になる。更に、第1及び第2の横黒
ラン・ヒストグラム作成処理において、長さL1Aと長
さL2Aとを同一値にしたので、処理プログラムを共有
でき、該処理プログラムを記憶するメモリ等の規模を節
約できる。(2-5) Deviation Detection Processing The deviation detection unit 18 combines the detection value S16 and the detection value S17 to detect a deviation of the image B from the position of the image A.
As described above, in the first embodiment, the positions of the histograms of the black run in the vertical direction and the horizontal direction of the reduced image S1 of the image A and the reduced image of the image B in the vertical deviation detection unit 16 and the horizontal deviation detection unit 17 By comparing the positions of the histograms of the black run in the vertical direction and the horizontal direction in S11 with each other, the detection value S1 of the vertical shift between the image A and the image B is obtained.
6 and the detection value S17 of the lateral shift are detected respectively. If there is a ruled line in the document of the form, a general scanner can be used without using a special scanner capable of detecting the edge of the form. Even in this case, it is possible to detect a slip of the form. Further, even when the position of the document with respect to the edge of the form such as a copied form is shifted from the reference position, the processing can be performed normally. In the present embodiment, the images A and B are used in the first and second image reduction processes.
Is reduced and the number of pixels is reduced, so that high-speed processing can be performed in each subsequent processing. Further, in the first and second horizontal black run / histogram creation processes, the length L1A and the length L2A are set to the same value, so that the processing programs can be shared, and the scale of the memory for storing the processing programs can be reduced. it can.
【0022】第2の実施形態 図5は、本発明の第2の実施形態の画像のずれ検出方法
を実施するための画像のずれ検出装置の構成図であり、
第1の実施形態を示す図1中の要素と共通の要素には共
通の符号が付されている。この画像のずれ検出装置で
は、図1中の横黒ラン・ヒストグラム作成部2、粗縦特
徴量抽出部4、及び横黒ラン・ヒストグラム作成部12
に代えて、これらとは異なる構成の横黒ラン・ヒストグ
ラム作成部2A、粗縦特徴量抽出部4A、及び横黒ラン
・ヒストグラム作成部12Aが接続されると共に、該横
黒ラン・ヒストグラム作成部2Aと粗縦特徴量抽出部4
Aとの間に、新たに横黒ラン閾値修正部21が設けら
れ、該横黒ラン閾値修正部21と該横黒ラン・ヒストグ
ラム作成部12Aとの間に横黒ラン閾値記憶部22が接
続されている。横黒ラン・ヒストグラム作成部2Aは、
縮小画像S1について、横方向の各走査線毎に、横黒ラ
ン閾値修正部21から供給される横黒ラン閾値S21以
上の長さの横方向の黒ランを検出し、この黒ランを構成
する画素数を計数して横黒ラン・ヒストグラムS2Aを
作成するものである。粗縦特徴量抽出部4Aは、横黒ラ
ン・ヒストグラムS2Aから単数又は複数のピークを検
出し、そのピークの位置と大きさを出力するものであ
る。例えば、横黒ラン・ヒストグラムS2Aが一定値以
上となる範囲をピークとし、その範囲のヒストグラムの
計数値の和を該ピークの大きさとし、粗縦特徴量S4A
として生成するものである。又、この粗縦特徴量抽出部
4Aは、ピークが予め定められた個数検出されなかった
場合(例えば、1つも検出されなかった場合)、横黒ラ
ン閾値修正部21に横黒ラン閾値S21の修正を行わせ
るようになっている。 Second Embodiment FIG. 5 is a block diagram of an image misalignment detecting apparatus for implementing an image misalignment detecting method according to a second embodiment of the present invention.
Elements common to those in FIG. 1 showing the first embodiment are denoted by common reference numerals. In this image shift detecting apparatus, the horizontal black run / histogram creating unit 2, coarse vertical feature amount extracting unit 4, and horizontal black run / histogram creating unit 12 in FIG.
Instead, a horizontal black run / histogram creating unit 2A, a coarse / vertical feature amount extracting unit 4A, and a horizontal black run / histogram creating unit 12A having different configurations are connected, and the horizontal black run / histogram creating unit is connected. 2A and coarse vertical feature amount extraction unit 4
A, a horizontal black run threshold correction unit 21 is newly provided, and a horizontal black run threshold storage unit 22 is connected between the horizontal black run threshold correction unit 21 and the horizontal black run / histogram creation unit 12A. Have been. The horizontal black run / histogram creation unit 2A
For the reduced image S1, a horizontal black run having a length equal to or greater than the horizontal black run threshold value S21 supplied from the horizontal black run threshold correction unit 21 is detected for each horizontal scanning line, and this black run is configured. The horizontal black run histogram S2A is created by counting the number of pixels. The coarse and vertical feature amount extraction unit 4A detects one or a plurality of peaks from the horizontal black run histogram S2A, and outputs the position and magnitude of the peak. For example, a range in which the horizontal black run histogram S2A is equal to or more than a certain value is defined as a peak, and the sum of the count values of the histogram in the range is defined as the size of the peak.
Is generated as When the predetermined number of peaks has not been detected (for example, when no peak has been detected), the coarse vertical feature amount extraction unit 4A sends the horizontal black run threshold value correction unit 21 the horizontal black run threshold value S21. The correction is made.
【0023】横黒ラン閾値修正部21は、最初は予め定
められた初期値を横黒ラン閾値S21として横黒ラン・
ヒストグラム作成部2Aに提供し、粗縦特徴量抽出部4
Aにおいてピークが予め定められた個数検出されなかっ
た場合(例えば、1つも検出されなかった場合)、横黒
ラン閾値S21を小さく(例えば、1/2 にする)し、再
度横黒ラン・ヒストグラム作成部2Aに供給して処理を
やり直すものである。最終的に使用された横黒ラン閾値
S21は、後のずれ検出処理で使用するため、横黒ラン
閾値記憶部22に記憶されるようになっている。横黒ラ
ン・ヒストグラム作成部12Aは、縮小画像S11につ
いて、縦方向の各走査線毎に、横黒ラン閾値記憶部22
に記憶された横黒ラン閾値S22以上の長さの横方向の
黒ランを検出し、この黒ランを構成する画素数を計数し
て横黒ランヒストグラムS12Aを作成するものであ
る。更に、この画像のずれ検出装置では、図1中の縦黒
ラン・ヒストグラム作成部3、粗横特徴量抽出部4、及
び縦黒ラン・ヒストグラム作成部12に代えて、これら
とは異なる構成の縦黒ラン・ヒストグラム作成部3A、
粗横特徴量抽出部5A、及び縦黒ラン・ヒストグラム作
成部13Aが接続されると共に、該縦黒ラン・ヒストグ
ラム作成部3Aと粗横特徴量抽出部5Aとの間に、新た
に縦黒ラン閾値修正部33が設けられ、該縦黒ラン閾値
修正部23と該縦黒ラン・ヒストグラム作成部13Aと
の間に縦黒ラン閾値記憶部24が接続されている。The horizontal black run threshold value correcting unit 21 initially sets a predetermined initial value as a horizontal black run threshold value S21.
Provided to the histogram creation unit 2A, the coarse vertical feature amount extraction unit 4
If a predetermined number of peaks are not detected in A (for example, if no peak is detected), the horizontal black run threshold value S21 is reduced (for example, halved), and the horizontal black run histogram is again obtained. The processing is supplied to the creation unit 2A and the processing is performed again. The horizontal black run threshold value S21 that is finally used is stored in the horizontal black run threshold storage unit 22 for use in a subsequent shift detection process. The horizontal black run / histogram creation unit 12A stores the horizontal black run threshold value storage unit 22 for each vertical scanning line for the reduced image S11.
The horizontal black run having a length equal to or longer than the horizontal black run threshold value S22 stored in the horizontal direction is detected, and the number of pixels constituting the black run is counted to create a horizontal black run histogram S12A. Further, in this image shift detecting device, the vertical black run / histogram creating unit 3, the coarse / horizontal feature extracting unit 4, and the vertical black run / histogram creating unit 12 in FIG. Vertical black run / histogram creation unit 3A,
The coarse / horizontal feature extracting unit 5A and the vertical black run / histogram creating unit 13A are connected, and a vertical black run is newly added between the vertical black run / histogram creating unit 3A and the coarse / horizontal feature extracting unit 5A. A threshold correction unit 33 is provided, and a vertical black run threshold storage unit 24 is connected between the vertical black run threshold correction unit 23 and the vertical black run / histogram creation unit 13A.
【0024】縦黒ラン・ヒストグラム作成部3Aは、縮
小画像S1について、縦方向の各走査線毎に、縦黒ラン
閾値修正部23から供給される縦黒ラン閾値S23以上
の長さの縦方向の黒ランを検出し、この黒ランを構成す
る画素数を計数して縦黒ラン・ヒストグラムS3Aを作
成するものである。粗横特徴量抽出部5Aは、縦黒ラン
・ヒストグラムS3Aから単数又は複数のピークを検出
し、そのピークの位置と大きさを出力するものである。
例えば、縦黒ラン・ヒストグラムS3Aが一定値以上と
なる範囲をピークとし、その範囲のヒストグラムの計数
値の和を該ピークの大きさとし、粗横特徴量S5Aとし
て保存するものである。又、この粗横特徴量抽出部5A
は、ピークが予め定められた個数検出されなかった場合
(例えば、1つも検出されなかった場合)、縦黒ラン閾
値修正部23に縦黒ラン閾値S23の修正を行わせるよ
うになっている。縦黒ラン閾値修正部23は、最初は予
め定められた初期値を縦黒ラン閾値S23として縦黒ラ
ン・ヒストグラム作成部3Aに提供し、粗横特徴量抽出
部5Aにおいてピークが予め定められた個数検出されな
かった場合(例えば、1つも検出されなかった場合)、
縦黒ラン閾値S23を小さく(例えば、1/2 にする)
し、再度縦黒ラン・ヒストグラム作成部3Aに提供して
処理をやり直すものである。最終的に使用された縦黒ラ
ン閾値S23は、後のずれ検出処理で使用するため、縦
黒ラン閾値記憶部24に記憶されるようになっている。
縦黒ラン・ヒストグラム作成部13Aは、縮小画像S1
1について、縦方向の各走査線毎に、縦黒ラン閾値記憶
部24に記憶された縦黒ラン閾値S24以上の長さの縦
方向の黒ランを検出し、この黒ランを構成する画素数を
計数して縦黒ランヒストグラムS13Aを作成するもの
である。他は、図1と同様の構成である。The vertical black run / histogram creating unit 3A, for each of the vertical scanning lines of the reduced image S1, has a vertical black run threshold S23 supplied from the vertical black run threshold correction unit 23 in the vertical direction. Is detected, and the number of pixels constituting the black run is counted to create a vertical black run histogram S3A. The coarse / horizontal feature extraction unit 5A detects one or a plurality of peaks from the vertical black run histogram S3A, and outputs the position and size of the peak.
For example, a range in which the vertical black run histogram S3A is equal to or more than a certain value is set as a peak, and the sum of the count values of the histogram in the range is set as the size of the peak and stored as the coarse and horizontal feature amount S5A. Also, the coarse and horizontal feature amount extraction unit 5A
When the predetermined number of peaks is not detected (for example, when no peak is detected), the vertical black run threshold correction unit 23 corrects the vertical black run threshold S23. The vertical black run threshold correction unit 23 initially provides a predetermined initial value as the vertical black run threshold S23 to the vertical black run / histogram creation unit 3A, and the peak is predetermined in the coarse / horizontal feature extraction unit 5A. If the number is not detected (for example, if none is detected),
Reduce vertical black run threshold S23 (for example, to 1/2)
Then, the process is provided again to the vertical black run / histogram creating unit 3A to repeat the process. The finally used vertical black run threshold value S23 is stored in the vertical black run threshold storage unit 24 for use in the subsequent deviation detection processing.
The vertical black run / histogram creation unit 13A outputs the reduced image S1
1 for each vertical scanning line, a vertical black run having a length equal to or longer than the vertical black run threshold S24 stored in the vertical black run threshold storage unit 24 is detected, and the number of pixels constituting the black run is detected. Is counted to create a vertical black run histogram S13A. Other configurations are the same as those in FIG.
【0025】この画像のずれ検出装置における画像のず
れ検出方法では、次の(1),(2)の処理が図1と異
なっている。 (1) 位置特徴抽出処理 図6は、黒ラン閾値修正処理の第1の例を示す図であ
り、同図(a)には位置特徴抽出処理の対象となる画像
Aに対し、画像縮小部1により第1の画像縮小処理を実
行した縮小画像S1が示されると共に縦黒ランを検出す
るための閾値L1B−1が示され、同図(b)には黒ラ
ンのヒストグラムが示されている。図7は、黒ラン閾値
修正処理の第2の例を示す図であり、同図(a)には縮
小画像S1が示されると共に縦黒ランを検出するための
閾値L1B−2が示され、同図(b)には黒ランのヒス
トグラムが示されている。縦黒ラン閾値修正部23は、
黒ランの閾値の初期値として図6(a)に示す長さの閾
値L1B−1を保持する。縦黒ラン・ヒストグラム作成
部3Aは、閾値L1B−1以上の長さの縦方向の黒ラン
を検出しようとするが、図6(a)の縮小画像S1中に
閾値L1B−1以上の長さの黒ランがないので、ヒスト
グラムは図6(b)に示すように、全ての計数値が0と
なる。このため、粗横特徴抽出部5Aではヒストグラム
のピークが検出されないので、図7(a)に示すよう
に、縦黒ラン閾値修正部23は、閾値L1B−1を例え
ば1/2 にした閾値L1B−2を新たな黒ランの閾値S2
3として縦黒ラン・ヒストグラム作成部3Aに供給し、
該縦黒ラン・ヒストグラム作成部3Aが縦黒ラン・ヒス
トグラム作成処理を再び行う。縦黒ラン・ヒストグラム
作成部3Aは、縦方向に閾値L1B−2以上の長さの縦
黒ランが図7(a)中の縦方向の走査線VL3,VL4
の位置に検出されるので、図7(b)に示すようなヒス
トグラムを作成する。粗横特徴抽出部5Aでは、このヒ
ストグラムから2つのピークP11,P12が見つかる
ので、これ以後の処理を第1の実施形態と同様に続行す
る。又、この時、使用された縦黒ランの閾値L1B−2
が縦黒ラン閾値記憶部34に記憶される。このように、
処理対象の文書中の罫線が閾値の初期値(即ち、L1B
−1)よりも短い場合でも、縦黒ラン・ヒストグラム作
成処理を行うことができる。In the image shift detecting method in the image shift detecting apparatus, the following processes (1) and (2) are different from those in FIG. (1) Position Feature Extraction Processing FIG. 6 is a diagram showing a first example of the black run threshold value correction processing. FIG. 6A shows an image reduction unit for an image A to be subjected to the position feature extraction processing. 1, a reduced image S1 that has undergone the first image reduction processing is shown, a threshold L1B-1 for detecting a vertical black run is shown, and a black run histogram is shown in FIG. . FIG. 7 is a diagram showing a second example of the black run threshold value correction process. FIG. 7A shows a reduced image S1 and a threshold value L1B-2 for detecting a vertical black run. FIG. 6B shows a histogram of the black run. The vertical black run threshold correction unit 23
The threshold value L1B-1 having the length shown in FIG. 6A is held as the initial value of the threshold value of the black run. The vertical black run / histogram creation unit 3A attempts to detect a vertical black run having a length equal to or longer than the threshold L1B-1. However, the vertical black run / histogram creating unit 3A has a length equal to or longer than the threshold L1B-1 in the reduced image S1 of FIG. , There is no black run, and all the count values of the histogram become 0 as shown in FIG. For this reason, since the coarse / horizontal feature extraction unit 5A does not detect the peak of the histogram, as shown in FIG. 7A, the vertical / black run threshold correction unit 23 sets the threshold L1B, for example, to half the threshold L1B-1. -2 is the new black run threshold S2
3 to the vertical black run / histogram creation unit 3A,
The vertical black run / histogram creation unit 3A performs the vertical black run / histogram creation processing again. The vertical black run / histogram creating unit 3A determines that the vertical black runs having a length equal to or greater than the threshold value L1B-2 in the vertical direction are vertical scanning lines VL3 and VL4 in FIG.
, A histogram as shown in FIG. 7B is created. Since the coarse and horizontal feature extraction unit 5A finds two peaks P11 and P12 from this histogram, the subsequent processing is continued similarly to the first embodiment. At this time, the threshold value L1B-2 of the used vertical black run is used.
Is stored in the vertical black run threshold storage unit 34. in this way,
The ruled line in the document to be processed is the initial threshold value (that is, L1B
Even when the length is shorter than -1), the vertical black run / histogram creation processing can be performed.
【0026】(2) 罫線位置比較処理 縦黒ラン・ヒストグラム作成部13Aは、縮小画像S1
1について、縦方向の各走査線毎に、縦黒ラン閾値記憶
部24に記憶された縦黒ラン閾値S24(即ち、縦黒ラ
ンの閾値L1B−2)以上の長さの縦方向の黒ランを検
出し、この黒ランを構成する画素数を計数して縦黒ラン
ヒストグラムS13Aを作成する。以降の処理は、第1
の実施形態と同様に行われる。尚、本実施形態では、縦
黒ラン閾値S23の修正処理について説明を行ったが、
横黒ラン閾値S21についても同様の処理を行う。以上
のように、この第2の実施形態では、縦黒ラン・ヒスト
グラム作成部3Aが予め定められた閾値L1B−1より
長い黒ランを検出できない場合、縦黒ラン閾値修正部2
3がより短い閾値L1B−2を設定するようにしたの
で、短い罫線で構成された様式の文書を処理する場合で
も、該罫線を画像Bの画像Aの位置に対するずれの検出
に使用することができる。又、第1の実施形態と同様の
長い罫線で構成された様式の文書を処理する場合では、
黒ランの閾値L1B−1は修正されないので、文字等と
混同しやすい短い罫線は検出されない。そのため、縦黒
ラン・ヒストグラム作成処理の精度を高く保つことがで
きる。(2) Ruled Line Position Comparison Processing The vertical black run / histogram creation unit 13A uses the reduced image S1
1, for each vertical scanning line, a vertical black run having a length equal to or longer than the vertical black run threshold S24 (that is, the vertical black run threshold L1B-2) stored in the vertical black run threshold storage unit 24. Is detected, the number of pixels constituting the black run is counted, and a vertical black run histogram S13A is created. Subsequent processing is the first
This is performed in the same manner as in the embodiment. In the present embodiment, the correction process of the vertical black run threshold value S23 has been described.
Similar processing is performed for the horizontal black run threshold value S21. As described above, in the second embodiment, when the vertical black run / histogram creation unit 3A cannot detect a black run longer than the predetermined threshold L1B-1, the vertical black run threshold correction unit 2A
3 sets a shorter threshold value L1B-2, so that even when processing a document in a style composed of short ruled lines, the ruled lines can be used to detect a deviation of the image B from the position of the image A. it can. In the case of processing a document in a style composed of long ruled lines as in the first embodiment,
Since the threshold value L1B-1 of the black run is not corrected, a short ruled line that is easily confused with a character or the like is not detected. Therefore, the accuracy of the vertical black run / histogram creation processing can be kept high.
【0027】尚、本発明は上記実施形態に限定されず、
種々の変形が可能である。その変形例としては、例えば
次のようなものがある。 (a) 第1の画像縮小処理において、縮小率や縮小の
方法は、罫線等の線素が縮小時に消えない方法であれ
ば、任意の方法で良い。 (b) 第2の実施形態では、閾値L1B−2は閾値L
1B−1の1/2 に修正されているが、該閾値L1B−2
が該閾値L1B−1よりも小さくなれば、任意の値で良
い。 (c) 本発明は、文書の読取り位置の登録に使用され
た画像と、実際に読取り処理を行う画像との間のずれを
検出する方法全般に適用できる。The present invention is not limited to the above embodiment,
Various modifications are possible. For example, there are the following modifications. (A) In the first image reduction process, any reduction method or reduction method may be used as long as line elements such as ruled lines do not disappear during reduction. (B) In the second embodiment, the threshold L1B-2 is the threshold L
The threshold value L1B-2 has been corrected to 1/2 of 1B-1.
Is smaller than the threshold value L1B-1. (C) The present invention can be applied to all methods for detecting a shift between an image used for registering a reading position of a document and an image to be actually read.
【0028】[0028]
【発明の効果】以上詳細に説明したように、請求項1〜
4に係る発明によれば、縦ずれ検出処理及び横ずれ検出
処理において、第1の縮小画像の縦方向及び横方向の黒
ランのヒストグラムの位置と第2の縮小画像の縦方向及
び横方向の黒ランのヒストグラムの位置とをそれぞれ比
較することにより、第1の画像と第2の画像との間の縦
方向のずれの検出値及び横方向のずれの検出値をそれぞ
れ検出するようにしたので、帳票の文書中に罫線があれ
ば、該帳票のエッジを検出可能な特別なスキャナを用い
ることなく、一般のスキャナを使用しても、帳票のずれ
の検出が可能となる。更に、複写された帳票等、帳票の
エッジに対する文書の位置が基準の位置に対してずれて
いる場合でも、正常に処理を行うことができる。しか
も、第1及び第2の画像縮小処理において第1及び第2
の画像を縮小し、画素数を少なくしたので、後の各処理
において高速の処理が可能になる。更に、第1及び第2
の横黒ラン・ヒストグラム作成処理において第1の長さ
と第3の長さとを同一値にし、且つ第1及び第2の縦黒
ラン・ヒストグラム作成処理において第1の長さと第3
の長さとを同一値にしたので、処理プログラムを共有で
き、該処理プログラムを記憶するメモリ等の規模を節約
できる。請求項5に係る発明によれば、第1の縦黒ラン
・ヒストグラム作成処理で、第1の長さより長い黒ラン
を検出できない場合、縦黒ラン閾値修正処理によって該
第1の長さを短く設定するようにしたので、短い罫線で
構成された様式の文書を処理する場合でも、該罫線を第
2の画像の第1の画像の位置に対するずれの検出に使用
することができる。その上、第1の発明と同様の長い罫
線で構成された様式の文書を処理する場合では、前記第
1の長さは修正されないので、文字等と混同しやすい短
い罫線は検出されない。そのため、縦黒ラン・ヒストグ
ラム作成処理の精度を高く保つことができる。As described in detail above, claims 1 to 5
According to the fourth aspect, in the vertical shift detecting process and the horizontal shift detecting process, the positions of the histograms of the vertical and horizontal black runs of the first reduced image and the vertical and horizontal black positions of the second reduced image are determined. By comparing the positions of the run histograms with the positions of the run histograms, the detected value of the vertical shift and the detected value of the horizontal shift between the first image and the second image are detected, respectively. If there is a ruled line in the document of the form, the deviation of the form can be detected by using a general scanner without using a special scanner capable of detecting the edge of the form. Further, even when the position of the document with respect to the edge of the form such as a copied form is shifted from the reference position, the processing can be performed normally. Moreover, in the first and second image reduction processes, the first and second images are reduced.
Since the image is reduced and the number of pixels is reduced, high-speed processing can be performed in each subsequent processing. Further, the first and second
In the horizontal black run / histogram creation processing, the first length and the third length are set to the same value, and the first length and the third length are set in the first and second vertical black run / histogram creation processing.
Since the length is set to the same value, the processing program can be shared, and the scale of a memory or the like for storing the processing program can be reduced. According to the fifth aspect of the present invention, when a black run longer than the first length cannot be detected in the first vertical black run / histogram creation processing, the first length is reduced by the vertical black run threshold correction processing. Since the setting is performed, even when processing a document in a format composed of short ruled lines, the ruled lines can be used for detecting a deviation of the second image from the position of the first image. In addition, when processing a document having a style composed of long ruled lines similar to that of the first invention, the first length is not corrected, so that a short ruled line that is easily confused with a character or the like is not detected. Therefore, the accuracy of the vertical black run / histogram creation processing can be kept high.
【図1】本発明の第1の実施形態の画像のずれ検出装置
の構成図である。FIG. 1 is a configuration diagram of an image shift detection device according to a first embodiment of the present invention.
【図2】位置特徴量抽出処理例を説明する図である。FIG. 2 is a diagram illustrating an example of a position feature amount extraction process.
【図3】ずれ仮検出処理例を説明する図である。FIG. 3 is a diagram illustrating an example of a provisional deviation detection process.
【図4】ずれ検出処理例を説明する図である。FIG. 4 is a diagram illustrating an example of a shift detection process.
【図5】本発明の第2の実施形態の画像のずれ検出装置
の構成図である。FIG. 5 is a configuration diagram of an image shift detecting apparatus according to a second embodiment of the present invention.
【図6】黒ラン閾値修正処理の第1の例を示す図であ
る。FIG. 6 is a diagram illustrating a first example of a black run threshold value correction process.
【図7】黒ラン閾値修正処理の第2の例を示す図であ
る。FIG. 7 is a diagram illustrating a second example of the black run threshold value correction processing.
1 画像縮小部 2,2A 横黒ラン・ヒストグラム作成
部 3,3A 縦黒ラン・ヒストグラム作成
部 4,4A 粗縦特徴量抽出部 5,5A 粗横特徴量抽出部 6 精細縦特徴量抽出部 7 精細横特徴量抽出部 8 位置特徴量記録部 11 画像縮小部 12,12A 横黒ラン・ヒストグラム作成
部 13,13A 縦黒ラン・ヒストグラム作成
部 14 縦ずれ仮検出部 15 横ずれ仮検出部 16 縦ずれ検出部 17 横ずれ検出部 18 ずれ検出部 21 横黒ラン閾値修正部 22 横黒ラン閾値記憶部 23 縦黒ラン閾値修正部 24 縦黒ラン閾値記憶部 A 第1の画像 B 第2の画像 S1 縮小画像 S2 横黒ラン・ヒストグラム S3 縦黒ラン・ヒストグラム S4 粗縦特徴量 S5 粗横特徴量 S6 精細縦特徴量 S7 精細横特徴量 S11 縮小画像 S12 横黒ラン・ヒストグラム S13 縦黒ラン・ヒストグラム S14 縦方向のずれの仮検出値 S15 横方向のずれの仮検出値 S16 縦方向のずれの検出値 S17 横方向のずれの検出値DESCRIPTION OF SYMBOLS 1 Image reduction part 2, 2A Horizontal black run / histogram creation part 3, 3A Vertical black run / histogram creation part 4, 4A Coarse vertical feature amount extraction part 5, 5A Coarse horizontal feature amount extraction part 6 Fine vertical feature amount extraction part 7 Fine horizontal feature amount extraction unit 8 Position feature amount recording unit 11 Image reduction unit 12, 12A Horizontal black run / histogram creation unit 13, 13A Vertical black run / histogram creation unit 14 Vertical displacement temporary detection unit 15 Horizontal displacement temporary detection unit 16 Vertical displacement Detector 17 Lateral shift detector 18 Displacement detector 21 Horizontal black run threshold correction unit 22 Horizontal black run threshold storage unit 23 Vertical black run threshold correction unit 24 Vertical black run threshold storage unit A First image B Second image S1 Reduction Image S2 Horizontal black run / histogram S3 Vertical black run / histogram S4 Rough vertical feature S5 Rough horizontal feature S6 Fine vertical feature S7 Fine horizontal feature S11 Reduced image S12 Horizontal black Run histogram H13 Vertical black run histogram S14 Temporary detection value of vertical deviation S15 Temporary detection value of horizontal deviation S16 Detection value of vertical deviation S17 Detection value of horizontal deviation
Claims (5)
に第1の文書を記載した第1の帳票の画像を電気信号化
して第1の画像を作成しておき、 前記第1の画像中の前記罫線を検出する位置特徴抽出処
理と、 前記第1の文書の位置に対する位置のずれを検出する必
要のある第2の文書を該第1の文書と同一の形式の表中
に記載した第2の帳票の画像を電気信号化して第2の画
像を作成しておき、 前記第2の画像中の罫線の位置と前記位置特徴抽出処理
において検出された前記第1の画像中の罫線の位置とを
比較して該各罫線間の位置のずれを検出し、該位置のず
れを該第1の画像と該第2の画像との間の位置のずれと
する罫線位置比較処理とを、行うことを特徴とする画像
のずれ検出方法。An image of a first document in which a first document is described in a table represented by a ruled line at a reference position is converted into an electric signal to generate a first image, and the first image is created. A position feature extraction process for detecting the ruled line in the image, and a second document that needs to detect a positional deviation from the position of the first document is described in a table in the same format as the first document. A second image is created by converting the image of the second form into an electric signal, and the position of the ruled line in the second image and the ruled line in the first image detected in the position feature extraction processing And a ruled line position comparing process for detecting a positional deviation between the respective ruled lines by comparing the positions of the ruled lines with each other and determining the positional deviation as a positional deviation between the first image and the second image. And a method for detecting an image shift.
記載した第1の帳票の画像を電気信号化して第1の画像
を作成しておき、 前記第1の画像を所定の縮小率で縮小して第1の縮小画
像を生成する第1の画像縮小処理と、 前記第1の縮小画像中の横方向に所定の第1の長さ以上
連続している黒画素で構成された黒ランについて、該黒
画素の数を該横方向に集計した第1の横黒ラン・ヒスト
グラムを該横方向の走査線毎に作成する第1の横黒ラン
・ヒストグラム作成処理と、 前記第1の縮小画像中の縦方向に所定の第2の長さ以上
連続している黒画素で構成された黒ランについて、該黒
画素の数を該縦方向に集計した第1の縦黒ラン・ヒスト
グラムを該縦方向の走査線毎に作成する第1の縦黒ラン
・ヒストグラム作成処理と、 前記第1の横黒ラン・ヒストグラム上の単数又は複数の
ピークの縦方向の位置と大きさとを粗い縦方向の特徴量
として抽出する粗縦特徴量抽出処理と、 前記第1の縦黒ラン・ヒストグラム上の単数又は複数の
ピークの横方向の位置と大きさとを粗い横方向の特徴量
として抽出する粗横特徴量抽出処理と、 前記粗い縦方向の特徴量として抽出された各ピークにつ
いて、前記第1の画像の該各ピークの位置に対応する部
分の横方向の各走査線上の黒画素を計数し、この計数値
が最大になる該走査線の位置を該各ピークにおける精細
な縦方向の特徴量として抽出する精細縦特徴量抽出処理
と、 前記粗い横方向の特徴量として抽出された各ピークにつ
いて、前記第1の画像の該各ピークの位置に対応する部
分の縦方向の各走査線上の黒画素を計数し、この計数値
が最大になる該走査線の位置を該各ピークにおける精細
な横方向の特徴量として抽出する精細横特徴量抽出処理
とを行い、 前記罫線位置比較処理は、 前記第1の文書の位置に対する位置のずれを検出する必
要のある第2の文書を該第1の文書と同一の形式の表中
に記載した第2の帳票の画像を電気信号化して第2の画
像を作成しておき、 前記第2の画像を前記第1の画像縮小処理と同一の縮小
率で縮小して第2の縮小画像を生成する第2の画像縮小
処理と、 前記第2の縮小画像中の横方向に所定の第3の長さ以上
連続している黒画素で構成された黒ランについて、該黒
画素の数を該横方向に集計した第2の横黒ラン・ヒスト
グラムを該横方向の走査線毎に作成する第2の横黒ラン
・ヒストグラム作成処理と、 前記第2の縮小画像中の縦方向に所定の第4の長さ以上
連続している黒画素で構成された黒ランについて、該黒
画素の数を該縦方向に集計した第2の縦黒ラン・ヒスト
グラムを該縦方向の走査線毎に作成する第2の縦黒ラン
・ヒストグラム作成処理と、 前記粗い縦方向の特徴量の各ピークの位置を複数用意さ
れた所定値Yi(i=1,2,…,N)だけずらした状
態で前記第2の横黒ラン・ヒストグラムと縦方向に比較
し、最も差が小さいときの該所定値Ykを縦ずれ仮検出
値として生成する縦ずれ仮検出処理と、 前記粗い横方向の特徴量の各ピークの位置を複数用意さ
れた所定値Xi(i=1,2,…,N)だけずらした状
態で前記第2の縦黒ラン・ヒストグラムと横方向に比較
し、最も差が小さいときの該所定値Xkを横ずれ仮検出
値として生成する横ずれ仮検出処理と、 前記粗い縦方向の特徴量の各ピークについて、該各ピー
クの位置を前記縦ずれ仮検出値Ykだけずらした位置に
対応する前記第2の画像の部分の黒画素数を横方向の各
走査線について計数し、最も計数値が大きくなったとき
の走査線の位置と前記精細な縦方向の特徴量として記録
された該各ピークに対応する走査線の位置との差をそれ
ぞれとり、該各差の平均値を該第2の画像の前記第1の
画像に対する縦方向のずれとして検出する縦ずれ検出処
理と、 前記粗い横方向の特徴量の各ピークについて、該各ピー
クの位置を前記横ずれ仮検出値Xkだけずらした位置に
対応する前記第2の画像の部分の黒画素数を縦方向の各
走査線について計数し、最も計数値が大きくなったとき
の走査線の位置と前記精細な横方向の特徴量として記録
された該各ピークに対応する走査線の位置との差をそれ
ぞれとり、該各差の平均値を該第2の画像の前記第1の
画像に対する横方向のずれとして検出する横ずれ検出処
理と、 前記縦ずれ検出処理で検出された前記第2の画像の前記
第1の画像に対する縦方向のずれと前記横ずれ検出処理
で検出された前記第2の画像の前記第1の画像に対する
横方向のずれとを合成することにより、前記第2の文書
の前記第1の文書の位置に対する位置のずれを検出する
ずれ検出処理とを、行うことを特徴とする請求項1記載
の画像のずれ検出方法。2. The position feature extraction process includes: converting an image of a first form in which a first document is described in a table represented by a ruled line at a reference position into an electric signal to generate a first image; A first image reduction process for generating a first reduced image by reducing the first image at a predetermined reduction ratio; and a first predetermined length in a horizontal direction in the first reduced image. A first horizontal black run histogram in which the number of the black pixels is totaled in the horizontal direction for a black run composed of continuous black pixels is created for each horizontal scanning line. Horizontal black run / histogram creation processing, and for a black run composed of black pixels that are continuous for a predetermined second length or more in the vertical direction in the first reduced image, the number of black pixels is determined by the vertical A first vertical black run for creating a first vertical black run histogram totaled in the vertical direction for each vertical scanning line A histogram creation process; a coarse vertical feature amount extraction process of extracting a vertical position and a size of one or more peaks on the first horizontal black run histogram as a coarse vertical feature amount; A coarse / horizontal feature extraction process for extracting the horizontal position and magnitude of one or more peaks on the vertical / black run histogram as coarse horizontal feature amounts; and extracting the coarse vertical feature amounts as the coarse vertical feature amounts. For each peak, the number of black pixels on each scanning line in the horizontal direction in a portion corresponding to the position of each peak in the first image is counted, and the position of the scanning line at which the counted value is the maximum is determined for each peak. A fine vertical feature value extraction process for extracting as a fine vertical feature value; and for each peak extracted as the coarse horizontal feature value, a vertical position of a portion corresponding to the position of each peak in the first image. Directional Performing a fine horizontal feature amount extraction process of counting black pixels on the scanning line and extracting the position of the scanning line at which the counted value is the maximum as a fine horizontal feature amount at each peak; The processing is as follows: an image of a second document, in which a second document for which it is necessary to detect a positional shift with respect to the position of the first document, is described in a table in the same format as the first document, is converted into an electric signal. A second image reduction process for reducing the second image at the same reduction ratio as the first image reduction process to generate a second reduced image; For a black run composed of black pixels continuous in the second reduced image in a horizontal direction for a predetermined third length or more, a second horizontal black run in which the number of the black pixels is totaled in the horizontal direction A second horizontal black run for generating a histogram for each horizontal scanning line; Processing, for a black run composed of black pixels continuous in the second reduced image in the vertical direction for a predetermined fourth length or more, a second count of the number of black pixels in the vertical direction is calculated. A vertical black run / histogram generation process for generating a vertical black run / histogram for each vertical scanning line; and a predetermined value Yi ( In the state shifted by i = 1, 2,..., N), the second horizontal black run histogram is vertically compared with the second horizontal black run histogram, and the predetermined value Yk at the time when the difference is smallest is generated as a vertical deviation temporary detection value. Vertical deviation temporary detection processing, and the second vertical black run is performed in a state where the positions of the respective peaks of the coarse horizontal feature amount are shifted by a plurality of predetermined values Xi (i = 1, 2,..., N).・ Comparing the histogram with the horizontal direction, the predetermined value Xk when the difference is the smallest is laterally shifted. A lateral displacement temporary detection process that is generated as a temporary detection value; and for each peak of the coarse vertical feature amount, the position of each peak is shifted by the vertical displacement temporary detection value Yk. The number of black pixels of the portion is counted for each scanning line in the horizontal direction, and the position of the scanning line when the count value is the largest and the scanning line corresponding to each peak recorded as the fine vertical feature amount And a vertical deviation detection process of detecting an average value of the respective differences as a vertical deviation of the second image from the first image, and each of the coarse horizontal characteristic amounts. For the peaks, the number of black pixels in the portion of the second image corresponding to the position obtained by shifting the position of each peak by the lateral displacement temporary detection value Xk is counted for each scanning line in the vertical direction, and the counted value is the largest. Scanning line position when The difference between each peak and the position of the scanning line corresponding to each peak recorded as a fine horizontal feature amount is taken, and the average value of each difference is taken as the horizontal direction of the second image with respect to the first image. A lateral displacement detection process for detecting as a displacement of the first image, a vertical displacement of the second image detected by the vertical displacement detection process with respect to the first image, and a second displacement detection process of the second image detected by the lateral displacement detection process. A shift detection process for detecting a shift in the position of the second document with respect to the position of the first document by synthesizing the shift with the shift in the horizontal direction with respect to the first image. Item 1. The image shift detecting method according to Item 1.
所定の第1の値より大きくなる位置を始点とし且つ該所
定の第1の値より小さくなる位置を終点とする1つのピ
ークとして検出し、該始点から該終点までのヒストグラ
ムの値の合計を該ピークの大きさとして抽出し、 前記粗横特徴量抽出処理は、 前記第1の縦黒ラン・ヒストグラムの値が予め設定した
所定の第2の値より大きくなる位置を始点とし且つ該所
定の第2の値より小さくなる位置を終点とする1つのピ
ークとして検出し、該始点から該終点までのヒストグラ
ムの値の合計を該ピークの大きさとして抽出し、 前記縦ずれ仮検出処理は、 前記第2の横黒ラン・ヒストグラムについて、前記粗い
縦方向の特徴量の各ピーク毎に該各ピークの始点及び終
点を前記所定値Yiだけずらした範囲の計数値の合計を
算出し、該算出値と該粗い縦方向の特徴量に記録された
該各ピークの大きさとの差を該ピークの不一致度として
それぞれ検出し、該各不一致度の合計が最も小さくなる
ときの該所定値Yiを縦ずれ仮検出値Ykとして検出
し、 前記の横ずれ仮検出処理は、 前記第2の縦黒ラン・ヒストグラムについて、前記粗い
横方向の特徴量の各ピーク毎に該各ピークの始点及び終
点を前記所定値xiだけずらした範囲の計数値の合計を
算出し、該算出値と該粗い横方向の特徴量に記録された
該各ピークの大きさとの差を該ピークの不一致度として
それぞれ検出し、該各不一致度の合計が最も小さくなる
ときの該所定値Xiを縦ずれ仮検出値Xkとして検出す
ることを、特徴とする請求項1又は2記載の画像のずれ
検出方法。3. The rough vertical feature amount extraction process starts at a position at which the value of the first horizontal black run histogram becomes larger than a predetermined first value set in advance and sets the predetermined first value as the starting point. Detecting as a peak having a smaller position as an end point, extracting a total of histogram values from the start point to the end point as a size of the peak, the rough horizontal feature amount extraction processing includes: A position where the value of the vertical black run histogram is larger than a predetermined second value is set as a starting point, and a position where the value is smaller than the predetermined second value is set as an end point. The sum of the values of the histogram up to the end point is extracted as the size of the peak, and the vertical misalignment temporary detection processing is performed for each peak of the coarse vertical feature amount for the second horizontal black run histogram. Each pea The sum of the count values in a range in which the start point and the end point of the peaks are shifted by the predetermined value Yi is calculated, and the difference between the calculated value and the size of each peak recorded in the coarse vertical feature amount is determined by the discrepancy between the peaks. , And the predetermined value Yi when the sum of the degrees of mismatch is minimized is detected as a vertical deviation temporary detection value Yk. The horizontal deviation temporary detection processing is performed by the second vertical black run histogram. For each peak of the coarse horizontal feature amount, the sum of count values in a range in which the start point and the end point of each peak are shifted by the predetermined value xi is calculated, and the calculated value and the coarse horizontal feature amount are calculated. Detecting the difference from the magnitude of each peak recorded in the above as the degree of inconsistency of the peak, and detecting the predetermined value Xi when the sum of the degrees of inconsistency becomes the smallest as the temporary deviation temporary detection value Xk. Claims characterized by Item 3. The method for detecting a displacement of an image according to Item 1 or 2.
処理における所定の第1の長さ及び前記第2の横黒ラン
・ヒストグラム作成処理における所定の第3の長さは同
一の値にし、且つ前記第1の縦黒ラン・ヒストグラム作
成処理における所定の第2の長さ及び前記第2の縦黒ラ
ン・ヒストグラム作成処理における所定の第4の長さは
同一の値にすることを、特徴とする請求項1、2、又は
3記載の画像のずれ検出方法。4. A predetermined first length in the first horizontal black run histogram creation processing and a predetermined third length in the second horizontal black run histogram creation processing have the same value, The predetermined second length in the first vertical black run / histogram creation process and the predetermined fourth length in the second vertical black run / histogram creation process have the same value. 4. The method of detecting an image shift according to claim 1, 2, or 3.
れたピークの数が予め定められた数以下の場合は前記第
1の長さの値を小さく修正し、再度前記第1の横黒ラン
・ヒストグラム作成処理を必要回数行い、該ピークの数
が該予め定められた数よりも大きくなった時の該第1の
長さの値を横黒ラン閾値として記録する横黒ラン閾値修
正処理と、 前記粗横特徴量抽出処理において抽出されたピークの数
が予め定められた数以下の場合は前記第2の長さの値を
小さく修正し、再度第2の縦黒ラン・ヒストグラム作成
処理を必要回数行い、該ピークの数が該予め定められた
数よりも大きくなった時の該第2の長さの値を縦黒ラン
閾値として記録する縦黒ラン閾値修正処理とを行い、 前記第2の横黒ラン・ヒストグラム作成処理における前
記所定の第3の長さとして前記横黒ラン閾値を使用し、
前記第2の縦黒ラン・ヒストグラム作成処理における前
記所定の第4の長さとして前記縦黒ラン閾値を使用する
ことを、特徴とする請求項1、2、3、又は4記載の画
像のずれ検出方法。5. When the number of peaks extracted in the rough vertical feature amount extraction processing is equal to or less than a predetermined number, the value of the first length is corrected to a small value, and the first horizontal black run is performed again. A horizontal black run threshold correction process of performing a histogram generation process a required number of times and recording the value of the first length when the number of the peaks becomes larger than the predetermined number as a horizontal black run threshold. If the number of peaks extracted in the coarse / horizontal feature extraction processing is equal to or less than a predetermined number, the value of the second length is corrected to be small, and the second vertical black run / histogram creation processing is performed again. Performing a required number of times, and performing a vertical black run threshold correction process of recording the value of the second length as a vertical black run threshold when the number of peaks is greater than the predetermined number; 2 in the horizontal black run / histogram creation processing of FIG. Using said transverse black run threshold as the length of 3,
5. The image shift according to claim 1, wherein the vertical black run threshold is used as the predetermined fourth length in the second vertical black run / histogram creation processing. 6. Detection method.
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP9279112A JPH11120288A (en) | 1997-10-13 | 1997-10-13 | Shift detecting method for image |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP9279112A JPH11120288A (en) | 1997-10-13 | 1997-10-13 | Shift detecting method for image |
Publications (1)
| Publication Number | Publication Date |
|---|---|
| JPH11120288A true JPH11120288A (en) | 1999-04-30 |
Family
ID=17606593
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| JP9279112A Withdrawn JPH11120288A (en) | 1997-10-13 | 1997-10-13 | Shift detecting method for image |
Country Status (1)
| Country | Link |
|---|---|
| JP (1) | JPH11120288A (en) |
Cited By (1)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US6959121B2 (en) | 2000-08-09 | 2005-10-25 | Fuji Xerox Co., Ltd. | Document image processing device, document image processing method, and memory medium |
-
1997
- 1997-10-13 JP JP9279112A patent/JPH11120288A/en not_active Withdrawn
Cited By (1)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US6959121B2 (en) | 2000-08-09 | 2005-10-25 | Fuji Xerox Co., Ltd. | Document image processing device, document image processing method, and memory medium |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| JP5071104B2 (en) | Image processing apparatus, image processing program, image processing method, and electronic camera for correcting color misregistration | |
| CN101958989B (en) | Image processing device, image processing system, image processing method | |
| US7079265B2 (en) | Distortion correction device for correcting imaged object to produce plane image without distortion | |
| JP5870745B2 (en) | Image processing apparatus, binarization threshold value calculation method, and computer program | |
| JP2003304561A (en) | Stereo image processing device | |
| EP2536123B1 (en) | Image processing method and image processing apparatus | |
| JP4013060B2 (en) | Image correction method and image correction apparatus | |
| WO2019187967A1 (en) | Image processing device and image processing method | |
| EP0851664A2 (en) | An image processing apparatus | |
| JPH11120288A (en) | Shift detecting method for image | |
| JP3378439B2 (en) | Form image creation device | |
| US20050094861A1 (en) | Positional synchronization in a multivoting character recognition environment | |
| JP4454297B2 (en) | Binarization processing apparatus and binarization processing method | |
| JP2007206963A (en) | Image processing apparatus, image processing method, program, and storage medium | |
| JP2778437B2 (en) | Document image tilt detection device | |
| JPH11288453A (en) | Method and system for detecting skew angle and black boundary line of original image in scan environment for reproduction | |
| JP3966448B2 (en) | Image processing apparatus, image processing method, program for executing the method, and recording medium storing the program | |
| US6411336B1 (en) | Systems and methods for intra- and inter-field aligning of video frames | |
| JP4116179B2 (en) | Image processing method, image processing apparatus, and recording medium | |
| JPH11175701A (en) | Image recording apparatus and image recording method, and image processing apparatus and image processing method | |
| JP2000011153A (en) | Image processor | |
| JP2008258980A (en) | Image information processing apparatus and image tilt angle calculation method | |
| JP3625660B2 (en) | Input information correction method and recording medium recording the program | |
| JPH03250280A (en) | Character recognition method and device and information processing device | |
| JP3526216B2 (en) | Image processing device |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| A300 | Application deemed to be withdrawn because no request for examination was validly filed |
Free format text: JAPANESE INTERMEDIATE CODE: A300 Effective date: 20050104 |