JP5563390B2 - Image processing apparatus, control method therefor, and program - Google Patents
Image processing apparatus, control method therefor, and program Download PDFInfo
- Publication number
- JP5563390B2 JP5563390B2 JP2010150264A JP2010150264A JP5563390B2 JP 5563390 B2 JP5563390 B2 JP 5563390B2 JP 2010150264 A JP2010150264 A JP 2010150264A JP 2010150264 A JP2010150264 A JP 2010150264A JP 5563390 B2 JP5563390 B2 JP 5563390B2
- Authority
- JP
- Japan
- Prior art keywords
- frame
- sides
- document
- line
- image processing
- 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.)
- Active
Links
- 238000000034 method Methods 0.000 title claims description 44
- 238000000605 extraction Methods 0.000 claims description 42
- 238000001514 detection method Methods 0.000 claims description 8
- 239000000284 extract Substances 0.000 claims description 6
- 238000010586 diagram Methods 0.000 description 16
- 230000009466 transformation Effects 0.000 description 4
- 238000006243 chemical reaction Methods 0.000 description 2
- 238000003672 processing method Methods 0.000 description 2
- 230000007423 decrease Effects 0.000 description 1
- 230000000694 effects Effects 0.000 description 1
- 230000006870 function Effects 0.000 description 1
- 239000011159 matrix material Substances 0.000 description 1
- NJPPVKZQTLUDBO-UHFFFAOYSA-N novaluron Chemical compound C1=C(Cl)C(OC(F)(F)C(OC(F)(F)F)F)=CC=C1NC(=O)NC(=O)C1=C(F)C=CC=C1F NJPPVKZQTLUDBO-UHFFFAOYSA-N 0.000 description 1
- 238000007781 pre-processing Methods 0.000 description 1
Images
Description
本発明は、画像処理装置、制御方法、及びプログラムに関し、特に、文書画像処理における前処理に関する。 The present invention relates to an image processing apparatus, a control method, and a program, and more particularly to preprocessing in document image processing.
近年、ネットワークの広がりにより、文書が電子的に配布される機会も増え、それに伴い紙の文書をスキャンにより電子文書化して配布可能とする技術が普及している。しかし、掲示されているポスターや、会議で用いたホワイトボード、サイズの大きな模造紙など、スキャンすることが困難な被写体(文書)が存在する。そこで、カメラで撮影した画像を電子文書化する技術が開発されている。ここで、カメラと被写文書との位置関係により得られる画像に台形状の歪みが生じるため、歪みを補正する技術が必要となる。 In recent years, due to the spread of networks, the opportunity for electronic distribution of documents has increased, and along with this, a technology that enables paper documents to be electronically distributed by scanning has become widespread. However, there are subjects (documents) that are difficult to scan, such as posted posters, whiteboards used in meetings, and large-size imitation paper. In view of this, techniques for electronically documenting images taken with a camera have been developed. Here, since a trapezoidal distortion occurs in the image obtained by the positional relationship between the camera and the document, a technique for correcting the distortion is required.
例えば、色差からエッジを取得し、一定以上の長さの線分を文書枠として検出し、歪みを補正する技術がある(特許文献1等参照)。また、台座上にある文書を撮影した場合に、検出した線分候補の撮影画像平面上の相対位置から隣接辺を求めていく技術がある(特許文献2等参照)。 For example, there is a technique of acquiring an edge from a color difference, detecting a line segment having a certain length or more as a document frame, and correcting distortion (see Patent Document 1). In addition, there is a technique for obtaining an adjacent side from a relative position on a photographed image plane of a detected line segment candidate when a document on a pedestal is photographed (see Patent Document 2, etc.).
文書やホワイトボードなどの長方形の撮影対象をカメラにより撮影した場合、当該撮影対象とカメラを正確に正対させるのが困難であるため、撮影画像中の文書には3次元的な傾きにより、台形状の歪みが生じる。そのため撮影画像中から文書(ホワイトボード)を読みやすい形で抽出する為には、文書枠(ホワイトボードの枠)を正確に抽出する必要がある。文書枠を抽出する方法として、ハフ変換などを用いて直線成分を検出し、4直線から文書枠を推定する方法がある。しかし、文書の背景によっては、直線が多数抽出され、文書枠を構成する組み合わせの数が増大し、正しい文書枠の推定が困難となる問題があった。 When a rectangular object such as a document or a whiteboard is photographed by a camera, it is difficult to accurately face the object and the camera. Therefore, the document in the photographed image has a three-dimensional inclination. Shape distortion occurs. Therefore, in order to extract a document (whiteboard) from a captured image in a form that is easy to read, it is necessary to accurately extract a document frame (whiteboard frame). As a method of extracting a document frame, there is a method of detecting a straight line component using Hough transform or the like and estimating a document frame from four straight lines. However, depending on the background of the document, many straight lines are extracted, and the number of combinations constituting the document frame increases, which makes it difficult to estimate the correct document frame.
上記課題を解決するために、本願発明は、以下の構成を有する。すなわち、矩形領域を有する被写体を撮影して得られた画像データから、前記矩形領域の四辺で構成される枠を抽出する画像処理装置であって、入力された前記画像データから複数の直線成分を検出する検出手段と、前記検出手段にて検出された前記直線成分に対する直交方向において、画素情報の高低による勾配方向を算出する算出手段と、前記検出手段にて検出された前記複数の直線成分の中から四辺を選択し、選択された当該四辺からなる枠候補を1以上抽出する抽出手段と、前記抽出手段にて抽出された前記枠候補のうち、当該枠候補の四辺における勾配方向が当該枠の内側もしくは外側のいずれかの方向に対して同一の向きとならない枠候補を、前記抽出手段で抽出された前記枠候補から除く絞り込み手段とを有する。
In order to solve the above problems, the present invention has the following configuration. That is, an image processing apparatus that extracts a frame composed of four sides of the rectangular area from image data obtained by photographing a subject having a rectangular area, wherein a plurality of linear components are extracted from the input image data. A detecting means for detecting; a calculating means for calculating a gradient direction according to the level of pixel information in a direction orthogonal to the linear component detected by the detecting means; and a plurality of linear components detected by the detecting means. select four sides from in an extraction means for extracting one or a frame candidate consisting of the four sides that are selected, among the frame candidate extracted by the extraction means, gradient direction in the four sides of the frame candidate the frame Narrowing means for excluding frame candidates that are not in the same orientation with respect to either the inside or outside direction from the frame candidates extracted by the extracting means .
直線が多数検出される煩雑な背景を持つ文書画像から精度よく文書枠の候補を絞り込むことが可能である。 Document frame candidates can be accurately narrowed down from a document image having a complicated background in which many straight lines are detected.
<実施形態1>
以下、図面を参照して本発明の好適な実施形態を詳細に説明する。図1は、本発明の実施例の画像処理装置へと入力される画像が取得される環境を示す図である。文書媒体101は、撮影対象となる矩形状の白板(ホワイトボード)やポスター、紙文書などであり、本発明ではこれらをまとめて文書と呼ぶこととする。撮影装置102は、文書媒体101を撮影するデジタルカメラなどの撮影装置である。撮影装置102で撮影して得られた画像が、処理対象の画像(入力画像)となる。表示部103は、撮影装置102に備えられ、撮影対象等を表示する。操作部104は、撮影装置102に備えられ、撮影装置102をユーザが操作する際に用いられる。
<Embodiment 1>
Hereinafter, preferred embodiments of the present invention will be described in detail with reference to the drawings. FIG. 1 is a diagram illustrating an environment in which an image input to an image processing apparatus according to an embodiment of the present invention is acquired. The
図2に入力画像の例を示す。画像200は、例えば表示部103に表示される。撮影装置102により撮影された画像200は、文書領域210(被写体の文書が写っている領域)と、文書領域以外の部分である背景領域220から構成される。文書領域210には文字領域211が含まれている。また、撮影位置と対象物の位置関係が正対していない場合(すなわち、斜め方向から撮影した場合)、文書領域210には傾き、すなわち線形歪みが生じる。ここでは、文書領域210は実際には直方形であるが、線形歪みにより、台形状の画像となっている。
FIG. 2 shows an example of the input image. The
[システム構成]
図3に本発明を実施する画像処理装置300の構成例を示す。画像処理装置300は、撮影画像データの入力を行う画像入力部301と、画像データに本発明の処理を施す画像処理プログラムを実行し、制御するCPU302と、該プログラムを実行する際のワークメモリやデータの一時保存などに利用されるRAM303と、該プログラムやデータを格納する記憶部304とから成る。
[System configuration]
FIG. 3 shows a configuration example of an
ここで、画像処理装置300の構成は一例であり、ここで示した以外の構成要素を含んでいても良い。また、外部の汎用コンピュータなどを用いて画像処理を実行しても良いし、撮影装置102などの電子回路上で画像処理を実行しても構わない。
Here, the configuration of the
図5は本実施形態の全体を説明するブロック図である。撮影画像501は、撮影装置102により撮影された画像を示す。画像判別部502は、撮影画像501が文書領域を含むか否かの判別を行う。文書領域抽出部503は、文書領域を含む撮影画像501から文書領域の枠を抽出する。ここでは、この枠を“文書枠”と記載する。歪み補正部504は、文書領域抽出部503で得た文書枠の撮影画像501上の座標をパラメータとして文書領域に対して逆透視変換を行い、直方形形状へと補正する。電子文書生成部505は、歪み補正部504により補正した画像から外部プログラムにて扱える電子文書506を生成する。電子文書506は、電子文書生成部505により生成された電子文書を示す。
FIG. 5 is a block diagram illustrating the entirety of this embodiment. A photographed
[処理の流れ]
以下、撮影画像501の例として、図2に示した画像200を用いた場合の処理を説明する。なお、本処理は、本実施形態において画像処理装置300に備えられたCPU302がRAM303や記憶部304等に格納されたプログラムを読み込み、実行するものである。また、抽出される直線の情報や勾配情報は、RAM303や記憶部304の記憶手段に保持される。
[Process flow]
Hereinafter, processing when the
画像判別部502により、撮影画像501に文書が含まれるか否かの判定を行う。画像データから文字を抽出する方法に関しては、例えば特開2002−042055号公報などの方法を用いて抽出することができる。処理の結果、画像200から文字領域211が得られ、文書画像を含む画像であると判定される。また、ユーザインターフェースを用いて、ユーザによって画像種別を切り替えても良い。
The
文書領域抽出部503の詳細な処理について、図4のフローチャートを用いて説明する。S401にて、文書領域抽出部503は、画像200から直線成分を検出する。直線成分の検出は、公知の手法を用いて、例えば次のように行うことができる。すなわち、SobelフィルタやLaplacianフィルタなどを用いたエッジ強調手法により、画像200中の文書の境界部分に該当する画素を強調する。このエッジを強調した画像に対し、ハフ変換や最小近似法などの公知の直線抽出法を用いることで、直線を検出することが可能である。検出した直線は、例えば画像データにおける端点と端点の座標を保持し、そのベクトルを算出することで直線の向きを取得することができる。なお、直線のベクトルを求める際には、例えば、画像において左から右へ向かってx座標が増加し、上から下へ向かってy座標が増加する場合、直線の両端のうち、x座標の値が小さい端点を始点とし、他点を終点として求めても良い。同じx座標の値である場合には、y座標の値が小さい端点を始点とする。
Detailed processing of the document
直線成分を抽出するための処理を適用した結果を図6に示す。図6(a)に示す画像600は、図2に示した画像200に対してエッジ強調を行った例である。図6(b)に示す画像610は、画像600に対してハフ変換を適用し、得られた直線成分を表した図である。この直線抽出の処理の結果、線分611から線分618までの計8本の線分が得られる。
The result of applying the process for extracting the linear component is shown in FIG. An
S402では、文書領域抽出部503は、S401により得られた全直線成分に対して直交方向の画素情報の変化から勾配方向を算出する。例えば、図7(a)に示す方法では、抽出された直線を含む領域700において、直線に対し、直交方向に走査することで輝度のヒストグラムを取得する。ここで、直交方向に走査するとは、例えば、直交方向の画素の値を順に読み出し、その値を抽出することを意味する。そして、直線と直交線の交点位置でのヒストグラムの傾きから輝度の勾配の方向を取得する。また、S401におけるエッジ画像生成時に、副次的に得られる輝度の勾配情報を用いても良い。
In S402, the document
具体的には図7(a)に示すように、直線に対し直交する方向において、左から右に走査した結果、輝度が直線の左側と比較し、直線の右側において高くなっている。この場合、直線を基準として輝度の高低により、値の高い方向を向くとして、右向きの勾配情報が取得される。具体的には、直線のベクトルから、そのベクトルに直交する直交ベクトルを求める。そして、その直交ベクトルに沿って画素値(本実施形態では輝度情報)を走査し、ヒストグラムを求める。ここで、図7(a)に示した直線の上部を始点とし、下部を終点とすると、直線のベクトルは下を向いていることとなる。この方向に基づいて画素値を走査する方向を一意とする。このヒストグラムと着目する直線に対する直交ベクトルとから、着目する直線の勾配情報(輝度の勾配)を取得する。そして、先に抽出された直線の情報と勾配情報とを対応付けて、記憶手段に保持する。勾配情報を表現するデータ構造については特に限定するものではないが、例えば直線が示すベクトルに向かって右側の画素値が高ければ“1”、左側が高ければ“0”というフラグを付与してもよい。 Specifically, as shown in FIG. 7A, as a result of scanning from left to right in a direction orthogonal to the straight line, the luminance is higher on the right side of the straight line than on the left side of the straight line. In this case, rightward gradient information is acquired assuming that the value is directed in the direction of higher value due to the level of luminance with respect to a straight line. Specifically, an orthogonal vector orthogonal to the vector is obtained from a straight vector. Then, the pixel value (luminance information in this embodiment) is scanned along the orthogonal vector to obtain a histogram. Here, if the upper part of the straight line shown in FIG. 7A is the starting point and the lower part is the ending point, the vector of the straight line is facing downward. The direction in which the pixel value is scanned is made unique based on this direction. The gradient information (luminance gradient) of the line of interest is acquired from this histogram and the orthogonal vector for the line of interest. Then, the previously extracted straight line information and gradient information are associated with each other and stored in the storage unit. The data structure that expresses the gradient information is not particularly limited. For example, a flag “1” is given if the pixel value on the right side is high toward the vector indicated by the straight line, and “0” is given if the left side is high. Good.
図7(b)に示す画像710は、画像600で図示した線分に勾配情報を付加した結果である。各線分に付随する矢印は輝度の上向き方向を示す。例えば図7(b)で示す線分611は上向きの矢印に示されている。これは、線分611の位置を基準として下から上方向へ画像の輝度が高くなっている、つまり線分611に対して上側が明るくなっていることを示す。なお、本実施形態において、勾配方向の算出において、輝度情報を用いているが、これに限定されるものではない。例えば、直線を基準として、その近傍の画素値により変化を算出できれば他の情報を用いても良い。
An
S403では、文書領域抽出部503は、S401により得られた線分の一つを処理対象線として選択する。ここでは、処理対象線分として線分611が選択されたとする。S404では、文書領域抽出部503は、未処理の線分全てに対して、S403にて選択された処理対象線分と対辺を成すかを、S402で算出した勾配情報を基に判定する。処理対象線分と対辺を成すと判定された全ての線分を対辺候補として対辺候補リストを作成する。
In step S403, the document
対辺の判定方法について、図8(a)の線分801と線分802を用いて説明する。最初に、線分801、802の座標から“内側”を求める。ここで“内側”とは、線分801の両端、線分802の両端の4点を4頂点とする四角形803を描き、四角形の内部方向を“内側”とする。次に、線分801、802の勾配情報において、勾配方向がいずれも内側へ、または外側へと向いている勾配であれば対辺候補と判定する。つまり、勾配情報としては、対辺となる線分において、逆方向の値を有することとなる。例えば、輝度の上向き方向を表す矢印804、805はそれぞれ内側を向いているため、線分801と線分802は対辺候補と判定される。なお、2線分が作る内側方向へ輝度が高くなる対辺候補を“山型対辺”、内側方向へ輝度が低くなる対辺候補を“谷型対辺”と便宜上呼ぶこととする。例えば画像800における対辺は山型対辺、画像810における対辺は谷型対辺となる。
A method for determining the opposite side will be described with reference to a
図8(b)に示す画像820は、処理対象である線分611に対して、未処理の線分、つまり線分611以外の全ての直線から対辺となり得る直線を表した図である。対辺候補として線分612、614、616、618が、いずれも谷型対辺として得られた。これらをそれぞれ、対辺種類(線分a,線分b)の命名規則を用いて、谷型対辺(611,612)、谷型対辺(611,614)、谷型対辺(611,616)、谷型対辺(611,618)と表す。なお、実際のデータ構造は、各直線の情報を対応付けて、記憶手段にて保持することとなる。もしくはテーブルを作成し、対応する直線間の情報を保持しても良い。
An
S405では、文書領域抽出部503は、S401により得られた全ての線分に対してS404の処理を行ったか否かを判定する。行っていなければS403へ戻り、他の線分に対しても処理を行う。全ての線分に対して処理が終了していればS406へ進む。すなわち、残りの未処理直線である線分612から618に関しても同様にS404で対辺候補リストを作成する。この処理の結果、谷型対辺(611,612)、谷型対辺(611,614)、谷型対辺(611,616)、谷型対辺(611,618)、山型対辺(612,613)、山型対辺(612,615)、山型対辺(612,617)、谷型対辺(613,614)、山型対辺(613,615)、山型対辺(613,617)、谷型対辺(614,616)、谷型対辺(614,618)、谷型対辺(615,616)、山型対辺(615,617)、谷型対辺(616,618)の15個の対辺候補リストが得られる。そして、全ての直線に対して処理をした後にS406へ進む。
In step S405, the document
S406では、文書領域抽出部503は、S404により得られた対辺候補を1つ処理対象として選択する。ここでは、処理対象の対辺候補として、谷型対辺(611,612)が選択されたとする。
In step S406, the document
S407では、文書領域抽出部503は、S404により得られた対辺候補リストの内、未処理の対辺候補から処理対辺候補と山谷同型の対辺候補を組み合わせて文書枠候補リストを作成する。また、処理対象対辺候補と、同じ辺を持つ対辺候補については文書枠を形成できないため、除外する。なお、2つの谷型対辺から構成される文書枠候補を“谷型枠”、2つの山型対辺から構成される文書枠候補を“山型枠”と呼ぶこととする。これらの文書枠は、いずれも四辺の勾配方向が、文書枠の内側外側を基準として、同一の向きとなっている。すなわち、山型枠は、四辺の勾配方向が全て文書枠の内側を向いており、谷型枠は、四辺の勾配方向が全て文書枠の外側を向いている。
In step S407, the document
処理対象の対辺候補である谷型対辺(611,612)に対しては、同じ谷型対辺であり、線分611、612を含まない対辺候補である、谷型対辺(613,614)、谷型対辺(614,616)、谷型対辺(614,618)、谷型対辺(615,616)、谷型対辺(616,618)が谷型枠候補として得られる。
The valley-type opposite side (611, 612) that is the opposite-side candidate to be processed is the same valley-type opposite side and is the opposite-side candidate that does not include the
これらをそれぞれ、枠種類(線分a,線分a’,線分b,線分b’)の命名規則を用いて、谷型枠(611,612,613,614)、谷型枠(611,612,614,616)、谷型枠(611,612,614,618)、谷型枠(611,612,615,616)、谷型枠(611,612,616,618)と表す。 Using the naming conventions of the frame types (line segment a, line segment a ′, line segment b, line segment b ′), these are respectively referred to as a valley frame (611, 612, 613, 614), a valley frame (611). , 612, 614, 616), a valley frame (611, 612, 614, 618), a valley frame (611, 612, 615, 616), and a valley frame (611, 612, 616, 618).
S408では、文書領域抽出部503は、S404により得られた全ての対辺候補に対して、S407の処理を行ったか否かを判定する。全ての対辺候補に対する処理が終了していなければS406へ戻り、未処理の対辺候補に対して処理を適用する。全ての対辺候補への処理が終了していればS409へ進む。
In step S408, the document
このように、残りの未処理対辺に関しても同様にS407で文書枠候補リストを作成する。この処理により谷型枠(611,612,613,614)、谷型枠(611,612,614,616)、谷型枠(611,612,614,618)、谷型枠(611,612,615,616)、谷型枠(611,612,616,618)、谷型枠(611,614,615,616)、谷型枠(611,614,616,618)、谷型枠(611,616,613,614)、谷型枠(611,618,613,614)、谷型枠(611,618,614,616)、谷型枠(613,614,615,616)、谷型枠(614,618,615,616)、山型枠(612,613,615,617)、山型枠(612,615,613,617)、山型枠(612,617,613,615)の15の文書枠候補リストが得られる。そして、全ての直線に対して処理をした後、S409へ進む。 As described above, the document frame candidate list is similarly created in S407 for the remaining unprocessed opposite sides. By this treatment, the valley form (611, 612, 613, 614), the valley form (611, 612, 614, 616), the valley form (611, 612, 614, 618), the valley form (611, 612) 615, 616), valley form (611, 612, 616, 618), valley form (611, 614, 615, 616), valley form (611, 614, 616, 618), valley form (611, 616,613,614), trough form (611,618,613,614), trough form (611,618,614,616), trough form (613,614,615,616), trough form ( 614, 618, 615, 616), mountain frame (612, 613, 615, 617), mountain frame (612, 615, 613, 617), mountain frame (612, 617, 613, 615) Document frame candidate list Obtained. Then, after processing all the straight lines, the process proceeds to S409.
S409では、文書枠候補の4線分から実際に文書枠となる四角形を算出する。直線検出で求めた線分はレンズの歪みやノイズなどの影響から、通常は実際の枠辺と同一にはならない。そのため、線分を延伸することにより4線分のそれぞれの交点を計算し、頂点とする。 In step S409, a quadrangle that actually becomes a document frame is calculated from the four line segments of the document frame candidate. The line segment obtained by the straight line detection is usually not the same as the actual frame side due to the influence of distortion and noise of the lens. Therefore, by extending the line segment, each intersection of the four line segments is calculated and set as a vertex.
例えば、以下の4つの線分について説明する。ここで、x、yはそれぞれ線分の端点のx座標、y座標を示す。 For example, the following four line segments will be described. Here, x and y indicate the x coordinate and y coordinate of the end point of the line segment, respectively.
線分A(Ax1,Ay1)−(Ax2,Ay2)
線分a(ax1,ay1)−(ax2,ay2) (線分Aの対辺)
線分B(Bx1,By1)−(Bx2,By2)
線分b(bx1,by1)−(bx2,by2) (線分Bの対辺)
上記の4線分からなる四角形の頂点は、隣接辺である線分AとB、線分Aとb、線分aとB、線分aとb、の交点を求める事でわかる。図9(a)に示す計算式900は、線分A(Ax1,Ay1)−(Ax2,Ay2)と線分B(Bx1,By1)−(Bx2,By2)との交点座標(ABx,ABy)を求める計算式である。
Line A (Ax1, Ay1)-(Ax2, Ay2)
Line segment a (ax1, ay1)-(ax2, ay2) (opposite side of line segment A)
Line segment B (Bx1, By1)-(Bx2, By2)
Line segment b (bx1, by1)-(bx2, by2) (opposite side of line segment B)
The vertices of the quadrilateral consisting of the above four line segments can be found by calculating the intersections of the adjacent line segments A and B, line segments A and b, line segments a and B, and line segments a and b. The
ここで、条件として、
(−Ay1+Ay2)*(Bx1−Bx2)−(Ax1−Ax2)*(−By1+By2)=0
であった場合は隣接辺が平行となり、解は存在しないため、文書枠候補から除外する。
Here, as a condition,
(-Ay1 + Ay2) * (Bx1-Bx2)-(Ax1-Ax2) * (-By1 + By2) = 0
If it is, the adjacent sides are parallel and there is no solution, so it is excluded from the document frame candidates.
また、画像910で示す、線分911,912,913,914から算出した4つの頂点915,916,917,918が作る四角形のように、四角形の各辺に線分が重ならない場合も候補のリストから除外する。S408で作成した14の文書枠候補リストの内、谷型枠(611,612,613,614)、谷型枠(611,612,614,616)、谷型枠(611,612,614,618)、谷型枠(611,612,615,616)、谷型枠(611,612,616,618)、谷型枠(611,614,615,616)、谷型枠(611,614,616,618)、谷型枠(611,616,613,614)、谷型枠(611,618,613,614)、谷型枠(613,614,615,616)、谷型枠(614,618,615,616)、山型枠(612,613,615,617)、山型枠(612,615,613,617)の13枠候補は含まれる四辺が文書枠を成さないため除外される。図10(a)の画像1000に示す、谷型枠(611,614,616,618)1001と山型枠(612,617,613,615)1002の2枠候補へと最終的に絞り込まれ、図4のフローチャートの全処理が完了する。なお、本フローチャートでは説明の為に対辺単位での処理を行ったが、最初から4線分を網羅的に組み合わせ、勾配情報に基づいて文書枠候補を判定しても良い。
In addition, as shown in the
図10(b)に示す画像1010は、表示部103に文書枠候補の絞り込み結果を表示した例である。オリジナル画像表示部1011は、撮影画像上に文書枠候補をオーバーレイ表示する。候補サムネイル部1012は、それぞれの文書枠候補について歪み補正した結果をサムネイルで表示する。この表示部103に表示された画像を参照して、ユーザが操作部104で選択操作を行うことにより、補正に使用する文書枠候補を決定することができる。ここでは、補正に使用する文書枠として山型枠(612,617,613,615)1002がユーザにより選択されたとする。なお、表示部103に表示する画像1010の構成は一例であり、パーソナルコンピューター上で決定しても良いし、1以上の文書枠候補全てに対して歪み補正処理をかけ、電子文書化しても良い。
An
歪み補正部504では、文書領域抽出部503で得られた文書枠の頂点情報から歪みを補正する。ここでの歪み補正とは、矩形領域を3次元的な角度をもって2次元平面に投影した場合に生成される不等辺四角形領域を、元の矩形領域へと補正する演算、いわゆる逆透視変換演算である。用いられる変換行列のパラメータについては、例えば特開2003−288588に開示されているように、逆透視変換の演算式に4頂点の座標を与える事で、得られる連立方程式を解くことにより抽出できる。その他、本発明に適用できれば、どのような手法を用いても良い。
The
電子文書生成部505では、補正した画像を電子文書506として生成し出力する。ここでは、電子文書506としてJPEG形式により出力する。なお、JPEG形式の出力は一例であり、電子デバイスの取り扱い可能な形式に応じた変換や、再利用可能な電子文書、例えばワードプロセッシング文書やプレゼンテーション文書などへ変換しても良い。
The electronic
図11(a)に示す画像1100は、実施形態1を適用した結果、出力される電子文書506の例である。対象物との傾きから台形状に歪んだ部分が、正対した長方形の状態で電子文書化される。
An
また、図11(b)の画像1110は勾配情報を用いなかった場合の例である。線分612、614、615、618からなる文書枠1111のような文書枠まで余分に検出される。この場合には、合計16通りから文書枠候補の選択をする必要がある。
Further, an
以上説明したように、本発明を適用することで、適用しない場合と比較し、好適な文書枠候補を残したまま削減することが可能となり、後段の処理の負荷を軽減することができる。 As described above, by applying the present invention, it is possible to reduce a document frame candidate while leaving a suitable document frame candidate as compared with the case where the present invention is not applied, and the processing load on the subsequent stage can be reduced.
<実施形態2>
実施形態1では、単純に全ての直線から総当たりで対辺候補の検索を行った。しかし、実際の文書画像では背景領域などから直線が多く検出されれば、その分負荷が増大する。そこで、縦方向の線分と横方向の線分を分類する方法を組み合わせることで絞り込みの処理をさらに高速化することが可能である。
<Embodiment 2>
In the first embodiment, the opposite side candidates are simply searched from all the straight lines. However, if a large number of straight lines are detected from the background area or the like in an actual document image, the load increases accordingly. Therefore, it is possible to further speed up the narrowing-down process by combining a method for classifying a vertical line segment and a horizontal line segment.
図12は本実施形態の文書領域抽出部503における文書領域抽出処理をフローチャートにより説明した図である。以下、入力される撮影画像501の例に、図2に示した画像200を用いて処理を説明する。なお、本処理フローは例えば、CPU302がRAM303や記憶部304に格納されたプログラムやデータを読み出し、実行することで実現される。S1201では、文書領域抽出部503は、直線成分を検出する。詳細な処理方法はS401と同様であるため省略する。図6(b)に示す画像610が直線検出した結果である。ここでは線分611から618まで8本の直線が検出される。S1202では、文書領域抽出部503は、直線の勾配方向を算出する。詳細な処理方法はS402と同様であるため省略する。図7(b)に示す画像710が勾配情報を付加した結果である。
FIG. 12 is a diagram illustrating a document area extraction process in the document
S1203では、文書領域抽出部503は、縦方向線及び横方向線の判定を行う。画像平面上での水平に対する線分の相対角度から、縦方向線および横方向線の判定を行う。ここでは、水平に対して相対的に0度以上45度未満、135度以上180度未満であれば横方向線、45度以上135度未満であれば縦方向線と判定する。なお、縦方向線もしくは横方向線を判定するための基準は、上記の値に限定されるものではなく、必要に応じて変更して良い。また、本発明を適用可能であれば、他の方法を用いても良い。図13に示す画像1300が縦方向線と横方向線を判定した結果である。ここでは、縦方向線を実線、横方向線を破線で表す。
In step S1203, the document
S1204では、文書領域抽出部503は、処理対象となる線分を選択する。ここでは線分611が選択されたとする。S1205では、文書領域抽出部503は、処理対象線分が縦方向線か横方向線かによる分岐処理を行う。縦方向線であればS1206へ、横方向線であればS1207へ進む。ここで、線分611は横方向線であるので、S1207へ進む。
In step S1204, the document
S1207では、文書領域抽出部503は、未処理の横方向線に対して上下対辺候補を作成する。ここでは未処理の横方向線として線分612、617、618が対象となる。対辺候補の判定自体はS404と同様であるため省略する。結果、対辺候補として612、618が、いずれも横方向の谷型対辺として得られた。これらをそれぞれ、上下谷型対辺(611,612)、上下谷型対辺(611,618)と表す。なお、上下谷型対辺、上下山型対辺は“上下対辺”であり、左右谷型対辺、左右山型対辺は“左右対辺”となる。
In step S <b> 1207, the document
S1208の終了判定に従い、線分612から618まで繰り返し処理を行う。S1204で線分613(縦方向線)が選択されたとする。S1205で縦方向線と判定され、S1206へ進む。S1206では、未処理の縦方向線として線分614、615、616を対象として左右対辺候補を作成する。処理の結果、谷型対辺候補として線分614、山型対辺候補として線分615が取得される。これらをそれぞれ、左右谷型対辺(613,614)、左右山型対辺(613,615)と表す。
In accordance with the end determination in S1208, the
同様に残りの線分に対してS1204からS1208を繰り返す。処理の結果、上下谷型対辺(611,612)、上下谷型対辺(611,618)、上下谷型対辺(617,618)、上下山型対辺(612,617)、左右谷型対辺(613,614)、左右谷型対辺(614,616)、左右谷型対辺(615,616)、左右山型対辺(613,615)の8個の対辺候補リストが作成された。全ての線分に対して処理が完了した後、S1209へ進む。 Similarly, S1204 to S1208 are repeated for the remaining line segments. As a result of processing, the upper and lower valley type opposite sides (611, 612), the upper and lower valley type opposite sides (611, 618), the upper and lower valley type opposite sides (617, 618), the upper and lower mountain type opposite sides (612, 617), and the left and right valley type opposite sides (613) 614), left and right valley-type opposite sides (614, 616), left and right valley-type opposite sides (615, 616), and left and right mountain-type opposite sides (613, 615). After the processing is completed for all the line segments, the process proceeds to S1209.
S1209では、文書領域抽出部503は、上下谷型対辺(611,612)を処理対象対辺として選択し、S1210へ進む。S1210では、文書領域抽出部503は、上下対辺か左右対辺かで処理の分岐を行う。ここで、上下谷型対辺(611,612)は“上下対辺”であるため、S1211へ進む。
In step S1209, the document
S1211では、文書領域抽出部503は、未処理の左右対辺に対して文書枠候補リストを作成する。ここでは、左右谷型対辺(613,614)、左右谷型対辺(614,616)、左右谷型対辺(615,616)、左右山型対辺(613,615)が対象となる。詳細な処理はS407と同様であるため省略する。処理の結果、左右谷型対辺(613,614)、左右谷型対辺(614,616)、左右谷型対辺(615,616)が文書枠候補として得られた。これらをそれぞれ谷型枠候補(611,612,613,614)、谷型枠候補(611,612,614,616)、谷型枠候補(611,612,615,616)と表す。
In step S <b> 1211, the document
S1213の終了判定に従い、未処理の対辺について処理を行う。S1209で左右谷型対辺(613,614)が選択されたとする。S1210で左右対辺と判断されS1212へ進む。S1212では、未処理の上下対辺に対して文書枠候補リストを作成する。ここでは、上下谷型対辺(611,618)、上下谷型対辺(617,618)、上下山型対辺(612,617)が対象となる。処理の結果、谷型枠候補(611,618,613,614)、谷型枠候補(617,618,613,614)が得られる。 In accordance with the end determination in S1213, processing is performed for the unprocessed opposite side. Assume that the left and right valley-type opposite sides (613, 614) are selected in S1209. In S1210, it is determined that the side is the opposite side, and the process proceeds to S1212. In S1212, a document frame candidate list is created for the unprocessed upper and lower opposite sides. Here, the upper and lower valley type opposite sides (611, 618), the upper and lower valley type opposite sides (617, 618), and the upper and lower mountain type opposite sides (612, 617) are targeted. As a result of the processing, valley shape frame candidates (611, 618, 613, 614) and valley shape frame candidates (617, 618, 613, 614) are obtained.
同様に残りの対辺に対してS1209からS1213を繰り返す。結果、谷型枠候補(611,612,613,614)、谷型枠候補(611,612,614,616)、谷型枠候補(611,612,615,616)、谷型枠候補(611,618,613,614)、谷型枠候補(611,618,614,616)、谷型枠候補(611,618,615,616)、谷型枠候補(617,618,613,614)、谷型枠候補(617,618,614,616)、谷型枠候補(617,618,615,616)、山型枠候補(612,617,613,615)の10個の文書枠候補リストが作成された。全ての線分に対して処理が完了した後、S1209へ進む。 Similarly, S1209 to S1213 are repeated for the remaining opposite sides. As a result, the valley form frame candidate (611, 612, 613, 614), the valley form frame candidate (611, 612, 614, 616), the valley form frame candidate (611, 612, 615, 616), the valley form frame candidate (611) , 618, 613, 614), valley-shaped frame candidates (611, 618, 614, 616), valley-shaped frame candidates (611, 618, 615, 616), valley-shaped frame candidates (617, 618, 613, 614), There are ten document frame candidate lists of valley type frame candidates (617, 618, 614, 616), valley type frame candidates (617, 618, 615, 616), and mountain type frame candidates (612, 617, 613, 615). Created. After the processing is completed for all the line segments, the process proceeds to S1209.
S1214では、文書領域抽出部503は、4線分から文書枠の頂点の算出を行う。詳細な処理はS409と同様であるため省略する。処理の結果、谷型枠(611,614,616,618)1001と山型枠(612,617,613,615)1002の2枠候補へと最終的に絞り込まれ、図12のフローチャートの全処理が完了する。歪み補正部504、電子文書生成部505の処理に関しては、実施形態1と同様であるため省略する。
In step S1214, the document
以上説明したように、実施形態1と比較して、対辺候補数が15から8へ、文書枠候補数が15から10へ、いずれも削減することができた。対辺候補作成処理時には、実施形態1では8本中2本の線分の組み合わせである28通りで探索するのに対し、実施形態2では、縦方向線4本中2本の組み合わせと、横方向線4本中2本の組み合わせとの計12通りの探索で済む。このことから、実施形態1の効果に加え、更に処理コストを削減することができる。 As described above, compared with the first embodiment, the number of opposite side candidates can be reduced from 15 to 8, and the number of candidate document frames can be reduced from 15 to 10. In the opposite side candidate creation processing, in the first embodiment, the search is performed in 28 ways that are combinations of two line segments out of eight, whereas in the second embodiment, a combination of two out of four vertical lines and a horizontal direction A total of 12 searches with combinations of 2 out of 4 lines are sufficient. Thus, in addition to the effects of the first embodiment, the processing cost can be further reduced.
<その他の実施形態>
また、本発明は、以下の処理を実行することによっても実現される。即ち、上述した実施形態の機能を実現するソフトウェア(プログラム)を、ネットワーク又は各種記憶媒体を介してシステム或いは装置に供給し、そのシステム或いは装置のコンピュータ(またはCPUやMPU等)がプログラムを読み出して実行する処理である。
<Other embodiments>
The present invention can also be realized by executing the following processing. That is, software (program) that realizes the functions of the above-described embodiments is supplied to a system or apparatus via a network or various storage media, and a computer (or CPU, MPU, or the like) of the system or apparatus reads the program. It is a process to be executed.
Claims (6)
入力された前記画像データから複数の直線成分を検出する検出手段と、
前記検出手段にて検出された前記直線成分に対する直交方向において、画素情報の高低による勾配方向を算出する算出手段と、
前記検出手段にて検出された前記複数の直線成分の中から四辺を選択し、選択された当該四辺からなる枠候補を1以上抽出する抽出手段と、
前記抽出手段にて抽出された前記枠候補のうち、当該枠候補の四辺における勾配方向が当該枠の内側もしくは外側のいずれかの方向に対して同一の向きとならない枠候補を、前記抽出手段で抽出された前記枠候補から除く絞り込み手段と
を有する画像処理装置。 An image processing apparatus for extracting a frame composed of four sides of the rectangular area from image data obtained by photographing a subject having a rectangular area ,
Detecting means for detecting a plurality of linear components from the input image data;
Calculating means for calculating a gradient direction according to the level of pixel information in a direction orthogonal to the linear component detected by the detecting means;
An extraction unit that selects four sides from the plurality of linear components detected by the detection unit, and extracts one or more frame candidates including the selected four sides;
Among the frame candidate extracted by the extraction means, a frame candidate gradient direction of four sides of the frame candidate is not the same orientation with respect to either direction of the inside or outside of the frame, by the extraction means An image processing apparatus comprising: a narrowing-down unit that excludes from the extracted frame candidates.
前記直線成分を、入力された前記画像データに対する相対的な傾きから、枠における、上下の辺となる横方向線と、左右の辺となる縦方向線に分類する分類手段と、
ある縦方向線と逆方向の勾配方向を有する他の縦方向線とを左右対辺とし、ある横方向線と逆方向の勾配方向を有する他の横方向線とを上下対辺として選択する選択手段と
を更に有し、
前記上下対辺と前記左右対辺とを組み合わせることにより、四辺からなる前記枠候補として抽出することを特徴とする請求項1に記載の画像処理装置。 The extraction means includes
Classifying means for classifying the linear component into a horizontal line as upper and lower sides and a vertical line as left and right sides in a frame from a relative inclination with respect to the input image data;
Selection means for selecting a certain vertical direction line and another vertical direction line having a reverse gradient direction as left and right opposite sides, and selecting a certain horizontal direction line and another horizontal direction line having a reverse gradient direction as upper and lower opposite sides Further comprising
The image processing apparatus according to claim 1, wherein the frame candidate is extracted from the four sides by combining the upper and lower opposite sides and the left and right opposite sides.
前記画像処理装置の検出手段が、入力された前記画像データから複数の直線成分を検出する検出工程と、
前記画像処理装置の算出手段が、前記検出工程において検出された前記直線成分に対する直交方向において、画素情報の高低による勾配方向を算出する算出工程と、
前記画像処理装置の抽出手段が、前記検出工程において検出された前記複数の直線成分の中から四辺を選択し、選択された当該四辺からなる枠候補を1以上抽出する抽出工程と、
前記画像処理装置の絞り込み手段が、前記抽出工程において抽出された前記枠候補のうち、当該枠候補の四辺における勾配方向が当該枠の内側もしくは外側のいずれかの方向に対して同一の向きとならない枠候補を、前記抽出工程にて抽出された前記枠候補から除く絞り込み工程と
を有する制御方法。 A control method of an image processing apparatus for extracting a frame composed of four sides of the rectangular area from image data obtained by photographing a subject having a rectangular area ,
A detecting step in which the detecting means of the image processing device detects a plurality of linear components from the input image data;
A calculation step in which the calculation means of the image processing device calculates a gradient direction according to the level of pixel information in a direction orthogonal to the linear component detected in the detection step;
An extraction step in which the extraction means of the image processing device selects four sides from the plurality of linear components detected in the detection step, and extracts one or more frame candidates composed of the selected four sides;
Narrowing means of said image processing apparatus, of the frame candidates extracted in the extraction step, not the same orientation with respect to either direction of the inside or outside of the gradient direction in the four sides of the frame candidate the frame And a narrowing-down step of removing frame candidates from the frame candidates extracted in the extraction step .
入力された画像データから複数の直線成分を検出する検出手段、
前記検出手段にて検出された前記直線成分に対する直交方向において、画素情報の高低による勾配方向を算出する算出手段、
前記検出手段にて検出された前記複数の直線成分の中から四辺を選択し、選択された当該四辺からなる枠候補を1以上抽出する抽出手段、
前記抽出手段にて抽出された前記枠候補のうち、当該枠候補の四辺における勾配方向が当該枠の内側もしくは外側のいずれかの方向に対して同一の向きとならない枠候補を、前記抽出手段で抽出された前記枠候補から除く絞り込み手段
として機能させるためのプログラム。 Computer
Detecting means for detecting a plurality of linear components from the input image data;
Calculating means for calculating a gradient direction according to the level of pixel information in a direction orthogonal to the linear component detected by the detecting means;
An extraction unit that selects four sides from the plurality of linear components detected by the detection unit and extracts one or more frame candidates including the selected four sides;
Among the frame candidate extracted by the extraction means, a frame candidate gradient direction of four sides of the frame candidate is not the same orientation with respect to either direction of the inside or outside of the frame, by the extraction means A program for functioning as a narrowing-down means to be excluded from the extracted frame candidates.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2010150264A JP5563390B2 (en) | 2010-06-30 | 2010-06-30 | Image processing apparatus, control method therefor, and program |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2010150264A JP5563390B2 (en) | 2010-06-30 | 2010-06-30 | Image processing apparatus, control method therefor, and program |
Publications (3)
Publication Number | Publication Date |
---|---|
JP2012014430A JP2012014430A (en) | 2012-01-19 |
JP2012014430A5 JP2012014430A5 (en) | 2013-08-08 |
JP5563390B2 true JP5563390B2 (en) | 2014-07-30 |
Family
ID=45600780
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP2010150264A Active JP5563390B2 (en) | 2010-06-30 | 2010-06-30 | Image processing apparatus, control method therefor, and program |
Country Status (1)
Country | Link |
---|---|
JP (1) | JP5563390B2 (en) |
Families Citing this family (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP5898596B2 (en) * | 2012-09-07 | 2016-04-06 | 京セラ株式会社 | Electronic device, control method and program |
JP2014092899A (en) | 2012-11-02 | 2014-05-19 | Fuji Xerox Co Ltd | Image processing apparatus and image processing program |
Family Cites Families (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2951814B2 (en) * | 1993-02-25 | 1999-09-20 | 富士通株式会社 | Image extraction method |
JP3420864B2 (en) * | 1995-08-09 | 2003-06-30 | 富士通株式会社 | Frame extraction device and rectangle extraction device |
US7496229B2 (en) * | 2004-02-17 | 2009-02-24 | Microsoft Corp. | System and method for visual echo cancellation in a projector-camera-whiteboard system |
JP2006107034A (en) * | 2004-10-04 | 2006-04-20 | Konica Minolta Photo Imaging Inc | Method and apparatus for image analysis, method and system for image processing, and operation program therefor |
JP4525519B2 (en) * | 2005-08-18 | 2010-08-18 | 日本電信電話株式会社 | Quadrilateral evaluation method, apparatus and program |
JP5160366B2 (en) * | 2008-10-10 | 2013-03-13 | Juki株式会社 | Pattern matching method for electronic parts |
-
2010
- 2010-06-30 JP JP2010150264A patent/JP5563390B2/en active Active
Also Published As
Publication number | Publication date |
---|---|
JP2012014430A (en) | 2012-01-19 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
KR101333871B1 (en) | Method and arrangement for multi-camera calibration | |
KR101399709B1 (en) | Model-based dewarping method and apparatus | |
EP1901228B1 (en) | Apparatus, method and program for image matching | |
JP4630936B1 (en) | Image processing apparatus, image processing method, image processing program, and recording medium recording image processing program | |
JP6688277B2 (en) | Program, learning processing method, learning model, data structure, learning device, and object recognition device | |
US8619098B2 (en) | Methods and apparatuses for generating co-salient thumbnails for digital images | |
JP5972498B2 (en) | Edge detection apparatus, edge detection method and program | |
RU2631765C1 (en) | Method and system of correcting perspective distortions in images occupying double-page spread | |
WO2012172817A1 (en) | Image stabilization apparatus, image stabilization method, and document | |
JP2010287174A (en) | Furniture simulation method, device, program, recording medium | |
JP5541679B2 (en) | Image processing apparatus and method, and program | |
US20220136979A1 (en) | Information processing apparatus, information processing method, and non- transitory computer-readable storage medium | |
WO2012029658A1 (en) | Imaging device, image-processing device, image-processing method, and image-processing program | |
JP5563390B2 (en) | Image processing apparatus, control method therefor, and program | |
JP5618719B2 (en) | Image processing apparatus, method and program thereof | |
JP2009146150A (en) | Method and device for detecting feature position | |
JP7118729B2 (en) | Information processing device, information processing method and program | |
Liang et al. | Mosaicing of camera-captured document images | |
KR101524074B1 (en) | Method for Image Processing | |
JP2018010359A (en) | Information processor, information processing method, and program | |
CN113920525A (en) | Text correction method, device, equipment and storage medium | |
JP2011170554A (en) | Object recognition device, object recognition method, and object recognition program | |
JP7221919B2 (en) | Information processing device, information processing method and information processing program | |
JP6613625B2 (en) | Image processing program, image processing apparatus, and image processing method | |
JP6077873B2 (en) | Image processing apparatus and image processing method |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
A521 | Request for written amendment filed |
Free format text: JAPANESE INTERMEDIATE CODE: A523 Effective date: 20130626 |
|
A621 | Written request for application examination |
Free format text: JAPANESE INTERMEDIATE CODE: A621 Effective date: 20130626 |
|
A977 | Report on retrieval |
Free format text: JAPANESE INTERMEDIATE CODE: A971007 Effective date: 20140227 |
|
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: 20140516 |
|
A61 | First payment of annual fees (during grant procedure) |
Free format text: JAPANESE INTERMEDIATE CODE: A61 Effective date: 20140612 |
|
R151 | Written notification of patent or utility model registration |
Ref document number: 5563390 Country of ref document: JP Free format text: JAPANESE INTERMEDIATE CODE: R151 |