JP2007019673A - Image processing apparatus, image compression method, image compression program, and data structure of compressed image - Google Patents
Image processing apparatus, image compression method, image compression program, and data structure of compressed image Download PDFInfo
- Publication number
- JP2007019673A JP2007019673A JP2005196908A JP2005196908A JP2007019673A JP 2007019673 A JP2007019673 A JP 2007019673A JP 2005196908 A JP2005196908 A JP 2005196908A JP 2005196908 A JP2005196908 A JP 2005196908A JP 2007019673 A JP2007019673 A JP 2007019673A
- Authority
- JP
- Japan
- Prior art keywords
- data
- ruled line
- image data
- image
- compressed
- 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.)
- Pending
Links
- 230000006835 compression Effects 0.000 title claims abstract description 84
- 238000007906 compression Methods 0.000 title claims abstract description 67
- 238000012545 processing Methods 0.000 title claims description 59
- 238000000034 method Methods 0.000 title claims description 33
- 238000000605 extraction Methods 0.000 claims description 14
- 238000006243 chemical reaction Methods 0.000 claims description 13
- 239000000284 extract Substances 0.000 claims description 8
- 238000004519 manufacturing process Methods 0.000 claims 1
- 230000002427 irreversible effect Effects 0.000 abstract description 6
- 230000002441 reversible effect Effects 0.000 abstract description 5
- 239000002131 composite material Substances 0.000 abstract 2
- 238000010586 diagram Methods 0.000 description 15
- 230000006870 function Effects 0.000 description 11
- 239000003086 colorant Substances 0.000 description 10
- 238000001514 detection method Methods 0.000 description 9
- 238000004891 communication Methods 0.000 description 5
- 230000012447 hatching Effects 0.000 description 4
- 238000007781 pre-processing Methods 0.000 description 4
- 238000000926 separation method Methods 0.000 description 4
- 230000003287 optical effect Effects 0.000 description 3
- 230000005540 biological transmission Effects 0.000 description 2
- 238000005401 electroluminescence Methods 0.000 description 2
- 238000002372 labelling Methods 0.000 description 2
- 239000004065 semiconductor Substances 0.000 description 2
- 206010044565 Tremor Diseases 0.000 description 1
- 238000012937 correction Methods 0.000 description 1
- 230000007423 decrease Effects 0.000 description 1
- 238000001914 filtration Methods 0.000 description 1
- 238000009499 grossing Methods 0.000 description 1
- 239000004973 liquid crystal related substance Substances 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 230000002093 peripheral effect Effects 0.000 description 1
Images
Landscapes
- Image Processing (AREA)
- Editing Of Facsimile Originals (AREA)
- Facsimile Image Signal Circuits (AREA)
- Color Image Communication Systems (AREA)
- Compression Of Band Width Or Redundancy In Fax (AREA)
- Compression, Expansion, Code Conversion, And Decoders (AREA)
Abstract
Description
この発明は、画像処理装置、画像圧縮方法、画像圧縮プログラムおよび圧縮画像のデータ構造に関し、画像データを圧縮する画像処理装置、画像圧縮方法、画像圧縮プログラムおよび圧縮した画像のデータ構造に関する。 The present invention relates to an image processing apparatus, an image compression method, an image compression program, and a compressed image data structure, and more particularly to an image processing apparatus, an image compression method, an image compression program, and a compressed image data structure.
近年、情報の電子化が進み、文書を紙ではなく電子化して保存あるいは送信する需要が高まっている。さらに、電子化データを送信する場合には、通信の効率化のためにデータを圧縮して送信するのが一般的である。文書を電子化する際にスキャナで原稿を読み取って画像データが得られる。この画像データ全体に対して非可逆的な方式で圧縮すると、圧縮後のデータ量を小さくすれば文字が読めなくなり、文字を読める程度で圧縮すると圧縮後のデータ量が大きくなってしまう。このため、画像データを文字領域と背景領域とで異なる圧縮方式で圧縮する技術が知られている(たとえば、特許文献1)。この場合、文字領域は2値化した後に可逆的な方式で圧縮され、背景領域は非可逆的な方式で圧縮される。この技術によれば、圧縮率を高めても文字を判読できるように圧縮することができる。 In recent years, with the progress of computerization of information, there is an increasing demand for storing or transmitting documents in electronic form instead of paper. Further, when transmitting digitized data, it is common to compress the data for transmission efficiency and transmit it. When digitizing a document, an original is read by a scanner, and image data is obtained. If the entire image data is compressed in an irreversible manner, characters cannot be read if the amount of data after compression is reduced, and if the amount is compressed so that the characters can be read, the amount of data after compression increases. For this reason, a technique for compressing image data using different compression methods for a character area and a background area is known (for example, Patent Document 1). In this case, the character area is binarized and then compressed in a reversible manner, and the background area is compressed in an irreversible manner. According to this technique, characters can be compressed so that they can be read even if the compression rate is increased.
一方、原稿に罫線が表されている場合には、罫線は輪郭が鮮明であることが望ましいため、画像データに含まれる罫線を文字と同様に2値化するのが好ましい。しかしながら、原稿をスキャナで読み取るときに原稿が傾かないように原稿をセットするのは困難であるため、原稿が傾いた状態で読み取られることが多い。このため、傾いて読み取られた罫線部分を2値化すると罫線のガタツキが強調されてしまう。罫線を背景と同様に非可逆圧縮すると、ガタツキは解消されるが罫線の輪郭がぼけてしまう。
この発明は上述した問題点を解決するためになされたもので、この発明の目的の一つは、画像データを圧縮しても罫線のガタツキを目立たなくすることが可能な画像処理装置、画像圧縮方法および画像圧縮プログラムを提供することである。 The present invention has been made to solve the above-described problems, and one of the objects of the present invention is to provide an image processing apparatus and an image compression device that can make the ruled lines less noticeable even when image data is compressed. A method and an image compression program are provided.
この発明の他の目的は、復元された罫線のガタツキが目立たないように、画像データを圧縮したデータを記憶可能な圧縮画像のデータ構造を提供することである。 Another object of the present invention is to provide a data structure of a compressed image capable of storing data obtained by compressing image data so that the restored ruled line is not noticeable.
上述した目的を達成するためにこの発明のある局面によれば、画像処理装置は、画像データを入力する入力手段と、入力された画像データから罫線を含む罫線領域を抽出する罫線領域抽出手段と、罫線領域の画像データから罫線の中心画素を少なくとも含む罫線データを生成する第1生成手段と、罫線領域の画像データから罫線データを補間するための補間データを生成する第2生成手段と、罫線データおよび補間データそれぞれを圧縮して第1および第2圧縮データを生成する第1圧縮手段と、画像データから罫線領域を除いた領域を圧縮して第3圧縮データを生成する第2圧縮手段と、第1圧縮データと、第2圧縮データと、第3圧縮データとを結合して結合データを生成する結合手段と、を備える。 In order to achieve the above object, according to one aspect of the present invention, an image processing apparatus includes an input unit that inputs image data, and a ruled line region extraction unit that extracts a ruled line region including a ruled line from the input image data. First generation means for generating ruled line data including at least the center pixel of the ruled line from the image data of the ruled line area, second generation means for generating interpolation data for interpolating the ruled line data from the image data of the ruled line area, and the ruled line First compression means for compressing data and interpolation data to generate first and second compressed data, and second compression means for compressing an area excluding the ruled line area from image data to generate third compressed data And combining means for combining the first compressed data, the second compressed data, and the third compressed data to generate combined data.
罫線は、直線、曲線、アンダーライン、枠、表、大きな文字の直線部分、斜線、破線を含む。この発明に従えば、罫線の中心画素を少なくとも含む罫線データが、補間データにより補間される。罫線データは、罫線の中心画素を含むので、データ量を削減することができるが、ガタツキが発生する確率が高い。このガタツキが補間データにより補間される。罫線領域の画像データをそのまま圧縮することなく、罫線の中心画素を含む罫線データと、それを補間するための補間データとに分けて圧縮するので、画像データを圧縮しても罫線のガタツキを目立たなくすることが可能な画像処理装置を提供することができる。 The ruled line includes a straight line, a curve, an underline, a frame, a table, a straight line portion of a large character, a diagonal line, and a broken line. According to the present invention, ruled line data including at least the center pixel of the ruled line is interpolated by the interpolation data. Since the ruled line data includes the center pixel of the ruled line, the amount of data can be reduced, but the probability of occurrence of rattling is high. This backlash is interpolated by the interpolation data. The image data in the ruled line area is compressed as it is without dividing the ruled line data including the center pixel of the ruled line and the interpolation data for interpolating it. An image processing apparatus that can be eliminated can be provided.
好ましくは、第1生成手段は、罫線領域の画像データに含まれる罫線を構成する画素のうちから明度が第1のしきい値以下の画素を抽出する第1抽出手段を含み、第2生成手段は、罫線領域の画像データに含まれる罫線を構成する画素のうちから明度が第1のしきい値を超える画素を抽出する第2抽出手段を含む、請求項1に記載の画像処理装置。
Preferably, the first generation means includes first extraction means for extracting a pixel whose brightness is not more than a first threshold value from pixels constituting the ruled line included in the image data of the ruled line region, and the second generation means The image processing apparatus according to
この発明に従えば、明度が第1しきい値以下の画素が罫線の中心画素として抽出され、明度が第1のしきい値を超える画素が罫線の中心画素を補間する画素として抽出される。このため、補間データは、罫線の中心画素の近傍の画素を含むことになり、罫線の中心画素をその近傍の画素で補間することができる。 According to this invention, a pixel whose brightness is equal to or less than the first threshold is extracted as the center pixel of the ruled line, and a pixel whose brightness exceeds the first threshold is extracted as a pixel for interpolating the center pixel of the ruled line. For this reason, the interpolation data includes pixels in the vicinity of the center pixel of the ruled line, and the center pixel of the ruled line can be interpolated with the pixels in the vicinity thereof.
好ましくは、第1抽出手段は、罫線領域の画像データを第1のしきい値で2値化して罫線データを生成する第1の2値化手段を含む。 Preferably, the first extraction means includes first binarization means for binarizing the image data of the ruled line area with a first threshold value to generate ruled line data.
この発明によれば、2値化するので罫線データのデータ量を削減することができる。 According to this invention, since it binarizes, the data amount of ruled line data can be reduced.
好ましくは、罫線データと画像データとから罫線データに含まれる罫線の第1罫線色を決定する第1罫線色決定手段をさらに備え、結合手段は、第1圧縮データと第1罫線色とを関連付ける罫線色関連付手段を含む。 Preferably, the apparatus further includes first ruled line color determining means for determining a first ruled line color of the ruled line included in the ruled line data from the ruled line data and the image data, and the combining unit associates the first compressed data with the first ruled line color. Includes ruled line color association means.
この発明に従えば、罫線データと画像データとから決定される第1罫線色と、第1圧縮データとが関連付けられるので、罫線の中心画素を第1罫線色で復元することができる。 According to the present invention, since the first ruled line color determined from the ruled line data and the image data is associated with the first compressed data, the center pixel of the ruled line can be restored with the first ruled line color.
好ましくは、第2抽出手段は、罫線領域の画像データを第1のしきい値と第2のしきい値との内外で2値化して前記補間データを生成する第2の2値化手段を含む。 Preferably, the second extraction means includes second binarization means for binarizing the image data of the ruled line area inside and outside the first threshold value and the second threshold value to generate the interpolation data. Including.
この発明によれば、2値化するので補間データのデータ量を削減することができる。 According to the present invention, since binarization is performed, the amount of interpolation data can be reduced.
好ましくは、罫線データと画像データとから罫線データに含まれる罫線の第1罫線色を決定する第1罫線色決定手段と、補間データと画像データとから補間データに含まれる第2罫線色を決定する第2罫線色決定手段とをさらに備え、結合手段は、第1圧縮データと第1罫線色とを関連付け、第2圧縮データを第2罫線色と関連付ける罫線色関連付手段を含む。 Preferably, a first ruled line color determining means for determining a first ruled line color of the ruled line included in the ruled line data from the ruled line data and the image data, and a second ruled line color included in the interpolation data from the interpolation data and the image data. And a second ruled line color determining unit that associates the first compressed data with the first ruled line color and includes a ruled line color associating unit that associates the second compressed data with the second ruled line color.
この発明に従えば、罫線データと画像データとから決定された第1罫線色と、第1圧縮データとが関連付けられ、補間データと画像データとから決定された第2罫線色と第2圧縮データとが関連付けられるので、罫線の中心画素を第1罫線色で復元し、罫線の中心画素を補間する画素を第2罫線色で復元することができる。 According to this invention, the first ruled line color determined from the ruled line data and the image data is associated with the first compressed data, and the second ruled line color and the second compressed data determined from the interpolation data and the image data. Are associated with each other, the center pixel of the ruled line can be restored with the first ruled line color, and the pixel that interpolates the center pixel of the ruled line can be restored with the second ruled line color.
好ましくは、第1生成手段は、罫線領域の画像データを2値化する2値化手段と、2値化されたデータを解像度の低い罫線データに変換する解像度変換手段とを含み、第2生成手段は、罫線領域の画像データを2値化する2値化手段と、2値化されたデータから前記罫線データに含まれる罫線成分を除去して補間データを生成する差分抽出手段とを含む。 Preferably, the first generation means includes binarization means for binarizing the image data of the ruled line area, and resolution conversion means for converting the binarized data into ruled line data having a low resolution, and the second generation The means includes binarization means for binarizing the image data of the ruled line area, and difference extraction means for generating interpolation data by removing ruled line components included in the ruled line data from the binarized data.
この発明に従えば、罫線領域の画像データを2値化したデータを低解像度に変換して罫線データが生成され、罫線領域の画像データを2値化したデータから罫線データに含まれる罫線成分を除去して補間データが生成される。罫線データは解像度が小さくなるのでデータ量が削減されるが、罫線のガタツキが目立つようになる。補間データは、2値化したデータから罫線データに含まれる罫線成分が除去されるのでデータ量が削減される。罫線データと補間データとで、罫線領域の画像データの罫線の形状を復元することができる。その結果、画像データを圧縮しても罫線のガタツキを目立たなくすることが可能な画像処理装置を提供することができる。 According to the present invention, ruled line data is generated by converting the binarized data of the ruled line area image data to a low resolution, and the ruled line component included in the ruled line data is converted from the binarized image data of the ruled line area. The interpolation data is generated by removing. Since the resolution of the ruled line data is reduced, the amount of data is reduced. However, the ruled line becomes unstable. Since the ruled line component included in the ruled line data is removed from the binarized data, the interpolation data reduces the data amount. The ruled line shape of the image data in the ruled line area can be restored by the ruled line data and the interpolation data. As a result, it is possible to provide an image processing apparatus that can make the ruled lines less noticeable even when the image data is compressed.
好ましくは、罫線領域の画像データから色相および彩度の組が近似する罫線を集めて罫線領域の画像データを色相および彩度の組別に分割して複数の分割データを生成する分割手段をさらに備え、第1および第2生成手段それぞれは、複数の分割データが入力され、色相および彩度の組ごとに罫線データおよび補間データを抽出する。 Preferably, the image processing apparatus further includes a dividing unit that collects ruled lines whose hue and saturation sets are approximated from the image data of the ruled line area, and divides the image data of the ruled line area into sets of hue and saturation to generate a plurality of divided data. Each of the first and second generation means receives a plurality of divided data, and extracts ruled line data and interpolation data for each set of hue and saturation.
この発明に従えば、カラーの画像データを圧縮率する場合であっても、罫線のガタツキを目立たなくすることができる。 According to the present invention, even when color image data is compressed, it is possible to make the ruled lines less noticeable.
この発明の他の局面によれば、画像圧縮方法は、画像データを入力するステップと、入力された画像データから罫線を含む罫線領域を抽出するステップと、罫線領域の画像データから罫線の中心画素を少なくとも含む罫線データを生成するステップと、罫線領域の画像データから罫線データを補間するための補間データを生成するステップと、罫線データおよび補間データそれぞれを圧縮して第1および第2圧縮データを生成するステップと、画像データから罫線領域を除いた領域を圧縮して第3圧縮データを生成するステップと、第1圧縮データと、第2圧縮データと、第3圧縮データとを結合して結合データを生成するステップとを含む。 According to another aspect of the present invention, an image compression method includes a step of inputting image data, a step of extracting a ruled line region including a ruled line from the input image data, and a center pixel of the ruled line from the image data of the ruled line region Generating ruled line data including at least a ruled line data, a step of generating interpolation data for interpolating the ruled line data from the image data of the ruled line region, and compressing the ruled line data and the interpolated data, respectively. A step of generating, a step of compressing a region excluding the ruled line region from the image data to generate third compressed data, a first compressed data, a second compressed data, and a third compressed data being combined and combined Generating data.
この発明に従えば、画像データを圧縮しても罫線のガタツキを目立たなくすることが可能な画像圧縮方法を提供することができる。 According to the present invention, it is possible to provide an image compression method capable of making ruled lines less noticeable even when image data is compressed.
この発明のさらに他の局面によれば、画像圧縮プログラムは、画像データを入力するステップと、入力された画像データから罫線を含む罫線領域を抽出するステップと、罫線領域の画像データから罫線の中心画素を少なくとも含む罫線データを生成するステップと、罫線領域の画像データから罫線データを補間するための補間データを生成するステップと、罫線データおよび補間データそれぞれを圧縮して第1および第2圧縮データを生成するステップと、画像データから罫線領域を除いた領域を圧縮して第3圧縮データを生成するステップと、第1圧縮データと、第2圧縮データと、第3圧縮データとを結合して結合データを生成するステップとを含む。 According to still another aspect of the present invention, an image compression program includes a step of inputting image data, a step of extracting a ruled line area including a ruled line from the input image data, and the center of the ruled line from the image data of the ruled line area. A step of generating ruled line data including at least pixels; a step of generating interpolation data for interpolating ruled line data from image data of a ruled line region; and the first and second compressed data by compressing the ruled line data and the interpolation data, respectively Generating a third compressed data by compressing a region excluding the ruled line region from the image data, combining the first compressed data, the second compressed data, and the third compressed data, Generating combined data.
この発明に従えば、画像データを圧縮しても罫線のガタツキを目立たなくすることが可能な画像圧縮プログラムを提供することができる。 According to the present invention, it is possible to provide an image compression program capable of making the ruled lines less noticeable even when image data is compressed.
この発明のさらに他の局面によれば、圧縮画像のデータ構造は、画像データに含まれる罫線領域から罫線の中心画素を抽出し、該中心画素を少なくとも含む罫線データを圧縮した第1の圧縮データと、画像データに含まれる罫線領域から罫線データを補間するための補間データを生成し、該補間データを圧縮した第2の圧縮データと、画像データから罫線領域を除いた領域を圧縮した第3圧縮データとを含む。 According to still another aspect of the present invention, the data structure of the compressed image is a first compressed data obtained by extracting a center pixel of a ruled line from a ruled line area included in the image data and compressing ruled line data including at least the center pixel. Interpolated data for interpolating ruled line data from the ruled line area included in the image data, second compressed data obtained by compressing the interpolated data, and third compressed data obtained by excluding the ruled line area from the image data. Compressed data.
この発明に従えば、復元された罫線のガタツキが目立たないように、画像データを圧縮したデータを記憶可能な圧縮画像のデータ構造を提供することができる。 According to the present invention, it is possible to provide a data structure of a compressed image that can store data obtained by compressing image data so that the restored ruled line is not noticeable.
以下、本発明の実施の形態について図面を参照して説明する。以下の説明では同一の部品には同一の符号を付してある。それらの名称および機能も同じである。したがってそれらについての詳細な説明は繰返さない。 Hereinafter, embodiments of the present invention will be described with reference to the drawings. In the following description, the same parts are denoted by the same reference numerals. Their names and functions are also the same. Therefore, detailed description thereof will not be repeated.
<第1の実施の形態>
図1は、本発明の第1の実施の形態におけるMFPのハード構成を示すブロック図である。図1を参照して、MFP(Multi Function Peripheral)100は、スキャナ部103と、用紙などの記録媒体に画像を形成する画像形成部106と、それぞれがバス111に接続されたCPU(Central Processing Unit)101と、記憶部102と、スキャナ部103が出力する画像データを処理する入力画像処理部104と、画像データに出力するのに適した処理を行う出力画像処理部105と、ネットワークインターフェイス(I/F)107と、モデム108と、操作パネル109と、カードI/F110とを含む。
<First Embodiment>
FIG. 1 is a block diagram showing a hardware configuration of the MFP according to the first embodiment of the present invention. Referring to FIG. 1, an MFP (Multi Function Peripheral) 100 includes a
CPU101は、MFP100の全体を制御する。記憶部102は、ROM(Read Only Memory)、RAM(Random Access Memory)およびEEPROM(Electrically Erasable/Programable ROM)などの半導体メモリおよびハードディスクドライブ(HDD)等の磁気記憶装置を含む。CPU101は、ROMに記録された画像圧縮プログラムをRAMにロードして実行する。
スキャナ部103は、原稿台とCCD(Charge Coupled Device)等の光電変換素子とを含み、原稿台に載置された原稿を光学的に読取って電子データとしての画像データを入力画像処理部104に出力する。入力画像処理部104は、入力された画像データに対して、色変換処理、色補正処理などを実行して、処理した画像データを記憶部102に記憶する。
The
出力画像処理部105は、記憶部102から画像データを読み出して、スクリーン制御処理、スムージング処理、パルス幅変調(PWM)を行い、処理後の画像データを画像形成部106に出力する。画像形成部106は、レーザプリンタであり、出力画像処理部105から入力される画像データを紙などの記録媒体に可視化する。画像形成部106は、カラープリントの場合には、イエロー、マゼンタ、シアン、ブラックの4色のトナーで画像を形成する。画像形成部106は、インクジェットプリンタであってもよい。
The output
カードI/F110には、ICカード110Aが装着される。CPU101は、カードI/F110を介してICカード110Aにアクセスが可能である。ネットワークI/F107は、MFP100をネットワーク112と接続する。ネットワークI/F107は、データを所定の通信プロトコルに従ってネットワークに出力し、ネットワーク112から所定の通信プロトコルに従ってデータを受信する。CPU101は、ネットワークI/F107を介してネットワーク112に接続された他のコンピュータと通信することが可能となる。このため、たとえば、電子メールを用いて画像データの送受信が可能である。
An
モデム108は、MFP100を電話回線113と接続する。モデム108は、データをファクシミリの通信プロトコルに従ってファクシミリ通信を可能とする。モデム108は、ファクシミリ受信されたデータを記憶部102のHDDに記憶する。また、モデム108は、電話回線113に接続されたコンピュータとの通信を可能とするためNCU(Network Control Unit)を含む。モデム108により他のコンピュータから受信されたデータは、記憶部102のHDDに記憶される。
操作パネル109は、入力部109Aと表示部109Bとを含む。入力部109Aは、MFP100のユーザによる操作の入力を受付けるためのタッチパネル、キーボードまたはマウス等の入力装置である。表示部109Bは、液晶表示装置または有機EL(Electro−Luminescence)ディスプレイパネルである。入力部109Aに透明な部材からなるタッチパネルを用いる場合には、表示部109B上にタッチパネルを重ねて設置することで、表示部109Bに表示されたボタンの指示を検出することができる。これにより、種々の操作の入力が可能となる。
なお、CPU101で実行する画像圧縮プログラムは、ROMに記憶されたものに限られず、EEPROMに記憶するようにしてもよい。EEPROMに記憶するようにすれば、画像圧縮プログラムを書き換えるまたは追加して書き込みすることが可能となる。このため、ネットワーク112に接続された他のコンピュータが、MPP100のEEPROMに記憶された画像圧縮プログラムを書換える、または、新たな画像圧縮プログラムを追加して書き込むことができる。さらに、MFP100が、ネットワーク112に接続された他のコンピュータから画像圧縮プログラムをダウンロードして、その画像圧縮プログラムをEEPROMに記憶することができる。さらに、画像圧縮プログラムをICカード110Aに記憶するようにし、カードI/F110に装着されたICカード110Aに記録された画像圧縮プログラムをRAMにロードして実行するようにしてもよい。
Note that the image compression program executed by the
なお、画像圧縮プログラムを記憶する記録媒体としては、ICカード110Aに限られず、フレキシブルディスク、カセットテープ、光ディスク(CD−ROM(Compact Disc−ROM)/MO(Magnetic Optical Disc/MD(Mini Disc)/DVD(Digital Versatile Disc))、光カード、マスクROM、EPROM、EEPROMなどの半導体メモリ等の固定的にプログラムを担持する媒体でもよい。
The recording medium for storing the image compression program is not limited to the
ここでいうプログラムは、CPU101により直接実行可能なプログラムだけでなく、ソースプログラム形式のプログラム、圧縮処理されたプログラム、暗号化されたプログラム等を含む。
The program here includes not only a program directly executable by the
図2は、第1の実施の形態におけるMFPの機能の概略を示す機能ブロック図である。図2を参照して、CPU101には、スキャナ部103で読み取られて出力される画像データ(イメージデータ)が入力画像処理部104で処理されて入力される。CPU101は、前処理部10と、前処理部10により処理された画像データが入力される領域判別部11と、領域判別部11が出力する文字領域の画像データが入力される文字2値化部12と、文字2値化部12に接続された可逆圧縮部13と、領域判別部11が出力する罫線領域の画像データが入力される罫線2値化部14と、罫線2値化部14に接続された可逆圧縮部15と、領域判別部11が出力する背景領域の画像データが入力される低解像度化部16と、低解像度化部16に接続された非可逆圧縮部17と、可逆圧縮部13,15および非可逆圧縮部17に接続された結合部18とを含む。
FIG. 2 is a functional block diagram showing an outline of the functions of the MFP according to the first embodiment. Referring to FIG. 2, image data (image data) read and output by the
なお、CPU101に入力される画像データは、スキャナ部103が出力する画像データに限られず、他のコンピュータから受信される画像データであてもよい。この場合、画像データは、ネットワーク112または電話回線113を介して、または、ICカード110Aを介して入力される。
The image data input to the
前処理部10は、入力される画像データに対して、画像形式の変換処理、解像度変換処理、下地除去処理を実行する。これらの処理は、画像データを領域判別部11で処理するのに適したデータとするための処理であり、これらの処理に限らず、これらの処理を実行しなくてもよいし、他の処理を実行するようにしてもよい。スキャナ部103の性能や、入力される画像データに応じて適宜組み合わせればよい。
The preprocessing
領域判別部11は、前処理された画像データが入力される。ここで入力される画像データは、1画素が24ビットの3つのRGBプレーンを有するフルカラーの画像データである。領域判別部11は、フルカラーの画像データを1画素が8ビットの明度プレーンを有する画像データに変換する。以下単に画像データというときは明度プレーンを有する画像データを示し、RGBプレーンを有するフルカラーの画像データを「RGB画像データ」という。
The
領域判別部11は、画像データから図、写真、下地の各領域を抽出する。図、写真および下地の領域は、背景領域として低解像度化部16に出力される。また、画像データからエッジ画像を生成し、エッジ画像から罫線を含む罫線領域を抽出する。罫線は、直線、曲線、アンダーライン、枠、表、大きな文字の直線部分、斜線、破線を含む。罫線領域は罫線2値化部14に出力される。そして、エッジ画像から罫線領域を除いたものから文字ブロックを検出する。さらに検出された文字ブロックのRGB画像データの画素値から文字の色を算出する。複数の文字ブロックのブロック間の距離と算出した文字色の差から近傍で似た色の文字ブロックを統合して文字領域とする。文字ブロックの数を減らすことで、データ量を削減することができるからである。そして文字領域を文字2値化部12に出力する。
The
文字2値化部12は、文字領域と画像データとが入力される。文字2値化部12は、画像データの文字領域を2値化する。そして、文字領域で文字とされた画素のRGB画像データにおける画素値から文字領域の色を決定する。RGB画像データの文字とされた画素のRGB各色の平均値または中央値をその文字領域の色に決定する。文字2値化部12は、文字領域の2値化データを可逆圧縮部13に出力し、その文字領域の色を結合部18に出力する。可逆圧縮部13は、文字2値化部12から入力される2値化データを可逆圧縮する。ここでは、可逆圧縮方式としてMMR(Modified
Modified Read)符号化を用いている。可逆圧縮部13は、2値化データを可逆圧縮して得られる第3圧縮データを結合部18に出力する。
The
Modified Read) encoding is used. The
罫線2値化部14には、罫線領域と画像データとRGB画像データとが入力される。罫線2値化部14は、入力される複数の罫線領域の色相および彩度をRGB画像データから求め、色相および彩度が近似する罫線領域を集めて統合した分割データを生成する。これにより、色相および彩度の組の数の分割データが生成される。罫線2値化部14は、複数の分割データそれぞれについて、分割データに含まれる複数の罫線領域それぞれの画像データから罫線の中心画素を少なくとも含む罫線2値化データと、罫線データを補間するための補間2値化データとを生成し、可逆圧縮部15に出力する。罫線2値化部14は、罫線2値化データで特定されるRGB画像データの画素値から第1罫線色を決定して結合部18に出力し、補間2値化罫線データで特定されるRGB画像データの画素値から第2罫線色を決定して結合部18に出力する。
A ruled line region, image data, and RGB image data are input to the ruled
可逆圧縮部15は、罫線2値化データと補間2値化データとが入力される。罫線2値化データと補間2値化データとは、色相および彩度の組ごと(分割データごと)に入力される。可逆圧縮部15は、色相および彩度の組ごとに入力される罫線2値化データを可逆圧縮して得られる第1圧縮データを結合部18に出力し、色相および彩度の組ごとに入力される補間2値化データを可逆圧縮して得られる第2圧縮データを結合部18に出力する。
The
低解像度化部16は、背景領域とRGB画像データとが入力され、RGB画像データの背景領域について解像度を低減する。解像度を低くすることによりデータ量を減少して圧縮効率を高めるためである。低解像度化部16は、解像度を低下させたRGB画像データの背景領域を非可逆圧縮部17に出力する。非可逆圧縮部17は、低解像度化部16から入力される解像度を低下させた背景領域のRGB画像データを非可逆圧縮する。ここでは、非可逆圧縮方式としてJPEG(Joint Photographic Experts Group)符号化を用いている。なお、非可逆的な圧縮方式であればJPEG以外を用いてもよい。
The resolution reduction unit 16 receives the background area and the RGB image data, and reduces the resolution of the background area of the RGB image data. This is to reduce the amount of data and increase the compression efficiency by lowering the resolution. The resolution reduction unit 16 outputs the background area of the RGB image data whose resolution has been reduced to the
結合部18は、可逆圧縮部13から第3圧縮データが、可逆圧縮部15から第1および第2圧縮データが、非可逆圧縮部17から第4圧縮データが、文字2値化部12から文字領域の色が、罫線2値化部14から第1罫線色および第2罫線色とが入力される。結合部18は、第1圧縮データと第1罫線色とを関連付けた第1関連データと、第2圧縮データと第2罫線色とを関連付けた第2関連データと、第3圧縮データと文字領域の色とを関連付けた第3関連データと、第1〜第4圧縮データとを結合して結合圧縮データを生成して出力する。出力は、記憶部102またはICカード110Aへの記憶、ネットワークI/F107またはモデム108から他のコンピュータへの送信のいずれであってもよい。結合データは、PDF(Portable Document Format)のフォーマットであってもよい。
The combining
図3は、第1の実施の形態における罫線2値化部の詳細な機能を示す機能ブロック図である。図3を参照して、罫線2値化部14は、罫線領域の画像データを第1のしきい値で2値化して罫線2値化データを抽出する第1の2値化部21と、罫線領域の画像データを第1および第2のしきい値の内外で2値化して補間2値化データを抽出する第2の2値化部23と、罫線2値化データで特定されるRGB画像データの画素値から第1罫線色を決定する第1罫線色決定部22と、補間2値化データで特定されるRGB画像データの画素値から第2罫線色を決定する第2罫線色決定部24とを含む。
FIG. 3 is a functional block diagram illustrating detailed functions of the ruled line binarization unit in the first embodiment. Referring to FIG. 3, ruled
ここでは、色相および彩度の組で特定される1つの分割データについて、その分割データに含まれる罫線領域が入力される場合について説明する。実際には、分割データが複数ある場合には、複数の分割データそれぞれについて罫線2値化データおよび補間2値化データが生成され、罫線2値化データに対応する第1罫線色および補間2値化データに対応する第2罫線色が決定される。換言すれば、罫線2値化部14では、色相と彩度の組ごとに、罫線2値化データおよび補間2値化データが生成され、罫線2値化データに対応する第1罫線色および補間2値化データに対応する第2罫線色が決定される。
Here, a case will be described in which a ruled line area included in one piece of divided data specified by a set of hue and saturation is input. Actually, when there are a plurality of divided data, ruled line binarized data and interpolated binarized data are generated for each of the plurality of divided data, and the first ruled line color and interpolated binary corresponding to the ruled line binarized data are generated. A second ruled line color corresponding to the digitized data is determined. In other words, the ruled
ここで、第1のしきい値と第2のしきい値の決定について説明する。図4は、画像データの罫線領域近傍における明度のヒストグラムを示す図である。図4を参照して、横軸は図面右側から左側方向に明度が低くなる次元を示す。縦軸は、画素数を示す。ヒストグラムの左側(明度の低い側)の山が罫線部分に相当し、右側(明度の高い側)の山が背景領域に相当する。左側の山のピークより明度の高い位置に第1のしきい値が設定される。この第1のしきい値よりも明度の低い画素は、罫線の濃度の濃い部分、換言すれば罫線の中心付近の画素に相当する。第2のしきい値は、第1のしきい値よりも明度が高い。第1しきい値と第2しきい値との間の明度の画素は、主に罫線の濃度の薄い部分の画素、換言すれば罫線のエッジ付近の画像に相当する。 Here, determination of the first threshold value and the second threshold value will be described. FIG. 4 is a diagram showing a brightness histogram in the vicinity of the ruled line region of the image data. Referring to FIG. 4, the horizontal axis indicates a dimension in which the brightness decreases from the right side to the left side of the drawing. The vertical axis indicates the number of pixels. The mountain on the left side (low lightness side) of the histogram corresponds to the ruled line portion, and the mountain on the right side (high lightness side) corresponds to the background region. A first threshold value is set at a position with higher brightness than the peak of the left mountain. A pixel having a lightness lower than the first threshold corresponds to a portion where the ruled line is dark, in other words, a pixel near the center of the ruled line. The second threshold value has a higher brightness than the first threshold value. Pixels having brightness between the first threshold value and the second threshold value mainly correspond to pixels in a portion where the ruled line density is low, in other words, an image near the edge of the ruled line.
第1のしきい値および第2のしきい値は、罫線領域のヒストグラムから次の手順で決定される。
(1)ヒストグラムのノイズを取るために、明度の階調数を256階調から64階調に削減する。
(2)ヒストグラムの罫線領域のピーク値を求める。
(3)ヒストグラムの画素数のピーク値の10%の画素数に当たる2つの明度のうちピーク値の明度よりも高い明度を第2のしきい値に決定する。
(4)罫線領域の第2しきい値以上の明度の画素の数の上位70%の画素を含むことのできる明度を第1のしきい値に決定する。
The first threshold value and the second threshold value are determined by the following procedure from the ruled line region histogram.
(1) In order to remove noise in the histogram, the number of lightness gradations is reduced from 256 gradations to 64 gradations.
(2) The peak value of the ruled line region of the histogram is obtained.
(3) Of the two brightness values corresponding to 10% of the peak value of the number of pixels in the histogram, a brightness value higher than the brightness value of the peak value is determined as the second threshold value.
(4) The lightness that can include the upper 70% of the number of pixels having the lightness equal to or higher than the second threshold value in the ruled line region is determined as the first threshold value.
なお、第1しきい値と第2しきい値とを定めるパラメータは、ヒストグラムの形状や処理の対象となる画素数等に応じて適切に変更するようにしてもよい。 The parameters that define the first threshold value and the second threshold value may be appropriately changed according to the shape of the histogram, the number of pixels to be processed, and the like.
図3に戻って、第1の2値化部21は、罫線領域の画像データを第1のしきい値で2値化して罫線2値化データを生成する。換言すれば、第1の2値化部21は、罫線領域の画像データの画素のうち明度が第1のしきい値以下の画素を「1」とし、他を「0」とする罫線2値化データを生成する。罫線2値化データは、罫線領域の画像データにおける罫線の中心付近の画素を「1」とし、他を「0」とした2値のデータとなる。このため、罫線領域の画像データが傾いた罫線を含んでいる場合、または曲線である場合には、直線にならないのでガタツキが目立つ罫線となる。
Returning to FIG. 3, the
第1罫線色決定部22には、RGB画像データと罫線2値化データとが入力される。第1罫線色決定部22は、罫線2値化データで画素値が「1」とされる画素に対応するRGB画像データの画素のRGB値それぞれの平均値または中央値を第1罫線色として決定する。この第1罫線色は、罫線2値化データで画素値「1」とされた画素の罫線色とされる。第1罫線色決定部22は、第1罫線色を結合部18に出力する。
RGB image data and ruled line binarized data are input to the first ruled line color determination unit 22. The first ruled line color determination unit 22 determines the average value or the median value of the RGB values of the pixels of the RGB image data corresponding to the pixel whose pixel value is “1” in the ruled line binarized data as the first ruled line color. To do. The first ruled line color is the ruled line color of the pixel whose pixel value is “1” in the ruled line binarized data. The first ruled line color determining unit 22 outputs the first ruled line color to the combining
第2の2値化部23は、罫線領域の画像データを第1および第2のしきい値の内外で2値化して補間2値化データを生成する。換言すれば、第2の2値化部23は、罫線領域の画像データの画素のうち明度が第1しきい値より高く第2のしきい値以下の画素を「1」とし、他を「0」とした補間2値化データを生成する。このため、補間2値化データは、罫線領域の画像データでは、罫線のエッジ付近の明度の高い画素を「1」とし、他を「0」とした2値のデータである。このような画素は、第1の2値化部21で2値化された罫線のガタツキ部分の近傍に存在することが多い。
The
第2罫線色決定部24には、RGB画像データと、補間2値化データとが入力される。第2罫線色決定部24は、補間2値化データで画素値が「1」とされる画素に対応するRGB画像データの画素のRGB値それぞれの平均値または中央値を第2罫線色として決定する。この第2罫線色は、補間2値化データで画素値「1」とされた画素の罫線色とされる。第2罫線色決定部24は、第2罫線色を結合部18に出力する。
The second ruled line
図5は、罫線2値化データと補間2値化データの関係を示す図である。図5(A)は、罫線2値化データを示し、図5(B)は、罫線2値化データおよび補間2値化データを示す。図5(A)を参照して、原稿が傾いてスキャナで読み取られた場合に、罫線がスキャナの主走査方向に垂直または平行とならない。罫線2値化データは、画像データで罫線の中心付近に相当する画素を「1」としたデータであるので、図に示すように直線とはならず、2つの直線が重なる部分でカタツキが存在する。 FIG. 5 is a diagram showing the relationship between ruled line binarized data and interpolated binarized data. FIG. 5A shows ruled line binarized data, and FIG. 5B shows ruled line binarized data and interpolated binarized data. Referring to FIG. 5A, when the document is tilted and read by the scanner, the ruled lines are not perpendicular or parallel to the main scanning direction of the scanner. The ruled line binarized data is image data in which the pixel corresponding to the vicinity of the center of the ruled line is set to “1”. Therefore, the line is not a straight line as shown in FIG. To do.
図5(B)を参照して、罫線2値化データに含まれる罫線を細かいハッチングで示し、補間2値化データに含まれる罫線を粗いハッチングで示している。罫線2値化データに含まれる罫線のガタツキ部分の近傍に補間2値化データに含まれる罫線が位置する。補間2値化データに含まれる罫線の明度は、罫線2値化データに含まれる罫線の明度より高いので、ガタツキ部分が補間2値化データに含まれる罫線によって見た目上緩和される。 With reference to FIG. 5B, the ruled lines included in the ruled line binarized data are indicated by fine hatching, and the ruled lines included in the interpolated binarized data are indicated by rough hatching. The ruled line included in the interpolated binarized data is located in the vicinity of the shaky part of the ruled line included in the ruled line binarized data. Since the lightness of the ruled line included in the interpolated binarized data is higher than the lightness of the ruled line included in the ruled binarized data, the shaky part is visually relaxed by the ruled line included in the interpolated binarized data.
図6は、MFPで実行される領域別圧縮処理の流れを示すフローチャートである。図6を参照して、領域別圧縮処理では、まず、RGB画像データが入力されるまで待機状態となっており(ステップS01でNO)、RGB画像データが入力されるとステップS02に進む。ステップS02では、RGB画像データの各画素の明度を算出して、RGB画像データを1画素が8ビットの明度プレーンを有する画像データに変換する。明度を算出して画像データに変換するのは、以降に実行される領域判別処理において、判別精度を向上させるため、および演算負荷を低減させるために、明度を処理するからである。 FIG. 6 is a flowchart showing the flow of the area-specific compression processing executed in the MFP. Referring to FIG. 6, in the region-by-region compression processing, first, the process is in a standby state until RGB image data is input (NO in step S01), and when RGB image data is input, the process proceeds to step S02. In step S02, the brightness of each pixel of the RGB image data is calculated, and the RGB image data is converted into image data in which each pixel has an 8-bit brightness plane. The reason why the lightness is calculated and converted into image data is that the lightness is processed in order to improve the determination accuracy and reduce the calculation load in the region determination processing to be executed later.
次のステップS03では、画像データをスムージングする。これにより画像データからノイズが除去されて、誤検出を低減することができる。そして、写真ブロックが検出される(ステップS04)。写真ブロックの検出は、画像データを2値化して、2値化したデータをラベリング処理することにより、画像データ中に含まれる矩形の写真ブロックの位置が検出される。写真ブロックを矩形とするのは、以降に実行される写真判定処理が、矩形毎に判定するからである。 In the next step S03, the image data is smoothed. Thereby, noise is removed from the image data, and erroneous detection can be reduced. Then, a photographic block is detected (step S04). In the detection of the photographic block, the position of the rectangular photographic block included in the image data is detected by binarizing the image data and labeling the binarized data. The reason why the photo block is rectangular is that the photo determination processing executed thereafter determines for each rectangle.
次のステップS05では、写真ブロック内の画像の特性に応じて、写真ブロックが図領域、写真領域、下地領域、その他の領域のいずれであるかを判定する。ステップS05における判定結果は、文字と罫線の判別に利用される。たとえば、写真領域にある文字または罫線を文字または罫線と判定するために、白地上の文字または罫線の判定で用いるしきい値と異なるしきい値を用いる必要があるからである。また、罫線分離処理では、画像全体の罫線を検出する他、図領域と判別された領域に特化した罫線検出を行うことに利用できるからである。 In the next step S05, it is determined whether the photographic block is a figure region, a photographic region, a base region, or another region according to the characteristics of the image in the photographic block. The determination result in step S05 is used for determination of characters and ruled lines. For example, in order to determine a character or ruled line in a photographic area as a character or ruled line, it is necessary to use a threshold value different from the threshold value used for determining a character or ruled line on the white background. This is because the ruled line separation process can be used not only to detect the ruled lines of the entire image but also to perform ruled line detection specialized for the area determined as the figure area.
そして、次の写真ブロックが存在するか否かが判断され(ステップS06)、存在する場合にはステップS05に戻り、存在しない場合にはステップS07に進む。 Then, it is determined whether or not the next photo block exists (step S06). If it exists, the process returns to step S05, and if it does not exist, the process proceeds to step S07.
次のステップS07およびステップS08では、ステップS02およびステップS03と同様にRGB画像データが明度プレーンを有する画像データに変換されて、スムージングされる。そして、スムージングされた画像データからエッジが抽出される(ステップS09)。エッジの抽出は、たとえば、画像データに一次微分フィルタまたは二次部分フィルタを用いてフィルタ処理して、エッジ画像を生成することにより行われる。写真領域のように明度を2値化したデータを用いずに、エッジを抽出するのは、明度の高い領域の文字や反転文字を検出するためである。 In the next step S07 and step S08, the RGB image data is converted into image data having a brightness plane and smoothed in the same manner as in step S02 and step S03. Then, an edge is extracted from the smoothed image data (step S09). Edge extraction is performed, for example, by filtering image data using a primary differential filter or a secondary partial filter to generate an edge image. The reason for extracting the edge without using the binarized data as in the photographic area is to detect characters and inverted characters in the high brightness area.
そして、エッジ画像を用いて罫線を抽出する。罫線の抽出は、画像の全体に対して行う他、ステップS05で図領域と判定された領域のみ、および写真領域と判定された領域のみに対しても行われる。画像全体から罫線を抽出することで、文字を修飾するアンダーライン等を抽出することができる。また、図属性または写真領域と判定された領域から罫線を正確に抽出することができる。さらに、縦横の連続性を考慮して罫線を検出することができる。 Then, a ruled line is extracted using the edge image. The ruled line is extracted not only for the entire image, but also only for the area determined as the figure area in step S05 and only the area determined as the photo area. By extracting ruled lines from the entire image, it is possible to extract underlines and the like that modify characters. Further, a ruled line can be accurately extracted from a region determined as a figure attribute or a photo region. Furthermore, ruled lines can be detected in consideration of vertical and horizontal continuity.
ここで、罫線分離処理について詳細に説明する。図7は、図6のステップS10で実行される罫線分離処理の流れを示すフローチャートである。図7を参照して、まず、画像データの傾きが検出される(ステップS41)。この傾き検出のため、まずエッジ画像を低解像度化する。処理速度と検出精度に応じて、適切な解像度に縮小される。そして、傾き検出領域を抽出する。傾き検出は、文字の多い領域で精度が高くなるため、エッジの多い領域を検出領域として抽出する。検出領域において、ラインごとにエッジ画素のヒストグラムを作成する。検出領域を回転させていき、それぞれの回転角においてヒストグラムを作成する。そして、ヒストグラムの形状が原稿の傾がない場合の形状となったときの回転角を傾き角度として検出する。 Here, the ruled line separation process will be described in detail. FIG. 7 is a flowchart showing a ruled line separation process executed in step S10 of FIG. Referring to FIG. 7, first, the inclination of image data is detected (step S41). In order to detect the inclination, the edge image is first reduced in resolution. The resolution is reduced to an appropriate resolution according to the processing speed and detection accuracy. Then, an inclination detection area is extracted. Since the inclination detection has high accuracy in a region with many characters, a region with many edges is extracted as a detection region. In the detection area, a histogram of edge pixels is created for each line. The detection area is rotated, and a histogram is created at each rotation angle. Then, the rotation angle when the shape of the histogram becomes the shape when the document is not inclined is detected as the inclination angle.
次のステップS42では、ステップS41で検出した傾き角だけエッジ画像を回転させる。そして、罫線を検出する(ステップS43)。罫線の検出は、まず、回転させたエッジ画像の行方向のヒストグラムを作成し、ヒストグラムの形状およびピーク値をしきい値と比較し、所定の条件を満たせばピーク値の行を罫線領域として検出する。検出された罫線領域は、エッジ画像から分離される。ピーク値の行が複数あれば、複数が罫線領域として検出される。次に列方向のヒストグラムを作成する。そして、ピーク値の列を罫線領域として分離する。ピーク値の列が複数あれば、複数が分離される。検出された罫線領域は、エッジ画像から分離される。そして、検出した罫線領域および罫線領域が分離されたエッジ画像を、ステップS42で回転させたのと逆方向に同じ角度だけ回転させる。 In the next step S42, the edge image is rotated by the inclination angle detected in step S41. Then, a ruled line is detected (step S43). To detect ruled lines, first create a histogram in the row direction of the rotated edge image, compare the shape and peak value of the histogram with the threshold value, and detect the peak value line as a ruled line area if a predetermined condition is met. To do. The detected ruled line area is separated from the edge image. If there are a plurality of rows of peak values, the plurality are detected as ruled line regions. Next, a histogram in the column direction is created. Then, the peak value column is separated as a ruled line region. If there are a plurality of columns of peak values, the plurality are separated. The detected ruled line area is separated from the edge image. Then, the detected ruled line area and the edge image from which the ruled line area is separated are rotated by the same angle in the opposite direction to that rotated in step S42.
図6に戻って、ステップS11では、罫線が分離されたエッジ画像から文字ブロックが検出される。エッジ画像をラベリングすることにより単語1つ程度の大きさの文字ブロックを検出する。文字ブロックを単語1つ程度の大きさとすることにより、処理時間を低減して、文字の判定制度を向上させることができる。なお、文字ブロックの大きさは、これに限られず、これより大きいたとえば1ライン程度の大きさとしてもよいし、これより小さいたとえば1文字程度の大きさとしてもよい。 Returning to FIG. 6, in step S11, a character block is detected from the edge image from which the ruled lines are separated. By labeling the edge image, a character block as large as one word is detected. By making the character block about one word in size, the processing time can be reduced and the character determination system can be improved. The size of the character block is not limited to this, and may be larger, for example, about one line, or smaller, for example, about one character.
そして、文字ブロックが文字特性を有するか否かを、文字ブロックの画像データを用いて判定する(ステップS12)。すなわち、画像データにおける文字ブロックに含まれる画素の明度を用いて文字特性を有するか否かが判定される。文字特性を有するとされた文字ブロックは、文字領域とされ、そうでなければ文字ブロックは文字領域とされない。 Then, it is determined using the image data of the character block whether or not the character block has character characteristics (step S12). That is, it is determined whether or not it has character characteristics using the brightness of the pixels included in the character block in the image data. A character block having character characteristics is regarded as a character area, otherwise the character block is not regarded as a character area.
次のステップS13では、文字領域の画像データに網点除去処理を行う。文字領域の背景に網点が存在する場合、網点は2値化されるとノイズとなるため、網点が2値化されるのを防ぐためである。次のステップS14では、文字領域の画像データを2値化する(ステップS14)。これにより、文字と背景とが分離され、データ量が削減される。2値化により文字とされた画素は「1」とされ、背景とされた画素は「0」となる。 In the next step S13, halftone dot removal processing is performed on the image data in the character area. This is to prevent the halftone dot from being binarized because when the halftone dot exists in the background of the character area, the halftone dot becomes noise when binarized. In the next step S14, the image data of the character area is binarized (step S14). Thereby, the character and the background are separated, and the data amount is reduced. Pixels that are converted to characters by binarization are set to “1”, and pixels that are set to background are set to “0”.
そして、文字色が決定される(ステップS15)。文字色の決定は、文字領域ごとに決定され、文字領域に対して1色が決定される。具体的には、文字領域における文字とされた画素のRGB画像データにおける画素値の平均値または中央値が、文字領域の文字の色とされる。複数の文字領域の文字領域間の距離と、決定した文字色の差とから、近傍でかつ類似する色の文字領域を統合して、文字領域の数が削減される。これにより、データ量が削減される。 Then, the character color is determined (step S15). The character color is determined for each character region, and one color is determined for the character region. Specifically, the average value or median value of the pixel values in the RGB image data of the pixels set as characters in the character area is used as the character color of the character area. Based on the distance between the character areas of the plurality of character areas and the difference between the determined character colors, the character areas in the vicinity and similar colors are integrated to reduce the number of character areas. Thereby, the data amount is reduced.
そして、次に処理対象とする文字ブロックの有無が判断され(ステップS16)、そのような文字ブロックが有ればステップS12に戻り、なければステップS17に進む。ステップS17では、画像データ全体からステップS12で文字と判定された文字領域とステップS10で抽出された罫線領域とを除いた領域を背景領域とし、RGB画像データから背景領域を抽出した背景領域の画像データ(背景領域データ)が生成される。そして、背景領域データが低解像度に変換され(ステップS18)、非可逆圧縮方式で圧縮される(ステップS19)。これにより、第4圧縮データが生成される。ここでは、JPEG方式で圧縮される。 Next, it is determined whether or not there is a character block to be processed (step S16). If there is such a character block, the process returns to step S12, and if not, the process proceeds to step S17. In step S17, an image of the background region obtained by extracting the background region from the RGB image data by using the region excluding the character region determined as the character in step S12 and the ruled line region extracted in step S10 from the entire image data as a background region. Data (background area data) is generated. Then, the background area data is converted to a low resolution (step S18) and compressed by the lossy compression method (step S19). As a result, fourth compressed data is generated. Here, the image is compressed by the JPEG method.
ステップS20では、近似する色の文字領域を統合した文字領域データが生成される(ステップS20)。統合された文字領域データは、全て同じ色とされる。同じ色は、文字とされた画素のRGB値の平均または中央値とすればよい。ここでは、黒色、赤色、青色および緑色それぞれの色の文字領域データが生成されるものとする。そして、色別に生成された文字領域データを可逆圧縮する(ステップS21)。これにより、色別の第3圧縮データが生成される。ここでは、黒色の文字領域を圧縮した第3圧縮データと、赤色の文字領域を圧縮した第3圧縮データと、青色の文字領域を圧縮した第3圧縮データと、緑色の文字領域を圧縮した第3圧縮データとが生成される。 In step S20, character area data in which character areas of similar colors are integrated is generated (step S20). All the integrated character area data has the same color. The same color may be the average or median of the RGB values of the pixels made into characters. Here, it is assumed that character area data of each color of black, red, blue and green is generated. Then, the character area data generated for each color is reversibly compressed (step S21). Thereby, the 3rd compression data according to color are produced | generated. Here, the third compressed data obtained by compressing the black character region, the third compressed data obtained by compressing the red character region, the third compressed data obtained by compressing the blue character region, and the third compressed data obtained by compressing the green character region. 3 compressed data is generated.
次のステップS22では、同色の罫線が統合される(ステップS22)。ステップS13で検出された罫線領域に含まれる画素のRGB値から、各罫線領域の色相および彩度の組が決定される。そして、色相および彩度の組が近似する罫線領域を統合するのである。これにより、色相および彩度の組別に罫線領域が特定される。ここでは、説明のため罫線領域の色相および彩度の組が黒、赤、緑、青の4色である場合を例に説明する。なお、ここでは、色相および彩度の組別に罫線領域を特定するようにしたが、ステップS10で分離された罫線ごとにステップS23からステップS28の処理を実行するようにしてもよい。 In the next step S22, ruled lines of the same color are integrated (step S22). From the RGB values of the pixels included in the ruled line area detected in step S13, a set of hue and saturation for each ruled line area is determined. Then, the ruled line regions that approximate the hue and saturation pairs are integrated. Thereby, a ruled line area is specified for each set of hue and saturation. Here, for the sake of explanation, a case where the set of hue and saturation in the ruled line region is four colors of black, red, green, and blue will be described as an example. Here, the ruled line region is specified for each set of hue and saturation, but the process from step S23 to step S28 may be executed for each ruled line separated in step S10.
ステップS23からS28は、色相および彩度の組別に統合された罫線領域のうち、色相および彩度の組が同じ罫線領域の全てに対して行われる。ステップS23では、罫線領域の画像データを第1のしきい値で2値化する。これにより罫線2値化データが生成される。罫線2値化データは、罫線領域の画像データのうち第1のしきい値よりも明度が低い画素を「1」とし、そうでない画素を「0」としたデータである。罫線2値化データにおいて、画素値「1」の画素は、罫線であることを示す。そして、生成された罫線2値化データが可逆圧縮される(ステップS24)。これにより、罫線2値化データを可逆圧縮した第1圧縮データが生成される。そして、罫線2値化データで特定されるRGB画像データの画素値から第1罫線色が決定される(ステップS25)。第1罫線色は、たとえば、罫線2値化データで画素値が「1」とされる画素に対応するRGB画像データの画素のRGB値それぞれの平均値または中央値である。 Steps S <b> 23 to S <b> 28 are performed for all of the ruled line regions having the same hue and saturation set among the ruled line regions integrated for each set of hue and saturation. In step S23, the image data of the ruled line area is binarized with the first threshold value. Thereby, ruled line binarized data is generated. The ruled line binarized data is data in which, in the image data of the ruled line area, a pixel whose brightness is lower than the first threshold value is set to “1”, and other pixels are set to “0”. In the ruled line binarized data, a pixel having a pixel value “1” indicates a ruled line. Then, the generated ruled line binarized data is reversibly compressed (step S24). As a result, first compressed data obtained by reversibly compressing the ruled line binarized data is generated. Then, the first ruled line color is determined from the pixel values of the RGB image data specified by the ruled line binarized data (step S25). The first ruled line color is, for example, the average value or the median value of the RGB values of the pixels of the RGB image data corresponding to the pixels whose pixel value is “1” in the ruled line binarized data.
ステップS26では、罫線領域の画像データを第1のしきい値および第2しきい値の内外で2値化する。これにより補間2値化データが生成される。補間2値化データは、罫線領域の画像データのうち第1しきい値より高く第2のしきい値以下の画素を「1」とし、そうでない画素を「0」としたデータである。補間2値化データにおいて、画素値「1」の画素は、罫線であることを示す。そして、生成された補間2値化データが可逆圧縮される(ステップS27)。これにより、補間2値化データを可逆圧縮した第2圧縮データが生成される。そして、補間2値化データで特定されるRGB画像データの画素値から第2罫線色が決定される(ステップS25)。第2罫線色は、たとえば、補間2値化データで画素値が「1」とされる画素に対応するRGB画像データの画素のRGB値それぞれの平均値または中央値である。 In step S26, the image data of the ruled line area is binarized inside and outside the first threshold value and the second threshold value. Thereby, interpolated binary data is generated. The interpolated binarized data is data in which, in the image data of the ruled line region, pixels that are higher than the first threshold value and lower than or equal to the second threshold value are set to “1”, and other pixels are set to “0”. In the interpolated binarized data, the pixel having the pixel value “1” indicates a ruled line. Then, the generated interpolated binary data is reversibly compressed (step S27). As a result, second compressed data obtained by reversibly compressing the interpolated binary data is generated. Then, the second ruled line color is determined from the pixel value of the RGB image data specified by the interpolation binary data (step S25). The second ruled line color is, for example, the average value or median value of the RGB values of the pixels of the RGB image data corresponding to the pixel whose pixel value is “1” in the interpolated binarized data.
次のステップS29では、未処理の色相および彩度の組の罫線領域が存在するか否かが判断される。そのような罫線領域が存在する場合にはステップS23に戻り、存在しなければステップS30に進む。これにより、ステップS22で色相および彩度の組別に統合された罫線領域の全てについて、ステップS23からS28までの処理が実行される。したがって、罫線2値化データおよび補間2値化データは、色相および彩度の組別に罫線領域を統合した分割データの数だけ生成されて可逆圧縮される。換言すれば、第1圧縮データおよび第2圧縮データは、色相および彩度の組別に生成される。ここでは、色相と彩度の組を、黒、赤、緑、青としたので、これら4つの組の分割データそれぞれに対して、第1圧縮データと第1罫線色、第2圧縮データと第2罫線色が求められる。 In the next step S29, it is determined whether or not there is a ruled line region of a set of unprocessed hue and saturation. If such a ruled line area exists, the process returns to step S23, and if not, the process proceeds to step S30. As a result, the processing from step S23 to S28 is executed for all the ruled line regions integrated for each combination of hue and saturation in step S22. Accordingly, the ruled line binarized data and the interpolated binarized data are generated by the number of divided data obtained by integrating the ruled line regions for each set of hue and saturation and are reversibly compressed. In other words, the first compressed data and the second compressed data are generated for each set of hue and saturation. Here, the set of hue and saturation is black, red, green, and blue. Therefore, for each of these four sets of divided data, the first compressed data, the first ruled line color, the second compressed data, and the first Two ruled line colors are required.
ステップS30では、色相および彩度の組別の第1圧縮データ、色相および彩度の組別の第2圧縮データ、色別の第3圧縮データおよび第4圧縮データを統合して1つのデータとする。この際、第1圧縮データと第1罫線色とを関連付けた関連データと、第2圧縮データと第2罫線色とを関連付けた関連データと、第3圧縮データと文字領域の色とを関連付けた関連データとが併せて結合される。ここでは、色相および彩度の組が黒、赤、緑および青それぞれので、第1圧縮データおよび第2圧縮データが生成されるので、色相および彩度の組が黒、赤、緑および青それぞれで、第1圧縮データと第1罫線色とを関連つけた関連データと、第2圧縮データと第2罫線色とを関連付けた関連データとが記憶され、さらに、黒の色と第3圧縮データとを関連付けた関連データと、赤の色と第3圧縮データとを関連付けた関連データと、青の色と第3圧縮データとを関連付けた関連データと、緑の色と第3圧縮データとを関連付けた関連データとが記憶される。 In step S30, the first compressed data for each set of hue and saturation, the second compressed data for each set of hue and saturation, the third compressed data for each color, and the fourth compressed data are integrated into one data and To do. At this time, the related data that associates the first compressed data with the first ruled line color, the related data that associates the second compressed data with the second ruled line color, the third compressed data, and the color of the character area are associated with each other. Combined with related data. Here, the hue and saturation pairs are black, red, green, and blue, respectively, and the first compressed data and the second compressed data are generated. Therefore, the hue and saturation pairs are black, red, green, and blue, respectively. And the related data associating the first compressed data with the first ruled line color, the related data associating the second compressed data with the second ruled line color, and the black color and the third compressed data. , Related data that associates the red color with the third compressed data, related data that associates the blue color with the third compressed data, and the green color and the third compressed data. The related data associated is stored.
図8は、結合データのデータ構造を示す図である。図8を参照して、結合データは、ヘッダと、ボディと、相互参照表と、トレーラとを含む。ボディは、作成日付などを含む文字情報と、第1ページ〜最終ページそれぞれのデータブロックと、各ページに対応する子ページ辞書と、親ページ辞書と、カタログ辞書とを含む。 FIG. 8 is a diagram illustrating a data structure of combined data. Referring to FIG. 8, the combined data includes a header, a body, a cross reference table, and a trailer. The body includes character information including a creation date, data blocks for each of the first to last pages, a child page dictionary corresponding to each page, a parent page dictionary, and a catalog dictionary.
第1ページ〜最終ページのデータブロックそれぞれは、背景領域を圧縮した第4圧縮データと、黒色の文字領域を圧縮した第3圧縮データと、赤色の文字領域を圧縮した第3圧縮データと、青色の文字領域を圧縮した第3圧縮データと、緑色の文字領域を圧縮した第3圧縮データと、色相および彩度の組が黒のうち第1罫線色(濃い黒)の第1圧縮データと、色相および彩度の組が黒のうち第2罫線色(薄い黒)の第2圧縮データと、色相および彩度の組が赤のうち第1罫線色(濃い赤)の第1圧縮データと、色相および彩度の組が赤のうち第2罫線色(薄い赤)の第2圧縮データと、色相および彩度の組が緑のうち第1罫線色(濃い緑)の第1圧縮データと、色相および彩度の組が緑のうち第2罫線色(薄い緑)の第2圧縮データと、色相および彩度の組が青のうち第1罫線色(濃い青)の第1圧縮データと、色相および彩度の組が青のうち第2罫線色(薄い青)の第2圧縮データと、レイヤ情報とを含む。レイヤ情報は、色相および彩度の組が黒、赤、緑および青それぞれについて第1罫線色と第1圧縮データとを関連付けた4つの関連データと、色相および彩度の組が黒、赤、緑および青それぞれについて第2罫線色と第2圧縮データとを関連付けた4つの関連データとを含み、さらに、黒の色と第3圧縮データとを関連付けた関連データと、赤の色と第3圧縮データとを関連付けた関連データと、青の色と第3圧縮データとを関連付けた関連データと、緑の色と第3圧縮データとを関連付けた関連データとを含む。 Each of the data blocks of the first page to the last page includes fourth compressed data obtained by compressing the background area, third compressed data obtained by compressing the black character area, third compressed data obtained by compressing the red character area, and blue The third compressed data obtained by compressing the character area, the third compressed data obtained by compressing the green character area, the first compressed data of the first ruled line color (dark black) among the combination of hue and saturation, and Second compressed data of the second ruled line color (light black) in which the set of hue and saturation is black; and first compressed data of the first ruled line color (dark red) in which the set of hue and saturation is red; Second compressed data of the second ruled line color (light red) out of the hue and saturation set of red; and first compressed data of the first ruled line color (dark green) out of the hue and saturation set of green; The second compressed data of the second ruled line color (light green) out of the hue and saturation set in green, and the hue And the first compressed data of the first ruled line color (dark blue) out of the set of blue and saturation, the second compressed data of the second ruled line color (light blue) out of the set of hue and saturation, and the layer Information. The layer information includes four related data in which the first ruled line color and the first compressed data are associated with each of the hue and saturation pairs of black, red, green, and blue, and the hue and saturation pairs of black, red, Four related data that associate the second ruled line color and the second compressed data with respect to each of green and blue, and further, related data that associates the black color with the third compressed data, the red color, and the third color Related data that associates the compressed data with each other, associated data that associates the blue color with the third compressed data, and relevant data that associates the green color with the third compressed data.
図9は、罫線2値化データと補間2値化データの関係を示す別の図である。図9(A)は、罫線2値化データを示し、図9(B)は、罫線2値化データおよび補間2値化データを示す。図9(A)を参照して原稿に曲線の罫線が含まれている場合、罫線がスキャナの主走査方向に垂直または平行とならない。罫線2値化データは、画像データで罫線の中心付近に相当する画素を「1」としたデータであるので、図に示すように曲線が複数の短い直線の集合となり、直線の接する部分でカタツキが存在する。 FIG. 9 is another diagram showing the relationship between ruled line binarized data and interpolated binarized data. FIG. 9A shows ruled line binarized data, and FIG. 9B shows ruled line binarized data and interpolated binarized data. With reference to FIG. 9A, when the document includes curved ruled lines, the ruled lines are not perpendicular or parallel to the main scanning direction of the scanner. Since the ruled line binarized data is image data in which the pixel corresponding to the vicinity of the center of the ruled line is “1”, the curve is a set of a plurality of short straight lines as shown in FIG. Exists.
図9(B)を参照して、罫線2値化データに含まれる罫線を細かいハッチングで示し、補間2値化データに含まれる罫線を粗いハッチングで示している。罫線2値化データに含まれる罫線のガタツキ部分の近傍に補間2値化データに含まれる罫線が位置する。補間2値化データに含まれる罫線の明度は、罫線2値化データに含まれる罫線の明度より高いので、ガタツキ部分が補間2値化データに含まれる罫線によって見た目上緩和される。 With reference to FIG. 9B, the ruled lines included in the ruled line binarized data are indicated by fine hatching, and the ruled lines included in the interpolated binarized data are indicated by rough hatching. The ruled line included in the interpolated binarized data is located in the vicinity of the shaky part of the ruled line included in the ruled line binarized data. Since the lightness of the ruled line included in the interpolated binarized data is higher than the lightness of the ruled line included in the ruled binarized data, the shaky part is visually relaxed by the ruled line included in the interpolated binarized data.
以上説明したように第1の実施の形態におけるMFPは、RGB画像データ中の罫線領域を色相および彩度の組別に第1罫線色の罫線2値化データと、第1罫線色よりも明度の高い第2罫線色の補間2値化データとに分割して圧縮する。第1罫線色の罫線2値化データのデータ量を削減することにより発生する罫線のガタツキが、第2罫線色の補間2値化データで補間される。このため、画像データを圧縮しても罫線のガタツキを目立たなくすることができる。 As described above, in the MFP according to the first embodiment, the ruled line region in the RGB image data is converted into the ruled line binarized data of the first ruled line color for each set of hue and saturation, and the brightness of the ruled line color is higher than that of the first ruled line color. The compressed data is divided into interpolation binary data having a high second ruled line color. The shakiness of the ruled line generated by reducing the data amount of the ruled line binarized data of the first ruled line color is interpolated with the interpolated binarized data of the second ruled line color. For this reason, even if the image data is compressed, the rattling of the ruled lines can be made inconspicuous.
<第2の実施の形態>
次に第2の実施の形態における画像処理装置について説明する。第2の実施の形態における画像処理装置のハード構成は第1の実施の形態における画像処理装置のそれと同じなので、ここでは説明を繰り返さない。第2の実施の形態における画像処理装置は、罫線を低解像度化して圧縮する際に発生する罫線のガタツキを目立たなくするようにする。
<Second Embodiment>
Next, an image processing apparatus according to the second embodiment will be described. Since the hardware configuration of the image processing apparatus in the second embodiment is the same as that of the image processing apparatus in the first embodiment, description thereof will not be repeated here. The image processing apparatus according to the second embodiment makes the ruled line rattle generated when the ruled line is reduced in resolution and compressed to be inconspicuous.
図10は、第2の実施の形態におけるMFPの機能の概略を示す機能ブロック図である。図10を参照して、図2と異なる点は、罫線2値化部14Aである。その他の機能は図2に示したのと同じなのでここでは説明を繰り返さない。
FIG. 10 is a functional block diagram showing an outline of the functions of the MFP in the second embodiment. Referring to FIG. 10, the difference from FIG. 2 is a ruled
図11は、第2の実施の形態における罫線2値化部の詳細な機能を示す機能ブロック図である。図11を参照して、第2の実施の形態における罫線2値化部14Aは、罫線領域と画像データとが入力され、罫線領域の画像データを2値化する2値化部31と、2値化されたデータとRGB画像データとが入力され、2値化されたデータで特定されるRGB画像データの画素値から罫線色を決定する罫線色決定部34と、2値化されたデータを低い解像度に変換して罫線2値化データを出力する解像度変換部32と、2値化されたデータと罫線2値化データとが入力され、2値化されたデータから罫線2値化データの罫線成分を除去して補間2値化データを出力する差分抽出部33とを含む。
FIG. 11 is a functional block diagram illustrating detailed functions of the ruled line binarization unit according to the second embodiment. Referring to FIG. 11, ruled
2値化部31は、罫線領域と画像データとが入力され、罫線領域の画像データを2値化する。画像データは、高解像度のデータであり、ここでは600dpi(dot per inch)としている。罫線領域は、300dpiであるので、罫線領域を600dpiに解像度変換して、罫線領域の画像データが特定される。罫線色決定部34は、2値化されたデータで画素値が「1」とされる画素(罫線)に対応するRGB画像データの画素のRGB値それぞれの平均値または中央値を第1罫線色として決定する。この罫線色は、罫線2値化データで画素値「1」とされた画素の罫線色とされるとともに、補間2値化データで画素値「1」とされた画素の罫線色とされる。罫線色決定部34は、罫線色を結合部18に出力する。
The
解像度変換部32は、2値化された罫線領域の画像データが入力され、2値化されたデータを低解像度に変換して罫線2値化データを可逆圧縮部15に出力する。ここでは罫線2値化データを300dpiとしている。差分抽出部33は、罫線領域の画像データを2値化したデータと、罫線2値化データの解像度を元に戻したデータとが入力され、罫線領域の画像データを2値化したデータと罫線2値化データの解像度を元に戻したデータとの差分を補間2値化データとして出力する。換言すれば、罫線領域の画像データを2値化したデータのうちから罫線2値化データで罫線とされた成分を除去した補間2値化データを抽出する。
The
罫線領域の画像データを2値化したデータは解像度が画像データと同じ600dpiであるが、罫線2値化データは、解像度変換部32で300dpiに変換される。一方、補間2値化データは、画像データを2値化したデータ(600dpi)から罫線2値化データ(300dpi)の解像度を元に戻したデータ(600dpi)との差分とされる。このため、補間2値化データは、画像データと同じ600dpiの解像度のままである。すなわち、補間2値化データは、罫線領域に含まれる罫線のうち解像度変換部32で低解像度化することにより削除されてしまった罫線部分のみを含むことになる。
Data obtained by binarizing the image data in the ruled line area has the same resolution of 600 dpi as that of the image data, but the ruled line binarized data is converted into 300 dpi by the
なお、解像度は例示的に示したもので、これに限られることはない。また、差分抽出部33は、ここでは解像度変換部32により縦横それぞれが1/2に低解像度化されるので、罫線領域の画像データを2値化したデータのうち縦横2×2のサイズの領域の画素が全て「1」となる画素の画素値を「0」とするようにしてもよい。また、ここでは、罫線2値化データを、罫線領域の画像データを2値化してから低解像度化しているが、罫線領域の画像データを低解像度化してから2値化するようにしてもよい。
Note that the resolution is shown by way of example and is not limited to this. In addition, since the
図10に戻って、結合部18には、可逆圧縮部15から第1圧縮データと第2圧縮データとが入力され、罫線2値化部14Aから罫線色が入力される。結合部18は、第1圧縮データと罫線色とを関連付けた関連データ、および第2圧縮データと罫線色とを関連付けた関連データを生成して、レイヤ情報として結合圧縮データに含める。
Returning to FIG. 10, the first compression data and the second compression data are input to the combining
図12は、第2の実施の形態におけるMFPで実行される領域別圧縮処理の流れを示すフローチャートである。第2の実施の形態における画像処理装置では、図6に示した領域別圧縮処理と同様の処理が実行されるが、ステップS23からステップS28の処理が異なり、これらに代えてステップS41〜S46が実行される。図12を参照して、ステップS41〜S46は、色相および彩度の組別に統合された罫線領域のうち、色相および彩度の組が同じ罫線領域の全てに対して行われる。ステップS41では、罫線領域の画像データを所定のしきい値で2値化する。ここでは、罫線領域は解像度が300dpiであり、画像データは解像度が600dpiの高解像度であるので、罫線領域を600dpiに解像度変換して、罫線領域の画像データが特定される。罫線領域の画像データを2値化したデータは、罫線領域の画像データのうち所定のしきい値よりも明度が低い画素を「1」とし、そうでない画素を「0」としたデータである。2値化されたデータにおいて、画素値「1」の画素は、高解像度の画像データにおいて罫線であることを示す。そして、2値化されたデータで特定されるRGB画像データの画素値から罫線色が決定される(ステップS42)。罫線色は、たとえば、2値化されたデータで画素値が「1」とされる画素に対応するRGB画像データの画素のRGB値それぞれの平均値または中央値である。 FIG. 12 is a flowchart showing the flow of the area-specific compression process executed by the MFP according to the second embodiment. In the image processing apparatus according to the second embodiment, processing similar to the region-by-region compression processing shown in FIG. 6 is executed, but the processing from step S23 to step S28 is different, and instead of these steps, steps S41 to S46 are performed. Executed. Referring to FIG. 12, steps S <b> 41 to S <b> 46 are performed for all ruled line regions having the same hue and saturation group among the ruled line areas integrated for each hue and saturation group. In step S41, the image data of the ruled line area is binarized with a predetermined threshold value. Here, since the ruled line area has a resolution of 300 dpi and the image data has a high resolution of 600 dpi, the ruled line area is converted to 600 dpi to specify the image data of the ruled line area. The data obtained by binarizing the image data of the ruled line area is data in which the pixels having lightness lower than a predetermined threshold are set to “1” and the other pixels are set to “0” in the image data of the ruled line area. In the binarized data, the pixel with the pixel value “1” indicates a ruled line in the high-resolution image data. Then, the ruled line color is determined from the pixel values of the RGB image data specified by the binarized data (step S42). The ruled line color is, for example, the average value or median value of the RGB values of the pixels of the RGB image data corresponding to the pixels whose pixel values are “1” in the binarized data.
そして、罫線2値化データが生成される(ステップS43)。罫線2値化データは、2値化されたデータを低解像度に変換することにより生成される。ここでは罫線2値化データの解像度を300dpiとしている。生成された罫線2値化データが可逆圧縮される(ステップS44)。これにより、罫線2値化データを可逆圧縮した第1圧縮データが生成される。次に、補間2値化データが生成される(ステップS45)。補間2値化データは、ステップS41で2値化されたデータと、罫線2値化データの解像度を元に戻したデータとの差分である。換言すれば、ステップS41で2値化されたデータのうちから罫線2値化データで罫線とされた成分を除去したものを補間2値化データとする。補間2値化データは、画像データと同じ600dpiの解像度のままであり、罫線領域に含まれる罫線のうち低解像度の罫線2値化データに含めることのできない罫線部分のみを含むことになる。そして、生成された補間2値化データが可逆圧縮される(ステップS46)。これにより、補間2値化データを可逆圧縮した第2圧縮データが生成される。 Then, ruled line binarized data is generated (step S43). The ruled line binarized data is generated by converting the binarized data to a low resolution. Here, the resolution of the ruled line binarized data is 300 dpi. The generated ruled line binarized data is reversibly compressed (step S44). As a result, first compressed data obtained by reversibly compressing the ruled line binarized data is generated. Next, interpolated binary data is generated (step S45). The interpolated binarized data is a difference between the data binarized in step S41 and the data obtained by restoring the resolution of the ruled line binarized data. In other words, interpolated binarized data is the data binarized in the ruled line binarized data from the data binarized in step S41. The interpolated binarized data remains at the same 600 dpi resolution as the image data, and includes only the ruled line portion that cannot be included in the low-resolution ruled line binarized data among the ruled lines included in the ruled line region. Then, the generated interpolated binary data is reversibly compressed (step S46). As a result, second compressed data obtained by reversibly compressing the interpolated binary data is generated.
図13は、罫線2値化データと補間2値化データの関係を示すさらに別の図である。図13(A)は、画像データの罫線部分を示す図であり、図13(B)は罫線2値化データを示し、図13(C)は、補間2値化データを示す。図13(A)を参照して、罫線2値化データは、画像データの解像度を縦横1/2に低解像度化したデータを2値化したデータである。画像データを低解像度化することにより画像データの罫線の一部が失われ、罫線の形状が変形していることがわかる。この罫線2値化データを復元しても、画像データに存在した罫線と同じ形状にはならない。図13(C)を参照して、補間2値化データは、罫線2値化データを生成するために画像データを低解像度化することにより画像データから失われた画素を「1」とし、他を「0」とするデータである。このため、罫線2値化データを復元したものと、補間2値化データを復元したものとを合成すれば、図13(A)に示した罫線の形状となることがわかる。このため、画像データの罫線領域を2値化したのと同じ結果が得られる。罫線2値化データは、解像度を縦横1/2に低解像度化しているのでデータ量が少なくなっている。このため、罫線2値化データと補間2値化データとは、画像データの罫線領域を2値化したものと比較して、データ量は少なくなる。 FIG. 13 is still another diagram showing the relationship between ruled line binarized data and interpolated binarized data. 13A shows a ruled line portion of image data, FIG. 13B shows ruled line binarized data, and FIG. 13C shows interpolated binarized data. Referring to FIG. 13A, ruled line binarized data is data obtained by binarizing data obtained by reducing the resolution of image data to 1/2 in the vertical and horizontal directions. It can be seen that by reducing the resolution of the image data, a part of the ruled line of the image data is lost and the shape of the ruled line is deformed. Even if the ruled line binarized data is restored, it does not have the same shape as the ruled line existing in the image data. Referring to FIG. 13C, the interpolated binarized data is set to “1” for pixels lost from the image data by reducing the resolution of the image data to generate ruled line binarized data. Is data in which “0” is set. For this reason, it can be understood that the ruled line shape shown in FIG. 13A is obtained by combining the restored ruled line binarized data and the interpolated binarized data. Therefore, the same result as that obtained by binarizing the ruled line area of the image data can be obtained. The ruled line binarized data has a reduced data amount because the resolution is reduced to 1/2 in the vertical and horizontal directions. For this reason, the data amount of the ruled line binarized data and the interpolated binarized data is smaller than the binarized ruled line area of the image data.
第2の実施の形態におけるMFP100によれば、RGB画像データ中の罫線領域から、色別に、罫線領域の画像データを低解像度化したデータを2値化した罫線2値化データと、罫線領域の画像データを2値化したデータから罫線データに含まれる罫線成分を除去した補間2値化データとに分割して圧縮する。罫線領域の画像データを低解像度化することによりデータ量が削減される。また、一方で罫線の形状のガタツキが目立つようになるが、補間2値化データにより罫線のガタツキが緩和される。補間2値化データは、罫線領域の画像データを2値化したデータから罫線データに含まれる罫線成分を除去したデータなので、データ量が削減される。このため、罫線領域の画像データを復元することができ、画像データを圧縮しても罫線のガタツキを目立たなくすることができる。
According to
なお、本実施の形態においては、画像処理装置の一例としてMFPを例に説明したが、MFPに限らず、画像データを処理可能な装置であればよく、たとえばコンピュータであってもよい。また、本実施の形態においては、MFPを例に説明したが、図6および図7に示した圧縮処理をコンピュータに実行させるための画像圧縮方法、および画像圧縮プログラムとして発明を捕らえることができるのは言うまでもない。 In the present embodiment, an MFP is described as an example of an image processing apparatus. However, the present invention is not limited to an MFP, and any apparatus capable of processing image data may be used. For example, a computer may be used. In the present embodiment, the MFP has been described as an example. However, the invention can be captured as an image compression method and an image compression program for causing a computer to execute the compression processing illustrated in FIGS. 6 and 7. Needless to say.
今回開示された実施の形態はすべての点で例示であって制限的なものではないと考えられるべきである。本発明の範囲は上記した説明ではなくて特許請求の範囲によって示され、特許請求の範囲と均等の意味および範囲内でのすべての変更が含まれることが意図される。 The embodiment disclosed this time should be considered as illustrative in all points and not restrictive. The scope of the present invention is defined by the terms of the claims, rather than the description above, and is intended to include any modifications within the scope and meaning equivalent to the terms of the claims.
<付記>
(1)前記第1圧縮手段は、可逆圧縮方式で圧縮する、請求項1に記載の画像処理装置。
(2)(1)において、前記第2圧縮手段は、非可逆圧縮方式で圧縮する。
(3) 前記入力手段は、原稿を読み取って得られる画像データを出力する読み取り手段を含む、請求項1に記載の画像処理装置。
<Appendix>
(1) The image processing apparatus according to (1), wherein the first compression unit compresses by a lossless compression method.
(2) In (1), the second compression means compresses by a lossy compression method.
(3) The image processing apparatus according to
10 前処理部、11 領域判別部、12 文字値化部、13,15 可逆圧縮部、14,14A 罫線2値化部、16 低解像度化部、17 非可逆圧縮部、18 結合部、21 第1の2値化部、22 第1罫線色決定部、23 第2の値化部、24 第2罫線色決定部、31 2値化部、32 解像度変換部、33 差分抽出部、34 罫線色決定部、102 記憶部、103 スキャナ部、104 入力画像処理部、105 出力画像処理部、106 画像形成部、107 ネットワークI/F、108 モデム、109 操作パネル、109A 入力部、109B 表示部、110 カードI/F、110A ICカード、111 バス、112 ネットワーク、113 電話回線。 10 Pre-processing unit, 11 Area discriminating unit, 12 Character value conversion unit, 13, 15 Lossless compression unit, 14, 14A Ruled line binarization unit, 16 Resolution reduction unit, 17 Lossless compression unit, 18 Joining unit, 21 1 binarization unit, 22 first ruled line color determination unit, 23 second binarization unit, 24 second ruled line color determination unit, 31 binarization unit, 32 resolution conversion unit, 33 difference extraction unit, 34 ruled line color Determination unit, 102 storage unit, 103 scanner unit, 104 input image processing unit, 105 output image processing unit, 106 image forming unit, 107 network I / F, 108 modem, 109 operation panel, 109A input unit, 109B display unit, 110 Card I / F, 110A IC card, 111 bus, 112 network, 113 telephone line.
Claims (11)
前記入力された画像データから罫線を含む罫線領域を抽出する罫線領域抽出手段と、
前記罫線領域の画像データから罫線の中心画素を少なくとも含む罫線データを生成する第1生成手段と、
前記罫線領域の画像データから前記罫線データを補間するための補間データを生成する第2生成手段と、
前記罫線データおよび前記補間データそれぞれを圧縮して第1および第2圧縮データを生成する第1圧縮手段と、
前記画像データから前記罫線領域を除いた領域を圧縮して第3圧縮データを生成する第2圧縮手段と、
前記第1圧縮データと、前記第2圧縮データと、前記第3圧縮データとを結合して結合データを生成する結合手段と、を備えた画像処理装置。 Input means for inputting image data;
Ruled line area extracting means for extracting ruled line areas including ruled lines from the input image data;
First generation means for generating ruled line data including at least a central pixel of the ruled line from the image data of the ruled line region;
Second generation means for generating interpolation data for interpolating the ruled line data from the image data of the ruled line region;
First compression means for compressing the ruled line data and the interpolation data to generate first and second compressed data;
Second compression means for compressing an area excluding the ruled line area from the image data to generate third compressed data;
An image processing apparatus comprising: a combining unit configured to combine the first compressed data, the second compressed data, and the third compressed data to generate combined data.
前記第2生成手段は、前記罫線領域の画像データに含まれる罫線を構成する画素のうちから明度が前記第1のしきい値を超える画素を抽出する第2抽出手段を含む、請求項1に記載の画像処理装置。 The first generation means includes first extraction means for extracting pixels whose brightness is equal to or less than a first threshold value from pixels constituting a ruled line included in the image data of the ruled line region,
The said 2nd production | generation means contains the 2nd extraction means which extracts the pixel in which the lightness exceeds the said 1st threshold value from the pixels which comprise the ruled line contained in the image data of the said ruled line area | region. The image processing apparatus described.
前記結合手段は、前記第1圧縮データと前記第1罫線色とを関連付ける罫線色関連付手段を含む、請求項3に記載の画像処理装置。 A first ruled line color determining means for determining a first ruled line color of a ruled line included in the ruled line data from the ruled line data and the image data;
The image processing apparatus according to claim 3, wherein the combining unit includes a ruled line color association unit that associates the first compressed data with the first ruled line color.
前記補間データと前記画像データとから前記補間データに含まれる第2罫線色を決定する第2罫線色決定手段とをさらに備え、
前記結合手段は、前記第1圧縮データと前記第1罫線色とを関連付け、前記第2圧縮データを前記第2罫線色と関連付ける罫線色関連付手段を含む、請求項5に記載の画像処理装置。 First ruled line color determining means for determining a first ruled line color of a ruled line included in the ruled line data from the ruled line data and the image data;
A second ruled line color determining means for determining a second ruled line color included in the interpolation data from the interpolation data and the image data;
The image processing apparatus according to claim 5, wherein the combining unit includes a ruled line color association unit that associates the first compressed data with the first ruled line color and associates the second compressed data with the second ruled line color. .
前記2値化されたデータを解像度の低い罫線データに変換する解像度変換手段とを含み、
前記第2生成手段は、前記罫線領域の画像データを2値化する2値化手段と、
前記2値化されたデータから前記罫線データに含まれる罫線成分を除去して補間データを生成する差分抽出手段とを含む、請求項1に記載の画像処理装置。 The first generation means includes binarization means for binarizing the image data of the ruled line area;
Resolution conversion means for converting the binarized data into ruled line data having a low resolution,
The second generation means includes binarization means for binarizing the image data of the ruled line area;
The image processing apparatus according to claim 1, further comprising: a difference extracting unit that generates interpolation data by removing ruled line components included in the ruled line data from the binarized data.
前記第1および第2生成手段それぞれは、前記複数の分割データが入力され、色相および彩度の組ごとに前記罫線データおよび前記補間データを抽出する、請求項1に記載の画像処理圧縮装置。 Further comprising a dividing unit that collects ruled lines whose hue and saturation sets are approximated from the image data of the ruled line areas, and divides the image data of the ruled line areas into sets of hues and saturations to generate a plurality of divided data;
2. The image processing compression apparatus according to claim 1, wherein each of the first and second generation units receives the plurality of divided data and extracts the ruled line data and the interpolation data for each set of hue and saturation.
前記入力された画像データから罫線を含む罫線領域を抽出するステップと、
前記罫線領域の画像データから罫線の中心画素を少なくとも含む罫線データを生成するステップと、
前記罫線領域の画像データから前記罫線データを補間するための補間データを生成するステップと、
前記罫線データおよび前記補間データそれぞれを圧縮して第1および第2圧縮データを生成するステップと、
前記画像データから前記罫線領域を除いた領域を圧縮して第3圧縮データを生成するステップと、
前記第1圧縮データと、前記第2圧縮データと、前記第3圧縮データとを結合して結合データを生成するステップとを含む、画像圧縮方法。 Inputting image data;
Extracting a ruled line area including a ruled line from the input image data;
Generating ruled line data including at least a central pixel of the ruled line from the image data of the ruled line region;
Generating interpolation data for interpolating the ruled line data from the image data of the ruled line region;
Compressing the ruled line data and the interpolation data, respectively, to generate first and second compressed data;
Compressing an area excluding the ruled line area from the image data to generate third compressed data;
An image compression method comprising: combining the first compressed data, the second compressed data, and the third compressed data to generate combined data.
前記入力された画像データから罫線を含む罫線領域を抽出するステップと、
前記罫線領域の画像データから罫線の中心画素を少なくとも含む罫線データを生成するステップと、
前記罫線領域の画像データから前記罫線データを補間するための補間データを生成するステップと、
前記罫線データおよび前記補間データそれぞれを圧縮して第1および第2圧縮データを生成するステップと、
前記画像データから前記罫線領域を除いた領域を圧縮して第3圧縮データを生成するステップと、
前記第1圧縮データと、前記第2圧縮データと、前記第3圧縮データとを結合して結合データを生成するステップとをコンピュータに実行させる、画像圧縮プログラム。 Inputting image data;
Extracting a ruled line area including a ruled line from the input image data;
Generating ruled line data including at least a central pixel of the ruled line from the image data of the ruled line region;
Generating interpolation data for interpolating the ruled line data from the image data of the ruled line region;
Compressing the ruled line data and the interpolation data, respectively, to generate first and second compressed data;
Compressing an area excluding the ruled line area from the image data to generate third compressed data;
An image compression program that causes a computer to execute a step of combining the first compressed data, the second compressed data, and the third compressed data to generate combined data.
画像データに含まれる罫線領域から前記罫線データを補間するための補間データを生成し、該補間データを圧縮した第2の圧縮データと、
前記画像データから前記罫線領域を除いた領域を圧縮した第3圧縮データとを含む、圧縮画像のデータ構造。 First compressed data obtained by extracting a center pixel of a ruled line from a ruled line region included in image data and compressing ruled line data including at least the center pixel;
Generating interpolated data for interpolating the ruled line data from the ruled line area included in the image data, and second compressed data obtained by compressing the interpolated data;
A compressed image data structure including third compressed data obtained by compressing an area obtained by removing the ruled line area from the image data.
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP2005196908A JP2007019673A (en) | 2005-07-05 | 2005-07-05 | Image processing apparatus, image compression method, image compression program, and data structure of compressed image |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP2005196908A JP2007019673A (en) | 2005-07-05 | 2005-07-05 | Image processing apparatus, image compression method, image compression program, and data structure of compressed image |
Publications (1)
| Publication Number | Publication Date |
|---|---|
| JP2007019673A true JP2007019673A (en) | 2007-01-25 |
Family
ID=37756463
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| JP2005196908A Pending JP2007019673A (en) | 2005-07-05 | 2005-07-05 | Image processing apparatus, image compression method, image compression program, and data structure of compressed image |
Country Status (1)
| Country | Link |
|---|---|
| JP (1) | JP2007019673A (en) |
Cited By (5)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| JP2009105768A (en) * | 2007-10-24 | 2009-05-14 | Fujitsu Ltd | Image processing program, image processing apparatus, and image processing method |
| JP2010074376A (en) * | 2008-09-17 | 2010-04-02 | Ricoh Co Ltd | Image coding device |
| JP2010527190A (en) * | 2007-05-04 | 2010-08-05 | イー・エル・イー・エス・ソシエテ・アノニム | Compress digital images containing scanned documents |
| JP2011009924A (en) * | 2009-06-24 | 2011-01-13 | Canon Inc | Image processing apparatus, image processing method, and computer program |
| JP2011010023A (en) * | 2009-06-25 | 2011-01-13 | Sharp Corp | Image compressing apparatus, image compressing method, image decompressing apparatus, image decompressing method, image forming apparatus, computer program and recording medium |
-
2005
- 2005-07-05 JP JP2005196908A patent/JP2007019673A/en active Pending
Cited By (8)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| JP2010527190A (en) * | 2007-05-04 | 2010-08-05 | イー・エル・イー・エス・ソシエテ・アノニム | Compress digital images containing scanned documents |
| US8666185B2 (en) | 2007-05-04 | 2014-03-04 | I.R.I.S. | Compression of digital images of scanned documents |
| US8995780B2 (en) | 2007-05-04 | 2015-03-31 | I.R.I.S. | Compression of digital images of scanned documents |
| JP2009105768A (en) * | 2007-10-24 | 2009-05-14 | Fujitsu Ltd | Image processing program, image processing apparatus, and image processing method |
| JP2010074376A (en) * | 2008-09-17 | 2010-04-02 | Ricoh Co Ltd | Image coding device |
| JP2011009924A (en) * | 2009-06-24 | 2011-01-13 | Canon Inc | Image processing apparatus, image processing method, and computer program |
| US8532385B2 (en) | 2009-06-24 | 2013-09-10 | Canon Kabushiki Kaisha | Image processing apparatus and image processing method |
| JP2011010023A (en) * | 2009-06-25 | 2011-01-13 | Sharp Corp | Image compressing apparatus, image compressing method, image decompressing apparatus, image decompressing method, image forming apparatus, computer program and recording medium |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| JP5875637B2 (en) | Image processing apparatus and image processing method | |
| JP5132530B2 (en) | Image coding apparatus, image processing apparatus, and control method thereof | |
| JP4333708B2 (en) | Method, apparatus, and computer program for processing input data related to generation of electronic file | |
| US7321688B2 (en) | Image processor for character recognition | |
| JP2013054601A (en) | Image processing device and image processing program | |
| JP6743092B2 (en) | Image processing apparatus, image processing control method, and program | |
| JP4135752B2 (en) | Image processing apparatus, image processing method, and image processing program | |
| US7660014B2 (en) | Image processing apparatus capable of extracting rule from document image with high precision | |
| JP6607490B2 (en) | CONVERSION PROCESSING DEVICE, INFORMATION PROCESSING DEVICE EQUIPPED WITH THE SAME, PROGRAM, AND RECORDING MEDIUM | |
| JP4383157B2 (en) | Image processing apparatus, program, and storage medium | |
| JP4861362B2 (en) | Image processing apparatus, image processing method, and image processing program | |
| RU2737001C1 (en) | Image processing device and method and data medium | |
| JP2008099149A (en) | Image processor, image processing method and image processing program | |
| JP6197840B2 (en) | Image processing apparatus, electronic file generation method, and program | |
| US8577132B2 (en) | Electronic document generation system, electronic document generation method, and program | |
| JP2009141597A (en) | Image processing apparatus, character region specification method, and character region specification program | |
| JP2007019673A (en) | Image processing apparatus, image compression method, image compression program, and data structure of compressed image | |
| US10931852B2 (en) | Image processing apparatus, image processing method, and storage medium, with determining whether or not character clipping rectangle determined to be non-character region is character region | |
| JP4396710B2 (en) | Image processing apparatus, image processing apparatus control method, and image processing apparatus control program | |
| JP3910120B2 (en) | Image processing apparatus, method, program for executing the method, and recording medium | |
| JP2003219187A (en) | Image processing method and image processing apparatus | |
| US11288536B2 (en) | Image processing apparatus, image processing method, and non-transitory computer-readable storage medium | |
| US20080043269A1 (en) | Method and apparatus for processing image containing picture and characters | |
| JP5517028B2 (en) | Image processing device | |
| US8553294B2 (en) | Outlining method for properly representing curved line and straight line, and image compression method using the same |