JP4497974B2 - Image processing apparatus, image processing method, program, and storage medium - Google Patents
Image processing apparatus, image processing method, program, and storage medium Download PDFInfo
- Publication number
- JP4497974B2 JP4497974B2 JP2004090063A JP2004090063A JP4497974B2 JP 4497974 B2 JP4497974 B2 JP 4497974B2 JP 2004090063 A JP2004090063 A JP 2004090063A JP 2004090063 A JP2004090063 A JP 2004090063A JP 4497974 B2 JP4497974 B2 JP 4497974B2
- Authority
- JP
- Japan
- Prior art keywords
- partial image
- image area
- line
- projection
- determined
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Expired - Fee Related
Links
Images
Landscapes
- Image Analysis (AREA)
Description
本発明は、文書画像の傾きを自動的に検出する画像処理装置、画像処理方法、プログラム及び記憶媒体に関する。 The present invention relates to an image processing apparatus, an image processing method, a program, and a storage medium that automatically detect the inclination of a document image.
スキャナ等から読み取った文書画像の傾きを自動的に補正することで、領域分割や文字認識等の文書画像解析処理の精度を向上させることができる。例えば、文書方向を自動的に検知し、その行方向に沿って配置された2つの探索用の窓内において行方向の射影をそれぞれ求め、一方の窓を固定し、他方の窓を行方向と垂直方向にずらしながら、射影の相関が最大となる時の2つの窓の垂直方向のずれ量と行方向の距離から文書画像の傾き量を求める技術が開示されている(例えば、特許文献1参照。)。 By automatically correcting the inclination of the document image read from the scanner or the like, it is possible to improve the accuracy of document image analysis processing such as area division and character recognition. For example, the document direction is automatically detected, the projections in the row direction are obtained in two search windows arranged along the row direction, one window is fixed, and the other window is set as the row direction. A technique is disclosed in which the tilt amount of the document image is obtained from the vertical shift amount of the two windows and the distance in the row direction when the correlation between projections is maximized while shifting in the vertical direction (see, for example, Patent Document 1). .)
特許文献1に記載の発明によれば、射影は窓の内部にある文字行の存在位置を示すものであり、両窓の射影の相関は行の位置が一致した状態の場合に最大となる。そして、文字行の傾きから文書画像の傾きを決定することができる。 According to the invention described in Patent Document 1, the projection indicates the position of the character line existing inside the window, and the correlation between the projections of both windows is maximized when the positions of the lines match. Then, the inclination of the document image can be determined from the inclination of the character line.
また、窓の組を文書画像全体に行き渡るように複数組設定し、複数箇所から得られた傾きの大きさに基づいて文書画像としての傾きを求めている。このように、特許文献1に記載の発明によれば、文字画像上の設定した窓における行方向の射影を用いることにより、速い処理速度で、かつ、記憶領域が少なくて済むような文字画像の傾き検出方法が開示されている。
しかしながら、上記特許文献1に記載の発明では、行方向に沿って配置された2つの窓が同一の文字行上に存在しない場合、適切に文字行の傾きを抽出することができないという欠点があった。例えば、2つの窓はあらかじめ定められた間隔で配置されるため、同一カラム(同一文字行)が2つの窓内に存在しない場合があったり、或いは一方の窓内に存在するカラムが他方の窓内に存在しなかったりするような場合、上記特許文献1に記載の発明では適切に文書画像の傾きを抽出することができない。 However, the invention described in Patent Document 1 has a drawback in that when two windows arranged in the line direction do not exist on the same character line, the inclination of the character line cannot be extracted appropriately. It was. For example, because two windows are arranged at a predetermined interval, the same column (same character line) may not be present in the two windows, or a column present in one window may be the other window. If it does not exist in the document, the invention described in Patent Document 1 cannot properly extract the inclination of the document image.
本発明は、このような事情を考慮してなされたものであり、文書画像内において文字行が連続している範囲を確実に取得して文字行の傾きを適切に取得することができるので、より高精度に文書画像の傾きを求めることができる画像処理装置、画像処理方法、プログラム及び記憶媒体を提供することを目的とする。 The present invention has been made in consideration of such circumstances, and it is possible to reliably acquire the range in which the character lines are continuous in the document image and appropriately acquire the inclination of the character lines. An object of the present invention is to provide an image processing apparatus, an image processing method, a program, and a storage medium that can determine the inclination of a document image with higher accuracy.
上記課題を解決するために、本発明に係る画像処理装置は、入力された文書画像内の所定の位置に、予め決められた大きさの部分画像領域を基準部分画像領域として設定する基準設定手段と、前記基準部分画像領域に含まれる文字行の射影を検出する基準射影検出手段と、前記基準部分画像領域の位置から行先端方向に部分画像領域の幅分スライドさせた位置に第1の部分画像領域を設定する第1部分画像領域設定手段と、当該新たに設定した第1の部分画像領域内から検出される文字行の射影の位置と、前記第1の部分画像領域の行終端方向に隣接する部分画像領域内から検出される文字行の射影の位置とを比較することにより、文字行の射影に連続性があるか否かを判定する第1判定手段と、前記第1判定手段で連続性がないと判定されるまで、その時点で設定されている第1の部分画像領域の位置から行先端方向に部分画像領域の幅分スライドさせた位置に新たな第1の部分画像領域を設定して前記第1判定手段による判定を繰り返し、前記第1判定手段で連続性がないと判定された時点で設定されている第1の部分画像領域の1つ前に設定された第1の部分画像領域を行先端の部分画像領域として決定する行先端部分画像領域決定手段と、前記基準部分画像領域の位置から行終端方向に部分画像領域の幅分スライドさせた位置に第2の部分画像領域を設定する第2部分画像領域設定手段と、当該新たに設定した第2の部分画像領域内から検出される文字行の射影の位置と、前記第2の部分画像領域の行先端方向に隣接する部分画像領域内から検出される文字行の射影の位置とを比較することにより、文字行の射影に連続性があるか否かを判定する第2判定手段と、前記第2判定手段で連続性がないと判定されるまで、その時点で設定されている第2の部分画像領域の位置から行終端方向に部分画像領域の幅分スライドさせた位置に新たな第2の部分画像領域を設定して前記第2判定手段による判定を繰り返し、前記第2判定手段で連続性がないと判定された時点で設定されている第2の部分画像領域の1つ前に設定された第2の部分画像領域を行終端の部分画像領域として決定する行終端部分画像領域決定手段と、前記行先端部分画像領域決定手段で決定された行先端の部分画像領域から検出される射影と前記行終端部分画像領域決定手段で決定された行終端の部分画像領域から検出される射影との間の相関関係と、前記行先端の部分画像領域と前記行終端の部分画像領域との間隔とに基づいて、前記文書画像の傾きを決定する決定手段とを備えることを特徴とする。 In order to solve the above problems, an image processing apparatus according to the present invention, a predetermined position in the document image input, a reference setting means for setting the partial image area of a predetermined size as a reference partial image area A reference projection detecting means for detecting a projection of a character line included in the reference partial image area, and a first part at a position slid by the width of the partial image area from the position of the reference partial image area toward the line leading end. A first partial image area setting means for setting an image area; a projection position of a character line detected from the newly set first partial image area; and a line end direction of the first partial image area. A first determination unit that determines whether the projection of the character line has continuity by comparing the position of the projection of the character line detected from within the adjacent partial image region; and the first determination unit Determined to be non-continuous Until the position of the first partial image area set at that time is shifted by the width of the partial image area in the row leading direction, a new first partial image area is set and the first determination means The first partial image area set immediately before the first partial image area set when the first determination means determines that there is no continuity is repeated at the end of the row. And a second partial image that sets a second partial image region at a position slid by the width of the partial image region in the row end direction from the position of the reference partial image region. Area setting means, the projection position of the character line detected from the newly set second partial image area, and the partial image area detected in the line leading direction of the second partial image area. The position of the projected character line The second determination means for determining whether or not the projection of the character line has continuity by comparing the above and the second determination means is set at that time until it is determined that there is no continuity. A new second partial image area is set at a position slid by the width of the partial image area from the position of the second partial image area in the row end direction, and the determination by the second determination unit is repeated, and the second determination is performed. A row end partial image for determining a second partial image region set immediately before the second partial image region set when it is determined by the means that there is no continuity as a partial image region at the end of the row Detected from an area determination means, a projection detected from the partial image area at the line leading end determined by the line leading end partial image area determining means, and a line end partial image area determined by the line end partial image area determining means And the correlation between , Based on the distance between the destination end of the partial image region and the line termination of the partial image area, characterized in that it comprises a determination means for determining the inclination of the document image.
また、本発明に係る画像処理方法は、画像処理装置における画像処理方法であって、前記画像処理装置の基準設定手段が、画像処理装置に入力された文書画像内の所定の位置に、予め決められた大きさの部分画像領域を基準部分画像領域として設定する基準設定工程と、前記画像処理装置の基準射影検出手段が、前記基準部分画像領域に含まれる文字行の射影を検出する基準射影検出工程と、前記画像処理装置の第1部分画像領域設定手段が、前記基準部分画像領域の位置から行先端方向に部分画像領域の幅分スライドさせた位置に第1の部分画像領域を設定する第1部分画像領域設定工程と、前記画像処理装置の第1判定手段が、当該新たに設定した第1の部分画像領域内から検出される文字行の射影の位置と、前記第1の部分画像領域の行終端方向に隣接する部分画像領域内から検出される文字行の射影の位置とを比較することにより、文字行の射影に連続性があるか否かを判定する第1判定工程と、前記画像処理装置の行先端部分画像領域決定手段が、前記第1判定工程で連続性がないと判定されるまで、その時点で設定されている第1の部分画像領域の位置から行先端方向に部分画像領域の幅分スライドさせた位置に新たな第1の部分画像領域を設定して前記第1判定工程における判定を繰り返し、前記第1判定工程で連続性がないと判定された時点で設定されている第1の部分画像領域の1つ前に設定された第1の部分画像領域を行先端の部分画像領域として決定する行先端部分画像領域決定工程と、前記画像処理装置の第2部分画像領域設定手段が、前記基準部分画像領域の位置から行終端方向に部分画像領域の幅分スライドさせた位置に第2の部分画像領域を設定する第2部分画像領域設定工程と、前記画像処理装置の第2判定手段が、当該新たに設定した第2の部分画像領域内から検出される文字行の射影の位置と、前記第2の部分画像領域の行先端方向に隣接する部分画像領域内から検出される文字行の射影の位置とを比較することにより、文字行の射影に連続性があるか否かを判定する第2判定工程と、前記画像処理装置の行終端部分画像領域決定手段が、前記第2判定工程で連続性がないと判定されるまで、その時点で設定されている第2の部分画像領域の位置から行終端方向に部分画像領域の幅分スライドさせた位置に新たな第2の部分画像領域を設定して前記第2判定工程による判定を繰り返し、前記第2判定工程で連続性がないと判定された時点で設定されている第2の部分画像領域の1つ前に設定された第2の部分画像領域を行終端の部分画像領域として決定する行終端部分画像領域決定工程と、前記画像処理装置の決定手段が、前記行先端部分画像領域決定工程で決定された行先端の部分画像領域から検出される射影と前記行終端部分画像領域決定工程で決定された行終端の部分画像領域から検出される射影との間の相関関係と、前記行先端の部分画像領域と前記行終端の部分画像領域との間隔とに基づいて、前記文書画像の傾きを決定する決定工程とを有することを特徴とする。 The image processing method according to the present invention is an image processing method in an image processing apparatus, wherein the reference setting means of the image processing apparatus is determined in advance at a predetermined position in a document image input to the image processing apparatus. A reference setting step of setting a partial image region of a specified size as a reference partial image region , and a reference projection detection in which a reference projection detection means of the image processing device detects a projection of a character line included in the reference partial image region And a first partial image area setting unit of the image processing apparatus sets the first partial image area at a position slid by the width of the partial image area from the position of the reference partial image area in the row leading direction. A first partial image region setting step, and the first determination unit of the image processing apparatus detects a projection of a character line detected from the newly set first partial image region, and the first partial image region of A first determination step of determining whether or not the projection of the character line has continuity by comparing the projection position of the character line detected from within the partial image region adjacent in the end direction; and the image processing The partial image area in the line leading direction from the position of the first partial image area set at that time until the line leading partial image area determining means of the apparatus determines that there is no continuity in the first determination step A new first partial image area is set at a position slid by the width of, and the determination in the first determination step is repeated, and is set when it is determined that there is no continuity in the first determination step. A line leading edge partial image area determining step of determining a first partial image area set immediately before the first partial image area as a partial image area at the line leading edge; and second partial image area setting of the image processing apparatus Means for the reference partial image A second partial image area setting step of setting a second partial image area from the position of the band in a position to width of the slide of the partial image area in the row end direction, the second judging means of the image processing apparatus, the new The position of the projection of the character line detected from within the second partial image area set to the position of the character line and the position of the projection of the character line detected from within the partial image area adjacent to the line tip direction of the second partial image area And a second determination step for determining whether or not the projection of the character line has continuity, and a line end partial image region determination means of the image processing device in the second determination step. Until it is determined that there is no image, a new second partial image area is set at a position slid by the width of the partial image area in the row end direction from the position of the second partial image area set at that time. Repeat the determination in the second determination step. The second partial image area set immediately before the second partial image area set when it is determined that there is no continuity in the second determination step is determined as the partial image area at the end of the row. A line end partial image region determining step to be performed, and a projection detected by the determining means of the image processing device from the partial image region at the line front end determined in the line leading end partial image region determining step and the line end partial image region determining The document image based on the correlation between the projection detected from the partial image area at the end of the line determined in the process and the interval between the partial image area at the top of the line and the partial image area at the end of the line And a determining step for determining the slope of the.
さらに、本発明は、コンピュータを、入力された文書画像内の所定の位置に、予め決められた大きさの部分画像領域を基準部分画像領域として設定する基準設定手段と、前記基準部分画像領域に含まれる文字行の射影を検出する基準射影検出手段と、前記基準部分画像領域の位置から行先端方向に部分画像領域の幅分スライドさせた位置に第1の部分画像領域を設定する第1部分画像領域設定手段と、当該新たに設定した第1の部分画像領域内から検出される文字行の射影の位置と、前記第1の部分画像領域の行終端方向に隣接する部分画像領域内から検出される文字行の射影の位置とを比較することにより、文字行の射影に連続性があるか否かを判定する第1判定手段と、前記第1判定手段で連続性がないと判定されるまで、その時点で設定されている第1の部分画像領域の位置から行先端方向に部分画像領域の幅分スライドさせた位置に新たな第1の部分画像領域を設定して前記第1判定手段による判定を繰り返し、前記第1判定手段で連続性がないと判定された時点で設定されている第1の部分画像領域の1つ前に設定された第1の部分画像領域を行先端の部分画像領域として決定する行先端部分画像領域決定手段と、前記基準部分画像領域の位置から行終端方向に部分画像領域の幅分スライドさせた位置に第2の部分画像領域を設定する第2部分画像領域設定手段と、当該新たに設定した第2の部分画像領域内から検出される文字行の射影の位置と、前記第2の部分画像領域の行先端方向に隣接する部分画像領域内から検出される文字行の射影の位置とを比較することにより、文字行の射影に連続性があるか否かを判定する第2判定手段と、前記第2判定手段で連続性がないと判定されるまで、その時点で設定されている第2の部分画像領域の位置から行終端方向に部分画像領域の幅分スライドさせた位置に新たな第2の部分画像領域を設定して前記第2判定手段による判定を繰り返し、前記第2判定手段で連続性がないと判定された時点で設定されている第2の部分画像領域の1つ前に設定された第2の部分画像領域を行終端の部分画像領域として決定する行終端部分画像領域決定手段と、前記行先端部分画像領域決定手段で決定された行先端の部分画像領域から検出される射影と前記行終端部分画像領域決定手段で決定された行終端の部分画像領域から検出される射影との間の相関関係と、前記行先端の部分画像領域と前記行終端の部分画像領域との間隔とに基づいて、前記文書画像の傾きを決定する決定手段として機能させるためのプログラムであることを特徴とする。 Further, according to the present invention, a reference setting means for setting a computer as a reference partial image area at a predetermined position in the inputted document image as a reference partial image area with a predetermined size is provided. A reference projection detecting means for detecting a projection of the included character line, and a first part for setting the first partial image area at a position slid by the width of the partial image area from the position of the reference partial image area toward the leading edge of the line Detecting from the image area setting means, the position of the projection of the character line detected from the newly set first partial image area, and the partial image area adjacent to the line end direction of the first partial image area The first determination means for determining whether or not the projection of the character line has continuity by comparing the position of the projected character line with the projection position, and the first determination means determines that there is no continuity. Until then A new first partial image area is set at a position slid by the width of the partial image area from the position of the first partial image area in the row leading direction, and the determination by the first determination unit is repeated, A row for determining the first partial image region set immediately before the first partial image region set when the first determination unit determines that there is no continuity as the partial image region at the head of the row. Tip partial image region determining means; second partial image region setting means for setting a second partial image region at a position slid by the width of the partial image region in the row end direction from the position of the reference partial image region; The projection position of the character line detected from the newly set second partial image area and the projection of the character line detected from the partial image area adjacent to the second partial image area in the line leading direction. By comparing with the position A second determination means for determining whether the projection of the character line has continuity, the second until it is determined that there is no continuity at decision means, said second partial image that is set at that time A new second partial image area is set at a position slid by the width of the partial image area in the row end direction from the position of the area, and the determination by the second determination means is repeated. A line end partial image area determining means for determining a second partial image area set immediately before the second partial image area set at the time when it is determined that there is no line end as a line end partial image area; Between the projection detected from the partial image area at the line leading end determined by the line leading end partial image area determining means and the projection detected from the partial image area at the line end determined by the line end partial image area determining means And the partial image at the top of the line It is a program for functioning as a determining means for determining an inclination of the document image based on an interval between an image region and the partial image region at the end of the line.
さらにまた、本発明は、上記プログラムを格納したことを特徴とするコンピュータ読み取り可能な記憶媒体であることを特徴とする。 Furthermore, the present invention is a computer-readable storage medium characterized by storing the above program.
本発明によれば、文書画像内において文字行が連続している範囲を確実に取得して文字行の傾きを適切に取得することができるので、より高精度に文書画像の傾きを求めることができる。 According to the present invention, it is possible to reliably acquire a range in which character lines are continuous in a document image and appropriately acquire the inclination of the character line, so that the inclination of the document image can be obtained with higher accuracy. it can.
以下、図面を参照して、本発明の一実施形態について説明する。 Hereinafter, an embodiment of the present invention will be described with reference to the drawings.
<第1の実施形態>
図1は、本発明の第1の実施形態に係る画像処理装置の構成を示すブロック図である。図1において、101は、ROM102に格納されている制御プログラムに従って本画像処理装置全体の制御を行うCPUである。また、102は、後述するフローチャートに示す処理手順に従ってCPU101が実行する本画像処理装置の制御プログラム等を格納するROMである。さらに、103は、文書画像等を記憶するRAM、104は磁気ディスク等の外部記憶装置である。さらにまた、105はディスプレイ、106はキーボード、107はマウス等のポインティングデバイス、108は紙原稿等から画像を読み取るためのスキャナである。
<First Embodiment>
FIG. 1 is a block diagram showing a configuration of an image processing apparatus according to the first embodiment of the present invention. In FIG. 1,
さらにまた、上述したCPU101、ROM102、RAM103、外部記憶装置104、ディスプレイ105、スキャナ108は互いにバス110を介して接続されている。
Furthermore, the
尚、上記本実施形態に係る画像処理装置が行う画像処理は、汎用的なコンピュータでも実施可能であり、その場合、記憶媒体等で提供される制御プログラムを外部記憶装置104に記憶させ、オペレータの指示等によりCPU101で実行するように構成してもよい。尚、図7は、第1の実施形態に係る画像処理装置で読み出し可能な各種データ処理プログラムを格納する記憶媒体のメモリマップの一例を説明するための図であり、後述するフローチャートの各ステップをコンピュータに実行させるためのプログラムコード群が格納されている。また、109はネットワークインタフェース(I/F)であり、遠隔地等に存在する情報処理装置等と通信し、プログラムやデータ等を読み込んだり、書き込んだりするためのインタフェースであって、バス110に接続されている。
Note that the image processing performed by the image processing apparatus according to the present embodiment can also be performed by a general-purpose computer. In this case, a control program provided on a storage medium or the like is stored in the external storage device 104 and the operator's It may be configured to be executed by the
尚、スキャナ108やディスプレイ105等の装置はバス110に直接接続される構成ではなく、ネットワークI/F109を介して接続されるような構成であってもよい。
The devices such as the
また、本画像処理装置で処理される画像は、スキャナ108で紙原稿等から光学的に読み取られたもの、或いは外部記憶装置104に保存されているもの、或いは、他の画像入力装置等からネットワークI/F109を介して受信されたもの等を使用することができる。また、そのようにして得られた画像に対して、本実施形態では、公知の技術を用いて、傾きを検出するための検査領域及び検査領域内の文書方向が決定される。例えば、検査領域は、入力画像の余白を除去して決定したり、或いは、文書のレイアウト情報からテキスト領域を抽出して決定したりすることができる。
The image processed by the image processing apparatus is an image optically read from a paper document or the like by the
図2は、第1の実施形態に係る画像処理装置による検査領域内から入力された文書画像の傾き量を検出するための処理手順を説明するためのフローチャートである。まず、公知の技術を用いて決定された文書画像内の検査領域に対して、当該検査領域内に存在する文字行等の局所的傾きを検知するための検知位置を決定する(ステップS201)。例えば、検知位置は、検査領域全体に等間隔に分布させたり、乱数を用いて全体にばらつくようにする。 FIG. 2 is a flowchart for explaining a processing procedure for detecting a tilt amount of a document image input from the inspection area by the image processing apparatus according to the first embodiment. First, a detection position for detecting a local inclination of a character line or the like existing in the inspection area is determined for the inspection area in the document image determined using a known technique (step S201). For example, the detection positions are distributed at equal intervals over the entire inspection region, or are varied using random numbers.
次に、ステップS201で決定した検知位置に、あらかじめ大きさの決まった検知窓を設定し、それを基準の検知窓とする(ステップS202)。尚、本実施形態では、一例として、矩形状の部分画像領域を検知窓として使用する。 Next, a detection window having a predetermined size is set at the detection position determined in step S201, and is set as a reference detection window (step S202). In this embodiment, as an example, a rectangular partial image region is used as a detection window.
そして、基準の検知窓内の行方向の射影を取得する(ステップS203)。ここで、射影とは、各画素を行方向にスキャンし、黒画素(文字部分を構成する画素)が存在すればその行は射影ありと判断するものである。その結果、検知窓内に存在する文字行の高さが射影として得られる。そして、得られた射影に文字行の射影が含まれるか否かを判定する(ステップS204)。 Then, the projection in the row direction within the reference detection window is acquired (step S203). Here, the projection means that each pixel is scanned in the row direction, and if there is a black pixel (a pixel constituting the character portion), it is determined that the row is projected. As a result, the height of the character line existing in the detection window is obtained as a projection. Then, it is determined whether or not the obtained projection includes a projection of a character line (step S204).
図4は、第1の実施形態に係る画像処理装置で設定される検知窓及び行方向の射影を説明するための図である。図4において、401はステップS202で設定された検知窓、402はステップS203で取得された射影である。図4に示すように、検知窓内に文字行が含まれている場合には、その文字行の行高さ分の射影が検知窓内に存在することになる。尚、射影が検知窓内に存在しなかったり、射影の長さが検知窓の高さ等に対して短かったり、或いは、射影が検知窓の高さ全体に及ぶ長さであったりするような場合は、行射影を含まないものと判定し(No)、ステップS216に進んで、全ての検知位置で傾斜角を求めたか否かを調べる。その結果、まだ残っている検知位置(すなわち、傾斜角を求めていない基準の検知窓)が存在する場合(No)は、次の検知位置に処理を移し(ステップS217)、ステップS201に再び戻って上記処理を繰り返す。 FIG. 4 is a diagram for explaining detection windows and projections in the row direction set by the image processing apparatus according to the first embodiment. In FIG. 4, 401 is the detection window set in step S202, and 402 is the projection acquired in step S203. As shown in FIG. 4, when a character line is included in the detection window, a projection corresponding to the line height of the character line exists in the detection window. The projection does not exist in the detection window, the projection length is short relative to the height of the detection window, or the projection extends over the entire height of the detection window. In this case, it is determined that the line projection is not included (No), and the process proceeds to step S216 to check whether the inclination angles have been obtained at all the detection positions. As a result, when there is a remaining detection position (that is, a reference detection window for which the inclination angle has not been obtained) (No), the process moves to the next detection position (step S217) and returns to step S201 again. Repeat the above process.
一方、ステップS204で文字行の射影が含まれていると判定された場合(Yes)、行方向へ検知窓の幅分だけずらした位置に新たな検知窓を設定する(ステップS205)。例えば、横書きであれば右方向に検知窓の幅分だけずらす(右方向に一検知窓幅分だけスライドする)ことになる。そして、新たな検知窓内の行方向の射影を取得する(ステップS206)。 On the other hand, if it is determined in step S204 that the projection of the character line is included (Yes), a new detection window is set at a position shifted by the width of the detection window in the line direction (step S205). For example, in the case of horizontal writing, it is shifted by the width of the detection window in the right direction (slides by the width of one detection window in the right direction). Then, the projection in the row direction in the new detection window is acquired (step S206).
次いで、新たな検知窓の射影と、一つ前に処理した、隣り合った検知窓の射影とを比較して、文字行の射影に連続性があるか否かを調べる(ステップS207)。例えば、射影の重なりが十分大きい場合は連続しているとする。その結果、連続性があると判断された場合(Yes)はステップS205に戻り、さらに検知窓を一検知窓の幅分だけ右方向にずらして連続性を見ていく。一方、連続性がないと判断された場合(No)は、基準の検知窓が一つ前に処理した検知窓までの間が文字行の連続していた範囲であるとみなし、その検知窓を行終端の窓とする(ステップS208)。 Next, the projection of the new detection window is compared with the projection of the adjacent detection window processed immediately before to check whether the projection of the character line has continuity (step S207). For example, when the projection overlap is sufficiently large, it is assumed that the projections are continuous. As a result, if it is determined that there is continuity (Yes), the process returns to step S205, and the detection window is further shifted to the right by the width of one detection window to see the continuity. On the other hand, when it is determined that there is no continuity (No), it is considered that the reference detection window is a continuous range of character lines until the previous detection window is processed. A window at the end of the line is set (step S208).
次に、注目する検知窓を基準の検知窓から、文字行と逆方向へ当該検知窓の幅分だけずらした位置に新たな検知窓を設定する(ステップS209)。例えば、横書きであれば左方向に検知窓の幅分ずらすことになる。そして、新たな検知窓の行方向の射影を取得する(ステップS210)。 Next, a new detection window is set at a position where the detection window of interest is shifted from the reference detection window by the width of the detection window in the direction opposite to the character line (step S209). For example, in horizontal writing, the detection window is shifted to the left by the width of the detection window. Then, a projection in the row direction of the new detection window is acquired (step S210).
そして、新たな検知窓の射影と、一つ前に処理した、隣り合った検知窓の射影とを比較し、前述した処理と同様にして、文字行の射影に連続性があるか否かを調べる(ステップS211)。その結果、連続性があると判断された場合(Yes)はステップS209に戻って、さらに検知窓を一検知窓分だけ左方向にずらして同様の処理を行う。一方、連続性がないと判断された場合(No)は、基準の検知窓から一つ前に処理した検知窓までが文字行が連続していたと判定し、その検知窓を行先端の窓とする(ステップS212)。尚、先に行と逆方向へずらし、その後、行方向(右方向)へずらすように構成されていてもよい。 Then, the projection of the new detection window is compared with the projection of the adjacent detection window that was processed immediately before, and in the same way as described above, whether or not the projection of the character line is continuous. Check (step S211). As a result, if it is determined that there is continuity (Yes), the process returns to step S209, and the detection window is further shifted to the left by one detection window to perform the same processing. On the other hand, when it is determined that there is no continuity (No), it is determined that the character line is continuous from the reference detection window to the previously processed detection window, and the detection window is defined as the window at the top of the line. (Step S212). In addition, you may comprise so that it may shift to the direction opposite to a row | line | column first, and may be shifted to a row direction (right direction) after that.
ここまでの処理の状態を図5を用いて説明する。図5は、第1の実施形態に係る画像処理装置による同一文字行上に設定された検知窓を用いた連続性の判定処理を説明するための図である。図5において、501は基準の検知窓である。そして、行方向(右方向)に窓をずらし503の位置で行の連続性がないと判断された場合、その一つ前の502の位置が行終端の窓となる。また、行方向と反対方向(左方向)に窓をずらしていき、505の位置で行の連続性がないと判断された場合、その一つ前の504の位置が行先端の窓となる。
The state of the processing so far will be described with reference to FIG. FIG. 5 is a diagram for explaining continuity determination processing using detection windows set on the same character line by the image processing apparatus according to the first embodiment. In FIG. 5,
次いで、ステップS212で求められた行先端とステップS208で求められた行終端の検知窓が同一であるか否かを判定する(ステップS213)。その結果、同一であると判定された場合(Yes)は、文字行の連続性がないとしてステップS216に進み、前述したように全ての検知位置で傾斜角を求めたか否かを判定する。すなわち、同一と判定される場合とは、最初に設定した基準の検知窓の左右両隣にずらして設定された検知窓が共に行射影を含まないと判定された場合である。 Next, it is determined whether or not the detection window at the line leading end determined at step S212 and the line end detecting window determined at step S208 are the same (step S213). As a result, if it is determined that they are the same (Yes), it is determined that there is no continuity of the character line, and the process proceeds to step S216, where it is determined whether the inclination angles have been obtained at all the detection positions as described above. That is, the case where it is determined that they are the same is a case where it is determined that the detection windows set so as to be shifted to the left and right of the reference detection window set first do not include any row projection.
一方、ステップS213で同一でないと判定された場合(No)は、行先端と行終端の検知窓の間に存在する検知窓の射影情報を使用して、局所的な傾斜角を求める(ステップS214)。そして、求められた傾斜角は記憶され(ステップS215)、ステップS216に進む。 On the other hand, when it is determined in step S213 that they are not the same (No), the local inclination angle is obtained using the projection information of the detection window existing between the detection window at the front end and the end of the line (step S214). ). Then, the obtained inclination angle is stored (step S215), and the process proceeds to step S216.
ステップS216で全ての検知位置での処理が終了したと判定された場合(Yes)は、記憶された局所的傾斜角から入力画像の傾き角度を決定する(ステップS218)。例えば、全ての傾斜角の平均値や中央値等を用いることによって、それらを決定することができる。 If it is determined in step S216 that the processing at all detection positions has been completed (Yes), the inclination angle of the input image is determined from the stored local inclination angle (step S218). For example, they can be determined by using the average value or median value of all inclination angles.
次に、ステップS214における傾斜角の求め方について図3のフローチャートを用いて説明する。すなわち、図3は、図2のフローチャートにおけるステップS214の細部処理内容を説明するためのフローチャートである。まず、先端の検知窓を固定し、終端の検知窓を行に対して垂直方向にずらす(ステップS301)。そして、両検知窓の射影が最大相関となるときの両窓のずれ量を求める(ステップS302)。そして、ステップS302で求められたずれ量と両検知窓の間隔から傾斜角が求まる(ステップS303)。 Next, how to determine the tilt angle in step S214 will be described using the flowchart of FIG. That is, FIG. 3 is a flowchart for explaining details of the detailed processing in step S214 in the flowchart of FIG. First, the detection window at the front end is fixed, and the detection window at the end is shifted in the direction perpendicular to the row (step S301). Then, the shift amount of both windows when the projections of both detection windows have the maximum correlation is obtained (step S302). Then, the inclination angle is obtained from the deviation amount obtained in step S302 and the interval between the two detection windows (step S303).
図6は、第1の実施形態に係る画像処理装置における検知窓の射影の相関を説明するための図である。図6(a)において、601aは設定された1つ目の検知窓、602aは検知窓601a内の射影である。同様に、601bは検知窓601aの対として設定された2つ目の検知窓、602bは検知窓601b内の射影である。また、図6(b)は、固定した検知窓607に対して、上下にずらす検知窓604とその相関の大きさをグラフ605に示したものである。ここで、相関が最大の時のずれ量tと、検知窓の距離dとを用いて、傾斜角θは、tanθ=t/dの関係になる。尚、tの上へのずれを正、下へのずれを負とすると、符号でどちらに傾いているかを判別することができる。尚、終端の検知窓を固定し、先端の検知窓をずらすように構成しても同様である。
FIG. 6 is a diagram for explaining the correlation of the projection of the detection window in the image processing apparatus according to the first embodiment. In FIG. 6A, 601a is a set first detection window, and 602a is a projection in the
以上説明したように、本実施形態に係る画像処理装置によれば、同一文字行の範囲で2つの検知窓を確実に設定することができ、それぞれの窓内に含まれる文字方向のカラム幅を十分に利用して文字行の傾き角度を適切に計算することができるので、文書画像の傾きを精度よく検知することができる。 As described above, according to the image processing apparatus according to the present embodiment, two detection windows can be reliably set within the same character line range, and the column width in the character direction included in each window can be set. Since the tilt angle of the character line can be appropriately calculated by making full use, the tilt of the document image can be detected with high accuracy.
尚、上記実施形態では、本発明の技術的思想を実施するための必要最小限の構成要件で説明を行っているが、例えば汎用コンピュータに対して、本発明を実施する処理を行う画像処理プログラム等のデータを外部から提供し、或いは、あらかじめ外部記憶装置107に記憶しておき、RAM103に格納するように構成されてもよい。また、あらかじめ外部記憶装置107に記憶した入力画像を処理するように構成されてもよい。
In the above-described embodiment, the description is given with the minimum configuration requirements for implementing the technical idea of the present invention. For example, an image processing program that performs processing for implementing the present invention on a general-purpose computer Such data may be provided from the outside, or may be stored in advance in the
<第2の実施形態>
次に、図1に示す画像処理装置と同様の画像処理装置が実行する第2の実施形態について説明する。本実施形態では、射影情報から傾斜角を求める他の実施形態として、第1の実施形態と同様の方法で取得された先端の検知窓の一つ手前の検知窓と、終端の検知窓の一つ手前の検知窓とを使用して、両検知窓内の射影の相関を求めるように構成する。このようにすることで、句読点等の記号類が含まれる可能性が高い文字行の先端部分や終端部分の射影の利用を避け、傾きの検知精度をより高めることができる。
<Second Embodiment>
Next, a second embodiment executed by an image processing apparatus similar to the image processing apparatus shown in FIG. 1 will be described. In this embodiment, as another embodiment for obtaining the tilt angle from the projection information, a detection window just before the front-end detection window and a terminal detection window obtained by the same method as in the first embodiment are used. A detection window in front is used to obtain a correlation between projections in both detection windows. By doing so, it is possible to avoid the use of the projection of the leading and trailing portions of a character line that is likely to include symbols such as punctuation marks, and to further improve the accuracy of inclination detection.
また、同一文字行内にあると判断された複数の検知窓を用いて複数の組み合わせで当該文字行の傾斜角を求めるように構成してもよい。この場合、複数の組み合わせから得られた複数の傾斜角の平均を求め、最終的な傾斜角としてもよい。或いは、複数の傾斜角の最大値と最小値を除いた値で平均値を求めるようにしてもよい。さらにまた、複数の傾斜角の中央値や最頻値を最終的な傾斜角としてもよい。 Moreover, you may comprise so that the inclination | tilt angle of the said character line may be calculated | required by several combinations using the some detection window judged to be in the same character line. In this case, an average of a plurality of inclination angles obtained from a plurality of combinations may be obtained to obtain a final inclination angle. Or you may make it obtain | require an average value by the value except the maximum value and minimum value of several inclination angles. Furthermore, a median value or mode value of a plurality of inclination angles may be used as the final inclination angle.
さらに、隣同士の検知窓の最大相関が得られるずれ量を全て求め、最小二乗法やその他の最適化手法等を使用して傾斜角を計算するようにしてもよい。 Further, all of the deviation amounts from which the maximum correlation between adjacent detection windows can be obtained may be obtained, and the tilt angle may be calculated using a least square method or other optimization method.
本実施形態により、最大相関が得られるずれ量を求める際の検知精度を高めることができるので、より精度よく安定して文書画像の傾きを得ることができる。 According to the present embodiment, it is possible to increase the detection accuracy when obtaining the amount of deviation from which the maximum correlation can be obtained, so that the inclination of the document image can be obtained more accurately and stably.
<第3の実施形態>
次に、図1に示す画像処理装置と同様の画像処理装置が実行する第3の実施形態について説明する。本実施形態では、同一文字行を判定する他の実施形態として、新たな検知窓を基準の検知窓の幅よりもさらに離れた位置に設定するように構成する。尚、隣の検知窓からの距離は、同一文字行であることを判定可能な範囲のあらかじめ決められた値とする。或いは、基準の検知窓から得られた射影から文字行高さを推定し、その値から次の検知窓の設定位置を決定するようにしてもよい。
<Third Embodiment>
Next, a third embodiment executed by an image processing apparatus similar to the image processing apparatus shown in FIG. 1 will be described. In the present embodiment, as another embodiment for determining the same character line, a new detection window is set at a position further away from the width of the reference detection window. Note that the distance from the adjacent detection window is a predetermined value within a range in which it can be determined that they are the same character line. Alternatively, the character line height may be estimated from the projection obtained from the reference detection window, and the setting position of the next detection window may be determined from the value.
また、上述した実施形態では、基準の検知窓に含まれる文字行の先端と終端が同一窓でない場合(ステップS214でNoの場合)は、少なくとも二検知窓幅分以上の文字行が連続していることから、その文字行の傾きを計算したが、ステップS214において、検知された文字行の長さがある一定値以上の場合に限って文字行の傾きを計算するようにしてもよい。これにより、短い文字行については傾きを計算しないようにするので、より精度よく文書画像の傾きを求めることができる。 In the above-described embodiment, when the leading and trailing ends of the character lines included in the reference detection window are not the same window (in the case of No in step S214), the character lines of at least two detection window widths or more are consecutive. Therefore, the inclination of the character line is calculated. However, in step S214, the inclination of the character line may be calculated only when the detected length of the character line is equal to or greater than a certain value. Thus, since the inclination is not calculated for a short character line, the inclination of the document image can be obtained with higher accuracy.
本実施形態により、検知窓の個数が減少し、処理速度が速くなるという効果が得られる。 According to the present embodiment, the effect that the number of detection windows is reduced and the processing speed is increased can be obtained.
<その他の実施形態>
以上、実施形態例を詳述したが、本発明は、例えば、システム、装置、方法、プログラム若しくは記憶媒体等としての実施態様をとることが可能であり、具体的には、複数の機器から構成されるシステムに適用しても良いし、また、一つの機器からなる装置に適用しても良い。
<Other embodiments>
As described above, the embodiment has been described in detail. However, the present invention can take an embodiment as a system, apparatus, method, program, storage medium, or the like, and specifically includes a plurality of devices. The present invention may be applied to a system that is configured, or may be applied to an apparatus that includes a single device.
尚、本発明は、前述した実施形態の機能を実現するソフトウェアのプログラム(実施形態では図に示すフローチャートに対応したプログラム)を、システムあるいは装置に直接あるいは遠隔から供給し、そのシステムあるいは装置のコンピュータが該供給されたプログラムコードを読み出して実行することによっても達成される場合を含む。 In the present invention, a software program (in the embodiment, a program corresponding to the flowchart shown in the drawing) that realizes the functions of the above-described embodiment is directly or remotely supplied to the system or apparatus, and the computer of the system or apparatus Is also achieved by reading and executing the supplied program code.
従って、本発明の機能処理をコンピュータで実現するために、該コンピュータにインストールされるプログラムコード自体も本発明を実現するものである。つまり、本発明は、本発明の機能処理を実現するためのコンピュータプログラム自体も含まれる。 Accordingly, since the functions of the present invention are implemented by computer, the program code installed in the computer also implements the present invention. In other words, the present invention includes a computer program itself for realizing the functional processing of the present invention.
その場合、プログラムの機能を有していれば、オブジェクトコード、インタプリタにより実行されるプログラム、OSに供給するスクリプトデータ等の形態であっても良い。 In that case, as long as it has the function of a program, it may be in the form of object code, a program executed by an interpreter, script data supplied to the OS, or the like.
プログラムを供給するための記録媒体としては、例えば、フロッピー(登録商標)ディスク、ハードディスク、光ディスク、光磁気ディスク、MO、CD−ROM、CD−R、CD−RW、磁気テープ、不揮発性のメモリカード、ROM、DVD(DVD−ROM,DVD−R)などがある。 As a recording medium for supplying the program, for example, floppy (registered trademark) disk, hard disk, optical disk, magneto-optical disk, MO, CD-ROM, CD-R, CD-RW, magnetic tape, nonvolatile memory card ROM, DVD (DVD-ROM, DVD-R) and the like.
その他、プログラムの供給方法としては、クライアントコンピュータのブラウザを用いてインターネットのホームページに接続し、該ホームページから本発明のコンピュータプログラムそのもの、もしくは圧縮され自動インストール機能を含むファイルをハードディスク等の記録媒体にダウンロードすることによっても供給できる。また、本発明のプログラムを構成するプログラムコードを複数のファイルに分割し、それぞれのファイルを異なるホームページからダウンロードすることによっても実現可能である。つまり、本発明の機能処理をコンピュータで実現するためのプログラムファイルを複数のユーザに対してダウンロードさせるWWWサーバも、本発明に含まれるものである。 As another program supply method, a client computer browser is used to connect to an Internet homepage, and the computer program of the present invention itself or a compressed file including an automatic installation function is downloaded from the homepage to a recording medium such as a hard disk. Can also be supplied. It can also be realized by dividing the program code constituting the program of the present invention into a plurality of files and downloading each file from a different homepage. That is, the present invention includes a WWW server that allows a plurality of users to download a program file for realizing the functional processing of the present invention on a computer.
また、本発明のプログラムを暗号化してCD−ROM等の記憶媒体に格納してユーザに配布し、所定の条件をクリアしたユーザに対し、インターネットを介してホームページから暗号化を解く鍵情報をダウンロードさせ、その鍵情報を使用することにより暗号化されたプログラムを実行してコンピュータにインストールさせて実現することも可能である。 In addition, the program of the present invention is encrypted, stored in a storage medium such as a CD-ROM, distributed to users, and key information for decryption is downloaded from a homepage via the Internet to users who have cleared predetermined conditions. It is also possible to execute the encrypted program by using the key information and install the program on a computer.
また、コンピュータが、読み出したプログラムを実行することによって、前述した実施形態の機能が実現される他、そのプログラムの指示に基づき、コンピュータ上で稼動しているOSなどが、実際の処理の一部または全部を行い、その処理によっても前述した実施形態の機能が実現され得る。 In addition to the functions of the above-described embodiments being realized by the computer executing the read program, the OS running on the computer based on the instruction of the program is a part of the actual processing. Alternatively, the functions of the above-described embodiment can be realized by performing all of the processes.
さらに、記録媒体から読み出されたプログラムが、コンピュータに挿入された機能拡張ボードやコンピュータに接続された機能拡張ユニットに備わるメモリに書き込まれた後、そのプログラムの指示に基づき、その機能拡張ボードや機能拡張ユニットに備わるCPUなどが実際の処理の一部または全部を行い、その処理によっても前述した実施形態の機能が実現される。 Furthermore, after the program read from the recording medium is written in a memory provided in a function expansion board inserted into the computer or a function expansion unit connected to the computer, the function expansion board or The CPU or the like provided in the function expansion unit performs part or all of the actual processing, and the functions of the above-described embodiments are realized by the processing.
101 CPU
102 ROM
103 RAM
104 外部記憶装置
105 ディスプレイ
106 キーボード
107 ポインティングデバイス
108 スキャナ
109 ネットワークインタフェース
110 バス
101 CPU
102 ROM
103 RAM
104
Claims (14)
前記基準部分画像領域に含まれる文字行の射影を検出する基準射影検出手段と、
前記基準部分画像領域の位置から行先端方向に部分画像領域の幅分スライドさせた位置に第1の部分画像領域を設定する第1部分画像領域設定手段と、
当該新たに設定した第1の部分画像領域内から検出される文字行の射影の位置と、前記第1の部分画像領域の行終端方向に隣接する部分画像領域内から検出される文字行の射影の位置とを比較することにより、文字行の射影に連続性があるか否かを判定する第1判定手段と、
前記第1判定手段で連続性がないと判定されるまで、その時点で設定されている第1の部分画像領域の位置から行先端方向に部分画像領域の幅分スライドさせた位置に新たな第1の部分画像領域を設定して前記第1判定手段による判定を繰り返し、前記第1判定手段で連続性がないと判定された時点で設定されている第1の部分画像領域の1つ前に設定された第1の部分画像領域を行先端の部分画像領域として決定する行先端部分画像領域決定手段と、
前記基準部分画像領域の位置から行終端方向に部分画像領域の幅分スライドさせた位置に第2の部分画像領域を設定する第2部分画像領域設定手段と、
当該新たに設定した第2の部分画像領域内から検出される文字行の射影の位置と、前記第2の部分画像領域の行先端方向に隣接する部分画像領域内から検出される文字行の射影の位置とを比較することにより、文字行の射影に連続性があるか否かを判定する第2判定手段と、
前記第2判定手段で連続性がないと判定されるまで、その時点で設定されている第2の部分画像領域の位置から行終端方向に部分画像領域の幅分スライドさせた位置に新たな第2の部分画像領域を設定して前記第2判定手段による判定を繰り返し、前記第2判定手段で連続性がないと判定された時点で設定されている第2の部分画像領域の1つ前に設定された第2の部分画像領域を行終端の部分画像領域として決定する行終端部分画像領域決定手段と、
前記行先端部分画像領域決定手段で決定された行先端の部分画像領域から検出される射影と前記行終端部分画像領域決定手段で決定された行終端の部分画像領域から検出される射影との間の相関関係と、前記行先端の部分画像領域と前記行終端の部分画像領域との間隔とに基づいて、前記文書画像の傾きを決定する決定手段と
を備えることを特徴とする画像処理装置。 Reference setting means for setting a partial image area having a predetermined size as a reference partial image area at a predetermined position in the input document image;
Reference projection detection means for detecting a projection of a character line included in the reference partial image region;
First partial image area setting means for setting the first partial image area at a position slid by the width of the partial image area from the position of the reference partial image area in the row leading direction;
The projection position of the character line detected from the newly set first partial image area and the projection of the character line detected from the partial image area adjacent to the line end direction of the first partial image area A first determination means for determining whether or not the projection of the character line has continuity by comparing with the position of
Until the first determination means determines that there is no continuity, a new second position is set at a position that is slid by the width of the partial image area from the position of the first partial image area set at that time in the row leading direction. 1 partial image region is set and the determination by the first determination unit is repeated, and the first determination unit determines that there is no continuity, and immediately before the first partial image region set. A line leading edge partial image area determining means for determining the set first partial image area as a partial image area at the line leading edge;
Second partial image area setting means for setting a second partial image area at a position slid by the width of the partial image area in the row end direction from the position of the reference partial image area;
Projection position of the character line detected from the newly set second partial image area, and projection of the character line detected from the partial image area adjacent to the second partial image area in the line leading direction A second determination means for determining whether or not the projection of the character line has continuity by comparing with the position of
Until the second determination means determines that there is no continuity, a new second position is obtained by sliding the position of the second partial image area set at that time from the position of the second partial image area by the width of the partial image area. 2 partial image areas are set and the determination by the second determining means is repeated, and the second partial image area is set immediately before the second partial image area determined when the second determining means determines that there is no continuity. A line end partial image area determining means for determining the set second partial image area as a line end partial image area;
Between the projection detected from the partial image area at the line leading end determined by the line leading end partial image area determining means and the projection detected from the partial image area at the line end determined by the line end partial image area determining means And determining means for determining an inclination of the document image based on the correlation between the partial image area and the interval between the partial image area at the front end of the line and the partial image area at the end of the line.
当該複数の所定の位置のそれぞれに設定された基準部分画像領域に対して、前記第1部分画像領域設定手段と前記第1判定手段と前記行先端部分画像領域決定手段と前記第2部分画像領域設定手段と前記第2判定手段と前記行終端部分画像領域決定手段と前記決定手段とによる処理を行うことにより、前記複数の所定の位置それぞれにおける傾きを決定し、当該決定された複数の傾きに基づいて前記文書画像の傾きを決定することを特徴とする請求項1または2に記載の画像処理装置。 The reference setting means sets the reference partial image region of the predetermined size at a plurality of predetermined positions in the document image;
The first partial image area setting means, the first determining means, the row leading edge partial image area determining means, and the second partial image area with respect to the reference partial image areas set at each of the plurality of predetermined positions. By performing processing by the setting unit, the second determination unit, the line end partial image region determination unit, and the determination unit, the inclinations at the plurality of predetermined positions are determined, and the determined plurality of inclinations are determined. The image processing apparatus according to claim 1, wherein an inclination of the document image is determined based on the document image.
前記基準部分画像領域に含まれる文字行の射影を検出する基準射影検出手段と、
前記基準部分画像領域の位置から行先端方向に部分画像領域の幅分スライドさせた位置に第1の部分画像領域を設定する第1部分画像領域設定手段と、
当該新たに設定した第1の部分画像領域内から検出される文字行の射影の位置と、前記第1の部分画像領域の行終端方向に隣接する部分画像領域内から検出される文字行の射影の位置とを比較することにより、文字行の射影に連続性があるか否かを判定する第1判定手段と、
前記第1判定手段で連続性がないと判定されるまで、その時点で設定されている第1の部分画像領域の位置から行先端方向に部分画像領域の幅分スライドさせた位置に新たな第1の部分画像領域を設定して前記第1判定手段による判定を繰り返し、前記第1判定手段で連続性がないと判定された時点で設定されている第1の部分画像領域の2つ前に設定された第1の部分画像領域を行先端の部分画像領域として決定する行先端部分画像領域決定手段と、
前記基準部分画像領域の位置から行終端方向に部分画像領域の幅分スライドさせた位置に第2の部分画像領域を設定する第2部分画像領域設定手段と、
当該新たに設定した第2の部分画像領域内から検出される文字行の射影の位置と、前記第2の部分画像領域の行先端方向に隣接する部分画像領域内から検出される文字行の射影の位置とを比較することにより、文字行の射影に連続性があるか否かを判定する第2判定手段と、
前記第2判定手段で連続性がないと判定されるまで、その時点で設定されている第2の部分画像領域の位置から行終端方向に部分画像領域の幅分スライドさせた位置に新たな第2の部分画像領域を設定して前記第2判定手段による判定を繰り返し、前記第2判定手段で連続性がないと判定された時点で設定されている第2の部分画像領域の2つ前に設定された第2の部分画像領域を行終端の部分画像領域として決定する行終端部分画像領域決定手段と、
前記行先端部分画像領域決定手段で決定された行先端の部分画像領域から検出される射影と前記行終端部分画像領域決定手段で決定された行終端の部分画像領域から検出される射影との間の相関関係と、前記行先端の部分画像領域と前記行終端の部分画像領域との間隔とに基づいて、前記文書画像の傾きを決定する決定手段と
を備えることを特徴とする画像処理装置。 Reference setting means for setting a partial image area having a predetermined size as a reference partial image area at a predetermined position in the input document image;
Reference projection detection means for detecting a projection of a character line included in the reference partial image region;
First partial image area setting means for setting the first partial image area at a position slid by the width of the partial image area from the position of the reference partial image area in the row leading direction;
The projection position of the character line detected from the newly set first partial image area and the projection of the character line detected from the partial image area adjacent to the line end direction of the first partial image area A first determination means for determining whether or not the projection of the character line has continuity by comparing with the position of
Until the first determination means determines that there is no continuity, a new second position is set at a position that is slid by the width of the partial image area from the position of the first partial image area set at that time in the row leading direction. One partial image area is set and the determination by the first determination unit is repeated, and the first determination unit determines that there is no continuity, and is two before the first partial image area set. A line leading edge partial image area determining means for determining the set first partial image area as a partial image area at the line leading edge;
Second partial image area setting means for setting a second partial image area at a position slid by the width of the partial image area in the row end direction from the position of the reference partial image area;
Projection position of the character line detected from the newly set second partial image area, and projection of the character line detected from the partial image area adjacent to the second partial image area in the line leading direction A second determination means for determining whether or not the projection of the character line has continuity by comparing with the position of
Until the second determination means determines that there is no continuity, a new second position is obtained by sliding the position of the second partial image area set at that time from the position of the second partial image area by the width of the partial image area. 2 partial image areas are set, the determination by the second determination unit is repeated, and the second determination unit determines that there is no continuity, and is two before the second partial image area set. A line end partial image area determining means for determining the set second partial image area as a line end partial image area;
Between the projection detected from the partial image area at the line leading end determined by the line leading end partial image area determining means and the projection detected from the partial image area at the line end determined by the line end partial image area determining means And determining means for determining an inclination of the document image based on the correlation between the partial image area and the interval between the partial image area at the front end of the line and the partial image area at the end of the line.
前記画像処理装置の基準設定手段が、画像処理装置に入力された文書画像内の所定の位置に、予め決められた大きさの部分画像領域を基準部分画像領域として設定する基準設定工程と、
前記画像処理装置の基準射影検出手段が、前記基準部分画像領域に含まれる文字行の射影を検出する基準射影検出工程と、
前記画像処理装置の第1部分画像領域設定手段が、前記基準部分画像領域の位置から行先端方向に部分画像領域の幅分スライドさせた位置に第1の部分画像領域を設定する第1部分画像領域設定工程と、
前記画像処理装置の第1判定手段が、当該新たに設定した第1の部分画像領域内から検出される文字行の射影の位置と、前記第1の部分画像領域の行終端方向に隣接する部分画像領域内から検出される文字行の射影の位置とを比較することにより、文字行の射影に連続性があるか否かを判定する第1判定工程と、
前記画像処理装置の行先端部分画像領域決定手段が、前記第1判定工程で連続性がないと判定されるまで、その時点で設定されている第1の部分画像領域の位置から行先端方向に部分画像領域の幅分スライドさせた位置に新たな第1の部分画像領域を設定して前記第1判定工程における判定を繰り返し、前記第1判定工程で連続性がないと判定された時点で設定されている第1の部分画像領域の1つ前に設定された第1の部分画像領域を行先端の部分画像領域として決定する行先端部分画像領域決定工程と、
前記画像処理装置の第2部分画像領域設定手段が、前記基準部分画像領域の位置から行終端方向に部分画像領域の幅分スライドさせた位置に第2の部分画像領域を設定する第2部分画像領域設定工程と、
前記画像処理装置の第2判定手段が、当該新たに設定した第2の部分画像領域内から検出される文字行の射影の位置と、前記第2の部分画像領域の行先端方向に隣接する部分画像領域内から検出される文字行の射影の位置とを比較することにより、文字行の射影に連続性があるか否かを判定する第2判定工程と、
前記画像処理装置の行終端部分画像領域決定手段が、前記第2判定工程で連続性がないと判定されるまで、その時点で設定されている第2の部分画像領域の位置から行終端方向に部分画像領域の幅分スライドさせた位置に新たな第2の部分画像領域を設定して前記第2判定工程による判定を繰り返し、前記第2判定工程で連続性がないと判定された時点で設定されている第2の部分画像領域の1つ前に設定された第2の部分画像領域を行終端の部分画像領域として決定する行終端部分画像領域決定工程と、
前記画像処理装置の決定手段が、前記行先端部分画像領域決定工程で決定された行先端の部分画像領域から検出される射影と前記行終端部分画像領域決定工程で決定された行終端の部分画像領域から検出される射影との間の相関関係と、前記行先端の部分画像領域と前記行終端の部分画像領域との間隔とに基づいて、前記文書画像の傾きを決定する決定工程と
を有することを特徴とする画像処理方法。 An image processing method in an image processing apparatus,
A reference setting step in which a reference setting unit of the image processing apparatus sets a partial image area having a predetermined size as a reference partial image area at a predetermined position in a document image input to the image processing apparatus;
A reference projection detecting step of the image processing apparatus for detecting a projection of a character line included in the reference partial image region; and
A first partial image area setting unit of the image processing apparatus sets a first partial image area at a position slid by the width of the partial image area from the position of the reference partial image area in the row leading direction. An area setting process;
A portion adjacent to the position of projection of the character line detected from the newly set first partial image area by the first determination means of the image processing device and the line end direction of the first partial image area A first determination step of determining whether the projection of the character line has continuity by comparing the position of the projection of the character line detected from within the image region;
From the position of the first partial image area set at that time in the direction of the line leading edge, until the line leading edge partial image area determining means of the image processing device determines that there is no continuity in the first determining step A new first partial image area is set at a position slid by the width of the partial image area, the determination in the first determination step is repeated, and is set when it is determined that there is no continuity in the first determination step. A line leading edge partial image area determining step for determining a first partial image area set immediately before the first partial image area being set as a partial image area at the leading edge of the line;
A second partial image area in which the second partial image area setting means of the image processing apparatus sets the second partial image area at a position slid from the position of the reference partial image area by the width of the partial image area in the row end direction. An area setting process;
A portion adjacent to the position of projection of the character line detected from the newly set second partial image area by the second determination means of the image processing apparatus and the line front end direction of the second partial image area A second determination step of determining whether the projection of the character line has continuity by comparing the position of the projection of the character line detected from within the image region;
Until the line end partial image area determining means of the image processing apparatus determines that there is no continuity in the second determination step, the position of the second partial image area set at that time is moved in the line end direction. A new second partial image area is set at a position slid by the width of the partial image area, the determination by the second determination step is repeated, and is set when it is determined that there is no continuity in the second determination step A line end partial image area determining step of determining a second partial image area set immediately before the second partial image area being set as a partial image area at the line end;
Projection detected by the determining means of the image processing device from the partial image region at the line leading end determined in the line leading partial image region determining step and the line end partial image determined in the line end partial image region determining step A determination step of determining an inclination of the document image based on a correlation between projections detected from the region and an interval between the partial image region at the top of the line and the partial image region at the end of the line. An image processing method.
前記行終端部分画像領域決定工程は、前記第2判定工程で連続性がないと判定されるまで、その時点で設定されている第2の部分画像領域の位置から行終端方向に部分画像領域の幅分スライドさせた位置に新たな第2の部分画像領域を設定して前記第2判定工程による判定を繰り返し、前記第2判定工程で連続性がないと判定された時点で設定されている第2の部分画像領域の2つ前に設定された第2の部分画像領域を行終端の部分画像領域として決定することを特徴とする請求項7に記載の画像処理方法。 The line leading edge partial image region determining step determines the partial image region in the row leading direction from the position of the first partial image region set at that time until it is determined that there is no continuity in the first determining step. A new first partial image region is set at a position slid by a width, and the determination by the first determination step is repeated, and the first setting is set when it is determined that there is no continuity in the first determination step. A first partial image area set two times before one partial image area is determined as a partial image area at the top of a line;
In the line end partial image area determination step, until it is determined in the second determination step that there is no continuity, the position of the partial image area in the line end direction from the position of the second partial image area set at that time is determined. A new second partial image region is set at a position slid by a width, and the determination by the second determination step is repeated, and the second set is set when it is determined that there is no continuity in the second determination step. 8. The image processing method according to claim 7, wherein the second partial image area set immediately before the second partial image area is determined as the partial image area at the end of the line.
当該複数の所定の位置のそれぞれに設定された基準部分画像領域に対して、前記第1部分画像領域設定手段と前記第1判定手段と前記行先端部分画像領域決定手段と前記第2部分画像領域設定手段と前記第2判定手段と前記行終端部分画像領域決定手段と前記決定手段とによる処理を行うことにより、前記複数の所定の位置それぞれにおける傾きを決定し、当該決定された複数の傾きに基づいて前記文書画像の傾きを決定することを特徴とする請求項7乃至9のいずれか1項に記載の画像処理方法。 In the reference setting step, the reference partial image region having the predetermined size is set at a plurality of predetermined positions in the document image.
The first partial image area setting means, the first determining means, the row leading edge partial image area determining means, and the second partial image area with respect to the reference partial image areas set at each of the plurality of predetermined positions. By performing processing by the setting unit, the second determination unit, the line end partial image region determination unit, and the determination unit, the inclinations at the plurality of predetermined positions are determined, and the determined plurality of inclinations are determined. The image processing method according to claim 7, wherein an inclination of the document image is determined based on the document image.
入力された文書画像内の所定の位置に、予め決められた大きさの部分画像領域を基準部分画像領域として設定する基準設定手段と、
前記基準部分画像領域に含まれる文字行の射影を検出する基準射影検出手段と、
前記基準部分画像領域の位置から行先端方向に部分画像領域の幅分スライドさせた位置に第1の部分画像領域を設定する第1部分画像領域設定手段と、
当該新たに設定した第1の部分画像領域内から検出される文字行の射影の位置と、前記第1の部分画像領域の行終端方向に隣接する部分画像領域内から検出される文字行の射影の位置とを比較することにより、文字行の射影に連続性があるか否かを判定する第1判定手段と、
前記第1判定手段で連続性がないと判定されるまで、その時点で設定されている第1の部分画像領域の位置から行先端方向に部分画像領域の幅分スライドさせた位置に新たな第1の部分画像領域を設定して前記第1判定手段による判定を繰り返し、前記第1判定手段で連続性がないと判定された時点で設定されている第1の部分画像領域の1つ前に設定された第1の部分画像領域を行先端の部分画像領域として決定する行先端部分画像領域決定手段と、
前記基準部分画像領域の位置から行終端方向に部分画像領域の幅分スライドさせた位置に第2の部分画像領域を設定する第2部分画像領域設定手段と、
当該新たに設定した第2の部分画像領域内から検出される文字行の射影の位置と、前記第2の部分画像領域の行先端方向に隣接する部分画像領域内から検出される文字行の射影の位置とを比較することにより、文字行の射影に連続性があるか否かを判定する第2判定手段と、
前記第2判定手段で連続性がないと判定されるまで、その時点で設定されている第2の部分画像領域の位置から行終端方向に部分画像領域の幅分スライドさせた位置に新たな第2の部分画像領域を設定して前記第2判定手段による判定を繰り返し、前記第2判定手段で連続性がないと判定された時点で設定されている第2の部分画像領域の1つ前に設定された第2の部分画像領域を行終端の部分画像領域として決定する行終端部分画像領域決定手段と、
前記行先端部分画像領域決定手段で決定された行先端の部分画像領域から検出される射影と前記行終端部分画像領域決定手段で決定された行終端の部分画像領域から検出される射影との間の相関関係と、前記行先端の部分画像領域と前記行終端の部分画像領域との間隔とに基づいて、前記文書画像の傾きを決定する決定手段と
して機能させるためのプログラム。 Computer
Reference setting means for setting a partial image area having a predetermined size as a reference partial image area at a predetermined position in the input document image;
Reference projection detection means for detecting a projection of a character line included in the reference partial image region;
First partial image area setting means for setting the first partial image area at a position slid by the width of the partial image area from the position of the reference partial image area in the row leading direction;
The projection position of the character line detected from the newly set first partial image area and the projection of the character line detected from the partial image area adjacent to the line end direction of the first partial image area A first determination means for determining whether or not the projection of the character line has continuity by comparing with the position of
Until the first determination means determines that there is no continuity, a new second position is set at a position that is slid by the width of the partial image area from the position of the first partial image area set at that time in the row leading direction. 1 partial image region is set and the determination by the first determination unit is repeated, and the first determination unit determines that there is no continuity, and immediately before the first partial image region set. A line leading edge partial image area determining means for determining the set first partial image area as a partial image area at the line leading edge;
Second partial image area setting means for setting a second partial image area at a position slid by the width of the partial image area in the row end direction from the position of the reference partial image area;
Projection position of the character line detected from the newly set second partial image area, and projection of the character line detected from the partial image area adjacent to the second partial image area in the line leading direction A second determination means for determining whether or not the projection of the character line has continuity by comparing with the position of
Until the second determination means determines that there is no continuity, a new second position is obtained by sliding the position of the second partial image area set at that time from the position of the second partial image area by the width of the partial image area. 2 partial image areas are set and the determination by the second determining means is repeated, and the second partial image area is set immediately before the second partial image area determined when the second determining means determines that there is no continuity. A line end partial image area determining means for determining the set second partial image area as a line end partial image area;
Between the projection detected from the partial image area at the line leading end determined by the line leading end partial image area determining means and the projection detected from the partial image area at the line end determined by the line end partial image area determining means And a program for causing the document image to function as a determination unit that determines the inclination of the document image based on the correlation between the partial image area and the interval between the partial image area at the top of the line and the partial image area at the line end.
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP2004090063A JP4497974B2 (en) | 2004-03-25 | 2004-03-25 | Image processing apparatus, image processing method, program, and storage medium |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP2004090063A JP4497974B2 (en) | 2004-03-25 | 2004-03-25 | Image processing apparatus, image processing method, program, and storage medium |
Publications (3)
| Publication Number | Publication Date |
|---|---|
| JP2005275951A JP2005275951A (en) | 2005-10-06 |
| JP2005275951A5 JP2005275951A5 (en) | 2007-02-08 |
| JP4497974B2 true JP4497974B2 (en) | 2010-07-07 |
Family
ID=35175541
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| JP2004090063A Expired - Fee Related JP4497974B2 (en) | 2004-03-25 | 2004-03-25 | Image processing apparatus, image processing method, program, and storage medium |
Country Status (1)
| Country | Link |
|---|---|
| JP (1) | JP4497974B2 (en) |
Families Citing this family (1)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| JP5280337B2 (en) * | 2009-11-18 | 2013-09-04 | 株式会社神戸製鋼所 | Character recognition method and character recognition device |
Family Cites Families (4)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| JPH03212780A (en) * | 1990-01-18 | 1991-09-18 | Fuji Xerox Co Ltd | Detector for inclination of character string |
| JPH04177583A (en) * | 1990-11-09 | 1992-06-24 | Seiko Epson Corp | Tilt angle detection method |
| JPH08235307A (en) * | 1995-02-27 | 1996-09-13 | Nec Corp | Character string detector |
| JP4114959B2 (en) * | 1995-06-20 | 2008-07-09 | キヤノン株式会社 | Image processing method and apparatus |
-
2004
- 2004-03-25 JP JP2004090063A patent/JP4497974B2/en not_active Expired - Fee Related
Also Published As
| Publication number | Publication date |
|---|---|
| JP2005275951A (en) | 2005-10-06 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| EP2241999B1 (en) | Underline removal apparatus | |
| JP5906788B2 (en) | Character cutout method, and character recognition apparatus and program using this method | |
| JP3615333B2 (en) | Ruled line eraser | |
| JP4497974B2 (en) | Image processing apparatus, image processing method, program, and storage medium | |
| JP2008167009A (en) | Image processing device and method, and program | |
| JP2009251872A (en) | Information processing device and information processing program | |
| US7769234B2 (en) | Ruled line extracting program, ruled line extracting apparatus and ruled line extracting method | |
| JP4434802B2 (en) | Image processing apparatus, image processing method, program, and storage medium | |
| JP3516541B2 (en) | Method and apparatus for recognizing dimension information of construction drawings | |
| JP4434803B2 (en) | Image processing apparatus, image processing method, program, and storage medium | |
| JP4804433B2 (en) | Image processing apparatus, image processing method, and image processing program | |
| US8270725B2 (en) | System and method for optical mark recognition | |
| JP2006343960A (en) | Image processing apparatus, image processing method, program, and storage medium | |
| JP3927171B2 (en) | Noise removing apparatus and method, program, and recording medium | |
| JPH10254991A (en) | Ruled line erasing method and machine readable medium | |
| JP2010103862A (en) | Document processing apparatus and method | |
| JP5845724B2 (en) | Image processing apparatus and image processing program | |
| JP2006072524A (en) | Information processing apparatus and information processing method | |
| JP7824721B1 (en) | Image processing system, image processing method and program | |
| JP2015176522A (en) | Information processing device and program | |
| JP2002074264A (en) | Image processing apparatus, image processing method, and recording medium | |
| JP2003016385A (en) | Image processing apparatus, method, program, and storage medium | |
| JP5991076B2 (en) | Image processing apparatus and image processing program | |
| KR20180085914A (en) | Apparatus, method, and computer-readable storage medium for determining a rotation angle of text | |
| JP2003030585A (en) | Image processing apparatus, method, program, and storage medium |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| A521 | Request for written amendment filed |
Free format text: JAPANESE INTERMEDIATE CODE: A523 Effective date: 20061214 |
|
| A621 | Written request for application examination |
Free format text: JAPANESE INTERMEDIATE CODE: A621 Effective date: 20061214 |
|
| A131 | Notification of reasons for refusal |
Free format text: JAPANESE INTERMEDIATE CODE: A131 Effective date: 20090904 |
|
| A521 | Request for written amendment filed |
Free format text: JAPANESE INTERMEDIATE CODE: A523 Effective date: 20091104 |
|
| A131 | Notification of reasons for refusal |
Free format text: JAPANESE INTERMEDIATE CODE: A131 Effective date: 20091218 |
|
| A521 | Request for written amendment filed |
Free format text: JAPANESE INTERMEDIATE CODE: A523 Effective date: 20091225 |
|
| 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: 20100402 |
|
| A01 | Written decision to grant a patent or to grant a registration (utility model) |
Free format text: JAPANESE INTERMEDIATE CODE: A01 |
|
| A61 | First payment of annual fees (during grant procedure) |
Free format text: JAPANESE INTERMEDIATE CODE: A61 Effective date: 20100413 |
|
| FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20130423 Year of fee payment: 3 |
|
| R150 | Certificate of patent or registration of utility model |
Ref document number: 4497974 Country of ref document: JP Free format text: JAPANESE INTERMEDIATE CODE: R150 Free format text: JAPANESE INTERMEDIATE CODE: R150 |
|
| FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20130423 Year of fee payment: 3 |
|
| FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20140423 Year of fee payment: 4 |
|
| LAPS | Cancellation because of no payment of annual fees |