JP6204076B2 - Text area reading order determination apparatus, text area reading order determination method, and text area reading order determination program - Google Patents
Text area reading order determination apparatus, text area reading order determination method, and text area reading order determination program Download PDFInfo
- Publication number
- JP6204076B2 JP6204076B2 JP2013121781A JP2013121781A JP6204076B2 JP 6204076 B2 JP6204076 B2 JP 6204076B2 JP 2013121781 A JP2013121781 A JP 2013121781A JP 2013121781 A JP2013121781 A JP 2013121781A JP 6204076 B2 JP6204076 B2 JP 6204076B2
- Authority
- JP
- Japan
- Prior art keywords
- sentence
- index
- dividing
- area
- order
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Active
Links
Images
Landscapes
- Character Input (AREA)
- Document Processing Apparatus (AREA)
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
Description
本発明は、文章領域の読み取り順序を判定する技術に関する。 The present invention relates to a technique for determining the reading order of a text area.
文書画像内の文章をテキストデータに変換したり、文書画像を表示装置の画面サイズに合わせて並び替えたりする(リフロー)ため、文書画像を文章毎の領域に分割し、各文章領域の読み取り順序を判定する方法がある(特許文献1)。 In order to convert the text in the document image into text data, or to rearrange the document image according to the screen size of the display device (reflow), the document image is divided into areas for each text, and the reading order of each text area There is a method of determining (Patent Document 1).
しかしながら、文章領域間に罫線を人為的に挿入しない場合、その読み取り順序の判定精度が低下し、一意に決まらない可能性がある。 However, if the ruled lines are not artificially inserted between the text areas, the accuracy of determining the reading order may be reduced and may not be determined uniquely.
本発明は、上記事情を鑑みてなされたものであり、文章領域の読み取り順序の判定精度を改善することを目的とする。 The present invention has been made in view of the above circumstances, and an object thereof is to improve the determination accuracy of the reading order of a text area.
請求項1に記載の文章領域読み取り順序判定装置は、記憶手段からコンテンツを読み出して複数の文章領域に分割し、各文章領域に対してインデックスをそれぞれ付与する分割・付与手段と、前記コンテンツの書字方向と前記各インデックスに基づき、前記各文章領域の読み取り順序を判定する判定手段と、を有することを要旨とする。
The sentence area reading order determination device according to
本発明によれば、コンテンツを複数の文章領域に分割してインデックスをそれぞれ付与し、そのコンテンツの書字方向と各インデックスに基づき各文章領域の読み取り順序を判定するため、文章領域の読み取り順序の判定精度を向上できる。 According to the present invention, the content is divided into a plurality of text areas, each index is assigned, and the reading order of each text area is determined based on the writing direction of each content and each index. The determination accuracy can be improved.
請求項2に記載の文章領域読み取り順序判定装置は、請求項1に記載の文章領域読み取り順序判定装置において、前記分割・付与手段は、前記コンテンツを左右又は上下に分割し、前記分割した分割パターンを識別する識別子を更に付与することを要旨とする。
The sentence area reading order determining apparatus according to
請求項3に記載の文章領域読み取り順序判定装置は、請求項1又は2に記載の文章領域読み取り順序判定装置において、前記分割・付与手段は、前記コンテンツを左右又は上下に分割する各分割パターンを交互に変えて前記文章領域を繰り返し分割することを要旨とする。
The sentence region reading order determination device according to
請求項4に記載の文章領域読み取り順序判定装置は、請求項1乃至3のいずれかに記載の文章領域読み取り順序判定装置において、隣り合う2つの文章領域が、1回又は複数回分割された後において共に再分割されておらず、並びに、左右に分割され及び共に縦書き、又は、上下に分割され及び共に横書きの場合、当該各文章領域を再結合する再結合手段を更に有することを要旨とする。
The sentence area reading order determination device according to claim 4 is the sentence area reading order determination apparatus according to any one of
請求項5に記載の文章領域読み取り順序判定装置は、請求項4に記載の文章領域読み取り順序判定装置において、前記再結合手段は、前記2つの文章領域の間隔が閾値以下の場合に、当該各文章領域を再結合することを要旨とする。 The sentence region reading order determining device according to claim 5 is the sentence region reading order determining device according to claim 4, wherein the recombination means is configured such that each interval between the two sentence regions is equal to or less than a threshold value. The gist is to recombine the text areas.
請求項6に記載の文章領域読み取り順序判定装置は、請求項1乃至5のいずれかに記載の文章領域読み取り順序判定装置において、隣り合う2つの文章領域が、共に1行であり、並びに、左右に分割され及び共に横書き、又は、上下に分割され及び共に縦書きの場合、当該各文章領域を再結合する再結合手段を更に有することを要旨とする。
The sentence region reading order determination device according to claim 6 is the sentence region reading order determination device according to any one of
請求項7に記載の文章領域読み取り順序判定装置は、請求項1乃至6のいずれかに記載の文章領域読み取り順序判定装置において、前記分割・付与手段は、左右に分割する場合、前記インデックスを左側の文章領域から順番に付与し、上下に分割する場合、前記インデックスを上側の文章領域から順番に付与することを要旨とする。
The sentence region reading order determination device according to claim 7 is the sentence region reading order determination device according to any one of
請求項8に記載の文章領域読み取り順序判定装置は、請求項7に記載の文章領域読み取り順序判定装置において、前記分割・付与手段は、前記左側から付与する場合、−1,−2,−3,…,と前記インデックスを付与し、前記上側から付与する場合、+1,+2,+3,…,と前記インデックスを付与することを要旨とする。 The sentence region reading order determining device according to claim 8 is the sentence region reading order determining device according to claim 7, wherein the dividing / applying unit assigns −1, −2, −3 when assigning from the left side. ,..., And when the index is given from the upper side, the gist is to give the index as +1, +2, +3,.
請求項9に記載の文章領域読み取り順序判定装置は、請求項1乃至8のいずれかに記載の文章領域読み取り順序判定装置において、前記分割・付与手段は、前記コンテンツに含まれる罫線の位置で分割することを要旨とする。
The sentence region reading order determination device according to claim 9 is the sentence region reading order determination device according to any one of
請求項10に記載の文章領域読み取り順序判定装置は、請求項1乃至9のいずれかに記載の文章領域読み取り順序判定装置において、前記判定手段は、左右に分割されている場合、前記コンテンツの書字方向が横書きであれば、順序が先のインデックスを付与する文章領域を先とし、縦書きであれば、当該文章領域を後とし、上下に分割されている場合、当該文章領域を先と判定することを要旨とする。
The sentence region reading order determination device according to claim 10 is the sentence region reading order determination device according to any one of
請求項11に記載の文章領域読み取り順序判定装置は、請求項8に記載の文章領域読み取り順序判定装置において、前記判定手段は、前記−1,−2,−3,…,と付与された場合、前記コンテンツの書字方向が横書きであれば、絶対値が小さい方のインデックスを付与する文章領域を先とし、縦書きであれば、当該文章領域を後と判定することを要旨とする。
The sentence region reading order determination device according to
請求項12に記載の文章領域読み取り順序判定装置は、請求項1乃至11のいずれかに記載の文章領域読み取り順序判定装置において、前記判定手段は、前記各文章領域の書字方向の推定結果に基づき、前記コンテンツの書字方向を決定することを要旨とする。
The sentence region reading order determining device according to
請求項13に記載の文章領域読み取り順序判定方法は、コンピュータにより、記憶手段からコンテンツを読み出して複数の文章領域に分割し、各文章領域に対してインデックスをそれぞれ付与する分割・付与ステップと、前記コンテンツの書字方向と前記各インデックスに基づき、前記各文章領域の読み取り順序を判定する判定ステップと、を有することを要旨とする。
The sentence area reading order determination method according to
本発明によれば、コンテンツを複数の文章領域に分割してインデックスをそれぞれ付与し、そのコンテンツの書字方向と各インデックスに基づき各文章領域の読み取り順序を判定するため、文章領域の読み取り順序の判定精度を向上できる。 According to the present invention, the content is divided into a plurality of text areas, each index is assigned, and the reading order of each text area is determined based on the writing direction of each content and each index. The determination accuracy can be improved.
請求項14に記載の文章領域読み取り順序判定プログラムは、コンピュータに、記憶手段からコンテンツを読み出して複数の文章領域に分割し、各文章領域に対してインデックスをそれぞれ付与する分割・付与処理と、前記コンテンツの書字方向と前記各インデックスに基づき、前記各文章領域の読み取り順序を判定する判定処理と、を実行させることを要旨とする。
The sentence area reading order determination program according to
本発明によれば、コンテンツを複数の文章領域に分割してインデックスをそれぞれ付与し、そのコンテンツの書字方向と各インデックスに基づき各文章領域の読み取り順序を判定するため、文章領域の読み取り順序の判定精度を向上できる。 According to the present invention, the content is divided into a plurality of text areas, each index is assigned, and the reading order of each text area is determined based on the writing direction of each content and each index. The determination accuracy can be improved.
本発明によれば、文章領域の読み取り順序の判定精度を向上できる。 ADVANTAGE OF THE INVENTION According to this invention, the determination precision of the reading order of a text area can be improved.
以下、本発明を実施する一実施の形態について図面を用いて説明する。 Hereinafter, an embodiment for carrying out the present invention will be described with reference to the drawings.
図1は、本実施の形態に係る文章領域読み取り順序判定装置1の機能ブロック構成を示す図である。この文章領域読み取り順序判定装置1は、コンテンツ記憶部11と、文書画像領域抽出部12と、文書画像領域分割部13と、書字推定部14と、分割処理キャンセル部15と、文章領域読み取り順序判定部16とで構成される。
FIG. 1 is a diagram showing a functional block configuration of a text area reading
コンテンツ記憶部11は、スキャナ装置等を用いて文章領域読み取り順序判定装置1に入力された複数のコンテンツを記憶するメモリ等の機能部である。
The
文書画像領域抽出部12は、コンテンツ記憶部11から判定対象のコンテンツを読み出して、文書画像領域を抽出する機能部である。
The document image
文書画像領域分割部13は、抽出された文書画像領域を複数の文章領域に分割し、各文章領域に対してインデックスをそれぞれ付与する機能部である。
The document image
書字推定部14は、各文章領域に含まれる文章の書字方向(横書き・縦書き)や行数を推定する機能部である。
The
分割処理キャンセル部15は、実行された分割処理を条件に応じてキャンセルする、つまり、分割前の文章領域に戻るように分割後の文章領域を再結合する機能部である。
The division
文章領域読み取り順序判定部16は、各文章領域の書字方向の推定結果から文書画像領域全体の書字方向を決定し、文書画像領域の書字方向と各インデックスに基づき、各文章領域の読み取り順序を判定する機能部である。
The sentence area reading
このような機能部を有する文章領域読み取り順序判定装置1は、メモリやCPUを備えたコンピュータで実現できる。また、各機能部の処理は、プログラムによって実行可能である。
The sentence region reading
図2は、文章領域読み取り順序判定方法の処理フローを示す図である。図2を参照しながら、その判定方法について説明する。 FIG. 2 is a diagram showing a processing flow of the sentence region reading order determination method. The determination method will be described with reference to FIG.
最初に、文書画像領域抽出部12により、コンテンツ記憶部11から判定対象のコンテンツが読み出され、印刷のある部分を黒色に変換し、印刷のない部分を白色に変換することで、コンテンツの2値化画像が生成される(ステップS1)。
First, the document image
この2値化処理は、コンテンツ内の文字が黒色以外の濃淡値(赤文字等)で描画されている場合でも確実にそれを文字と認識できるようにするために実行される。判定対象のコンテンツが小説等、印刷された文字部分が黒色であり、その背景が白色であることが明らかな場合には、本ステップを省略できる。 This binarization processing is executed in order to ensure that characters in the content can be recognized as characters even if they are drawn with a gray value other than black (such as red characters). If it is clear that the content to be determined is a novel or the like and the printed character portion is black and the background is white, this step can be omitted.
次に、同文書画像領域抽出部12により、ステップS1で生成された2値化画像の全体が処理領域として指定され、その処理領域内の全ての黒画素を包含する最小の矩形領域が初期領域(文書画像領域)として抽出される(ステップS2)。
Next, the document image
この抽出処理により、判定対象のコンテンツに含まれていた上下左右の余白が取り除かれ、判定の実対象である文書画像領域のみが抽出される。なお、処理領域の指定方法としては、コンピュータにより2値化画像全体を自動で指定しても構わないし、コンテンツが少し斜めにスキャンされ紙面外が画像に含まれる場合や、画像が写真として撮影され余分な印刷領域を含む場合等を考慮して、ユーザにより矩形領域を指定しても構わない。 By this extraction process, the top, bottom, left, and right margins included in the content to be determined are removed, and only the document image region that is the actual target of the determination is extracted. As a method for specifying the processing area, the entire binarized image may be automatically specified by a computer. When the content is scanned slightly obliquely and the image is out of paper, the image is taken as a photograph. The rectangular area may be designated by the user in consideration of the case where an extra print area is included.
次に、同文書画像領域抽出部12により、ステップS2で抽出された初期領域内の1次元射影ヒストグラムが生成される(ステップS3)。
Next, the document image
例えば、図3に示すように、初期領域A内における黒画素の数を垂直ライン上と水平ライン上でそれぞれカウントすることにより、x軸方向とy軸方向での各1次元射影ヒストグラムをそれぞれ生成する。 For example, as shown in FIG. 3, each one-dimensional projection histogram in the x-axis direction and the y-axis direction is generated by counting the number of black pixels in the initial area A on the vertical line and the horizontal line, respectively. To do.
より具体的には、図4に示すように、初期領域Aの左上端の画素位置を(xr,yr)、x軸方向の幅をwr、y軸方向の幅をhrとして、以下の式(1)よりx軸方向での1次元射影ヒストグラムhxを生成し、以下の式(2)よりy軸方向での1次元射影ヒストグラムhyを生成する。
ただし、変数Bcの取り得る値は1又は0である。(x,y)の画素が黒画素の場合に1となり、黒画素以外の場合に0となる。 However, the possible value of the variable Bc is 1 or 0. It is 1 when the pixel (x, y) is a black pixel, and 0 when it is not a black pixel.
他方、このような方法以外に、初期領域内で黒画素が連結しているグループを検出し、そのグループを包含している最小の矩形範囲をラベル領域として、そのラベル領域の数を垂直ライン上と水平ライン上でそれぞれカウントした値を用いて生成しても構わない。 On the other hand, in addition to this method, a group in which black pixels are connected in the initial area is detected, and the minimum rectangular area including the group is used as a label area, and the number of label areas is set on the vertical line. And may be generated using values counted on the horizontal line.
より具体的には、図5に示すように、例えば、「あ」の文字を包含する矩形範囲をラベル領域Rとし、x軸方向の1次元射影ヒストグラムhxを生成する場合は、そのラベル領域Rの「左端≦i≦右端」を満たす全てのiについてhx(i)に1を加える。一方、y軸方向の1次元射影ヒストグラムhyを生成する場合は、ラベル領域Rの「上端≦j≦下端」を満たす全てのjについてhy(j)に1を加える。
More specifically, as shown in FIG. 5, for example, when a rectangular range including the character “A” is used as the label region R and a one-dimensional projection histogram h x in the x-axis direction is generated, the
以上が1次元射影ヒストグラムの生成例である。なお、コンテンツによっては、段組の区切りを明確にするため、横長又は縦長の罫線G(図3)が描画されている場合がある。その場合、罫線部分のヒストグラム値を1次元射影ヒストグラムから削除する。この罫線の位置を記憶しておき、領域の分割位置として用いるようにしても構わない。なお、罫線部分の検出方法としては、例えば、文字のラベル領域と比べて極めて細長いラベル領域になるため、縦横比率又は面積が規定範囲内に収まらない矩形範囲を罫線部分とする。 The above is an example of generating a one-dimensional projection histogram. Depending on the content, a horizontally long or vertically long ruled line G (FIG. 3) may be drawn in order to clarify the division between columns. In that case, the ruled line portion histogram value is deleted from the one-dimensional projection histogram. The ruled line position may be stored and used as a region division position. As a ruled line portion detection method, for example, since the label region is extremely elongated compared to the character label region, a rectangular range whose aspect ratio or area does not fall within a specified range is set as the ruled line portion.
続いて、同文書画像領域抽出部12により、ステップS2で抽出された初期領域の階層が0に設定される(ステップS4)。なお、本ステップは、ステップS3よりも前に実行しても構わない。
Subsequently, the document image
次に、文書画像領域分割部13により、ステップS3で生成された各方向の1次元射影ヒストグラムを用いて初期領域の分割方向(水平方向又は垂直方向)が決定される(ステップS5)。
Next, the dividing direction (horizontal direction or vertical direction) of the initial region is determined by the document image
例えば、上下又は左右で段組がある場合、その段組間で軸長の長い白ランが存在するため、x軸方向での白ランの平均軸長とy軸方向での白ランの平均軸長を比較し、大きい方の白ランで分割するようにする。つまり、y軸方向の白ランのy軸幅の方がx軸方向の白ランのx軸幅よりも大きい場合には、上下に分割するためy軸方向を分割方向(垂直方向:縦分割)とし、小さい場合には、左右に分割するためx軸方向を分割方向(水平方向:横分割)とする。 For example, when there is a vertical or horizontal column, there is a white run with a long axial length between the columns, so the average axis length of the white run in the x-axis direction and the average axis of the white run in the y-axis direction Compare the lengths and divide by the larger white run. In other words, when the y-axis width of the white run in the y-axis direction is larger than the x-axis width of the white run in the x-axis direction, the y-axis direction is divided in the vertical direction to divide up and down. If it is small, the x-axis direction is set as the division direction (horizontal direction: horizontal division) in order to divide it left and right.
その他、黒ランの軸長を利用しても構わない。例えば、x軸方向での白ランの平均軸長をx軸方向での黒ランの平均軸長で除算した値が、y軸方向での白ランの平均軸長をy軸方向での黒ランの平均軸長で除算した値よりも大きい場合には、縦分割とする。 In addition, the black run axial length may be used. For example, the value obtained by dividing the average axis length of the white run in the x-axis direction by the average axis length of the black run in the x-axis direction is equal to the average axis length of the white run in the y-axis direction. If it is larger than the value divided by the average axis length, the vertical division is assumed.
次に、同文書画像領域分割部13により、ステップS5で決定された分割方向の1次元射影ヒストグラムを用いて、その分割方向で閾値以上の軸長を有する白ランがあるか否かが判定され(ステップS6)、ある場合には当該白ランの位置で初期領域が複数の分割領域(文章領域)に分割される(ステップS7)。
Next, the document image
なお、白ランを用いて判定するのに代えて、隣り合う黒ランの間隙長が閾値以上であるか否かで判定するようにしても構わない。また、前述したように、罫線部分が検出されていた場合には当該罫線の位置で必ず分割しても構わない。 Instead of using the white run, the determination may be made based on whether the gap length between adjacent black runs is greater than or equal to a threshold value. Further, as described above, when a ruled line portion is detected, it may be divided at the position of the ruled line.
次に、ステップS7の後、同文書画像領域分割部13により、そのステップS7で分割された各分割領域に対して、分割方向を識別可能な現階層でのインデックスがそれぞれ付与される(ステップS8)。
Next, after step S7, the document image
例えば、横分割の場合、左側の分割領域から順番に、−1,−2,−3,…,とインデックスを付与する。一方、縦分割の場合、上側の分割領域から順番に、+1,+2,+3,…,と付与する。+,−は分割方向(分割パターン)の識別子である。 For example, in the case of horizontal division, indexes such as −1, −2, −3,. On the other hand, in the case of vertical division, +1, +2, +3,. + And − are identifiers of division directions (division patterns).
次に、同文書画像領域分割部13により、現在の階層が分割の上限階層に到達しているか否かが判定される(ステップS9)。上限階層に到達していない場合には、階層数に1を追加することにより現在の階層が1に更新され(ステップS10)、各分割領域の1次元射影ヒストグラムがそれぞれ生成される(ステップS11)。なお、分割の上限階層は、想定するレイアウトの複雑さに応じて予め定める。例えば図表を含む書籍の場合、上限階層は2〜3程度が望ましい。
Next, the document image
そして、ステップS11の後はステップS6に戻り、各分割領域に対する再分割処理が再帰的に繰り返し実行され、再分割以降の全ての分割領域に対してインデックスが追加的に付与されることになる。ただし、再分割の試行方向は、分割元の領域の分割方向と逆とする。例えば、縦方向に分割された領域は横方向の分割を試行する。 Then, after step S11, the process returns to step S6, the re-division process for each divided area is recursively repeated, and indexes are additionally given to all divided areas after the re-division. However, the subdivision trial direction is opposite to the division direction of the division source area. For example, a region divided in the vertical direction is attempted to be divided in the horizontal direction.
ここで、インデックスの付与結果例を図6に示す。例えば、縦分割された分割領域B1には「+1」、分割領域B2には「+2」、分割領域B3には「+3」が付与される。また、分割領域B1を更に横分割した分割領域B11には「−1」が更に付与され、分割領域B12には「−2」が更に付与される。 Here, an example of the result of index assignment is shown in FIG. For example, “+1” is assigned to the vertically divided divided region B1, “+2” is assigned to the divided region B2, and “+3” is assigned to the divided region B3. Further, “−1” is further given to the divided region B11 obtained by further dividing the divided region B1, and “−2” is further given to the divided region B12.
続いて、ステップS6の判定結果がNoの場合、又は、ステップS9の判定結果がYesの場合、書字推定部14により、各分割領域内に記述されている文章の書字方向(横書き・縦書き)がそれぞれ推定され(ステップS12)、文章の行数が1行か否かが特定される(ステップS13)。
Subsequently, when the determination result of step S6 is No, or when the determination result of step S9 is Yes, the writing direction of the sentence described in each divided region (horizontal writing / vertical writing) is written by the
書字方向や文章行数は、各分割領域に対して生成された1次元射影ヒストグラムの分布状態から特定できる。例えば、y軸方向で白ランと黒ランの平均軸長をそれぞれ計算し、白ランの平均軸長が0に近い場合には、縦書きとする。縦書きの場合、y軸方向へ射影すると文字がない部分はほとんど現れないためである。 The writing direction and the number of sentence lines can be specified from the distribution state of the one-dimensional projection histogram generated for each divided region. For example, the average axis lengths of white run and black run are calculated in the y-axis direction, respectively, and when the average axis length of white run is close to 0, vertical writing is performed. This is because in the case of vertical writing, when there is a projection in the y-axis direction, a portion without characters does not appear.
次に、分割処理キャンセル部15により、同一階層において隣り合う2つの分割領域が、1回又は複数回分割された後において共に再分割されておらず、かつ、横分割&共に縦書き又は縦分割&共に横書きに該当する場合、二重改行等の切れ目で分割されたものとみなし、それら2つの分割領域の間隔が閾値以下である場合は再結合される(ステップS14)。当該閾値を超えている場合でも再結合するようにしても構わない。
Next, after the division
なお、ここで用いる閾値は、ステップS6で用いた閾値よりも大きいものとする。また、2つの分割領域の間に罫線が存在し、かつ、罫線の位置で必ず領域分割することにしている場合は、それら分割領域の間隔に関わらず再結合しない。 Note that the threshold used here is larger than the threshold used in step S6. Further, when a ruled line exists between two divided areas and the area is always divided at the position of the ruled line, recombination is not performed regardless of the interval between the divided areas.
また、同分割処理キャンセル部15により、同一階層において隣り合う2つの分割領域が、共に1行であり、かつ、横分割&共に横書き又は縦分割&共に縦書きに該当する場合、句読点等の隙間で誤分割されたものとみなし、それら2つの分割領域は再結合される(ステップS15)。
In addition, when the division
なお、ステップS14およびステップS15は、その処理順序に時間的な前後関係がなく、同じタイミングで実行しても構わない。また、結合された分割領域に付与されていたインデックス(該当する階層でのインデックスのみ)は、結合した分割領域のいずれか一方のインデックスに置換される。 Note that step S14 and step S15 have no temporal relationship in the processing order, and may be executed at the same timing. In addition, the index (only the index in the corresponding hierarchy) assigned to the combined divided area is replaced with one of the indexes of the combined divided areas.
次に、文書画像領域分割部13により、再分割されておらず、かつ、他方向での分割が試されていない分割領域があるか否かが判定される(ステップS16)。
Next, the document image
ここで該当する分割領域については、分割方向を代えてステップS6以降の処理が再度実行される。例えば、図6に示した分割領域B2がそれに該当する。この分割領域B2は再分割されていないため、分割方向を縦方向に変えて更なる分割が可能か否かが再度試されることになる。 Here, with respect to the corresponding divided area, the process after step S6 is executed again by changing the dividing direction. For example, the divided area B2 shown in FIG. Since this divided area B2 is not subdivided, it is tried again whether or not further division is possible by changing the division direction to the vertical direction.
次に、ステップS16の判定結果がNoの場合、文章領域読み取り順序判定部16により、横書きの分割領域の総面積と縦書きの分割領域の総面積とが比較され、面積の大きい方の書字方向が初期領域全体の読み方向(書字方向)と決定される(ステップS17)。
Next, when the determination result of step S16 is No, the sentence area reading
次に、同文章領域読み取り順序判定部16により、ステップS17で決定された初期領域の読み方向と、各分割領域に付与されているインデックスの順序とを用いて、各分割領域の読み取り順序が判定される(ステップS18)。
Next, the reading order of each divided area is determined by the same text area reading
具体的には、任意の2つの分割領域について、付与されている各インデックスの階層が浅い方から順番に値を比較し、最初に等しくなくなったインデックス値の大小関係から読み取り順序を判定する。 Specifically, for any two divided regions, values are compared in order starting from the shallowest level of each assigned index, and the reading order is determined from the magnitude relationship of the index values that are initially not equal.
例えば、インデックスの順序がステップS8で用いた具体例において、横分割の場合、初期領域の読み方向が横書きであれば、上記インデックス値の絶対値が小さい方のインデックスを付与する分割領域の読み取り順序を先とし、その読み方向が縦書きであれば、当該分割領域の読み取り順序を後(上記インデックス値の絶対値の大きい方のインデックスを付与する分割領域の読み取り順序を先)と判定する。 For example, in the specific example where the index order is used in step S8, in the case of horizontal division, if the reading direction of the initial area is horizontal writing, the reading order of the divided areas to which the index having the smaller absolute value of the index value is assigned. If the reading direction is vertical writing, it is determined that the reading order of the divided area is later (the reading order of the divided area to which the index having the larger absolute value of the index value is given first).
すなわち、横分割の場合、初期領域の読み方向が横書きであれば、順序が先のインデックスを付与する分割領域を先とし、縦書きであれば、当該分割領域を後とする。一方、縦分割の場合、初期領域の読み方向には関係なく、順序が先のインデックスを付与する文章領域を先と判定する。 That is, in the case of horizontal division, if the reading direction of the initial area is horizontal writing, the divided area to which the index is assigned first is the first, and if it is vertical writing, the divided area is the rear. On the other hand, in the case of vertical division, regardless of the reading direction of the initial area, the sentence area to which the index with the first order is assigned is determined as the first.
最後に、ステップS18の判定結果に基づいて各分割領域に読み取り順序を改めて付与し、各分割領域の識別子に対応付けて読み取り用リストとしてメモリ等に記憶しておく。以降、上記判定対象コンテンツを表示装置の画面サイズに合わせて並び替える場合には、そのリスト内の読み取り順序で各分割領域を並び替えて表示する。 Finally, based on the determination result of step S18, the read order is assigned to each divided area, and the read order is stored in a memory or the like in association with the identifier of each divided area. Thereafter, when the determination target content is rearranged in accordance with the screen size of the display device, the divided areas are rearranged and displayed in the reading order in the list.
以上より、本実施の形態によれば、文書画像領域の初期画像を複数の分割領域に分割してインデックスをそれぞれ付与し、その初期画像の書字方向と各インデックスに基づき各文章領域の読み取り順序を判定するので、文章領域の読み取り順序の判定精度を向上できる。つまり、複雑なレイアウトの文書画像でも適切に領域分割し、正しい読み順で並べることができる。また、テキストデータの生成時やリフローの際に文章を取り出す領域の順番を正しくすることができる。 As described above, according to the present embodiment, the initial image of the document image area is divided into a plurality of divided areas, and indexes are assigned respectively, and the reading order of each text area is based on the writing direction of the initial image and each index. Therefore, the determination accuracy of the reading order of the text area can be improved. In other words, even a document image with a complicated layout can be appropriately divided into regions and arranged in the correct reading order. Further, it is possible to correct the order of the areas from which sentences are extracted when text data is generated or reflowed.
最後に、本実施の形態では、自然数を1,2,3,…,の順番で付与する場合をインデックスの例として説明したが、インデックス自体の順序(自然数の場合には大小関係)が把握できればよいため、例えば、A,B,C,…,の順番で付与する英字をインデックスとして用いても構わない。 Finally, in the present embodiment, the case where the natural numbers are assigned in the order of 1, 2, 3,... Has been described as an example of the index, but if the order of the indexes themselves (magnitude relationship in the case of natural numbers) can be grasped. Therefore, for example, an alphabetic character assigned in the order of A, B, C,... May be used as an index.
1…文章領域読み取り順序判定装置
11…コンテンツ記憶部(記憶手段)
12…文書画像領域抽出部
13…文書画像領域分割部(分割・付与手段)
14…書字推定部
15…分割処理キャンセル部(再結合手段)
16…文章領域読み取り順序判定部(判定手段)
S1〜S18…ステップ
DESCRIPTION OF
12 ... Document image
14:
16 ... sentence region reading order determination unit (determination means)
S1-S18 ... Step
Claims (16)
前記コンテンツの書字方向と前記各インデックスに基づき、前記各文章領域の読み取り順序を判定する判定手段と、を有し、
前記分割・付与手段は、
左右に分割する場合、左側の文章領域から順番に順序を表す記号と左右で分割した分割パターンを識別する識別子とを前記インデックスとして付与し、上下に分割する場合、上側の文章領域から順番に順序を表す記号と上下で分割した分割パターンを識別する識別子とを前記インデックスとして付与することを特徴とする文章領域読み取り順序判定装置。 Dividing / giving means for reading out content from the storage means and dividing it into a plurality of sentence areas, and assigning an index to each sentence area;
Determining means for determining the reading order of each sentence area based on the writing direction of the content and each index ;
The dividing / giving means is
When dividing into left and right, a symbol indicating the order in order from the left sentence area and an identifier for identifying the division pattern divided into left and right are given as the index, and when dividing up and down, the order is in order from the upper sentence area. A sentence region reading order determination apparatus characterized by assigning a symbol representing the character and an identifier for identifying a divided pattern divided vertically as the index .
前記コンテンツを左右又は上下に分割する各分割パターンを交互に変えて前記文章領域を繰り返し分割することを特徴とする請求項1に記載の文章領域読み取り順序判定装置。The sentence area reading order determination apparatus according to claim 1, wherein the sentence area is repeatedly divided by alternately changing each division pattern for dividing the content into right and left or up and down.
前記2つの文章領域の間隔が閾値以下の場合に、当該各文章領域を再結合することを特徴とする請求項3に記載の文章領域読み取り順序判定装置。4. The sentence area reading order determination apparatus according to claim 3, wherein when the interval between the two sentence areas is equal to or less than a threshold value, the respective sentence areas are recombined.
左右に分割する場合、前記インデックスを左側の文章領域から順番に付与し、上下に分割する場合、前記インデックスを上側の文章領域から順番に付与することを特徴とする請求項1乃至5のいずれかに記載の文章領域読み取り順序判定装置。The index is assigned in order from the left sentence area when dividing into left and right, and the index is given in order from the upper sentence area when dividing up and down. The sentence region reading order determination device according to claim 1.
前記左側から付与する場合、−1,−2,−3,…,と前記インデックスを付与し、前記上側から付与する場合、+1,+2,+3,…,と前記インデックスを付与することを特徴とする請求項6に記載の文章領域読み取り順序判定装置。The index is assigned as -1, -2, -3, ... when given from the left side, and the index is given as +1, +2, +3, ... when given from the upper side. The sentence region reading order determination device according to claim 6.
前記コンテンツに含まれる罫線の位置で分割することを特徴とする請求項1乃至7のいずれかに記載の文章領域読み取り順序判定装置。The sentence region reading order determination apparatus according to claim 1, wherein division is performed at a position of a ruled line included in the content.
左右に分割されている場合、前記コンテンツの書字方向が横書きであれば、順序が先のインデックスを付与する文章領域を先とし、縦書きであれば、当該文章領域を後とし、上下に分割されている場合、当該文章領域を先と判定することを特徴とする請求項1乃至8のいずれかに記載の文章領域読み取り順序判定装置。When the content is divided horizontally, if the writing direction of the content is horizontal writing, the sentence area to which the index is assigned is the first, and if it is vertical writing, the sentence area is the rear, and divided vertically. The sentence area reading order determination apparatus according to any one of claims 1 to 8, wherein the sentence area is determined to be the destination when the sentence area is determined to be a destination.
前記−1,−2,−3,…,と付与された場合、前記コンテンツの書字方向が横書きであれば、絶対値が小さい方のインデックスを付与する文章領域を先とし、縦書きであれば、当該文章領域を後と判定することを特徴とする請求項7に記載の文章領域読み取り順序判定装置。If the writing direction of the content is horizontal writing, the sentence area to which the index having the smaller absolute value is given first, and the vertical writing is possible. The sentence area reading order determination apparatus according to claim 7, wherein the sentence area is determined to be later.
前記各文章領域の書字方向の推定結果に基づき、前記コンテンツの書字方向を決定することを特徴とする請求項1乃至10のいずれかに記載の文章領域読み取り順序判定装置。11. The sentence region reading order determination apparatus according to claim 1, wherein the writing direction of the content is determined based on an estimation result of a writing direction of each of the sentence regions.
記憶手段からコンテンツを読み出して複数の文章領域に分割し、各文章領域に対してインデックスをそれぞれ付与する分割・付与ステップと、A division / granting step of reading content from the storage means and dividing it into a plurality of sentence areas, and assigning an index to each sentence area,
前記コンテンツの書字方向と前記各インデックスに基づき、前記各文章領域の読み取り順序を判定する判定ステップと、を行い、A determination step of determining the reading order of each sentence area based on the writing direction of the content and each index;
前記分割・付与ステップでは、In the dividing / giving step,
左右に分割する場合、左側の文章領域から順番に順序を表す記号と左右で分割した分割パターンを識別する識別子とを前記インデックスとして付与し、上下に分割する場合、上側の文章領域から順番に順序を表す記号と上下で分割した分割パターンを識別する識別子とを前記インデックスとして付与することを特徴とする文章領域読み取り順序判定方法。When dividing into left and right, a symbol indicating the order in order from the left sentence area and an identifier for identifying the division pattern divided into left and right are given as the index, and when dividing up and down, the order is in order from the upper sentence area. A sentence region reading order determination method, comprising: an index for identifying a divided pattern divided vertically and an identifier for identifying a divided pattern.
記憶手段からコンテンツを読み出して複数の文章領域に分割し、各文章領域に対してインデックスをそれぞれ付与する分割・付与処理と、Dividing and assigning processing for reading content from the storage means and dividing it into a plurality of sentence areas, and assigning an index to each sentence area;
前記コンテンツの書字方向と前記各インデックスに基づき、前記各文章領域の読み取り順序を判定する判定処理と、を実行させ、A determination process for determining the reading order of each sentence area based on the writing direction of the content and each index,
前記分割・付与処理では、In the division / grant process,
左右に分割する場合、左側の文章領域から順番に順序を表す記号と左右で分割した分割パターンを識別する識別子とを前記インデックスとして付与し、上下に分割する場合、上側の文章領域から順番に順序を表す記号と上下で分割した分割パターンを識別する識別子とを前記インデックスとして付与することを特徴とする文章領域読み取り順序判定プログラム。When dividing into left and right, a symbol indicating the order in order from the left sentence area and an identifier for identifying the division pattern divided into left and right are given as the index, and when dividing up and down, the order is in order from the upper sentence area. A sentence region reading order determination program characterized in that a symbol representing the character and an identifier for identifying a divided pattern divided vertically are assigned as the index.
前記コンテンツの書字方向と前記各インデックスに基づき、前記各文章領域の読み取り順序を判定する判定手段と、を有し、Determining means for determining the reading order of each sentence area based on the writing direction of the content and each index;
前記分割・付与手段は、The dividing / giving means is
左右に分割する場合、前記インデックスを左側の文章領域から順番に付与し、上下に分割する場合、前記インデックスを上側の文章領域から順番に付与し、When dividing into left and right, the index is given in order from the left sentence area, and when dividing up and down, the index is given in order from the upper sentence area,
前記左側から付与する場合、−1,−2,−3,…,と前記インデックスを付与し、前記上側から付与する場合、+1,+2,+3,…,と前記インデックスを付与することを特徴とする文章領域読み取り順序判定装置。The index is assigned as -1, -2, -3, ... when given from the left side, and the index is given as +1, +2, +3, ... when given from the upper side. Sentence reading order determination device.
記憶手段からコンテンツを読み出して複数の文章領域に分割し、各文章領域に対してインデックスをそれぞれ付与する分割・付与ステップと、A division / granting step of reading content from the storage means and dividing it into a plurality of sentence areas, and assigning an index to each sentence area,
前記コンテンツの書字方向と前記各インデックスに基づき、前記各文章領域の読み取り順序を判定する判定ステップと、を行い、A determination step of determining the reading order of each sentence area based on the writing direction of the content and each index;
前記分割・付与ステップでは、In the dividing / giving step,
左右に分割する場合、前記インデックスを左側の文章領域から順番に付与し、上下に分割する場合、前記インデックスを上側の文章領域から順番に付与し、When dividing into left and right, the index is given in order from the left sentence area, and when dividing up and down, the index is given in order from the upper sentence area,
前記左側から付与する場合、−1,−2,−3,…,と前記インデックスを付与し、前記上側から付与する場合、+1,+2,+3,…,と前記インデックスを付与することを特徴とする文章領域読み取り順序判定方法。The index is assigned as -1, -2, -3, ... when given from the left side, and the index is given as +1, +2, +3, ... when given from the upper side. To determine the reading order of sentence areas.
記憶手段からコンテンツを読み出して複数の文章領域に分割し、各文章領域に対してインデックスをそれぞれ付与する分割・付与処理と、Dividing and assigning processing for reading content from the storage means and dividing it into a plurality of sentence areas, and assigning an index to each sentence area;
前記コンテンツの書字方向と前記各インデックスに基づき、前記各文章領域の読み取り順序を判定する判定処理と、を実行させ、A determination process for determining the reading order of each sentence area based on the writing direction of the content and each index,
前記分割・付与処理では、In the division / grant process,
左右に分割する場合、前記インデックスを左側の文章領域から順番に付与し、上下に分割する場合、前記インデックスを上側の文章領域から順番に付与し、When dividing into left and right, the index is given in order from the left sentence area, and when dividing up and down, the index is given in order from the upper sentence area,
前記左側から付与する場合、−1,−2,−3,…,と前記インデックスを付与し、前記上側から付与する場合、+1,+2,+3,…,と前記インデックスを付与することを特徴とする文章領域読み取り順序判定プログラム。The index is assigned as -1, -2, -3, ... when given from the left side, and the index is given as +1, +2, +3, ... when given from the upper side. To determine the reading order of the text area.
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP2013121781A JP6204076B2 (en) | 2013-06-10 | 2013-06-10 | Text area reading order determination apparatus, text area reading order determination method, and text area reading order determination program |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP2013121781A JP6204076B2 (en) | 2013-06-10 | 2013-06-10 | Text area reading order determination apparatus, text area reading order determination method, and text area reading order determination program |
Publications (2)
| Publication Number | Publication Date |
|---|---|
| JP2014238757A JP2014238757A (en) | 2014-12-18 |
| JP6204076B2 true JP6204076B2 (en) | 2017-09-27 |
Family
ID=52135857
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| JP2013121781A Active JP6204076B2 (en) | 2013-06-10 | 2013-06-10 | Text area reading order determination apparatus, text area reading order determination method, and text area reading order determination program |
Country Status (1)
| Country | Link |
|---|---|
| JP (1) | JP6204076B2 (en) |
Families Citing this family (1)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN113283432B (en) * | 2020-02-20 | 2025-04-04 | 阿里巴巴集团控股有限公司 | Image recognition, text sorting method and device |
Family Cites Families (4)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| JPH0821057B2 (en) * | 1987-07-10 | 1996-03-04 | 日本電気株式会社 | Document image analysis method |
| JP2786361B2 (en) * | 1991-12-12 | 1998-08-13 | 沖電気工業株式会社 | Document image area extraction method |
| JP3425834B2 (en) * | 1995-09-06 | 2003-07-14 | 富士通株式会社 | Title extraction apparatus and method from document image |
| JP3940491B2 (en) * | 1998-02-27 | 2007-07-04 | 株式会社東芝 | Document processing apparatus and document processing method |
-
2013
- 2013-06-10 JP JP2013121781A patent/JP6204076B2/en active Active
Also Published As
| Publication number | Publication date |
|---|---|
| JP2014238757A (en) | 2014-12-18 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| CN112801084B (en) | Image processing method and device, electronic device and storage medium | |
| JP4483909B2 (en) | Translation apparatus and program | |
| US10885325B2 (en) | Information processing apparatus, control method, and storage medium | |
| JP7244223B2 (en) | Identifying emphasized text in electronic documents | |
| CN107689070B (en) | Chart data structured extraction method, electronic device and computer-readable storage medium | |
| JP2003288334A (en) | Document processing apparatus and document processing method | |
| CN101944179A (en) | Image processing apparatus and image processing method | |
| CN106599940A (en) | Picture character identification method and apparatus thereof | |
| US8538154B2 (en) | Image processing method and image processing apparatus for extracting heading region from image of document | |
| US8386943B2 (en) | Method for query based on layout information | |
| KR100268367B1 (en) | Mars treatment methods and devices | |
| US20160124813A1 (en) | Restoration of modified document to original state | |
| US9049400B2 (en) | Image processing apparatus, and image processing method and program | |
| JP2011188291A (en) | Image processor and image processing program | |
| JP6204076B2 (en) | Text area reading order determination apparatus, text area reading order determination method, and text area reading order determination program | |
| CN108804978A (en) | A kind of printed page analysis method and device | |
| CN100530219C (en) | Image processing apparatus | |
| JP2016012767A (en) | Image processing device | |
| JP2012022413A (en) | Image processing apparatus, image processing method and program | |
| CN113011131B (en) | Typesetting method based on picture electronic book, electronic equipment and storage medium | |
| JP2008108114A (en) | Document processing apparatus and document processing method | |
| JP5298830B2 (en) | Image processing program, image processing apparatus, and image processing system | |
| JP2019153230A (en) | Information processor and information processing program | |
| JP6852359B2 (en) | Image processing equipment and programs | |
| JP5277750B2 (en) | Image processing program, image processing apparatus, and image processing system |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| A621 | Written request for application examination |
Free format text: JAPANESE INTERMEDIATE CODE: A621 Effective date: 20160125 |
|
| A977 | Report on retrieval |
Free format text: JAPANESE INTERMEDIATE CODE: A971007 Effective date: 20161209 |
|
| A131 | Notification of reasons for refusal |
Free format text: JAPANESE INTERMEDIATE CODE: A131 Effective date: 20170124 |
|
| A521 | Request for written amendment filed |
Free format text: JAPANESE INTERMEDIATE CODE: A523 Effective date: 20170322 |
|
| 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: 20170815 |
|
| A61 | First payment of annual fees (during grant procedure) |
Free format text: JAPANESE INTERMEDIATE CODE: A61 Effective date: 20170831 |
|
| R150 | Certificate of patent or registration of utility model |
Ref document number: 6204076 Country of ref document: JP Free format text: JAPANESE INTERMEDIATE CODE: R150 |
|
| S531 | Written request for registration of change of domicile |
Free format text: JAPANESE INTERMEDIATE CODE: R313531 |
|
| R350 | Written notification of registration of transfer |
Free format text: JAPANESE INTERMEDIATE CODE: R350 |
|
| R250 | Receipt of annual fees |
Free format text: JAPANESE INTERMEDIATE CODE: R250 |
|
| R250 | Receipt of annual fees |
Free format text: JAPANESE INTERMEDIATE CODE: R250 |
|
| R250 | Receipt of annual fees |
Free format text: JAPANESE INTERMEDIATE CODE: R250 |
|
| R250 | Receipt of annual fees |
Free format text: JAPANESE INTERMEDIATE CODE: R250 |
|
| R250 | Receipt of annual fees |
Free format text: JAPANESE INTERMEDIATE CODE: R250 |
|
| R250 | Receipt of annual fees |
Free format text: JAPANESE INTERMEDIATE CODE: R250 |
|
| S533 | Written request for registration of change of name |
Free format text: JAPANESE INTERMEDIATE CODE: R313533 |
|
| R350 | Written notification of registration of transfer |
Free format text: JAPANESE INTERMEDIATE CODE: R350 |