JP2016171429A - Image correction device, image correction method, and program - Google Patents

Image correction device, image correction method, and program Download PDF

Info

Publication number
JP2016171429A
JP2016171429A JP2015049382A JP2015049382A JP2016171429A JP 2016171429 A JP2016171429 A JP 2016171429A JP 2015049382 A JP2015049382 A JP 2015049382A JP 2015049382 A JP2015049382 A JP 2015049382A JP 2016171429 A JP2016171429 A JP 2016171429A
Authority
JP
Japan
Prior art keywords
correction
image
divided
region
area
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
JP2015049382A
Other languages
Japanese (ja)
Other versions
JP6230001B2 (en
Inventor
亮 二村
Akira Nimura
亮 二村
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.)
Casio Computer Co Ltd
Original Assignee
Casio Computer 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 Casio Computer Co Ltd filed Critical Casio Computer Co Ltd
Priority to JP2015049382A priority Critical patent/JP6230001B2/en
Publication of JP2016171429A publication Critical patent/JP2016171429A/en
Application granted granted Critical
Publication of JP6230001B2 publication Critical patent/JP6230001B2/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Image Processing (AREA)
  • Editing Of Facsimile Originals (AREA)
  • Studio Devices (AREA)

Abstract

PROBLEM TO BE SOLVED: To perform, in a shorter time, curvature correction on an image obtained by picking up a curved paper surface.SOLUTION: A CPU acquires a synthesis image by processing: a step S32 of extracting an outline of a page from the inside of an image; a step S36 of performing keystone correction on distortion of the image on the basis of four corners of the extracted outline; a step S38 of dividing the image on which the keystone correction has been performed into a correction necessary area and a correction unnecessary area with respect to correction in the longitudinal direction; a step S40 of performing curvature correction in the longitudinal direction on the correction necessary area in the longitudinal direction; a subsequent step S42 of synthesizing the correction unnecessary area and the correction necessary area having been corrected in the longitudinal direction before dividing the image on which the keystone correction has been performed into a correction necessary area and a correction unnecessary area with respect to correction in the lateral direction; a step S44 of performing curvature correction in the lateral direction on the correction necessary area in the lateral direction; and a step S46 of synthesizing the correction unnecessary area and the correction necessary area having been corrected in the lateral direction.SELECTED DRAWING: Figure 3

Description

本発明は、画像補正装置、画像補正方法、及びプログラムに関する。   The present invention relates to an image correction apparatus, an image correction method, and a program.

従来より、本を裁断することなく、そのままの状態で頁を捲りながらカメラで撮影して電子化する技術が提案されている。本を自然な状態で開いて上部から撮影すると、本の頁の撓(たわ)みにより、画像中の文字列や図表が歪み、画像中の文字列や図表を読解することが難しい。   2. Description of the Related Art Conventionally, a technique has been proposed in which a book is photographed with a camera while turning the page as it is without being cut, and digitized. When a book is opened in a natural state and photographed from above, the character strings and diagrams in the image are distorted due to the bending of the pages of the book, and it is difficult to read the character strings and diagrams in the image.

そこで、例えば、特許文献1では、本の上下の輪郭線に基づいて本の頁の曲面(歪み)を補正する画像処理技術が提案されている。また、特許文献2では、歪曲成分、基点、メッシュ、射影変換などを用いて本の頁の曲面(歪み)を補正する技術が提案されている。   Therefore, for example, Patent Document 1 proposes an image processing technique for correcting the curved surface (distortion) of a book page based on the upper and lower contour lines of the book. Patent Document 2 proposes a technique for correcting a curved surface (distortion) of a book page using a distortion component, a base point, a mesh, projective transformation, and the like.

特開2013−004088号公報JP 2013-004088 A 特開2012−170049号公報JP 2012-170049 A

近年、スマートフォンやタブレットなどのカメラ機能を持つ携帯情報端末が普及しており、本の頁を撮影した画像の湾曲を補正し、画像中の文字列や図表に歪みがない画像を生成する技術が望まれる。しかしながら、従来技術によるアルゴリズムでは、処理能力が低い携帯情報端末上で処理すると時間がかかってしまうという問題がある。   In recent years, portable information terminals with camera functions such as smartphones and tablets have become widespread, and there is a technology that corrects the curvature of an image of a book page and generates an image with no distortion in character strings and diagrams in the image. desired. However, the algorithm according to the prior art has a problem that it takes time if processing is performed on a portable information terminal having low processing capability.

そこで本発明は、湾曲した紙面を撮像した画像をより短時間で湾曲補正することを目的とする。   SUMMARY OF THE INVENTION Accordingly, an object of the present invention is to correct a curve of an image obtained by capturing a curved sheet in a shorter time.

この発明に係る画像補正装置は、画像内から頁の輪郭を抽出する抽出手段と、前記抽出手段により抽出された前記輪郭の四隅に基づいて前記画像の歪みを補正する輪郭補正手段と、前記輪郭補正手段により補正された前記画像を、補正必要領域と補正不要領域とに分割する領域分割手段と、前記領域分割手段により分割された前記補正必要領域を、前記画像の上端から下端まで綴じ目方向に沿って延在する分割領域が前記綴じ目方向に直交する横方向にn個配列されるように分割する分割手段と、前記分割手段によって分割された前記分割領域毎に、前記綴じ目方向の長さを補正する第1補正手段と、前記第1補正手段によって補正された前記分割領域毎に、実際の頁における前記分割領域の法線方向の撓み量を推定する推定手段と、前記推定手段によって推定された前記撓み量に基づいて前記分割領域毎の前記横方向の長さを補正する第2補正手段と、前記第1補正手段及び前記第2補正手段によって補正されたn個の前記分割領域を合成するとともに、当該合成された領域と前記領域分割手段によって分割された前記補正不要領域とを合成して合成画像を取得する取得手段と、を備えることを特徴とする。   An image correction apparatus according to the present invention includes an extraction unit that extracts a contour of a page from an image, a contour correction unit that corrects distortion of the image based on four corners of the contour extracted by the extraction unit, and the contour A region dividing unit that divides the image corrected by the correcting unit into a correction necessary region and a correction unnecessary region, and the correction necessary region divided by the region dividing unit from the upper end to the lower end of the image. A dividing unit that divides the divided regions so as to be arranged in a horizontal direction orthogonal to the binding direction, and a dividing direction divided by the dividing unit in the binding direction. A first correction unit that corrects a length; an estimation unit that estimates a deflection amount in a normal direction of the divided region in an actual page for each of the divided regions corrected by the first correcting unit; Second correction means for correcting the lateral length of each of the divided regions based on the deflection amount estimated by the means, and the n corrections corrected by the first correction means and the second correction means. The image processing apparatus includes: an acquisition unit configured to combine the divided regions and combine the combined region and the correction unnecessary region divided by the region dividing unit to acquire a combined image.

この発明に係る画像補正方法は、画像内から頁の輪郭を抽出するステップと、前記抽出された輪郭の四隅に基づいて前記画像の歪みを補正するステップと、前記歪みが補正された画像を、補正必要領域と補正不要領域とに分割するステップと、前記分割された補正必要領域を、前記画像の上端から下端まで綴じ目方向に沿って延在する分割領域が前記綴じ目方向に直交する横方向にn個配列されるように分割するステップと、前記n個に分割された前記分割領域毎に、前記綴じ目方向の長さを補正するステップと、前記綴じ目方向の長さが補正された前記分割領域毎に、実際の頁における前記分割領域の法線方向の撓み量を推定するステップと、前記推定された撓み量に基づいて前記分割領域毎の前記横方向の長さを補正するステップと、前記補正されたn個の分割領域を合成するとともに、当該合成された領域と前記分割された補正不要領域とを合成して合成画像を取得するステップと、を含むことを特徴とする。   An image correction method according to the present invention includes a step of extracting a page outline from within an image, a step of correcting distortion of the image based on four corners of the extracted outline, and an image in which the distortion is corrected, A step of dividing the correction required area into a correction unnecessary area, and a divided area extending along the stitch direction from the upper end to the lower end of the divided image. Dividing in a direction so as to be arranged in n directions, correcting the length in the binding direction for each of the divided areas divided in the number n, and correcting the length in the binding direction. Further, for each of the divided regions, a step of estimating a normal direction deflection amount of the divided region on an actual page, and correcting the lateral length of each divided region based on the estimated deflection amount. Step and before Thereby synthesizing the corrected n pieces of divided regions, characterized in that it comprises the steps of synthesizing the said combined area and the divided correction unnecessary area to obtain a composite image.

この発明に係るプログラムは、画像補正装置を制御するコンピュータに、画像内から頁の輪郭を抽出する抽出機能、前記抽出機能により抽出された前記輪郭の四隅に基づいて前記画像の歪みを補正する輪郭補正機能、前記輪郭補正機能により補正された前記画像を、補正必要領域と補正不要領域とに分割する領域分割機能、前記領域分割機能により分割された前記補正必要領域を、前記画像の上端から下端まで綴じ目方向に沿って延在する分割領域が前記綴じ目方向に直交する横方向にn個配列されるように分割する分割機能、前記分割機能によって分割された前記分割領域毎に、前記綴じ目方向の長さを補正する第1補正機能、前記第1補正機能によって補正された前記分割領域毎に、実際の頁における前記分割領域の法線方向の撓み量を推定する推定機能、前記推定機能によって推定された前記撓み量に基づいて前記分割領域毎の前記横方向の長さを補正する第2補正機能、前記第1補正機能及び前記第2補正機能によって補正されたn個の前記分割領域を合成するとともに、当該合成された領域と前記領域分割機能によって分割された前記補正不要領域とを合成して合成画像を取得する取得機能、を実現させることを特徴とする。   The program according to the present invention provides a computer that controls the image correction apparatus with an extraction function for extracting the outline of a page from within an image, and an outline for correcting distortion of the image based on the four corners of the outline extracted by the extraction function. A correction function, a region dividing function for dividing the image corrected by the contour correcting function into a correction required region and a correction unnecessary region, and the correction required region divided by the region dividing function from the upper end to the lower end of the image A dividing function for dividing the divided areas so that n divided areas extending along the stitch direction are arranged in a lateral direction perpendicular to the stitch direction, and for each of the divided areas divided by the dividing function, A first correction function for correcting the length in the eye direction, and for each of the divided areas corrected by the first correction function, the amount of deflection in the normal direction of the divided area in the actual page Correction by the second correction function, the first correction function, and the second correction function for correcting the horizontal length for each of the divided regions based on the deflection amount estimated by the estimation function. And an acquisition function for obtaining a composite image by combining the n divided regions and combining the combined region and the correction unnecessary region divided by the region dividing function. And

この発明によれば、湾曲した紙面を撮像した画像をより短時間で湾曲補正することができる。   According to the present invention, it is possible to correct the curvature of an image obtained by imaging a curved paper surface in a shorter time.

本発明の実施形態による画像補正装置としての携帯情報端末1の構成を示すブロック図である。It is a block diagram which shows the structure of the portable information terminal 1 as an image correction apparatus by embodiment of this invention. 本実施形態の携帯情報端末1による全体動作を説明するためのフローチャートである。It is a flowchart for demonstrating the whole operation | movement by the portable information terminal 1 of this embodiment. 本実施形態による画像処理の動作を説明するためのフローチャートである。It is a flowchart for demonstrating the operation | movement of the image processing by this embodiment. 本の頁を真上から撮影した場合の画像の例を示す模式図である。It is a schematic diagram which shows the example of the image at the time of image | photographing the page of a book from right above. 本の頁を下側から斜め方向に撮影した場合の画像の例を示す模式図である。It is a schematic diagram which shows the example of the image at the time of image | photographing the page of a book in the diagonal direction from the lower side. 本実施形態の湾曲補正を行う前の画像Gを示す概念図である。It is a conceptual diagram which shows the image G before performing the curvature correction of this embodiment. 本実施形態による台形補正後の画像G1を示す概念図である。It is a conceptual diagram which shows the image G1 after the keystone correction by this embodiment. 本実施形態による湾曲補正に先だって行う縦方向の分割処理について説明するための概念図である。It is a conceptual diagram for demonstrating the division | segmentation process of the vertical direction performed before the curvature correction by this embodiment. 本実施形態による湾曲補正処理に先だって行う横方向の分割処理について説明するための概念図である。It is a conceptual diagram for demonstrating the division | segmentation process of the horizontal direction performed prior to the curvature correction process by this embodiment. 台形補正後の輪郭R1及び画像G1と、台形補正後の四隅r1、r2、r3、r4からなる矩形輪郭R2とを示す説明図である。It is explanatory drawing which shows outline R1 and image G1 after trapezoid correction | amendment, and rectangular outline R2 which consists of four corners r1, r2, r3, r4 after trapezoid correction | amendment. 本実施形態による縦方向補正処理で用いられる変換式を説明するための概念図である。It is a conceptual diagram for demonstrating the conversion type used by the vertical direction correction process by this embodiment. 本実施形態による縦方向補正後の補正必要領域30a、30bと補正不要領域31とに生じる不連続性を説明するための概念図である。It is a conceptual diagram for demonstrating the discontinuity which arises in the correction required area | regions 30a and 30b and the correction unnecessary area | region 31 after the vertical direction correction | amendment by this embodiment. 本実施形態による縦方向補正処理の動作を説明するためのフローチャートである。It is a flowchart for demonstrating the operation | movement of the vertical direction correction process by this embodiment. 台形補正後の輪郭R1及び画像G1と、台形補正後の四隅の目標点r1’、r2’、r3’、r4’からなる矩形輪郭R2とを示す説明図である。It is explanatory drawing which shows the outline R1 and image G1 after trapezoid correction | amendment, and the rectangular outline R2 which consists of the target points r1 ', r2', r3 ', r4' of the four corners after trapezoid correction | amendment. 本実施形態による横方向補正処理の動作を説明するためのフローチャートである。It is a flowchart for demonstrating operation | movement of the horizontal direction correction | amendment process by this embodiment. 本実施形態に係る分割領域における撓み量d(z)を示す説明図である。It is explanatory drawing which shows the deflection amount d (z) in the division area which concerns on this embodiment. 本実施形態に係るds(i)、dz(i)及びdx’(i)の関係を示す概念図である。It is a conceptual diagram which shows the relationship between ds (i), dz (i), and dx '(i) concerning this embodiment. 本実施形態による横方向補正処理の動作を説明するための概念図である。It is a conceptual diagram for demonstrating operation | movement of the horizontal direction correction | amendment process by this embodiment. 本実施形態において、頁の湾曲度合いによって変化する補正後の画像の例を示す概念図である。In this embodiment, it is a conceptual diagram which shows the example of the image after correction | amendment which changes with the curvature degree of a page.

以下、本発明の実施の形態を、図面を参照して説明する。   Hereinafter, embodiments of the present invention will be described with reference to the drawings.

A.実施形態の構成
図1は、本発明の実施形態による画像補正装置としての携帯情報端末1の構成を示すブロック図である。図において、携帯情報端末1は、例えば、スマートフォンや、タブレット端末などからなる。携帯情報端末1は、通信部10、撮像部11、ROM12、RAM13、表示部14、操作部(タッチパネル)15、記録媒体16、及びCPU17を備えている。
A. Configuration of Embodiment FIG. 1 is a block diagram showing a configuration of a portable information terminal 1 as an image correction apparatus according to an embodiment of the present invention. In the figure, the portable information terminal 1 includes, for example, a smartphone or a tablet terminal. The portable information terminal 1 includes a communication unit 10, an imaging unit 11, a ROM 12, a RAM 13, a display unit 14, an operation unit (touch panel) 15, a recording medium 16, and a CPU 17.

通信部10は、例えば、移動体通信、Bluetooth(登録商標)、又は/及び無線LAN(WiFi)を用いてインターネットなどのネットワークに接続する。撮像部11は、光学レンズ群からなるレンズブロックと、CCDや、CMOSなどの撮像素子からなり、レンズブロックから入った画像を撮像素子により撮像する。特に、本実施形態では、撮像部11は、本の頁を撮像する。   The communication unit 10 is connected to a network such as the Internet using mobile communication, Bluetooth (registered trademark), and / or wireless LAN (WiFi), for example. The imaging unit 11 includes a lens block including an optical lens group and an imaging element such as a CCD or a CMOS, and captures an image entered from the lens block by the imaging element. In particular, in the present embodiment, the imaging unit 11 images a page of a book.

ROM12は、後述するCPU17により実行されるプログラムや動作等に必要とされる各種パラメータなどを記憶している。RAM13は、後述するCPU17がプログラムを実行した際の一時的なデータや、各種アプリケーションプログラム、アプリケーションの実行に必要な各種パラメータなどのデータを記憶する。特に、本実施形態では、RAM13には、撮像した画像並びに補正した補正画像等が記憶される。   The ROM 12 stores programs executed by the CPU 17 described later, various parameters necessary for operations, and the like. The RAM 13 stores data such as temporary data when the CPU 17 described later executes a program, various application programs, and various parameters necessary for executing the application. In particular, in the present embodiment, the RAM 13 stores captured images, corrected corrected images, and the like.

表示部14は、液晶表示器や有機EL(Electro Luminescence)表示器などからなり、特定の機能やアプリケーションなどに紐付けられているアイコンや、アプリケーション画面、各種のメニュー画面などを表示する。操作部(タッチパネル)15は、指やスタイラス(ペン)などの直接接触、あるいは、近接を検出する。なお、操作部(タッチパネル)15には、電源ボタンや音量ボタンなどの機械的なスイッチ類が含まれてもよい。また、本実施形態では、操作部(タッチパネル)15から、撮像した画像の曲面(歪み)を補正する際のパラメータが入力される。   The display unit 14 includes a liquid crystal display, an organic EL (Electro Luminescence) display, and the like, and displays icons associated with specific functions and applications, application screens, various menu screens, and the like. The operation unit (touch panel) 15 detects direct contact or proximity of a finger or a stylus (pen). The operation unit (touch panel) 15 may include mechanical switches such as a power button and a volume button. In this embodiment, parameters for correcting the curved surface (distortion) of the captured image are input from the operation unit (touch panel) 15.

記録媒体16は、撮像された画像データなどの各種データを保存する。CPU17は、上述したROM12に記憶されているプログラムを実行することで各部の動作を制御する。特に、本実施形態では、CPU17は、画像処理プログラムを実行することにより、撮像した画像に対して湾曲補正を実行する。   The recording medium 16 stores various data such as captured image data. The CPU 17 controls the operation of each unit by executing the program stored in the ROM 12 described above. In particular, in the present embodiment, the CPU 17 executes curvature correction on the captured image by executing an image processing program.

本実施形態は、撮像部11、あるいは他の撮像機能を有する機器で撮像された本又は冊子(今後は本と省略する)の画像の曲面(歪み)を部分的に湾曲補正する画像処理技術である。本実施形態では、撮影された1つの本の画像の中心部や、綴じ部から離れた部分には歪みが少ないという特徴を生かし、同一画像(1つの本の画像)内で湾曲補正が必要な領域(補正必要領域)と不必要な領域(補正不要領域)に分割し、補正必要領域に対して湾曲補正を加えた後に、再び、補正必要領域と補正不要領域とをつなぎ合わせる。これにより湾曲補正すべき対象となる画素数が減り、画像処理速度を上げることができる。   The present embodiment is an image processing technique that partially corrects a curved surface (distortion) of an image of a book or booklet (hereinafter abbreviated as a book) imaged by the imaging unit 11 or another device having an imaging function. is there. In the present embodiment, curvature correction is necessary in the same image (one book image) by taking advantage of the feature that distortion is small in the center part of the photographed one book image and the part away from the binding part. The area is divided into an area (necessary area for correction) and an unnecessary area (unnecessary area for correction), and after the curvature correction is performed on the necessary area for correction, the necessary area for correction and the unnecessary area for correction are connected again. As a result, the number of pixels to be curved is reduced and the image processing speed can be increased.

また、本実施形態では、補正必要領域と補正不要領域とを違和感なくつなげるために、すなわち、湾曲補正後に、補正必要領域と補正不要領域とをつなぎ合わせたとき、画像のズレが生じないよう、補正必要領域と補正不要領域との境界近傍に対する湾曲補正の効果を抑えるべく、湾曲補正処理において、重み係数を乗算することで、境界近傍では補正の度合いが比較的小さくなるようにしている。   Further, in the present embodiment, in order to connect the correction necessary area and the correction unnecessary area without a sense of incongruity, that is, when the correction necessary area and the correction unnecessary area are connected after the curvature correction, the image is not shifted. In order to suppress the effect of the curvature correction on the vicinity of the boundary between the correction necessary area and the correction unnecessary area, the degree of correction is made relatively small in the vicinity of the boundary by multiplying the weight coefficient in the curvature correction processing.

B.実施形態の動作
次に、上述した実施形態の動作について説明する。
図2は、本実施形態の携帯情報端末1による全体動作を説明するためのフローチャートである。携帯情報端末1において、CPU17は、まず、本の画像を記録媒体16からRAM13に格納し、操作部(タッチパネル)15から湾曲補正のためのパラメータを入力するか、又は別アルゴリズムによって湾曲補正のためのパラメータを自動的に導出する(ステップS10)。次に、CPU17は、上記パラメータに基づいて、湾曲補正のための画像処理を行う(ステップS12)。なお、湾曲補正のための画像処理の詳細については後述する。
B. Operation of Embodiment Next, the operation of the above-described embodiment will be described.
FIG. 2 is a flowchart for explaining the overall operation of the portable information terminal 1 of the present embodiment. In the portable information terminal 1, the CPU 17 first stores a book image from the recording medium 16 in the RAM 13, inputs parameters for curvature correction from the operation unit (touch panel) 15, or performs curvature correction by another algorithm. Are automatically derived (step S10). Next, the CPU 17 performs image processing for curvature correction based on the parameters (step S12). Details of image processing for curvature correction will be described later.

画像処理が終了すると、CPU17は、画像処理した画像、すなわちパラメータに基づいて湾曲補正を施した本の画像を表示部14に出力する(ステップS14)。CPU17は、処理画像が所定の条件を満たしているか否かを判断する(ステップS16)。   When the image processing ends, the CPU 17 outputs the image-processed image, that is, the book image subjected to the curvature correction based on the parameters to the display unit 14 (step S14). The CPU 17 determines whether or not the processed image satisfies a predetermined condition (step S16).

本実施形態では、ユーザが表示部14に表示された湾曲補正を施した画像を確認して、十分な湾曲補正が行われたか、あるいは湾曲補正の程度が強すぎたか、弱すぎたかを判断し、操作部(タッチパネル)15から指示する。しかしながら、これに限らず、CPU17が、湾曲補正後の画像の歪みが許容範囲内であるかを判断するようにしてもよい。   In the present embodiment, the user confirms the image subjected to curvature correction displayed on the display unit 14 and determines whether sufficient curvature correction has been performed, or whether the degree of curvature correction is too strong or too weak. Instructed from the operation unit (touch panel) 15. However, the present invention is not limited to this, and the CPU 17 may determine whether the distortion of the image after curvature correction is within an allowable range.

処理画像が所定の条件を満たしていない場合には(ステップS16のNO)、ユーザによって、操作部(タッチパネル)15から湾曲補正の程度を強くしたり、弱くしたりするための湾曲補正のパラメータを入力させる(ステップS18)。CPU17が所定の条件を満たしているか否かを判断する場合には、CPU17が再度、異なる条件で湾曲補正を実行するためのパラメータを設定する。   When the processed image does not satisfy the predetermined condition (NO in step S16), the curvature correction parameter for increasing or decreasing the degree of curvature correction from the operation unit (touch panel) 15 by the user is set. Input (step S18). When the CPU 17 determines whether or not a predetermined condition is satisfied, the CPU 17 sets again a parameter for executing curvature correction under a different condition.

いずれの場合も、湾曲補正のパラメータが再設定されると、CPU17は、ステップS12に戻り、上述した湾曲補正のための画像処理を行った後、湾曲補正を施した本の画像を表示部14に出力することを繰り返す。この処理は、湾曲補正後の画像の歪みが許容範囲内なるまで、すなわち、十分な湾曲補正が行われたと判断されるまで繰り返し実行される。   In any case, when the curvature correction parameters are reset, the CPU 17 returns to step S12, performs the above-described image processing for curvature correction, and then displays the book image subjected to the curvature correction on the display unit 14. Repeat to output to. This process is repeatedly executed until the distortion of the image after curvature correction falls within the allowable range, that is, until it is determined that sufficient curvature correction has been performed.

一方、処理画像が所定の条件を満たした場合には(ステップS16のYES)、CPU17は、湾曲補正後の画像を記録媒体16に出力する(ステップS20)。次に、CPU17は、処理すべき他の画像があるか否かを判断する(ステップS22)。   On the other hand, when the processed image satisfies the predetermined condition (YES in step S16), the CPU 17 outputs the image after the curvature correction to the recording medium 16 (step S20). Next, the CPU 17 determines whether there is another image to be processed (step S22).

そして、処理すべき他の画像がある場合には(ステップS22のYES)、ステップS10に戻り、次の画像に対して上述した処理を繰り返す。一方、処理すべき他の画像がない場合には(ステップS22のNO)、当該処理を終了する。   If there is another image to be processed (YES in step S22), the process returns to step S10 and the above-described processing is repeated for the next image. On the other hand, if there is no other image to be processed (NO in step S22), the process ends.

なお、上述した処理において、連続処理や速度向上のため、ステップS16の判断処理をスキップするようにしてもよい。   In the above-described processing, the determination processing in step S16 may be skipped for continuous processing or speed improvement.

図3は、本実施形態による画像処理の動作を説明するためのフローチャートである。また、図4は、本の頁を真上から撮影した場合の画像の例を示す模式図である。また、図5は、本の頁を下側から斜め方向に撮影した場合の画像の例を示す模式図である。   FIG. 3 is a flowchart for explaining the image processing operation according to the present embodiment. FIG. 4 is a schematic diagram showing an example of an image when a book page is photographed from directly above. FIG. 5 is a schematic diagram illustrating an example of an image when a page of a book is photographed obliquely from below.

CPU17は、まず、処理対象となる画像を記録媒体16から読み込む(ステップS30)。画像は、どのようなものでも良いが、紙面の真上の位置から垂直に撮影されたものが良い。図4に示すように、紙面の真上の位置から垂直に撮影された画像20では、頁の中心付近の領域21は、湾曲補正前と湾曲補正後に変化が少ないので、補正の不必要な領域となり得る。つまり、領域21の部分は、縦方向の歪みも小さく、横方向も急激な変化がないので無視できる領域と言える。これに対して、図5に示すように、紙面に垂直にせず斜め下側から撮影された画像22では、中心付近でも湾曲してしまい、湾曲補正が不必要な部分が少なくなってしまう。つまり、画像22では、全ての領域において歪みがあり、全ての領域で湾曲補正が必要になってしまう。   First, the CPU 17 reads an image to be processed from the recording medium 16 (step S30). Any image may be used, but an image taken vertically from a position directly above the paper surface is preferable. As shown in FIG. 4, in the image 20 taken perpendicularly from the position directly above the paper surface, the area 21 near the center of the page has little change before and after the curvature correction, and therefore an area that does not need to be corrected. Can be. That is, it can be said that the region 21 can be ignored because the distortion in the vertical direction is small and there is no abrupt change in the horizontal direction. On the other hand, as shown in FIG. 5, an image 22 taken from an oblique lower side without being perpendicular to the paper surface is curved near the center, and there are fewer portions that do not require curvature correction. That is, in the image 22, there is distortion in all areas, and curvature correction is required in all areas.

また、キャリブレーションを行わない場合も、レンズから生じる歪みが広範囲にわたって発生しているので、湾曲補正の不必要な領域は小さくなる。よって、本実施形態の湾曲補正による効果を享受するためには、キャリブレーション済みの撮像手段(例えば、撮像部11)で、図4に示すように、できるだけ紙面の中心真上から垂直に撮影することが望ましい。   Even when the calibration is not performed, the distortion generated from the lens is generated over a wide range, so that an unnecessary area for curvature correction is reduced. Therefore, in order to enjoy the effect of the curvature correction of the present embodiment, as shown in FIG. 4, the calibrated imaging unit (for example, the imaging unit 11) is photographed as vertically as possible from the center of the paper as much as possible. It is desirable.

次に、CPU17は、画像内の輪郭を周知の画像処理を用いて抽出する(ステップS32)。図6は、本実施形態の湾曲補正を行う前の画像Gを示す概念図である。図6に示すように、画像Gの上側基準線SBULの両端の点r1、r4と下側基準線SBDLの両端の点r2、r3を真直ぐな直線で結んだときの形状は台形状をしている。また、開いた本の紙面の歪み方は、綴じ部(線分r1−r2)を中心に一定の方向に歪んでおり、綴じ部(線分r1−r2)から等距離にある紙面はすべて同じ高さ方向に歪んでいる。   Next, the CPU 17 extracts a contour in the image by using known image processing (step S32). FIG. 6 is a conceptual diagram showing an image G before performing the curvature correction of the present embodiment. As shown in FIG. 6, when the points r1 and r4 at both ends of the upper reference line SBUL of the image G and the points r2 and r3 at both ends of the lower reference line SBDL are connected by a straight line, the shape is trapezoidal. Yes. In addition, the open book is distorted in a certain direction around the binding (line segment r1-r2), and all the paper surfaces that are equidistant from the binding (line r1-r2) are the same. It is distorted in the height direction.

次に、CPU17は、画像Gの輪郭から四隅r1、r2、r3、r4の座標値を取得する(ステップS34)。次に、CPU17は、取得した四隅r1、r2、r3、r4の座標値を基に、射影行列SAを用いて、画像Gの輪郭に対して周知の台形補正(透視変換)を施す(ステップS36)。なお、この台形補正おいては、画像Gの輪郭のみが台形補正されるのではなく、台形補正による輪郭の変形に追従して画像Gの画像全体(全ての画素)が補正される。   Next, the CPU 17 acquires the coordinate values of the four corners r1, r2, r3, r4 from the contour of the image G (step S34). Next, the CPU 17 performs known trapezoidal correction (perspective transformation) on the contour of the image G using the projection matrix SA based on the acquired coordinate values of the four corners r1, r2, r3, r4 (step S36). ). In this trapezoidal correction, not only the contour of the image G is trapezoidally corrected, but the entire image (all pixels) of the image G is corrected following the contour deformation by the trapezoidal correction.

図7は、本実施形態による台形補正後の画像G1を示す概念図である。なお、図7では、図が見やすいように、4つの目標点r1’、r2’、r3’、及びr4’を真直ぐな直線で結んで形成される四角形を正面向きに図示している。   FIG. 7 is a conceptual diagram showing an image G1 after keystone correction according to the present embodiment. In FIG. 7, for easy understanding of the drawing, a quadrangle formed by connecting four target points r1 ′, r2 ′, r3 ′, and r4 ′ with straight straight lines is illustrated facing the front.

射影行列SAは、4つの基準点を4つの目標点に射影する行列であり、4つの基準点は、それぞれ画像Gの上側基準線SBULと下側基準線SBDLの両端の点であったので、この射影行列SAで射影された画像G1の補正後上側基準線SBUL’及び補正後下側基準線SBDL’の両端の点は、図7に示すように、4つの目標点r1’、r2’、r3’、及びr4’に一致するようになっている。   The projection matrix SA is a matrix that projects four reference points onto four target points, and the four reference points are points on both ends of the upper reference line SBUL and the lower reference line SBDL of the image G, respectively. The points at both ends of the corrected upper reference line SBUL ′ and the corrected lower reference line SBDL ′ of the image G1 projected by the projection matrix SA are four target points r1 ′, r2 ′, It corresponds to r3 ′ and r4 ′.

また、4つの目標点は、本来あるべききれいな四角形の四隅の点として与えられているので、図7に示されるように、4つの目標点r1’、r2’、r3’、及びr4’を真直ぐな直線で結んだ形状は、図6に示す台形状から、きれいな四角形(矩形状)に変換されているが、完全に歪みが除去されているわけではない。本実施形態における湾曲補正処理では、透視変換後(台形補正後)の画像に対して、縦方向の湾曲補正と横方向の湾曲補正の2つの処理を行うことで補正を行う。   In addition, since the four target points are given as the four corner points of the clean quadrangle, the four target points r1 ′, r2 ′, r3 ′, and r4 ′ are straightened as shown in FIG. The shape connected by a straight line is converted from the trapezoidal shape shown in FIG. 6 into a clean quadrangle (rectangular shape), but the distortion is not completely removed. In the curvature correction processing according to the present embodiment, correction is performed on the image after perspective transformation (after trapezoidal correction) by performing two processes of vertical curvature correction and horizontal curvature correction.

次に、CPU17は、縦方向補正に対して、台形補正後の画像を補正必要領域30a、30bと補正不要領域31とに分割する(ステップS38)。   Next, the CPU 17 divides the image after the trapezoid correction into the correction required areas 30a and 30b and the correction unnecessary area 31 with respect to the vertical correction (step S38).

図8は、本実施形態による湾曲補正処理に先だって行う縦方向の分割処理について説明するための概念図である。図8に示すように、縦方向で歪みが多い領域は、一般的に画像の周縁部である。すなわち、上端と下端の領域が補正処理する領域であり、この領域を補正必要領域30a、30bとして抽出する。補正必要領域30a、30b以外は、補正不要領域31とする。したがって、画像は、2つの補正必要領域30a、30bの画像(上側と下側)と1つの補正不要領域31の画像との計3つの画像に分割されることになる。   FIG. 8 is a conceptual diagram for explaining vertical division processing performed prior to the curvature correction processing according to the present embodiment. As shown in FIG. 8, a region where there is much distortion in the vertical direction is generally the peripheral portion of the image. That is, the upper and lower areas are areas to be corrected, and these areas are extracted as the correction required areas 30a and 30b. The areas other than the correction necessary areas 30a and 30b are set as the correction unnecessary areas 31. Therefore, the image is divided into a total of three images, that is, the images of the two correction necessary regions 30a and 30b (upper and lower) and the image of the one correction unnecessary region 31.

補正必要領域30a、30bの範囲の決定方法(分割する境界線BL1、BL2をどこにするか)は、ユーザが操作部(タッチパネル)15から手動で指定するか、あるいは、予め決められた固定位置の境界線を用いるか、あるいは、基準の頁から任意の頁の境界線を導出して設定するなどの方法が考えられる。   The method of determining the range of the correction required areas 30a and 30b (where to set the boundary lines BL1 and BL2 to be divided) can be specified manually by the user from the operation unit (touch panel) 15 or at a predetermined fixed position. A method of using a boundary line or deriving and setting a boundary line of an arbitrary page from a reference page can be considered.

次に、CPU17は、分割した補正必要領域30a、30bに対して縦方向の湾曲補正を行う(ステップS40)。特に、本発明では、縦方向の湾曲補正に用いる演算式に境界線BL1、BL2からの距離に反比例する重み係数の項を乗算する。これにより、補正必要領域30a、30bと補正不要領域31とを違和感なくつなぎ合わせることができる。なお、縦方向の湾曲補正処理の詳細については後述する。   Next, the CPU 17 performs vertical curvature correction on the divided correction required areas 30a and 30b (step S40). In particular, in the present invention, an arithmetic expression used for vertical curvature correction is multiplied by a weight coefficient term that is inversely proportional to the distance from the boundary lines BL1 and BL2. Thereby, it is possible to connect the correction required areas 30a and 30b and the correction unnecessary area 31 without a sense of incongruity. Details of the vertical curvature correction process will be described later.

次に、CPU17は、横方向補正に対して、台形補正後の画像を補正必要領域32と補正不要領域33とに分割する(ステップS42)。   Next, the CPU 17 divides the image after the trapezoidal correction into the correction required area 32 and the correction unnecessary area 33 with respect to the horizontal correction (step S42).

図9は、本実施形態による湾曲補正処理に先だって行う横方向の分割処理について説明するための概念図である。図9に示すように、横方向で歪みが多い部分は、一般的に本の中央の綴じ部近傍(図示の右端)である。それ以外の部分も横方向の補正は必要であるが、間隔の変化は緩やかなので、あまり目立たない。したがって、綴じ部近傍の補正必要領域32とそれ以外の補正不要領域33の2つの画像に分割する。   FIG. 9 is a conceptual diagram for explaining horizontal division processing performed prior to the curvature correction processing according to the present embodiment. As shown in FIG. 9, the portion having a large amount of distortion in the lateral direction is generally in the vicinity of the binding portion at the center of the book (the right end in the drawing). Other portions need to be corrected in the horizontal direction, but the change in the interval is slow, so it is not very noticeable. Therefore, the image is divided into two images, that is, a correction required area 32 in the vicinity of the binding portion and the other correction unnecessary area 33.

縦方向の分割と同様、分割領域の範囲の決定方法(分割する境界線BL3をどこにするか)については、ユーザが操作部(タッチパネル)15から手動で決定するか、予め決められた固定位置のラインを用いるか、あるいは、基準頁から任意の頁の境界線BL3を導出するなどの方法が考えられるが特に限定はしない。   As with the vertical division, the method for determining the range of the divided region (where to set the boundary line BL3 to be divided) is determined manually by the user from the operation unit (touch panel) 15 or at a predetermined fixed position. A method of using a line or deriving a boundary line BL3 of an arbitrary page from a reference page is conceivable, but is not particularly limited.

次に、CPU17は、分割した補正必要領域32に対して横方向の湾曲補正を行う(ステップS44)。特に、本発明では、縦方向の湾曲補正と同様に、横方向の湾曲補正に用いる演算式に境界線BL3からの距離に反比例する重み係数の項を乗算する。これにより、補正必要領域32と補正不要領域33とを違和感なくつなぎ合わせることができる。なお、横方向の湾曲補正処理の詳細については後述する。   Next, the CPU 17 performs lateral curvature correction on the divided correction required area 32 (step S44). In particular, in the present invention, similarly to the vertical curvature correction, an arithmetic expression used for the horizontal curvature correction is multiplied by a term of a weighting factor that is inversely proportional to the distance from the boundary line BL3. Thereby, the correction required area | region 32 and the correction unnecessary area | region 33 can be joined without a sense of incongruity. The details of the lateral curvature correction process will be described later.

次に、CPU17は、縦方向補正処理及び横方向補正処理が施されたn個の分割領域U1を合成し、全体の画像を作成する(ステップS46)。具体的には、横方向補正処理によって補正された横方向の長さを累積加算することにより、高さ方向補正処理後のn個の分割領域U1を合成し、記録媒体16に保存する。この合成処理によって、画素数に変化が起きる場合がある。その場合、縦横の幅を元の画像の幅と同様になるようリサイズして画素数を等しくする。また、生成後の画像のアスペクト比は、実物の紙面と等しいとは限らない。したがって、適宜、正しく、もしくは不自然な画像にはならないようにアスペクト比を調整する。その後、CPU17は、図2に示すステップS14に戻る。   Next, the CPU 17 synthesizes the n divided areas U1 that have been subjected to the vertical direction correction process and the horizontal direction correction process, and creates an entire image (step S46). Specifically, by accumulating the lateral length corrected by the lateral direction correction process, n divided areas U1 after the height direction correction process are combined and stored in the recording medium 16. This composition processing may cause a change in the number of pixels. In that case, the vertical and horizontal widths are resized to be the same as the width of the original image, and the number of pixels is made equal. Further, the aspect ratio of the generated image is not necessarily equal to the actual paper surface. Therefore, the aspect ratio is adjusted as appropriate so that the image is not correct or unnatural. Thereafter, the CPU 17 returns to step S14 shown in FIG.

なお、本実施形態では、説明を簡単にするために補正完了時に分割した画像を結合するが、分割されたまま次の横方向の分割処理、湾曲補正処理をそれぞれの画像に施し、最後に全ての画像を結合する方法も考えられる。   In this embodiment, the images divided at the completion of correction are combined to simplify the explanation, but the next horizontal division processing and curvature correction processing are performed on each image while being divided, and finally all A method of combining the images is also conceivable.

図10は、台形補正後の補正必要領域30a(30b)の輪郭R1及び画像G1と、台形補正後の補正必要領域30a(30b)の四隅の目標点r1’、r2’、r3’、r4’からなる矩形輪郭R2とを示す説明図である。図において、h1は、矩形輪郭R2の高さであり、H1は、補正必要領域30a(30b)の輪郭R1の高さである。台形補正後の補正必要領域30a(30b)の輪郭R1及び画像G1においては、綴じ目方向(Y方向)における湾曲は残ったままである。頁が湾曲していると頁の中央部分が撮像手段(カメラ)に近くなるため、頁の左右端部と比べて大きく撮影される。   FIG. 10 shows the contour R1 and the image G1 of the correction required area 30a (30b) after trapezoid correction, and the target points r1 ′, r2 ′, r3 ′, r4 ′ at the four corners of the correction required area 30a (30b) after trapezoid correction. It is explanatory drawing which shows the rectangular outline R2 which consists of. In the figure, h1 is the height of the rectangular contour R2, and H1 is the height of the contour R1 of the correction required region 30a (30b). In the outline R1 and the image G1 of the correction required area 30a (30b) after the trapezoid correction, the curve in the binding direction (Y direction) remains. If the page is curved, the center portion of the page is close to the image pickup means (camera), so that the image is taken larger than the left and right edges of the page.

例えば、画像G1の横方向の略中央付近で当該画像G1の上端から下端まで綴じ目方向に沿って延在する領域Uは、矩形輪郭R2よりも綴じ目方向に大きい(長い)。つまり、頁の綴じ目方向の長さは頁の横方向でばらつくことになる。これを均一化し矩形輪郭R2内に収めるべく、分割した縦方向の補正必要領域30a(30b)に対して縦方向補正処理を実行する。   For example, a region U extending along the stitch direction from the upper end to the lower end of the image G1 in the vicinity of the approximate center in the lateral direction of the image G1 is larger (longer) in the stitch direction than the rectangular contour R2. That is, the length in the binding direction of the page varies in the horizontal direction of the page. In order to make this uniform and within the rectangular contour R2, the vertical correction processing is executed on the divided vertical correction required region 30a (30b).

(縦方向の湾曲補正処理)
図11は、本実施形態による縦方向補正処理で用いられる変換式を説明するための概念図である。図中Fは便宜上置かれた焦点である。A’は台形補正後の補正必要領域30a(30b)の輪郭R1における任意の領域Uの上点、B’は領域Uにおける任意の領域Uの下点、P’はA’−B’線上における任意の点、Aは矩形輪郭R2内で領域Uに対応する部分の上点、Bは矩形輪郭R2内で領域Uに対応する部分の下点、PはA−B線上における点Pに対応する点を示している。また、括弧内には座標を示している。
(Vertical curvature correction processing)
FIG. 11 is a conceptual diagram for explaining a conversion formula used in the vertical direction correction processing according to the present embodiment. In the figure, F is a focal point set for convenience. A ′ is the upper point of an arbitrary region U in the contour R1 of the correction required region 30a (30b) after trapezoid correction, B ′ is the lower point of the arbitrary region U in the region U, and P ′ is on the A′-B ′ line. An arbitrary point, A is an upper point of a portion corresponding to the region U in the rectangular contour R2, B is a lower point of a portion corresponding to the region U in the rectangular contour R2, and P corresponds to a point P on the line AB. Shows the point. The coordinates are shown in parentheses.

この図11から以下の関係が分かる。
ΔA’FB’∝ΔAFB
∴FP:FP’=h1:H1
ΔAFP∝ΔA’FP’
∴AP:A’P’=h1:H1
∴AP=(h1/H1)・A’P’
ここで、A点のY座標値をyaとし、P点のY座標値をypとし、A’点のY座標値をya’とし、P’点のY座標値をyp’とすると、
A’P’=ya’−yp’
AP=ya−yp
となる。
∴yp=h1/H1*(yp’−ya’)+ya ・・・(1)
The following relationship can be seen from FIG.
ΔA'FB'∝ΔAFB
∴FP: FP '= h1: H1
ΔAFP∝ΔA'FP '
∴AP: A'P '= h1: H1
∴AP = (h1 / H1) ・ A'P '
Here, assuming that the Y coordinate value of point A is ya, the Y coordinate value of point P is yp, the Y coordinate value of point A ′ is ya ′, and the Y coordinate value of point P ′ is yp ′,
A'P '= ya'-yp'
AP = ya-yp
It becomes.
∴yp = h1 / H1 * (yp′−ya ′) + ya (1)

但し、この式(1)をそのまま補正必要領域30a(30b)に適用することはできない。
図12は、本実施形態による縦方向補正後の補正必要領域30a(30b)と補正不要領域31とに生じる不連続性を説明するための概念図である。分割した補正不要領域31にも実際には湾曲が生じており、縦方向補正後、式(1)を適用した補正必要領域30a(30b)と補正不要領域31とを合成すると、図12に示すように境界線BL1の付近で不連続になってしまう。
However, this equation (1) cannot be directly applied to the correction required region 30a (30b).
FIG. 12 is a conceptual diagram for explaining discontinuities that occur in the correction required area 30a (30b) and the correction unnecessary area 31 after the vertical correction according to the present embodiment. Curves are also actually generated in the divided correction unnecessary area 31, and after correction in the vertical direction, the correction required area 30a (30b) to which the expression (1) is applied and the correction unnecessary area 31 are combined, as shown in FIG. Thus, it becomes discontinuous near the boundary line BL1.

そこで、境界線BL1の付近では、変換率に抑制がかかり、境界線BL1から離れるに従って、式(1)と同様の変換率を持つような変換式にする。一例として、以下のような重みを含んだ変換式を挙げる。   Therefore, in the vicinity of the boundary line BL1, the conversion rate is suppressed, and a conversion equation having a conversion rate similar to the equation (1) is set as the distance from the boundary line BL1 increases. As an example, a conversion formula including the following weights is given.

yp=(1−m)*{h1/H1*(yp’−ya’)+ya}+m*yp’ ・・・(2)
m=(1+k*|yp’−ybound|)^−1 ・・・(3)
yp = (1-m) * {h1 / H1 * (yp'-ya ') + ya} + m * yp' (2)
m = (1 + k * | yp'-ybound |) ^-1 (3)

ここで、yboundは境界線BL1、BL2のy座標であり、kは0<kである係数である。係数kは、頁の端で式(1)とほぼ同じ変換率になるように設定しなければならない。例えば、係数kが0に近い値だと、全域にわたって変換が抑制され、変換の効果がなくなってしまう。   Here, ybound is the y coordinate of the boundary lines BL1 and BL2, and k is a coefficient with 0 <k. The coefficient k must be set so that the conversion rate is almost the same as that in the expression (1) at the end of the page. For example, if the coefficient k is a value close to 0, conversion is suppressed over the entire area, and the conversion effect is lost.

変換領域の結合部とは反対側の境界をyc、その平面に変換したときの座標をyc’とすると、ycは、数(1)、(2)どちらの式でも変わらない結果になればよい。
数(1)−数(2)より、
yc1−yc2=h1/H1*(yc’−ya’)+ya−(1−m)*{h1/H1*(yc’−ya’)+ya}−m*yc’=0 ・・・(4)
Assuming that the boundary of the conversion area opposite to the coupling portion is yc and the coordinate when converted to the plane is yc ′, yc only needs to be a result that does not change in either equation (1) or (2). .
From number (1)-number (2),
yc1-yc2 = h1 / H1 * (yc′−ya ′) + ya− (1-m) * {h1 / H1 * (yc′−ya ′) + ya} −m * yc ′ = 0 (4)

しかしながら、この式(4)では、係数kは不定になってしまう。そこで、右辺は0ではなく、1ピクセルよりも小さいという意味で、   However, in this equation (4), the coefficient k becomes indefinite. So, the right side is not 0, but smaller than 1 pixel,

h1/H1*(yc’−ya’)+ya−(1−m)*{h1/H1*(yc’−ya’)+ya}+m*yc’<1 ・・・(5)
とすると、係数kは、式(6)で示される。
h1 / H1 * (yc′−ya ′) + ya− (1-m) * {h1 / H1 * (yc′−ya ′) + ya} + m * yc ′ <1 (5)
Then, the coefficient k is expressed by Equation (6).

k>{H1/h1*(yc’−ya’)−yc’+ya−1}/|yc’−ybound| ・・・(6)   k> {H1 / h1 * (yc'-ya ')-yc' + ya-1} / | yc'-ybound | (6)

よって、式(6)の条件になる係数kを用いる。係数kの決め方は、係数kの下限値の2倍の量を用いたり、H1/h1の導出の簡略化のために、H1/h1を1.2(経験的な1画像の最大量)などの固定量としたりしてもよい。この係数kを用いて式(2)の変換式から変換行列を作り、縦方向の湾曲補正を実行する。   Therefore, the coefficient k that satisfies the condition of Expression (6) is used. The coefficient k is determined by using an amount twice the lower limit value of the coefficient k, or H1 / h1 is 1.2 (empirical maximum amount of one image) to simplify the derivation of H1 / h1. Or a fixed amount. Using this coefficient k, a transformation matrix is created from the transformation equation (2), and vertical curvature correction is executed.

ここで導出した変換式は、あくまで一例であり、境界線BL1、BL2の近傍で補正が抑制され、離れるにつれ抑制項が減衰するような振る舞いを示すのなら、係数kをどのような値とするかは限定しない。   The conversion equation derived here is merely an example, and if the correction is suppressed in the vicinity of the boundary lines BL1 and BL2 and the suppression term attenuates as it moves away, what value is the coefficient k? It is not limited.

上述した式(2)によって任意の点Pの変換後のPのY座標値を求めることができる。
実際には、矩形輪郭R2内のメッシュ内の各点の階調に、対応する輪郭R1の点における階調を当てはめていく補正を行う。
The Y coordinate value of P after conversion of an arbitrary point P can be obtained by the above-described equation (2).
Actually, correction is performed by applying the gradation at the point of the corresponding contour R1 to the gradation of each point in the mesh in the rectangular contour R2.

図13は、本実施形態による縦方向補正処理の動作を説明するためのフローチャートである。CPU17は、矩形輪郭R2の綴じ目方向の長さh1を取得する(ステップS60)。具体的には、台形補正後の補正必要領域30a(30b)における輪郭R1の右側若しくは左側の上下の角部の間隔を長さh1とする。次に、CPU17は、台形補正後の補正必要領域30a(30b)における輪郭R1を横方向にn分割し、各分割領域U1の横座標x(i)を設定する(ステップS62)。   FIG. 13 is a flowchart for explaining the operation of the vertical direction correction processing according to this embodiment. The CPU 17 obtains the length h1 in the stitch direction of the rectangular contour R2 (step S60). Specifically, the interval between the upper and lower corners on the right side or the left side of the contour R1 in the correction required region 30a (30b) after the trapezoid correction is set to the length h1. Next, the CPU 17 horizontally divides the contour R1 in the correction required area 30a (30b) after trapezoid correction, and sets the abscissa x (i) of each divided area U1 (step S62).

次に、CPU17は、iを1に設定し(ステップS64)、補正必要領域30a(30b)における輪郭R1を基にx(i)での縦方向の長さH1を取得する(ステップS66)。次に、CPU17は、分割領域U1間の境目のP’点に対応するY座標値(yp’)を、式(2)を用いて導出し、当該P’点の画像を変換する(ステップS68)。   Next, the CPU 17 sets i to 1 (step S64), and acquires the vertical length H1 at x (i) based on the contour R1 in the correction required region 30a (30b) (step S66). Next, the CPU 17 derives the Y coordinate value (yp ′) corresponding to the P ′ point at the boundary between the divided areas U1 using the equation (2), and converts the image of the P ′ point (step S68). ).

CPU17は、x(i)での綴じ目方向全ての点で変換処理が終わったか否かを判断する(ステップS70)。そして、終わっていない場合には(ステップS70のNO)、ステップS68に戻り、式(2)を用いた画像変換を繰り返す。   The CPU 17 determines whether or not the conversion process has been completed at all points in the stitch direction in x (i) (step S70). If not completed (NO in step S70), the process returns to step S68, and the image conversion using equation (2) is repeated.

一方、終わっている場合には(ステップS70のYES)、CPU17は、iがn−1になったか否かを判断する(ステップS72)。そして、iがn−1になっていない場合には(ステップS72のNO)、CPU17は、i=i+1とし(ステップS74)、ステップS66に戻り、上述した処理を繰り返す。これによって、補正必要領域30a(30b)における、n−1個ある分割領域U1間の境目の全てに対して縦方向補正が実行される。一方、iがn−1になった場合には(ステップS72のYES)、補正後の補正必要領域30a、30bと補正不要領域31とを合成し(ステップS76)、縦方向補正処理を終了する。その後、CPU17は、図3に示すステップS42に戻る。   On the other hand, if it is over (YES in step S70), the CPU 17 determines whether i has reached n-1 (step S72). If i is not n−1 (NO in step S72), the CPU 17 sets i = i + 1 (step S74), returns to step S66, and repeats the above-described processing. As a result, the vertical correction is performed on all the boundaries between the n-1 divided areas U1 in the correction required area 30a (30b). On the other hand, when i becomes n−1 (YES in step S72), the corrected correction required areas 30a and 30b and the correction unnecessary area 31 are combined (step S76), and the vertical direction correction process is terminated. . Thereafter, the CPU 17 returns to step S42 shown in FIG.

(横方向の湾曲補正処理)
図14は、台形補正後の輪郭R1及び画像G1と、台形補正後の四隅の目標点r1’、r2’、r3’、r4’からなる矩形輪郭R2とを示す説明図である。台形補正後の輪郭R1及び画像G1においては、綴じ目方向の湾曲が残ったままであるので、図14に示すように、湾曲W1を直線L1に戻す処理を行う必要がある。この際、横方向の場所によって補正量が変動するため、横方向補正を実行する。また、縦方向の湾曲補正と同様に、横方向の湾曲補正を行う場合にも、境界線BL3の付近で不連続面が発生するので、横方向の湾曲補正で用いる変換式にも重みを加える。
(Horizontal curvature correction processing)
FIG. 14 is an explanatory diagram showing the contour R1 and the image G1 after the trapezoid correction, and the rectangular contour R2 including the target points r1 ′, r2 ′, r3 ′, and r4 ′ at the four corners after the trapezoid correction. In the contour R1 and the image G1 after the trapezoidal correction, the curve in the binding direction remains, so it is necessary to perform a process for returning the curve W1 to the straight line L1, as shown in FIG. At this time, since the correction amount varies depending on the location in the horizontal direction, the horizontal correction is executed. Similarly to the vertical curvature correction, when the horizontal curvature correction is performed, a discontinuous surface is generated in the vicinity of the boundary line BL3. Therefore, the conversion formula used in the horizontal curvature correction is also weighted. .

図15は、本実施形態による横方向補正処理の動作を説明するためのフローチャートである。CPU17は、矩形輪郭R2の綴じ目方向の長さhを取得する(ステップS80)。次に、CPU17は、台形補正後の輪郭R1を横方向にn分割し、各分割領域U1の横座標x(i)を設定する(ステップS82)。次に、CPU17は、iを1に設定し(ステップS84)、x(i)での撓み量dz(i)を推定する(ステップS86)。   FIG. 15 is a flowchart for explaining the operation of the horizontal direction correction processing according to this embodiment. The CPU 17 obtains the length h in the binding direction of the rectangular contour R2 (step S80). Next, the CPU 17 divides the trapezoid-corrected contour R1 into n parts in the horizontal direction, and sets the abscissa x (i) of each divided region U1 (step S82). Next, the CPU 17 sets i to 1 (step S84), and estimates the deflection amount dz (i) at x (i) (step S86).

図16は、分割領域U1における撓み量d(z)を示す説明図であり、図16(a)は実際の頁の断面図、図16(b)は輪郭補正後の画像を示す正面図である。図16(a)に示すように、実際の頁の法線方向(Z方向)の撓み量dz(i)は、厳密に言うとi番目の分割領域U1と、i−1番目の分割領域U1とのZ方向の差分によって求まる。   16A and 16B are explanatory views showing the amount of deflection d (z) in the divided region U1, FIG. 16A is a cross-sectional view of an actual page, and FIG. 16B is a front view showing an image after contour correction. is there. As shown in FIG. 16A, the deflection amount dz (i) in the normal direction (Z direction) of the actual page is strictly speaking that the i-th divided region U1 and the (i-1) th divided region U1. And the difference in the Z direction.

しかしながら、この導出には、撮像手段(カメラ)から紙面までの距離や、角度が必要であり、それらの測定が手間となる。ここで、分割領域U1の幅が微小であれば、i番目の分割領域U1の綴じ目方向の長さH(i)と、i−1番目の分割領域U1の長さH(i−1)との差分が撓み量dz(i)と近似的に等しくなる。この関係性を用いて、分割領域U1の撓み量dz(i)を推定する。
具体的には、式(7)により撓み量dz(i)を推定する。
dz(i)=g・{H(i)−H(i−1)} ・・・(7)
However, this derivation requires a distance and an angle from the image pickup means (camera) to the paper surface, and measurement thereof is troublesome. Here, if the width of the divided area U1 is very small, the length H (i) of the i-th divided area U1 in the binding direction and the length H (i-1) of the i-1th divided area U1. Is approximately equal to the deflection amount dz (i). Using this relationship, the deflection amount dz (i) of the divided region U1 is estimated.
Specifically, the amount of deflection dz (i) is estimated by Expression (7).
dz (i) = g · {H (i) −H (i−1)} (7)

なお、ここで、gは任意の係数である。この係数gを用いることで、横方向補正処理後の画像を横方向で調整することができる。ここで暫定的にg=1で導出していく。   Here, g is an arbitrary coefficient. By using this coefficient g, the image after the horizontal direction correction process can be adjusted in the horizontal direction. Here, it is tentatively derived with g = 1.

次に、CPU17は、実際の幅dx’(i)を求める(ステップS88)。
dx(i)は、台形補正後のi番目の分割領域U1の幅である。
dx(i)=x(i)−x(i−1)={x(n)−x(0)}/n ・・・(8)
Next, the CPU 17 obtains the actual width dx ′ (i) (step S88).
dx (i) is the width of the i-th divided region U1 after trapezoidal correction.
dx (i) = x (i) -x (i-1) = {x (n) -x (0)} / n (8)

実際の幅dx’(i)は、x(i)の高さz(i)によって修正を受けている。z(i)が高い場合、Hが大きくなると同様に幅も大きくなっている。つまり、実際の幅dx’(i)は小さい。この関係は以下の式(9)にまとめられる。
dx’(i)=h/H(i)・dx(i) ・・・(9)
The actual width dx ′ (i) has been modified by the height z (i) of x (i). When z (i) is high, the width increases as H increases. That is, the actual width dx ′ (i) is small. This relationship is summarized in the following equation (9).
dx ′ (i) = h / H (i) · dx (i) (9)

次に、CPU17は、ds(i)を求める(ステップS90)。
ds(i)は、i番目の分割領域U1における実際の頁の微小長さである。
Next, the CPU 17 calculates ds (i) (step S90).
ds (i) is the minute length of the actual page in the i-th divided region U1.

図17は、ds(i)、dz(i)及びdx’(i)の関係を示す概念図である。
図17に示すように、ds(i)は、ステップS86で求めたZ方向の長さdz(i)とステップS88で求めたX方向の長さdx’(i)とを基にした三平方の定理によって導出される。
ds(i)={dz(i)^2+dx’(i)^2}^1/2 ・・・(10)
FIG. 17 is a conceptual diagram showing the relationship between ds (i), dz (i), and dx ′ (i).
As shown in FIG. 17, ds (i) is a square square based on the length dz (i) in the Z direction obtained in step S86 and the length dx ′ (i) in the X direction obtained in step S88. It is derived by the theorem.
ds (i) = {dz (i) ^ 2 + dx '(i) ^ 2} ^ 1/2 (10)

次に、CPU17は、iが境界線BL3の位置に達したか否かを判断する(ステップS92)。そして、iが境界線BL3の位置に達していない場合には(ステップS92のNO)、CPU17は、i=i+1とし(ステップS94)、ステップS86に戻る。これによって、n個ある分割領域U1の全てに対してdz(i)、dx’(i)、及びds(i)が求められる。   Next, the CPU 17 determines whether i has reached the position of the boundary line BL3 (step S92). If i has not reached the position of the boundary line BL3 (NO in step S92), the CPU 17 sets i = i + 1 (step S94) and returns to step S86. As a result, dz (i), dx ′ (i), and ds (i) are obtained for all n divided regions U1.

一方、iが境界線BL3の位置に達した場合には(ステップS92のYES)、CPU17は、実際の頁の横方向の長さSを求める(ステップS96)。具体的には、n個ある分割領域U1の全てのds(i)の総和を求めることで、実際の頁の横方向の長さSが導出される。次に、CPU17は、iを再び1に設定する(ステップS98)。   On the other hand, when i has reached the position of the boundary line BL3 (YES in step S92), the CPU 17 obtains the horizontal length S of the actual page (step S96). More specifically, the horizontal length S of the actual page is derived by calculating the sum of all ds (i) of the n divided areas U1. Next, the CPU 17 sets i to 1 again (step S98).

次に、CPU17は、1からi番目まで分割領域U1のds(i)を求め、その累積値S(i)を導出し(ステップS100)、x(i)をx’(i)に対応させて画像を変換する(ステップS102)。   Next, the CPU 17 obtains ds (i) of the divided area U1 from the 1st to the i-th, derives the accumulated value S (i) (step S100), and associates x (i) with x ′ (i). The image is converted (step S102).

i番目の微小スリットの変換後の点をx’(i)=i、変換前の点をx(i)とし、基準曲線の長さをS、i番目までの基準曲線の長さをS(i)、矩形領域の横の長さをDとして、変換式を予め導出しておいたSとS(i)から、
x(i)=D*S(i)/S ・・・(11)
とする。
The converted point of the i-th minute slit is x ′ (i) = i, the point before conversion is x (i), the length of the reference curve is S, and the length of the reference curve up to the i-th is S ( i) The horizontal length of the rectangular area is D, and S and S (i) from which the conversion formula is derived in advance,
x (i) = D * S (i) / S (11)
And

図18は、本実施形態による横方向補正処理の動作を説明するための概念図である。横方向の湾曲補正の場合には、図18に示すように、縦方向の湾曲補正と同様の重みを与えることに加え、iのインクリメントを補正必要領域側からカウントしていく。すなわち、綴じ目が右側ならば、一般とは逆に右側から画像を走査する。これにより、境界線BL3において、iのカウントを終了することができ、処理時間を短縮することが可能になる。   FIG. 18 is a conceptual diagram for explaining the operation of the horizontal direction correction processing according to the present embodiment. In the case of the horizontal curvature correction, as shown in FIG. 18, in addition to giving the same weight as the vertical curvature correction, the i increment is counted from the correction required region side. That is, if the stitch is on the right side, the image is scanned from the right side, contrary to the general case. As a result, the count of i can be terminated at the boundary line BL3, and the processing time can be shortened.

以下が横方向の湾曲補正における変換式の一例である。
x(i)=(1−m)*D*S(i)/S+m*x’(i)・・・(12)
m=(1−k*|x’(i)−xbound|)^−1 ・・・(13)
The following is an example of a conversion formula in lateral curvature correction.
x (i) = (1−m) * D * S (i) / S + m * x ′ (i) (12)
m = (1-k * | x ′ (i) −xbound |) ^ − 1 (13)

ここで、xboundは境界線BL3のx座標であり、kは0<kである定数である。kの値については、前述した式(6)の条件を満たすものとする。このkを用いて式(12)の変換式から変換行列を作り、横方向の湾曲補正を実行する。これにより、合成処理において、補正必要領域32と補正不要領域33とを違和感なくつなぎ合わせることができる。   Here, xbound is the x coordinate of the boundary line BL3, and k is a constant where 0 <k. It is assumed that the value of k satisfies the condition of the above-described formula (6). Using this k, a transformation matrix is created from the transformation equation (12), and lateral curvature correction is executed. Thereby, it is possible to connect the correction required area 32 and the correction unnecessary area 33 without a sense of incongruity in the synthesis process.

次に、CPU17は、x(i)での綴じ目方向全ての点で変換処理が終わったか否かを判断し(ステップS104)、終わっていない場合には(ステップS104のNO)、ステップS102に戻り、上述した式(12)、(13)に従って、x(i)をx’(i)に対応させた画像変換を繰り返す。   Next, the CPU 17 determines whether or not the conversion process has been completed for all points in the stitch direction in x (i) (step S104). If not completed (NO in step S104), the process proceeds to step S102. Returning, the image conversion in which x (i) is made to correspond to x ′ (i) is repeated according to the above-described equations (12) and (13).

一方、変換処理が終わった場合には(ステップS104のYES)、CPU17は、iが境界線BL3の位置に達したか否かを判断する(ステップS106)。そして、iが境界線BL3の位置に達していない場合には(ステップS106のNO)、i=i+1とし(ステップS108)、ステップS100に戻り、上述した処理を繰り返す。これによって、補正必要領域32における、n個ある分割領域U1の全てに対して横方向補正が実行される。一方、iが境界線BL3の位置に達した場合には(ステップS106のYES)、補正後の補正必要領域32と補正不要領域33とを合成し(ステップS110)、当該横方向補正処理を終了する。その後、CPU17は、図3に示すステップS46に戻る。   On the other hand, when the conversion process is completed (YES in step S104), the CPU 17 determines whether i has reached the position of the boundary line BL3 (step S106). If i has not reached the position of the boundary line BL3 (NO in step S106), i = i + 1 is set (step S108), the process returns to step S100, and the above-described processing is repeated. As a result, the horizontal correction is executed for all n divided areas U1 in the correction required area 32. On the other hand, if i has reached the position of the boundary line BL3 (YES in step S106), the corrected correction required area 32 and the correction unnecessary area 33 are combined (step S110), and the horizontal direction correction processing is ended. To do. Thereafter, the CPU 17 returns to step S46 shown in FIG.

また、本実施形態では、横方向補正処理におけるdz(i)を求める際に、式(6)に対して係数g(暫定的にg=1)を用いている。上記処理により、各分割領域U1の横方向の均一化が図られるものの、幅全体の長さの正確性に問題が生じる。例えば、図19(a)では、湾曲度が小さい頁P1に対して補正を施した場合を示し、図19(b)では、図19(a)の場合と同じ頁P1をより大きく湾曲させて補正を施した場合を示している。   In the present embodiment, the coefficient g (provisionally g = 1) is used for Expression (6) when determining dz (i) in the lateral correction processing. Although the above-described processing makes the divided areas U1 uniform in the horizontal direction, there is a problem in the accuracy of the overall length of the width. For example, FIG. 19A shows a case where correction is performed on a page P1 having a low degree of curvature, and FIG. 19B shows that the same page P1 as in FIG. The case where correction is performed is shown.

図19(a)、(b)でも明らかなように、補正後の画像Q1、Q2は横方向の長さが異なることになる。これは実際の頁の幅が同じであっても、その湾曲度によってH(i)とH(i−1)との差分が大きく異なってしまうことに起因する。このばらつきを抑制するべく、係数gを考慮し、処理を行うことができる。   As is clear from FIGS. 19A and 19B, the corrected images Q1 and Q2 have different lengths in the horizontal direction. This is because even if the actual page width is the same, the difference between H (i) and H (i-1) is greatly different depending on the degree of curvature. In order to suppress this variation, processing can be performed in consideration of the coefficient g.

すなわち、実際は、頁のアスペクト比(例えば、規定の紙サイズ)が分かっているので、図3のステップS46で合成された画像の横幅と頁のアスペクト比から求められる横幅との比が係数gに相当する。したがって、ステップS46で合成された画像を、この比に対応して横方向に拡縮することにより、所望のアスペクト比で歪みのない画像を求めることができる。具体的には、補正後の画像が所定のサイズ(例えば規定の紙サイズ)になるように横方向に拡縮することが好ましい。
なお、本発明は上記実施形態に限らず適宜変更可能である。
In other words, since the page aspect ratio (for example, the prescribed paper size) is known, the ratio between the horizontal width of the image synthesized in step S46 of FIG. 3 and the horizontal width obtained from the page aspect ratio is the coefficient g. Equivalent to. Therefore, an image without distortion at a desired aspect ratio can be obtained by scaling the image synthesized in step S46 in the horizontal direction corresponding to this ratio. Specifically, it is preferable that the corrected image is enlarged or reduced in the horizontal direction so as to have a predetermined size (for example, a prescribed paper size).
Note that the present invention is not limited to the above embodiment, and can be modified as appropriate.

上述した本実施形態によれば、本の画像の中で湾曲補正が必要な補正必要領域30a、30b、32と補正不必要な補正不要領域31、33とに分割し、補正必要領域30a、30b、32に対して縦方向補正及び横方向補正を行うようにしたので、湾曲した紙面を撮像した画像をより短時間で湾曲補正することができる。   According to the present embodiment described above, the correction required areas 30a, 30b, and 32 that need to be corrected in a book image and the correction unnecessary areas 31 and 33 that do not need correction are divided into correction required areas 30a and 30b. , 32, the vertical direction correction and the horizontal direction correction are performed, so that an image obtained by imaging a curved paper surface can be corrected in a shorter time.

また、上述した本実施形態によれば、補正必要領域30a、30b、32に対して縦方向補正及び横方向補正を行う際に、補正不要領域31、33との境界近傍では補正の度合いを比較的小さくなるようにしたので、補正後の補正必要領域30a、30b、32と補正不要領域31、33とを違和感なく合成することができる。   Further, according to the present embodiment described above, when the vertical correction and the horizontal correction are performed on the correction necessary areas 30a, 30b, and 32, the degree of correction is compared in the vicinity of the boundary with the correction unnecessary areas 31 and 33. Therefore, the corrected necessary areas 30a, 30b, and 32 and the unnecessary correction areas 31, 33 can be combined without a sense of incongruity.

また、上述した本実施形態によれば、補正必要領域30a、30b、32と補正不要領域31、33とに分割するための境界をユーザの指示操作に従って設定するようにしたので、画像毎に湾曲程度に応じた湾曲補正を実行することができる。   In addition, according to the above-described embodiment, the boundary for dividing the correction required areas 30a, 30b, and 32 and the correction unnecessary areas 31 and 33 is set according to the user's instruction operation. The curvature correction according to the degree can be executed.

また、上述した本実施形態によれば、補正必要領域30a、30b、32と補正不要領域31、33とを、予め決められた分割範囲に基づいて設定するようにしたので、より容易に補正必要領域30a、30b、32と補正不要領域31、33とを分割することができる。   In addition, according to the above-described embodiment, the correction required areas 30a, 30b, and 32 and the correction unnecessary areas 31 and 33 are set based on a predetermined division range, so that correction is required more easily. The areas 30a, 30b, and 32 and the correction unnecessary areas 31 and 33 can be divided.


また、上述した本実施形態によれば、補正必要領域30a、30b、32と補正不要領域31、33とを、基準の画像の分割範囲に基づいて導出するようにしたので、より容易に補正必要領域30a、30b、32と補正不要領域31、33とを分割することができる。
7
Further, according to the above-described embodiment, the correction required areas 30a, 30b, and 32 and the correction unnecessary areas 31 and 33 are derived based on the division range of the reference image, so that correction is required more easily. The areas 30a, 30b, and 32 and the correction unnecessary areas 31 and 33 can be divided.

以上、この発明のいくつかの実施形態について説明したが、この発明は、これらに限定されるものではなく、特許請求の範囲に記載された発明とその均等の範囲を含むものである。
以下に、本願出願の特許請求の範囲に記載された発明を付記する。
As mentioned above, although several embodiment of this invention was described, this invention is not limited to these, The invention described in the claim, and its equal range are included.
Below, the invention described in the claims of the present application is appended.

(付記1)
付記1に記載の発明は、画像内から頁の輪郭を抽出する抽出手段と、前記抽出手段により抽出された前記輪郭の四隅に基づいて前記画像の歪みを補正する輪郭補正手段と、前記輪郭補正手段により補正された前記画像を、補正必要領域と補正不要領域とに分割する領域分割手段と、前記領域分割手段により分割された前記補正必要領域を、前記画像の上端から下端まで綴じ目方向に沿って延在する分割領域が前記綴じ目方向に直交する横方向にn個配列されるように分割する分割手段と、前記分割手段によって分割された前記分割領域毎に、前記綴じ目方向の長さを補正する第1補正手段と、前記第1補正手段によって補正された前記分割領域毎に、実際の頁における前記分割領域の法線方向の撓み量を推定する推定手段と、前記推定手段によって推定された前記撓み量に基づいて前記分割領域毎の前記横方向の長さを補正する第2補正手段と、前記第1補正手段及び前記第2補正手段によって補正されたn個の前記分割領域を合成するとともに、当該合成された領域と前記領域分割手段によって分割された前記補正不要領域とを合成して合成画像を取得する取得手段と、を備えることを特徴とする画像補正装置である。
(Appendix 1)
The invention according to attachment 1 includes an extracting unit that extracts a contour of a page from an image, a contour correcting unit that corrects distortion of the image based on four corners of the contour extracted by the extracting unit, and the contour correction A region dividing unit that divides the image corrected by the unit into a correction necessary region and a correction unnecessary region; and the correction necessary region divided by the region dividing unit in a binding direction from an upper end to a lower end of the image. A dividing unit that divides the divided regions so that n divided regions are arranged in a lateral direction orthogonal to the binding direction, and a length in the binding direction for each of the divided regions divided by the dividing unit. A first correction unit that corrects the height, an estimation unit that estimates a deflection amount in a normal direction of the divided region in an actual page for each divided region corrected by the first correcting unit, and an estimation unit. Second correction means for correcting the lateral length of each of the divided areas based on the amount of deflection estimated in the above, and the n corrections corrected by the first correction means and the second correction means. An image correction apparatus comprising: an acquisition unit configured to combine a divided region and combine the combined region and the correction unnecessary region divided by the region dividing unit to obtain a combined image. is there.

(付記2)
付記2に記載の発明は、前記第1補正手段及び前記第2補正手段は、前記補正必要領域と前記補正不要領域との境界近傍において補正の度合いを調整する、ことを特徴とする付記1に記載の画像補正装置である。
(Appendix 2)
The invention according to attachment 2 is characterized in that the first correction means and the second correction means adjust the degree of correction in the vicinity of the boundary between the correction necessary area and the correction unnecessary area. It is an image correction apparatus of description.

(付記3)
付記3に記載の発明は、前記領域分割手段は、前記画像を、縦方向に上端部と中央部と下端部との3つの領域に分割し、前記上端部と前記下端部との領域を前記補正必要領域とし、前記中央部を前記補正不要領域とする、ことを特徴とする付記1又は2に記載の画像補正装置である。
(Appendix 3)
According to the third aspect of the present invention, the region dividing unit divides the image into three regions of an upper end portion, a central portion, and a lower end portion in the vertical direction, and the regions of the upper end portion and the lower end portion are divided into the regions. The image correction apparatus according to appendix 1 or 2, wherein the correction required area is used and the central portion is the correction unnecessary area.

(付記4)
付記4に記載の発明は、前記領域分割手段は、前記画像を、横方向に頁の綴じ部近傍とそれ以外の2つの領域に分割し、前記綴じ部近傍の領域を前記補正必要領域とし、前記それ以外の領域を前記補正不要領域とする、ことを特徴とする付記1乃至3のいずれか一つに記載の画像補正装置である。
(Appendix 4)
In the invention according to appendix 4, the region dividing unit divides the image into the vicinity of the binding portion of the page and the other two regions in the horizontal direction, and sets the region near the binding portion as the correction necessary region, The image correction apparatus according to any one of appendices 1 to 3, wherein the other area is set as the correction unnecessary area.

(付記5)
付記5に記載の発明は、前記領域分割手段によって分割される前記補正必要領域と前記補正不要領域とを指定する指定手段を更に備える、ことを特徴とする付記1乃至4のいずれか一つに記載の画像補正装置である。
(Appendix 5)
The invention according to appendix 5 further includes designation means for designating the correction required area and the correction unnecessary area divided by the area dividing means. It is an image correction apparatus of description.

(付記6)
付記6に記載の発明は、前記領域分割手段によって分割される前記補正必要領域と前記補正不要領域とを、予め決められた分割範囲に基づいて設定する設定手段を更に備える、ことを特徴とする付記1乃至4のいずれか一つに記載の画像補正装置である。
(Appendix 6)
The invention according to attachment 6 further includes setting means for setting the correction required area and the correction unnecessary area divided by the area dividing means based on a predetermined division range. The image correction apparatus according to any one of appendices 1 to 4.

(付記7)
付記7に記載の発明は、前記領域分割手段によって分割される前記補正必要領域と前記補正不要領域とを、基準の画像の分割範囲に基づいて導出する、ことを特徴とする付記1乃至4のいずれか一つに記載の画像補正装置である。
(Appendix 7)
The invention according to appendix 7 is characterized in that the correction required area and the correction unnecessary area divided by the area dividing means are derived based on a division range of a reference image. It is an image correction apparatus as described in any one.

(付記8)
付記8に記載の発明は、画像内から頁の輪郭を抽出するステップと、前記抽出された輪郭の四隅に基づいて前記画像の歪みを補正するステップと、前記歪みが補正された画像を、補正必要領域と補正不要領域とに分割するステップと、前記分割された補正必要領域を、前記画像の上端から下端まで綴じ目方向に沿って延在する分割領域が前記綴じ目方向に直交する横方向にn個配列されるように分割するステップと、前記n個に分割された前記分割領域毎に、前記綴じ目方向の長さを補正するステップと、前記綴じ目方向の長さが補正された前記分割領域毎に、実際の頁における前記分割領域の法線方向の撓み量を推定するステップと、前記推定された撓み量に基づいて前記分割領域毎の前記横方向の長さを補正するステップと、前記補正されたn個の分割領域を合成するとともに、当該合成された領域と前記分割された補正不要領域とを合成して合成画像を取得するステップと、を含むことを特徴とする画像補正方法である。
(Appendix 8)
The invention according to appendix 8 includes a step of extracting a contour of a page from an image, a step of correcting distortion of the image based on four corners of the extracted contour, and correcting an image in which the distortion is corrected A step of dividing into a necessary area and a correction unnecessary area; and a horizontal direction in which the divided area extending from the upper end to the lower end of the image along the stitch direction is orthogonal to the stitch direction. The n-divided area, the step of correcting the length in the binding direction for each of the divided areas divided into the n, and the length in the binding direction are corrected. For each of the divided regions, estimating a normal direction deflection amount of the divided region on an actual page, and correcting the lateral length of each divided region based on the estimated deflection amount And the corrected With synthesizing n number of segmented regions, an image correction method characterized by comprising the steps of synthesizing the said combined area and the divided correction unnecessary area to obtain a composite image.

(付記9)
付記9に記載の発明は、画像補正装置を制御するコンピュータに、画像内から頁の輪郭を抽出する抽出機能、前記抽出機能により抽出された前記輪郭の四隅に基づいて前記画像の歪みを補正する輪郭補正機能、前記輪郭補正機能により補正された前記画像を、補正必要領域と補正不要領域とに分割する領域分割機能、前記領域分割機能により分割された前記補正必要領域を、前記画像の上端から下端まで綴じ目方向に沿って延在する分割領域が前記綴じ目方向に直交する横方向にn個配列されるように分割する分割機能、前記分割機能によって分割された前記分割領域毎に、前記綴じ目方向の長さを補正する第1補正機能、前記第1補正機能によって補正された前記分割領域毎に、実際の頁における前記分割領域の法線方向の撓み量を推定する推定機能、前記推定機能によって推定された前記撓み量に基づいて前記分割領域毎の前記横方向の長さを補正する第2補正機能、前記第1補正機能及び前記第2補正機能によって補正されたn個の前記分割領域を合成するとともに、当該合成された領域と前記領域分割機能によって分割された前記補正不要領域とを合成して合成画像を取得する取得機能、を実現させることを特徴とするプログラムである。
(Appendix 9)
According to the ninth aspect of the present invention, the computer that controls the image correction apparatus corrects the distortion of the image based on the extraction function for extracting the outline of the page from the image and the four corners of the outline extracted by the extraction function. An area correction function that divides the image corrected by the outline correction function, the image that has been corrected by the outline correction function into a correction required area and a correction unnecessary area, and the correction required area that is divided by the area dividing function from the upper end of the image A division function that divides the division area extending along the stitch direction to the lower end so that n pieces are arranged in a lateral direction orthogonal to the stitch direction, and for each of the division areas divided by the division function, A first correction function for correcting the length in the binding direction, and for each of the divided areas corrected by the first correction function, an amount of deflection in the normal direction of the divided area on an actual page is estimated. The correction function is corrected by the second correction function, the first correction function, and the second correction function that correct the length in the horizontal direction for each of the divided regions based on the amount of deflection estimated by the estimation function. An acquisition function of combining the n divided regions and combining the combined region and the correction unnecessary region divided by the region dividing function to acquire a composite image is realized. It is a program.

1…携帯情報端末、10…通信部、11…撮像部、12…ROM、13…RAM、14…表示部、15…操作部(タッチパネル)、16…記録媒体、17…CPU、30a、30b、32…補正必要領域、31、33…補正不要領域

DESCRIPTION OF SYMBOLS 1 ... Portable information terminal, 10 ... Communication part, 11 ... Imaging part, 12 ... ROM, 13 ... RAM, 14 ... Display part, 15 ... Operation part (touch panel), 16 ... Recording medium, 17 ... CPU, 30a, 30b, 32: Correction required area 31, 33: Correction unnecessary area

Claims (9)

画像内から頁の輪郭を抽出する抽出手段と、
前記抽出手段により抽出された前記輪郭の四隅に基づいて前記画像の歪みを補正する輪郭補正手段と、
前記輪郭補正手段により補正された前記画像を、補正必要領域と補正不要領域とに分割する領域分割手段と、
前記領域分割手段により分割された前記補正必要領域を、前記画像の上端から下端まで綴じ目方向に沿って延在する分割領域が前記綴じ目方向に直交する横方向にn個配列されるように分割する分割手段と、
前記分割手段によって分割された前記分割領域毎に、前記綴じ目方向の長さを補正する第1補正手段と、
前記第1補正手段によって補正された前記分割領域毎に、実際の頁における前記分割領域の法線方向の撓み量を推定する推定手段と、
前記推定手段によって推定された前記撓み量に基づいて前記分割領域毎の前記横方向の長さを補正する第2補正手段と、
前記第1補正手段及び前記第2補正手段によって補正されたn個の前記分割領域を合成するとともに、当該合成された領域と前記領域分割手段によって分割された前記補正不要領域とを合成して合成画像を取得する取得手段と、
を備えることを特徴とする画像補正装置。
Extraction means for extracting the outline of the page from the image;
Contour correcting means for correcting distortion of the image based on the four corners of the contour extracted by the extracting means;
Area dividing means for dividing the image corrected by the contour correcting means into a correction required area and a correction unnecessary area;
The correction required areas divided by the area dividing means are arranged so that n divided areas extending along the stitch direction from the upper end to the lower end of the image are arranged in the horizontal direction perpendicular to the stitch direction. A dividing means for dividing;
First correcting means for correcting the length in the binding direction for each of the divided areas divided by the dividing means;
Estimating means for estimating the amount of deflection in the normal direction of the divided area on an actual page for each of the divided areas corrected by the first correcting means;
Second correction means for correcting the lateral length of each of the divided regions based on the amount of deflection estimated by the estimation means;
The n number of divided regions corrected by the first correcting unit and the second correcting unit are combined, and the combined region and the correction unnecessary region divided by the region dividing unit are combined and combined. An acquisition means for acquiring an image;
An image correction apparatus comprising:
前記第1補正手段及び前記第2補正手段は、
前記補正必要領域と前記補正不要領域との境界近傍において補正の度合いを調整する、
ことを特徴とする請求項1に記載の画像補正装置。
The first correction unit and the second correction unit are:
Adjusting the degree of correction in the vicinity of the boundary between the correction necessary region and the correction unnecessary region;
The image correction apparatus according to claim 1.
前記領域分割手段は、
前記画像を、縦方向に上端部と中央部と下端部との3つの領域に分割し、前記上端部と前記下端部との領域を前記補正必要領域とし、前記中央部を前記補正不要領域とする、
ことを特徴とする請求項1又は2に記載の画像補正装置。
The region dividing means includes
The image is vertically divided into three regions of an upper end portion, a central portion, and a lower end portion, the upper end portion and the lower end portion are defined as the correction necessary region, and the central portion is defined as the correction unnecessary region. To
The image correction apparatus according to claim 1, wherein the image correction apparatus is an image correction apparatus.
前記領域分割手段は、
前記画像を、横方向に頁の綴じ部近傍とそれ以外の2つの領域に分割し、前記綴じ部近傍の領域を前記補正必要領域とし、前記それ以外の領域を前記補正不要領域とする、
ことを特徴とする請求項1乃至3のいずれか一項に記載の画像補正装置。
The region dividing means includes
The image is divided in the horizontal direction into the vicinity of the binding portion of the page and the other two regions, the region near the binding portion is set as the correction necessary region, and the other region is set as the correction unnecessary region.
The image correction apparatus according to claim 1, wherein the image correction apparatus is an image correction apparatus.
前記領域分割手段によって分割される前記補正必要領域と前記補正不要領域とを指定する指定手段を更に備える、
ことを特徴とする請求項1乃至4のいずれか一項に記載の画像補正装置。
Further comprising designation means for designating the correction necessary area and the correction unnecessary area divided by the area dividing means;
The image correction apparatus according to claim 1, wherein the image correction apparatus is an image correction apparatus.
前記領域分割手段によって分割される前記補正必要領域と前記補正不要領域とを、予め決められた分割範囲に基づいて設定する設定手段を更に備える、
ことを特徴とする請求項1乃至4のいずれか一項に記載の画像補正装置。
Further comprising setting means for setting the correction required area and the correction unnecessary area divided by the area dividing means based on a predetermined division range.
The image correction apparatus according to claim 1, wherein the image correction apparatus is an image correction apparatus.
前記領域分割手段によって分割される前記補正必要領域と前記補正不要領域とを、基準の画像の分割範囲に基づいて導出する、
ことを特徴とする請求項1乃至4のいずれか一項に記載の画像補正装置。
Deriving the correction required area and the correction unnecessary area divided by the area dividing means based on a division range of a reference image;
The image correction apparatus according to claim 1, wherein the image correction apparatus is an image correction apparatus.
画像内から頁の輪郭を抽出するステップと、
前記抽出された輪郭の四隅に基づいて前記画像の歪みを補正するステップと、
前記歪みが補正された画像を、補正必要領域と補正不要領域とに分割するステップと、
前記分割された補正必要領域を、前記画像の上端から下端まで綴じ目方向に沿って延在する分割領域が前記綴じ目方向に直交する横方向にn個配列されるように分割するステップと、
前記n個に分割された前記分割領域毎に、前記綴じ目方向の長さを補正するステップと、
前記綴じ目方向の長さが補正された前記分割領域毎に、実際の頁における前記分割領域の法線方向の撓み量を推定するステップと、
前記推定された撓み量に基づいて前記分割領域毎の前記横方向の長さを補正するステップと、
前記補正されたn個の分割領域を合成するとともに、当該合成された領域と前記分割された補正不要領域とを合成して合成画像を取得するステップと、
を含むことを特徴とする画像補正方法。
Extracting a page outline from within the image;
Correcting distortion of the image based on the four corners of the extracted contour;
Dividing the distortion-corrected image into a correction-necessary region and a correction-unnecessary region;
Dividing the divided correction required areas so that n divided areas extending along the stitch direction from the upper end to the lower end of the image are arranged in a lateral direction perpendicular to the stitch direction;
Correcting the length in the binding direction for each of the divided areas divided into n pieces;
Estimating the amount of deflection in the normal direction of the divided area on an actual page for each of the divided areas in which the length in the binding direction is corrected;
Correcting the lateral length of each of the divided regions based on the estimated amount of deflection;
Combining the corrected n divided regions and combining the combined region and the divided correction unnecessary region to obtain a combined image;
An image correction method comprising:
画像補正装置を制御するコンピュータに、
画像内から頁の輪郭を抽出する抽出機能、
前記抽出機能により抽出された前記輪郭の四隅に基づいて前記画像の歪みを補正する輪郭補正機能、
前記輪郭補正機能により補正された前記画像を、補正必要領域と補正不要領域とに分割する領域分割機能、
前記領域分割機能により分割された前記補正必要領域を、前記画像の上端から下端まで綴じ目方向に沿って延在する分割領域が前記綴じ目方向に直交する横方向にn個配列されるように分割する分割機能、
前記分割機能によって分割された前記分割領域毎に、前記綴じ目方向の長さを補正する第1補正機能、
前記第1補正機能によって補正された前記分割領域毎に、実際の頁における前記分割領域の法線方向の撓み量を推定する推定機能、
前記推定機能によって推定された前記撓み量に基づいて前記分割領域毎の前記横方向の長さを補正する第2補正機能、
前記第1補正機能及び前記第2補正機能によって補正されたn個の前記分割領域を合成するとともに、当該合成された領域と前記領域分割機能によって分割された前記補正不要領域とを合成して合成画像を取得する取得機能、
を実現させることを特徴とするプログラム。

In the computer that controls the image correction device,
An extraction function that extracts the outline of the page from the image,
A contour correction function for correcting distortion of the image based on the four corners of the contour extracted by the extraction function;
A region dividing function for dividing the image corrected by the contour correcting function into a correction required region and a correction unnecessary region;
The correction required areas divided by the area dividing function are arranged so that n divided areas extending along the stitch direction from the upper end to the lower end of the image are arranged in the horizontal direction perpendicular to the stitch direction. Split function to split,
A first correction function for correcting the length in the binding direction for each of the divided areas divided by the division function;
An estimation function for estimating the amount of deflection in the normal direction of the divided area on an actual page for each of the divided areas corrected by the first correction function;
A second correction function for correcting the lateral length of each of the divided regions based on the amount of deflection estimated by the estimation function;
The n regions divided by the first correction function and the second correction function are combined, and the combined region and the correction unnecessary region divided by the region dividing function are combined and combined. Acquisition function to acquire images,
A program characterized by realizing.

JP2015049382A 2015-03-12 2015-03-12 Image correction apparatus, image correction method, and program Expired - Fee Related JP6230001B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2015049382A JP6230001B2 (en) 2015-03-12 2015-03-12 Image correction apparatus, image correction method, and program

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2015049382A JP6230001B2 (en) 2015-03-12 2015-03-12 Image correction apparatus, image correction method, and program

Publications (2)

Publication Number Publication Date
JP2016171429A true JP2016171429A (en) 2016-09-23
JP6230001B2 JP6230001B2 (en) 2017-11-15

Family

ID=56984180

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2015049382A Expired - Fee Related JP6230001B2 (en) 2015-03-12 2015-03-12 Image correction apparatus, image correction method, and program

Country Status (1)

Country Link
JP (1) JP6230001B2 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110402454A (en) * 2017-03-28 2019-11-01 富士胶片株式会社 Image correcting apparatus, image correcting method and program

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH1065877A (en) * 1996-08-23 1998-03-06 Sharp Corp Picture processor
JPH11155070A (en) * 1997-11-20 1999-06-08 Ricoh Co Ltd Image processor
JP2012243307A (en) * 2011-05-19 2012-12-10 Seiko Epson Corp Method for detecting strain in input image, device for detecting strain in input image and computer readable medium

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH1065877A (en) * 1996-08-23 1998-03-06 Sharp Corp Picture processor
JPH11155070A (en) * 1997-11-20 1999-06-08 Ricoh Co Ltd Image processor
JP2012243307A (en) * 2011-05-19 2012-12-10 Seiko Epson Corp Method for detecting strain in input image, device for detecting strain in input image and computer readable medium

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110402454A (en) * 2017-03-28 2019-11-01 富士胶片株式会社 Image correcting apparatus, image correcting method and program
CN110402454B (en) * 2017-03-28 2023-06-13 富士胶片株式会社 Image correction device, image correction method, and recording medium

Also Published As

Publication number Publication date
JP6230001B2 (en) 2017-11-15

Similar Documents

Publication Publication Date Title
CN109104596B (en) Projection system and correction method of display image
JP4960992B2 (en) Image processing method and image processing apparatus for fisheye correction and perspective distortion reduction
WO2022179109A1 (en) Projection correction method and apparatus, storage medium and electronic device
US9860448B2 (en) Method and electronic device for stabilizing video
CN108668093B (en) HDR image generation method and device
US8717455B2 (en) Image processing apparatus and image processing method
US8472747B2 (en) Image composition device, image composition method, and storage medium storing program
JP6436373B2 (en) Distortion correction method and terminal
JP2011170840A (en) Image processing device and electronic apparatus
JP4010754B2 (en) Image processing apparatus, image processing method, and computer-readable recording medium
KR101450782B1 (en) Image processing device and program
JP2014131257A (en) Image correction system, image correction method, and program
JP5954310B2 (en) Image processing apparatus, image processing method, and program
JP2002247614A (en) Projector
JP2015148532A (en) Distance measuring device, imaging apparatus, distance measuring method, and program
JP2020088708A (en) Control device, imaging apparatus, and program
JPWO2018189971A1 (en) Image processing device, imaging device, terminal device, image correction method, and image processing program
JP2014127773A5 (en)
JP6230001B2 (en) Image correction apparatus, image correction method, and program
US9967528B2 (en) Image processing apparatus and image processing method
JP5820716B2 (en) Image processing apparatus, image processing method, computer program, recording medium, and stereoscopic image display apparatus
JP4930304B2 (en) Image processing apparatus, image processing method, program, and recording medium
WO2015198478A1 (en) Image distortion correction apparatus, information processing apparatus and image distortion correction method
JP5845151B2 (en) A tilt correction device, a tilt correction method, and a tilt correction computer program
JP6217378B2 (en) Page image correction apparatus, page image correction method, and program

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20170419

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: 20170925

R150 Certificate of patent or registration of utility model

Ref document number: 6230001

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R150

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20171008

LAPS Cancellation because of no payment of annual fees