JP2012022577A - Image processing apparatus, control method, and computer program - Google Patents
Image processing apparatus, control method, and computer program Download PDFInfo
- Publication number
- JP2012022577A JP2012022577A JP2010161040A JP2010161040A JP2012022577A JP 2012022577 A JP2012022577 A JP 2012022577A JP 2010161040 A JP2010161040 A JP 2010161040A JP 2010161040 A JP2010161040 A JP 2010161040A JP 2012022577 A JP2012022577 A JP 2012022577A
- Authority
- JP
- Japan
- Prior art keywords
- document
- document area
- search range
- character
- pixel
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Withdrawn
Links
Images
Landscapes
- Character Input (AREA)
- Image Analysis (AREA)
Abstract
Description
本発明は、デジタルカメラなどで撮影された自然画中の文書の領域を抽出する技術に関する。 The present invention relates to a technique for extracting a region of a document in a natural image shot with a digital camera or the like.
近年、ネットワークの広がりにより、文書が電子的に配布される機会も増え、それに伴い紙の文書をスキャンにより電子文書化して配布可能とする技術が普及している。しかし、掲示されているポスターや、会議で用いたホワイトボード、サイズの大きな模造紙など、スキャンすることが困難な文書が存在する。そこで、カメラで撮影した画像を電子文書化する技術が考えられている。その場合、カメラと被写文書との位置関係により、得られる画像に台形状の歪みが生じるため、歪みを補正する技術が必要となる。 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 documents that are difficult to scan, such as posted posters, whiteboards used in meetings, and large-size imitation paper. In view of this, a technique for electronically documenting images taken with a camera has been considered. In that case, a trapezoidal distortion occurs in the obtained image due to the positional relationship between the camera and the document to be copied, and thus a technique for correcting the distortion is required.
例えば、色差からエッジを取得し、一定以上の長さの線分を文書枠として検出し、歪みを補正する技術がある(特許文献1参照)。この技術を用いれば撮影画像中から文書を検出して歪みを補正することが可能となる。また、台座上にある文書を撮影した場合に、検出した線分候補の撮影画像平面上の相対位置から隣接辺を求めていく技術がある(特許文献2)。また、撮影した文書に、他のオブジェクトに隠れて文書の端を抽出できない場合において、原稿端を推定する技術もある。まず、入力画像からエッジを抽出し、原稿端のおおよその位置を検出する。文書全体の色情報から生成したヒストグラムのピーク値から下地色候補および背景色候補を推定し、推定された下地色候補および背景色候補から最終的な原稿端を求めている(特許文献3)。 For example, there is a technique for 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). By using this technique, it is possible to detect a document from a captured image and correct distortion. Further, there is a technique for obtaining an adjacent side from a relative position on a captured image plane of a detected line segment candidate when a document on a pedestal is captured (Patent Document 2). There is also a technique for estimating the edge of a document when the edge of the document cannot be extracted because it is hidden behind another object in the photographed document. First, an edge is extracted from the input image, and the approximate position of the document edge is detected. Background color candidates and background color candidates are estimated from the peak values of the histogram generated from the color information of the entire document, and the final document edge is obtained from the estimated background color candidates and background color candidates (Patent Document 3).
文書をカメラにより撮影した場合、対象とカメラを正確に正対させるのが困難であるため、撮影画像中の文書には3次元的な傾きにより、台形状の歪みが生じる。そのため撮影画像中から文書を読みやすい形で抽出する為には、文書の枠を正確に抽出する必要がある。枠を抽出する方法に、ハフ変換などを用いて直線成分を検出し、4直線から枠を推定する方法がある。 When a document is photographed with a camera, it is difficult to accurately face the object and the camera, so that the document in the photographed image has a trapezoidal distortion due to a three-dimensional tilt. Therefore, in order to extract a document from a captured image in a form that is easy to read, it is necessary to accurately extract the frame of the document. As a method of extracting a frame, there is a method of detecting a straight line component using Hough transform or the like and estimating a frame from four straight lines.
しかし、文書の背景によっては、直線が多数抽出される。特に、図3のような、文書領域301および文書領域302の下地色と画像300全体の背景が近似している場合、文書領域端のエッジを出すにはかなりの弱エッジまで検出し、枠を推定しなければならない。また、自然画中には複数の文書が映りこむこともある。このため、枠を構成する直線の組み合わせ候補数が増大し、正しい文書枠の推定が困難となる問題があった。
However, many straight lines are extracted depending on the background of the document. In particular, when the background color of the
また、一般的な領域分割を行い文字領域だけを抽出しても、図4のように本来の文書領域より小さい領域しか抽出できない。このため、文書領域を本来の大きさ通りに抽出できない。さらに、同一であるべき文書が文字領域単位で分断されてしまい、ユーザの意図にかなった文書領域の抽出ができない問題があった。 Further, even if a general area division is performed and only a character area is extracted, only an area smaller than the original document area can be extracted as shown in FIG. For this reason, the document area cannot be extracted with the original size. Furthermore, the document that should be the same is divided in character area units, and there is a problem that it is not possible to extract the document area in accordance with the user's intention.
上記課題を解決するために、本願発明は以下の構成を有する。文書領域を有する画像データから前記文書領域を抽出する画像処理装置であって、入力された画像データから前記文書領域を構成する文字の文字領域を抽出する文字領域抽出手段と、抽出された前記文字領域の位置を基準として、文書領域端となる文書領域端画素を探索する第一の探索範囲を決定する第一の探索範囲決定手段と、前記第一の探索範囲から前記文書領域端画素を抽出する文書領域端画素抽出手段と、抽出された前記文書領域端画素の位置を基準として、文書領域端となる文書領域端線を探索する第二の探索範囲を決定する第二の探索範囲決定手段と、前記第二の探索範囲から前記文書領域端線を抽出する文書領域端線抽出手段と、前記文書領域端線から前記文書領域を確定する文書領域確定手段とを有する。 In order to solve the above problems, the present invention has the following configuration. An image processing apparatus for extracting the document area from image data having a document area, wherein the character area extracting unit extracts a character area of characters constituting the document area from input image data, and the extracted character First search range determination means for determining a first search range for searching for a document region end pixel serving as a document region end with reference to the position of the region, and extracting the document region end pixel from the first search range And a second search range determining means for determining a second search range for searching for a document area end line serving as a document area end with reference to the position of the extracted document area end pixel. And document area end line extracting means for extracting the document area end line from the second search range, and document area determining means for determining the document area from the document area end line.
ひとつの自然画に背景との境界がはっきりしない文書領域が複数存在しても、文書領域と背景の正しい境界線を推定でき、本来の大きさ通りの文書領域の抽出が可能になる。 Even if there are a plurality of document areas in which the boundary between the background and the background is not clear in one natural image, the correct boundary line between the document area and the background can be estimated, and the document area can be extracted with the original size.
<第一の実施形態>
図1は本発明の実施形態を実施するためのシステム構成例である。CPU101は、システム全体を制御し、各処理が定義された実行プログラムを実行する。RAM(Random Access Memory)102では、処理プログラムや入出力データが展開されて処理される。記憶装置103は、処理対象となる画像データや処理済の電子ファイルを記憶する。入力装置104は、処理データを外部から入力するために用いられる。出力装置105は、処理データを外部に出力するために用いられる。
<First embodiment>
FIG. 1 shows an example of a system configuration for carrying out an embodiment of the present invention. The
デジタルカメラなどの入力装置104から入力された画像データは、ハードディスクなどの記憶装置103に入力データ1032として記憶される。記憶装置103に記憶されている処理プログラム1031はRAM102上の処理プログラム展開領域1021に展開され、CPU101によって実行される。処理プログラムは入力データを記憶装置103から呼び出し、RAM102上の入力データ領域1022を展開する。処理プログラムは入力データに対して処理を施し、RAM102上の出力データ領域1023に処理結果を出力し、記憶装置103に出力データ1033として保存する。出力データ1033は必要に応じてディスプレイやプリンタなどの出力装置105に出力される。
Image data input from an
[処理フロー]
図2は本発明の第一の実施形態におけるフローチャートである。図2を元に処理手順の詳細を説明する。S201では、入力画像の判定を行う。画像判定方法は、入力画像中に文字が存在するかどうかで自然画像と文字有り画像に分類する。画像データから文字を抽出する方法に関しては、例えば特開2002−042055号公報「カラー文書からの文字認識方法」などを用いて抽出することができる。なお、この手法に限定するものではなく、本発明が適用可能であれば、他の画像判定方法を用いても良い。ここで、文字領域とは、1以上の文字を含む領域を指し、文字を含む矩形となる。また、文書領域とは、1以上の文字領域を含む領域を指し、画像によっては当該画像を撮影した角度などの影響により台形状となる歪みが生じているものが含まれる。
[Processing flow]
FIG. 2 is a flowchart in the first embodiment of the present invention. Details of the processing procedure will be described with reference to FIG. In S201, the input image is determined. The image determination method classifies a natural image and an image with characters depending on whether characters exist in the input image. Regarding a method for extracting characters from image data, for example, Japanese Patent Laid-Open No. 2002-042055 “Character recognition method from color document” can be used. Note that the present invention is not limited to this method, and other image determination methods may be used as long as the present invention is applicable. Here, the character area refers to an area including one or more characters and is a rectangle including characters. The document area refers to an area including one or more character areas, and some images include a trapezoidal distortion due to an influence of an angle at which the image is captured.
画像データ中に文字が存在する場合にはS202以降の処理を行う。また、画像データ中に文字が存在しない場合(自然画像の場合)は処理を終了する。S202では、画像データ中の文字を含む領域である文書領域を抽出する。S202の詳細な機能構成を図5に示す。画像501はS201で文字有り画像と判定された画像である。本実施形態では文字有り画像の例を図3の画像300とし、画像300が入力されたとして以降の処理の詳細を説明する。
If there is a character in the image data, the processing from S202 is performed. If no character is present in the image data (in the case of a natural image), the process is terminated. In S202, a document area that is an area including characters in the image data is extracted. A detailed functional configuration of S202 is shown in FIG. An
カラー入力として画像300には、“ABC”と書き込まれた文書領域301および、“There are some words in this paper”と書き込まれた文書領域302が存在している。ここでの文書領域の例として、具体的には紙のメモなどが想定されうる。文書領域301および文書領域302はこれら2つの背景色と類似した色のテーブルに置かれ、文書領域とテーブルとの境界ははっきりしていない。
As the color input, the
文字領域抽出部502は、入力画像を領域分割し、文字領域の抽出を行う。文字領域抽出部502には画像501が入力される。領域分割処理の具体例としては、USP5680478号公報記載の処理などがある。上例では文書画像中の黒画素連結成分、白画素成分の集合を抽出し、その形状、大きさ、集合状態等から、文字、絵や図、表、枠、線といった特徴的な領域を抽出している。本実施形態では、画像300を公知の二値化技術で二値画像を生成し、領域分割を行う。
A character
図4は画像300を属性ごとに領域分割した結果を表した図である。この結果では、文字領域401,402,403が領域として分割されている。文字領域抽出部502の出力は、文字領域、すなわち文字に該当する画素連結成分および文字画素連結成分の外接矩形である。抽出された文字領域は、文書領域端画素抽出部503に引き渡される。
FIG. 4 is a diagram showing the result of dividing the
文書領域端画素抽出部503では、文書領域と背景の境界の画素となりうる文書領域端画素を検出する。文書領域端画素抽出部503は、第一の探索範囲決定部504と濃度変化点抽出部505からなる。また、文書領域端画素抽出部503の入力は画像501および、文字領域抽出部502で出力された文字領域となる。
The document area edge
[第一の探索範囲決定]
まず、第一の探索範囲決定部504において、画像501において文書領域端画素を探索する範囲を決定する。文書領域端画素を探索する範囲は、文字領域の内部の走査開始点(始点)から放射状に引いた線分とする。ここで、一般的な画像処理における走査は画像をすべて走査するZスキャン、もしくはラインスキャンを指す。本実施形態では走査方向を放射状とすることで探索対象となる画素は画像全体をスキャンするよりも少なくなり、処理量が低減できる。さらに、単純な縦横方向の走査だけよりも文書領域端画素を多く獲得できるため、より文書領域の推定がしやすくなる。また、走査開始点を文字領域の内点にすることで、走査開始時の対象画素が確実に文書領域上にあり、文書領域と背景の微小な濃度変化を抽出しやすくなる利点がある。
[First search range determination]
First, the first search
本実施形態では走査開始点を文字領域の外接矩形の中心とし、探索範囲をこの中心点から45度刻みの8方向に走査した線分とする。なお、探索する走査線の開始点は文字領域の外接矩形の内側であればどこでもよい。また、走査終了点を画像端、もしくは、他の文字領域の外接矩形と交差する画素までとする。 In this embodiment, the scanning start point is the center of the circumscribed rectangle of the character area, and the search range is a line segment scanned in 8 directions in 45 degree increments from this center point. Note that the starting point of the scanning line to be searched may be anywhere inside the circumscribed rectangle of the character area. Further, the scanning end point is set to the edge of the image or a pixel that intersects a circumscribed rectangle of another character area.
図6は文書領域301に含まれる文字領域401を基準とした第一の探索範囲を示している。走査線601〜608は第一の探索範囲となる走査線を示す。走査線601〜604、および、走査線606〜608の走査終了点は画像データ端であり、走査線605の走査終了点は画像データ中の異なる文字領域である文字領域402の外接矩形と交差する画素までとなる。
FIG. 6 shows a first search range based on the
本実施形態では先に文書領域端画素を探索する走査線をすべて確定させたのち、次工程を行う濃度変化点抽出部505へ遷移する。しかし、1本の探索範囲が確定したら直ちに濃度変化点抽出部505に遷移し、濃度変化点を抽出後に他の未処理の探索範囲の決定するように繰り返しても良い。
In this embodiment, after all the scanning lines for searching the document region end pixel are first determined, the process proceeds to the density change
以上、文字領域401の文書領域を抽出するにあたり、8本の走査線601〜608に対し、文書領域端画素を探索するものとして説明を続ける。
As described above, in extracting the document area of the
[濃度変化点抽出]
濃度変化点抽出部505では、決定された第一の探索範囲となる入力画像中の走査線上の濃度変化点を抽出する。濃度変化点抽出部505について、図7のフローを用いて詳細を説明する。濃度変化点抽出部505では、文書領域の下地色を決定し、下地色と走査線上の画素の濃度変化を参照することで、対象画素が文書領域端画素かを判定する。
[Density change point extraction]
The density change
まず、S5051にて、走査開始点となる画素に近接する文字画素連結成分を文字領域から取得し、S5052に遷移する。S5052では、文書領域における下地色決定を行う。具体的には取得した文字画素連結成分の周辺画素を入力された画像501から取得し、文字周辺画素の色情報(画素値)の平均値を算出する。そして算出した色情報を文書下地色として記憶し、S5053へ遷移する。
First, in S5051, a character pixel connected component close to the pixel that becomes the scanning start point is acquired from the character region, and the process proceeds to S5052. In step S5052, the background color in the document area is determined. Specifically, the peripheral pixels of the acquired character pixel connected component are acquired from the
S5053では、先に決定した探索範囲の走査線を取得し、S5054へ遷移する。S5054では、走査線上の一画素を濃度変化点判定の対象画素とし、S5055へ遷移する。S5055では、文字画素を濃度変化判定から除外する。この処理は、濃度変化が明らかに大きいと想定される文字そのものの画素を除外し、背景と文書下地色の濃度変化点抽出の精度を上げることを目的としている。具体的には、対象画素が文字領域中の文字連結画素に該当するかを判定し、YESならばS5058、NOならばS5056へ遷移する。 In S5053, the scanning line of the previously determined search range is acquired, and the process proceeds to S5054. In S5054, one pixel on the scanning line is set as a target pixel for density change point determination, and the process proceeds to S5055. In S5055, the character pixel is excluded from the density change determination. The purpose of this processing is to eliminate the pixels of the character itself that is assumed to have a clearly large density change, and to improve the accuracy of extracting density change points of the background and document background color. Specifically, it is determined whether the target pixel corresponds to a character connection pixel in the character area. If YES, the process proceeds to S5058, and if NO, the process proceeds to S5056.
S5056では、文書領域端画素を判定する。具体的には、対象画素の色情報と先に求めた文書下地色との差分を求め、差が閾値より大きいかを判定し、YESならS5057へ、NOならS5058へ遷移する。なお、文書領域端画素判定を行う際の色(画素値)の差分の算出にはマンハッタン距離などを用いることが可能である。S5057では、対象画素を濃度変化点とし、この文字領域における文書領域端画素として関連付けて記憶し、S50510へ遷移する。 In step S5056, the document area end pixel is determined. Specifically, the difference between the color information of the target pixel and the previously obtained document background color is obtained, and it is determined whether the difference is larger than the threshold. If YES, the process proceeds to S5057, and if NO, the process proceeds to S5058. Note that a Manhattan distance or the like can be used to calculate a color (pixel value) difference when performing document region edge pixel determination. In step S5057, the target pixel is set as a density change point, and is stored in association with the document region end pixel in the character region, and the flow advances to step S50510.
S5058では、走査線方向へ1画素分だけ進め、S5059へ遷移する。S5059では、この画素が探索範囲内か否かを判定する。具体的にはこの画素が画像端、もしくは、他の文字領域の外接矩形との交点かを判定し、YESであればS5054へ、NOであればS50510へ遷移する。S50510では、まだ走査していない探索走査線があるかを判定し、YESであればS5053へ、NOであればこの文字領域に対する濃度変化点抽出を終了する。 In step S5058, the scanning line direction is advanced by one pixel, and the flow advances to step S5059. In S5059, it is determined whether this pixel is within the search range. Specifically, it is determined whether this pixel is an image edge or an intersection with a circumscribed rectangle of another character area. If YES, the process proceeds to S5054, and if NO, the process proceeds to S50510. In S50510, it is determined whether there is a search scanning line that has not been scanned yet. If YES, the process proceeds to S5053, and if NO, the density change point extraction for this character area is terminated.
文字領域401の処理結果を図8に示す。文字領域401の濃度変化点、すなわち、文書領域端画素701〜708が得られる。文書領域端画素抽出部503はひとつの文字領域に関連付けられた文書領域端画素を出力し、文書領域端線抽出部506に引き渡される。
The processing result of the
文書領域端線抽出部506は、文書と背景の境界の線となりうる文書領域端線を検出する。文書領域端線抽出部506は、第二の探索範囲決定部507とエッジ抽出部508からなる。また、文書領域端線抽出部506の入力は、画像501および、文書領域端画素抽出部503で出力された文字領域に関連付けられた文書領域端画素となる。
The document area end
[第二の探索範囲決定]
まず、第二の探索範囲決定部507において、入力される画像501における文書領域端線を探索する範囲を決定する。文書領域端線を探索する範囲は、文書領域端画素を中心とした小矩形とする。小矩形の大きさの設定は、まず、小矩形の所定のサイズとして上限のサイズをあらかじめ定めておく。上限サイズの小矩形に文字連結成分が含まれるようであれば小矩形の大きさを縮小し、調整する。文書領域端線の抽出範囲を文書領域端画素が中心の小領域にすることで、ノイズとなる他の余計なエッジを発生させずに文書領域と背景色の微小な濃度変化点の抽出ができる利点がある。
[Second search range determination]
First, the second search
図9は文字領域401に対する、抽出された文書領域端画素を基準とした第二の探索範囲をそれぞれ示している。小矩形801〜808は、抽出された文書領域端画素それぞれに対する探索範囲の小矩形を示している。本実施形態では先に文書領域端線を探索する小矩形をすべて確定させたのち、次工程を行うエッジ抽出部508へ遷移する。しかし、1つの探索範囲が確定したら直ちにエッジ抽出部508に遷移し、エッジ抽出後に他の探索範囲の決定を繰り返してもよい。
FIG. 9 shows a second search range with respect to the
以上、文書領域301の文書領域を抽出するにあたり、8個の小矩形801〜808に対し、文書領域端線を探索するものとして説明を続ける。
As described above, in extracting the document area of the
[エッジ抽出]
エッジ抽出部508では、決定された第二の探索範囲となる入力画像中の小矩形内部の弱エッジを抽出する。弱エッジの検出は、公知の手法を用いて次のように行うことができる。すなわち、SobelフィルタやLaplacianフィルタなどを用いたエッジ強調手法により、入力画像中の文書の境界部分に該当する画素を際立たせる。
[Edge Extraction]
The
図10は文書領域301の弱エッジ、すなわち、文書領域端線を示している。文書領域端線抽出部506はひとつの文字領域に関連付けられた文書領域端線を出力し、文書領域確定部509に引き渡される。
FIG. 10 shows a weak edge of the
[文書領域確定]
文書領域確定部509では、文書領域端線を用い、文書領域を確定する。文書領域端線にハフ変換や最小近似法などの公知の直線抽出法を用いることで、直線を検出することが可能である。第二の探索範囲のみのエッジ情報であれば、同じ入力画像中にある他の文字領域のエッジ情報も混在しないため、文書領域の境界を決定する直線の組み合わせを決定するための計算量を大幅に低減できる利点がある。図11は文書領域端線から推定される直線を示す。ここから閉じた矩形を検出し、文書領域と確定する。図12は上記処理により抽出された、文字領域401に対する文書領域1001を示している。これは、入力された画像300における文書領域301に対応する。
[Confirm document area]
The document
以上、図2のS202における文書領域抽出の処理を説明した。なお、これらの処理は入力画像に存在する文字領域をひとつずつ文書領域情報の出力まで実行しても良いし、各機能に入力画像に存在する文字領域すべてを処理してから次の機能に遷移しても良い。 The document area extraction process in S202 of FIG. 2 has been described above. These processes may be executed one by one for each character area existing in the input image until the output of the document area information, or after each character area existing in the input image is processed for each function, the process proceeds to the next function. You may do it.
抽出した文書領域はS203において、入力画像から切り出され、逆透視変換などの歪み補正を行い、S204へ遷移する。S204では補正された文書領域を電子ファイルに変換する。図13(a)は文字領域401に対する文書領域1001を歪み補正し電子ファイル化した例である。
The extracted document area is cut out from the input image in S203, distortion correction such as reverse perspective transformation is performed, and the process proceeds to S204. In step S204, the corrected document area is converted into an electronic file. FIG. 13A shows an example in which the
以上、説明したとおり、本実施形態ではひとつの自然画に背景との境界がはっきりしない文書が含まれる場合に対して、画像端の探索範囲を限定することにより、他の余計なノイズの発生を抑えることができる。そのため、自然画と背景がはっきりしない境界を抽出するための弱いエッジを抽出することが可能となる。また、文書端線の組み合わせ数を減らせるため、計算量の低減が可能となる。さらに、文字領域と文書端線を対応させて文書境界を算出するため、自然画中に複数の文書がある場合においても、文書領域の抽出が可能となる。 As described above, in the present embodiment, in the case where a single natural image includes a document whose boundary with the background is not clear, by limiting the search range of the image edge, other extra noise is generated. Can be suppressed. Therefore, it is possible to extract a weak edge for extracting a boundary where the natural image and the background are not clear. Further, since the number of combinations of document edge lines can be reduced, the amount of calculation can be reduced. Furthermore, since the document boundary is calculated by associating the character area with the document end line, the document area can be extracted even when there are a plurality of documents in the natural image.
<第二の実施形態>
第一の実施形態では、一つの文書領域に対し、文字領域がひとつある例について説明した。本実施形態では図4の文字領域402,403のように、ひとつの文書領域に対し、文字領域が複数に分かれてしまった場合の文書領域確定部の機能について説明する。
<Second Embodiment>
In the first embodiment, an example in which there is one character area for one document area has been described. In the present embodiment, the function of the document area determination unit when a single character area is divided into a plurality of character areas as in the
図2のS202の詳細な機能構成を図14に示す。なお、図5の番号と同じ機能ブロックは第一の実施形態と同じであるため説明を省く。図14の文字領域統合部5011は、第一の探索範囲である走査線と文書領域端画素の関係から文字領域を統合する。文字領域統合部5011の入力は、文書領域端画素抽出部503で出力した文字領域とそれに関連付けられた文書領域端画素、および第一の探索範囲である走査線のそれぞれの走査終点情報を用いる。
FIG. 14 shows a detailed functional configuration of S202 in FIG. The functional blocks that are the same as the numbers in FIG. 5 are the same as those in the first embodiment, and will not be described. The character
[文字領域統合処理]
文字領域統合部5011の詳細なフローを図15に示す。文字領域統合部5011では、走査線の終点と、その走査線上に境界となる文書領域端画素があるかを判定し、2つの文字領域が同じ文書領域に含まれるか否かを判定する。第一の走査範囲である走査線の終点が画像そのものの端であれば統合する対象となる文字領域は存在しない。
[Character area integration processing]
A detailed flow of the character
また、第一の走査範囲の走査線の終点が他の文字領域であれば、この2つの文字領域は同じ文書領域上にある可能性がある。従って、2つの文字領域の間に位置づく走査線上に文書領域端画素が存在すれば、そこに文書としての境界が存在するので統合対象でないと判定できる。以上のことから、文書領域統合の条件は、“走査線の終点が他の文字領域”であり、かつ、“終点が他の文字領域である走査線上に文書領域端画素が存在しない”場合となる。 If the end point of the scanning line in the first scanning range is another character area, the two character areas may be on the same document area. Accordingly, if there is a document area edge pixel on the scanning line located between the two character areas, it can be determined that the document is not an integration target because there is a boundary as a document. From the above, the document area integration condition is that “the end point of the scan line is another character area” and “the end pixel of the document area is not present on the scan line whose end point is another character area”. Become.
S1101では入力された文字領域に対し、文書領域端画素が抽出されなかった走査線があるか否かを判定する。S1101にてYESであればS1102へ、NOであれば本処理フローの終了へ遷移する。S1102では、文書領域端画素が抽出されなかった走査線の終点が他の文字領域であるか否かを判定し、YESならS1103、NOなら本処理フローの終了へ遷移する。 In step S <b> 1101, it is determined whether there is a scanning line from which the document area end pixel has not been extracted for the input character area. If YES in S1101, the process proceeds to S1102, and if NO, the process flow ends. In S1102, it is determined whether or not the end point of the scanning line from which the document area end pixel has not been extracted is another character area. If YES, the process proceeds to S1103, and if NO, the process flow ends.
S1103、S1104では、同一の文書領域上にあると判定された文字領域および文字領域に関連付けられた文書領域端画素を統合し、本処理フローを終了する。なお、S1101およびS1102の順番が入れ替わっても統合条件は満たされるため、S1101およびS1102の順番はどちらが先でも構わない。 In S1103 and S1104, the character area determined to be on the same document area and the document area end pixels associated with the character area are integrated, and this processing flow ends. Note that, since the integration condition is satisfied even if the order of S1101 and S1102 is switched, whichever of the order of S1101 and S1102 may be used.
図16は文字領域402に対する第一の探索範囲および文書領域端画素を示す。走査線1201〜1208は探索範囲を示している。走査線1201〜1204、および、走査線1206〜1208の走査終了点は画像端であり、走査線1205の走査終了点は文字領域403の外接矩形と交差する画素までとなる。また走査線1201〜1204、および、走査線1206〜1208にはそれぞれ文書領域端画素が抽出されているが、走査線1205は、文書領域端画素の抽出ができていない。このため文字領域402および文字領域403は同一の文書領域に存在する文字領域と判定し、2つの文書領域端画素を統合する。
FIG. 16 shows the first search range and document area end pixel for the
図17は文字領域統合部5011から出力された統合された文書領域端画素および、第二の探索範囲である小矩形、および、文書領域確定部509内で推定される文書領域端線を示す。本実施形態の第二の探索範囲決定部507では、文書領域端画素が一定の距離より近い場合はこれらを包含するような矩形にサイズを拡大する機能を有する。図17の小矩形1301および小矩形1306は文書領域端画素が近接していると判定され、小矩形の大きさを規定より拡大したものである。
FIG. 17 shows the integrated document region end pixel output from the character
図18の文字領域1401は文字領域402、403を含む文書領域を示している。この文書領域に対し歪み補正を行い電子ファイル化したものを図13(b)に示す。なお、この文字領域1401は、図3の文書領域302に対応している。
A
以上、説明したとおり、同じ文書内で文字が離れて存在し、文字領域抽出時に分割された状態であっても、文字領域を統合して単一の文書領域として抽出することが可能なる。また、文字領域統合を行うことで文書領域確定に使用できる線が増えるため、より確実に文書領域が抽出できる。さらに文書領域確定処理を実施する領域数を減らせるため計算量の低減が可能となる。 As described above, even if characters exist apart from each other in the same document and are divided when the character region is extracted, the character regions can be integrated and extracted as a single document region. In addition, by integrating character areas, more lines can be used to determine the document area, so that the document area can be extracted more reliably. Further, the amount of calculation can be reduced because the number of areas for performing the document area determination process can be 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 (8)
入力された画像データから前記文書領域に含まれる文字の外接矩形である文字領域を抽出する文字領域抽出手段と、
抽出された前記文字領域の位置を基準として、文書領域端となる文書領域端画素を探索する第一の探索範囲を決定する第一の探索範囲決定手段と、
前記第一の探索範囲から前記文書領域端画素を抽出する文書領域端画素抽出手段と、
抽出された前記文書領域端画素の位置を基準として、文書領域端となる文書領域端線を探索する第二の探索範囲を決定する第二の探索範囲決定手段と、
前記第二の探索範囲から前記文書領域端線を抽出する文書領域端線抽出手段と、
前記文書領域端線から前記文書領域を確定する文書領域確定手段と
を有することを特徴とする画像処理装置。 An image processing apparatus for extracting a document area from image data having a document area,
A character region extraction means for extracting a character region that is a circumscribed rectangle of characters included in the document region from the input image data;
First search range determining means for determining a first search range for searching for a document region end pixel serving as a document region end with reference to the position of the extracted character region;
Document area edge pixel extracting means for extracting the document area edge pixel from the first search range;
Second search range determining means for determining a second search range for searching for a document area end line serving as a document area end with reference to the position of the extracted document area end pixel;
Document area end line extracting means for extracting the document area end line from the second search range;
An image processing apparatus comprising: a document area determining unit that determines the document area from the document area end line.
前記文書領域端画素の探索の始点となる画素に近接する文字連結成分の周辺画素の画素値から前記文書領域の下地色となる画素値を決定する下地色決定手段と、
前記第一の探索範囲を走査し、対象画素の画素値と前記下地色となる画素値とを用いて前記文書領域端画素か否かを判定する文書領域端画素判定手段と
を更に有することを特徴とする請求項1に記載の画像処理装置。 The document area edge pixel extracting means includes:
A background color determining means for determining a pixel value to be a background color of the document area from a pixel value of a peripheral pixel of a character connected component adjacent to a pixel that is a search start point of the document area edge pixel;
Document area end pixel determining means for scanning the first search range and determining whether the pixel is the document area end pixel using the pixel value of the target pixel and the pixel value as the background color. The image processing apparatus according to claim 1, wherein:
前記画像処理装置の文字領域抽出手段が、入力された画像データから前記文書領域に含まれる文字の外接矩形である文字領域を抽出する文字領域抽出工程と、
前記画像処理装置の第一の探索範囲決定手段が、抽出された前記文字領域の位置を基準として、文書領域端となる文書領域端画素を探索する第一の探索範囲を決定する第一の探索範囲決定工程と、
前記画像処理装置の文書領域端画素抽出手段が、前記第一の探索範囲から前記文書領域端画素を抽出する文書領域端画素抽出工程と、
前記画像処理装置の第二の探索範囲決定手段が、抽出された前記文書領域端画素の位置を基準として、文書領域端となる文書領域端線を探索する第二の探索範囲を決定する第二の探索範囲決定工程と、
前記画像処理装置の文書領域端線抽出手段が、前記第二の探索範囲から前記文書領域端線を抽出する文書領域端線抽出工程と、
前記画像処理装置の文書領域確定手段が、前記文書領域端線から前記文書領域を確定する文書領域確定工程と
を有することを特徴とする制御方法。 A control method of an image processing apparatus for extracting the document area from image data having a document area,
A character region extraction step in which the character region extraction means of the image processing device extracts a character region that is a circumscribed rectangle of a character included in the document region from the input image data;
A first search for determining a first search range in which a first search range determining unit of the image processing apparatus searches for a document region end pixel serving as a document region end with reference to the extracted position of the character region. A range determination process;
A document area edge pixel extracting step in which the document area edge pixel extracting means of the image processing apparatus extracts the document area edge pixel from the first search range;
Second search range determining means of the image processing apparatus determines a second search range for searching for a document area end line serving as a document area end with reference to the extracted position of the document area end pixel. A search range determination step of
A document area end line extracting means for extracting the document area end line from the second search range;
A control method comprising: a document region determining step of determining the document region from the document region end line, wherein the document region determining means of the image processing apparatus.
入力された画像データから文書領域に含まれる文字の外接矩形である文字領域を抽出する文字領域抽出手段、
抽出された前記文字領域の位置を基準として、文書領域端となる文書領域端画素を探索する第一の探索範囲を決定する第一の探索範囲決定手段、
前記第一の探索範囲から前記文書領域端画素を抽出する文書領域端画素抽出手段、
抽出された前記文書領域端画素の位置を基準として、文書領域端となる文書領域端線を探索する第二の探索範囲を決定する第二の探索範囲決定手段、
前記第二の探索範囲から前記文書領域端線を抽出する文書領域端線抽出手段、
前記文書領域端線から前記文書領域を確定する文書領域確定手段
として機能させるためのコンピュータプログラム。 Computer
A character area extracting means for extracting a character area that is a circumscribed rectangle of a character included in the document area from the input image data;
First search range determining means for determining a first search range for searching for a document region end pixel serving as a document region end with reference to the position of the extracted character region;
Document area edge pixel extracting means for extracting the document area edge pixel from the first search range;
Second search range determining means for determining a second search range for searching for a document area end line serving as a document area end with reference to the position of the extracted document area end pixel;
Document area end line extracting means for extracting the document area end line from the second search range;
A computer program for functioning as document area determining means for determining the document area from the document area end line.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2010161040A JP2012022577A (en) | 2010-07-15 | 2010-07-15 | Image processing apparatus, control method, and computer program |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2010161040A JP2012022577A (en) | 2010-07-15 | 2010-07-15 | Image processing apparatus, control method, and computer program |
Publications (1)
Publication Number | Publication Date |
---|---|
JP2012022577A true JP2012022577A (en) | 2012-02-02 |
Family
ID=45776805
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP2010161040A Withdrawn JP2012022577A (en) | 2010-07-15 | 2010-07-15 | Image processing apparatus, control method, and computer program |
Country Status (1)
Country | Link |
---|---|
JP (1) | JP2012022577A (en) |
-
2010
- 2010-07-15 JP JP2010161040A patent/JP2012022577A/en not_active Withdrawn
Similar Documents
Publication | Publication Date | Title |
---|---|---|
JP5896245B2 (en) | How to crop a text image | |
AU2007224085B2 (en) | Model- based dewarping method and apparatus | |
RU2721188C2 (en) | Improved contrast and noise reduction on images obtained from cameras | |
WO2016127478A1 (en) | Image processing method and device, and terminal | |
EP2270746A2 (en) | Method for detecting alterations in printed document using image comparison analyses | |
JP2002190957A (en) | Document processing equipment and method therefor | |
US10455163B2 (en) | Image processing apparatus that generates a combined image, control method, and storage medium | |
CN111695540A (en) | Video frame identification method, video frame cutting device, electronic equipment and medium | |
WO2009114967A1 (en) | Motion scan-based image processing method and device | |
CN113627428A (en) | Document image correction method and device, storage medium and intelligent terminal device | |
KR101377910B1 (en) | Image processing method and image processing apparatus | |
US9094617B2 (en) | Methods and systems for real-time image-capture feedback | |
CN111260675A (en) | High-precision extraction method and system for image real boundary | |
US10999513B2 (en) | Information processing apparatus having camera function, display control method thereof, and storage medium | |
JP6542230B2 (en) | Method and system for correcting projected distortion | |
CN112800824A (en) | Processing method, device and equipment for scanning file and storage medium | |
CN110610163B (en) | Table extraction method and system based on ellipse fitting in natural scene | |
CN115410191B (en) | Text image recognition method, device, equipment and storage medium | |
JP2010002991A (en) | Image processor, image processing method, and computer program | |
CN113033562A (en) | Image processing method, device, equipment and storage medium | |
CN108647680B (en) | Image positioning frame detection method and device | |
JP2012060452A (en) | Image processor, method therefor and program | |
JP2012022577A (en) | Image processing apparatus, control method, and computer program | |
JP5563390B2 (en) | Image processing apparatus, control method therefor, and program | |
CN112036342A (en) | Document snapshot method, device and computer storage medium |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
A300 | Application deemed to be withdrawn because no request for examination was validly filed |
Free format text: JAPANESE INTERMEDIATE CODE: A300 Effective date: 20131001 |