JP4145256B2 - Image distortion correction apparatus, program, and storage medium - Google Patents

Image distortion correction apparatus, program, and storage medium Download PDF

Info

Publication number
JP4145256B2
JP4145256B2 JP2004033634A JP2004033634A JP4145256B2 JP 4145256 B2 JP4145256 B2 JP 4145256B2 JP 2004033634 A JP2004033634 A JP 2004033634A JP 2004033634 A JP2004033634 A JP 2004033634A JP 4145256 B2 JP4145256 B2 JP 4145256B2
Authority
JP
Japan
Prior art keywords
image
line
character line
scanning direction
character
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Expired - Fee Related
Application number
JP2004033634A
Other languages
Japanese (ja)
Other versions
JP2005229193A (en
Inventor
禎史 荒木
真希 篠田
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Ricoh Co Ltd
Original Assignee
Ricoh Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Ricoh Co Ltd filed Critical Ricoh Co Ltd
Priority to JP2004033634A priority Critical patent/JP4145256B2/en
Priority to US11/054,396 priority patent/US7602995B2/en
Publication of JP2005229193A publication Critical patent/JP2005229193A/en
Application granted granted Critical
Publication of JP4145256B2 publication Critical patent/JP4145256B2/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Images

Landscapes

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

Description

本発明は、書籍原稿画像を画像読取手段により読み取ったスキャン画像の歪みを補正する画像歪み補正装置、プログラム及び記憶媒体に関する。   The present invention relates to an image distortion correction apparatus, a program, and a storage medium for correcting distortion of a scanned image obtained by reading a book original image by an image reading unit.

フラットベッドスキャナを用いて読み取る原稿の多くはシート状の原稿であり、コンタクトガラス上に開閉自在の圧板を設け、コンタクトガラス上に原稿を載置した後に圧板を閉じて原稿をスキャンするようにしている。しかし、原稿としてはシート状のものに限られず、書籍原稿(本、冊子など)も原稿として扱われることがあり、そのような場合にもコンタクトガラス上に書籍原稿を載置し、原稿をスキャンすることになる。   Many originals read using a flatbed scanner are sheet-like originals, and an openable / closable pressure plate is provided on the contact glass. After placing the original on the contact glass, the pressure plate is closed and the original is scanned. Yes. However, the manuscript is not limited to a sheet, and book manuscripts (books, booklets, etc.) may be handled as manuscripts. In such cases, the manuscript is placed on the contact glass and the manuscript is scanned. Will do.

ところが、原稿として書籍原稿を用いた場合には、図62に示すように、書籍原稿100のページ綴じ部101がコンタクトガラス102から浮き上がってしまう。このように書籍原稿100のページ綴じ部101がコンタクトガラス102から浮き上がってしまった場合には、ページ綴じ部101が焦点面から離れてしまうため、浮き上がった部分のスキャン画像には、画像歪み、影、文字ぼけなどの画像劣化が発生する。劣化した画像のページ綴じ部101は読みにくく、OCRにより文字認識処理を行うときの認識率が著しく低下する。特に、厚手製本ではその割合が高く、また、書籍原稿100のページ綴じ部101を焦点面から離れないように加圧作業した場合には、書籍原稿100自体を破損してしまうこともある。   However, when a book manuscript is used as the manuscript, the page binding portion 101 of the book manuscript 100 is lifted from the contact glass 102 as shown in FIG. As described above, when the page binding portion 101 of the book document 100 is lifted from the contact glass 102, the page binding portion 101 is separated from the focal plane. , Image degradation such as blurred characters occurs. The page binding portion 101 of the deteriorated image is difficult to read, and the recognition rate when performing character recognition processing by OCR is remarkably reduced. In particular, the ratio is high in thick bookbinding, and when the page binding portion 101 of the book document 100 is pressed so as not to leave the focal plane, the book document 100 itself may be damaged.

このような問題を解決すべく、画像の濃度情報から物体の3次元形状を推定する方法を用いて、画像の歪みを補正する方法が提案されている。このような画像の濃度情報から物体の3次元形状を推定する方法としては、非特許文献1に記載されているShape from Shadingと呼ばれる方法が代表的な例である。   In order to solve such a problem, a method of correcting image distortion using a method of estimating the three-dimensional shape of an object from image density information has been proposed. As a method for estimating the three-dimensional shape of an object from such image density information, a method called Shape from Shading described in Non-Patent Document 1 is a typical example.

また、特許文献1には、三角測量方式により書籍の形状を測定し、歪みを補正する方法が提案されている。   Patent Document 1 proposes a method of correcting the distortion by measuring the shape of a book by a triangulation method.

さらに、特許文献2には、読み取りスキャン画像のページ外形の形状を用いて書籍表面の3次元形状を推定する方法が提案されている。   Further, Patent Document 2 proposes a method for estimating the three-dimensional shape of the book surface using the shape of the page outline of the scanned read image.

しかしながら、前述したShape from Shadingと呼ばれる方法によれば、計算量が多く、歪み補正処理の計算時間が長いので、実用化は困難である。   However, according to the method called “Shape from Shading” described above, the amount of calculation is large, and the calculation time of the distortion correction processing is long.

また、特許文献1に記載されている方法によれば、三角測量方式により書籍の形状を測定するための特別な形状計測装置が必要になるため、適当ではない。   Further, according to the method described in Patent Document 1, a special shape measuring device for measuring the shape of a book by the triangulation method is required, and therefore, it is not appropriate.

さらに、特許文献2に記載されている方法によれば、少ない計算量で歪み補正ができるが、ページ外形が画像中に完全に収まりきれずに途中で切れているような場合には有効な補正ができない。   Furthermore, according to the method described in Patent Document 2, distortion correction can be performed with a small amount of calculation, but effective correction when the page outline is not completely contained in the image and is cut off in the middle. I can't.

そこで、本出願人は、ページ外形が途中で切れているような読み取りスキャン画像であっても、その歪みを少ない計算量で有効に補正することができる画像歪み補正装置を特願2002-247643にて提案している。特願2002-247643によれば、ページ外形だけではなく文字行情報および罫線情報を用いて画像の歪みを補正し、しかも、スキャナ(画像読取手段)の固有パラメータ(レンズの焦点面距離、スキャン光軸の位置(アドレス))を利用していないので、任意のスキャナの出力画像を補正できる。   In view of this, the present applicant has disclosed an image distortion correction apparatus capable of effectively correcting the distortion with a small amount of calculation even in a scanned scan image in which the page outline is cut off in the middle of Japanese Patent Application No. 2002-247643. I have proposed. According to Japanese Patent Application No. 2002-247643, not only the page outline but also the character line information and ruled line information are used to correct image distortion, and the inherent parameters of the scanner (image reading means) (lens focal plane distance, scanning light) Since the axis position (address) is not used, the output image of any scanner can be corrected.

T. Wada, H. Uchida and T. Matsuyama, “Shape from Shading with Interreflections under a Proximal Light Source: Distortion-Free Copying of an Unfolded Book”, International Journal Computer Vision 24(2), 125-135(1997)T. Wada, H. Uchida and T. Matsuyama, “Shape from Shading with Interreflections under a Proximal Light Source: Distortion-Free Copying of an Unfolded Book”, International Journal Computer Vision 24 (2), 125-135 (1997) 特開平5-161002号公報Japanese Patent Laid-Open No. 5161002 特開平11-41455号公報Japanese Patent Laid-Open No. 11-41455

しかしながら、上述したようなページ外形が途中で切れているような読み取りスキャン画像であっても、その歪みを少ない計算量で有効に補正することができる画像歪み補正装置によれば、ページ外形ではなく、文字行情報および罫線情報を用いて画像の歪みを補正するようにしているが、まだ、完全とはいえず、解決されねばならない課題が存在する。   However, according to the image distortion correction apparatus that can effectively correct the distortion with a small amount of calculation even in a scanned scan image in which the page outline as described above is cut off in the middle, the page outline is not Although image distortion is corrected using character line information and ruled line information, there is still a problem that is not complete and must be solved.

例えば、歪み補正するための手がかりとして文字行を利用する従来方式では、文字単位の矩形を抽出し、それらの矩形から主走査方向の補正では近似曲線を求めている。ところが、図63に示すように、英文画像では、日本語で書かれた画像と異なりアルファベット文字で書かれているために文字のアスペクト比がさまざまであり、また、文字間の間隔が狭くなる場合もある。そのため、英文画像に対して矩形抽出を行うと、水平方向に隣接する文字同士が複数個接触し一つの矩形として抽出されてしまう場合がある。このように文字同士が複数個接触し一つの矩形として抽出された矩形を基に歪み補正を行うと、主走査方向の歪み補正に悪影響を及ぼすことがある。   For example, in a conventional method using a character line as a clue for correcting distortion, rectangles in character units are extracted, and an approximate curve is obtained from the rectangles in correction in the main scanning direction. However, as shown in FIG. 63, when an English image is written in alphabetical characters unlike an image written in Japanese, the aspect ratio of characters is various, and the interval between characters is narrow. There is also. Therefore, when rectangle extraction is performed on an English sentence image, a plurality of characters adjacent in the horizontal direction may come into contact with each other and be extracted as one rectangle. If distortion correction is performed based on a rectangle extracted as a single rectangle by contacting a plurality of characters in this way, distortion correction in the main scanning direction may be adversely affected.

より詳細には、主走査方向の歪み補正では、矩形抽出後、行統合して、行内の矩形から近似曲線を生成し、それを基に補正を行っている。そこで、文字同士が接触した矩形から行を生成しようとすると、図64に示すように、複数分の行が一行と誤認識されやすく不適切な行が生成されることがある。そして、行統合した一行内にある実際に存在する文字数よりも矩形数が減る。そのため、一行内にある矩形の中心座標を基に生成される近似曲線は、不安定となってしまう問題点がある。   More specifically, in distortion correction in the main scanning direction, after extracting rectangles, the rows are integrated, an approximate curve is generated from the rectangles in the rows, and correction is performed based on the approximate curves. Therefore, when trying to generate a line from a rectangle in which characters are in contact with each other, as shown in FIG. 64, a plurality of lines are likely to be erroneously recognized as one line, and an inappropriate line may be generated. Then, the number of rectangles is reduced from the number of characters that are actually present in one line. Therefore, there is a problem that the approximate curve generated based on the center coordinates of the rectangle in one line becomes unstable.

本発明は、英文画像の主走査方向の歪み補正における精度の高精度化を図ることができる画像歪み補正装置、プログラム及び記憶媒体を提供することを目的とする。   An object of the present invention is to provide an image distortion correction apparatus, a program, and a storage medium that can improve accuracy in distortion correction in the main scanning direction of an English image.

請求項1記載の発明の画像歪み補正装置は、画像読取手段の主走査方向に対してページ綴じ部がほぼ平行となるようにスキャン面の上もしくは下に接触した書籍原稿画像を前記画像読取手段により読み取ったスキャン画像の歪みを当該スキャン画像内の文字行の形状を基に補正する画像歪み補正装置において、前記スキャン画像から主走査方向に予め定めた第1閾値以上かつ予め定めた第2閾値以下の数の黒画素が連結する黒画素ランのみを抽出する手段と、抽出した黒画素ランを基に、文字の垂直方向の成分である縦成分のみの矩形を縦成分矩形として抽出する手段と、抽出した縦成分矩形間の主走査方向および副走査方向の距離を基に文字行を抽出する手段と、抽出した文字行の中から、前記スキャン画像の歪み補正に利用するための文字行を決定する手段と、決定した文字行中に存在する各縦成分矩形の中心座標を基に近似曲線を算出する手段と、を備える。
The image distortion correction apparatus according to the first aspect of the present invention is the image reading unit that reads a book document image that is in contact with the upper or lower side of the scanning surface so that the page binding portion is substantially parallel to the main scanning direction of the image reading unit. In the image distortion correction apparatus for correcting the distortion of the scanned image read by the method based on the shape of the character line in the scanned image, a predetermined second threshold value that is equal to or larger than a first threshold value in the main scanning direction from the scanned image. Means for extracting only a black pixel run in which the following number of black pixels are connected, and means for extracting, as a vertical component rectangle, only a vertical component rectangle that is a vertical component of a character, based on the extracted black pixel run. Means for extracting a character line based on the distance between the extracted vertical component rectangles in the main scanning direction and the sub-scanning direction, and a sentence used for correcting distortion of the scanned image from the extracted character line And means for determining a line, and means for calculating an approximate curve based on the center coordinates of each longitudinal component rectangle present in the determined character line, the.

したがって、文字の縦成分のみの矩形を抽出することで隣接する文字の接触が防止される。このような縦成分矩形から近似曲線を求めることにより、英文画像の主走査方向の歪み補正における精度の高精度化を図ることが可能になる。   Therefore, by extracting a rectangle of only the vertical component of the character, contact between adjacent characters is prevented. By obtaining an approximate curve from such a vertical component rectangle, it is possible to improve the accuracy of distortion correction in the main scanning direction of an English image.

請求項2記載の発明は、請求項1記載の画像歪み補正装置において、抽出した縦成分矩形の主走査方向の長さが予め定めた閾値以上の場合、当該縦成分矩形の長さを当該閾値の長さに縮める。   According to a second aspect of the present invention, in the image distortion correction apparatus according to the first aspect, when the length of the extracted vertical component rectangle in the main scanning direction is equal to or greater than a predetermined threshold value, the length of the vertical component rectangle is set to the threshold value. Shrink to the length of

したがって、縦成分矩形の長さを主走査方向に縮めることにより、主走査方向に矩形が接触するのを防ぐことが可能になるので、複数分の行が一行と誤認識されやすいという事態が回避され、安定した行統合が可能になる。   Therefore, by reducing the length of the vertical component rectangle in the main scanning direction, it is possible to prevent the rectangle from coming into contact with the main scanning direction, so that a situation in which a plurality of lines are likely to be erroneously recognized as one line is avoided. And enables stable row integration.

なお、抽出した文字行の中から、前記スキャン画像の歪み補正に利用するための文字行を決定する手段においては、請求項3記載の発明のように、ページ綴じ部付近まで最も食い込んでいる矩形に包摂される罫線を前記スキャン画像の歪み補正に利用するための罫線と決定し、または、請求項4記載の発明のように、副走査方向の長さが最も長い矩形に包摂される罫線を前記スキャン画像の歪み補正に利用するための罫線と決定し、もしくは、請求項5記載の発明のように、前記スキャン画像のページ外形に最も近い矩形に包摂される罫線を前記スキャン画像の歪み補正に利用するための罫線と決定する。また、請求項6記載の発明のように、前記スキャン画像の歪み補正に利用するための罫線を、ページ綴じ部付近まで最も食い込んでいる矩形に包摂される罫線、副走査方向の長さが最も長い矩形に包摂される罫線、前記スキャン画像のページ外形に最も近い矩形に包摂される罫線の順に決定するようにしても良い。   In the means for determining a character line to be used for distortion correction of the scanned image from the extracted character lines, a rectangle that bites most into the vicinity of the page binding portion as in the invention of claim 3. Or the ruled line included in the rectangle with the longest length in the sub-scanning direction as in the invention of claim 4. 6. A ruled line that is determined to be a ruled line to be used for distortion correction of the scanned image, or a ruled line included in a rectangle closest to a page outline of the scanned image, as in the invention of claim 5, is corrected for distortion of the scanned image. Determine the ruled line to use. According to a sixth aspect of the present invention, the ruled line used for distortion correction of the scanned image is a ruled line included in a rectangle that penetrates most to the vicinity of the page binding portion, and has the longest length in the sub-scanning direction. The ruled line included in the long rectangle and the ruled line included in the rectangle closest to the page outline of the scanned image may be determined in this order.

請求項7記載の発明のプログラムは、画像読取手段の主走査方向に対してページ綴じ部がほぼ平行となるようにスキャン面の上もしくは下に接触した書籍原稿画像を前記画像読取手段により読み取ったスキャン画像の歪みを当該スキャン画像内の文字行の形状を基に補正する処理をコンピュータに実行させるプログラムであって、前記コンピュータに、前記スキャン画像から主走査方向に予め定めた第1閾値以上かつ予め定めた第2閾値以下の数の黒画素が連結する黒画素ランのみを抽出する機能と、抽出した黒画素ランを基に、文字の垂直方向の成分である縦成分のみの矩形を縦成分矩形として抽出する機能と、抽出した縦成分矩形間の主走査方向および副走査方向の距離を基に文字行を抽出する機能と、抽出した文字行の中から、前記スキャン画像の歪み補正に利用するための文字行を決定する機能と、決定した文字行中に存在する各縦成分矩形の中心座標を基に近似曲線を算出する機能と、を実行させる。 According to a seventh aspect of the invention, the image reading unit reads a book document image that is in contact with the upper or lower side of the scan surface so that the page binding portion is substantially parallel to the main scanning direction of the image reading unit. A program for causing a computer to execute a process of correcting distortion of a scanned image based on the shape of a character line in the scanned image, wherein the computer causes the computer to execute a process that is greater than or equal to a first threshold value that is predetermined in the main scanning direction from the scanned image A function that extracts only black pixel runs in which a number of black pixels equal to or less than a predetermined second threshold value are connected , and a vertical component that is a vertical component that is a vertical component of a character, based on the extracted black pixel runs. The function of extracting as a rectangle, the function of extracting a character line based on the distance between the extracted vertical component rectangles in the main scanning direction and the sub-scanning direction, A function of determining the character line to be used for distortion correction of the catcher down image, a function of calculating an approximate curve center coordinates based on each longitudinal component rectangle present in the determined character line, is executed.

したがって、文字の縦成分のみの矩形を抽出することで隣接する文字の接触が防止される。このような縦成分矩形から近似曲線を求めることにより、英文画像の主走査方向の歪み補正における精度の高精度化を図ることが可能になる。   Therefore, by extracting a rectangle of only the vertical component of the character, contact between adjacent characters is prevented. By obtaining an approximate curve from such a vertical component rectangle, it is possible to improve the accuracy of distortion correction in the main scanning direction of an English image.

請求項8記載の発明は、請求項7記載のプログラムにおいて、抽出した縦成分矩形の主走査方向の長さが予め定めた閾値以上の場合、当該縦成分矩形の長さを当該閾値の長さに縮める。   According to an eighth aspect of the present invention, in the program according to the seventh aspect, when the length of the extracted vertical component rectangle in the main scanning direction is equal to or greater than a predetermined threshold, the length of the vertical component rectangle is set to the length of the threshold. Shrink to

したがって、縦成分矩形の長さを主走査方向に縮めることにより、主走査方向に矩形が接触するのを防ぐことが可能になるので、複数分の行が一行と誤認識されやすいという事態が回避され、安定した行統合が可能になる。   Therefore, by reducing the length of the vertical component rectangle in the main scanning direction, it is possible to prevent the rectangle from coming into contact with the main scanning direction, so that a situation in which a plurality of lines are likely to be erroneously recognized as one line is avoided. And enables stable row integration.

なお、抽出した文字行の中から、前記スキャン画像の歪み補正に利用するための文字行を決定する機能においては、請求項9記載の発明のように、ページ綴じ部付近まで最も食い込んでいる矩形に包摂される罫線を前記スキャン画像の歪み補正に利用するための罫線と決定し、または、請求項10記載の発明のように、副走査方向の長さが最も長い矩形に包摂される罫線を前記スキャン画像の歪み補正に利用するための罫線と決定し、もしくは、請求項11記載の発明のように、前記スキャン画像のページ外形に最も近い矩形に包摂される罫線を前記スキャン画像の歪み補正に利用するための罫線と決定する。また、請求項12記載の発明のように、前記スキャン画像の歪み補正に利用するための罫線を、ページ綴じ部付近まで最も食い込んでいる矩形に包摂される罫線、副走査方向の長さが最も長い矩形に包摂される罫線、前記スキャン画像のページ外形に最も近い矩形に包摂される罫線の順に決定するようにしても良い。   In the function for determining a character line to be used for distortion correction of the scanned image from the extracted character lines, a rectangle that bites most into the vicinity of the page binding portion as in the invention according to claim 9. Or the ruled line included in the rectangle having the longest length in the sub-scanning direction is determined as the ruled line for use in correcting the distortion of the scanned image. 12. A ruled line that is determined as a ruled line to be used for distortion correction of the scan image, or a ruled line included in a rectangle closest to a page outline of the scan image, as in the invention of claim 11, is corrected for distortion of the scan image. Determine the ruled line to use. According to a twelfth aspect of the present invention, the ruled line used for distortion correction of the scanned image is a ruled line included in a rectangle that penetrates most to the vicinity of the page binding portion, and has the longest length in the sub-scanning direction. The ruled line included in the long rectangle and the ruled line included in the rectangle closest to the page outline of the scanned image may be determined in this order.

請求項13記載の発明の記憶媒体は、請求項7ないし12のいずれか一記載のプログラムを記憶する。   A storage medium according to a thirteenth aspect stores the program according to any one of the seventh to twelfth aspects.

したがって、請求項7ないし12のいずれか一記載のプログラムを有体物の形態で取り扱うことが可能となる。   Therefore, the program according to any one of claims 7 to 12 can be handled in the form of a tangible object.

本発明によれば、文字の縦成分のみの矩形を抽出することで隣接する文字の接触を防止し、このような縦成分矩形から近似曲線を求めることにより、英文画像の主走査方向の歪み補正における精度の高精度化を図ることができる。   According to the present invention, by extracting a rectangle having only a vertical component of a character, contact between adjacent characters is prevented, and an approximate curve is obtained from such a vertical component rectangle, thereby correcting distortion in the main scanning direction of an English image. It is possible to improve the accuracy of the.

本発明の実施の一形態を図1ないし図61に基づいて説明する。本実施の形態の画像歪み補正装置は画像形成装置であるデジタル複写機に備えられており、画像読取装置としてはデジタル複写機のスキャナ部が適用されている。   An embodiment of the present invention will be described with reference to FIGS. The image distortion correction apparatus according to the present embodiment is provided in a digital copying machine as an image forming apparatus, and a scanner unit of the digital copying machine is applied as the image reading apparatus.

ここで、図1はスキャナ部1の構成を示す縦断正面図である。図1に示すように、スキャナ部1は、原稿を載置するコンタクトガラス2と、原稿の露光用の露光ランプ3および第一反射ミラー4からなる第一走行体5と、第二反射ミラー6および第三反射ミラー7からなる第二走行体8と、原稿の画像を読み取る撮像素子としてのCCD(Charge Coupled Device)9と、このCCD9に結像させるためのレンズユニット10と、原稿を載置する基準になるとともにコンタクトガラス2のズレや外れを防止する原稿スケール11と、この原稿スケール11の下側に設置されたシェーディング補正用の白基準板12と、フレーム14とを備えている。CCD9はセンサボード13上に形成されている。   Here, FIG. 1 is a longitudinal front view showing the configuration of the scanner unit 1. As shown in FIG. 1, the scanner unit 1 includes a contact glass 2 on which a document is placed, a first traveling body 5 including an exposure lamp 3 for exposing a document and a first reflection mirror 4, and a second reflection mirror 6. And a second traveling body 8 composed of the third reflecting mirror 7, a CCD (Charge Coupled Device) 9 as an imaging device for reading an image of the document, a lens unit 10 for forming an image on the CCD 9, and a document placed thereon. A document scale 11 that prevents the contact glass 2 from shifting and coming off, a white reference plate 12 for shading correction installed under the document scale 11, and a frame 14 are provided. The CCD 9 is formed on the sensor board 13.

原稿の走査時には、第一走行体5および第二走行体8はステッピングモータ24(図3参照)によって副走査方向に移動する。すなわち、第一走行体5および第二走行体8がコンタクトガラス2の下を走行して、露光ランプ3で原稿を露光走査し、その反射光を第一反射ミラー4、第二反射ミラー6および第三反射ミラー7で反射して、レンズユニット10を通してCCD9に結像させる。ここに、画像読取手段が実現されている。   During scanning of a document, the first traveling body 5 and the second traveling body 8 are moved in the sub-scanning direction by a stepping motor 24 (see FIG. 3). That is, the first traveling body 5 and the second traveling body 8 travel under the contact glass 2, and the original is exposed and scanned by the exposure lamp 3. The light is reflected by the third reflecting mirror 7 and imaged on the CCD 9 through the lens unit 10. Here, an image reading means is realized.

このようなスキャナ部1は、このスキャナ部1で読み取られた原稿の画像に基づく画像データに応じ、例えば電子写真方式で用紙上に画像の形成を行う画像印刷装置であるプリンタ部(図示せず)を備えるデジタル複写機16に搭載されている。図2は、スキャナ部1を搭載したデジタル複写機16の上部部分を示す斜視図である。図2に示すように、スキャナ部1には、コンタクトガラス2に対して開閉自在な圧板17と、この圧板17の開閉を検出する開閉センサ18とが設けられている。なお、デジタル複写機16に備えられるプリンタとしては、電子写真方式のほか、インクジェット方式、昇華型熱転写方式、銀塩写真方式、直接感熱記録方式、溶融型熱転写方式など、種々の印刷方式を適用することができる。その具体的な構成については周知であるため、詳細な説明は省略する。   Such a scanner unit 1 is a printer unit (not shown) that is an image printing apparatus that forms an image on a sheet by, for example, electrophotography, in accordance with image data based on an image of a document read by the scanner unit 1. ). FIG. 2 is a perspective view showing an upper portion of the digital copying machine 16 on which the scanner unit 1 is mounted. As shown in FIG. 2, the scanner unit 1 is provided with a pressure plate 17 that can be opened and closed with respect to the contact glass 2, and an open / close sensor 18 that detects opening and closing of the pressure plate 17. As the printer provided in the digital copying machine 16, various printing methods such as an ink jet method, a sublimation type thermal transfer method, a silver salt photography method, a direct thermal recording method, and a melt type thermal transfer method are applied in addition to the electrophotographic method. be able to. Since the specific configuration is well known, detailed description is omitted.

図3は、スキャナ部1の制御系の電気的な接続を示すブロック図である。図3に示すように、この制御系は、スキャナ部1の全体を制御するメイン制御部19に、CCD9で読み取った画像データに各種の画像処理を施す回路である画像処理部20と、第一走行体5および第二走行体8を制御する回路である走行体制御部21と、デジタル複写機16への各種操作を受け付け、また、各種メッセージを表示する操作パネル22と、CCD9で読み取った画像データや所定のデータ等を記憶するメモリ23とが接続されている。なお、操作パネル22には、コピー開始を宣言するためのコピースタートキー等が設けられている。また、走行体制御部21には、露光ランプ3と、第一走行体5および第二走行体8を駆動するステッピングモータ24と、第一走行体5および第二走行体8がホームポジションにあるか否かを検出するスキャナホームポジションセンサ(HPセンサ)25と、開閉センサ18とが接続されている。   FIG. 3 is a block diagram showing the electrical connection of the control system of the scanner unit 1. As shown in FIG. 3, the control system includes an image processing unit 20 that is a circuit that performs various image processing on image data read by the CCD 9, and a first control unit 19 that controls the entire scanner unit 1. An image read by the CCD 9 and an operation panel 22 for accepting various operations to the digital copying machine 16 and receiving various operations on the digital copying machine 16, which is a circuit for controlling the traveling body 5 and the second traveling body 8. A memory 23 for storing data, predetermined data, and the like is connected. The operation panel 22 is provided with a copy start key for declaring the start of copying. Further, in the traveling body control unit 21, the exposure lamp 3, the stepping motor 24 that drives the first traveling body 5 and the second traveling body 8, and the first traveling body 5 and the second traveling body 8 are in the home position. A scanner home position sensor (HP sensor) 25 for detecting whether or not and an open / close sensor 18 are connected.

ここで、図4は画像処理部20の基本的な内部構成を示すブロック図である。図4に示すように、画像処理部20は、原稿をCCD9により読み取ったアナログ画像信号の増幅処理やデジタル変換処理等を行うアナログビデオ処理部26、シェーディング補正処理を行うシェーディング補正処理部27、シェーディング補正処理後のデジタル画像信号に、MTF補正、変倍処理、γ補正等の各種画像データ処理を行いスキャン画像を生成する画像データ処理部28から構成されている。以上のような画像処理後のデジタル画像信号は、メイン制御部19を介してプリンタ部に送信されて、画像形成に供される。   Here, FIG. 4 is a block diagram showing a basic internal configuration of the image processing unit 20. As shown in FIG. 4, the image processing unit 20 includes an analog video processing unit 26 that performs analog image signal amplification processing and digital conversion processing when a document is read by the CCD 9, a shading correction processing unit 27 that performs shading correction processing, and shading. The digital image signal after the correction process includes an image data processing unit 28 that performs various image data processes such as MTF correction, scaling process, and γ correction to generate a scan image. The digital image signal after the image processing as described above is transmitted to the printer unit via the main control unit 19 and used for image formation.

メイン制御部19は、図5に示すように、各部を集中的に制御するCPU(Central Processing Unit)31を備えており、このCPU31には、BIOSなどを記憶した読出し専用メモリであるROM(Read Only Memory)32と、各種データを書換え可能に記憶してCPU31の作業エリアとして機能するRAM(Random Access Memory)33とがバス34で接続されており、マイクロコンピュータを構成している。さらにバス34には、制御プログラムが記憶されたHDD35と、CD(Compact Disc)−ROM37を読み取るCD−ROMドライブ36と、プリンタ部等との通信を司るインタフェース(I/F)38とが接続されている。   As shown in FIG. 5, the main control unit 19 includes a CPU (Central Processing Unit) 31 that centrally controls each unit. The CPU 31 includes a ROM (Read Only Memory) that stores BIOS and the like. Only memory (RAM) 32 and a RAM (Random Access Memory) 33 that stores various data in a rewritable manner and functions as a work area of the CPU 31 are connected by a bus 34 to constitute a microcomputer. Further, an HDD 35 in which a control program is stored, a CD-ROM drive 36 that reads a CD (Compact Disc) -ROM 37, and an interface (I / F) 38 that controls communication with a printer unit and the like are connected to the bus 34. ing.

図5に示すCD−ROM37は、この発明の記憶媒体を実施するものであり、所定の制御プログラムが記憶されている。CPU31は、CD−ROM37に記憶されている制御プログラムをCD−ROMドライブ36で読み取り、HDD35にインストールする。これにより、メイン制御部19は、後述するような各種の処理を行うことが可能な状態となる。   A CD-ROM 37 shown in FIG. 5 implements the storage medium of the present invention, and stores a predetermined control program. The CPU 31 reads the control program stored in the CD-ROM 37 with the CD-ROM drive 36 and installs it in the HDD 35. As a result, the main control unit 19 is in a state in which various processes as described later can be performed.

なお、記憶媒体としては、CD−ROM37のみならず、DVDなどの各種の光ディスク、各種光磁気ディスク、フレキシブルディスクなどの各種磁気ディスク、半導体メモリ等、各種方式のメディアを用いることができる。また、インターネットなどのネットワークからプログラムをダウンロードし、HDD35にインストールするようにしてもよい。この場合に、送信側のサーバでプログラムを記憶している記憶装置も、この発明の記憶媒体である。なお、プログラムは、所定のOS(Operating System)上で動作するものであってもよいし、その場合に後述の各種処理の一部の実行をOSに肩代わりさせるものであってもよいし、ワープロソフトなど所定のアプリケーションソフトやOSなどを構成する一群のプログラムファイルの一部として含まれているものであってもよい。   As the storage medium, not only the CD-ROM 37 but also various types of media such as various optical disks such as DVD, various magnetic disks such as various magneto-optical disks and flexible disks, and semiconductor memory can be used. Alternatively, the program may be downloaded from a network such as the Internet and installed in the HDD 35. In this case, the storage device storing the program in the server on the transmission side is also a storage medium of the present invention. Note that the program may operate on a predetermined OS (Operating System), in which case the OS may execute a part of various processes described later, or a word processor. It may be included as part of a group of program files that constitute predetermined application software such as software or an OS.

次に、メイン制御部19に設けられたCPU31が制御プログラムに基づいて実行する各種処理の内容について説明する。ここでは、CPU31が実行する処理のうち、本実施の形態のスキャナ部1が備える特長的な機能であるスキャン画像の歪み補正機能を実現するスキャン画像の歪み補正処理についてのみ説明する。すなわち、メイン制御部19は画像歪み補正装置として機能するものである。   Next, the contents of various processes executed by the CPU 31 provided in the main control unit 19 based on the control program will be described. Here, only the scan image distortion correction processing that realizes the scan image distortion correction function, which is a characteristic function of the scanner unit 1 of the present embodiment, among the processes executed by the CPU 31 will be described. That is, the main control unit 19 functions as an image distortion correction device.

図6は、スキャン画像の歪み補正処理の流れを概略的に示すフローチャートである。なお、ここでは、図7に示すように、書籍原稿40がそのページ綴じ部41とスキャナ部1の画像読み取りの主走査方向とが平行になるように位置させてコンタクトガラス2に載置されている場合について説明する。   FIG. 6 is a flowchart schematically showing the flow of a distortion correction process for a scanned image. Here, as shown in FIG. 7, the book document 40 is placed on the contact glass 2 so that the page binding portion 41 and the main scanning direction of image reading of the scanner portion 1 are parallel to each other. The case will be described.

まず、ステップS1において、画像データ処理部28から出力されたコンタクトガラス2に載置されている書籍原稿40のスキャン画像を入力する。ここで、図8は入力した画像の一例を示したものである。そして、図9に示すように、入力された書籍原稿40のスキャン画像には、ページ綴じ部41の近傍において歪みが生じている。   First, in step S1, a scanned image of the book document 40 placed on the contact glass 2 output from the image data processing unit 28 is input. Here, FIG. 8 shows an example of the input image. As shown in FIG. 9, the input scanned image of the book document 40 is distorted in the vicinity of the page binding portion 41.

次いで、書籍原稿40のスキャン画像(例えば、モノクロ多値画像)の最適2値化処理を実行し(ステップS2)、副走査方向の黒画素(スキャン画像の画素の中でその濃度値が予め定めた濃度値よりも濃い画素)数のヒストグラムを求める(ステップS3)。図10は、図8に示した画像の綴じ部境界線左側の黒画素ヒストグラムである。図10中の横軸は、主走査方向の黒画素(スキャン画像の画素の中でその濃度値が予め定めた濃度値よりも濃い画素)の位置を示し、図10中の縦軸は、その位置毎の黒画素数を示すものである。なお、ページ綴じ部41のスキャン画像である綴じ部境界線としては、スキャン画像中の画素の中でその濃度値が元も濃い画素が位置する副走査方向の位置が選択される。   Next, optimal binarization processing of a scanned image (for example, a monochrome multi-valued image) of the book original 40 is executed (step S2), and a black pixel in the sub-scanning direction (a density value among pixels of the scanned image is determined in advance). A histogram with the number of pixels darker than the density value is obtained (step S3). FIG. 10 is a black pixel histogram on the left side of the binding portion boundary line of the image shown in FIG. The horizontal axis in FIG. 10 indicates the position of the black pixel in the main scanning direction (the pixel whose density value is darker than the predetermined density value among the pixels of the scanned image), and the vertical axis in FIG. This indicates the number of black pixels for each position. Note that the position in the sub-scanning direction where a pixel whose density value is originally dark among the pixels in the scan image is selected as the binding portion boundary line that is the scan image of the page binding portion 41.

なお、スキャン画像がカラー多値画像の場合における2値化処理は、例えばRGB成分の何れか一つの成分に着目し(例えばG成分)、G成分の所定の濃度閾値よりも大きいものを黒画素とし、G成分の所定の濃度閾値よりも小さいものを白画素とすれば良い。また、RGBを色変換して輝度成分と色差成分とに分け、輝度成分で閾値処理を行うようにしても良い。   Note that the binarization process when the scanned image is a color multi-valued image focuses on, for example, any one of the RGB components (for example, the G component), and black pixels that are larger than the predetermined density threshold of the G component are black pixels. And a pixel smaller than a predetermined density threshold of the G component may be a white pixel. Alternatively, RGB may be color-converted to be divided into a luminance component and a color difference component, and threshold processing may be performed with the luminance component.

続くステップS4においては、ページ外形/罫線/文字行の抽出処理を実行する。ここで、図11は、ページ外形/罫線/文字行の抽出処理の流れを概略的に示すフローチャートである。   In the subsequent step S4, page outline / ruled line / character line extraction processing is executed. FIG. 11 is a flowchart schematically showing the flow of page outline / ruled line / character line extraction processing.

[スキャン画像からのページ外形の抽出]
まず、ステップS41におけるスキャン画像からのページ外形の抽出処理について説明する。ここで、図12は上端にページ外形が存在するスキャン画像の一例を示す説明図、図13は図12に示したスキャン画像の綴じ部境界線左側の黒画素ヒストグラムである。図13に示すヒストグラムのx軸はスキャン画像の主走査方向(図12の上下方向)を示すものであり、スキャン画像の上端はヒストグラムの左端に対応付けられている。なお、ページ外形が下端に存在するスキャン画像の場合には、スキャン画像の下端がヒストグラムの右端に対応付けられることになる。したがって、図12に示すようにスキャン画像の上端にページ外形が存在する場合、スキャン画像の上部に黒い帯が現れることから、図13に示すヒストグラムの左端には高い縦棒が現れることになる。本実施の形態では、このような特性を利用して、スキャン画像にページ外形が存在するか否かの判断を行う。
[Extract page outline from scanned image]
First, the process of extracting the page outline from the scanned image in step S41 will be described. Here, FIG. 12 is an explanatory diagram showing an example of a scan image having a page outline at the upper end, and FIG. 13 is a black pixel histogram on the left side of the binding boundary line of the scan image shown in FIG. The x-axis of the histogram shown in FIG. 13 indicates the main scanning direction (vertical direction in FIG. 12) of the scan image, and the upper end of the scan image is associated with the left end of the histogram. Note that in the case of a scanned image having a page outline at the lower end, the lower end of the scanned image is associated with the right end of the histogram. Accordingly, when a page outline exists at the upper end of the scanned image as shown in FIG. 12, a black band appears at the upper portion of the scanned image, and thus a high vertical bar appears at the left end of the histogram shown in FIG. In this embodiment, it is determined whether or not a page outline exists in the scanned image using such characteristics.

より具体的には、図13に示すように、綴じ部境界線からスキャン画像の左端(図12の左端)までの距離AO、ヒストグラム縦棒の高さBOとし、その比率を下記に示す式(1)により算出し、

Figure 0004145256
算出された比率kが、予め定められた閾値よりも大きい場合に、スキャン画像にページ外形が存在すると判断する。 More specifically, as shown in FIG. 13, the distance AO from the binding boundary line to the left end of the scan image (left end in FIG. 12), the height BO of the histogram vertical bar, and the ratio is expressed by the following formula ( 1)
Figure 0004145256
When the calculated ratio k is larger than a predetermined threshold, it is determined that a page outline exists in the scanned image.

なお、スキャン画像の上下にページ外形が存在する場合には、ヒストグラムの左右両端に高い縦棒が現れることになるので、このような場合には、ヒストグラムの左右両端の高い縦棒に基づいてスキャン画像にページ外形が存在するか否かの判断がそれぞれ実行される。   In addition, when page outlines exist above and below the scanned image, high vertical bars appear at the left and right ends of the histogram. In such a case, scanning is performed based on the high vertical bars at the left and right ends of the histogram. A determination is made as to whether or not a page outline exists in the image.

以上の処理により、スキャン画像にページ外形が存在すると判断された場合には、左右ページの上下辺のいずれにページ外形が存在しているのかという情報とともにページ外形を抽出し、RAM33に一時的に記憶する。   If it is determined by the above processing that the page outline exists in the scanned image, the page outline is extracted together with information on which of the upper and lower sides of the left and right pages the page outline exists, and temporarily stored in the RAM 33. Remember.

なお、このスキャン画像にページ外形が存在するか否かの判断処理は、スキャン画像の綴じ部境界線を境にした左右ページ毎に実行される。   Note that the process of determining whether or not a page outline exists in the scanned image is executed for each of the left and right pages with the binding line boundary line of the scanned image as a boundary.

[スキャン画像からの罫線の抽出]
続くステップS42においては、スキャン画像からの罫線の抽出処理を実行する。ステップS42におけるスキャン画像からの罫線の抽出処理について説明する。
[Extract ruled lines from scanned images]
In the subsequent step S42, a ruled line extraction process from the scanned image is executed. The ruled line extraction process from the scanned image in step S42 will be described.

[罫線候補の検出]
ここで、図14は罫線が存在するスキャン画像の一例を示す説明図である。本実施の形態では、罫線の矩形抽出を導入し、図14に示すようなスキャン画像に存在する罫線を1つの矩形として抽出する。なお、詳細については後述するが、ただ単に矩形抽出を行うだけでは罫線が単独で抽出できない場合もあるために、本実施の形態では、ランの登録に制限を設けた矩形抽出を行う。
[Detection of ruled line candidates]
Here, FIG. 14 is an explanatory diagram showing an example of a scanned image having ruled lines. In the present embodiment, ruled line rectangle extraction is introduced, and ruled lines existing in a scanned image as shown in FIG. 14 are extracted as one rectangle. Although details will be described later, there may be cases where a ruled line cannot be extracted solely by simply performing rectangle extraction. Therefore, in this embodiment, rectangle extraction with restrictions on run registration is performed.

図15は、2値化した画像に矩形抽出を施した結果を示す説明図である。図15に示すように、黒画素が連結している箇所が1つの矩形として抽出される。図15に示すように、罫線が存在していれば、副走査方向に細長い矩形として抽出されることから、細長い矩形の有無や抽出した矩形の形状(長さ・縦横比)や位置を基に罫線の有無の判定を行う。   FIG. 15 is an explanatory diagram illustrating a result of performing rectangular extraction on a binarized image. As shown in FIG. 15, a portion where black pixels are connected is extracted as one rectangle. As shown in FIG. 15, if a ruled line exists, it is extracted as a long and narrow rectangle in the sub-scanning direction. Therefore, based on the presence or absence of the long and narrow rectangle and the extracted rectangular shape (length / aspect ratio) and position. The presence / absence of ruled lines is determined.

ただし、ただ単に矩形抽出を行うだけでは、罫線が単独で抽出できない場合もある。図16に示すように、罫線がノイズと接触している場合、ノイズを含む矩形が抽出されてしまう。また、図17のような表が含まれる画像の場合は、副走査方向の罫線は主走査方向の罫線と交差するため、表全体が1つの矩形として抽出され罫線が単独で抽出できない。   However, there are cases where a ruled line cannot be extracted by simply performing rectangle extraction. As shown in FIG. 16, when the ruled line is in contact with noise, a rectangle including noise is extracted. In the case of an image including a table as shown in FIG. 17, the ruled line in the sub-scanning direction intersects the ruled line in the main scanning direction, so that the entire table is extracted as one rectangle and the ruled line cannot be extracted alone.

[ランの登録に制限を設けた矩形抽出]
そこで、罫線を単独で抽出するために、ランの登録に制限を設けた矩形抽出を行う。図16に示すような罫線とノイズが接触している画像に対して、主走査方向(垂直方向)に一定値未満のランのみを登録し矩形を抽出すると、図18に示すように罫線を構成する黒画素は登録対象のランとなるが、ノイズを構成する黒画素はランとして登録されない。罫線を構成する黒画素を対象として矩形抽出を行うため、罫線を単独で抽出することができる。
[Rectangle extraction with restrictions on run registration]
Therefore, in order to extract the ruled lines alone, rectangle extraction with restrictions on run registration is performed. For an image in which noise is in contact with the ruled line as shown in FIG. 16, if only a run having a predetermined value in the main scanning direction (vertical direction) is registered and a rectangle is extracted, the ruled line is formed as shown in FIG. 18. The black pixel to be registered is a run to be registered, but the black pixel constituting the noise is not registered as a run. Since the rectangle extraction is performed on black pixels constituting the ruled line, the ruled line can be extracted independently.

なお、罫線を矩形抽出するにあたって、副走査方向(水平方向)に長いランのみを対象に矩形抽出を行う方法もあるが、この方法だと綴じ部付近の歪み部分は矩形内に含まれない。ところが、本実施の形態の方式を用いることにより、罫線の綴じ部付近の歪み部分も矩形内に含めることが可能となり、より正確な罫線の位置や長さを検出することが出来る。   In addition, when extracting a ruled line in a rectangle, there is a method of extracting a rectangle only for a run that is long in the sub-scanning direction (horizontal direction), but in this method, a distorted portion near the binding portion is not included in the rectangle. However, by using the method of the present embodiment, a distorted portion near the ruled line binding portion can be included in the rectangle, and a more accurate ruled line position and length can be detected.

[矩形統合]
表など、副走査方向(水平方向)の罫線と主走査方向(垂直方向)の罫線とが交差している画像に矩形抽出を行うと、主走査方向の罫線はランとして登録されないため、副走査方向に矩形が細切れに抽出されてしまう。すると、図19に示すように、副走査方向に長い罫線があるにもかかわらず、その罫線は1つの矩形として抽出されず、複数の細切れの矩形となって抽出される。
[Rectangle integration]
If rectangle extraction is performed on an image such as a table where a ruled line in the sub-scanning direction (horizontal direction) and a ruled line in the main scanning direction (vertical direction) intersect, the ruled line in the main scanning direction is not registered as a run. Rectangles are extracted in the direction. Then, as shown in FIG. 19, although there is a long ruled line in the sub-scanning direction, the ruled line is not extracted as one rectangle, but is extracted as a plurality of finely divided rectangles.

そこで、矩形統合を行う。副走査方向における距離が一定値以下の矩形同士を統合する。図20は、矩形統合を施した例である。矩形統合は、図20に示すように、細切れになっていた矩形を1つの矩形に統合し、罫線の矩形を抽出するものである。この矩形統合は、かすれた罫線や点線の罫線に対して行っても、罫線全体が1つの矩形として抽出されるため有効な方法である。   Therefore, rectangle integration is performed. The rectangles whose distances in the sub-scanning direction are equal to or less than a certain value are integrated. FIG. 20 is an example in which rectangular integration is performed. In the rectangle integration, as shown in FIG. 20, the rectangles that have been cut into pieces are integrated into one rectangle, and a ruled line rectangle is extracted. This integration of rectangles is an effective method because the entire ruled line is extracted as one rectangle even if it is applied to a blurred ruled line or a dotted ruled line.

[最適罫線の選択]
次いで、一定値未満のランのみを登録した矩形抽出を行い、副走査方向に細長い矩形の有無にて罫線の有無を判定する。このような罫線の有無の判定は、画像の左上・左下・右上・右下の4箇所それぞれにおいて行う。例えば、図21に示す画像の場合、左上にのみ罫線が存在しないということになる。ある箇所にて複数罫線が存在する場合は、補正に利用する罫線を以下の優先順位で決定する。
1.綴じ部付近まで食い込んでいる罫線
例えば、図21に示す画像の右下の場合、綴じ部付近まで食い込んでいる罫線が補正に利用される。
2.長さが長い方の罫線
例えば、図21に示す画像の右上の場合、双方の罫線は綴じ部付近まで食い込んでいるため、長さが長い方の罫線が補正に利用される。
3.位置が外側の罫線
例えば、図21に示す画像の左下の場合、双方の罫線は綴じ部付近まで食い込んでいて、なおかつ、長さがほぼ同じため、画像の外側に位置する罫線が補正に利用される。
[Select optimal ruled line]
Next, rectangle extraction in which only runs less than a certain value are registered is performed, and the presence or absence of ruled lines is determined based on the presence or absence of a long and narrow rectangle in the sub-scanning direction. Such determination of the presence or absence of ruled lines is performed at each of the four locations of the upper left, lower left, upper right, and lower right of the image. For example, in the case of the image shown in FIG. 21, no ruled line exists only in the upper left. If there are a plurality of ruled lines at a certain location, the ruled lines used for correction are determined in the following priority order.
1. For example, in the case of the lower right side of the image shown in FIG. 21, a ruled line that penetrates to the vicinity of the binding portion is used for correction.
2. For example, in the case of the upper right side of the image shown in FIG. 21, the ruled line with the longer length is used for correction because both the ruled lines have penetrated to the vicinity of the binding portion.
3. For example, in the case of the lower left side of the image shown in FIG. 21, both ruled lines cut into the vicinity of the binding portion and the lengths are almost the same, so that the ruled line located outside the image is used for correction. The

[最適罫線の座標値検出]
以上のようにして最適罫線を選択した後、各罫線の座標値を検出する。罫線の位置座標は、抽出された矩形の座標から得ることができる。なお、特殊な例として、副走査方向に細長い矩形の位置が画像の上端や下端に接している場合は、その矩形がノイズである可能性を考慮して、罫線とはみなさないものとする。また、左右のページそれぞれで細長い矩形が抽出された場合(例えば、左上と右上、左下と右下)、画像によっては、綴じ部をまたがる形で左右ページの矩形が統合されることがある。すると、水平方向画像全体に細長い矩形が抽出されることから、抽出された矩形にそのような特徴が見られた場合は、綴じ部位置を境にその矩形を分割する。
[Coordinate value detection of optimal ruled line]
After selecting the optimum ruled line as described above, the coordinate value of each ruled line is detected. The position coordinates of the ruled line can be obtained from the extracted rectangular coordinates. As a special example, when the position of a rectangle elongated in the sub-scanning direction is in contact with the upper end or the lower end of the image, the rectangle is not regarded as a ruled line in consideration of the possibility that the rectangle is noise. In addition, when elongated rectangles are extracted from the left and right pages (for example, upper left and upper right, lower left and lower right), depending on the image, the rectangles of the left and right pages may be integrated across the binding portion. Then, since a long and narrow rectangle is extracted from the entire horizontal image, when such a feature is found in the extracted rectangle, the rectangle is divided at the binding position.

以上の処理により、スキャン画像に罫線が存在すると判断された場合には、左右各ページのいずれの位置に罫線が存在しているのかという情報とともに罫線を抽出し、RAM33に一時的に記憶する。   If it is determined by the above processing that a ruled line exists in the scanned image, the ruled line is extracted together with information on which position of the ruled line exists on each of the left and right pages, and temporarily stored in the RAM 33.

[スキャン画像からの文字行の抽出]
続くステップS43においては、スキャン画像からの文字行の抽出処理を実行する。ステップS43におけるスキャン画像からの文字行の抽出処理について説明する。本実施の形態においては、まず、スキャン画像中の文字行が縦書き文字行なのか、横書き文字行なのかの判別を行う。
[Extract text lines from scanned images]
In a succeeding step S43, a character line extraction process from the scanned image is executed. The character line extraction process from the scanned image in step S43 will be described. In the present embodiment, first, it is determined whether the character line in the scanned image is a vertically written character line or a horizontally written character line.

[文字行の判別]
スキャン画像中の文字行が縦書き文字行なのか、横書き文字行なのかの判別手法について説明する。ここで、図22は図8に示した画像の副走査方向の黒白反転数ヒストグラムである。図22中の横軸は、副走査方向(左右方向)の黒画素(スキャン画像を黒白反転させた画素の中でその濃度値が予め定めた濃度値よりも濃い画素)の主走査方向上での位置を示し、図22中の縦軸は、その位置毎の黒画素数を示すものである。また、図23は図8に示した画像の主走査方向の黒白反転数ヒストグラムである。図23中の横軸は、主走査方向(上下方向)の黒画素(スキャン画像を黒白反転させた画素の中でその濃度値が予め定めた濃度値よりも濃い画素)の副走査方向上での位置を示し、図23中の縦軸は、その位置毎の黒画素数を示すものである。画像中の文字が横書きの図8に示したようなスキャン画像の場合、図22に示すような副走査方向のヒストグラムは激しく変化するが、図23に示すような主走査方向のヒストグラムの変化は少ない。また、特に図示しないが、スキャン画像中の文字行が縦書き文字行である場合には、主走査方向のヒストグラムは激しく変化するが、副走査方向のヒストグラムの変化は少ない。
[Determination of character line]
A method for determining whether a character line in a scanned image is a vertically written character line or a horizontally written character line will be described. Here, FIG. 22 is a black-and-white inversion number histogram in the sub-scanning direction of the image shown in FIG. The horizontal axis in FIG. 22 is in the main scanning direction of black pixels in the sub-scanning direction (left-right direction) (pixels whose density value is darker than a predetermined density value among pixels obtained by inverting the scan image in black and white). The vertical axis in FIG. 22 indicates the number of black pixels for each position. FIG. 23 is a black-and-white inversion number histogram of the image shown in FIG. 8 in the main scanning direction. The horizontal axis in FIG. 23 represents the black pixel in the main scanning direction (vertical direction) (the pixel whose density value is darker than the predetermined density value among the pixels obtained by inverting the scan image in black and white) in the sub-scanning direction. The vertical axis in FIG. 23 indicates the number of black pixels for each position. When the characters in the image are horizontal scans as shown in FIG. 8, the histogram in the sub-scan direction as shown in FIG. 22 changes drastically, but the change in the histogram in the main scan direction as shown in FIG. Few. Although not particularly illustrated, when the character line in the scanned image is a vertically written character line, the histogram in the main scanning direction changes drastically, but the change in the histogram in the sub-scanning direction is small.

上述したような判別手法は、具体的には下記に示す各式により実現される。まず、下記に示す式(2)により、

Figure 0004145256
主走査方向yの位置でのヒストグラム値Pnt(y)の平均値meanHが算出される。ここで、heightは画像の高さである。
そして、下記に示す式(3)により、
Figure 0004145256
副走査方向のヒストグラムの主走査方向に関する分散σHが得られる。
同様に、下記に示す式(4)により、
Figure 0004145256
副走査方向xの位置でのヒストグラム値Pnt(x)の平均値meanVが算出される。ここで、widthは画像の幅である。
そして、下記に示す式(5)により、
Figure 0004145256
主走査方向のヒストグラムの副走査方向に関する分散σvが得られる。 Specifically, the discrimination method as described above is realized by the following equations. First, according to the following equation (2):
Figure 0004145256
An average value meanH of the histogram values Pnt (y) at the position in the main scanning direction y is calculated. Here, height is the height of the image.
And according to the equation (3) shown below,
Figure 0004145256
A variance σH in the main scanning direction of the histogram in the sub-scanning direction is obtained.
Similarly, according to equation (4) below:
Figure 0004145256
An average value meanV of the histogram values Pnt (x) at the position in the sub-scanning direction x is calculated. Here, width is the width of the image.
And according to the equation (5) shown below,
Figure 0004145256
A variance σv in the sub-scanning direction of the histogram in the main scanning direction is obtained.

上述したようにスキャン画像中の文字行が横書き文字行である場合には、副走査方向のヒストグラムの主走査方向に関する分散σHが、主走査方向のヒストグラムの副走査方向に関する分散σvより大きい。逆に、スキャン画像中の文字行が縦書き文字行である場合には、主走査方向のヒストグラムの副走査方向に関する分散σvが、副走査方向のヒストグラムの主走査方向に関する分散σHより大きい。つまり、分散σHと分散σvとの比較により、スキャン画像中の文字行が縦書き文字行なのか、横書き文字行なのかの判別が可能になっている。   As described above, when the character line in the scanned image is a horizontally written character line, the variance σH in the main scanning direction of the histogram in the sub-scanning direction is larger than the variance σv in the sub-scanning direction of the histogram in the main scanning direction. Conversely, when the character line in the scanned image is a vertically written character line, the variance σv in the sub-scanning direction of the histogram in the main scanning direction is larger than the variance σH in the main scanning direction of the histogram in the sub-scanning direction. That is, by comparing the variance σH and the variance σv, it is possible to determine whether the character line in the scanned image is a vertically written character line or a horizontally written character line.

なお、スキャン画像中の文字行が縦書き文字行なのか、横書き文字行なのかの判別に、黒白反転数ヒストグラムを用いたのは、文字行と写真部分との混同を避けるためである。一般に、黒画素ヒストグラムの値が同程度の場合、文字領域のほうが写真領域よりも黒白反転数ヒストグラムの値が大きくなるからである。   The reason why the black and white inversion number histogram is used to determine whether the character line in the scanned image is a vertically written character line or a horizontally written character line is to avoid confusion between the character line and the photograph portion. This is because, in general, when the values of the black pixel histogram are approximately the same, the value of the black / white inversion number histogram is larger in the character region than in the photo region.

[横書き文字行候補の検出]
以上のようにして横書き文字行と判別された場合、横書き文字行候補を検出する。従来方式では、文字単位の外接矩形を抽出して横書き文字行候補を検出するようにしていたが、矩形を抽出する際に隣接する文字同士が接触して複数の文字が一つの矩形となる問題点があった。そこで、本実施の形態では、ランの長さに制限を設けて文字の縦成分のみの矩形を抽出することで不適切なランを排除し、隣接する文字が接触しないようにする。ここで、縦成分とは文字の垂直方向の成分のことである。このように文字の縦成分のみの矩形を抽出する理由は、アルファベット(a〜z)文字のアスペクト比は一定ではないが、文字に含まれる垂直方向の成分のピッチが一定に近いためである。
[Detection of horizontal text line candidates]
If it is determined as a horizontally written character line as described above, a horizontally written character line candidate is detected. In the conventional method, circumscribed rectangles in character units are extracted to detect horizontal writing character line candidates, but when extracting rectangles, adjacent characters come into contact with each other and multiple characters become one rectangle. There was a point. Therefore, in the present embodiment, by limiting the length of the run and extracting a rectangle having only the vertical component of the character, an inappropriate run is eliminated and adjacent characters are not touched. Here, the vertical component is a vertical component of a character. The reason for extracting the rectangle of only the vertical component of the character in this way is that the aspect ratio of the alphabet (az) character is not constant, but the pitch of the vertical component included in the character is close to constant.

具体的には、文字と思われる黒画素の集合部分であるランを探索し、ランが発見された時にはランの終始座標の長さが主走査方向に予め定めた第1閾値以上かつ予め定めた第2閾値以下であればランとして登録する。このようにして登録したランを基に縦成分のみの矩形抽出を行う。ここで、横書き文字行候補の検出の結果の一例を図24に示す。   Specifically, a run that is a set portion of black pixels that are considered to be characters is searched, and when the run is found, the length of the start coordinate of the run is greater than or equal to a predetermined first threshold in the main scanning direction. If it is below the second threshold, it is registered as a run. Rectangle extraction of only the vertical component is performed based on the run registered in this way. Here, FIG. 24 shows an example of the result of detection of horizontal writing character line candidates.

加えて、本実施の形態においては、縦成分の矩形を抽出後、縦成分の矩形の長さを主走査方向にある一定の長さに縮める。このように縦成分の矩形の長さを主走査方向に縮めるのは、従来方式では、複数分の行が一行と誤認識されやすいという問題点があったからである。すなわち、縦成分の矩形の長さを主走査方向に縮めることにより、主走査方向に矩形が接触するのを防ぎ、安定した行統合が可能になる。ここで、図25は縦成分矩形を縮める手法を示す説明図である。図25に示すように、縦成分の矩形の主走査方向の開始座標をXs、終止座標をXe、中心座標をZとして、Zを基準に上部分と下部分を縮め、主走査方向に一定の長さ以下になるようにすることで、縦成分矩形を縮める。ここで、縦成分矩形を縮めた横書き文字行候補の検出の結果の一例を図26に示す。図26(a)は縦成分矩形を縮める前、図26(b)は縦成分矩形を縮めた後である。   In addition, in the present embodiment, after extracting the vertical component rectangle, the length of the vertical component rectangle is reduced to a certain length in the main scanning direction. The reason why the length of the vertical component rectangle is reduced in the main scanning direction is that the conventional method has a problem that a plurality of lines are easily recognized as one line. That is, by reducing the length of the vertical component rectangle in the main scanning direction, it is possible to prevent the rectangle from coming into contact with the main scanning direction and to perform stable row integration. Here, FIG. 25 is an explanatory diagram showing a method of reducing the vertical component rectangle. As shown in FIG. 25, assuming that the start coordinate in the main scanning direction of the vertical component rectangle is Xs, the end coordinate is Xe, and the center coordinate is Z, the upper and lower portions are contracted based on Z, and fixed in the main scanning direction. The vertical component rectangle is shortened by making it equal to or less than the length. Here, FIG. 26 shows an example of the result of detection of a horizontal character line candidate in which the vertical component rectangle is shortened. FIG. 26A is before the vertical component rectangle is contracted, and FIG. 26B is after the vertical component rectangle is contracted.

また、縦成分の矩形から行統合を行うとノイズの行が統合されることがある。ノイズの行内にある縦成分の矩形から生成される近似曲線は補正に適さない。そこで、長さがある一定以下の行はノイズとみなして、補正に利用しないようにする。これらの方法を行うと、安定した近似曲線を得る可能性が高くなる。   In addition, when lines are merged from vertical component rectangles, noise lines may be merged. Approximate curves generated from vertical component rectangles in the noise row are not suitable for correction. Therefore, a line having a certain length or less is regarded as noise and is not used for correction. When these methods are performed, the possibility of obtaining a stable approximate curve increases.

次いで、一行内の縦成分矩形の中心座標を基に近似曲線を生成する。ここで、図27(a)は縦成分矩形による近似曲線の生成を示す説明図、(b)行を拡大して示す説明図である。   Next, an approximate curve is generated based on the center coordinates of the vertical component rectangle in one line. Here, FIG. 27A is an explanatory diagram showing generation of an approximate curve by a vertical component rectangle, and FIG. 27B is an explanatory diagram showing an enlarged row.

[最適横書き文字行の選択]
次に、抽出した横書き文字行の中から歪み補正に最適な横書き文字行を選択する。複数の横書き文字行が検出される場合、どの横書き文字行を用いて歪み補正するかを選択する必要がある。最適な横書き文字行の選択基準の一例としては、前述した最適な罫線の選択基準と基本的に同様であって、補正に利用する横書き文字行を以下の優先順位で決定する。
1.綴じ部付近まで食い込んでいる横書き文字行
例えば、図28に示す画像の右下の場合、綴じ部付近まで食い込んでいる横書き文字行が補正に利用される。
2.長さが長い方の横書き文字行
例えば、図28に示す画像の右上の場合、双方の横書き文字行は綴じ部付近まで食い込んでいるため、長さが長い方の横書き文字行が補正に利用される。
3.位置が外側の横書き文字行
例えば、図28に示す画像の左下の場合、双方の横書き文字行は綴じ部付近まで食い込んでいて、なおかつ、長さがほぼ同じため、画像の外側に位置する横書き文字行が補正に利用される。
[Select optimum horizontal text line]
Next, a horizontal character line optimal for distortion correction is selected from the extracted horizontal character lines. When a plurality of horizontally written character lines are detected, it is necessary to select which horizontally written character line is used for distortion correction. An example of the optimum horizontal writing character line selection criterion is basically the same as the optimal ruled line selection criterion described above, and the horizontal writing character row used for correction is determined in the following priority order.
1. For example, in the case of the lower right side of the image shown in FIG. 28, a horizontally written character line that digs into the vicinity of the binding portion is used for correction.
2. For example, in the case of the upper right side of the image shown in FIG. 28, since both horizontal writing lines are biting into the vicinity of the binding portion, the horizontal writing line having the longer length is used for correction. The
3. For example, in the case of the lower left side of the image shown in FIG. 28, both the horizontal character lines are pierced to the vicinity of the binding portion, and the lengths are almost the same, so the horizontal characters that are located outside the image. Rows are used for correction.

[最適横書き文字行の座標値の決定]
最適な横書き文字行が選択された場合には、横書き文字行の(主走査方向の)座標値を決定する。横書き文字行の(主走査方向の)座標値は、横書き文字行内の各縦成分矩形主走査方向の中心点を連結し、直線部分と曲線部分とを近似して抽出することにより横書き文字行の(主走査方向の)座標値を決定することになる。より詳細には、図28に示すDは綴じ部境界線であり、BDの間は多項式近似曲線で(主走査方向の)座標値を推定し、一番左端のAとBとの間は近似直線の値で(主走査方向の)座標値を推定する。
[Determine the coordinate value of the optimal horizontal text line]
When the optimum horizontal writing character line is selected, the coordinate value (in the main scanning direction) of the horizontal writing character line is determined. The coordinate value (in the main scanning direction) of the horizontal writing line is obtained by connecting the center points of the vertical component rectangular main scanning directions in the horizontal writing line and approximating the straight line portion and the curved portion to extract the horizontal writing character line. The coordinate value (in the main scanning direction) is determined. More specifically, D shown in FIG. 28 is a binding boundary line, a coordinate value (in the main scanning direction) is estimated with a polynomial approximation curve between BDs, and an approximation between A and B at the left end is approximated. A coordinate value (in the main scanning direction) is estimated with a straight line value.

以上の処理により、スキャン画像に横書き文字行が存在すると判断された場合には、左右各ページのいずれの位置に横書き文字行が存在しているのかという情報とともに横書き文字行を抽出し、RAM33に一時的に記憶する。   If it is determined by the above processing that there is a horizontally written character line in the scanned image, the horizontally written character line is extracted together with information on which position of the horizontally written character line exists on each of the left and right pages and stored in the RAM 33. Memorize temporarily.

[縦書き文字行に基づく横書き文字行の抽出]
次に、各縦書き文字行から横書き文字行を抽出する。
[Extract horizontal text lines based on vertical text lines]
Next, a horizontal writing character line is extracted from each vertical writing character line.

図29は、各縦書き文字行からの横書き文字行の抽出処理の流れを概略的に示すフローチャートである。図29に示すように、まず、縦書き文字行の行切り出し矩形を抽出する(ステップS201)。なお、縦書き文字行の行切り出し矩形の抽出処理は、OCR等で一般に用いられている周知の技術をそのまま利用することができるので、その説明は省略する。図30は、抽出した行切り出し矩形を例示的に示す説明図である。   FIG. 29 is a flowchart schematically showing the flow of processing for extracting horizontally written character lines from each vertically written character line. As shown in FIG. 29, first, a line cut-out rectangle of a vertically written character line is extracted (step S201). In addition, since the extraction process of the line cut-out rectangle of a vertically written character line can use the well-known technique generally used by OCR etc., the description is abbreviate | omitted. FIG. 30 is an explanatory diagram exemplarily showing the extracted row cutout rectangle.

次いで、縦書き文字行の先頭(もしくは末尾)のy座標が最大(もしくは最小)の縦書き文字行を抽出し、さらに、そこから予め定めた距離範囲内に先頭(もしくは末尾)が存在する縦書き文字行を抽出する(ステップS202)。より具体的には、図30に示した例においては、図31に示すように、縦書き文字行の先頭文字のy座標が最大の縦書き文字行はAで示した縦書き文字行である。そして、その先頭位置から予め定めた距離範囲h内に存在する行先頭文字は、図31中、黒丸“●”で示した文字である。すなわち、黒丸“●”で示す文字を含む縦書き文字行のみを抽出し、それ以外の縦書き文字行B,Cは除外する。なお、hはスキャン画像の解像度によって定められる定数である。   Next, a vertical writing character line having the maximum (or minimum) y coordinate at the beginning (or the end) of the vertical writing character line is extracted, and further, the vertical (with the leading (or tail)) existing within a predetermined distance range therefrom. A written character line is extracted (step S202). More specifically, in the example shown in FIG. 30, as shown in FIG. 31, the vertical writing character line having the maximum y coordinate of the first character of the vertical writing character row is the vertical writing character line indicated by A. . A line head character existing within a predetermined distance range h from the head position is a character indicated by a black circle “●” in FIG. That is, only the vertically written character lines including the character indicated by the black circle “●” are extracted, and the other vertically written character lines B and C are excluded. Note that h is a constant determined by the resolution of the scanned image.

次に、抽出した縦書き文字行の先頭(もしくは末尾)のy座標に関してヒストグラムを構成する(ステップS203)。図32では、ページの左端に近い縦書き文字行Dを基準行とし、その先頭のy座標(yD)を基準座標としている。以後、yDに対して一定幅d(例えば抽出した縦書き文字行の平均幅の1/2)の範囲内に先頭が存在する縦書き文字行の数を、yDに関するヒストグラムの値とする。図32では、yDを示す直線を上下に挟む点線の範囲内に先頭が存在する縦書き文字行がその対象となる。したがって、ページの左端に近い縦書き文字行Dの右隣の縦書き文字行Eは、その範囲外である。このように、既存の基準座標の対象範囲に先頭が含まれない縦書き文字行が出現した場合は、その縦書き文字行を新たな基準行とし、その先頭座標を新たな基準座標(ここでは、yE)とする。また、縦書き文字行Eの右隣の縦書き文字行Fの行先頭座標はyDの対象範囲に含まれるので、新たな基準座標を設けることなく、yDに関するヒストグラムの値を1だけカウントアップする。   Next, a histogram is constructed for the y-coordinate at the beginning (or the end) of the extracted vertical writing line (step S203). In FIG. 32, a vertically written character line D close to the left end of the page is set as a reference line, and the top y coordinate (yD) is set as a reference coordinate. Hereinafter, the number of vertically written character lines having a head within a range of a constant width d (for example, ½ of the average width of the extracted vertically written character lines) with respect to yD is set as a histogram value related to yD. In FIG. 32, a vertically written character line whose head exists within the range of a dotted line sandwiching a straight line indicating yD vertically is the target. Therefore, the vertical writing character line E on the right side of the vertical writing character line D near the left end of the page is out of the range. In this way, when a vertically written character line that does not include the beginning of the target range of the existing reference coordinates appears, the vertically written character line is set as a new reference line, and the beginning coordinate is set as a new reference coordinate (here, YE). Also, since the line start coordinate of the vertical writing character line F adjacent to the right of the vertical writing character line E is included in the target range of yD, the value of the histogram relating to yD is counted up by 1 without providing a new reference coordinate. .

以下、同様の処理を綴じ部境界線に向かって続けて行く。その結果、図32に示す例では、yDの対象範囲に含まれる縦書き文字行は斜線を施した矩形で囲まれた7つで、yEの対象範囲に含まれる縦書き文字行は網掛けを施した矩形で囲まれた4つとなる(これら以外の矩形で囲まれた縦書き文字行に関しても、基準行、基準座標と対象範囲がそれぞれ定められるが、図32では省略している)。なお、yDの対象範囲には本来無関係であるべき縦書き文字行Gも含まれているが、次のステップS204にてこれは除外される。   Thereafter, the same processing is continued toward the binding portion boundary line. As a result, in the example shown in FIG. 32, the vertical writing character lines included in the target range of yD are surrounded by a hatched rectangle, and the vertical writing character lines included in the target range of yE are shaded. (The reference line, the reference coordinates, and the target range are also determined for vertically written character lines surrounded by other rectangles, but are omitted in FIG. 32). In addition, although the vertical writing character line G which should be irrelevant is included in the target range of yD, this is excluded in the next step S204.

続いて、ステップS203にて構成したヒストグラムの中で、最大の値に対応する基準行の対象範囲に含まれる縦書き文字行の中で、最もページの左端(もしくは右端)にある縦書き文字行(基準行)を開始行として、綴じ部境界線へ向かって、先頭(もしくは末尾)のy座標が近接した縦書き文字行を抽出する(ステップS204)。図32では、基準座標yDの対象範囲に含まれる文字行が7つと最大であったので、その中の左端の縦書き文字行Dを開始行とし、開始行(縦書き文字行D)から綴じ部境界線へ向かって先頭のy座標が近接した縦書き文字行を抽出していく。   Subsequently, among the vertical writing character lines included in the target range of the reference line corresponding to the maximum value in the histogram configured in step S203, the vertical writing character line at the left end (or right end) of the page most. Using (reference line) as a start line, a vertically written character line having a leading (or trailing) y coordinate close to the binding boundary line is extracted (step S204). In FIG. 32, the maximum number of character lines included in the target range of the reference coordinate yD is seven, so the leftmost vertical writing character line D is the starting line, and binding is started from the starting line (vertical writing character line D). A vertically written character line with the leading y coordinate close to the partial boundary line is extracted.

ところで、開始行(縦書き文字行D)から綴じ部境界線へ向かって先頭のy座標が近接した縦書き文字行を抽出する際には、画像の歪みを生じていない部分と歪みを生じている部分とで処理内容を切り替える。   By the way, when extracting a vertically written character line whose leading y coordinate is close to the bounding line from the start line (vertically written character line D), a distortion occurs in the portion where the image is not distorted. The processing content is switched with the part that is present.

まず、画像の歪みを生じていない部分における処理について図33を参照しつつ説明する。画像の歪みを生じていない部分では、着目行Hを基準として、次の2条件を満足する縦書き文字行を抽出する。
1.y座標の正方向(図33中、上方へ向かう方向)に関して、着目行Hの先頭位置から一定範囲内b1(例えば平均文字行幅の1/2)に抽出する縦書き文字行の先頭が存在すること
2.y座標の負方向(図33中、下方へ向かう方向)に関して、着目行Hの先頭位置から見てx座標の正方向(綴じ部境界線へ向かう方向)に対して予め定めた一定角度(ここでは、角度を直線の傾き(b2/a1)で表している)の範囲内に抽出する縦書き文字行の先頭が存在すること
すなわち、着目行Hの次の縦書き文字行Iの先頭は上記の範囲外なので除外することになるが、さらに次の縦書き文字行Jの先頭は範囲内に存在するので抽出することになる。以下、縦書き文字行Jを新たな着目行として同様の処理を続ける。
First, processing in a portion where image distortion has not occurred will be described with reference to FIG. In a portion where the image is not distorted, a vertically written character line that satisfies the following two conditions is extracted with reference to the target line H.
1. With respect to the positive direction of the y-coordinate (the upward direction in FIG. 33), there is a head of a vertically written character line that is extracted within a certain range b1 (for example, 1/2 of the average character line width) from the head position of the target line H. 1. What to do With respect to the negative direction of the y coordinate (the downward direction in FIG. 33), a predetermined angle (here) with respect to the positive direction of the x coordinate (the direction toward the binding boundary) viewed from the head position of the target row H Then, the head of the vertical writing character line to be extracted exists within the range of the angle of the straight line (b2 / a1). That is, the head of the vertical writing character line I next to the target row H is the above Since it is out of the range, it will be excluded, but the beginning of the next vertically written character line J will be extracted because it exists within the range. Hereinafter, the same processing is continued with the vertically written character line J as a new target line.

次に、画像の歪みを生じている部分における処理について図34を参照しつつ説明する。画像の歪みを生じている部分では、着目行Lを基準として、次の2条件を満足する縦書き文字行を抽出する。
1.y座標の負方向(図34中、下方へ向かう方向)に関して、着目行Lの先頭位置から見てx座標の正方向(綴じ部境界線へ向かう方向)に対して予め定めた一定角度(ここでは、角度を直線の傾き(b3/a2)で表しているが、歪みを生じている部分では基本的にページの内側へ文字行の先頭が食い込んでいくのを考慮して、b2/a1<b3/a2とする)の範囲内に抽出する縦書き文字行の先頭が存在すること
2.着目行Lの先頭位置と抽出する縦書き文字行の先頭位置を結ぶ直線の傾き(b4/a2)が、着目行Lの先頭位置と直前の抽出行Kの先頭位置を結ぶ直線の傾き(b5/a3)から一定値αを引いた値よりも大きい。すなわち、“b4/a2>b5/a3−α”を満足すること(基本的には、“b4/a2>b5/a3”で良いが、誤差を考慮して一定値αを導入する。一定値αは予め定めた値である)
すなわち、着目行Lの次の縦書き文字行Mの先頭はこの条件外なので除外することになるが、さらに次の縦書き文字行Nの先頭は条件を満足するので抽出することになる。以下、縦書き文字行Nを新たな着目行として同様の処理を続ける。
Next, processing in a portion where image distortion has occurred will be described with reference to FIG. In a portion where the image is distorted, a vertically written character line that satisfies the following two conditions is extracted with the target line L as a reference.
1. With respect to the negative direction of the y-coordinate (the downward direction in FIG. 34), a predetermined angle (here) with respect to the positive direction of the x-coordinate (the direction toward the binding boundary) viewed from the head position of the target row L The angle is represented by the slope of the straight line (b3 / a2). However, in consideration of the fact that the beginning of the character line intrudes into the inside of the page at the part where the distortion occurs, b2 / a1 < 1. The head of the vertically written character line to be extracted exists within the range of (b3 / a2). The slope (b4 / a2) of the straight line connecting the head position of the target line L and the head position of the vertical writing character line to be extracted is the slope of the straight line connecting the head position of the target line L and the head position of the previous extracted line K (b5). / A3) larger than a value obtained by subtracting a constant value α. That is, “b4 / a2> b5 / a3-α” is satisfied (basically “b4 / a2> b5 / a3” may be satisfied, but a constant value α is introduced in consideration of an error. α is a predetermined value)
That is, the beginning of the next vertically written character line M of the line of interest L is excluded because it is outside this condition, but the beginning of the next vertically written character line N is extracted because it satisfies the condition. Hereinafter, the same processing is continued with the vertically written character line N as a new target line.

さて、ここで問題となるのは、歪みを生じていない部分と歪みを生じている部分をいかに識別するかであるが、これは次のように行っている。すなわち、着目行と次の抽出行の先頭のy座標をそれぞれyC,yNとすると、“yN−yC”が一定値(例えば、平均文字行幅の1/4)以上となれば、それ以降を歪みを生じている部分とする。   The problem here is how to identify the non-distorted portion and the distorted portion as follows. That is, if yC at the beginning of the target line and the next extracted line are yC and yN, respectively, if “yN−yC” is a certain value (for example, ¼ of the average character line width) or more, It is assumed that the part is distorted.

以上の方法により図32から抽出した縦書き文字行を、図35において斜線を施した矩形で囲んで示す。   The vertically written character lines extracted from FIG. 32 by the above method are shown surrounded by a hatched rectangle in FIG.

最後に、抽出した縦書き文字行の先頭(もしくは末尾)の位置座標に関する近似曲線多項式を算出する(ステップS205)。抽出した各縦書き文字行の行切り出し矩形の先頭を連結して外形を形成する場合には、図36に示すように、連結する各縦書き文字行の行切り出し矩形の上辺中心点に基づき、抽出した縦書き文字行の先頭の位置座標に関する近似曲線多項式を算出する。また、抽出した各縦書き文字行の行切り出し矩形の末尾を連結して外形を形成する場合には、図36に示すように、連結する各縦書き文字行の行切り出し矩形の下辺中心点に基づき、抽出した縦書き文字行の末尾の位置座標に関する近似曲線多項式を算出する。   Finally, an approximate curve polynomial relating to the position coordinates of the beginning (or the end) of the extracted vertically written character line is calculated (step S205). In the case of forming the outer shape by concatenating the heads of the row cutout rectangles of the extracted vertical writing character lines, as shown in FIG. An approximate curve polynomial is calculated regarding the position coordinates of the beginning of the extracted vertical character line. Further, in the case of forming the outline by connecting the end of the line cut rectangle of each extracted vertical character line, as shown in FIG. 36, the lower side center point of the line cut rectangle of each vertical character line to be connected is formed. Based on this, an approximate curve polynomial is calculated regarding the position coordinate at the end of the extracted vertical writing line.

なお、最後に不適切な縦書き文字行の外形を排除する。これは、前述したように多項式近似により座標値を推定する際に、多項式近似による推定曲線の形状が不適切である場合には補正の際にかえって歪みが増大する恐れがあるので、このような縦書き文字行の外形を排除するものである。不適切な近似曲線形状の例としては、前述した罫線や横書き文字行の場合と同様であって、特に図示しないが、曲線が書籍の外側へ向かうような場合や、中心線を超えて大きく内側へ食い込むような場合である。   Finally, an inappropriate vertical character line outline is eliminated. This is because, when the coordinate value is estimated by polynomial approximation as described above, if the shape of the estimated curve by polynomial approximation is inappropriate, the distortion may increase at the time of correction. This eliminates the outline of vertical character lines. Examples of inappropriate approximate curve shapes are the same as in the case of the ruled lines and horizontal text lines described above, and although not particularly shown, when the curve goes to the outside of the book or greatly beyond the center line It is a case where it digs into.

なお、推定曲線の形状が不適切であるとして縦書き文字行の外形を排除した場合には、歪み補正用の縦書き文字行の外形は無いということになる。   If the outline of the vertically written character line is excluded because the shape of the estimated curve is inappropriate, it means that there is no outline of the vertically written character line for distortion correction.

以上の処理により、スキャン画像に縦書き文字行の外形が存在すると判断された場合には、左右各ページのいずれの位置に縦書き文字行の外形が存在しているのかという情報とともに縦書き文字行の外形を抽出し、RAM33に一時的に記憶する。   If it is determined by the above processing that the outline of the vertical text line exists in the scanned image, the vertical text will be displayed along with information on where the vertical text line outline exists on the left and right pages. The outline of the row is extracted and temporarily stored in the RAM 33.

なお、以下においては、横書き文字行及び縦書き文字行の外形を文字行として扱うものとする。   In the following, it is assumed that the outer shape of a horizontal character line and a vertical character line is treated as a character line.

以上、ステップS41〜S43の処理により、ページ外形/罫線/文字行の抽出処理(ステップS4)が終了する。   As described above, the page outline / ruled line / character line extraction process (step S4) is completed by the processes of steps S41 to S43.

続くステップS5(図6参照)においては、画像歪み補正処理を実行する。画像歪み補正処理は、図37に示すように、概略的には、歪み補正(伸長)に際しての基準となる線(基準線)としてスキャン画像の上辺(もしくは下辺)の近傍に位置するページ外形/罫線/文字行の何れかを選択する処理(ステップS51:基準線選択処理)、基準線に対応するものであって補正率(伸長率)の算出用の参照線としてスキャン画像の上辺(もしくは下辺)の近傍に位置するページ外形/罫線/文字行の何れかを選択する処理(ステップS52:参照線選択処理)、基準線が罫線や文字行の場合に、基準線より下部の画像情報の欠落を最小限にするための仮想的なページ外形を算出する処理(ステップS53:仮想ページ外形算出処理)、仮想的なページ外形に基づいてスキャン画像に伸長処理を施して主走査方向の歪みを補正する処理(ステップS54:主走査方向歪み補正処理)、補正画像の文字外接矩形に基づいてスキャン画像に伸長処理を施して副走査方向の歪みを補正する処理(ステップS55:副走査方向歪み補正処理)により構成されている。   In a subsequent step S5 (see FIG. 6), an image distortion correction process is executed. As shown in FIG. 37, the image distortion correction processing is roughly performed by using a page outline / position positioned near the upper side (or lower side) of the scanned image as a reference line (reference line) for distortion correction (expansion). Processing for selecting either a ruled line / character line (step S51: reference line selection process), which corresponds to the reference line and serves as a reference line for calculating a correction rate (expansion rate) ) (Page S52: reference line selection process) for selecting one of the page outline / ruled line / character line located near the image line, and if the reference line is a ruled line or character line, image information below the reference line is missing. Processing for calculating a virtual page outline for minimizing the image (step S53: virtual page outline calculation process), and performing a decompression process on the scanned image based on the virtual page outline to distort in the main scanning direction Processing for correcting (step S54: distortion correction processing in the main scanning direction), processing for extending the scanning image based on the character circumscribed rectangle of the corrected image and correcting distortion in the sub scanning direction (step S55: distortion correction in the sub scanning direction) Processing).

ここで、基準線選択処理(ステップS51)及び参照線選択処理(ステップS52)においては、基準線または参照線として、スキャン画像の上辺(もしくは下辺)の近傍に位置するページ外形/罫線/文字行の何れかを選択することになるが、本実施の形態におけるページ外形、罫線、文字行の選択の優先順位は、
ページ外形>罫線>文字行
とされている。このような選択優先順位にしたのは、文字行はページ外形や罫線に比べて抽出精度が低く、また、画像の外側にあるページ外形を利用する方が精度の高い歪み補正率を得ることができるためである。ただし、本実施の形態においては、ページ外形は一般に左右ページにまたがるが、罫線や文字行は両ページにあるとは限らないので、スキャン画像の上辺または下辺からの基準線選択の優先順位は、下記に示すようになる。
Here, in the reference line selection process (step S51) and the reference line selection process (step S52), the page outline / ruled line / character line positioned near the upper side (or lower side) of the scanned image as the reference line or reference line. However, the priority of selection of the page outline, ruled line, and character line in the present embodiment is as follows:
Page outline> ruled line> character line. This selection priority is used because character lines have lower extraction accuracy than page outlines and ruled lines, and more accurate distortion correction rates can be obtained by using page outlines outside the image. This is because it can. However, in this embodiment, the page outline generally spans the left and right pages, but ruled lines and character lines are not necessarily on both pages, so the priority order of the reference line selection from the upper or lower side of the scanned image is As shown below.

1.「ページ外形」(ページ外形は、常に左右両ページに存在する)
2.左右両ページともに「罫線」
3.一方のページが「罫線」、他方のページが「文字行」
4.左右両ページともに「文字行」
5.一方のページのみに「罫線」、他方のページには「手がかりなし」
6.一方のページのみに「文字行」、他方のページには「手がかりなし」
ここで、「手がかりなし」とは、ページ外形、罫線、文字行のいずれも抽出できなかった場合を言う。
1. "Page outline" (Page outline always exists on both left and right pages)
2. "Rules" on both left and right pages
3. One page is "ruled line", the other page is "text line"
4). `` Character line '' on both left and right pages
5. "Rules" on one page only, "No clues" on the other page
6). "Character line" on one page only, "No clue" on the other page
Here, “no clue” means a case where none of the page outline, ruled line, and character line could be extracted.

次に、仮想ページ外形算出処理(ステップS53)及び主走査方向歪み補正処理(ステップS54)の例について、上記優先順位に基づいて順に説明する。   Next, examples of the virtual page outer shape calculation process (step S53) and the main scanning direction distortion correction process (step S54) will be described in order based on the priority order.

1.スキャン画像の上辺及び下辺のいずれにも「ページ外形」が存在する場合
ここでは、スキャン画像の上辺及び下辺のいずれにも「ページ外形」が存在する場合について説明する。図38に示すように、スキャン画像の上辺及び下辺のいずれにも「ページ外形」が存在する場合は、いずれを基準線、参照線にしても構わない。なお、本実施の形態においては、基準線として選択した「ページ外形」、「罫線」、「文字行」は、下辺に位置させるものとする。この場合においては、基準線と仮想ページ外形とは一致していることから、仮想ページ外形算出処理(ステップS53)においては特に処理を実行しなくても良い。
1. Case where “Page Outline” Exists on Both Upper and Lower Sides of Scanned Image Here, a case where “page outline” exists on both the upper and lower sides of the scanned image will be described. As shown in FIG. 38, when “page outline” exists on both the upper side and the lower side of the scanned image, any of them may be used as a reference line or a reference line. In the present embodiment, it is assumed that “page outline”, “ruled line”, and “character line” selected as the reference line are positioned on the lower side. In this case, since the reference line and the virtual page outline coincide with each other, the virtual page outline calculation process (step S53) does not have to be particularly performed.

次いで、主走査方向歪み補正処理(ステップS54)について説明する。ここで、x0は「ページ外形」の直線部分と曲線部分との境界点である。主走査方向歪み補正処理としては、まず、この境界点x0における基準線と参照線間の距離h0(図39参照)に基づいて歪み補正率を算出する。歪み補正率は、主走査方向に画像を伸長して補正する際に、基準線と参照線との間の距離を副走査方向の全ての位置において等しくさせるためのものである。すなわち、位置xにおける基準線と参照線間の距離をh(図39参照)とした場合には、位置xにおける歪み補正率は、
h0/h
として表すことができる。即ち、歪み補正率とは、主走査方向に画像を伸長して補正する際に、基準線と参照線との間の距離を副走査方向の全ての位置xにおいて等しくなるように、各xに関して算出した値である。
Next, the main scanning direction distortion correction process (step S54) will be described. Here, x0 is a boundary point between the straight line portion and the curved portion of the “page outline”. In the main scanning direction distortion correction process, first, a distortion correction factor is calculated based on the distance h0 (see FIG. 39) between the reference line and the reference line at the boundary point x0. The distortion correction rate is for making the distance between the reference line and the reference line equal at all positions in the sub-scanning direction when the image is expanded and corrected in the main scanning direction. That is, when the distance between the reference line and the reference line at the position x is h (see FIG. 39), the distortion correction rate at the position x is
h0 / h
Can be expressed as In other words, the distortion correction rate refers to each x so that the distance between the reference line and the reference line becomes equal at all positions x in the sub-scanning direction when the image is expanded and corrected in the main scanning direction. It is a calculated value.

次に、実際に補正をする際は、まず、図39に示すように仮想ページ外形(ここでは基準線)が直線(最下辺)になるように、主走査方向に各画素をシフトする。その後、副走査方向の全ての位置xにおいて、画像を主走査方向の上辺側にh0/hで伸長すれば、図39の上辺の「ページ外形」EがREとなるように画像が補正される。   Next, when the correction is actually performed, first, each pixel is shifted in the main scanning direction so that the virtual page outline (here, the reference line) becomes a straight line (the lowermost side) as shown in FIG. Thereafter, at all positions x in the sub-scanning direction, if the image is expanded at h0 / h toward the upper side in the main scanning direction, the image is corrected so that the “page outline” E on the upper side in FIG. 39 becomes RE. .

2.スキャン画像の上辺及び下辺の何れか一方に「ページ外形」が存在し、他方の辺には「罫線」と「文字行」とが存在する場合
ここでは、スキャン画像の上辺及び下辺の何れか一方に「ページ外形」が存在し、他方の辺ではページ外形が途中で切れているが「罫線」と「文字行」とが存在する場合について説明する。図40に示すように、スキャン画像の上辺及び下辺の何れか一方に「ページ外形」が存在し、他方の辺には「罫線」と「文字行」とが存在する場合は、「ページ外形」を基準線として下辺に位置させ、「文字行」と「罫線」とを参照線とする(図40に示す例では、左ページが「文字行」、右ページが「罫線」である)。この場合においても、基準線と仮想ページ外形とは一致していることから、仮想ページ外形算出処理(ステップS53)においては特に処理を実行しなくても良い。
2. When the “page outline” exists on one of the upper and lower sides of the scanned image and “ruled lines” and “character lines” exist on the other side Here, either the upper or lower side of the scanned image A case where “page outline” exists and the page outline is cut off on the other side, but “ruled lines” and “character lines” exist will be described. As shown in FIG. 40, when the “page outline” exists on one of the upper side and the lower side of the scanned image and “ruled line” and “character line” exist on the other side, “page outline” Is set as a reference line and “character line” and “ruled line” are used as reference lines (in the example shown in FIG. 40, the left page is “character line” and the right page is “ruled line”). Even in this case, since the reference line and the virtual page outline coincide with each other, the virtual page outline calculation process (step S53) does not have to be performed.

次いで、主走査方向歪み補正処理(ステップS54)について説明する。ここで、x0は「ページ外形」の直線部分と曲線部分との境界点である。主走査方向歪み補正処理としては、まず、この境界点x0における基準線と参照線間の距離h0(図41参照)に基づいて歪み補正率を算出する。位置xにおける基準線と参照線間の距離をh(図41参照)とした場合には、位置xにおける歪み補正率は、
h0/h
として表すことができる。
Next, the main scanning direction distortion correction process (step S54) will be described. Here, x0 is a boundary point between the straight line portion and the curved portion of the “page outline”. In the main scanning direction distortion correction process, first, a distortion correction factor is calculated based on the distance h0 (see FIG. 41) between the reference line and the reference line at the boundary point x0. When the distance between the reference line and the reference line at the position x is h (see FIG. 41), the distortion correction rate at the position x is
h0 / h
Can be expressed as

次に、実際に補正をする際は、まず、図41に示すように仮想ページ外形(ここでは基準線)が直線(最下辺)になるように、主走査方向に各画素をシフトする。その後、副走査方向の全ての位置xにおいて、画像を主走査方向の上辺側にh0/hで伸長すれば、図41の右ページでは、上辺の「罫線」LUがRLUとなるように画像が補正される。左ページ上辺の「文字行」についても同様に行う。   Next, when the correction is actually performed, first, each pixel is shifted in the main scanning direction so that the virtual page outline (here, the reference line) becomes a straight line (the lowermost side) as shown in FIG. Thereafter, if the image is expanded at h0 / h to the upper side in the main scanning direction at all the positions x in the sub-scanning direction, on the right page in FIG. 41, the image is displayed so that the “ruled line” LU on the upper side becomes the RLU. It is corrected. The same applies to the “character line” on the upper side of the left page.

3.スキャン画像の左右両ページの上辺及び下辺の何れか一方に「罫線」が存在し、他方の辺には「罫線」と「文字行」とが存在する場合
ここでは、スキャン画像の左右両ページの上辺及び下辺の何れか一方に「罫線」が存在し、他方の辺には「罫線」と「文字行」とが存在する場合について説明する。スキャン画像の左右両ページの上辺及び下辺の何れか一方に「罫線」が存在し、他方の辺には「罫線」と「文字行」とが存在する場合は、図42に示すように、左右両ページに「罫線」が存在する側を下辺に位置させ、その2本の「罫線」を基準線とし、他方の辺に位置する「文字行」と「罫線」とを参照線とする(図42に示す例では、左ページが「文字行」、右ページが「罫線」である)。ところで、このように、基準線が「ページ外形」ではない場合は、基準線をそのまま仮想ページ外形と見なしてはならない。なぜなら、両者を一致させた場合、後の主走査方向歪み補正処理において仮想ページ外形(基準線)を最下辺に画素シフトする際、基準線より下方の画像情報が全て欠落してしまうからである。
3. When there is a “ruled line” on one of the upper and lower sides of both the left and right pages of the scanned image, and “ruled line” and “character line” are present on the other side A case will be described in which a “ruled line” exists on one of the upper side and the lower side, and a “ruled line” and a “character line” exist on the other side. When a “ruled line” exists on either the upper side or the lower side of both the left and right pages of the scanned image and a “ruled line” and a “character line” exist on the other side, as shown in FIG. The side where the “ruled line” exists on both pages is positioned on the lower side, the two “ruled lines” are used as reference lines, and the “character line” and “ruled line” positioned on the other side are used as reference lines (see FIG. In the example shown in 42, the left page is a “character line” and the right page is a “ruled line”). By the way, when the reference line is not “page outline” as described above, the reference line should not be regarded as a virtual page outline as it is. This is because, if they are matched, when the virtual page outline (reference line) is pixel-shifted to the lowermost side in the subsequent main scanning direction distortion correction processing, all image information below the reference line is lost. .

そこで、基準線が「ページ外形」でない場合は、図42において点線で示すような仮想ページ外形VEを求める仮想ページ外形算出処理(ステップS53)を実行する。ここで、x0は下辺の「罫線」LDの直線部分と曲線部分との境界点である。仮想ページ外形算出処理は、境界点x0における「罫線」LDからスキャン画像の最下辺までの距離a0と、境界点x0における「罫線」LDから上辺の「罫線」LUまでの距離b0とに基づいて仮想ページ外形VEを算出するものである。すなわち、「罫線」LD上の位置xから上辺の「罫線」LUまでの距離bが解かれば、
a/b=a0/b0
であることから、「罫線」LD上の位置xから仮想ページ外形VEまでの距離aを算出することができる。したがって、「罫線」LD上の位置から仮想ページ外形VEまでの距離を副走査方向の全ての位置xにおいて算出することにより、仮想ページ外形VEを求めることができる。このような処理は、左右ページについてそれぞれ独立に行われる。
Therefore, when the reference line is not “page outline”, a virtual page outline calculation process (step S53) for obtaining a virtual page outline VE as indicated by a dotted line in FIG. 42 is executed. Here, x0 is a boundary point between the straight line portion and the curved portion of the “ruled line” LD on the lower side. The virtual page outline calculation processing is based on the distance a0 from the “ruled line” LD at the boundary point x0 to the lowermost side of the scanned image, and the distance b0 from the “ruled line” LD to the upper “ruled line” LU at the boundary point x0. The virtual page outline VE is calculated. That is, if the distance b from the position x on the “ruled line” LD to the “ruled line” LU on the upper side is solved,
a / b = a0 / b0
Therefore, the distance a from the position x on the “ruled line” LD to the virtual page outline VE can be calculated. Therefore, the virtual page outline VE can be obtained by calculating the distance from the position on the “ruled line” LD to the virtual page outline VE at all the positions x in the sub-scanning direction. Such processing is performed independently for the left and right pages.

次いで、主走査方向歪み補正処理(ステップS54)について説明する。主走査方向歪み補正処理としては、まず、前述した境界点x0における「罫線」LDからスキャン画像の最下辺までの距離a0と、境界点x0における「罫線」LDから上辺の「罫線」LUまでの距離b0とを加算した距離h0(h0=a0+b0)に基づいて歪み補正率を算出する。位置xにおける上辺の「罫線」LUからスキャン画像の最下辺までの距離をh(h=a+b)とした場合には、位置xにおける歪み補正率は、
h0/h
として表すことができる。
Next, the main scanning direction distortion correction process (step S54) will be described. In the main scanning direction distortion correction processing, first, the distance a0 from the “ruled line” LD at the boundary point x0 to the lowermost side of the scanned image, and the “ruled line” LD at the boundary point x0 to the “ruled line” LU on the upper side. A distortion correction factor is calculated based on a distance h0 (h0 = a0 + b0) obtained by adding the distance b0. When the distance from the “ruled line” LU on the upper side at the position x to the lowest side of the scanned image is h (h = a + b), the distortion correction rate at the position x is
h0 / h
Can be expressed as

次に、実際に補正をする際は、まず、図43に示すように仮想ページ外形VEが直線(最下辺)になるように、主走査方向に各画素をシフトする。その後、副走査方向の全ての位置xにおいて、画像を主走査方向の上辺側にh0/hで伸長すれば、図37の右ページでは、上辺の「罫線」LUがRLU(厳密には、xの位置は「罫線」LUの直線部と曲線部との境界には一致しないが、ここでは「罫線」LDの境界をそのまま用いる)となるように画像が補正される。左ページ上辺の「文字行」についても同様に行う。   Next, when actually correcting, first, each pixel is shifted in the main scanning direction so that the virtual page outline VE becomes a straight line (the lowermost side) as shown in FIG. After that, if the image is expanded at h0 / h to the upper side in the main scanning direction at all positions x in the sub-scanning direction, the “ruled line” LU on the upper side becomes the RLU (strictly, xLU on the right page in FIG. 37). Is not coincident with the boundary between the straight portion and the curved portion of the “ruled line” LU, but here, the image is corrected so that the boundary of the “ruled line” LD is used as it is. The same applies to the “character line” on the upper side of the left page.

このように、仮想ページ外形VEを利用することで、シフトによる画像の欠落を最小限に抑えることができる。   In this way, by using the virtual page outline VE, it is possible to minimize image loss due to shift.

4.スキャン画像の左右両ページの上辺及び下辺の何れか一方に「罫線」と「文字行」とが存在し、他方の辺の一方のページのみに「罫線」が存在する場合
ここでは、スキャン画像の左右両ページの上辺及び下辺の何れか一方に「罫線」と「文字行」とが存在し、他方の辺の一方のページのみに「罫線」が存在する場合について説明する。スキャン画像の左右両ページの上辺及び下辺の何れか一方に「罫線」と「文字行」とが存在し、他方の辺の一方のページのみに「罫線」が存在する場合(他方のページは「手がかりなし」)は、図44に示すように、「罫線」と「文字行」とが存在する側を下辺に位置させ、それらの「罫線」と「文字行」とを基準線とし、他方の辺に位置する「罫線」とスキャン画像を副走査方向に貫く中心線Cとを参照線とする(図44に示す例では、左ページが「罫線」、右ページが「手がかりなし」である)。なお、中心線Cは、スキャン画像の主走査方向の中心を副走査方向に横切る線であり、書籍原稿40の中心線ではない。
4). When there are “ruled lines” and “text lines” on either the upper or lower side of both the left and right pages of the scanned image, and “ruled lines” only on one page of the other side. A case will be described in which “ruled lines” and “character lines” exist on either the upper side or the lower side of both the left and right pages, and “ruled lines” exist only on one page of the other side. When there are “ruled lines” and “character lines” on either the upper side or the lower side of both the left and right pages of the scanned image, and “ruled lines” exist only on one page on the other side (the other page 44), as shown in FIG. 44, the side where the “ruled line” and the “character line” are located is positioned on the lower side, the “ruled line” and the “character line” are used as the reference line, and the other A “ruled line” located on the side and a center line C penetrating the scanned image in the sub-scanning direction are used as reference lines (in the example shown in FIG. 44, the left page is “ruled line” and the right page is “no clue”). . The center line C is a line that crosses the center of the scanned image in the main scanning direction in the sub-scanning direction, and is not the center line of the book document 40.

このように基準線が「ページ外形」でない場合は、前述したように、図44において点線で示すような仮想ページ外形VEを求める仮想ページ外形算出処理(ステップS53)を実行する。ここで、x0は下辺の「罫線」LDの直線部分と曲線部分との境界点である。仮想ページ外形算出処理は、境界点x0における「罫線」LDからスキャン画像の最下辺までの距離a0と、境界点x0における「罫線」LDから中心線Cまでの距離b0とに基づいて仮想ページ外形VEを算出するものである。すなわち、「罫線」LD上の位置xから中心線Cまでの距離bが解かれば、
a/b=a0/b0
であることから、「罫線」LD上の位置xから仮想ページ外形VEまでの距離aを算出することができる。したがって、「罫線」LD上の位置から仮想ページ外形VEまでの距離を副走査方向の全ての位置xにおいて算出することにより、仮想ページ外形VEを求めることができる。このような処理は、左右ページについてそれぞれ独立に行われる。なお、右ページのように上辺に「罫線」が存在する場合については、中心線Cに代えて、前述したように上辺の「罫線」を用いる。
When the reference line is not “page outline” as described above, the virtual page outline calculation process (step S53) for obtaining the virtual page outline VE as shown by the dotted line in FIG. 44 is executed as described above. Here, x0 is a boundary point between the straight line portion and the curved portion of the “ruled line” LD on the lower side. The virtual page outline calculation processing is based on the distance a0 from the “ruled line” LD at the boundary point x0 to the lowermost side of the scanned image and the distance b0 from the “ruled line” LD to the center line C at the boundary point x0. VE is calculated. That is, if the distance b from the position x on the “ruled line” LD to the center line C is solved,
a / b = a0 / b0
Therefore, the distance a from the position x on the “ruled line” LD to the virtual page outline VE can be calculated. Therefore, the virtual page outline VE can be obtained by calculating the distance from the position on the “ruled line” LD to the virtual page outline VE at all the positions x in the sub-scanning direction. Such processing is performed independently for the left and right pages. When a “ruled line” exists on the upper side as in the right page, instead of the center line C, the “ruled line” on the upper side is used as described above.

次いで、主走査方向歪み補正処理(ステップS54)について説明する。主走査方向歪み補正処理としては、まず、前述した境界点x0における「罫線」LDからスキャン画像の最下辺までの距離a0と、境界点x0における「罫線」LDから中心線Cまでの距離b0とを加算した距離h0(h0=a0+b0)に基づいて歪み補正率を算出する。位置xにおける中心線Cからスキャン画像の最下辺までの距離をh(h=a+b)とした場合には、位置xにおける歪み補正率は、
h0/h
として表すことができる。
Next, the main scanning direction distortion correction process (step S54) will be described. In the main scanning direction distortion correction processing, first, the distance a0 from the “ruled line” LD at the boundary point x0 to the lowermost side of the scanned image, and the distance b0 from the “ruled line” LD to the center line C at the boundary point x0. The distortion correction rate is calculated based on the distance h0 (h0 = a0 + b0) obtained by adding. When the distance from the center line C at the position x to the lowest side of the scanned image is h (h = a + b), the distortion correction rate at the position x is
h0 / h
Can be expressed as

次に、実際に補正をする際は、まず、図45に示すように仮想ページ外形VEが直線(最下辺)になるように、主走査方向に各画素をシフトする。その後、副走査方向の全ての位置xにおいて、画像を主走査方向の上辺側にh0/hで伸長して補正する。左ページ上辺の「罫線」についても同様に行う。なお、右ページについては、補正によってシフトにより一旦歪んだ中心線Cが元の直線RCに戻るが、Cがスキャナ部1の光軸と一致する場合以外は、画像全体の補正は不完全となる。   Next, when the correction is actually performed, first, each pixel is shifted in the main scanning direction so that the virtual page outline VE becomes a straight line (lowermost side) as shown in FIG. Thereafter, at all the positions x in the sub-scanning direction, the image is corrected by extending it to the upper side in the main scanning direction at h0 / h. The same applies to the “ruled line” on the upper side of the left page. As for the right page, the center line C once distorted by the shift by the correction returns to the original straight line RC, but the correction of the entire image is incomplete except when C matches the optical axis of the scanner unit 1. .

5.スキャン画像の左右何れかのページの上辺及び下辺の何れか一方に「罫線」が存在し、他方の辺の他方のページのみに「文字行」が存在する場合
ここでは、スキャン画像の左右何れかのページの上辺及び下辺の何れか一方に「罫線」が存在し、他方の辺の他方のページのみに「文字行」が存在する場合について説明する。スキャン画像の左右何れかのページの上辺及び下辺の何れか一方に「罫線」が存在し(他方のページは「手がかりなし」)、他方の辺の他方のページのみに「文字行」が存在する場合(一方のページは「手がかりなし」)は、図46に示すように、「罫線」が存在する側を下辺に位置させ、その「罫線」を基準線とし、「罫線」が存在しない方のページ(「文字行」が存在する方のページ)については、文字行Lを中心線Cを挟んで線対称の位置に移動させた曲線SLを基準線とする。参照線については、「罫線」が存在するページは中心線Cを、「文字行」が存在するページはその「文字行」を、それぞれ参照線とする。
5. When there is a “ruled line” on either the top or bottom side of the left or right page of the scanned image, and a “text line” exists only on the other page of the other side. A case where a “ruled line” exists on either the upper side or the lower side of the page and a “character line” exists only on the other page of the other side will be described. There is a “ruled line” on either the upper or lower side of the scanned image on either the left or right page (the other page is “no clue”), and there is a “character line” only on the other page on the other side. In the case (one page is “no clue”), as shown in FIG. 46, the side where the “ruled line” exists is positioned on the lower side, the “ruled line” is set as the reference line, and the “ruled line” does not exist For a page (the page on which “a character line” exists), a curve SL obtained by moving the character line L to a line-symmetrical position with the center line C in between is used as a reference line. As for the reference line, the center line C is used as the reference line for the page where the “ruled line” exists, and the “character line” is used as the reference line for the page where the “character line” exists.

なお、歪み補正率の算出や画素シフト、補正(伸長)処理についてはこれまでの例と同様であるため、それらの説明は省略する。   Note that the calculation of the distortion correction rate, pixel shift, and correction (expansion) processing are the same as those in the previous examples, and thus description thereof is omitted.

最後に、副走査方向歪み補正処理(ステップS55)について説明する。まず、スキャナ部1(画像読取手段)の固有パラメータ(レンズの焦点面距離、スキャン光軸の位置(アドレス))が未知の場合における副走査方向歪み補正処理について説明する。   Finally, sub-scanning direction distortion correction processing (step S55) will be described. First, the sub-scanning direction distortion correction processing when the intrinsic parameters (lens focal plane distance, scan optical axis position (address)) of the scanner unit 1 (image reading means) are unknown will be described.

図47は、固有パラメータが未知の場合における副走査方向歪み補正処理の流れを概略的に示すフローチャートである。図47に示すように、ステップS101においては、主走査方向歪み補正されたスキャン画像に基づいて文字の外接矩形A(図48参照)を抽出する。ここで、文字認識処理については周知の技術であるので、その説明は省略する。このように文字の外接矩形Aを抽出するのは、この文字の外接矩形Aの形状の変化を基に、副走査方向の歪みを補正するためである。ここでは、図48に示すように、文字外接矩形Aの横辺の長さw、縦辺の長さh、および、文字の中心Bを定義する。ここで、文字の中心Bは、外接矩形Aの対角線の交点である。   FIG. 47 is a flowchart schematically showing the flow of sub-scanning direction distortion correction processing when the intrinsic parameter is unknown. As shown in FIG. 47, in step S101, a circumscribed rectangle A (see FIG. 48) of the character is extracted based on the scanned image corrected for distortion in the main scanning direction. Here, since the character recognition process is a well-known technique, the description thereof is omitted. The reason why the circumscribed rectangle A of the character is extracted in this way is to correct the distortion in the sub-scanning direction based on the change in the shape of the circumscribed rectangle A of the character. Here, as shown in FIG. 48, the horizontal side length w, the vertical side length h, and the character center B of the character circumscribing rectangle A are defined. Here, the center B of the character is the intersection of the diagonal lines of the circumscribed rectangle A.

続いて、図49に示すように、スキャン画像を書籍原稿40のページ綴じ部41に平行な方向の複数の短冊状の領域Cに分割した後(ステップS102)、各短冊領域Cについて、そこに含まれる文字外接矩形Aに関する特徴量を求める(ステップS103)。ここで、ある短冊領域Cに含まれる文字外接矩形Aとは、その中心が当該短冊領域Cに含まれるような外接矩形Aのことである。例えば、図49の短冊領域C1に含まれる外接矩形Aは、図中の網掛けを施した矩形である。   Subsequently, as shown in FIG. 49, after the scanned image is divided into a plurality of strip-shaped areas C in a direction parallel to the page binding portion 41 of the book document 40 (step S102), A feature amount relating to the included character circumscribing rectangle A is obtained (step S103). Here, the circumscribed rectangle A included in a strip area C is a circumscribed rectangle A whose center is included in the strip area C. For example, the circumscribed rectangle A included in the strip area C1 of FIG. 49 is a shaded rectangle in the drawing.

さて、上記の文字外接矩形Aに関する特徴量は、
(文字の横辺の長さ)/(文字の縦辺の長さ)=w/h
を基に求められる。すなわち、各短冊領域Cについて、そこに含まれる全ての文字外接矩形Aのw/hの値の平均値をその短冊領域Cの特徴量とするのである。
Now, the feature amount related to the character circumscribed rectangle A is as follows.
(Length of horizontal side of character) / (Length of vertical side of character) = w / h
Required based on That is, for each strip region C, the average value of w / h values of all the character circumscribed rectangles A included therein is used as the feature amount of the strip region C.

しかしながら、単に、w/hの平均値を算出すると不適切な場合がある。文字の中には、句読点や数式中の記号のようにそのサイズが元々小さく、w/hの値が不安定なものがある。また、矩形抽出の際に隣接する文字同士がくっついて抽出されてしまい、wが極端に大きい文字外接矩形Aが生じる場合もある。特徴量を求める場合は、このような特殊な文字や極端にwが大きいものを予め排除しておく必要がある。そこで、続くステップS104においては、予め閾値を定めておいて、hの値がその閾値より小さな文字外接矩形Aを予め排除するとともに、w/hの比率に関する閾値を予め定めておき、w/hの値が其の閾値よりも大きい文字外接矩形Aも予め排除する。例えば、図50中に示した網掛けを施した文字外接矩形Aが予め排除されることになる。   However, simply calculating the average value of w / h may be inappropriate. Some characters, such as punctuation marks and symbols in mathematical formulas, are originally small in size and have unstable w / h values. In addition, adjacent characters may be extracted when the rectangle is extracted, resulting in a character circumscribing rectangle A having an extremely large w. When obtaining the feature amount, it is necessary to exclude such special characters or extremely large w in advance. Therefore, in the subsequent step S104, a threshold value is determined in advance, and the character circumscribed rectangle A whose h value is smaller than the threshold value is excluded in advance, and a threshold value regarding the ratio of w / h is determined in advance. Character circumscribing rectangle A whose value is larger than the threshold is also excluded in advance. For example, the circumscribed rectangle A that is shaded in FIG. 50 is excluded in advance.

続くステップS105においては、前述したように極端な文字外接矩形Aを排除した後に、各短冊領域C内の文字外接矩形Aのw/hの平均値を求める。図51に各短冊領域C内の外接矩形Aのw/hの平均値の一例を示す。なお、図51中の短冊領域C2は、書籍原稿40のページ綴じ部41を含む短冊領域である。   In the subsequent step S105, after eliminating the extreme character circumscribing rectangle A as described above, the average value of w / h of the character circumscribing rectangle A in each strip region C is obtained. FIG. 51 shows an example of the average value of w / h of the circumscribed rectangle A in each strip area C. Note that the strip region C2 in FIG. 51 is a strip region including the page binding portion 41 of the book document 40.

続いて、書籍原稿40のページ綴じ部41を含む短冊領域C2に文字外接矩形Aが存在するか否かを判断する(ステップS106)。これは、図50に示すように、一般には書籍原稿40のページ綴じ部41付近には文字外接矩形Aが存在しない場合が多いからである。書籍原稿40のページ綴じ部41を含む短冊領域C2に文字外接矩形Aが存在する場合は(ステップS106のY)、その文字外接矩形Aを利用して特徴量は算出されているのでそのままステップS108に進む。   Subsequently, it is determined whether or not the character circumscribing rectangle A exists in the strip area C2 including the page binding portion 41 of the book document 40 (step S106). This is because, as shown in FIG. 50, generally, there are many cases where the character circumscribing rectangle A does not exist near the page binding portion 41 of the book document 40. If the character circumscribing rectangle A exists in the strip area C2 including the page binding portion 41 of the book document 40 (Y in step S106), the feature amount is calculated using the character circumscribing rectangle A, and thus the step S108 is performed as it is. Proceed to

一方、書籍原稿40のページ綴じ部41を含む短冊領域C2に文字外接矩形Aが存在しない場合は(ステップS106のN)、ステップS107に進み、書籍原稿40のページ綴じ部41を含む短冊領域C2の特徴量を求める。なお、書籍原稿40のページ綴じ部41を含む短冊領域C2の識別は、例えば、スキャン画像(例えば、モノクロ多値画像)の地肌濃度変化を各短冊領域Cごとに求め、短冊領域C内の最も濃度の薄い濃度値を求めることにより実現される。図52は地肌濃度変化を求めた一例を示したものであり、地肌濃度が最も濃い短冊領域が、書籍原稿40のページ綴じ部41を含む短冊領域C2であるとみなされる。   On the other hand, if the character circumscribing rectangle A does not exist in the strip area C2 including the page binding portion 41 of the book document 40 (N in step S106), the process proceeds to step S107, and the strip area C2 including the page binding portion 41 of the book document 40 is displayed. Find the feature quantity. The strip region C2 including the page binding portion 41 of the book document 40 is identified by, for example, obtaining a background density change of a scanned image (for example, a monochrome multi-value image) for each strip region C, and obtaining the most in the strip region C. This is realized by obtaining a low density value. FIG. 52 shows an example in which the background density change is obtained. The strip area with the highest background density is regarded as the strip area C2 including the page binding portion 41 of the book document 40.

なお、スキャン画像がカラー多値画像の場合における書籍原稿40のページ綴じ部41を含む短冊領域C2の識別は、例えばRGB成分の何れか一つの成分(例えばG成分)に着目し、そのG成分の地肌濃度を使用して識別するようにすれば良い。また、RGBを色変換して輝度成分と色差成分とに分け、輝度成分を使用して書籍原稿40のページ綴じ部41を含む短冊領域C2を識別するようにしても良い。   When the scanned image is a color multi-valued image, the identification of the strip region C2 including the page binding portion 41 of the book document 40 is focused on, for example, one of the RGB components (for example, the G component), and the G component The background density may be used for identification. Alternatively, RGB may be color-converted into a luminance component and a color difference component, and the strip region C2 including the page binding portion 41 of the book document 40 may be identified using the luminance component.

書籍原稿40のページ綴じ部41を含む短冊領域C2の特徴量は、次のようにして定められる。ここでは、統計的特徴量の算出対象となり得る文字外接矩形Aが存在し、かつ、ページ綴じ部41を含む短冊領域C2の最近傍である短冊領域Cの特徴量に対して予め定めた定数値を乗じることにより算出された値が、書籍原稿40のページ綴じ部41を含む短冊領域C2における特徴量とみなされるものである。つまり、図51に示した例では、書籍原稿40のページ綴じ部41を含む短冊領域C2の左右何れの短冊領域C3,C4にも文字外接矩形Aが存在するので、どちらか適当な方の特徴量を選択し(ここでは右側の○印の方)、それに予め定めた定数値(ここでは0.5)を乗じて、これを書籍原稿40のページ綴じ部41を含む短冊領域C2の特徴量としている。   The feature amount of the strip area C2 including the page binding portion 41 of the book document 40 is determined as follows. Here, there is a character circumscribing rectangle A that can be a statistical feature quantity calculation target, and a constant value determined in advance for the feature quantity of the strip area C that is the closest to the strip area C2 including the page binding portion 41. The value calculated by multiplying by is regarded as the feature amount in the strip area C2 including the page binding portion 41 of the book document 40. That is, in the example shown in FIG. 51, the character circumscribing rectangle A exists in any of the left and right strip regions C3 and C4 of the strip region C2 including the page binding portion 41 of the book document 40. The amount is selected (here, the circle on the right side), and is multiplied by a predetermined constant value (here, 0.5), and this is multiplied by the feature amount of the strip region C2 including the page binding portion 41 of the book document 40. It is said.

続くステップS108においては、各短冊領域Cの特徴量に対する適切なフィルタリング処理、例えば、短冊領域Cの位置の変化方向(即ち副走査方向)に関する移動平均を求める処理を施すなどして、短冊領域Cの位置の変化に対する(副走査方向の)特徴量の変化がなだらかになるようにする。ただし、ここでも書籍原稿40のページ綴じ部41付近は特別な処理が必要となる。なぜなら、副走査方向に関して長さが全て等しいウィンドウを用いてフィルタリングを行うと、書籍原稿40のページ綴じ部41付近の特徴量の変化の鋭さが失われてしまうからである。   In the subsequent step S108, an appropriate filtering process for the feature amount of each strip area C, for example, a process for obtaining a moving average in the direction of change of the position of the strip area C (ie, the sub-scanning direction) is performed. The change in the feature amount (in the sub-scanning direction) with respect to the change in the position is made gentle. However, also here, special processing is required near the page binding portion 41 of the book document 40. This is because if the filtering is performed using windows whose lengths are all equal in the sub-scanning direction, the sharpness of the feature amount change in the vicinity of the page binding portion 41 of the book document 40 is lost.

ここで、長さが全て5であるウィンドウを用いて図51に示した各短冊領域Cの特徴量に対してフィルタリング処理を施した結果を図53に示す。図53に示すように、長さが全て5であるウィンドウを用いてフィルタリング処理を施した場合には、書籍原稿40のページ綴じ部41付近の特徴量(w/h)の変化がなだらかになり過ぎてしまう。このような場合には、書籍原稿40のページ綴じ部41付近での適切な画像補正が不可能になってしまう。   Here, FIG. 53 shows the result of performing the filtering process on the feature amount of each strip region C shown in FIG. 51 using a window whose length is all five. As shown in FIG. 53, when the filtering process is performed using a window whose length is all 5, the change in the characteristic amount (w / h) in the vicinity of the page binding portion 41 of the book document 40 becomes gentle. It will pass. In such a case, appropriate image correction near the page binding portion 41 of the book document 40 becomes impossible.

そこで、本実施の形態においては、フィルタリング処理の際には、フィルタのウィンドウが書籍原稿40のページ綴じ部41を含む短冊領域C2の両側の短冊領域C3,C4に跨がらないように、ページ綴じ部41付近でウィンドウ長を調整する。ここで、図54はページ綴じ部41付近でウィンドウ長を調整してフィルタリング処理を施した結果を示すグラフである。図54に示すように、ページ綴じ部41付近でウィンドウ長を調整した場合には、ページ綴じ部41付近の特徴量(w/h)の変化を適切に表現できるので、良好な画像補正が実現できる。   Therefore, in the present embodiment, during the filtering process, the page binding is performed so that the filter window does not extend over the strip regions C3 and C4 on both sides of the strip region C2 including the page binding portion 41 of the book document 40. The window length is adjusted near the portion 41. Here, FIG. 54 is a graph showing the result of performing the filtering process by adjusting the window length in the vicinity of the page binding portion 41. As shown in FIG. 54, when the window length is adjusted in the vicinity of the page binding portion 41, a change in the feature amount (w / h) in the vicinity of the page binding portion 41 can be appropriately expressed, so that a good image correction is realized. it can.

続くステップS109においては、各短冊領域Cの推定歪み量を算出する。各短冊領域Cの推定歪み量の算出手法は、以下に示す通りである。   In subsequent step S109, an estimated distortion amount of each strip region C is calculated. The calculation method of the estimated distortion amount of each strip region C is as follows.

まず、短冊領域の歪み量を算出するための基準となる短冊領域(基準短冊領域)を定める。ここでは、歪みが最も小さいと考えられる短冊領域C、例えば、特徴量(w/h)が最大である短冊領域Cを基準短冊領域とする。この処理は左右ページで共通に行っても良いが、左右独立に基準短冊領域を定めても構わない。図54においては、左右独立に基準短冊領域を定めた例を示しており、○印を施した短冊領域Cが基準短冊領域であり、左側の基準特徴量を“Lw0/Lh0”、右側の基準特徴量を“Rw0/Rh0”、でそれぞれ示している。   First, a strip area (reference strip area) is defined as a reference for calculating the distortion amount of the strip area. Here, the strip region C that is considered to have the smallest distortion, for example, the strip region C having the maximum feature (w / h) is set as the reference strip region. This process may be performed in common on the left and right pages, but the reference strip area may be determined independently on the left and right. FIG. 54 shows an example in which the reference strip area is determined independently on the left and right sides. The strip area C marked with a circle is the reference strip area, the reference feature value on the left is “Lw0 / Lh0”, and the reference reference on the right The feature amounts are indicated by “Rw0 / Rh0”, respectively.

次に、基準短冊領域の特徴量w0/h0をスキャン画像全体の基準特徴量とし、
(各短冊領域の特徴量)/(基準特徴量)=(w/h)/(w0/h0)
の値を、各短冊領域の推定歪み量として算出する。
Next, the feature amount w0 / h0 of the reference strip region is set as the reference feature amount of the entire scanned image,
(Feature amount of each strip area) / (reference feature amount) = (w / h) / (w0 / h0)
Is calculated as an estimated amount of distortion in each strip region.

なお、書籍原稿40のページ綴じ部41から外れたページ外側付近の短冊領域Cを基準短冊領域とすると、書籍原稿40のページ綴じ部41付近とはフォントや活字のサイズの違いが大きくて、適切な推定歪み量が算出できない場合も考えられる。そのような画像を対象とする場合は、基準短冊領域の探索範囲を予め書籍原稿40のページ綴じ部41付近に限定しておくのが有効である。これを実現するためには、地肌濃度が予め定めた濃度よりも濃い短冊領域Cのみから基準短冊領域を求めるようにすれば良い。   If the strip region C near the outside of the page outside the page binding portion 41 of the book document 40 is set as the reference strip region, the difference in font and type size is large from the vicinity of the page binding portion 41 of the book document 40. It is also conceivable that a large estimated distortion amount cannot be calculated. When such an image is the target, it is effective to limit the search range of the reference strip region to the vicinity of the page binding portion 41 of the book document 40 in advance. In order to realize this, the reference strip region may be obtained only from the strip region C whose background density is higher than a predetermined density.

最後に、スキャン画像に対して、短冊領域Cの短辺方向(副走査方向)の拡大処理を行い、書籍原稿40のページ綴じ部41付近の歪みを補正する(ステップS110)。その場合の拡大率は、ステップS109において算出した推定歪み量の逆数、すなわち、
(基準特徴量)/(各短冊領域の特徴量)=(w0/h0)/(w/h)
とする。ここで、上記の基準短冊領域を左右共通に定めた場合には、この拡大率も左右共通の基準特徴量によって算出し、独立に定めた場合には、左右それぞれの基準特徴量で独立に算出するようにする。図55は、図54に示した特徴量に基づいて算出した補正拡大率を示したものである。
Finally, enlargement processing in the short side direction (sub-scanning direction) of the strip region C is performed on the scanned image to correct distortion in the vicinity of the page binding portion 41 of the book document 40 (step S110). The enlargement ratio in that case is the reciprocal of the estimated distortion amount calculated in step S109, that is,
(Reference feature value) / (Feature value of each strip area) = (w0 / h0) / (w / h)
And Here, if the above-mentioned standard strip area is defined to be common to the left and right, this enlargement ratio is also calculated based on the standard feature quantity common to the left and right. To do. FIG. 55 shows the corrected enlargement ratio calculated based on the feature amount shown in FIG.

なお、ここでも、書籍原稿40のページ綴じ部41付近から離れた短冊領域Cはもともと画像の歪みが無い領域である可能性が高いので、拡大処理の対象としない方が良い場合がある。拡大処理を行ったために、かえって不自然な歪みが生じてしまう可能性があるからである。これを防ぐために、地肌濃度が予め定めた濃度よりも薄い短冊領域Cについては、推定歪み量を“1”とする。   In this case as well, the strip area C away from the vicinity of the page binding portion 41 of the book document 40 is likely to be an area without distortion of the image from the beginning, so it may be better not to make it an object of enlargement processing. This is because an unnatural distortion may occur due to the enlargement process. In order to prevent this, the estimated distortion amount is set to “1” for the strip region C whose background density is thinner than a predetermined density.

また、短冊領域C内において共通の補正拡大率を適用した場合、隣接する短冊領域Cの境界部での補正拡大率が不連続となるため、補正画像が不自然となる。そこで、隣接する短冊領域Cの境界部での補正拡大率が連続的に変化するように、補正拡大率を予め補正しておく。これは、例えば図55に示す短冊領域Cの中央部分の補正拡大率を推定歪み量の逆数を示す点としてプロットし、これらの点を線分で結んで直線補完することで、他の部分の補正拡大率とすることで実現できる。以上の処理により、スキャン画像の副走査方向の補正拡大率が確定する。   Further, when a common correction magnification ratio is applied in the strip area C, the correction magnification ratio becomes discontinuous at the boundary between adjacent strip areas C, and the correction image becomes unnatural. Therefore, the correction magnification rate is corrected in advance so that the correction magnification rate at the boundary between adjacent strip regions C changes continuously. For example, the correction magnification rate of the central portion of the strip region C shown in FIG. 55 is plotted as a point indicating the reciprocal of the estimated distortion amount, and these points are connected by a line segment to complement a straight line, This can be realized by setting the correction magnification. Through the above processing, the correction magnification rate in the sub-scanning direction of the scanned image is determined.

なお、画像の拡大処理は、例えばコピーの変倍機能として良く使われる3次関数のコンボリューション法等を用いて実行される。   Note that the image enlargement process is executed using, for example, a cubic function convolution method often used as a copy scaling function.

次に、スキャナ部1(画像読取手段)の固有パラメータ(レンズの焦点面距離、スキャン光軸の位置(アドレス))が既知の場合における副走査方向歪み補正処理について説明する。   Next, the sub-scanning direction distortion correction processing in the case where the intrinsic parameters (lens focal plane distance, scan optical axis position (address)) of the scanner unit 1 (image reading means) are known will be described.

スキャンの主走査方向と書籍原稿40のページ綴じ部41の境界線が平行な場合、レンズユニット10等のスキャナーレンズによる書籍原稿40を読み取るとき、結像系は次の特性を持つ。主走査方向は中心投影であり、副走査方向は平射投影である。ここで、これらの特性を利用して、3次元形状復元を行う。   When the main scanning direction of scanning and the boundary line of the page binding portion 41 of the book document 40 are parallel, the image forming system has the following characteristics when the book document 40 is read by a scanner lens such as the lens unit 10. The main scanning direction is center projection, and the sub-scanning direction is projection. Here, three-dimensional shape restoration is performed using these characteristics.

中心投影する場合、図56と図57に示すように書籍原稿40の表面はコンタクトガラス2の表面から浮いて結像距離が遠くなり、画像の拡大倍率は小さくなるので、外形エッジの直線はだんだん内側に湾曲していく。図57の縮む量ABを測定すれば、図56に浮いた本の表面の高さhを計算できる。従って、直線の内側への歪み量を測定すれば、3次元形状(書籍原稿40のコンタクトガラス2からの浮き上がりの量)を復元できる。   In the case of central projection, as shown in FIGS. 56 and 57, the surface of the book document 40 floats from the surface of the contact glass 2 and the image formation distance becomes longer, and the magnification of the image becomes smaller. Curves inward. If the shrinkage amount AB in FIG. 57 is measured, the height h of the surface of the book floating in FIG. 56 can be calculated. Therefore, if the amount of distortion inward of the straight line is measured, the three-dimensional shape (the amount of lifting of the book original 40 from the contact glass 2) can be restored.

ここで、書籍原稿40を水平にコンタクトガラス2上に置くことを仮定する。そうすると、3次元の形状は2次元になる。スキャナーレンズの結像関係を図58に示す。OO´はレンズの光軸であり、0はレンズの中心である。Fはレンズの中心0からスキャナ表面(コンタクトガラス2)までの距離で、これを、スキャナの焦点距離と言う。スキャナ表面上の点Bは結像面でDに結像する。浮いた製本(書籍原稿40)の表面上の点CはEに結像する。それぞれの結像面の中心0との距離はy´とyである(第一走行体5および第二走行体8が副走査方向に移動することによって、中心0も移動するが、その軌跡を結像中心線と呼ぶことにする)。三角形の相似関係により次の関係式(6),(7)が得られる。
h/F=AB/AO´ ・・・(6)
AB/AO´=(y´−y)/y ・・・(7)
また、式(6),(7)により、書籍原稿40の浮き上がりの量hが次式(8)により得られる。
h=F×((y´−y)/y) ・・・(8)
この式(8)により2次元の歪み量から3次元形状が求められることがわかる。ここで、歪み量(y´−y)と距離yは画像から求められるが、本実施の形態では、これを文字行あるいは罫線の直線成分と曲線部分との距離から求めるものである。レンズの焦点距離Fはスキャナ部1によって定まる既知量であり、スキャナ部1の設定値かレンズの校正値を用いる。
Here, it is assumed that the book original 40 is placed horizontally on the contact glass 2. Then, the three-dimensional shape becomes two-dimensional. The imaging relationship of the scanner lens is shown in FIG. OO ′ is the optical axis of the lens, and 0 is the center of the lens. F is the distance from the center 0 of the lens to the scanner surface (contact glass 2), which is called the focal length of the scanner. The point B on the scanner surface forms an image on D on the image plane. A point C on the surface of the floating bookbinding (book original 40) forms an image on E. The distance from the center 0 of each imaging plane is y ′ and y (the center 0 also moves as the first traveling body 5 and the second traveling body 8 move in the sub-scanning direction. This will be called the imaging center line). The following relational expressions (6) and (7) are obtained by the triangular similarity.
h / F = AB / AO ′ (6)
AB / AO ′ = (y′−y) / y (7)
Further, the amount h of lifting of the book document 40 is obtained by the following equation (8) from the equations (6) and (7).
h = F × ((y′−y) / y) (8)
It can be seen from this equation (8) that a three-dimensional shape is obtained from the two-dimensional strain amount. Here, the distortion amount (y′−y) and the distance y are obtained from the image. In the present embodiment, this is obtained from the distance between the straight line component of the character line or ruled line and the curved portion. The focal length F of the lens is a known amount determined by the scanner unit 1, and a setting value of the scanner unit 1 or a calibration value of the lens is used.

したがって、スキャナ部1(画像読取手段)の固有パラメータ(レンズの焦点面距離、スキャン光軸の位置(アドレス))が既知の場合には、ページ外形/罫線/文字行の湾曲の度合いから書籍表面のスキャン面からの浮きの高さhを求め、図59に示すように、副走査方向の1画素分をm倍に伸張して継ぎ足すことにより、副走査方向の歪みを補正することができる。   Therefore, when the intrinsic parameters (lens focal plane distance, scan optical axis position (address)) of the scanner unit 1 (image reading means) are known, the surface of the book is determined from the degree of curvature of the page outline / ruled line / character line. As shown in FIG. 59, the height h of the floating from the scanning surface is obtained, and one pixel in the sub-scanning direction is expanded by m times and added, whereby the distortion in the sub-scanning direction can be corrected. .

以上により副走査方向歪み補正処理(ステップS55)が終了し、図6に示すスキャン画像の歪み補正処理が終了する。ここで、図60は歪みを補正した画像を示す平面図である。以上の処理によれば、図8に示したような書籍原稿40のページ綴じ部41の近傍において生じていたスキャン画像の歪みが、図60に示すように補正されることになる。   Thus, the sub-scanning direction distortion correction process (step S55) ends, and the scan image distortion correction process shown in FIG. 6 ends. Here, FIG. 60 is a plan view showing an image in which distortion is corrected. According to the above processing, the distortion of the scan image that has occurred in the vicinity of the page binding portion 41 of the book document 40 as shown in FIG. 8 is corrected as shown in FIG.

ここに、文字の縦成分のみの矩形を抽出することで隣接する文字の接触が防止される。このような縦成分矩形から近似曲線を求めることにより、英文画像の主走査方向の歪み補正における精度の高精度化を図ることが可能になる。また、抽出した縦成分矩形の主走査方向の長さが予め定めた閾値以上の場合、当該縦成分矩形の長さを当該閾値の長さに縮めることにより、主走査方向に矩形が接触するのを防ぐことが可能になるので、複数分の行が一行と誤認識されやすいという事態が回避され、安定した行統合が可能になる。   Here, by extracting a rectangle of only the vertical component of the character, contact between adjacent characters is prevented. By obtaining an approximate curve from such a vertical component rectangle, it is possible to improve the accuracy of distortion correction in the main scanning direction of an English image. In addition, when the length of the extracted vertical component rectangle in the main scanning direction is equal to or larger than a predetermined threshold, the rectangle comes into contact with the main scanning direction by reducing the length of the vertical component rectangle to the threshold length. Therefore, it is possible to avoid a situation in which a plurality of lines are likely to be erroneously recognized as one line, and to enable stable line integration.

なお、本実施の形態においては、画像読取装置としてデジタル複写機のスキャナ部1を適用したが、これに限るものではなく、例えば自動ページ捲り機能を搭載したスキャナ等に適用するようにしても良い。   In the present embodiment, the scanner unit 1 of the digital copying machine is applied as the image reading apparatus. However, the present invention is not limited to this. For example, the scanner unit 1 may be applied to a scanner equipped with an automatic page turning function. .

また、本実施の形態においては、書籍原稿40のページ綴じ部41とスキャナ部1の画像読み取りの主走査方向とが平行になるように位置させて書籍原稿40をコンタクトガラス2上に下向きに載置した場合について説明したが、これに限るものではない。例えば、図61に示すように、上向きの書籍原稿40をコンタクトガラス2の下方からコンタクトガラス2に対して押し付けるように接触させるものであっても良い。   In the present embodiment, the book original 40 is placed on the contact glass 2 so that the page binding portion 41 of the book original 40 and the main scanning direction of image reading of the scanner unit 1 are parallel to each other. However, the present invention is not limited to this. For example, as shown in FIG. 61, an upward book original 40 may be brought into contact with the contact glass 2 from below the contact glass 2.

さらに、本実施の形態においては、画像歪み補正装置を画像形成装置であるデジタル複写機16に備え、デジタル複写機16のスキャナ部1で読み取ったスキャン画像に対して画像の歪み補正処理を施すようにしたが、これに限るものではない。例えば、原稿画像を読み取る画像読取手段を備えたイメージスキャナをパーソナルコンピュータに接続するとともに、このパーソナルコンピュータのHDDに記憶媒体であるCD−ROM37に格納されたプログラムをインストールすることによって画像歪み補正装置を構成しても、前述したような各種の作用効果と同様の作用効果を得ることができる。また、記憶媒体であるCD−ROM37に格納されたプログラムをパーソナルコンピュータのHDDにインストールすることによって画像歪み補正装置を構成し、予め画像読取手段により読み取られたスキャン画像に対して歪み補正処理を施すようにしても良い。   Furthermore, in the present embodiment, the image distortion correction apparatus is provided in the digital copying machine 16 that is an image forming apparatus, and image distortion correction processing is performed on the scanned image read by the scanner unit 1 of the digital copying machine 16. However, it is not limited to this. For example, an image scanner having an image reading unit for reading a document image is connected to a personal computer, and a program stored in a CD-ROM 37 which is a storage medium is installed in the HDD of the personal computer, whereby an image distortion correction apparatus is installed. Even if it comprises, the effect similar to the various effect mentioned above can be acquired. Further, an image distortion correction apparatus is configured by installing a program stored in a CD-ROM 37 as a storage medium in the HDD of a personal computer, and distortion correction processing is performed on a scanned image read in advance by an image reading means. You may do it.

本発明の実施の一形態のスキャナ部の構成を示す縦断正面図である。It is a vertical front view which shows the structure of the scanner part of one Embodiment of this invention. スキャナ部を搭載したデジタル複写機の上部部分を示す斜視図である。It is a perspective view which shows the upper part of the digital copying machine carrying a scanner part. スキャナ部の制御系の電気的な接続を示すブロック図である。It is a block diagram which shows the electrical connection of the control system of a scanner part. 画像処理部の基本的な内部構成を示すブロック図である。It is a block diagram which shows the basic internal structure of an image process part. メイン制御部の電気的な接続を示すブロック図である。It is a block diagram which shows the electrical connection of a main control part. スキャン画像の歪み補正処理の流れを概略的に示すフローチャートである。It is a flowchart which shows roughly the flow of the distortion correction process of a scanned image. スキャナ部のコンタクトガラス上に書籍原稿を載置した状態を示す斜視図である。It is a perspective view which shows the state which mounted the book original on the contact glass of a scanner part. 入力した画像の一例を示す平面図である。It is a top view which shows an example of the input image. スキャン画像のページ綴じ部の近傍の歪みを示す説明図である。It is explanatory drawing which shows the distortion of the vicinity of the page binding part of a scan image. 図8に示した画像の黒画素ヒストグラムである。9 is a black pixel histogram of the image shown in FIG. 8. ページ外形/罫線/文字行の抽出処理の流れを概略的に示すフローチャートである。It is a flowchart which shows roughly the flow of the extraction process of a page external shape / ruled line / character line. 上端にページ外形が存在するスキャン画像の一例を示す説明図である。It is explanatory drawing which shows an example of the scanning image which has a page external shape in an upper end. 図12に示したスキャン画像の綴じ部境界線左側の黒画素ヒストグラムである。13 is a black pixel histogram on the left side of the binding portion boundary line of the scanned image shown in FIG. 12. 長い罫線が存在するスキャン画像の一例を示す説明図である。It is explanatory drawing which shows an example of the scanning image in which a long ruled line exists. 2値化した画像に矩形抽出を施した結果を示す説明図である。It is explanatory drawing which shows the result of having performed rectangular extraction to the binarized image. 罫線がノイズと接触している場合を示す説明図である。It is explanatory drawing which shows the case where a ruled line is contacting with noise. 表が含まれる画像を示す説明図である。It is explanatory drawing which shows the image containing a table | surface. 一定値未満のランのみを登録し矩形を抽出した結果を示す説明図である。It is explanatory drawing which shows the result of having registered only the run below a fixed value and extracting the rectangle. 副走査方向に矩形が細切れに抽出されてしまう場合を示す説明図である。It is explanatory drawing which shows the case where a rectangle will be extracted to a thin piece in the subscanning direction. 矩形統合を施した例を示す説明図である。It is explanatory drawing which shows the example which performed rectangle integration. 矩形抽出を行った結果を示す説明図である。It is explanatory drawing which shows the result of having performed rectangle extraction. 図8に示した画像の副走査方向の黒白反転数ヒストグラムである。9 is a black / white inversion number histogram in the sub-scanning direction of the image shown in FIG. 8. 図8に示した画像の主走査方向の黒白反転数ヒストグラムである。9 is a black / white inversion number histogram of the image shown in FIG. 8 in the main scanning direction. 横書き文字行候補の検出の結果の一例を示す説明図である。It is explanatory drawing which shows an example of the result of a detection of a horizontal writing character line candidate. 縦成分矩形を縮める手法を示す説明図である。It is explanatory drawing which shows the method of shrinking | reducing a vertical component rectangle. 縦成分矩形を縮めた横書き文字行候補の検出の結果の一例を示す説明図である。It is explanatory drawing which shows an example of the result of the detection of the horizontal writing character line candidate which shortened the vertical component rectangle. (a)は縦成分矩形による近似曲線の生成を示す説明図、(b)行を拡大して示す説明図である。(A) is explanatory drawing which shows the production | generation of the approximated curve by a vertical component rectangle, (b) It is explanatory drawing which expands and shows a line. 矩形抽出を行った結果を示す説明図である。It is explanatory drawing which shows the result of having performed rectangle extraction. 各縦書き文字行からの横書き文字行の抽出処理の流れを概略的に示すフローチャートである。It is a flowchart which shows roughly the flow of the extraction process of the horizontal writing character line from each vertical writing character line. 抽出した行切り出し矩形を例示的に示す説明図である。It is explanatory drawing which shows the extracted line cut-out rectangle as an example. 予め定めた距離範囲内に先頭が存在する縦書き文字行を例示的に示す説明図である。It is explanatory drawing which shows illustratively the vertical writing character line in which the head exists within the predetermined distance range. 抽出した縦書き文字行の先頭のy座標に関してヒストグラムを構成する状態を示す説明図である。It is explanatory drawing which shows the state which comprises a histogram regarding the y coordinate of the head of the extracted vertical writing character line. 画像の歪みを生じていない部分における処理を示す説明図である。It is explanatory drawing which shows the process in the part which has not produced distortion of an image. 画像の歪みを生じている部分における処理を示す説明図である。It is explanatory drawing which shows the process in the part which has produced the distortion of an image. 抽出した縦書き文字行を示す説明図である。It is explanatory drawing which shows the extracted vertical writing character line. 縦書き文字行の行切り出し矩形を示す説明図である。It is explanatory drawing which shows the line cut-out rectangle of a vertical writing character line. 画像歪み補正処理の流れを概略的に示すフローチャートである。It is a flowchart which shows the flow of an image distortion correction process roughly. スキャン画像の上辺及び下辺のいずれにも「ページ外形」が存在する場合を示す説明図である。It is explanatory drawing which shows the case where a "page outer shape" exists in both the upper side and lower side of a scan image. 図38を画素シフトした状態を示す説明図である。It is explanatory drawing which shows the state which shifted the pixel of FIG. スキャン画像の上辺及び下辺の何れか一方に「ページ外形」が存在し、他方の辺には「罫線」と「文字行」とが存在する場合を示す説明図である。It is explanatory drawing which shows the case where "page outline" exists in any one of the upper side of a scan image, and a lower side, and a "ruled line" and a "character line" exist in the other side. 図40を画素シフトした状態を示す説明図である。It is explanatory drawing which shows the state which shifted the pixel of FIG. スキャン画像の左右両ページの上辺及び下辺の何れか一方に「罫線」が存在し、他方の辺には「罫線」と「文字行」とが存在する場合を示す説明図である。It is explanatory drawing which shows the case where a "ruled line" exists in either one of the upper side and the lower side of both the left and right pages of a scanned image, and a "ruled line" and a "character line" exist on the other side. 図42を画素シフトした状態を示す説明図である。It is explanatory drawing which shows the state which shifted the pixel of FIG. スキャン画像の左右両ページの上辺及び下辺の何れか一方に「罫線」と「文字行」とが存在し、他方の辺の一方のページのみに「罫線」が存在する場合を示す説明図である。It is explanatory drawing which shows the case where a "ruled line" and a "character line" exist in any one of the upper side and the lower side of both the left and right pages of a scanned image, and a "ruled line" exists only in one page of the other side. . 図44を画素シフトした状態を示す説明図である。It is explanatory drawing which shows the state which shifted the pixel of FIG. スキャン画像の左右何れかのページの上辺及び下辺の何れか一方に「罫線」が存在し、他方の辺の他方のページのみに「文字行」が存在する場合を示す説明図である。It is explanatory drawing which shows the case where a "ruled line" exists in any one of the upper side and the lower side of a left or right page of a scanned image, and a "character line" exists only in the other page of the other side. 副走査方向歪み補正処理の流れを概略的に示すフローチャートである。It is a flowchart which shows roughly the flow of a subscanning direction distortion correction process. 抽出された文字外接矩形を示す説明図である。It is explanatory drawing which shows the extracted character circumscribed rectangle. 二値化画像を書籍原稿のページ綴じ部に平行な方向の複数の短冊状の領域に分割した状態を示す説明図である。It is explanatory drawing which shows the state which divided | segmented the binarized image into the several strip-shaped area | region of the direction parallel to the page binding part of a book original. 予め排除される文字外接矩形を示す説明図である。It is explanatory drawing which shows the character circumscribing rectangle excluded beforehand. 各短冊領域内の外接矩形の特徴量の平均値の一例を示すグラフである。It is a graph which shows an example of the average value of the feature-value of the circumscribed rectangle in each strip area. 各短冊領域内の地肌濃度変化の一例を示すグラフである。It is a graph which shows an example of the background density change in each strip area. 図51に示した各短冊領域の特徴量に対して長さが全て5であるウィンドウを用いてフィルタリング処理を施した結果を示すグラフである。It is a graph which shows the result of having performed the filtering process using the window whose length is all 5 with respect to the feature-value of each strip area | region shown in FIG. 図51に示した各短冊領域の特徴量に対してページ綴じ部付近でウィンドウ長を調整してフィルタリング処理を施した結果を示すグラフである。FIG. 52 is a graph showing a result of performing filtering processing by adjusting the window length in the vicinity of the page binding portion with respect to the feature amount of each strip area shown in FIG. 51. 図54に示した特徴量に基づいて算出した補正拡大率を示すグラフである。FIG. 55 is a graph showing a corrected enlargement ratio calculated based on the feature amount shown in FIG. 54. FIG. 本の表面の浮いた高さを示す説明図である。It is explanatory drawing which shows the height which the surface of the book floated. 画像が縮む量を示す説明図である。It is explanatory drawing which shows the quantity which an image shrinks. スキャナーレンズの結像関係を示す説明図である。It is explanatory drawing which shows the imaging relationship of a scanner lens. 固有パラメータが既知の場合における副走査方向歪み補正処理を示す説明図である。It is explanatory drawing which shows a subscanning direction distortion correction process in case an intrinsic | native parameter is known. 歪みを補正した画像を示す平面図である。It is a top view which shows the image which correct | amended distortion. コンタクトガラスに書籍原稿を接触させた状態を示す正面図である。It is a front view which shows the state which made the book original document contact the contact glass. コンタクトガラス上に書籍原稿を載置した状態を示す正面図である。It is a front view which shows the state which mounted the book original on the contact glass. 文字単位の矩形抽出を示し、(a)は日本語の矩形抽出、(b)は英文の矩形抽出を示す説明図である。The rectangle extraction of a character unit is shown, (a) is Japanese rectangle extraction, (b) is explanatory drawing which shows the rectangle extraction of an English sentence. 複数分の行が一行と誤認識される場合を示す説明図である。It is explanatory drawing which shows the case where several lines are misrecognized as one line.

符号の説明Explanation of symbols

19 画像歪み補正装置
37 記憶媒体
40 書籍原稿
41 ページ綴じ部
19 Image distortion correction device 37 Storage medium 40 Book manuscript 41 Page binding part

Claims (13)

画像読取手段の主走査方向に対してページ綴じ部がほぼ平行となるようにスキャン面の上もしくは下に接触した書籍原稿画像を前記画像読取手段により読み取ったスキャン画像の歪みを当該スキャン画像内の文字行の形状を基に補正する画像歪み補正装置において、
前記スキャン画像から主走査方向に予め定めた第1閾値以上かつ予め定めた第2閾値以下の数の黒画素が連結する黒画素ランのみを抽出する手段と、
抽出した黒画素ランを基に、文字の垂直方向の成分である縦成分のみの矩形を縦成分矩形として抽出する手段と、
抽出した縦成分矩形間の主走査方向および副走査方向の距離を基に文字行を抽出する手段と、
抽出した文字行の中から、前記スキャン画像の歪み補正に利用するための文字行を決定する手段と、
決定した文字行中に存在する各縦成分矩形の中心座標を基に近似曲線を算出する手段と、を備えることを特徴とする画像歪み補正装置。
The distortion of the scanned image obtained by reading the book document image read by the image reading unit so that the page binding portion is substantially parallel to the main scanning direction of the image reading unit is scanned in the scanned image. In an image distortion correction apparatus that corrects based on the shape of a character line,
Means for extracting only black pixel runs in which a number of black pixels not less than a predetermined first threshold and not more than a predetermined second threshold are connected in the main scanning direction from the scanned image;
Based on the extracted black pixel run, means for extracting a vertical component rectangle that is a vertical component of a character as a vertical component rectangle;
Means for extracting a character line based on the distance between the extracted vertical component rectangles in the main scanning direction and the sub-scanning direction;
Means for determining a character line to be used for distortion correction of the scanned image from the extracted character line;
An image distortion correction apparatus comprising: means for calculating an approximate curve based on the center coordinates of each vertical component rectangle existing in the determined character line.
抽出した縦成分矩形の主走査方向の長さが予め定めた閾値以上の場合、当該縦成分矩形の長さを当該閾値の長さに縮める、ことを特徴とする請求項1記載の画像歪み補正装置。   2. The image distortion correction according to claim 1, wherein when the length of the extracted vertical component rectangle in the main scanning direction is equal to or greater than a predetermined threshold, the length of the vertical component rectangle is reduced to the threshold length. apparatus. ページ綴じ部付近まで最も食い込んでいる文字行を前記スキャン画像の歪み補正に利用するための文字行と決定する、ことを特徴とする請求項1または2記載の画像歪み補正装置。   The image distortion correction apparatus according to claim 1, wherein a character line that penetrates to the vicinity of a page binding portion is determined as a character line to be used for distortion correction of the scanned image. 副走査方向の長さが最も長い文字行を前記スキャン画像の歪み補正に利用するための文字行と決定する、ことを特徴とする請求項1または2記載の画像歪み補正装置。   3. The image distortion correction apparatus according to claim 1, wherein a character line having the longest length in the sub-scanning direction is determined as a character line to be used for distortion correction of the scanned image. 前記スキャン画像のページ外形に最も近い文字行を前記スキャン画像の歪み補正に利用するための文字行と決定する、ことを特徴とする請求項1または2記載の画像歪み補正装置。   3. The image distortion correction apparatus according to claim 1, wherein a character line closest to a page outline of the scan image is determined as a character line to be used for distortion correction of the scan image. 前記スキャン画像の歪み補正に利用するための文字行を、ページ綴じ部付近まで最も食い込んでいる文字行、副走査方向の長さが最も長い文字行、前記スキャン画像のページ外形に最も近い文字行の順に決定する、ことを特徴とする請求項1または2記載の画像歪み補正装置。   The character line used for correcting the distortion of the scanned image is the character line that has penetrated most to the vicinity of the page binding part, the character line having the longest length in the sub-scanning direction, and the character line closest to the page outline of the scanned image The image distortion correction apparatus according to claim 1, wherein the image distortion correction apparatus is determined in the following order. 画像読取手段の主走査方向に対してページ綴じ部がほぼ平行となるようにスキャン面の上もしくは下に接触した書籍原稿画像を前記画像読取手段により読み取ったスキャン画像の歪みを当該スキャン画像内の文字行の形状を基に補正する処理をコンピュータに実行させるプログラムであって、前記コンピュータに、
前記スキャン画像から主走査方向に予め定めた第1閾値以上かつ予め定めた第2閾値以下の数の黒画素が連結する黒画素ランのみを抽出する機能と、
抽出した黒画素ランを基に、文字の垂直方向の成分である縦成分のみの矩形を縦成分矩形として抽出する機能と、
抽出した縦成分矩形間の主走査方向および副走査方向の距離を基に文字行を抽出する機能と、
抽出した文字行の中から、前記スキャン画像の歪み補正に利用するための文字行を決定する機能と、
決定した文字行中に存在する各縦成分矩形の中心座標を基に近似曲線を算出する機能と、を実行させることを特徴とするプログラム。
The distortion of the scanned image obtained by reading the book document image read by the image reading unit so that the page binding portion is substantially parallel to the main scanning direction of the image reading unit is scanned in the scanned image. A program for causing a computer to execute a process for correcting based on the shape of a character line, wherein the computer
A function of extracting only black pixel runs in which a number of black pixels not less than a predetermined first threshold and not more than a predetermined second threshold are connected in the main scanning direction from the scanned image;
Based on the extracted black pixel run, a function that extracts a vertical component rectangle that is a vertical component of a character as a vertical component rectangle;
A function of extracting a character line based on the distance between the extracted vertical component rectangles in the main scanning direction and the sub-scanning direction;
A function for determining a character line to be used for distortion correction of the scanned image from the extracted character line;
And a function for calculating an approximate curve based on the center coordinates of each vertical component rectangle existing in the determined character line.
抽出した縦成分矩形の主走査方向の長さが予め定めた閾値以上の場合、当該縦成分矩形の長さを当該閾値の長さに縮める、ことを特徴とする請求項7記載のプログラム。   8. The program according to claim 7, wherein if the length of the extracted vertical component rectangle in the main scanning direction is equal to or greater than a predetermined threshold value, the length of the vertical component rectangle is reduced to the threshold value. ページ綴じ部付近まで最も食い込んでいる文字行を前記スキャン画像の歪み補正に利用するための文字行と決定する、ことを特徴とする請求項7または8記載のプログラム。   The program according to claim 7 or 8, wherein a character line that penetrates to the vicinity of a page binding portion is determined as a character line to be used for distortion correction of the scanned image. 副走査方向の長さが最も長い文字行を前記スキャン画像の歪み補正に利用するための文字行と決定する、ことを特徴とする請求項7または8記載のプログラム。   9. The program according to claim 7, wherein a character line having the longest length in the sub-scanning direction is determined as a character line to be used for correcting distortion of the scanned image. 前記スキャン画像のページ外形に最も近い文字行を前記スキャン画像の歪み補正に利用するための文字行と決定する、ことを特徴とする請求項7または8記載のプログラム。   9. The program according to claim 7, wherein a character line closest to a page outline of the scanned image is determined as a character line to be used for correcting distortion of the scanned image. 前記スキャン画像の歪み補正に利用するための文字行を、ページ綴じ部付近まで最も食い込んでいる文字行、副走査方向の長さが最も長い文字行、前記スキャン画像のページ外形に最も近い文字行の順に決定する、ことを特徴とする請求項7または8記載のプログラム。   The character line used for correcting the distortion of the scanned image is the character line that has penetrated most to the vicinity of the page binding part, the character line having the longest length in the sub-scanning direction, and the character line closest to the page outline of the scanned image 9. The program according to claim 7, wherein the program is determined in the following order. 請求項7ないし12のいずれか一記載のプログラムを記憶することを特徴とする記憶媒体。
A storage medium storing the program according to any one of claims 7 to 12.
JP2004033634A 2004-02-10 2004-02-10 Image distortion correction apparatus, program, and storage medium Expired - Fee Related JP4145256B2 (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
JP2004033634A JP4145256B2 (en) 2004-02-10 2004-02-10 Image distortion correction apparatus, program, and storage medium
US11/054,396 US7602995B2 (en) 2004-02-10 2005-02-10 Correcting image distortion caused by scanning

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2004033634A JP4145256B2 (en) 2004-02-10 2004-02-10 Image distortion correction apparatus, program, and storage medium

Publications (2)

Publication Number Publication Date
JP2005229193A JP2005229193A (en) 2005-08-25
JP4145256B2 true JP4145256B2 (en) 2008-09-03

Family

ID=35003586

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2004033634A Expired - Fee Related JP4145256B2 (en) 2004-02-10 2004-02-10 Image distortion correction apparatus, program, and storage medium

Country Status (1)

Country Link
JP (1) JP4145256B2 (en)

Also Published As

Publication number Publication date
JP2005229193A (en) 2005-08-25

Similar Documents

Publication Publication Date Title
US7430065B2 (en) Method and system for correcting distortions in image data scanned from bound originals
JP4141235B2 (en) Image correction apparatus and program
US7016081B2 (en) Image distortion correction apparatus, distortion correction method therefor, recording media, image scanner and image construction apparatus
JP4271085B2 (en) Image correction apparatus, image reading apparatus, program, and storage medium
JP4162633B2 (en) Image distortion correction apparatus, image reading apparatus, image forming apparatus, program, and storage medium
JP3983721B2 (en) Image distortion correction apparatus, image reading apparatus, image forming apparatus, and program
JP4585015B2 (en) Image distortion correction apparatus, image reading apparatus, image forming apparatus, and program
JP4507124B2 (en) Image distortion correction apparatus, image reading apparatus, image forming apparatus, and program
JP4180260B2 (en) Image distortion correction apparatus, image reading apparatus, image forming apparatus, and program
JP4093970B2 (en) Image distortion correction apparatus, program, and storage medium
JP4145256B2 (en) Image distortion correction apparatus, program, and storage medium
JP4198613B2 (en) Image distortion correction apparatus, program, and storage medium
JP3979639B2 (en) Image distortion correction apparatus, image reading apparatus, image forming apparatus, and program
JP4194076B2 (en) Image distortion correction apparatus, image reading apparatus, image forming apparatus, program, and storage medium
JP3926294B2 (en) Image distortion correction apparatus, image reading apparatus, image forming apparatus, image distortion correction method, image distortion correction program, and recording medium
JP4006242B2 (en) Image correction apparatus, program, storage medium, and image correction method
JP4061256B2 (en) Image distortion correction apparatus, image reading apparatus, image forming apparatus, and program
JP4136860B2 (en) Image distortion correction apparatus, image reading apparatus, image forming apparatus, and program
JP4789221B2 (en) Image distortion correction apparatus, image reading apparatus, image forming apparatus, and program
JP3917421B2 (en) Image brightness correction apparatus, image reading apparatus, image forming apparatus, program, and storage medium
JP2003143407A (en) Picture luminance correcting apparatus, picture read apparatus, picture forming apparatus, program, and memorizing medium
JP4480291B2 (en) Image distortion correction apparatus, storage medium, program, image distortion correction method, image reading apparatus, and image forming apparatus
JP3877142B2 (en) Image distortion correction apparatus, image reading apparatus, image forming apparatus, program, and storage medium
JP4577845B2 (en) Image processing apparatus, image processing method, program, and storage medium storing program
JP2003143410A (en) Blurred picture correcting apparatus, picture read apparatus, picture forming apparatus, program, and memorizing medium

Legal Events

Date Code Title Description
RD01 Notification of change of attorney

Free format text: JAPANESE INTERMEDIATE CODE: A7421

Effective date: 20051021

A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20061024

RD01 Notification of change of attorney

Free format text: JAPANESE INTERMEDIATE CODE: A7421

Effective date: 20070222

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20080117

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20080205

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20080407

TRDD Decision of grant or rejection written
A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

Effective date: 20080520

A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20080617

R150 Certificate of patent or registration of utility model

Free format text: JAPANESE INTERMEDIATE CODE: R150

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

Free format text: PAYMENT UNTIL: 20110627

Year of fee payment: 3

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

Free format text: PAYMENT UNTIL: 20110627

Year of fee payment: 3

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

Free format text: PAYMENT UNTIL: 20120627

Year of fee payment: 4

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

Free format text: PAYMENT UNTIL: 20130627

Year of fee payment: 5

LAPS Cancellation because of no payment of annual fees