JP2013080349A - Image processor, image processing method, and program - Google Patents
Image processor, image processing method, and program Download PDFInfo
- Publication number
- JP2013080349A JP2013080349A JP2011219564A JP2011219564A JP2013080349A JP 2013080349 A JP2013080349 A JP 2013080349A JP 2011219564 A JP2011219564 A JP 2011219564A JP 2011219564 A JP2011219564 A JP 2011219564A JP 2013080349 A JP2013080349 A JP 2013080349A
- Authority
- JP
- Japan
- Prior art keywords
- character
- information
- pixel block
- pixel
- area
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Granted
Links
Images
Abstract
Description
本発明は、紙文書、または文書の画像データから編集可能な電子文書データを生成する画像処理装置、画像処理方法、およびプログラムに関する。 The present invention relates to an image processing apparatus, an image processing method, and a program for generating editable electronic document data from a paper document or document image data.
近年、文書を作成する際、単に文字を打ち込むのみならず、フォントに装飾を凝らしたり、図を自由に作成したり、あるいは写真等を取り込んだりといった、高度な機能が用いられるようになっている。 In recent years, when creating a document, advanced functions have been used, such as adding decorations to fonts, creating drawings freely, and capturing photos, etc., as well as simply typing characters. .
しかし、作成物の内容が高度になるほど、文書をまったく新規から作成するには大きな労力が必要とされる。よって、過去に作成した文書の一部をそのまま、あるいは加工編集したものを再利用できるようにすることが望まれている。 However, the higher the content of the creation, the more labor is required to create a completely new document. Therefore, it is desired that a part of a document created in the past can be reused as it is or after being processed and edited.
一方、インターネットに代表されるようなネットワークの広がりにより、文書が電子的に配布される機会も増えたが、電子文書が紙に印刷された状態で配布されることも多い。そのように紙文書しか手元に存在しない場合でも、その内容を紙から再利用可能なデータとして得られるようにするための技術が開示されている。例えば、特許文献1では、紙の文書を装置に電子的に読み込ませた際に、その内容と一致する文書をデータベースから検索して取得し、読み込んだ紙面のデータの代わりに利用できることが記載されている。また、同一の文書がデータベースから特定できなかった場合は、読み込んだ文書の画像を再利用が容易な電子データへと変換するため、この場合も文書の内容を再利用することができる。
On the other hand, the spread of networks such as the Internet has increased the opportunities for electronic distribution of documents, but electronic documents are often distributed in a printed state on paper. In this way, even when only a paper document exists at hand, a technique for obtaining the contents as reusable data from paper is disclosed. For example,
従来、文書画像中の文字情報を再利用が容易な電子データへと変換する技術として、OCR技術があった。また、線や面で構成される図画情報を再利用が容易な電子データへと変換する技術として、ベクトル化の技術があった。例えば、特許文献1では、上記技術を用いて文書画像中の文字を文字コードにしたり、図形の輪郭をベクトルデータにすることで、再利用可能なデータへと変換する技術が開示されている。
Conventionally, there has been an OCR technique as a technique for converting character information in a document image into electronic data that can be easily reused. Further, as a technique for converting graphic information composed of lines and planes into electronic data that can be easily reused, there has been a vectorization technique. For example,
特許文献1では更に、文書画像中の文字、線画、自然画、表などの領域を識別し、各領域の関係をツリー構造で表現するデータを構築する技術を開示している。そして、同構造に従って上記文字コードやベクトルデータ、画像データ等を配置することで、アプリケーションで編集可能な電子文書ページへの変換を行う。この電子データは、元文書と同等のレイアウトを持ち、文書作成アプリケーション等で新規作成した電子文書ページと同様、文字や図形の位置やサイズの変更、さらに幾何学的な変形や色付けなどを容易に行うことができる。
また、カラープリンタ等の普及により、カラフルに印刷された紙文書を受けとる機会も増えている。このようなカラー文書の内容を再利用しようとする場合、その色情報を再現したうえで、再利用可能なデータに変換することが求められる。このような要求に対し、特許文献2では、文字等の色情報が失われないように、カラー画像を2値以上の画素値を持つことができる画像に減色してから、同色となった画素塊を抽出して領域を識別している。この技術を利用して色情報を持つ画素塊取得し、上記ベクトル化等の処理を施すことで、色情報を再現したうえで再利用可能なデータを得ることができる。
In addition, with the spread of color printers and the like, opportunities to receive colorfully printed paper documents are increasing. When reusing the contents of such a color document, it is required to reproduce the color information and convert it into reusable data. In response to such a request, in
また、特許文献3では、文字認識結果の各文字コードに対し、入力画像の画素を元に得た色情報を付加している。これにより、色情報を再現した再利用可能な文字データを得ることができる。
In
入力画像を電子文書に変換する際に、一文字ごとに色などの修飾情報を付加すると、その分ファイルサイズが増大してしまうという問題がある。 When converting an input image into an electronic document, if modification information such as color is added for each character, there is a problem that the file size increases accordingly.
また、文字認識結果の中にスペース文字(空白文字)がある場合、当該スペース文字には対応する画素情報が存在しないので、当該スペース文字は色情報無しとして判定される。文字認識結果の文字列の中に、色情報が付与される文字と、色情報が付与されないスペース文字とが混在する場合、そのままの状態で電子文書への変換を行おうとすると、文字ごとに色情報の有無を記述する必要が出てしまう。その結果、電子文書のファイルサイズが増大することにより、保存や再利用の際に利便性が損なわれるという課題があった。 If there is a space character (blank character) in the character recognition result, there is no pixel information corresponding to the space character, so the space character is determined as having no color information. If a character string with color information and a space character without color information are mixed in the character string of the character recognition result, if conversion to an electronic document is performed as it is, the color for each character It becomes necessary to describe the presence or absence of information. As a result, the file size of the electronic document increases, and there is a problem that convenience is lost during storage and reuse.
上記課題を解決するために、本願発明は以下の構成を有する。すなわち、入力画像から編集が可能な電子データを生成する画像処理装置であって、文字列を含む画像を前記入力画像として入力する入力手段と、前記入力画像を構成する画素において画素値が近似する複数の画素塊を抽出する抽出手段と、前記複数の前記画素塊が構成する領域を、文字領域、およびそれ以外の領域のうちの少なくともいずれかとして識別する識別手段と、前記文字領域として識別された画素塊から文字を解析し、当該文字の少なくとも文字コードと位置情報とを含む文字情報を取得する解析手段と、前記文字情報により示される文字の配置から空白文字を含む文字列を特定する特定手段と、前記文字情報にて示される位置の文字領域の画素塊から色情報を取得し、当該文字情報に付加する色情報付加手段と、前記特定された文字列と当該文字列に含まれる文字の文字情報とから前記電子データを定義する記述を生成する生成手段とを備え、前記色情報付加手段は、前記文字列に含まれる空白文字の文字情報に対し、当該文字列における当該空白文字の前後にある文字の色情報を付加する。 In order to solve the above problems, the present invention has the following configuration. That is, an image processing apparatus that generates electronic data that can be edited from an input image, and the pixel values approximate in input means that inputs an image including a character string as the input image and pixels that constitute the input image An extraction unit that extracts a plurality of pixel blocks, an identification unit that identifies a region formed by the plurality of pixel blocks as at least one of a character region and other regions, and is identified as the character region Analysis means for analyzing a character from the pixel block and acquiring character information including at least a character code and position information of the character, and specifying a character string including a blank character from an arrangement of characters indicated by the character information Color information adding means for acquiring color information from a pixel block of a character area at a position indicated by the character information and adding the color information to the character information; Generating means for generating a description defining the electronic data from a character string and character information of a character included in the character string, and the color information adding means includes character information of blank characters included in the character string. On the other hand, color information of characters before and after the blank character in the character string is added.
不可視の文字に対して前後の修飾情報を付加することで、生成する電子文書の見た目の情報を変えることなく、文字列中の修飾情報をまとめ、ファイルサイズを削減する。 By adding front and rear modification information to invisible characters, the modification information in the character string is collected and the file size is reduced without changing the appearance information of the generated electronic document.
<第一実施形態>
[システム構成]
以下、本発明を実施するための最良の形態について図面を用いて説明する。図1は本発明に係る画像処理装置を用いたシステム構成の一例を示す図である。画像処理装置100は、スキャナ101、CPU102、メモリ103、ハードディスク104、およびネットワークI/F105を含む。スキャナ101は、読みとった文書の紙面情報を画像データに変換する。CPU102は、画像データに電子文書生成処理を施すためのプログラムを実行する。メモリ103は、該プログラムを実行する際のワークメモリやデータの一時保存などに利用される。ハードディスク104は、該プログラムやデータを格納する。ネットワークI/F105は、外部装置とデータの入出力を行う。画像処理装置100は、ネットワークI/F105を介してLANやインターネットなどの有線または無線のネットワーク110に接続にされている。このネットワーク110には更に汎用のパーソナルコンピュータ(PC)120が接続されており、PC120は、画像処理装置100から送信されたデータを受信し、同コンピュータ上にて表示・編集などに利用することが可能である。
<First embodiment>
[System configuration]
The best mode for carrying out the present invention will be described below with reference to the drawings. FIG. 1 is a diagram showing an example of a system configuration using an image processing apparatus according to the present invention. The
[電子文書生成処理の構成]
図2は、本発明に係る画像処理装置のCPU102で実施される電子文書生成処理の構成を示すブロック図である。更に、電子文書生成処理の中で、生成される各種データが示されている。図2の入力画像200および出力電子文書210はそれぞれ電子文書生成処理の入力データおよび出力データである。この入力画像200を出力電子文書210として出力するまでの処理の流れと、処理を行う各処理部についての概要を説明する。また、各処理部の詳細な処理内容はその後で説明する。
[Configuration of electronic document generation processing]
FIG. 2 is a block diagram showing the configuration of the electronic document generation process executed by the
入力画像200は、図2の電子文書生成処理の対象となる画像データである。例えば図1に示す画像処理装置100では、スキャナ101により読み取られた紙文書の内容が、光電変換により電子的画素情報に変換された文書画像データである。もしくは、ネットワークI/F105を通して外部から供給された画像データ、画像処理装置100内で生成された画像データであってもよい。入力画像200は、具体的にはメモリ103もしくはハードディスク104に格納された状態で、以降の処理ブロックへと入力される。
The
出力電子文書210は、電子文書生成処理の結果として出力される電子データである。この出力電子文書210は、入力画像200の内容を、利用者がパーソナルコンピュータのアプリケーション上で表示・編集が可能となる形式で表現したものである。またこの出力電子文書210内では、入力画像200に含まれている文字や図形、写真等の内容に応じて、それらの内容を種別毎に適切なデータ形式で表現することを特徴とする。その目的は、表示・保存・検索・編集・再利用等の異なる用途の各々に最適な電子文書を出力可能とするためである。それぞれのデータ形式および電子文書形式の具体例については後述する。
The output
画素塊解析部201は、入力画像200の画素内容(画素情報)を解析し、同色とみなされる連結画素のグループ化を行い、連結画素塊を形成する。そして、画素塊解析部201は、形成した連結画素塊の画素形状、および相対的な位置関係を含む画素塊データ206を生成する。
The pixel
レイアウト解析部202は、画素塊解析部201にて生成された画素塊データ206を入力として、各画素塊を文字と非文字に分類し、かつグループ化を行う。これにより、レイアウト解析部202は、入力画像200内に存在する領域を特定する。ここで特定される領域の種別としては、文字領域、線画領域、自然画領域、表領域などがある。そして、レイアウト解析部202は、それら特定された各領域の種類、座標と相対関係、および領域に含まれる画素塊の情報を含む領域データ207を生成する。
The
グラフィックスデータ生成部203は、領域データ207、画素塊データ206、および入力画像200を入力とし、出力電子文書210内で各領域の内容に相当するグラフィックスデータ208を生成する。グラフィックスデータ208は、後述の電子文書記述生成部205において、各領域に対応するグラフィックスオブジェクト記述の生成に用いられる。具体的には、例えば、グラフィックスデータ生成部203は、領域データ207の中から写真の領域を特定し、入力画像200中の同領域の画素情報を利用して、写真部分の切り出し画像データを生成する。または、グラフィックスデータ生成部203は、線画の領域を特定し、対応する画素塊データの画素形状情報からその輪郭を抽出し、直線・曲線パス近似による線画部分のベクトルデータを生成する。更に、グラフィックスデータ生成部203は、入力画像200において文字・写真・線画といった前景部分の画素を、その周囲色で塗りつぶした画像データである、背景画像データを生成する。
The graphics
文字認識部204は、領域データ207から文字の領域を特定し、さらに同領域に対応する画素塊データ206から文字の画素形状を二値画像として再構成する。そして、文字認識部204は、構成した二値画像に対して文字認識処理を行い、文字領域内の認識文字コード列を得る。さらに、文字認識部204は、これらの文字コード列と、電子文書上で利用可能なその他の情報を含む文字データ209を生成する。文字認識部204は、認識処理を正しく行う為に入力画像200の天地方向を判別し、その方向が上以外の場合は、二値画像および領域情報を回転して文字認識処理を行うようにしてもよい。文字データ209は、文字認識結果の文字コード列のみではなく、各文字の座標情報、推定文字サイズやピッチ、行ピッチなど、文字認識処理に付随して推定された書式情報を含んでいてもよい。また、文字データ209は、文字画素塊データが有する色の情報を利用して推定された、各文字の色情報を含んでいてもよい。
The
電子文書記述生成部205は、領域データ207、グラフィックスデータ208、および文字データ209を入力として、それらを用途に合った形式になるよう選択・変形・合成し、出力となる出力電子文書210の記述を生成する。電子文書記述生成部205は、1つの入力画像200に対し、1ページの出力電子文書を生成するようにしても、複数の入力画像に対し1のマルチページ電子文書が生成されるようにしてもよい。
The electronic document
[各処理部の動作]
続いて、図2の電子文書生成処理を構成する各処理部の詳細な動作例を順に説明していく。各処理部による処理は、画像処理装置100が備えるCPU102が、記憶部であるメモリ103等に記憶されたプログラムを読み出し、実行することにより実現される。
[Operation of each processing unit]
Next, detailed operation examples of the processing units constituting the electronic document generation process of FIG. 2 will be described in order. The processing by each processing unit is realized by the
(画素塊解析部による処理)
図3に、画素塊解析部201の動作例を説明するフローチャートを示す。
(Processing by the pixel block analysis unit)
FIG. 3 shows a flowchart for explaining an operation example of the pixel
S301では、入力画像200が画素塊解析部201へと入力される。ここで入力画像200は、カラー画像であれば、各画素がRGB各々3つの8bit値で表現されるページサイズの画素集合として、メモリ103に展開した状態で入力されるものとする。なお、これはあくまで一例であって、グレー形式を含むRGB形式以外の色空間で表現されていてもよい。また、入力画像200が圧縮画像のストリームとして入力され、画素塊解析部201がメモリ103にてRGB画素などとなるように展開してもよい。
In S <b> 301, the
S302では、画素塊解析部201は、入力画像200の各画素に対し、減色処理を施した減色画像を生成する。この減色画像において各画素がとる値の範囲は、入力画像200の画素値範囲以下の0〜N(N≧2)の値である。減色処理の方法自体については、本発明の本質と外れるので詳細な説明は省略する。しかし、減色後の画素値が白黒二値ではなく、元の入力画像200に含まれる文字や線等の色特徴を保持する画素値を保持するよう処理することで、本発明の効果が発揮されることは留意すべきである。つまり、白黒二値のような2種類の画素値を有する画像でなく、3種類以上の画素値を有することが可能な画像を対象として本発明に係る処理を適用することが本発明の効果を得る前提となる。
In step S <b> 302, the pixel
このような減色処理の例としては、入力画像200がRGB形式の場合、各画素をR、G、B各要素についてそれぞれ128未満か128以上であることを0、1で表現した3bitで最大8色に減色する方法がある。また、各画素の輝度値Yを計算し、このYを4段階に量子化することで減色する方法もある。また、画像の画素値ヒストグラムからN個の代表色を推定したうえで代表色にID値を付与し、各画素には最も近似する代表色のID値を割りあてる方法もある。
As an example of such color reduction processing, when the
S303では、画素塊解析部201は、減色画像内で同じ画素値を持つ連結画素の集合に対し、公知のラベリング処理を行い、同一ラベルを持つ画素集合を画素塊として抽出する。これは、入力画像200中で色が近似する連結画素塊を抽出することを意味する。この連結画素の判定には、上下左右とすべての斜め方向の隣接画素を考慮する8連結判定を用いることにする。8連結判定を用いたラベリング処理については、図4および図5を用いて後述する。
In step S303, the pixel
S304では、画素塊解析部201は、S303で生成した画素塊情報中の全画素塊を対象に、画素塊間の接触の有無を示す情報を保持するように、画素塊情報を更新する。具体的には、注目画素塊に対し、1)外接矩形が接するか重なる画素塊、2)さらに両画素塊のランの中に接触するランがある、の両条件に合致する画素塊のIDのリストを接触画素塊のリストとして登録する。これを全画素塊の組み合わせに対し実行する。なお、上記条件は一例であり、他の条件を用いても構わない。また、接触する画素塊を取得する処理は、S304のラベル付けのところで、接触ラベル間の関連づけを行っておくことで、より高速な接触関係の特定が可能である。しかし本処理の効率は発明の本質とは関係ないのでその説明は省略する。
In S304, the pixel
S305では、画素塊解析部201は、画素塊情報中の全画素塊を対象に、ある画素塊が別の画素塊を含む、あるいは別画素塊に含まれることを示す包含情報を生成し、画素塊情報に追加する。なお、本例では2画素塊が包含関係にあることを次の条件で定義する簡易判定処理を行う。1)2画素塊間が接触しており、かつ、2)片方の画素塊の外接矩形が他方の画素塊の外接矩形を完全に包含する。これは包含判定時の処理量を軽減し処理時間を省くためである。なお、他の条件を用いることによって判定を行い、画素間の正確な包含判定を用いるようにしてもよい。
In S305, the pixel
S306では、画素塊解析部201は、画素塊情報に追加された包含関係を、画素塊同士の親子関係とみなしたうえで、画像全体を祖先(ルート)とし、各画素塊をノードとする画素塊のツリー構造を生成する。なお、S305にて用いる処理条件では、親となる画素塊を持たない画素塊が存在する場合がある。その場合、当該画素塊が、接触関係にある画素塊の親と同じ親を持つようにツリー構造を生成する。また、親が複数ある画素塊が存在する場合があるが、その際は任意のひとつの親、例えば、階層の最も深い親とのみ親子関係を有すように構造を生成すればよい。S306で生成された画素塊ツリー構造と、各画素塊の情報とを合わせたものが、画素塊解析部201が生成する画素塊データ206となる。
In S306, the pixel
(8連結判定によるラベリング処理)
S303にて行われる8連結判定によるラベリング処理の例を図4のフローチャートを用いて説明する。
(Labeling process based on 8-connection judgment)
An example of the labeling process based on the 8-connection determination performed in S303 will be described with reference to the flowchart of FIG.
S401では、画素塊解析部201は、ラベル値kを1に初期化する。S402では、画素塊解析部201は、減色画像の注目ラインにおいて、同一画素値が連続するランを現ランとして抽出する。最初は減色画像の最上ラインに注目し、その左端の画素から同じ画素値を持つ画素が右方向に連続する範囲をランとして抽出するものとする。抽出されたランは、始終点のx座標および注目ラインのy座標の組からなるラン情報として記憶される。なお、後述するように、同注目ラインでS402が再度処理される場合、処理済ランの右端の次の画素から始まるランを抽出する。
In S401, the pixel
S403では、画素塊解析部201は、注目ラインのひとつ上のラインにすでに抽出されたランがあり、かつ現ランと画素値が連結しているものがあるかどうかを調べる。ここで8連結しているとは、y座標=k、x座標による始終点=(s,e)の現ランに対し、y座標k−1、x座標(s−1,e+1)の範囲に1画素でも存在するランであり、かつ画素値が同一であることが条件である。なお、注目ラインが最上ラインの場合は、連結ランは常に存在しないこととなる。条件に合致する連結ランが無い場合は(S403にてNO)、S404に進み、画素塊解析部201は、現ランに新規ラベルLkを付与する。続いてS405で、画素塊解析部201は、ラベル値kに対して+1とする。一方、S403で条件に合致する連結ランが存在した場合(S403にてYES)、S406に進む。
In step S <b> 403, the pixel
S406では、画素塊解析部201は、条件に合致する連結ランが複数で、かつ当該連結ランが複数のラベル種を有しているかどうかを調べる。複数のラベル種を有している場合は(S406にてYES)、S407に進み、画素塊解析部201は、最初に検出された連結ランが有するラベルを現ランに付与する。更に、画素塊解析部201は、全連結ランが有するラベルが同一グループとみなされるよう、ラベル値間の関連付けを行う。一方、連結ランが単一の場合、あるいは複数の連結ランが同種のラベルを有している場合は(S406にてNO)、S408に進み、画素塊解析部201は、連結ランが有するラベルを現ランに付与する。
In step S <b> 406, the pixel
S405、S408、S409の後、S409に進み、画素塊解析部201は、注目ラインに次のランが有るか否か、すなわち現ランの終点が画像右端でないかどうかを調べる。次のランがある場合(S409にてYES)、画素塊解析部201は、そのランが抽出されるようにS402に進んで以降処理を繰り返す。注目ラインに次のランが無い場合(S409にてNO)、S410に進む。
After S405, S408, and S409, the process proceeds to S409, and the pixel
S410では、画素塊解析部201は、注目ラインが最終ラインかどうかを調べる。最終ラインではない場合(S410にてNO)、S411に進み、画素塊解析部201は、次のラインに移動する。そして、S402に戻り、画素塊解析部201は、そのライン左端の画素から新たなランを抽出して以降の処理を繰り返す。注目ラインが最終ラインの場合は(S410にてYES)、S412に進む。
In step S410, the pixel
S412では、画素塊解析部201は、ラベル値毎に、同ラベルが付与されたランの集合により構成される画素塊情報を作成する。このランの集合を構成する際には、S407で関連づけられた複数種類のラベル値を持つランがひとつの画素塊ラン情報に集められるよう処理される。最終的に生成される画素塊情報として、ひとつの画素塊は、識別の為のID、外接矩形情報、画素値、および画素塊に集められたラン情報の集合の組から成る。
In step S412, the pixel
(ラベリング処理の処理例)
図4のラベリング処理を適用した場合の処理例を図5に示す。図5(a)は処理対象となる減色画像の例であり、ひとつのマスが1画素を表す幅6×高さ3画素の画像で、各マス内の数値は画素値を示す。図5(b)は図5(a)に対するラベリング処理の結果の例である。
(Example of labeling process)
An example of processing when the labeling processing of FIG. 4 is applied is shown in FIG. FIG. 5A shows an example of a subtractive color image to be processed. An image having a width of 6 × 3 pixels in which one square represents one pixel, and a numerical value in each square represents a pixel value. FIG. 5B is an example of the result of the labeling process with respect to FIG.
ラベリング処理では、まず最上のライン(y=0のライン)に注目して、左端から始まる画素値3のラン501が抽出される。これより上にはラインが存在しないので連結ランは無く、ラン501には最初のラベルL1が与えられる。続く画素値1のラン502にも同様に新規ラベルL2が与えられる。
In the labeling process, first, paying attention to the uppermost line (line of y = 0), a
最上ラインにもう画素は無いので次のライン(y=1のライン)に移動し、画素値1のラン511が抽出される。上ライン(y=0のライン)にはラン511に連結する画素値1のランは無いので、ラン511には、新規ラベルL3が与えられる。次の画素値3のラン512は、上ライン(y=0のライン)に同値のラン501が存在する。連結ランはこのラン501だけなので、ラン501のラベルL1がラン512にも与えられる。続いて、画素値1のラン513が抽出され、同様に上ライン(y=0のライン)の連結ランであるラン502のラベルL2が与えられる。続いて画素値3のラン514が抽出され、連結ランが無いので、新規ラベルL4が与えられる。 3ライン目(y=2のライン)に移動し、画素値1のラン521が抽出され、上の連結ランであるラン511のラベルL3が与えられる。続く画素値3のラン522は上ライン(y=1のライン)の連結ランとして、ラン512とラン514が存在する。かつ、ラン512とラン514のラベル値はそれぞれL1およびL4と異なるので、ラン522には連結ランのうち最初に検出されたラン512のラベルL1が与えられる。加えて、ラベルL1とラベルL4を同一ラベルとみなすための関連付け情報が生成される。最後に、画素値2のラン523が抽出され、新規ラベルL5が与えられる。
Since there are no more pixels in the uppermost line, the process moves to the next line (y = 1 line), and a
図5(c)はラベル付けされたラン集合から生成される画素塊情報の例である。ID1の画素塊は、前述の関連付けに基づき、ラベルL1のラン501、512、522およびラベルL4のラン514の集まりとして構成されている。またその矩形範囲として(0,0)−(5,2)、および画素値3が記憶されている。ID2の画素塊は、ラベルL2のラン502およびラン513により構成される、矩形範囲(2,0)−(5,1)、および画素値1の画素塊である。以降、ID3、ID4も同様に示される。なお、一度画素塊情報が構成されれば、ランの集合を構成する際に使用されたラベルの情報Lkは破棄してもよい。また、各ラン情報が持つ座標を、図5(c)に記されるように各画素塊の外接矩形の左上を原点とするように再設定してもよい。
FIG. 5C shows an example of pixel block information generated from the labeled run set. The pixel block of ID1 is configured as a collection of
(画素塊解析部による処理結果の例)
図6に画素塊解析部201による処理結果の例を示す。図6(a)は画素塊解析部201に入力される減色画像の例である。図6(b)は、図6(a)に示す減色画像から抽出された画素塊情報の例であり、かつS304で生成された画素塊の接触関係を矢印で示した図である。図6(c)は、図6(b)に示す画素塊情報の例において、S305で生成された包含関係を矢印で示した図である。この矢印は矢の先が子、元が親を示している。図6(d)は、図6(b)および図6(c)から構成された画素塊ツリー情報の例である。図6(d)の画素塊601は包含関係による親画素塊が存在しないため、接触している画素塊602が親とする画素塊を親とするようにツリー構造が構築されている。
(Example of processing results by the pixel block analysis unit)
FIG. 6 shows an example of the processing result by the pixel
なお、図3のフローチャートでは、画素塊解析処理により入力画像データ全体を一度に処理するように説明した。これに対し、入力画像データを複数部分に分け、各部分画像の入力と画素塊情報の抽出を繰り返しながら行っても構わない。例えば、特許文献3では、32画素四方のタイルをひとつの処理単位とし、画像の左上から順に画像入力、量子化、タイル内画素塊であるblobの作成、を繰り返すよう処理する例が説明されている。この特許文献3による説明では更に、処理済タイルである上タイルおよび左タイルにあるblobを現タイルのblobと結合することで、結果的に入力画像200と同じサイズも含む任意の大きさの画素塊生成している。この処理方法を適用することにより、本実施形態に係る画素塊データの生成処理に消費するメモリや処理時間を大幅に節約することも可能である。
In the flowchart of FIG. 3, it has been described that the entire input image data is processed at once by the pixel block analysis processing. On the other hand, the input image data may be divided into a plurality of parts, and input of each partial image and extraction of pixel block information may be repeated. For example,
(レイアウト解析部による処理)
続いて、レイアウト解析部202の処理を、図7のフローチャートを用いて説明する。本処理では、メモリ103上の画素塊データ206を入力とし、文字、線画、自然画、表といった文書領域間の構造に基づいた、領域データ207をメモリ103上に構成していく。
(Processing by the layout analysis unit)
Next, the processing of the
S701では、レイアウト解析部202は、入力である画素塊データ206中の各画素塊を、文字候補画素塊とそれ以外の画素塊に分類する。画素塊が文字候補であるか否かの分類は、公知の文書画像解析技術で利用されている文字画素塊判定方法を用いればよい。例えば、画素塊の外接矩形サイズを利用し、予め定められた高さおよび幅の範囲に収まるものを文字候補とする方法がある。
In S701, the
本例においては、文字とみなす大きさを6ポイントから50ポイントまでとし、入力画像200の解像度から換算したTmin〜Tmaxの画素数に、画素塊の幅あるいは高さが収まるものを文字候補とする。ここでサイズに下限を設けることは、文字内部から抽出される背景相当の小画素塊を文字候補に含めないようにする効果がある。文字候補の判定条件に、更に画素の密度や比率、画素色などを加えてもよい。また大きさの閾値は、入力画像200から実際抽出された画素塊の集合より幅・高さの頻度情報を得て、動的に定めるようにしてもよい。
In this example, the size considered as a character is from 6 points to 50 points, and a character candidate that has a pixel block width or height that falls within the number of pixels Tmin to Tmax converted from the resolution of the
S702では、レイアウト解析部202は、S701で分類された文字候補の画素塊に対し、互いに近傍にあるものに対するグループ化を行う。近傍であるか否かの判定は、画素塊の外接矩形座標間のユークリッド距離を計算し、予め定められた閾値以下であることで判定することができる。これはあくまで一例であり、距離計算にシティブロック距離など別の計算方法を用いてもよい。また、複数の文字は行をなして記述され、一般に行内の文字間隔は行間隔より狭いことから、小さい距離閾値で文字行をなす文字候補画素塊をグループ化し、さらに大きな距離閾値で複数の文字行をグループ化するようにしてもよい。なお、本グループ化処理では、画素塊ツリー構造において同じ親を持つ文字候補画素塊同士のみがグループ化の対象になるものとする。これは、近傍計算の対象となる画素塊の組み合わせを減らし、処理を高速化するためである。
In step S <b> 702, the
S703では、レイアウト解析部202は、S702でグループ化された文字候補画素塊の集合が、実際に文字集合であるか否かの判定をグループ毎に行う。そして、レイアウト解析部202は、文字集合であるとされたグループの画素塊の存在範囲をそれぞれ文字領域として特定する。そして特定された領域それぞれに対し、領域の座標と対応画素塊への関連付け情報を含む領域情報が、領域データ207の構成要素として記憶される。すなわち、文字領域に対しては、グループ化された文字候補画素集合への関連付け情報と、同画素塊を囲む外接矩形座標情報とが文字領域情報として記憶される。
In step S703, the
文字集合であるか否かの判定は、例えば、グループを含む矩形範囲で文字候補画素塊の射影を縦横に求め、文字列としての整列性を示すか否かで判断する方法がある。具体的には、横書きならば水平の射影、縦書きならば垂直の射影において、行部分には山、行間には谷となる頻度分布が観測されるものは文字領域の可能性が高いと判断できる。さらに、文字同士は斜体などの例外を除き、互いの外接矩形が大きく重複することは少ない。したがって、他の画素塊と大きな重複がないことも、文字領域か否かの判定の有効な手段となる。ただし、漢字などで1つの文字が複数の重複する画素塊に分割されているケースを除くために、重複判定を一定以上の大きさの画素塊間のみに制限することが効果的である。 For example, there is a method for determining whether or not the character set is a character set by determining whether a character candidate pixel block is projected vertically and horizontally in a rectangular range including a group, and indicating whether or not the character string is aligned. Specifically, in horizontal projection for horizontal writing and vertical projection for vertical writing, if a frequency distribution with peaks in the line part and valleys in the line is observed, it is determined that there is a high possibility of a character area. it can. In addition, with the exception of italics and other characters, the circumscribed rectangles do not overlap significantly. Therefore, the fact that there is no large overlap with other pixel blocks is also an effective means for determining whether or not it is a character area. However, in order to exclude the case where one character is divided into a plurality of overlapping pixel blocks such as kanji, it is effective to limit the overlap determination to only between pixel blocks having a certain size or more.
なお、文字領域として特定されたあとに、同領域内にある別の画素塊を文字候補画素塊の集合に追加してもよい。例えば、句読点や文字内の独立点部分の画素塊は、サイズ制限により文字候補画素塊に選出されていない可能性が高い。これら文字候補画素塊に含めるために、既に文字候補である画素塊と同色で近傍にある小サイズの画素塊を追加する処理を行ってもよい。 After the character area is specified, another pixel block in the same area may be added to the set of character candidate pixel blocks. For example, there is a high possibility that a pixel block of an independent point portion within a punctuation mark or character is not selected as a character candidate pixel block due to size restrictions. In order to include in these character candidate pixel blocks, a process of adding a small-sized pixel block having the same color as that of the pixel block that is already a character candidate in the vicinity may be performed.
S704では、レイアウト解析部202は、S701で文字候補以外に分類された画素塊から、線画・表枠候補の画素塊を選出する。線画・表枠候補か否かの判定は、文字候補以上の大きさであり、かつ画素塊の存在範囲全体に対する画素密度が低いことにより判断できる。
In step S <b> 704, the
S705では、レイアウト解析部202は、S704で線画・表枠候補とされた画素塊に対し、表枠であるか否かの判定を行い、表枠と判定された画素塊の存在領域を、表領域として特定する。そして、レイアウト解析部202は、対応する表枠の画素塊への関連付け情報と、同画素塊の外接矩形座標を含む領域情報とを、表領域情報として領域データ207に記憶する。
In step S705, the
表領域情報表枠か否かの判定は、例えば、画素塊の存在範囲において、画素塊のラン情報から縦横の画素ヒストグラムを計算し、その形状から判定を行えばよい。つまり画素塊が表枠に相当するものであれば、縦横の表外枠および罫線の存在する部分に、複数の鋭いピークがヒストグラム上に発生することを利用する。これらを検出することで、表枠かどうかの判定を行うことができる。あるいは、表枠画素塊の子に相当する画素塊の集合により判断することもできる。表枠の子となる画素塊は、表内の枠領域に相当するため、子領域すべてが矩形形状であり、かつ重なりなく整列していることは、表枠であることの有効な判断手段となる。 Whether or not the table area information table frame is present may be determined, for example, by calculating a vertical and horizontal pixel histogram from the run information of the pixel block in the presence range of the pixel block and determining the shape. That is, if a pixel block corresponds to a front frame, the fact that a plurality of sharp peaks are generated on the histogram in a portion where vertical and horizontal outer frames and ruled lines exist is utilized. By detecting these, it is possible to determine whether the frame is a table frame. Alternatively, the determination can be made based on a set of pixel blocks corresponding to the children of the table frame pixel block. Since the pixel block that is a child of the table frame corresponds to a frame region in the table, all the child regions are rectangular and aligned without overlapping, which is an effective determination means for being a table frame. Become.
S706では、レイアウト解析部202は、S704で線画・表枠候補とされ、かつS705で表枠と判定されなかった画素塊の存在領域を、線画領域として特定する。そして、レイアウト解析部202は、対応する線画の画素塊への関連付け情報と、同画素塊の外接矩形座標を含む領域情報とを、線画領域情報として領域データ207に記憶する。このとき、線画と判定された画素塊の近傍にある画素塊をグループ化した範囲を線画領域としてもよい。
In step S <b> 706, the
S707では、レイアウト解析部202は、ここまでに記憶されたどの領域にも対応しない画素塊の中から、写真等の自然画領域と判定される画素塊、もしくは画素塊の集合を選出し、その存在領域を自然画領域情報として記憶する。そして、レイアウト解析部202は、対応する画素塊集合への関連付け情報と、同画素塊の存在範囲の座標を含む領域情報とを、自然画領域情報として領域データ207に記憶する。
In step S707, the
自然画領域か否かの判定は、複数色の画素塊が重複、あるいは包含されるように存在しており、かつそれら画素塊の集合が一定の大きさ内の矩形を構成しているものを、矩形状の写真に相当する自然画領域と判定することにする。この判定はあくまで一例であって、任意形状の画素塊集合を対象にしてもよい。 Whether or not it is a natural image area is determined so that pixel clusters of multiple colors exist so that they overlap or are included, and the set of pixel clusters forms a rectangle within a certain size. The natural image area corresponding to the rectangular photograph is determined. This determination is merely an example, and an arbitrarily shaped pixel block set may be targeted.
S708では、レイアウト解析部202は、ここまでに記憶されたどの領域にも対応しない画素塊の中から、一定以上の密度および面積を持つ画素塊を、フラット領域として記憶する。無地のページ全体を占める領域、文字や図の背景などで意味的なまとまりを持たせるために着色された色背景領域や、表内セルの背景などがこのフラット領域に相当する。
In step S <b> 708, the
S709では、レイアウト解析部202は、S708までに領域データ207に記憶されている各々領域をノードとし、その相対関係を表現する領域ツリーを構成する。領域ツリーの起点には、入力画像全体範囲に相当する特殊なルートノードを配置する。そして、領域ツリーのノード間の親子関係は、画素塊ツリーにおいて各領域に対応する画素塊ノードが持つ親子関係と一致するようにする。ツリー構造を構成するための具体的処理としては、各領域データに親領域へのリンク情報、および子領域へのリンク情報のリストを付与することでツリー構造を構成する。
In step S709, the
(レイアウト解析部による処理結果の例)
図7のフローチャートにより説明した、レイアウト解析部202における処理の結果の例を、図9を用いて説明する。図9(a)は、画素塊解析部201により減色され、画素塊に分解される文書画像の例である。図9(b)は、図9(a)に示す文書画像において抽出された画素塊を、画素塊ツリー構造で表現した例図である。図9(a)、(b)において、画素塊901、902、903はそれぞれ元画像において文字に相当する画素塊の集合である。画素塊904〜907は、表を構成する画素塊である。画素塊908は星型の線画に相当する画素塊である。画素塊909、910は写真に相当する画素塊である。なお図9では、文字内部の小さな画素塊に関しては記載を省略している。
(Example of processing result by layout analysis unit)
An example of the result of processing in the
図9(b)において、矢印は包含関係に基づく親子関係を示している。例えば、表を構成する画素塊904〜907において、画素塊905は表の左側枠内の単色背景領域である。画素塊905は内部に2つの文字の領域である画素塊902を包含するので、両者は親子関係となる。一方、表の右側枠内の背景領域は、上下に異なる色の画素塊906、907に分かれている。その結果、文字の画素塊903はどちらの画素塊にも包含されないので、それらの親となる表枠の画素塊904の直接の子となる。こういったケースはオリジナルの入力画像が元々そのように色分けされている場合の他、ノイズや減色処理を要因に、単色領域が意図せず過分割されて生ずることもある。いずれにせよカラーの画素塊構造抽出処理において普遍的に発生するケースであることを考慮すべきである。
In FIG. 9B, arrows indicate parent-child relationships based on inclusion relationships. For example, in the pixel blocks 904 to 907 constituting the table, the
図9(c)は、図9(b)の画素塊ツリーから生成される領域ツリーの例であり、その生成過程を図7のフローチャートのS701〜S709に従って以下説明する。まずS701〜S703にて、レイアウト解析部202は、画素塊901、902、903の3つの画素塊グループが文字候補画素塊として選出する。そして、レイアウト解析部202は、文字領域の判定条件を満たす、各存在範囲が文字領域として子領域ノード921、922、923を記憶する。
FIG. 9C is an example of a region tree generated from the pixel block tree of FIG. 9B, and the generation process will be described below according to S701 to S709 of the flowchart of FIG. First, in S701 to S703, the
S704で、レイアウト解析部202は、画素塊904、908を線画・表枠候補として選出する。S705では、レイアウト解析部202は、画素塊904を表枠と判定し、表領域として子領域ノード924を記憶する。S706では、レイアウト解析部202は、画素塊908を線画と判定し、線画領域として子領域ノード928を記憶する。
In step S704, the
S707で、レイアウト解析部202は、画素塊909、910が自然画領域を構成すると判定し、自然画領域として子領域ノード929を記憶する。S708では、レイアウト解析部202は、残る画素塊900、905、906、907をいずれもフラット領域として記憶する。そしてS709にて、レイアウト解析部202は、各領域をノードとし、各々対応する画素塊ツリーの親子構造を反映した領域ツリー構造を生成する。図9(c)において、線で結ばれる領域は親子関係を持つ。
In step S707, the
(グラフィックスデータ生成部による処理)
続いて、グラフィックスデータ生成部203の処理を説明する。グラフィックスデータ生成部203は、領域データ207に含まれる各領域をグラフィックスオブジェクトとして表現する為のグラフィックスデータ208を生成する。ここで生成されるデータは、後述の電子文書記述生成部205において、各領域の内容をオブジェクトとして記述する際に利用される。以下、グラフィックスデータ生成部203の処理を図8のフローチャートを用いて説明する。
(Processing by the graphics data generator)
Next, the processing of the graphics
S801では、グラフィックスデータ生成部203は、出力電子文書210において、線図形部分のオブジェクトをグラフィックスで表現するためのベクトルデータを生成する。本例におけるベクトルデータの生成対象領域は、入力となる領域データ207中に存在する線画領域、および表領域とする。生成されたベクトルデータは、領域データ207中の対応する領域ノードに関連付けられたうえで、メモリ103あるいはハードディスク104に保存される。ベクトルデータ生成には、対象領域に関連付けられた画素塊の輪郭情報から、公知のベクトル化手法、すなわち直線、曲線パス近似手法を用いるものとする。各画素塊から生成されるパスの塗り色には、画素塊に関連付けられた色情報を設定するものとする。
In step S <b> 801, the graphics
S802では、グラフィックスデータ生成部203は、出力電子文書210において、ベクトル化対象外の領域を表現するための、切り出し画像データを生成する。本例における切り出し画像データ生成領域は、領域データ207中に存在する自然画像の領域(自然画領域)とする。切り出された画像データは、領域データ207中の対応する領域ノードに関連付けられたうえで、メモリ103あるいはハードディスク104に保存される。ここで切り出し処理とは、入力画像200を参照し、対象範囲の画素のみからなる同サイズの画像データを生成する処理である。切り出された画像データはJPEG等の公知の圧縮技術で圧縮してもよい。
In step S <b> 802, the graphics
S803では、グラフィックスデータ生成部203は、出力電子文書210において、背景に用いられる背景画像データを生成する。生成された背景画像データは領域データ207のルートノードに関連づけられて、メモリ103もしくはハードディスク104に保存される。
In step S <b> 803, the graphics
背景画像とは、S801、S802で生成されるベクトルデータや切り出し画像データを前景データとして、当該背景画像に重ねて描画することで、出力電子文書210が入力画像200と同等の見た目を有するように用意されるものである。背景画像データに対しては、前景データが存在する領域の画素情報を入力画像200から消去する処理を行う。
A background image is such that the output
画素情報の消去には、合成した出力電子文書210において、データが二重に見えるのを防ぐ効果がある。あるいは重畳により隠れてしまう領域に存在する無駄な画素情報を無くすことで圧縮効率を上げ、出力電子文書をコンパクトにする効果がある。画素情報の消去は、例えば、対象領域の矩形範囲をその周囲色で一様に塗り潰す方法がある。なお、対象領域が線図形領域の場合、線部分に相当する画素のみを、その近傍の画素色で塗り潰すようにすれば、線部分以外にあたる部分の色情報を背景情報に残すこともできる。
Erasing pixel information has the effect of preventing the data from appearing double in the synthesized output
なお、S801およびS802において、どの種類の領域に対しベクトル化処理または画像切り出し処理を行うかは上述した例に限るものではない。例えば、線画、表領域に対し画像切り処理を行うようにしてもよい。また、ベクトル化対象領域に文字領域を加えてもよい。これらの対象選択は、電子文書生成処理の制御項目として、処理対象領域種類を外部指示により設定できるようにしてもよい。また、生成される電子文書の形式が複数あり、それぞれ別の用途がある場合、各用途に適したデータ形式を領域種別毎に変えられるようにしてもよい。 In S801 and S802, for which type of region the vectorization process or the image cutout process is performed is not limited to the above-described example. For example, image cutting processing may be performed on a line drawing and a table area. In addition, a character area may be added to the vectorization target area. In these target selections, the processing target area type may be set by an external instruction as a control item of the electronic document generation process. In addition, when there are a plurality of formats of electronic documents to be generated and each has a different use, a data format suitable for each use may be changed for each region type.
また、S803の背景画像データ生成時に、どの種類の領域に対して画素情報の消去処理を行うかを、電子文書生成処理の制御項目として設定するようにしてもよいし、生成電子文書の形式に合わせて変えられるようにしてもよい。また、文字領域がベクトル化対象ではない場合にも、後述の文字認識部204の処理において、文字データ209が出力される場合には、文字画素が除去されるように背景データが生成されるようにしてもよい。
In addition, it may be set as a control item of the electronic document generation process for which type of region the pixel information erasure process is performed at the time of generating the background image data in S803. You may make it change together. Even when a character area is not a vectorization target, when
図9に、図9(a)の入力画像の例に対し生成される背景データの例を示す。図9(a)中のすなわち文字領域である画素塊901〜903、線画領域である画素塊908、および表枠領域である画素塊904の線図形部分画素が周辺の画素色で塗りつぶされている。また、自然画領域である画素塊909の矩形範囲が周辺の画素色で塗りつぶされている。
FIG. 9 shows an example of background data generated for the example of the input image shown in FIG. In FIG. 9A, the
(文字認識部による処理)
文字認識部204の処理を、図10のフローチャートを用いて説明する。S1001では、文字認識部204は、文字認識処理に入力する文字画像を生成する。本説明では、文字認識処理において、文字を含む二値画像を入力とすることを前提とし、各文字領域の2値画像を生成する。文字領域の二値画像とは、領域内の文字画素を1、それ以外を0とする、入力画像と同じ画素数の二値画像である。実際の処理では、レイアウト解析部202が生成した領域データ207中の各文字領域に対し、同領域内に存在する画素塊情報を画素塊解析部201が生成した画素塊データ206から読み出す。そして、各画素塊が持つラン部分が1、それ以外が0になるように、入力画像200と等サイズの画像を生成する。
(Processing by the character recognition unit)
The processing of the
S1002では、文字認識部204は、入力された文字入りの文書画像が正置されていない、すなわち入力画像200内に書かれた文字の上方向が90°、180°、270°である可能性を想定する。そして、文字認識部204は、それらを正しい向きに補正するために必要な回転角を判別する方向判別処理を行う。
In S <b> 1002, the
ここでの方向判別処理は、S1001で生成した二値画像を利用して公知の手法で行う。方向判別処理の手法は本発明の本質とは異なるため詳細は省略する。なお、方向判別処理の一例として、画像中のいくつかの文字を0°のほか、90°、180°、270°に回転した状態で計4方向に認識し、その際の認識スコアが最も高い方向を正しい方向と判断する方法が挙げられる。 The direction discrimination processing here is performed by a known method using the binary image generated in S1001. Since the method of direction discrimination processing is different from the essence of the present invention, the details are omitted. As an example of the direction discrimination processing, some characters in the image are recognized in four directions in a state rotated to 90 °, 180 °, and 270 ° in addition to 0 °, and the recognition score at that time is the highest. One way is to determine the direction as the correct direction.
S1003では、文字認識部204は、S1002で得られた、必要な回転角が0°かどうかを調べる。必要な回転角が0°、すなわち回転の必要が無い場合には(S1003にてYES)、S1006に進む。90°、180°、270°いずれかの回転が必要な場合には(S1003にてNO)、S1004に進む。
In S1003, the
S1004では、文字認識部204は、S1001で生成した二値画像を、S1002で得られた必要回転角度分だけ回転する。S1005では、文字認識部204は、S1002で得られた回転角を領域データ207に回転情報として付加する。
In S1004, the
S1006では、文字認識部204は、回転された二値画像および文字領域情報を利用して、各文字領域内に公知の文字認識処理を実行し、文字コード列を含む文字認識結果を得る。なお、回転角が0°以外の場合は、文字認識処理に指定する領域情報も、回転された二値画像上での領域に一致するように回転されたものとする。文字認識結果は、文字領域情報、行情報、および認識文字情報で構成される。文字領域情報は、位置情報として文字が存在する範囲の座標と、認識された文字行数の情報を含む。行情報は、各行の行内文字数の情報を含む。認識文字情報は、各文字に対して認識された文字コードと、文字の外接矩形座標の情報とを含む。認識文字情報には、文字認識処理により付加的に得られた各文字の情報を追加してもよい。例えば、行内の文字平均高さやピッチから推定される文字サイズや、太字、斜体、下線といった文字修飾情報やフォント種類などを付加してもよい。
In step S1006, the
S1007では、文字認識部204は、S1006で出力された文字認識結果の各文字に色情報を付加する。本処理では、画素塊データ206に保持されている、各画素塊の外接矩形座標と、画素値すなわち画素塊の色情報とを利用する。ただし、文字認識処理は二値画像を文字領域単位で指定して行われており、文字認識処理の結果である文字単位は、画素塊データ206の画素塊と関連づけられていない。
In step S1007, the
(色情報付加処理)
文字認識部204によるS1007の処理を図12のフローチャートを用いて説明する。S1201では、文字認識部204は、領域データ207の文字領域に属する画素塊データ206から未処理画素塊一つを処理対象Cとして選択する。このとき、文字認識部204は、文字データ209の処理情報をクリアする。画素塊データに対する処理順序は、画素塊データの処理方法や原稿の入力方向などにより異なるため、不定、つまり文字の読み順であることを前提としない。なお、領域データ207に0°以外の回転角が付与されている場合は、処理対象の画素塊Cに対する以下のステップの処理において、回転角により回転された座標を用いる。これにより、入力画像の方向と文字認識処理時の正置方向が異なる場合に、両者から得られたデータの不一致を解消することができる。
(Color information addition processing)
The process of S1007 by the
S1202では、文字認識部204は、文字データ209から未処理文字の一つを処理対象Oとして選択する。S1203では、文字認識部204は、画素塊Cと文字データOの領域の外接矩形の重なりを判定する。CとOの領域の外接矩形が重なれば(S1203にてYES)、S1204へ進む。CとOの領域の外接矩形が重ならない場合は(S1203にてNO)、S1202へ進み、文字認識部204は、次の未処理文字データを処理対象Oとする。
In step S <b> 1202, the
S1204では、文字認識部204は、既に文字Oに画素塊Cが関連付けられているかを判断する。関連付けられていなければ(S1204にてNO)、S1206へ進む。関連付けられていれば(S1204にてYES)、文字認識部204は、画素塊Cを文字Oの関連画素塊Ocとして、S1205へ進む。ここで、文字と画素塊とが関連付けられているかの判定は、当該文字に色情報が付加されているかで判断することができる。
In step S1204, the
S1205では、文字認識部204は、既に文字Oに関連づけられた画素塊Ocと文字Oの重なりの面積が近似するかを判定する。ここでは、文字認識部204は、既に文字Oに関連づけられた画素Ocと文字Oの重なりの面積と、画素塊Cと文字Oの重なりの面積の大きさを判定する。あるいは単に画素塊Cと文字Oの重なりの大きさと文字Oの面積の近さ、つまり画素塊Cが文字Oをカバーする面積の広さにより判定しても良い。
In step S <b> 1205, the
本工程は、小領域を無視することで文字矩形内に存在するノイズの色の付加を防ぐ目的と、より正確な色情報を持つ画素塊と関連づける効果がある。先に説明した様に、文字画素塊と文字は一対一で対応するとは限らない。例えば偏と旁からなる漢字では偏と旁でそれぞれ一つの画素塊が形成される。偏と旁が同色であれば、どちらの色情報を用いても構わないが、インクの滲みやスキャナの光学解像度の問題から文字輪郭部の色味は一般的に異なる。そのため、小さい画素塊では輪郭部の占める面積が大きくなり不正確な色情報が抽出される可能性が高い。よって、面積を比較することで、より正確な色情報を持つと推定される画素塊を選択する。面積が近似していれば(S1205にてYES)S1206へ進む。面積が近似していない場合は(S1205にてNO)、S1202へ進み、文字認識部204は、次の未処理文字データを処理対象Oとする。
This step has the effect of preventing the addition of the noise color existing in the character rectangle by ignoring the small area, and the effect of associating with the pixel block having more accurate color information. As described above, a character pixel block and a character do not necessarily correspond one-on-one. For example, in a Chinese character consisting of bias and 旁, one pixel block is formed for both bias and 旁. Either color information may be used as long as the bias and the color are the same, but the color of the character outline portion is generally different due to the problem of ink bleeding and the optical resolution of the scanner. Therefore, in a small pixel block, the area occupied by the contour portion becomes large, and there is a high possibility that inaccurate color information is extracted. Therefore, a pixel block estimated to have more accurate color information is selected by comparing the areas. If the area is approximate (YES in S1205), the process proceeds to S1206. If the area is not approximate (NO in S1205), the process proceeds to S1202, and the
S1206では、文字認識部204は、文字Oに対して、関連付けられた画素塊Cの色情報を付加する。本実施形態では、文字Oの関連画素塊Ocとして画素塊Cを関連付けることで、文字Oに対する関連画素塊Ocの色情報を参照可能とする。その後、S1207へ進む。
In step S <b> 1206, the
S1207では、文字認識部204は、文字データ209の全文字に対して処理が終了したかを判定する。処理が終了していれば(S1207にてYES)S1208へ進む。未処理の文字データがあれば(S1207にてNO)、S1202へ進み、文字認識部204は、次の未処理文字データを処理対象Oとする。
In step S <b> 1207, the
S1208では、文字認識部204は、画素塊データ206の全画素塊データに対して処理が終了したかを判定する。未処理画素塊データがあれば(S1208にてNO)、S1201へ進み、文字認識部204は、次の未処理画素塊データを処理対象Cとする。全画素塊に対して処理が終了していれば(S1208にてYES)、S1209へ進む。
In step S <b> 1208, the
S1209では、文字認識部204は、色情報のない文字データに対する色付け処理を行う。文字認識部204の出力する文字データは画素塊を元にしているため、出力される文字データには一致する画素塊が存在するが、空白などの不可視文字を認識する場合は例外的に一致する画素塊が存在しない。前の文字が存在すれば、文字認識部204は、前の文字と同一の文字色を色情報に付加する。前の文字が存在しない場合は、文字認識部204は、後ろの文字の色情報を参照し、存在しない場合はさらに後方の文字を辿り、文字色が存在した時点での文字色を付加する。この処理を色情報のない文字データ全てに行うことで、全ての空白文字に、前、あるいは後方の文字列の色情報が付けられる。なお、本実施形態では、前の文字の色を優先的に付加したが、後ろの文字の色を優先的に付加してもよい。
In step S1209, the
(色情報付加処理の処理結果の例)
以下、入力される文字領域の例として図11を用い、図12のフローチャートの処理を説明する。図11(a)は文字領域の例であり、“ab c”、“123”、“if”の3行からなる8つの文字とスペース(空白文字)とを含んでいる。ここで、“ab c”は黒色、“123”が赤色、“if”が青色であるとする。なお、1行目の“ab”と“c”の間にはスペースが含まれているものとする。
(Example of processing result of color information addition processing)
Hereinafter, the processing of the flowchart of FIG. 12 will be described using FIG. 11 as an example of the character region to be input. FIG. 11A shows an example of a character area, which includes eight characters consisting of three lines “ab c”, “123”, and “if” and a space (blank character). Here, “ab c” is black, “123” is red, and “if” is blue. It is assumed that a space is included between “ab” and “c” in the first line.
図11(b)は、図11(a)を文字認識した結果の例である。本例では、文字O01から文字O09まで9文字の文字コード情報と矩形座標情報、推定文字サイズ、そして行情報が認識されている。なお、文字認識は二値の情報を元に行われるため、色情報は付加されていない。 FIG. 11B is an example of the result of character recognition in FIG. In this example, character code information, rectangular coordinate information, estimated character size, and line information of nine characters from character O01 to character O09 are recognized. Since character recognition is performed based on binary information, color information is not added.
図11(c)は、文字領域に対して画素塊解析部201より得られた画素塊データ206の例である。C01からC09で表した9個の画素塊と、それぞれの外接矩形座標、そして色情報が格納されている。本例では色情報の表記を赤成分4bit、緑成分4bit、青成分4bitの3桁の16進数RGB表記を用いる。このとき、色情報の値は、黒色なら“#000”、赤色なら“#F00”、青色なら“#00F”となる。画素塊データは、先に説明した通り画素の連結からなるため、文字認識結果と領域が異なる。例えば、文字認識結果でスペースと認識された部分に対して画素塊は存在しない。
FIG. 11C is an example of the
また、図13(a)で示す通り、文字O08の文字矩形が実線1300で囲まれた一つの領域であるのに対し、画素塊は破線1301と破線1302で囲まれたC07、C08の二つの領域に分割される。また、C07の画素塊の色情報が実際は青色を表す“#00F”であるにも関わらず、文字の滲み、あるいはスキャン解像度によって、“#33F”として得られている。文字の滲み、スキャン解像度による色の誤差については図14を用いて説明をする。
Further, as shown in FIG. 13A, the character rectangle of the character O08 is one area surrounded by a
図14(a)は、図11(a)の文字“i”のスキャン画像を拡大した図である。3×3の小領域からなる領域1401は、色滲みとスキャン解像度の影響により、本来の色よりも淡色で得られている。領域1402は領域1401と比較してより大きい領域であるため、色の滲みやスキャン解像度の影響を受けている領域が少ない。
FIG. 14A is an enlarged view of the scanned image of the letter “i” in FIG. A
図14(b)は、図14(a)に対して減色処理(S302)を行った結果を図示したものである。減色処理により領域1401の画素塊は本来の色より淡色にまとめられている。
FIG. 14B illustrates the result of the color reduction process (S302) performed on FIG. 14A. The pixel block in the
続いて、図12のフローチャートに沿って、図11に示す情報に対する色情報付加処理を具体的に説明する。 Next, the color information addition processing for the information shown in FIG. 11 will be specifically described along the flowchart of FIG.
S1201で、図11(c)に示す画素塊C01が選択されたとする。S1202では図11(b)に示す未処理の文字O01が選択され、S1203で外接矩形の重なりの判定が行われる。このとき、画素塊C01の外接矩形は、文字O01の外接矩形に内包されており、重なっていると判定され、S1204に進む。ここで文字O01には色情報が未付加であるためS1206へ進み、文字C01と関連付けられ、画素塊C01の色情報“#000”が文字O01の色情報として参照可能となる。同様の処理により、画素塊C02と文字O02、画素塊C03と文字O04、画素塊C04と文字O05、画素塊C05と文字O06、画素塊C06と文字O07、画素塊C07と文字O08がそれぞれ関連付けられる。 Assume that the pixel block C01 shown in FIG. 11C is selected in S1201. In S1202, the unprocessed character O01 shown in FIG. 11B is selected, and in S1203, the determination of the circumscribed rectangle overlap is performed. At this time, the circumscribed rectangle of the pixel block C01 is included in the circumscribed rectangle of the character O01, and it is determined that the pixel rectangle C01 overlaps, and the process proceeds to S1204. Here, since color information is not added to the character O01, the process proceeds to S1206, and is associated with the character C01, and the color information “# 000” of the pixel block C01 can be referred to as the color information of the character O01. By similar processing, pixel block C02 and character O02, pixel block C03 and character O04, pixel block C04 and character O05, pixel block C05 and character O06, pixel block C06 and character O07, and pixel block C07 and character O08 are associated with each other. .
次にS1201で画素塊C08が選択され、S1202で文字O08が選択され、S1203へ進んだとする。この時、画素塊C08の外接矩形と文字O08の外接矩形が重なるため、S1204へ進む。S1204では、文字O08に既に画素塊C07が関連付けられているため、S1205へ進む。S1205では、既に関連づけられている画素塊C07と文字O08の重なっている面積の差を比較する。 Next, it is assumed that the pixel block C08 is selected in S1201, the character O08 is selected in S1202, and the process proceeds to S1203. At this time, since the circumscribed rectangle of the pixel block C08 and the circumscribed rectangle of the character O08 overlap, the process proceeds to S1204. In S1204, since the pixel block C07 is already associated with the character O08, the process proceeds to S1205. In S1205, the difference in the area where the pixel block C07 already associated and the character O08 overlap is compared.
画素塊C07は、全領域が文字O08に内包されており、重なりの面積は、図13(a)の領域1311で示す画素塊C07の面積、つまり3×3=9となる。一方、画素塊C08と文字O08においては、画素塊C08は全領域が文字O08に内包されており、図13(a)の領域1312で示す矩形面積7×13=91となる。この場合、画素塊C08の方がより文字O08に近いと判定され、S1206にて、画素塊C08と文字O08とが関連づけられる。これにより、文字O08の色情報が、画素塊C07の“#33F”から、C08の“#00F”に変更される。
The entire area of the pixel block C07 is included in the character O08, and the overlapping area is the area of the pixel block C07 indicated by the
続けてS1201へ進み、画素塊C09と文字O09が関連づけられる。全ての画素塊に対して処理が終わり、S1209へ進む。図13(b)は、この時点での文字データに対する色情報の値である。文字O03は空白文字(スペース)であるため、対応する画素塊がなく、色が付加されていない。S1209では、文字認識部204は、色情報が未付加の文字O03に対して前後の色情報を付加する。前の文字O02に色情報#000が付加されているため、文字認識部204は、O03に対しても“#000”を付加し、処理を終了する。文字認識部204の全処理を終了したあとの文字データの例を図13(c)に示す。
Subsequently, the process proceeds to S1201, and the pixel block C09 and the character O09 are associated with each other. Processing is completed for all pixel blocks, and the process advances to step S1209. FIG. 13B shows color information values for character data at this point. Since the character O03 is a blank character (space), there is no corresponding pixel block and no color is added. In step S1209, the
S1205の処理を行わない場合は、C07とC08のどちらの色がO08に付加されるかは不定であるため、本来の色ではないC07の“#33F”が付加されることがある。 When the processing of S1205 is not performed, it is uncertain which color of C07 or C08 is added to O08, and therefore C07 “# 33F” that is not the original color may be added.
(電子文書記述生成部による処理)
電子文書記述生成部205の処理を図15のフローチャートを用いて説明する。S1501では、電子文書記述生成部205は、出力電子文書210の開始部分を記述するデータを出力する。なお、本説明では、出力先はメモリ103あるいはハードディスク104に確保された出力バッファである。以降、処理でデータが出力される毎に、その内容は出力バッファ内に出力済のデータの末尾へと追加されるよう記憶されていくものとする。
(Processing by electronic document description generator)
The processing of the electronic document
S1502では、電子文書記述生成部205は、出力電子文書210において、ページの開始部分を記述するデータを出力する。なお、本実施形態に係る電子文書生成処理では、ひとつの入力画像の内容を出力電子文書210の1ページに対応させるものとする。S1503では、電子文書記述生成部205は、領域データ207内におけるルートノードを最初の処理対象となる注目ノードに設定する。
In step S <b> 1502, the electronic document
S1504では、電子文書記述生成部205は、注目ノードが出力対象領域であるかどうかを調べる。出力対象領域である場合は(S1504にてYES)、S1505に進む。出力対象領域では無い場合は(S1504にてNO)、S1506に進む。ここで注目ノードが出力対象領域か否かは、電子文書記述生成部205に設定された定義テーブルに基づいて判断される。この定義テーブルには、前背景、文字、線画、自然画、表の領域種別毎に、出力の有無および方式(データ形式)が定義される。
In step S1504, the electronic document
図16に出力対象領域の定義テーブルの一例を示す。図16では、定義1601と定義1602の2種類の定義テーブルが定められている。どちらのテーブルを用いるかは、本電子文書生成処理に予め指示されていてもよいし、入力内容によって電子文書生成処理内で自動選択するようになっていてもよい。 FIG. 16 shows an example of an output target area definition table. In FIG. 16, two types of definition tables, a definition 1601 and a definition 1602, are defined. Which table is used may be instructed in advance in the electronic document generation process, or may be automatically selected in the electronic document generation process depending on the input content.
S1505では、電子文書記述生成部205は、注目ノードに対し、領域に対応づけられているグラフィックスデータ208もしくは文字データ209を出力する。なお、領域データ207に対し、図10のS1005にて、0°以外の回転角情報が付与されている場合がある。これは、入力画像200の向きが、文字が読める正置方向と異なる場合に相当する。図10で説明したように、このとき領域に対応づけられている文字データは、正置方向に回転された二値画像から得られたものであり、正置方向の座標を有する。一方、グラフィックスデータ208は、入力画像200から得た、正置とは異なる方向の座標を有する。これらの不一致を解消する為に、グラフィックスデータ208に対しては、座標を正置方向へと回転したデータを出力するものとする。
In step S <b> 1505, the electronic document
S1506では、電子文書記述生成部205は、注目ノードの次に出力処理が行われるべきノードである、次ノードを取得する。S1507では、電子文書記述生成部205は、S1506で次ノードが取得できたか否かを判定する。次ノードが取得できた場合は(S1507にてYES)、S1508に進み、取得できなかった場合は(S1507にてNO)、S1509に進む。S1508では、電子文書記述生成部205は、S1506で取得した次ノードを新たな注目ノードとしてS1504に戻り、以降の処理を繰り返す。S1509では、電子文書記述生成部205は、領域データにさらに出力すべき領域のノードが無い、すなわち出力1ページぶんのデータ記述が終了したとして、ページの終端データを出力する。
In step S <b> 1506, the electronic document
S1510では、電子文書記述生成部205は、追加のページがあるか否かを調べる。追加のページは、電子文書生成処理が複数ページの電子文書を出力するよう動作している場合、追加の画像が入力された際に発生する。追加のページがある場合は(S1510にてYES)、電子文書記述生成部205は、S1502に戻って、以降の処理を繰り返す。追加のページが無い、すなわちこれ以上画像が入力されない場合は(S1510にてNO)、S1511へ進む。
In step S1510, the electronic document
S1511では、電子文書記述生成部205は、電子文書データにおける終端データを出力する。終端データの出力により完結した電子文書データが出力バッファ上に構成される。S1512では、電子文書記述生成部205は、出力バッファ上の電子文書データを出力電子文書210として利用者が予め指定したPC等に送信し、電子文書生成処理を終了する。
In step S1511, the electronic document
なお本説明では、電子文書データの全体を出力バッファに書き出すように処理したが、より小さい出力バッファサイズで処理できるようにしてもよい。例えば、各ページの終端データを出力した時点で同ページの内容を指定送信先に送信し、次ページの内容は再び出力バッファの先頭からデータを書き出すようにしてもよい。あるいはより小さい単位で出力バッファへの書き出しと送信、クリアを繰り返すようにしてもよい。 In this description, the entire electronic document data is processed to be written to the output buffer. However, the electronic document data may be processed with a smaller output buffer size. For example, when the end data of each page is output, the content of the same page may be transmitted to the designated transmission destination, and the content of the next page may be written again from the top of the output buffer. Alternatively, writing to the output buffer, transmission, and clearing may be repeated in smaller units.
(電子ファイルの変換例)
図17は、図13の文字認識結果を電子文書記述生成部205により電子文書データに変換した例の一部分である。本例ではXML(eXtensible Markup Language)形式の仮想のフォーマットで表現している。なお、記述形式はこれに限定するものではなく、他の形式を用いても構わない。textLine要素が1行の文字列、run要素がそのうちの同一の修飾情報を持つ文字列をまとめている。text要素に囲まれた文字列が実際に出力する文字列であり、色情報を示すcolor属性、文字サイズを示すsize属性からなる。図17(a)は、図12のS1205とS1209の処理を行わない状態を電子ファイル化した例の一部である。
(Example of electronic file conversion)
FIG. 17 is a part of an example in which the character recognition result of FIG. 13 is converted into electronic document data by the electronic document
図17(b)は、S1209の処理を施した後、つまり図13(c)を電子ファイル化した例の一部である。図13(b)の例では、1行目の“ab”と“c”の間のスペースに色情報がないため、3つのrun要素が作成される。ここで、“&nbsp;”は、スペースを表す記号である。また3行目の“i”の色情報が“#33F”になったため、3行目に2つのrun要素が作成され、3行合計6つのrun要素が作成される。 FIG. 17B is a part of an example in which the processing of S1209 is performed, that is, FIG. 13C is converted into an electronic file. In the example of FIG. 13B, since there is no color information in the space between “ab” and “c” in the first row, three run elements are created. Here, “ ” is a symbol representing a space. In addition, since the color information of “i” in the third row becomes “# 33F”, two run elements are created in the third row, and a total of six run elements in three rows are created.
一方、図13(c)では、S1209の処理によってスペースに前の文字の色情報を付加したため、1行目の“ab c”が1つのrun要素で表される。3行目“i”のS1205の処理によって色情報が“#00F”となっているため1つのrun要素で表現され、合計3つのrun要素で記述される。スペースは不可視の文字コードであるため、電子文書の表示に影響しない。 On the other hand, in FIG. 13C, the color information of the previous character is added to the space by the processing of S1209, so that “ab c” on the first line is represented by one run element. Since the color information is “# 00F” by the processing of S1205 of the third line “i”, it is expressed by one run element, and is described by a total of three run elements. Since the space is an invisible character code, it does not affect the display of the electronic document.
このように、本発明を適用することでテキストに色情報を付加した上で、スペースなどの空白を示す文字の記述を省略でき記述量の削減をすることが可能となる。 In this manner, by applying the present invention, it is possible to omit the description of characters indicating white space such as spaces after adding color information to the text, and to reduce the amount of description.
<第二実施形態>
第一実施形態では、図12のS1209において色情報を付加したが、色情報に限らず文字の修飾情報を未定義文字に付加してもよい。以下、入力文字領域の例として図18を用いた処理を説明する。ここでの色情報以外の修飾情報の例として、文字サイズ、フォント形状、文字を装飾する情報が挙げられる。
<Second embodiment>
In the first embodiment, color information is added in step S1209 of FIG. 12, but not only color information but also character modification information may be added to undefined characters. Hereinafter, processing using FIG. 18 as an example of the input character area will be described. Examples of the modification information other than the color information here include character size, font shape, and information for decorating characters.
図18(a)は、文字領域の例であり、1行の文字列“ab c”からなる。このとき、文字a、b、cの文字列は緑色で、フォント形状がゴシック体、斜体、太字といった装飾情報で描画された文字であるとする。 FIG. 18A shows an example of a character area, which is composed of one line of character string “ab c”. At this time, the character strings of the characters a, b, and c are green, and the font shape is a character drawn with decoration information such as Gothic, italic, and bold.
図18(b)は、文字認識結果に対してS1206の処理によって色情報を付加した例である。文字コード0x61、0x62、0x20、0x63の4文字が認識される。更に、文字コード0x61、0x62、0x63について、文字サイズ“14”のサイズ情報、ゴシックのフォント形状情報、斜体、太字の装飾情報、緑を表す“#0F0”の色情報を有するとする。スペースを表す“0x20”に対してはフォント形状情報、装飾情報、色情報が未定義である。 FIG. 18B is an example in which color information is added to the character recognition result by the processing of S1206. Four characters of character codes 0x61, 0x62, 0x20, and 0x63 are recognized. Further, it is assumed that the character codes 0x61, 0x62, and 0x63 have size information of the character size “14”, Gothic font shape information, italics, bold decoration information, and “# 0F0” color information representing green. For “0x20” representing a space, font shape information, decoration information, and color information are undefined.
図18(c)は、図18(b)に対してS1209の処理で前後のフォント形状情報、装飾情報、色情報を付加した例である。ここで、スペースに対して、情報が付加されていることが分かる。 FIG. 18C is an example in which font shape information, decoration information, and color information before and after are added in the processing of S1209 to FIG. 18B. Here, it can be seen that information is added to the space.
図19は、図18の認識結果の例をそれぞれ電子文書データに変換した例である。図19(a)は図18(b)の変換結果であり、図19(b)は図18(c)の変換結果である。図17で説明したXML形式のtext要素にさらに、フォント形状を表すfont属性、太字を表すb属性、斜体を表すi属性が加わっている。図19(a)が“ab”とスペースと“c”の3つのrun要素から構成されているのに対し、図19(b)では“ab c”と一つのrun要素になっている。スペースは不可視の文字コードであるため、電子文書の表示には影響しない。 FIG. 19 is an example in which the example of the recognition result of FIG. 18 is converted into electronic document data. FIG. 19A shows the conversion result of FIG. 18B, and FIG. 19B shows the conversion result of FIG. 18C. In addition to the XML format text element described in FIG. 17, a font attribute representing a font shape, a b attribute representing bold, and an i attribute representing italic are added. FIG. 19A is composed of three run elements “ab”, a space, and “c”, whereas in FIG. 19B, “ab c” is one run element. Since the space is an invisible character code, it does not affect the display of the electronic document.
このように、本実施形態を適用することで、フォント形状や装飾情報を認識した場合にもスペースなどの空白を示す文字の記述を省略し、記述量の削減を行うことが可能となる。 As described above, by applying this embodiment, it is possible to omit the description of characters indicating white space such as a space even when the font shape and decoration information are recognized, and to reduce the amount of description.
<その他の実施形態>
また、本発明は、以下の処理を実行することによっても実現される。即ち、上述した実施形態の機能を実現するソフトウェア(プログラム)を、ネットワーク又は各種記憶媒体を介してシステム或いは装置に供給し、そのシステム或いは装置のコンピュータ(またはCPUやMPU等)がプログラムを読み出して実行する処理である。
<Other embodiments>
The present invention can also be realized by executing the following processing. That is, software (program) that realizes the functions of the above-described embodiments is supplied to a system or apparatus via a network or various storage media, and a computer (or CPU, MPU, or the like) of the system or apparatus reads the program. It is a process to be executed.
また、本発明は、図2の各処理部の一部または全部を、電子回路等のハードウェアを用いて実現してもよい。 In the present invention, a part or all of each processing unit in FIG. 2 may be realized using hardware such as an electronic circuit.
Claims (6)
文字列を含む画像を前記入力画像として入力する入力手段と、
前記入力画像を構成する画素において画素値が近似する複数の画素塊を抽出する抽出手段と、
前記複数の前記画素塊が構成する領域を、文字領域、およびそれ以外の領域のうちの少なくともいずれかとして識別する識別手段と、
前記文字領域として識別された画素塊から文字を解析し、当該文字の少なくとも文字コードと位置情報とを含む文字情報を取得する解析手段と、
前記文字情報により示される文字の配置から空白文字を含む文字列を特定する特定手段と、
前記文字情報にて示される位置の文字領域の画素塊から色情報を取得し、当該文字情報に付加する色情報付加手段と、
前記特定された文字列と当該文字列に含まれる文字の文字情報とから前記電子データを定義する記述を生成する生成手段と
を備え、
前記色情報付加手段は、前記文字列に含まれる空白文字の文字情報に対し、当該文字列における当該空白文字の前後にある文字の色情報を付加することを特徴とする画像処理装置。 An image processing apparatus that generates electronic data that can be edited from an input image,
Input means for inputting an image including a character string as the input image;
Extraction means for extracting a plurality of pixel clusters whose pixel values approximate in the pixels constituting the input image;
Identification means for identifying an area formed by the plurality of pixel blocks as at least one of a character area and other areas;
Analyzing a character from the pixel block identified as the character region, and obtaining character information including at least a character code and position information of the character;
A specifying means for specifying a character string including a blank character from an arrangement of characters indicated by the character information;
Color information adding means for acquiring color information from a pixel block in a character area at a position indicated by the character information and adding the color information to the character information;
Generating means for generating a description defining the electronic data from the specified character string and character information of characters included in the character string;
The image processing apparatus, wherein the color information adding unit adds color information of characters before and after the blank character in the character string to character information of the blank character included in the character string.
前記色情報付加手段は更に、前記文字列に含まれる空白文字の文字情報に対し、当該文字列における当該空白文字の前後にある文字の修飾情報を付加することを特徴とする請求項1に記載の画像処理装置。 The analysis means further obtains at least one information of character size, font shape, bold, italic as modification information for the character of the pixel block identified as the character region,
The color information adding unit further adds modification information of characters before and after the blank character in the character string to character information of the blank character included in the character string. Image processing apparatus.
入力手段が、文字列を含む画像を前記入力画像として入力する入力工程と、
抽出手段が、前記入力画像を構成する画素において画素値が近似する複数の画素塊を抽出する抽出工程と、
識別手段が、前記複数の前記画素塊が構成する領域を、文字領域、およびそれ以外の領域のうちの少なくともいずれかとして識別する識別工程と、
解析手段が、前記文字領域として識別された画素塊から文字を解析し、当該文字の少なくとも文字コードと位置情報とを含む文字情報を取得する解析工程と、
特定手段が、前記文字情報により示される文字の配置から空白文字を含む文字列を特定する特定工程と、
色情報付加手段が、前記文字情報にて示される位置の文字領域の画素塊から色情報を取得し、当該文字情報に付加する色情報付加工程と、
生成手段が、前記特定された文字列と当該文字列に含まれる文字の文字情報とから前記電子データを定義する記述を生成する生成工程と
を有し、
前記色情報付加工程において、前記文字列に含まれる空白文字の文字情報に対し、当該文字列における当該空白文字の前後にある文字の色情報を付加することを特徴とする画像処理方法。 An image processing method for generating electronic data that can be edited from an input image,
An input step in which an input means inputs an image including a character string as the input image;
An extracting step in which the extracting means extracts a plurality of pixel blocks whose pixel values approximate in the pixels constituting the input image;
An identification step for identifying an area formed by the plurality of pixel blocks as at least one of a character area and other areas;
An analyzing step of analyzing a character from the pixel block identified as the character region and obtaining character information including at least a character code and position information of the character;
A specifying step of specifying a character string including a blank character from an arrangement of characters indicated by the character information;
A color information adding step for acquiring color information from a pixel block in a character area at a position indicated by the character information and adding the color information to the character information;
A generation step of generating a description defining the electronic data from the identified character string and character information of characters included in the character string;
In the color information adding step, color information on characters before and after the blank character in the character string is added to the character information of the blank character included in the character string.
文字列を含む画像を入力画像として入力する入力手段、
前記入力画像を構成する画素において画素値が近似する複数の画素塊を抽出する抽出手段、
前記複数の前記画素塊が構成する領域を、文字領域、およびそれ以外の領域のうちの少なくともいずれかとして識別する識別手段、
前記文字領域として識別された画素塊から文字を解析し、当該文字の少なくとも文字コードと位置情報とを含む文字情報を取得する解析手段、
前記文字情報により示される文字の配置から空白文字を含む文字列を特定する特定手段、
前記文字情報にて示される位置の文字領域の画素塊から色情報を取得し、当該文字情報に付加する色情報付加手段、
前記特定された文字列と当該文字列に含まれる文字の文字情報とから電子データを定義する記述を生成する生成手段
として機能させ、
前記色情報付加手段は、前記文字列に含まれる空白文字の文字情報に対し、当該文字列における当該空白文字の前後にある文字の色情報を付加することを特徴とするプログラム。 Computer
Input means for inputting an image including a character string as an input image;
Extraction means for extracting a plurality of pixel clusters whose pixel values approximate in the pixels constituting the input image;
An identification means for identifying an area formed by the plurality of pixel blocks as at least one of a character area and other areas;
Analyzing means for analyzing a character from the pixel block identified as the character region and obtaining character information including at least a character code and position information of the character;
A specifying means for specifying a character string including a blank character from an arrangement of characters indicated by the character information;
Color information adding means for acquiring color information from a pixel block in a character area at a position indicated by the character information and adding the color information to the character information;
Function as generation means for generating a description defining electronic data from the specified character string and character information of characters included in the character string;
The color information adding means adds color information of characters before and after the blank character in the character string to character information of the blank character included in the character string.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2011219564A JP5767549B2 (en) | 2011-10-03 | 2011-10-03 | Image processing apparatus, image processing method, and program |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2011219564A JP5767549B2 (en) | 2011-10-03 | 2011-10-03 | Image processing apparatus, image processing method, and program |
Publications (3)
Publication Number | Publication Date |
---|---|
JP2013080349A true JP2013080349A (en) | 2013-05-02 |
JP2013080349A5 JP2013080349A5 (en) | 2014-10-09 |
JP5767549B2 JP5767549B2 (en) | 2015-08-19 |
Family
ID=48526674
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP2011219564A Active JP5767549B2 (en) | 2011-10-03 | 2011-10-03 | Image processing apparatus, image processing method, and program |
Country Status (1)
Country | Link |
---|---|
JP (1) | JP5767549B2 (en) |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2015103114A (en) * | 2013-11-26 | 2015-06-04 | コニカミノルタ株式会社 | Text data embedding device, image processing device having the same, text data embedding method and embedding program |
JP2020511726A (en) * | 2017-03-22 | 2020-04-16 | ドリリング・インフォ・インコーポレイテッド | Data extraction from electronic documents |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JPH05108875A (en) * | 1991-10-21 | 1993-04-30 | Matsushita Electric Ind Co Ltd | Character recognition device |
JPH09223240A (en) * | 1996-02-14 | 1997-08-26 | Oki Electric Ind Co Ltd | Document electronizing device |
JP2009205232A (en) * | 2008-02-26 | 2009-09-10 | Fuji Xerox Co Ltd | Image processor and image processing program |
JP2011040075A (en) * | 2010-08-31 | 2011-02-24 | Canon Inc | Image processing device, image processing method and computer program |
-
2011
- 2011-10-03 JP JP2011219564A patent/JP5767549B2/en active Active
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JPH05108875A (en) * | 1991-10-21 | 1993-04-30 | Matsushita Electric Ind Co Ltd | Character recognition device |
JPH09223240A (en) * | 1996-02-14 | 1997-08-26 | Oki Electric Ind Co Ltd | Document electronizing device |
JP2009205232A (en) * | 2008-02-26 | 2009-09-10 | Fuji Xerox Co Ltd | Image processor and image processing program |
JP2011040075A (en) * | 2010-08-31 | 2011-02-24 | Canon Inc | Image processing device, image processing method and computer program |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2015103114A (en) * | 2013-11-26 | 2015-06-04 | コニカミノルタ株式会社 | Text data embedding device, image processing device having the same, text data embedding method and embedding program |
JP2020511726A (en) * | 2017-03-22 | 2020-04-16 | ドリリング・インフォ・インコーポレイテッド | Data extraction from electronic documents |
Also Published As
Publication number | Publication date |
---|---|
JP5767549B2 (en) | 2015-08-19 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
KR101334483B1 (en) | Apparatus and method for digitizing a document, and computer-readable recording medium | |
JP4646797B2 (en) | Image processing apparatus, control method therefor, and program | |
US7936929B2 (en) | Image processing method and apparatus for removing noise from a document image | |
JP4366011B2 (en) | Document processing apparatus and method | |
JP5361574B2 (en) | Image processing apparatus, image processing method, and program | |
JP4443576B2 (en) | Pattern separation / extraction program, pattern separation / extraction apparatus, and pattern separation / extraction method | |
JP2006023945A (en) | Image processing system and image processing method | |
US20070133031A1 (en) | Image processing apparatus and image processing method | |
JP2008109394A (en) | Image processor, its method, and program | |
US6532302B2 (en) | Multiple size reductions for image segmentation | |
JP2010009509A (en) | Image processor, image processing method, program thereof, and storage medium | |
CN102375981A (en) | Image processing apparatus | |
US8310692B2 (en) | Image processing apparatus, image processing method, computer-readable medium and computer data signal | |
JP5950700B2 (en) | Image processing apparatus, image processing method, and program | |
JP2009271679A (en) | Image processor, image processing method, and image processing program | |
JP5335581B2 (en) | Image processing apparatus, image processing method, and program | |
JP5767549B2 (en) | Image processing apparatus, image processing method, and program | |
JP5020698B2 (en) | Image processing apparatus, image processing method, and image processing program | |
JP5159588B2 (en) | Image processing apparatus, image processing method, and computer program | |
JP5824309B2 (en) | Image processing apparatus, image processing method, and program | |
JP2003046746A (en) | Method and apparatus for processing image | |
JP2008042346A (en) | Image processing method and image processor | |
JP4587167B2 (en) | Image processing apparatus and image processing method | |
JP2006054817A (en) | Document processor | |
JP4574347B2 (en) | Image processing apparatus, method, and program |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
A521 | Request for written amendment filed |
Free format text: JAPANESE INTERMEDIATE CODE: A523 Effective date: 20140826 |
|
A621 | Written request for application examination |
Free format text: JAPANESE INTERMEDIATE CODE: A621 Effective date: 20140826 |
|
A977 | Report on retrieval |
Free format text: JAPANESE INTERMEDIATE CODE: A971007 Effective date: 20150519 |
|
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: 20150522 |
|
A61 | First payment of annual fees (during grant procedure) |
Free format text: JAPANESE INTERMEDIATE CODE: A61 Effective date: 20150619 |
|
R151 | Written notification of patent or utility model registration |
Ref document number: 5767549 Country of ref document: JP Free format text: JAPANESE INTERMEDIATE CODE: R151 |