JP2010057080A - Image processor, image processing method and image processing program - Google Patents
Image processor, image processing method and image processing program Download PDFInfo
- Publication number
- JP2010057080A JP2010057080A JP2008221956A JP2008221956A JP2010057080A JP 2010057080 A JP2010057080 A JP 2010057080A JP 2008221956 A JP2008221956 A JP 2008221956A JP 2008221956 A JP2008221956 A JP 2008221956A JP 2010057080 A JP2010057080 A JP 2010057080A
- Authority
- JP
- Japan
- Prior art keywords
- gradation
- gradation value
- image
- value
- block
- 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
Landscapes
- Editing Of Facsimile Originals (AREA)
- Image Processing (AREA)
Abstract
Description
本発明は、画像処理装置、画像処理方法および画像処理プログラムに関し、特に、画像圧縮処理を行う画像処理装置、画像処理方法および画像処理プログラムに関する。 The present invention relates to an image processing device, an image processing method, and an image processing program, and more particularly to an image processing device, an image processing method, and an image processing program that perform image compression processing.
従来、撮像装置や画像取込装置等を用いて作成した大きなデータサイズの画像を小さなデータサイズの画像に変換(圧縮)する画像圧縮技術が利用されている。画像圧縮技術を利用することで、画像の保存領域の節約やデータ伝送における送信遅延の低減等を図ることができる。 2. Description of the Related Art Conventionally, an image compression technique for converting (compressing) an image having a large data size created using an imaging device, an image capturing device, or the like into an image having a small data size has been used. By using the image compression technique, it is possible to save an image storage area and reduce transmission delay in data transmission.
ところで、画像取込装置で読み取る原稿や帳票等の紙面には、下地が含まれるものも存在する。例えば、紙媒体で発行される各種帳票や公的な証明書等には、不正な複製・改ざん防止のために地紋が含まれるものがある。地紋は通常、利用者によって記入される、あるいは印刷されている文字よりも薄い色によって描かれている。 By the way, some papers such as documents and forms read by the image capturing device include a background. For example, various forms and public certificates issued on paper media include a background pattern to prevent unauthorized duplication / tampering. The tint block is usually drawn in a lighter color than characters that are entered or printed by the user.
ここで、下地を含む帳票を読み取って画像化すると、下地に重なる文字や図柄が元の紙面よりも見難くなる場合がある。特に、公的な証明書等では、画像として保存する場合、所定の視認性(画像に含まれる文字等の見易さ)が保持されることとする旨の規定が設けられているものもある。 Here, when a form including a background is read and converted into an image, characters and designs overlapping the background may be harder to see than the original paper surface. In particular, some official certificates have a provision that a predetermined visibility (ease of seeing characters or the like included in an image) is maintained when saved as an image. .
このような課題に対し、地紋を含む画像に関して、その不正防止の効果を保持しつつ文字等の視認性を向上する方法が知られている(例えば、特許文献1参照)。
また、地紋を含む画像の圧縮を行う際に、不正防止の効果を保持しつつ画像圧縮を行う方法も知られている(例えば、特許文献2参照)。
In addition, a method of performing image compression while retaining the effect of preventing fraud when compressing an image including a background pattern is also known (see, for example, Patent Document 2).
しかし、上記特許文献1に記載の方法では、取込画像の視認性は向上するが圧縮は行われないため、画像のデータサイズが大きいという問題がある。
一方、上記特許文献2に記載の方法では、圧縮は行われるが視認性が保証されないという問題がある。例えば、高い圧縮率を実現する圧縮方法としてJPEG(Joint Photographic Experts Group)圧縮が知られているが、JPEG圧縮では圧縮率を高めると文字や図柄にブロックノイズが生じて見難くなってしまう。また、他の圧縮方法として、画像の色を白黒に限定(2値化)する方法が考えられる。2値化は、圧縮率は非常に高いが下地と重なる文字や図柄が一体となってしまい見難くなってしまう。
However, the method described in
On the other hand, the method described in
すなわち、文字を含む画像の圧縮では、文字の視認性と画像圧縮率の両立が望まれる。
本発明はこのような点に鑑みてなされたものであり、文字の視認性を保って画像圧縮を行うことが可能な画像処理装置、画像処理方法および画像処理プログラムを提供することを目的とする。
That is, in compression of an image including characters, it is desired that both the character visibility and the image compression rate are compatible.
SUMMARY An advantage of some aspects of the invention is that it provides an image processing apparatus, an image processing method, and an image processing program capable of performing image compression while maintaining character visibility. .
上記課題を解決するために、入力画像のデータ量を圧縮する画像処理装置が提供される。この画像圧縮装置は、ブロック抽出手段、階調変換手段および解像度変換手段を有する。ブロック抽出手段は、入力画像から1つ以上の文字の全体または一部を含む領域であるブロックを抽出する。階調変換手段は、入力画像の階調数を削減した階調変換画像を生成する。階調変換手段は、入力画像のデータを基に、入力画像の総階調数の中から第1の階調値と、それより大きい第2の階調値とを設定し、入力画像に含まれる各画素の階調値のうち、第1の階調値よりも小さい階調値を、階調変換画像における最小階調値に変換し、第2の階調値よりも大きい階調値を、階調変換画像における最大階調値に変換し、第1の階調値以上で第2の階調値以下の範囲に含まれる階調値をこの範囲の階調数が現階調数よりも少なくなるように変換して、階調変換画像を生成する。解像度変換手段は、ブロック抽出手段が抽出したブロックの縦方向および横方向の画素数が所定の最小画素数より少なくならない範囲で、階調変換画像の解像度を低解像度に変換する。 In order to solve the above problems, an image processing apparatus that compresses the data amount of an input image is provided. This image compression apparatus has block extraction means, gradation conversion means, and resolution conversion means. The block extraction means extracts a block that is an area including all or part of one or more characters from the input image. The gradation converting means generates a gradation converted image in which the number of gradations of the input image is reduced. The gradation converting means sets a first gradation value and a second gradation value larger than the total gradation number of the input image based on the input image data, and includes them in the input image. Of the gradation values of each pixel, a gradation value smaller than the first gradation value is converted into a minimum gradation value in the gradation converted image, and a gradation value larger than the second gradation value is obtained. The tone value is converted into the maximum tone value in the tone conversion image, and the tone value included in the range not less than the first tone value and not more than the second tone value is set so that the tone number in this range is greater than the current tone number. The tone conversion image is generated by converting the image so as to reduce the image. The resolution conversion unit converts the resolution of the gradation-converted image to a low resolution within a range in which the number of vertical and horizontal pixels of the block extracted by the block extraction unit is not less than a predetermined minimum number of pixels.
このような画像処理装置によれば、ブロック抽出手段により、入力画像から1つ以上の文字の全体または一部を含む領域であるブロックが抽出される。次に、階調変換手段により、入力画像のデータを基に、入力画像の総階調数の中から第1の階調値と、それより大きい第2の階調値とが設定され、入力画像に含まれる各画素の階調値のうち、第1の階調値よりも小さい階調値が階調変換後の最小階調値に変換され、第2の階調値よりも大きい階調値が階調変換後の最大階調値に変換され、第1の階調値以上で第2の階調値以下の範囲に含まれる階調値がこの範囲の階調数が現階調数よりも少なくなるように変換して、階調変換画像が生成される。そして、解像度変換手段により、ブロック抽出手段が抽出したブロックの縦方向および横方向の画素数が所定の最小画素数より少なくならない範囲で、階調変換画像の解像度が低解像度に変換される。 According to such an image processing apparatus, the block extraction unit extracts a block that is an area including all or part of one or more characters from the input image. Next, based on the input image data, the gradation conversion means sets the first gradation value and the second gradation value larger than the first gradation value from the total number of gradations of the input image. Of the gradation values of each pixel included in the image, a gradation value smaller than the first gradation value is converted to the minimum gradation value after gradation conversion, and the gradation value is larger than the second gradation value. The value is converted to the maximum gradation value after gradation conversion, and the gradation number included in the range of the first gradation value and the second gradation value is the number of gradations in this range. The tone conversion image is generated by converting the image so as to be less. Then, the resolution conversion means converts the resolution of the gradation-converted image to a low resolution within a range in which the number of pixels in the vertical and horizontal directions of the block extracted by the block extraction means is not less than a predetermined minimum number of pixels.
また、上記課題を解決するために、上記画像処理装置と同様の処理を行う画像処理方法が提供される。
また、上記課題を解決するために、上記画像処理装置と同様の処理をコンピュータに実行させる画像処理プログラムが提供される。
In order to solve the above problems, an image processing method for performing the same processing as that of the image processing apparatus is provided.
In order to solve the above problem, an image processing program for causing a computer to execute the same processing as that of the image processing apparatus is provided.
本発明の画像処理装置、画像処理方法および画像処理プログラムによれば、視認性を保って画像圧縮を行うことができる。 According to the image processing apparatus, the image processing method, and the image processing program of the present invention, it is possible to perform image compression while maintaining visibility.
以下、本実施の形態を図面を参照して詳細に説明する。
図1は、実施の形態の概要を示す図である。画像処理装置1は、入力画像P1を圧縮処理する。入力画像P1は、地紋等の下地をもつ帳票や証明書等の紙媒体を読み取ったものであり、図示しない画像取込装置等から画像処理装置1に入力される。この紙媒体には、例えば人手により文字も描かれており、画像処理装置1は、読み取った画像を文字が視認しやすくなるように変換すると共に、そのデータ量を削減する処理を実行する。この画像処理装置1は、階調変更手段1aブロック抽出手段1b、階調変換手段1c、解像度変換手段1dおよび圧縮符号化手段1eを有する。
Hereinafter, the present embodiment will be described in detail with reference to the drawings.
FIG. 1 is a diagram showing an outline of the embodiment. The
階調変更手段1aは、入力画像P1に含まれる各画素の階調値のうち、所定の階調値L3よりも大きな階調値を最大階調値に対応付けた変換画像を生成する。ここで、色の階調は、色の濃淡を示す数値(階調値)によって表される。階調値は、各画素に対する信号レベル値に対応しており、値が大きいほど明るく(淡い)、値が小さいほど暗い(濃い)。階調値の最大値は、白色に相当し、階調値の最小値は、黒色に相当する。 The gradation changing unit 1a generates a converted image in which a gradation value larger than a predetermined gradation value L3 among the gradation values of each pixel included in the input image P1 is associated with the maximum gradation value. Here, the color gradation is represented by a numerical value (gradation value) indicating the density of the color. The gradation value corresponds to the signal level value for each pixel. The larger the value, the brighter (lighter), and the smaller the value, the darker (darker). The maximum gradation value corresponds to white, and the minimum gradation value corresponds to black.
また、階調値L3には、下地が消えない適切な値が予め設定される。
ブロック抽出手段1bは、階調変更手段1aが生成した変換画像から1つ以上の文字の全体または一部を含むブロックを抽出する。抽出されたブロックは、階調変換手段1cの処理の閾値の決定や解像度変換手段1dによる解像度低下の度合いを求めるために用いられる。
The gradation value L3 is set in advance to an appropriate value that prevents the background from disappearing.
The block extracting unit 1b extracts a block including all or part of one or more characters from the converted image generated by the gradation changing unit 1a. The extracted block is used to determine the threshold of processing of the
階調変換手段1cは、階調変更手段1aが生成した変換画像に含まれる階調数を削減して階調変換画像を生成する。階調変換手段1cは、各画素の階調値のうち、階調値L3より小さい階調値L1よりも小さい階調値を階調変換画像における最小階調値に変換する。ここで、階調値L1は、特許請求の範囲における第1の階調値に対応する。
The
また、階調値L1より大きく階調値L3より小さい階調値L2よりも大きい階調値を階調変換画像における最大階調値に変換する。ここで、階調値L2は、特許請求の範囲における第2の階調値に対応する。 Also, a gradation value larger than the gradation value L2 that is larger than the gradation value L1 and smaller than the gradation value L3 is converted into the maximum gradation value in the gradation conversion image. Here, the gradation value L2 corresponds to the second gradation value in the claims.
そして、階調値L1以上で階調値L2以下の範囲に含まれる階調値をこの範囲の階調数が現階調数よりも少なくなるように変換する。階調変換手段1cは、これらの処理の結果、階調変換画像を生成する。 Then, the gradation values included in the range from the gradation value L1 to the gradation value L2 are converted so that the number of gradations in this range is smaller than the current number of gradations. The gradation converting means 1c generates a gradation converted image as a result of these processes.
なお、階調変換手段1cは、例えば、上記の階調変換処理を、ブロック抽出手段1bが抽出したブロック毎に実行する。この場合、階調値L1,L2を、ブロック毎の階調値の頻度を示すヒストグラムに基づき、適正な値をブロック毎の階調変換処理のたびに決定することができる。また、例えば、上記の階調変換処理を変換画像全体に対して施してもよい。この場合、階調値L1,L2を、変換画像全体に含まれる階調値の頻度を示すヒストグラムに基づいて決定することもできる。
Note that the
解像度変換手段1dは、ブロック抽出手段1bが抽出したブロックに基づいて現解像度よりも低い変換後解像度を決定する。変換後解像度は、例えば、抽出されたブロックのうち最小のブロックに含まれる文字が所定の視認性を満たすような解像度として決定される。階調変換手段1cが生成した階調変換画像を変換後解像度に変換した解像度変換画像を生成する。
The
圧縮符号化手段1eは、解像度変換手段1dが生成した解像度変換画像に、所定の画像圧縮符号化方式に従った圧縮符号化処理を施して圧縮画像データを生成する。
このような画像処理装置1によれば、入力画像P1の階調値L1より小さい領域の階調値が解像度変換後の最小階調値に変換され、階調値L2より大きい領域の階調値が解像度変換後の最大階調値に変換される。また、階調値L1以上で階調値L2以下の範囲にある階調数が現階調数よりも小さくなるように各画素の階調値が変換される。その後、所定の圧縮方法により圧縮処理が行われ出力画像P2が出力される。これにより、下地および下地と重なる文字の階調差を際立たせることができる。また、画像全体の階調数や解像度が削減され、所定の圧縮処理によりデータ量が削減される。
The
According to such an
これにより、文字の視認性を保持しつつデータサイズを小さく圧縮することが可能となる。
[第1の実施の形態]
以下、第1の実施の形態を図面を参照して詳細に説明する。
As a result, the data size can be reduced while maintaining the visibility of the characters.
[First Embodiment]
Hereinafter, a first embodiment will be described in detail with reference to the drawings.
図2は、第1の実施の形態の画像処理装置のハードウェア構成を示す図である。画像処理装置100は、地紋を含む帳票等の紙媒体を読み込んだ画像を圧縮処理する。
画像処理装置100は、CPU(Central Processing Unit)101によって装置全体が制御されている。CPU101には、バス108を介してRAM(Random Access Memory)102、HDD(Hard Disk Drive)103、グラフィック処理装置104、入力インタフェース105,106および通信インタフェース107が接続されている。
FIG. 2 is a diagram illustrating a hardware configuration of the image processing apparatus according to the first embodiment. The
The entire
RAM102には、CPU101に実行させるOS(Operating System)のプログラムやアプリケーションソフトのプログラムの少なくとも一部が一時的に格納される。また、RAM102には、CPU101による処理に必要な各種データが格納される。
The
HDD103は、データを記憶するためのディスク装置である。HDD103には、OSのプログラムやアプリケーションソフトのプログラムが格納される。また、HDD103には、CPU101による処理に必要な各種データが格納される。
The
グラフィック処理装置104には、モニタ11が接続されている。グラフィック処理装置104は、CPU101からの命令に従って、画像をモニタ11の画面に表示させる。
入力インタフェース105,106は、外部装置からのデータの入力を受け付けるインタフェースである。
A monitor 11 is connected to the
The input interfaces 105 and 106 are interfaces that accept data input from external devices.
入力インタフェース105には、キーボード12とマウス13とが接続されている。入力インタフェース105は、キーボード12やマウス13から送られてくる信号を、バス108を介してCPU101に送信する。
A
入力インタフェース106には、スキャナ14が接続されている。入力インタフェース106は、スキャナ14から送られてくる所定の帳票の画像情報に対応する信号をバス108を介してCPU101に送信する。また、入力インタフェース106は、入力インタフェース106の有するDMA(Direct Memory Access)機能により、取得する画像情報をバス108を介して直接RAM102に格納することもできる。
A
通信インタフェース107は、ネットワーク10に接続されている。通信インタフェース107は、ネットワーク10を介して、他の情報処理装置との間でデータの送受信を行う。
The
図3は、第1の実施の形態の画像処理装置の機能を示すブロック図である。画像処理装置100は、管理情報記憶部110、入力部120、階調変更部130、ブロック抽出部140、階調変換部150、解像度変換部160および圧縮符号化部170を有する。これらの機能は、CPU101により所定のプログラムが実行されることで実現される。なお、これらの機能の少なくとも一部は、専用のハードウェア回路によって実現されてもよい。
FIG. 3 is a block diagram illustrating functions of the image processing apparatus according to the first embodiment. The
管理情報記憶部110は、階調変更部130、階調変換部150および解像度変換部160の処理に必要なパラメータを記憶する。
入力部120は、スキャナ14から取得する画像を階調変更部130に出力する。なお、入力画像の各画素が取り得る圧縮前の階調数は、“0〜255”の256段階であるものとする。
The management
The
階調変更部130は、入力部120から取得する入力画像に含まれる各画素の階調値のうち、階調変更の閾値となる階調値L3以上の階調値を、白色を示す最大階調値“255”に変換する。階調値L3は、地紋が消えない適切な階調値(すなわち、地紋よりも小さい階調値)として管理情報記憶部110に予め設定される。階調変更部130は、この処理により生成される変換画像をブロック抽出部140に出力する。
The
ブロック抽出部140は、階調変更部130から取得する変換画像に含まれる1つ以上の文字の全体または一部を含むブロックを抽出する。ブロック抽出部140は、所定の値以下の階調値を有する画素が(縦および横に)所定の長さだけ連続する領域を、文字または文字の一部であると認識して抽出することができる。
The
このようにすると、例えば、2つの別の文字であっても、その間が地紋により連続している場合には、1つのブロックとして抽出する。ただし、抽出されたブロックのサイズが大きくなり過ぎないようにするため、ブロックの縦または横のサイズ(画素数)には上限を設ける。また、文字の全体または一部として認識するための最低限の大きさを保証するため、ブロックとして認識する最小のサイズ(画素数)も設ける。 In this way, for example, even two different characters are extracted as one block if the space between them is continuous due to the background pattern. However, in order to prevent the size of the extracted block from becoming too large, an upper limit is set for the vertical or horizontal size (number of pixels) of the block. Further, in order to guarantee a minimum size for recognizing all or part of a character, a minimum size (number of pixels) recognized as a block is also provided.
そして、ブロック抽出部140は、抽出したブロックを示す位置情報を階調変換部150に出力する。
階調変換部150は、ブロック抽出部140により抽出されたブロック単位に階調変換を行う。階調変換後の階調数は、管理情報記憶部110に予め設定される。階調変換部150は、管理情報記憶部110を参照して階調変換後の階調数を取得する。
Then, the
The
階調変換部150は、元の画像の階調数を小さな階調数に変換する。階調変換部150は、このために、まず取得したブロックの各画素の階調値の頻度を示すヒストグラムを生成する。階調変換部150は、このヒストグラムに基づいて、中間階調の階調値範囲を決定する。この階調値範囲の下限を階調値L1、上限を階調値L2とする。
The
階調値L1,L2は、ヒストグラム上のピークから求めることができる。例えば、階調値L1は、文字を構成する画素が有する階調値を示すピークに基づいて求めることができる。また、階調値L2は、地紋を構成する画素が有する階調値を示すピークに基づいて求めることができる。なお、ブロックに地紋が含まれない場合、階調値L2は、例えば階調値L1に所定の数値を加えた値として求めることができる。 The gradation values L1 and L2 can be obtained from the peaks on the histogram. For example, the gradation value L1 can be obtained based on a peak indicating a gradation value possessed by a pixel constituting a character. Further, the gradation value L2 can be obtained based on a peak indicating a gradation value possessed by a pixel constituting the background pattern. If the block pattern is not included in the block, the gradation value L2 can be obtained as a value obtained by adding a predetermined numerical value to the gradation value L1, for example.
そして、階調変換部150は、階調値L1よりも小さい階調値を階調変換後の最小階調値に変換する。また、階調値L2よりも大きい階調値を階調変換後の最大階調値に変換する。
Then, the
更に、階調変換部150は、階調値L1以上L2以下の範囲に含まれる階調数を目的の階調数となるように階調変換する。
階調変換部150は、階調数の削減処理により生成した階調変換画像を解像度変換部160に出力する。
Further, the
The
解像度変換部160は、ブロック抽出部140により抽出されたブロックに基づいて現解像度よりも低い変換後解像度を決定する。解像度変換部160は、変換後解像度を抽出されたブロックのうち最小のブロックに含まれる文字が所定の視認性を満たすような解像度として決定する。解像度変換部160は、階調変換部150から取得する階調変換画像を変換後解像度に変換して解像度変換画像を生成し、圧縮符号化部170に出力する。
The
圧縮符号化部170は、解像度変換部160から取得する解像度変換画像に画像圧縮を施す。圧縮符号化部170は、例えば、解像度変換画像に対してPNG(Portable Network Graphics)圧縮を施してPNG形式の圧縮画像データを生成する。
The
図4は、第1の実施の形態のパラメータ管理テーブルのデータ構造例を示す図である。パラメータ管理テーブル111は、RAM102またはHDD103に設けられた管理情報記憶部110に記憶される。パラメータ管理テーブル111には、属性を示す項目および設定値を示す項目が設けられている。各項目の横方向に関連付けられた情報同士が1つの圧縮パラメータに関する情報を構成する。
FIG. 4 is a diagram illustrating a data structure example of the parameter management table according to the first embodiment. The parameter management table 111 is stored in the management
パラメータ管理テーブル111には、以下の情報が設定される。
第1の情報として、属性が“階調変更閾値”、その設定値が“170”という情報が設定される。これは、階調変更部130による階調変更の閾値となる階調値L3が“170”であり、この値よりも大きい階調値は、最大階調値255に変換されることを示している。
The following information is set in the parameter management table 111.
As the first information, information that the attribute is “tone change threshold” and the setting value is “170” is set. This indicates that the gradation value L3 serving as a threshold for gradation change by the
第2の情報として、属性が“階調数”、その設定値が“8”という情報が設定される。これは、256階調を階調変換部150による階調変換処理により8階調まで削減することを示している。すなわち、階調変換処理後の最小階調値は、0であり、階調変換処理後の最大階調値は7となる。
As the second information, information that the attribute is “the number of gradations” and the setting value is “8” is set. This indicates that 256 gradations are reduced to 8 gradations by gradation conversion processing by the
第3の情報として、属性が“文字ピーク上限階調値”、その設定値が“50”という情報が設定される。文字ピーク上限階調値は、階調変換部150による階調変換処理における階調値L1の上限を示している。すなわち、階調変換部150は、ヒストグラムの階調値“50”以下の領域でピーク(文字を構成するピーク)を検出する場合には、そのピークに対応する階調値をL1とするが、階調値“50”以下の領域でピークを検出しない場合には、階調値L1=50を設定する。文字ピーク上限階調値は、特許請求の範囲における第1の限界階調値に対応する。
As the third information, information that the attribute is “character peak upper limit gradation value” and the setting value is “50” is set. The character peak upper limit gradation value indicates the upper limit of the gradation value L1 in the gradation conversion processing by the
第4の情報として、属性が“地紋ピーク下限階調値”、その設定値が“150”という情報が設定される。地紋ピーク下限階調値は、階調変換部150による階調変換処理において、ヒストグラムの地紋を構成するピークに対応する階調値の下限を示している。すなわち、階調変換部150は、ヒストグラムの階調値“150”以上の領域でピーク(地紋を構成するピーク)を検出する場合には、そのピークに対応する階調値に基づいて階調値L2を決定するが、階調値“150”以上の領域でピークを検出しない場合には、下限階調値“150”以上の所定の値を階調値L2として決定する。地紋ピーク下限階調値は、特許請求の範囲における第2の限界階調値に対応する。
As the fourth information, information having an attribute “background pattern peak lower limit gradation value” and a setting value “150” is set. The background pattern peak lower limit gradation value indicates the lower limit of the gradation value corresponding to the peak constituting the background pattern of the histogram in the gradation conversion processing by the
第5の情報として、属性が“ブロック最小縦画素数”、その設定値が“10”という情報が設定される。これは、入力画像に含まれる文字を表す画素数を削減して見読可能とすることができる縦の画素数の最小値を示している。また、この値は、ブロック抽出部140が抽出するブロックの縦の画素数の下限も示している。なお、最小画素数としては、ブロックの縦方向に限らず横方向の画素数、またはそれらの両方として設定してもよい。また、最小ブロックに含まれる画素数の合計により設定してもよい。
As the fifth information, information that the attribute is “the minimum number of vertical pixels in the block” and the setting value is “10” is set. This indicates the minimum value of the number of vertical pixels that can be read by reducing the number of pixels representing characters included in the input image. This value also indicates the lower limit of the number of vertical pixels of the block extracted by the
第6の情報として、属性が“圧縮後目標サイズ”、その設定値が“1MB(Mega Byte)”という情報が設定される。これは、圧縮符号化部170が生成する圧縮画像の最低サイズを1MBとすることを示している。この“圧縮後目標サイズ”の設定により、圧縮画像データに基づく再生画像のサイズを一定のサイズに近付けることができる。
As the sixth information, information having an attribute “target size after compression” and a setting value “1 MB (Mega Byte)” is set. This indicates that the minimum size of the compressed image generated by the
なお、パラメータ管理テーブル111には、これらの情報の他にもブロックとして認識する最大サイズ(最大画素数)等の情報も設定される。
パラメータ管理テーブル111には、元の画像の処理を行う前に、それぞれのパラメータについて最適な値が予め設定される。
In addition to these pieces of information, information such as the maximum size (maximum number of pixels) recognized as a block is set in the parameter management table 111.
In the parameter management table 111, optimum values for the respective parameters are set in advance before processing the original image.
次に、以上のような構成を備える画像処理装置100において実行される処理の詳細を説明する。
図5は、第1の実施の形態の画像圧縮処理の手順を示すフローチャートである。以下、図5に示す処理をステップ番号に沿って説明する。
Next, details of processing executed in the
FIG. 5 is a flowchart illustrating a procedure of image compression processing according to the first embodiment. Hereinafter, the process illustrated in FIG. 5 will be described in order of step number.
[ステップS11]階調変更部130は、入力部120から取得する入力画像に含まれる各画素の階調値のうち、パラメータ管理テーブル111に記憶された階調変更閾値である階調値L3(=“170”)以上の階調値を最大階調値“255”に変換する。なお、この処理での変換後の値は必ずしも255に限らず、階調値L3以上の階調値はL3以上255以下の所定の値に変換されればよい。そして、階調変更部130は、この階調変更処理により生成した変換画像をブロック抽出部140に出力する。
[Step S <b> 11] The
[ステップS12]ブロック抽出部140は、階調変更部130から取得する変換画像から1つ以上の文字の全体または一部を含むブロックを抽出する。そして、ブロック抽出部140は、抽出した複数のブロックを階調変換部150に出力する。
[Step S12] The
[ステップS13]階調変換部150は、ブロック抽出部140から取得する複数のブロックから1つを選択して、そのブロックに含まれる各画素の階調値の頻度を示すヒストグラムを生成する。
[Step S13] The
[ステップS14]階調変換部150は、生成したヒストグラムのピークに基づいて、中間階調の階調値範囲を決める下限の階調値L1および上限の階調値L2を求める。階調変換部150は、階調値L1をブロックに含まれる文字のピークの階調値とする。文字のピークは、濃い色を示す小さな階調値のピークとして識別することができる。また、階調値L2を地紋のピークに基づいて算出する。地紋のピークは、文字より淡い色を示すより大きな階調値のピークとして識別することができる。
[Step S14] The
[ステップS15]階調変換部150は、ブロックの各画素に関し、ステップS14で求めた階調値L1よりも小さい階調値を階調変換後の階調値“0”に、階調値L2よりも大きい階調値を階調変換後の最大階調値“7”に、それぞれ変換する。そして、階調変換部150は、パラメータ管理テーブル111に記憶された階調数“8”に基づき、階調値L1以上L2以下の階調範囲を階調値“1〜6”の計6階調に変換する。
[Step S15] For each pixel of the block, the
[ステップS16]階調変換部150は、ブロック抽出部140から取得した全てのブロックについて階調削減処理を行ったか否かを判定する。全ブロックに対して処理済みの場合、処理がステップS17に移される。全ブロックに対して処理済みでない場合、未処理ブロックを次の処理対象として抽出して、処理がステップS13に移される。
[Step S <b> 16] The
[ステップS17]階調変換部150は、ブロック抽出部140によりブロックとして抽出されなかった残りの領域に対する階調削減処理を行う。階調変換部150は、残り領域に関して、例えば、ステップS14により求められた各ブロックの階調値L1のうち最も小さい値と、階調値L2のうち最も大きい値を用いて残り領域全てをステップS15と同様の処理により一律に階調削減を行う。そして、階調変換部150は、階調削減処理により生成した階調変換画像を解像度変換部160に出力する。なお、このステップS17では、残りの領域に適用する階調値L1,L2を、予め決められた値としてもよい。
[Step S <b> 17] The
[ステップS18]解像度変換部160は、ブロック抽出部140が抽出したブロックのうち、最小のブロックの縦画素数fを取得する。解像度変換部160は、この縦画素数fとパラメータ管理テーブル111に記憶されたブロック最小縦画素数“10”を用いて、解像度の縮小率p=10/fを算出する。
[Step S18] The
[ステップS19]解像度変換部160は、階調変換部150から取得した階調変換画像をステップS18で算出した縮小率で解像度変換して解像度変換画像を生成し、圧縮符号化部170に出力する。本例では、縦方向の画素数の縮小率を求めているが、横方向に関しても同じ縮小率で圧縮を行う。すなわち、画像全体の画素数は、p2=102/f2に削減される。なお、縮小率p=1である場合には、解像度変換は行われない。
[Step S19] The
[ステップS20]圧縮符号化部170は、解像度変換部160から取得した解像度変換画像に対してPNG圧縮を施して圧縮画像データを生成する。
[ステップS21]圧縮符号化部170は、PNG圧縮により生成した圧縮画像データのサイズが適切であるか否かを判定する。圧縮画像データのサイズがパラメータ管理テーブル111に記憶された圧縮後目標サイズ“1MB”以上である場合、圧縮画像データを出力して処理が完了する。圧縮画像データのサイズが1MB未満である場合、縮小率pの値を1段階増やして、処理がステップS18に移される。
[Step S20] The
[Step S21] The
このように、圧縮画像データのデータサイズが1MB未満の場合、縮小率を1段階上げて解像度変換し、PNG圧縮して、再び圧縮画像データのデータサイズを検出する。これを、圧縮画像データのデータサイズが1MBに達するまで繰り返す。これにより、圧縮画像データのデータサイズを一定の値に保つと共に過剰に圧縮されて必要以上に画質が劣化することを防止することができる。 As described above, when the data size of the compressed image data is less than 1 MB, the reduction rate is increased by one step, the resolution is converted, PNG compression is performed, and the data size of the compressed image data is detected again. This is repeated until the data size of the compressed image data reaches 1 MB. Thereby, it is possible to keep the data size of the compressed image data at a constant value and prevent the image quality from being deteriorated more than necessary due to excessive compression.
なお、解像度変換部160は、最初に最低縮小率より高い縮小率で解像度変換して、1MB以上である場合には、更に解像度を下げ、1MB以下となったら下限まで下がっていなくてもその解像度に決定するようにしてもよい。
Note that the
上記に示した処理により画像処理装置100は、画像に含まれる階調を地紋および地紋と重なる文字の階調差を際立たせることができる。これにより、文字を容易に視認できるようにしつつデータサイズを現サイズよりも小さく圧縮することが可能となる。
With the processing described above, the
また、ブロックとして抽出されなかった領域に関しては、ブロック毎に生成したヒストグラムから取得するそれぞれの中間階調の範囲のうち最も小さい下限値と最も大きい上限値を用いて階調削減処理を行うようにする。これにより、ブロックとして抽出されなかった領域に地紋や文字が含まれていた場合でも、文字を視認しやすくすることができる。また、ブロックとの境界をより自然に接続させ、視認時の違和感を低減することもできる。 In addition, with respect to an area that is not extracted as a block, gradation reduction processing is performed using the smallest lower limit value and the largest upper limit value among the intermediate gradation ranges acquired from the histogram generated for each block. To do. Thereby, even when a background pattern or a character is included in an area that is not extracted as a block, the character can be easily recognized. Further, the boundary with the block can be connected more naturally, and the uncomfortable feeling at the time of visual recognition can be reduced.
以下では、画像処理装置100による画像圧縮処理の処理例を説明する。
図6は、読取画像の例を示す図である。画像200は、地紋付きの紙媒体をスキャナ14で読み込んだ画像である。領域201は、画像200のうち、地紋202より色の薄い領域(階調値が“170”以上であるものとする)を示している。地紋202は、例えば、紙媒体に記載された情報の複製を防止する機能を果たすものである。地紋202の背景(領域201等)には、更に、地紋202より薄い色で別の模様が描かれていてもよい。このような画像200は、スキャナ14により読み込まれ、入力部120を介して階調変更部130に画像データとして出力される。
Hereinafter, an example of image compression processing by the
FIG. 6 is a diagram illustrating an example of a read image. The
図7は、階調変更部による階調変更処理後の画像の例を示す図である。画像300は、階調変更部130による画像200の階調変更処理後の状態を示している。領域301は、階調変更部130により領域201の階調値が最大階調値“255”に変換された場合を示している。なお、このような処理を、ステップS12のブロック抽出処理に対して事前に行っておくことで、ブロック抽出処理時における閾値との比較処理の負荷を軽減できる。また、その後の階調削減処理(ステップS14〜S15)においても、階調変更された画素を階調値L3(=170)より大きい階調値をもつ画素として容易に識別できるようになり、処理負荷を軽減できる。
FIG. 7 is a diagram illustrating an example of an image after the gradation changing process by the gradation changing unit. An
図8は、ブロック抽出処理により抽出されたブロックの例を示す図である。ブロック310,320,330は、画像300からブロック抽出部140により抽出される。ブロック310は、“昭”の文字とこの文字に重なる地紋310aとを含むブロックである。ブロック320は、“和”の文字の偏である「のぎへん」を含むブロックである。ブロック320は、“和”の文字の旁である「くち」を含むブロックである。
FIG. 8 is a diagram illustrating an example of blocks extracted by the block extraction process. The
ブロック抽出部140は、文字の領域であるか否かを判定するための判定閾値を用い、階調変更処理後の画像において、判定閾値以下の階調値をもつ画素が横方向および縦方向に所定の画素数だけ連続して現れたとき、それらの画素の領域を文字を含むブロックとして抽出する。また、判定閾値以下の階調値をもつ画素が一定数だけ連続した後、ごく少ない画素数分だけ階調値が判定閾値を超え、その後の画素から判定閾値以下の階調値をもつ画素が再度連続した場合には、それらの領域を1つのブロック(すなわち、1つの文字)として認識してもよい。このような処理により、ブロック310のように、複数の部首が組み合わされて構成された文字を、1つの文字として認識できるようになる。
The
ここで、判定閾値としては、ステップS11の階調変更処理で利用された階調値L3とすることができる。この場合、ブロック抽出処理では、各画素の階調値がL3以下であるか否かを検出するのではなく、各画素の階調値が、階調変更処理により変換された階調値“255”であるか否かを判定するという簡単な処理で文字を認識できるようになる。 Here, the determination threshold value may be the gradation value L3 used in the gradation changing process in step S11. In this case, the block extraction process does not detect whether the gradation value of each pixel is equal to or less than L3, but the gradation value “255” obtained by converting the gradation value of each pixel by the gradation changing process. The character can be recognized by a simple process of determining whether or not it is "."
なお、判定閾値として設定し得る上限値は、階調変更部130で閾値として用いられた階調値L3より小さくする必要があり、下限値は、文字の領域として予測される階調値より大きくする必要がある。ただし、その下限値については、地紋の階調値として予測される値以上としてもよい。この場合、ブロック310のように、地紋の領域も文字領域の一部として認識される場合があるが、このことは特に精度に影響しない。また、例えば、ブロック抽出部140への入力画像における階調値のヒストグラムに基づき、上記の条件に合致する判定閾値を決定してもよい。
The upper limit value that can be set as the determination threshold value needs to be smaller than the gradation value L3 used as the threshold value by the
次に、階調変換部150は、ブロック310,320,330それぞれの階調値の頻度を示すヒストグラムを生成し、階調削減処理を行う。
次に、ブロック310に対して生成されるヒストグラムに関して説明する。
Next, the
Next, the histogram generated for the
図9は、階調変換部により生成されたヒストグラムの例を示す図である。ヒストグラム311は、階調変換部150により生成される。ヒストグラム311は、ピーク311a,311bを有する。階調値“255”に現れるピークは、階調変更部130により、各画素の階調値のうち、階調値L3以上が階調値“255”に変換されたことによるピークである。
FIG. 9 is a diagram illustrating an example of a histogram generated by the gradation conversion unit. The
ピーク311aは、ヒストグラム上で階調値の小さい方から最初に現れたピークであり、階調値L1の位置に現れている。ピーク311aは、ブロック310における文字“昭”を構成する画素のもつ階調値によるピークとして識別することができる。なぜなら、“昭”を構成する画素は、ブロック310の中でも濃い階調を有する画素の集合だからである。
The
ピーク311bは、階調値がL3より小さい領域に最初に現れるピークであり、このピーク311bが現れる階調値を、階調値L2’とする。ピーク311bは、ブロック310における地紋を構成する画素のもつ階調値によるピークとして識別することができる。なぜなら、地紋を構成する画素は、ブロック310の中で“昭”の文字を構成する画素よりも淡い階調を有する画素の集合だからである。
The
すなわち、階調変換部150は、ヒストグラム311に現れるピークのうち、最も小さい階調値に現れるピークが文字によるピークであると認識することができる。そして、文字によるピークよりも大きい階調値に現れるピークが地紋やその他の下地によるピークであると認識することができる。なお、複数の色や明るさの地紋が存在する場合には、これらに対応する複数のピークが現れる場合がある。このような場合、例えば、これらのうち最も大きな階調値の位置に現れたピークを、階調値L2’に対応するピーク311bとして決定すればよい。
That is, the
階調変換部150は、階調値L1を階調削減範囲の下限とする。また、階調変換部150は、ピーク311bに対応する階調値L2’より大きく、階調値L3より小さい範囲において、階調削減範囲の上限となる階調値L2を決定する。階調値L2は、例えば、ピーク311bに対応する階調値L2’に基づく統計的な手法により求めることができる。また、例えば、階調値L2’に予め決められた所定の数値を加えた階調値、あるいは、階調値L2’と階調値L3との間の範囲を所定の割合で分割した分割点の値などとして求めることもできる。
The
ここで、ブロック320,330には、地紋が含まれない。このため、ブロック320,330に関してヒストグラムを生成すると、文字または文字の一部を構成する画素の階調値にピーク(ピーク311aに対応)が現れるのみとなる。この場合は、このピークに対応する階調値L1が階調削減範囲の下限となる。そして、例えば、この下限の階調値に所定の数値を加えた階調値として、あるいは、階調値L1と階調値L3との間の範囲を所定の割合で分割した分割点の値などとして、階調削減範囲の上限(階調値L2)を求めることができる。
Here, the
更に、階調変換部150は、次のようにして階調数の削減を行う。
図10は、階調変換部の階調削減処理を示す図である。階調変換部150は、階調値L1未満の範囲に含まれる階調値を階調変換後の最小階調値0に変換する。また、階調値L2よりも大きい範囲に含まれる階調値を階調変換後の最大階調値“7”に変換する。
Further, the
FIG. 10 is a diagram illustrating the tone reduction processing of the tone conversion unit. The
更に、階調変換部150は、各画素について階調値L1以上L2以下の範囲に含まれる階調数を削減して、6階調とする。例えば、L1=40、L2=160である場合、分割値“40,64,88,112,136,160”により階調範囲を5つに等分割する。そして、これらの分割値の間に含まれる階調値を各階調値から最も近い分割値に対応付ける。例えば、階調値“45”は、分割値“40”に対応付けられ、階調値“138”は、分割値“136”に対応付けられる。
Further, the
なお、階調値“52”のように最も近い分割値が2つ存在する場合には、小さい方の分割値に対応付ける等、予め規定しておく。例えば、階調値“52”は、分割値“40”および分割値“64”のうちの小さい方の分割値“40”に対応付ける。 When there are two closest division values such as the gradation value “52”, the division value is defined in advance, for example, to be associated with the smaller division value. For example, the gradation value “52” is associated with the smaller divided value “40” of the divided value “40” and the divided value “64”.
次に、階調変換部150は、分割値“40”に対応付けた画素の階調値を、階調値“1”に変換する。同様に、分割値“64,88,112,136,160”にそれぞれ対応付けた画素の階調値を、それぞれ階調値“2,3,4,5,6”に変換する。
Next, the
このようにして、元の画像データの256階調を8階調に変換する。ただし、分割値の決め方に関しては、上記の例に限らず他の方法を適用することもできる。
これにより階調の情報が削減され、画像のデータサイズを小さくすることができる。更に、中間階調の領域のみ階調を残し、その領域でのコントラストを際立たせるように画像が変換されることで、その画像を視認したときに文字と地紋との区別がつきやすくなる。すなわち、文字の視認性を保持しながらも、画像のデータサイズを圧縮することができる。
In this way, 256 gradations of the original image data are converted to 8 gradations. However, the method of determining the division value is not limited to the above example, and other methods can be applied.
As a result, gradation information is reduced, and the data size of the image can be reduced. Furthermore, since the image is converted so that the gradation is left only in the intermediate gradation region and the contrast in the region is conspicuous, it is easy to distinguish the character and the background pattern when the image is viewed. That is, it is possible to compress the data size of the image while maintaining the visibility of the characters.
なお、ヒストグラム311において、階調値L1(=40)より小さい階調値をもつ画素については、それらの階調値を全て分割値“40”に対応付けてもよい。また、階調値L2(=160)以上の階調値をもつ画素については、それらの階調値を全て分割値“160”に対応付けてもよい。このようにすると、階調削減後の階調数を6とすることが可能となり、更に階調の情報を削減し、データサイズを圧縮することができる。また、このように変換前における40以下の階調値、160以上の階調値をそれぞれ変換後の階調の最小値、最大値とする場合には、40以上160以下の範囲の階調分割数を8段階としてもよい。この場合、図10の例と比較して、データサイズを変えることなく、中間階調の階調数をより多く残すことが可能になり、文字と地紋とを視覚的に識別しやすくなる。
In the
なお、ステップS17で述べたように、ブロックとして抽出されなかった領域の各画素のデータについても、ブロック内と同じ階調数を有するデータに変換される。この処理の手順は、階調値L1,L2,L2’の決め方以外は各ブロック内での処理と同様である。階調値L1,L2,L2’としては、例えば、予め決められた数値が設定されてもよい。あるいは、前述のように、階調値L1を、各ブロックで求められた階調値L1のうち最も小さい値に設定し、階調値L2を、各ブロックで求められた階調値L2のうち最も大きい値に設定してもよい。後者の処理により、ステップS12で抽出されなかった文字や地紋がブロック以外の領域に存在していた場合でも、これらの文字と地紋とをより識別しやすくすることができる。 Note that, as described in step S17, the data of each pixel in the area not extracted as a block is also converted into data having the same number of gradations as in the block. The procedure of this process is the same as the process in each block except for how to determine the gradation values L1, L2, and L2 '. As the gradation values L1, L2, L2 ', for example, predetermined numerical values may be set. Alternatively, as described above, the gradation value L1 is set to the smallest value among the gradation values L1 obtained in each block, and the gradation value L2 is set out of the gradation values L2 obtained in each block. You may set to the largest value. By the latter process, even when the characters and the background pattern not extracted in step S12 exist in the area other than the block, it is possible to more easily identify these characters and the background pattern.
図11は、解像度変換部による縮小率の決定処理を示す図である。ブロック341は、縦方向の画素数xのブロックである。ブロック342は、縦方向の画素数y(y>x)のブロックである。ブロック343a,343bは、解像度変換後の画像において、文字の視認性を保持可能な縦方向の最小の画素数z(y>x>z)のブロックである。ここでは例として、x=3,y=4,z=2である。
FIG. 11 is a diagram illustrating a reduction rate determination process performed by the resolution conversion unit. A
例えば、ブロック抽出部140が抽出した最小のブロックがブロック341であった場合を考える。この場合、解像度変換部160は、ブロック343aの縦方向の画素数とブロック341の縦方向の画素数との比によって、最小ブロックの文字がつぶれない縦方向の縮小率p=2/3を得ることができる。
For example, consider a case where the minimum block extracted by the
また、例えば、ブロック抽出部140が抽出した最小のブロックがブロック342であった場合を考える。この場合にも解像度変換部160は、同様にブロック343bの縦方向の画素数とブロック342の縦方向の画素数との比によって、縦方向の縮小率p=1/2を得ることができる。
For example, consider a case where the minimum block extracted by the
なお、前述した通り、本例では縦方向の縮小率を求めたが、横方向も縮小率pにより圧縮が行われる。これにより、画像全体の画素の削減率は、p2となる。
このように、ブロック抽出部140が抽出した最小のブロックに応じて解像度変換に用いる縮小率pを求めるようにする。そして、この縮小率pを用いて画像全体の解像度変換を行うことで、ブロック単位で文字の視認性を保証しながら、データサイズをより小さくすることができる。
As described above, in this example, the reduction ratio in the vertical direction is obtained, but compression is also performed in the horizontal direction with the reduction ratio p. Thus, the reduction rate of the entire pixel image is a p 2.
In this way, the reduction rate p used for resolution conversion is obtained according to the minimum block extracted by the
図12は、圧縮符号化部による画像圧縮処理後の画像の例を示す図である。圧縮符号化部170は、解像度変換部160が生成した解像度変換画像に対し、更に所定の圧縮符号化処理を施す。なお、圧縮符号化部170では、例えば、PNG圧縮を行うようにする。PNG圧縮では、まず、画像データを隣接する画素間での階調値の差分で表す(フィルタリング)。そして、フィルタリングの結果現れる冗長箇所(階調値の差分の値が連続する箇所)に基づいて画像の圧縮符号化を行う。このため、PNG圧縮は、階調数および解像度が削減された画像の圧縮に適している。すなわち、解像度変換部160が生成した解像度変換画像に対してPNG圧縮を行うことで、画像データサイズの大幅な削減を図ることができる。
FIG. 12 is a diagram illustrating an example of an image after image compression processing by the compression encoding unit. The
なお、圧縮符号化部170は、画像400のデータサイズがパラメータ管理テーブル111に設定された圧縮後目標サイズ“1MB”よりも小さくなる場合には、解像度変換部160により解像度を1段階高い解像度(例えば、150dpiから200dpi)に上げるよう指示する。そして、圧縮符号化部170は、再度、解像度変換部160により解像度を上げて生成された解像度変換画像の圧縮処理を行う。これにより、PNG圧縮後の圧縮データのサイズを一定値に保ちつつ、その再生画像の解像度をできるだけ高くしてその画質を向上させることができる。
When the data size of the
このように、画像処理装置100は、画像に含まれる各画素の中間階調を残して階調数を削減し、画像の解像度を低下させて、画像圧縮処理を施す。これにより、画像に含まれる文字や地紋等の下地に対する所定の視認性を保持しつつ、データサイズを小さく圧縮することができる。
As described above, the
なお、以上で説明した例では、階調変換部150は、階調削減処理のためのヒストグラムをブロック毎に作成し、ブロック毎に階調削減処理を行うものとしたが、ヒストグラムを抽出されたブロック全部に基づいて作成するようにしてもよい。この場合、階調変換部150は、ブロック全部の領域から作成されたヒストグラムに基づいて、画像単位で階調削減処理を行う。これにより、上記の例と同様の効果を得ることも可能である。以下、このような場合の処理について、第2の実施の形態として説明する。
In the example described above, the
[第2の実施の形態]
以下、第2の実施の形態を図面を参照して詳細に説明する。前述の第1の実施の形態との相違点を中心に説明し、同様の事項については説明を省略する。
[Second Embodiment]
Hereinafter, a second embodiment will be described in detail with reference to the drawings. Differences from the first embodiment will be mainly described, and description of similar matters will be omitted.
第2の実施の形態に係る画像処理装置は、図2,3に示した第1の実施の形態に係る画像処理装置100と同様のハードウェア構成によって実現することができる。
図13は、第2の実施の形態の画像処理装置の機能を示すブロック図である。画像処理装置100aは、管理情報記憶部110、入力部120、階調変更部130、ブロック抽出部140、階調変換部150a、解像度変換部160および圧縮符号化部170を有する。なお、管理情報記憶部110、入力部120、階調変更部130、ブロック抽出部140、解像度変換部160および圧縮符号化部170は、図3の画像処理装置100において同一の符号で示した構成と同一の機能であるため、その説明を省略する。ただし、階調変更部130は、階調変更後の変換画像を階調変換部150aに出力する。
The image processing apparatus according to the second embodiment can be realized by a hardware configuration similar to that of the
FIG. 13 is a block diagram illustrating functions of the image processing apparatus according to the second embodiment. The
階調変換部150aは、階調変更部130から取得する変換画像に基づいて、変換画像に含まれる各画素の階調値の頻度を示すヒストグラムを生成する。階調変換部150aは、このヒストグラムに基づいて、階調削減処理の対象となる階調値範囲の下限の階調値L1および上限の階調値L2を求める。これらの階調値は、ヒストグラム上のピークから求めることができる。
Based on the converted image acquired from the
階調変換部150aは、求めた階調値L1,L2に基づいて画像に含まれる階調数を削減する。階調変換部150aは、例えば、256段階の階調を8段階の階調に削減する。この方法は、第1の実施の形態で示した階調変換部150と同様の方法を用いることができる。
The
ここで、第1の実施の形態の階調変換部150は、1枚の画像に含まれるブロック単位で階調削減処理を実行する。これに対し、第2の実施の形態の階調変換部150aでは、1枚の画像単位で階調削減処理を実行する点が異なる。
Here, the
階調変換部150aは、この階調削減処理により生成した階調変換画像をブロック抽出部140に出力する。
そして、ブロック抽出部140は、階調変換部150aから取得する階調変換画像に基づいてブロックを抽出する。解像度変換部160は、ブロック抽出部140が抽出したブロックに基づいて、解像度変換処理を行う。
The
Then, the
なお、管理情報記憶部110に記憶されるパラメータ管理テーブルの構成も第1の実施の形態におけるパラメータ管理テーブル111の構成と同一であるため説明を省略する。
次に、以上のような構成を備える画像処理装置100aにおいて実行される処理の詳細を説明する。
Note that the configuration of the parameter management table stored in the management
Next, details of processing executed in the
図14は、第2の実施の形態の画像圧縮処理の手順を示すフローチャートである。以下、図14に示す処理をステップ番号に沿って説明する。
[ステップS31]階調変更部130は、入力部120から取得する入力画像に含まれる各画素の階調値のうち、階調値L3(=170)以上の階調値を最大階調値“255”に変換する。そして、階調変更部130は、この階調変更処理により生成した変換画像を階調変換部150aに出力する。
FIG. 14 is a flowchart illustrating a procedure of image compression processing according to the second embodiment. In the following, the process illustrated in FIG. 14 will be described in order of step number.
[Step S31] The
[ステップS32]階調変換部150aは、階調変更部130から取得する変換画像に含まれる各画素の階調値の頻度を示すヒストグラムを生成する。
[ステップS33]階調変換部150aは、生成したヒストグラムのピークに基づいて、中間階調の階調値範囲を決める下限の階調値L1および上限の階調値L2を求める。階調変換部150aは、階調値L1を画像に含まれる文字のピークの階調値とする。また、階調値L2を地紋のピークに基づいて算出する。これらの階調値L1,L2の算出方法は、図5のS14での処理と同様である。
[Step S32] The
[Step S33] The
[ステップS34]階調変換部150aは、画像に含まれる各画素に関し、ステップS33で求めた階調値L1よりも小さい階調値を階調変換後の階調値“0”に、階調値L2よりも大きい階調値を階調変換後の最大階調値“7”に、それぞれ変換する。そして、階調変換部150aは、パラメータ管理テーブル111に記憶された階調数“8”に基づき、階調値L1以上L2以下の階調範囲を階調値“1〜6”の計6階調に変換する。すなわち、ここでの階調削減処理は、第1の実施の形態において各ブロックに適用した処理(図5のS15)を、画像全体に適用したものである。階調変換部150aは、階調削減処理の結果生成される階調変換画像をブロック抽出部140に出力する。
[Step S34] For each pixel included in the image, the
[ステップS35]ブロック抽出部140は、階調変換部150aから取得する階調変換画像から1つ以上の文字の全体または一部を含むブロックを抽出する。そして、ブロック抽出部140は、抽出した複数のブロックのうち、最も小さなブロックの情報を解像度変換部160に出力する。
[Step S35] The
[ステップS36]解像度変換部160は、ブロック抽出部140が抽出したブロックのうち、最小のブロックの縦画素数fを取得する。解像度変換部160は、この縦画素数fとパラメータ管理テーブル111に記憶されたブロック最小縦画素数“10”を用いて、解像度の縮小率p=10/fを算出する。
[Step S36] The
[ステップS37]解像度変換部160は、階調変換部150aから取得した階調変換画像をステップS36で算出した縮小率pで解像度変換して解像度変換画像を生成し、圧縮符号化部170に出力する。なお、縮小率p=1である場合には、解像度変換は行われない。
[Step S37] The
[ステップS38]圧縮符号化部170は、解像度変換部160から取得した解像度変換画像に対してPNG圧縮を施して圧縮画像データを生成する。
[ステップS39]圧縮符号化部170は、PNG圧縮により生成した圧縮画像データのサイズが適切であるか否かを判定する。圧縮画像のサイズがパラメータ管理テーブル111に記憶された圧縮後目標サイズ“1MB”以上である場合、圧縮画像データを出力して処理が完了する。圧縮画像のサイズが1MB未満である場合、縮小率pの値を1段階増やして、処理がステップS36に移される。
[Step S38] The
[Step S39] The
このように、画像処理装置100aは、画像に含まれる階調を下地および下地と重なる文字の階調差を際立たせるように圧縮処理を行う。これにより、視認性を保持しつつデータサイズを現サイズよりも小さく圧縮することが可能となる。
As described above, the
また、階調削減処理をブロック単位ではなく画像単位で行うようにすることで、ブロックの境界で階調が不自然に変化することがなくなり、見易さを向上することができる。
なお、上記に示した画像処理装置の処理機能の少なくとも一部は、コンピュータによって実現することができる。その場合には、これらの処理機能の処理内容を記述したプログラムが提供される。そして、そのプログラムをコンピュータで実行することにより、上記処理機能がコンピュータ上で実現される。処理内容を記述したプログラムは、コンピュータで読み取り可能な記録媒体に記録しておくことができる。コンピュータで読み取り可能な記録媒体としては、磁気記録装置、光ディスク、光磁気記録媒体、半導体メモリなどがある。
Further, by performing gradation reduction processing not on a block basis but on an image basis, gradation does not change unnaturally at the boundary between blocks, and visibility can be improved.
Note that at least a part of the processing functions of the image processing apparatus described above can be realized by a computer. In that case, a program describing the processing contents of these processing functions is provided. And the said processing function is implement | achieved on a computer by running the program with a computer. The program describing the processing contents can be recorded on a computer-readable recording medium. Examples of the computer-readable recording medium include a magnetic recording device, an optical disk, a magneto-optical recording medium, and a semiconductor memory.
プログラムを流通させる場合には、例えば、そのプログラムが記録された光ディスクなどの可搬型記録媒体が販売される。また、プログラムをサーバコンピュータの記憶装置に格納しておき、そのプログラムを、サーバコンピュータからネットワークを介して他のコンピュータに転送することもできる。 When the program is distributed, for example, a portable recording medium such as an optical disk on which the program is recorded is sold. It is also possible to store the program in a storage device of a server computer and transfer the program from the server computer to another computer via a network.
プログラムを実行するコンピュータは、例えば、可搬型記録媒体に記録されたプログラムまたはサーバコンピュータから転送されたプログラムを、自己の記憶装置に格納する。そして、コンピュータは、自己の記憶装置からプログラムを読み取り、そのプログラムに従った処理を実行する。なお、コンピュータは、可搬型記録媒体から直接プログラムを読み取り、そのプログラムに従った処理を実行することもできる。また、コンピュータは、サーバコンピュータからプログラムが転送される毎に、逐次、受け取ったプログラムに従った処理を実行することもできる。 The computer that executes the program stores, for example, the program recorded on the portable recording medium or the program transferred from the server computer in its own storage device. Then, the computer reads the program from its own storage device and executes processing according to the program. The computer can also read the program directly from the portable recording medium and execute processing according to the program. In addition, each time the program is transferred from the server computer, the computer can sequentially execute processing according to the received program.
以上、本発明の画像処理装置、画像処理方法および画像処理プログラムを図示の実施の形態に基づいて説明したが、これらに限定されるものではなく、各部の構成は同様の機能を有する任意の構成のものに置換することができる。また、他の任意の構成物や工程が付加されてもよい。また、本発明は前述した実施の形態のうちの任意の2以上の構成(特徴)を組み合わせたものであってもよい。 The image processing apparatus, the image processing method, and the image processing program of the present invention have been described based on the illustrated embodiments. However, the present invention is not limited to these, and the configuration of each unit is an arbitrary configuration having the same function. Can be substituted. Moreover, other arbitrary structures and processes may be added. Further, the present invention may be a combination of any two or more configurations (features) of the above-described embodiments.
1 画像処理装置
1a 階調変更手段
1b ブロック抽出手段
1c 階調変換手段
1d 解像度変換手段
1e 圧縮符号化手段
P1 入力画像
P2 出力画像
DESCRIPTION OF
Claims (13)
前記入力画像から1つ以上の文字の全体または一部を含む領域であるブロックを抽出するブロック抽出手段と、
前記入力画像の階調数を削減した階調変換画像を生成する階調変換手段であって、前記入力画像のデータを基に、当該入力画像の総階調数の中から第1の階調値と、それより大きい第2の階調値とを設定し、前記入力画像に含まれる各画素の階調値のうち、前記第1の階調値よりも小さい階調値を、階調変換画像における最小階調値に変換し、前記第2の階調値よりも大きい階調値を、階調変換画像における最大階調値に変換し、前記第1の階調値以上で前記第2の階調値以下の範囲に含まれる階調値を当該範囲の階調数が現階調数よりも少なくなるように変換して、前記階調変換画像を生成する階調変換手段と、
前記ブロック抽出手段が抽出した前記ブロックの縦方向および横方向の画素数が所定の最小画素数より少なくならない範囲で、前記階調変換画像の解像度を低解像度に変換する解像度変換手段と、
を有することを特徴とする画像処理装置。 In an image processing apparatus that compresses the data amount of an input image,
Block extraction means for extracting a block which is an area including all or part of one or more characters from the input image;
Gradation conversion means for generating a gradation-converted image in which the number of gradations of the input image is reduced, wherein a first gradation is selected from the total number of gradations of the input image based on the data of the input image; A gradation value smaller than the first gradation value among gradation values of each pixel included in the input image is converted into a gradation value. Converting to a minimum gradation value in the image, converting a gradation value larger than the second gradation value to a maximum gradation value in the gradation conversion image, the second gradation value is equal to or greater than the first gradation value. Gradation conversion means for converting the gradation value included in the range of the gradation value or less so that the number of gradations in the range is smaller than the current gradation number, and generating the gradation conversion image;
Resolution conversion means for converting the resolution of the gradation-converted image to a low resolution within a range in which the number of pixels in the vertical and horizontal directions of the block extracted by the block extraction means is not less than a predetermined minimum number of pixels;
An image processing apparatus comprising:
前記解像度変換手段は、前記圧縮符号化手段が生成した前記圧縮画像データが所定のデータ量よりも小さい場合には、前記変換後解像度を向上させて前記階調変換画像の前記解像度変換および前記圧縮符号化処理を再実行する、
ことを特徴とする請求項10記載の画像処理装置。 The resolution conversion means further includes compression encoding means for generating a compressed image data by performing a predetermined compression encoding process on the resolution conversion image generated by the resolution conversion of the gradation conversion image,
When the compressed image data generated by the compression encoding unit is smaller than a predetermined data amount, the resolution conversion unit improves the post-conversion resolution and converts the resolution conversion and the compression of the gradation-converted image. Re-execute the encoding process,
The image processing apparatus according to claim 10.
ブロック抽出手段が、前記入力画像から1つ以上の文字の全体または一部を含む領域であるブロックを抽出し、
階調変換手段が、前記入力画像のデータを基に、当該入力画像の総階調数の中から第1の階調値と、それより大きい第2の階調値とを設定し、前記入力画像に含まれる各画素の階調値のうち、前記第1の階調値よりも小さい階調値を階調数削減後の最小階調値に変換し、前記第2の階調値よりも大きい階調値を階調数削減後の最大階調値に変換し、前記第1の階調値以上で前記第2の階調値以下の範囲に含まれる階調値を当該範囲の階調数が現階調数よりも少なくなるように変換して前記階調変換画像を生成し、
解像度変換手段が、前記ブロック抽出手段が抽出した前記ブロックの縦方向および横方向の画素数が所定の最小画素数より少なくならない範囲で、前記階調変換画像の解像度を低解像度に変換する、
ことを特徴とする画像処理方法。 In the image processing method of the image processing apparatus for compressing the data amount of the input image,
A block extracting means extracts a block which is an area including all or part of one or more characters from the input image;
The gradation converting means sets a first gradation value and a second gradation value larger than the first gradation value from the total number of gradations of the input image based on the data of the input image, and the input Of the gradation values of each pixel included in the image, the gradation value smaller than the first gradation value is converted into the minimum gradation value after the number of gradations is reduced, and the gradation value is smaller than the second gradation value. A large gradation value is converted into a maximum gradation value after the number of gradations is reduced, and gradation values included in a range that is greater than or equal to the first gradation value and less than or equal to the second gradation value are represented by gradations in the range. The gradation conversion image is generated by converting the number to be smaller than the current gradation number,
The resolution conversion means converts the resolution of the gradation-converted image to a low resolution within a range in which the number of pixels in the vertical and horizontal directions of the block extracted by the block extraction means is not less than a predetermined minimum number of pixels.
An image processing method.
コンピュータを、
前記入力画像から1つ以上の文字の全体または一部を含む領域であるブロックを抽出するブロック抽出手段、
前記入力画像の階調数を削減した階調変換画像を生成する階調変換手段であって、前記入力画像のデータを基に、当該入力画像の総階調数の中から第1の階調値と、それより大きい第2の階調値とを設定し、前記入力画像に含まれる各画素の階調値のうち、前記第1の階調値よりも小さい階調値を、階調変換画像における最小階調値に変換し、前記第2の階調値よりも大きい階調値を、階調変換画像における最大階調値に変換し、前記第1の階調値以上で前記第2の階調値以下の範囲に含まれる階調値を当該範囲の階調数が現階調数よりも少なくなるように変換して、前記階調変換画像を生成する階調変換手段、
前記ブロック抽出手段が抽出した前記ブロックの縦方向および横方向の画素数が所定の最小画素数より少なくならない範囲で、前記階調変換画像の解像度を低解像度に変換する解像度変換手段、
として機能させることを特徴とする画像処理プログラム。 In an image processing program that compresses the data amount of an input image,
Computer
Block extraction means for extracting a block which is an area including all or part of one or more characters from the input image;
Gradation conversion means for generating a gradation-converted image in which the number of gradations of the input image is reduced, wherein a first gradation is selected from the total number of gradations of the input image based on the data of the input image; A gradation value smaller than the first gradation value among gradation values of each pixel included in the input image is converted into a gradation value. Converting to a minimum gradation value in the image, converting a gradation value larger than the second gradation value to a maximum gradation value in the gradation conversion image, the second gradation value is equal to or greater than the first gradation value. Gradation conversion means for converting the gradation value included in the range of the gradation value or less so that the number of gradations in the range is less than the current number of gradations, and generating the gradation conversion image;
Resolution conversion means for converting the resolution of the gradation-converted image to a low resolution within a range in which the number of pixels in the vertical and horizontal directions of the block extracted by the block extraction means is not less than a predetermined minimum number of pixels;
An image processing program that functions as an image processing program.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2008221956A JP4927047B2 (en) | 2008-08-29 | 2008-08-29 | Image processing apparatus, image processing method, and image processing program |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2008221956A JP4927047B2 (en) | 2008-08-29 | 2008-08-29 | Image processing apparatus, image processing method, and image processing program |
Publications (2)
Publication Number | Publication Date |
---|---|
JP2010057080A true JP2010057080A (en) | 2010-03-11 |
JP4927047B2 JP4927047B2 (en) | 2012-05-09 |
Family
ID=42072484
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP2008221956A Expired - Fee Related JP4927047B2 (en) | 2008-08-29 | 2008-08-29 | Image processing apparatus, image processing method, and image processing program |
Country Status (1)
Country | Link |
---|---|
JP (1) | JP4927047B2 (en) |
Cited By (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
WO2013153848A1 (en) * | 2012-04-13 | 2013-10-17 | 株式会社デンソー | Image processing device and method |
JP2015179500A (en) * | 2014-02-26 | 2015-10-08 | パナソニックIpマネジメント株式会社 | Image processing method and image processing device |
JP2020108116A (en) * | 2018-12-28 | 2020-07-09 | キヤノン株式会社 | Image processing apparatus, image processing method, program, and storage medium |
Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2006101152A (en) * | 2004-09-29 | 2006-04-13 | Fuji Photo Film Co Ltd | Image compression processing device, image compression processing program, and image compression processing method |
JP2006202209A (en) * | 2005-01-24 | 2006-08-03 | Toshiba Corp | Image compression method and image compression device |
JP2006238361A (en) * | 2005-02-28 | 2006-09-07 | Fuji Photo Film Co Ltd | Image compressing apparatus, method and program |
JP2006270266A (en) * | 2005-03-22 | 2006-10-05 | Toshiba Corp | Image processor and image processing method |
JP2006295857A (en) * | 2005-04-15 | 2006-10-26 | Konica Minolta Business Technologies Inc | Ground tint processing method and image forming apparatus |
JP2008042325A (en) * | 2006-08-02 | 2008-02-21 | Konica Minolta Business Technologies Inc | Method, device, and computer program for processing input data related to generation of electronic file |
-
2008
- 2008-08-29 JP JP2008221956A patent/JP4927047B2/en not_active Expired - Fee Related
Patent Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2006101152A (en) * | 2004-09-29 | 2006-04-13 | Fuji Photo Film Co Ltd | Image compression processing device, image compression processing program, and image compression processing method |
JP2006202209A (en) * | 2005-01-24 | 2006-08-03 | Toshiba Corp | Image compression method and image compression device |
JP2006238361A (en) * | 2005-02-28 | 2006-09-07 | Fuji Photo Film Co Ltd | Image compressing apparatus, method and program |
JP2006270266A (en) * | 2005-03-22 | 2006-10-05 | Toshiba Corp | Image processor and image processing method |
JP2006295857A (en) * | 2005-04-15 | 2006-10-26 | Konica Minolta Business Technologies Inc | Ground tint processing method and image forming apparatus |
JP2008042325A (en) * | 2006-08-02 | 2008-02-21 | Konica Minolta Business Technologies Inc | Method, device, and computer program for processing input data related to generation of electronic file |
Cited By (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
WO2013153848A1 (en) * | 2012-04-13 | 2013-10-17 | 株式会社デンソー | Image processing device and method |
JP2013222261A (en) * | 2012-04-13 | 2013-10-28 | Denso Corp | Image processing apparatus |
US9396527B2 (en) | 2012-04-13 | 2016-07-19 | Denso Corporation | Image processing device and method |
JP2015179500A (en) * | 2014-02-26 | 2015-10-08 | パナソニックIpマネジメント株式会社 | Image processing method and image processing device |
JP2020108116A (en) * | 2018-12-28 | 2020-07-09 | キヤノン株式会社 | Image processing apparatus, image processing method, program, and storage medium |
Also Published As
Publication number | Publication date |
---|---|
JP4927047B2 (en) | 2012-05-09 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
JP5875637B2 (en) | Image processing apparatus and image processing method | |
US7324247B2 (en) | Image processing apparatus, image processing program and storage medium storing the program | |
JP4950315B2 (en) | DATA GENERATION DEVICE, DATA GENERATION METHOD, AND DATA GENERATION PROGRAM | |
JP4366003B2 (en) | Image processing apparatus and image processing method | |
JP2005045404A (en) | Image processor and method, and program | |
JP2009301141A (en) | Subtractive color method, subtractive color processing apparatus, image forming apparatus, and computer program | |
JP4950316B2 (en) | DATA GENERATION DEVICE, DATA GENERATION METHOD, AND DATA GENERATION PROGRAM | |
US8620081B2 (en) | Image processing apparatus, method, and storage medium for determining attributes | |
JP3715905B2 (en) | Image processing apparatus, image processing method, program, and storage medium | |
US8971647B2 (en) | Image compression apparatus, image compression method, and storage medium | |
JP2010056827A (en) | Apparatus and program for processing image | |
JP6362632B2 (en) | Image processing apparatus and image processing method | |
JP6923037B2 (en) | Image processing equipment, image processing methods and programs | |
JP4927047B2 (en) | Image processing apparatus, image processing method, and image processing program | |
JP2006197178A (en) | Image processor, image processing method, program, and storage medium | |
JP6705237B2 (en) | Image compression apparatus, image forming apparatus, image compression method and program | |
JP2003244447A (en) | Image processor and image processing method | |
JP2010146218A (en) | Image processing apparatus, image processing method, computer program | |
JP2005275854A (en) | Image processor, image processing method, image processing program and recording medium with this program stored thereon | |
JP2011172261A (en) | Image processing apparatus and image processing program | |
JP2004120092A (en) | Image processing apparatus, image processing system, image processing method, storage medium, and program | |
JPH04356873A (en) | Adaptive encoding system for color document image | |
JP6744779B2 (en) | Image processing apparatus, control method thereof, and program | |
JP2005204206A (en) | Image processing apparatus, image processing program, and storage medium | |
JP2003338934A (en) | Image processing equipment and method therefor |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
A621 | Written request for application examination |
Free format text: JAPANESE INTERMEDIATE CODE: A621 Effective date: 20110404 |
|
A977 | Report on retrieval |
Free format text: JAPANESE INTERMEDIATE CODE: A971007 Effective date: 20120201 |
|
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: 20120207 |
|
A01 | Written decision to grant a patent or to grant a registration (utility model) |
Free format text: JAPANESE INTERMEDIATE CODE: A01 |
|
A61 | First payment of annual fees (during grant procedure) |
Free format text: JAPANESE INTERMEDIATE CODE: A61 Effective date: 20120208 |
|
FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20150217 Year of fee payment: 3 |
|
R150 | Certificate of patent or registration of utility model |
Ref document number: 4927047 Country of ref document: JP Free format text: JAPANESE INTERMEDIATE CODE: R150 Free format text: JAPANESE INTERMEDIATE CODE: R150 |
|
LAPS | Cancellation because of no payment of annual fees |