JP2011142471A - Image processing apparatus, control method, and program - Google Patents
Image processing apparatus, control method, and program Download PDFInfo
- Publication number
- JP2011142471A JP2011142471A JP2010001569A JP2010001569A JP2011142471A JP 2011142471 A JP2011142471 A JP 2011142471A JP 2010001569 A JP2010001569 A JP 2010001569A JP 2010001569 A JP2010001569 A JP 2010001569A JP 2011142471 A JP2011142471 A JP 2011142471A
- Authority
- JP
- Japan
- Prior art keywords
- color
- tile
- class
- representative color
- representative
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Granted
Links
Images
Abstract
Description
本発明は、画像処理装置、制御方法、及びプログラムに関する。特に、カラー画像の減色画像処理方法に関する。 The present invention relates to an image processing apparatus, a control method, and a program. In particular, the present invention relates to a color-reduced color image processing method.
近年、情報の電子化が進み、紙文書をそのまま保存するのではなく、スキャナ等によりスキャンして電子化して保存したり、その電子データを他装置に送信するシステムが普及している。また、文書データそのものに使われる色も白黒2値からカラー化(多値化)が進んでいる。電子文書データには可読性向上や高圧縮性を実現させるために文字部は鮮明であり、背景部は均一な色が求められている。 In recent years, the digitization of information has progressed, and a system that scans with a scanner or the like for digitization and stores the data, or transmits the electronic data to another apparatus has been widespread, instead of storing a paper document as it is. Also, the color used for the document data itself has been changed from black and white to color (multi-value). Electronic document data is required to have a clear character portion and a uniform color in the background portion in order to achieve improved readability and high compressibility.
しかし、実際に紙文書を電子化する際には各種のノイズやにじみ、むらが発生する。特に網点で構成されたカラー文書では、網点の構成点そのものの色に起因したむらやにじみが発生し、可読性や画質に影響を及ぼす。このため、画像中から代表色を選定し、減色する処理が行われている。 However, when a paper document is actually digitized, various noises, blurs, and unevenness occur. In particular, in a color document composed of halftone dots, unevenness and blurring due to the colors of the halftone dots themselves occur, which affects readability and image quality. For this reason, a process of selecting a representative color from the image and reducing the color is performed.
スキャン画像の減色処理は一般的にスキャナや複合機などの機器に組み込み、リアルタイムで稼働させることが想定される。よって、減色処理には高精度もさることながら、省メモリ化が求められる。このため、特許文献1には、入力画像を複数のブロックに分割し、ブロック単位で色置換を行う技術が開示されている。特許文献2では、タイル単位で濃度ヒストグラムを算出し、分散が小さい場合は1色ブロックと判定する。そうでないならば、前景色側と後景色側の分散比が最大となるように閾値を設定し、前景色背景色を分ける。それぞれの分散値が小さければ2色ブロック、そうでなければ多色ブロックと判定してそれぞれに合った符号化処理を行っている。
In general, it is assumed that the color reduction processing of a scanned image is incorporated in a device such as a scanner or a multifunction peripheral and is operated in real time. Therefore, memory saving is required for the color reduction processing as well as high accuracy. For this reason,
入力画像をタイル分割すると、文字などの一部がタイル端でちぎれてしまい、タイル内でごく小さく存在する例が多い。特許文献1では、ヒストグラムを生成、色量子化処理をし、量子化領域の形状や発生位置を見てノイズか残すべき色かを判定し、再度ヒストグラムを作って量子化処理を行う。つまり、計算量の多いヒストグラム計算を2回行うため、計算コストが高くなってしまう。
When an input image is divided into tiles, there are many examples in which a part of characters or the like is torn off at the edge of the tile and exists very small in the tile. In
また、文字端が存在するヒストグラムは図3(C)のように、分散が小さい可能性が高く、特許文献2では1色ブロックに分類され、残すべき文字領域の色を残すことができない。タイル単位の減色処理は、ページ全体から見れば同じ色領域であっても、網点の構成点のばらつきや領域境界の滲みの色によって、タイルの代表色がタイル間で微妙に色が異なるケースがある(図3(B))。
In addition, as shown in FIG. 3C, a histogram having character ends is highly likely to have a small variance, and is classified as one color block in
特許文献1では、タイル間の色むらを低減するために、処理対象の近隣にあるタイルの代表色を参照している。しかし、本形態は組み込み機器を想定しているため、該当タイルに隣接するタイルの色情報やページ全体の背景情報はメモリの制限で参照できない可能性が高い。よって、本発明は網点領域を含むカラー画像の減色処理、特に代表色決定において、高精度と省メモリ化の両立の実現を目的とする。
In
上記課題を解決するため、本発明は、以下の構成を有する。入力画像データを規定の大きさのタイルに分割するタイル分割手段と、前記分割したタイルごとに当該分割したタイルに含まれる画素の色頻度分布を生成する色頻度分布生成手段と、前記生成された色頻度分布の各階級に対し、当該各階級に属する当該タイルにおける画素の位置情報を付与する位置情報付与手段と、当該タイルにおける代表色を選定する代表色選定手段と、前記代表色選定手段で選定された代表色により、当該タイルの画素の色情報を置換する色置換手段とを有し、前記代表色選定手段は、前記色頻度分布の階級における前記位置情報を用いて当該画素が有する色情報の中から代表色候補を判定する必要極小領域色判定手段と、前記色頻度分布の階級における前記位置情報を用いて前記代表色候補である階級の色情報を統合し当該代表色を決定する階級色情報統合手段とを有する。 In order to solve the above problems, the present invention has the following configuration. A tile dividing unit that divides input image data into tiles of a predetermined size, a color frequency distribution generating unit that generates a color frequency distribution of pixels included in the divided tiles for each of the divided tiles, and the generated For each class of the color frequency distribution, a position information providing unit that provides pixel position information in the tile belonging to each class, a representative color selecting unit that selects a representative color in the tile, and the representative color selecting unit Color replacement means for replacing the color information of the pixel of the tile by the selected representative color, and the representative color selection means uses the position information in the class of the color frequency distribution and the color of the pixel Necessary minimum area color determination means for determining representative color candidates from the information and the color information of the class that is the representative color candidate are integrated using the position information in the color frequency distribution class And a class color information integrating means for determining the representative color.
また、本発明の画像処理装置は、入力画像データを規定の大きさのタイルに分割するタイル分割手段と、前記分割したタイルごとに当該分割したタイルに含まれる画素の色頻度分布を生成する色頻度分布生成手段と、前記生成された色頻度分布の各階級に対し、当該各階級に属する当該タイルにおける画素の位置情報を付与する位置情報付与手段と、前記生成された色頻度分布と前記付与された位置情報とに基づいて、当該タイルにおける代表色を選定する代表色選定手段と、前記代表色選定手段で選定された代表色により、当該タイルの画素の色情報を置換する色置換手段とを有する。 The image processing apparatus of the present invention also includes a tile dividing unit that divides input image data into tiles of a predetermined size, and a color that generates a color frequency distribution of pixels included in the divided tiles for each of the divided tiles. A frequency distribution generating unit; a position information adding unit that adds position information of a pixel in the tile belonging to each class to each class of the generated color frequency distribution; the generated color frequency distribution and the adding A representative color selecting means for selecting a representative color in the tile based on the position information, and a color replacing means for replacing the color information of the pixel of the tile with the representative color selected by the representative color selecting means; Have
本発明によれば、本発明は網点領域を含むカラー画像の減色処理、特に代表色決定において、高精度と省メモリ化が両立できる。具体的には、ヒストグラム上では頻度が低い色であっても代表色にすべき色かの判定を簡単に精度よく実現できる。また、減色後のタイル間の色むらを低減させることが可能になる。 According to the present invention, the present invention can achieve both high accuracy and memory saving in color-reduction processing of a color image including a halftone dot region, particularly in representative color determination. Specifically, even if the frequency is low on the histogram, it can be easily and accurately determined whether the color should be the representative color. In addition, it is possible to reduce color unevenness between tiles after color reduction.
<第一の実施形態>
図1は、本発明の第一の実施形態に係るシステムの装置構成図である。画像処理装置100は本発明を実現するための構成を有する。画像処理装置100は、読み取った文書の紙面情報を画像データに変換するスキャナ101と、画像データに本発明の処理を施すためのプログラムを実行するCPU102とを有する。また、画像処理装置100は、プログラムを実行する際のワークメモリやデータの一時保存等に利用されるメモリ103と、プログラムやデータを格納するハードディスク104と、外部装置とデータの入出力を行うためのネットワークI/F105とを有する。パーソナルコンピュータ(以下、PCと言う)120は、画像処理装置100とLAN110等のネットワークで接続され、画像処理装置100から送信されたデータを受信する。
<First embodiment>
FIG. 1 is an apparatus configuration diagram of a system according to the first embodiment of the present invention. The
図2は、第一の実施形態に係る画像処理装置100の機能的構成を示すブロック図である。なお、ここで示す各処理は、CPU102で電子ドキュメント生成プログラムを実行することによって実現されるものとするが、その一部又は全部を電気回路で構成し制御するようにしても構わない。画像201はスキャナ101により入力される。本実施形態では図3(A)の(1)で示すような画像が入力されたものとして説明を続ける。色量子化部202は画像201からスキャンノイズや網点をなくすために減色処理を施す。解析部203は減色した画像を解析し、文字や背景などその後の処理に必要な属性を付与する。解析結果204は203解析部の出力物である。解析結果204はその後、CPU102上、もしくはPC120上で引き続き実行される電子ドキュメント生成プログラムによって電子ファイル化される。
FIG. 2 is a block diagram illustrating a functional configuration of the
本発明の主たる構成となる色量子化部202の詳細な説明を続ける。図4は色量子化部202の機能構成を示すブロック図である。タイル分割部401は入力画像データを規定のサイズの画像(タイル)に分割し、タイル402はタイル分割部401の出力物である。例えば、入力された文書画像データを、タイル状に、32画素×32画素サイズ毎の画像(タイル)に分割していく。色量子化部202では、タイル分割部401で分割されたタイル402をひとつづつ処理していく。例えば、図3(A)の(1)で示す背景部が網点領域で前景に文字がある入力画像があった場合、タイル分割部401において図3(A)の(2)のタイル301〜304のように分割され、それぞれのタイルごとにその後の処理に遷移する。平滑化部403は、タイル分割部401で分割された入力画像データのタイル402に対し平滑化処理を行い、平滑化する。平滑化の目的は、代表色選定に網点構成点そのものの色の影響を低減させるためであり、本発明の構成において必須の処理ではない。そのため、網点構成点をつぶす手法であればなんでもよく、公知の平滑化フィルタのいずれかを用いることができる。本実施形態では平均化フィルタを使って、低解像度変換を行うものとする。低解像度変換をすると、ヒストグラム生成対象のタイルの画素数を減らせるため、結果的にヒストグラム生成処理の負荷が軽くなる効果もある。例えば、32×32画素サイズのタイルを低解像度変換することで平滑化し、16×16画素サイズの平滑化タイルを生成する。
The detailed description of the
ヒストグラム生成部408は、平滑化タイル404を入力とし、ヒストグラムを生成する。ヒストグラム生成部408は、色空間分割部405、色頻度分布生成部406、位置情報付与部407から構成される。ヒストグラム生成部408の詳細は後ほど説明する。代表色選定部409は、先に生成したヒストグラムからタイル内の代表色の数、および代表色の色情報を決定する。代表色選定部409の詳細は後ほど説明する。代表色情報410についても後ほど説明する。
The
色置換部411は、入力されたタイル402の画素単位の色情報と代表色選定部409で求めた代表色情報410との色間距離を求め、入力画像データと最も距離が近い代表色に色を置換する量子化処理を行う。この結果、量子化タイル412が生成される。なお、色置換の対象に平滑化前の入力タイルを用いるのは、小さい文字の欠けやつぶれを防ぐためである。本発明では、注目画素と代表色のRGB空間のユークリッド距離を計算しているが、色空間、距離算出方法はこれに限られるものではない。また、のちに詳細を説明する階級の位置情報を用いてもよい。
The
本発明で解決される代表色選定方法では、タイル端の微小領域の色情報が代表色として選択が可能になるが、タイル中の代表色同士の色の差があまり大きくない場合が想定される。そこで、置換する画素の位置と代表色の位置情報を参照し、置換対象となる画素位置が包含されている領域の代表色と置換することで、色の置き換えエラーの低減が可能となる。以上、色量子化部202の機能構成を説明した。
In the representative color selection method solved by the present invention, the color information of the minute area at the edge of the tile can be selected as the representative color, but it is assumed that the color difference between the representative colors in the tile is not so large. . Therefore, by referring to the position information of the pixel to be replaced and the position information of the representative color and replacing the representative color in the area including the pixel position to be replaced, the color replacement error can be reduced. The functional configuration of the
続いて、本発明の特徴となる、ヒストグラム生成部408および、代表色選定部409について詳細を説明する。はじめに、ヒストグラム生成部408について詳細を説明する。図5はヒストグラム生成部408のフローチャートである。なお、図5における色空間分割部405に該当するステップは、S4081となる。同じく、色頻度分布生成部406に該当するステップはS4082〜S4086,S4088,S4089であり、位置情報付与部407に該当するステップはS4087となる。
Next, details of the
図6はヒストグラム生成部408で扱うデータ構造の例である。図6(A)はヒストグラム中の階級のデータ構造例である。階級には画素数、平均色情報、位置情報がそれぞれ格納される。図6(B)はヒストグラムのデータ構造例である。ヒストグラムは先に述べた階級の配列構造となっている。配列の数は色空間分割部405で分割された数の分だけ存在する。以下、ヒストグラム生成部408について、図5を用いてフローチャートの処理順に説明する。S4081で、各ヒストグラムの階級のレベルを設定する。これは色空間分割部405の機能に該当する。本実施形態では一般的なカラー画像を入力と想定し、色空間分割および色頻度分布生成を行った場合について説明するが、入力はグレー画像でもよい。つまり、本実施形態で説明する色が意図する意味は、RGB値に相当するものの他に、グレースケールにも対応することを明示しておく。本実施形態では、YUV色空間の輝度YとHSV色空間の色相Hを用いたY/HS色空間を分割してヒストグラムの各階級に対応する色情報のレベルを設定する。なお、本実施形態では、Y/HS色空間を分割して複数の階級を設定するが、使用する色空間はY/HS色空間に限定するものではない。
FIG. 6 shows an example of the data structure handled by the
まず、色相Hのレベル設定について説明する。HSV色空間は図7のような円錐形をしている。半径方向は、彩度Sであり、円柱の原点に近いほうが無彩色に近く、遠い方が有彩色になる。円柱の外周角は色相を表しており、赤、マゼンタ、青、シアン、緑、黄色、橙のように0〜360度の値で色を示す。明度Vは上底から下底へ向かう方向で色が暗くなる。色相方向は、色相環における中心部H0を無彩色部と、色相環上を任意の角度で分割した領域を有彩色部(H1〜H4)の分割したレベルを設定する。 First, the setting of the hue H level will be described. The HSV color space has a conical shape as shown in FIG. The radial direction is saturation S, and the closer to the origin of the cylinder, the closer to the achromatic color, and the farther, the chromatic color. The outer peripheral angle of the cylinder represents a hue, and indicates a color with a value of 0 to 360 degrees such as red, magenta, blue, cyan, green, yellow, and orange. The brightness V becomes darker in the direction from the upper base to the lower base. The hue direction is set to a level obtained by dividing the central portion H0 in the hue circle by the achromatic color portion and a region obtained by dividing the hue circle at an arbitrary angle by the chromatic color portions (H1 to H4).
次に、輝度Yのレベル設定について説明する。輝度値Yは一次元の線形であるため、単純に画素の輝度値を規定した分割数で割ればよい。本実施形態では輝度方向を8分割している。なお、HSV色空間の明度Vより、YUV色空間の輝度Yの方がより人間の目から見た場合の明るさに近い。このため、色の明るさの情報についてはYUV色空間のYを用いた。よって、以下で述べる図8のヒストグラムでは、色相Hと輝度Yとの関係となっている。 Next, the level setting of the luminance Y will be described. Since the luminance value Y is one-dimensional linear, it is sufficient to simply divide the luminance value of the pixel by the prescribed number of divisions. In this embodiment, the luminance direction is divided into eight. Note that the luminance Y in the YUV color space is closer to the brightness when viewed from the human eye than the brightness V in the HSV color space. For this reason, Y in the YUV color space is used for information on color brightness. Therefore, in the histogram of FIG. 8 described below, there is a relationship between the hue H and the luminance Y.
図8はS4081で設定されるヒストグラムの構造を可視化したものである。このようなヒストグラムをタイル毎に生成し、次工程である代表色選定部409へ遷移する。S4082は後に述べるS4083〜S4087の処理を平滑化タイル内のすべての画素分繰り返すことを意味している。S4083で、平滑化タイルから1画素(以下P_dsと呼ぶ)を取得する。S4084で、P_dsの色情報を取得し、輝度値と色相から、色空間分割部405で分割した色空間中の輝度レベルおよび色相レベルのどこに対応するか、つまり、色頻度分布上ではどの階級に加算すべきかを判定する。S4085で、S4084で判定した輝度レベルおよび色相レベルに該当する色頻度分布の階級を呼び出し、この階級に格納されている画素数を1加算する。
FIG. 8 is a visualization of the histogram structure set in S4081. Such a histogram is generated for each tile, and the process proceeds to the representative
S4086で、該当する階級の色情報にP_dsの色情報を加算する。S4087で、P_dsの画素位置をもとに該当する階級の位置情報を更新する。画素位置の座標情報をそのまま階級の位置情報として保持させると、メモリサイズが大きくなってしまう。そのため、本実施形態において、位置情報は16ビットのエリアコードで表す。これは、図8にて可視化したヒストグラムにおいては、Locationの情報に保持される。 In S4086, the color information of P_ds is added to the color information of the corresponding class. In S4087, the position information of the corresponding class is updated based on the pixel position of P_ds. If the coordinate information of the pixel position is retained as the position information of the class as it is, the memory size becomes large. Therefore, in this embodiment, the position information is represented by a 16-bit area code. This is stored in the location information in the histogram visualized in FIG.
エリアコードの詳細について、図9を用いて説明する。図9(A)はタイル上でのエリアコードの設定範囲を図示したものである。Nは平滑化タイルの一辺の画素数を表し、それぞれ図示したようにタイルを分割してある(エリア901〜916)。本実施形態では、ヒストグラムの処理対象タイルのサイズをNとすると、タイル境界部をタイル端からN/8に設定し、さらにタイル中央部を4等分した16の領域を設定している。つまり、ここではタイル境界部とはエリア901〜905、908、909、912〜916であり、タイル中央部とはエリア906〜911である。例えば、16×16画素サイズの平滑化タイルを対象にした場合、縦方向と横方向それぞれを2:6:6:2の画素比率で分割したエリアが設定される。
Details of the area code will be described with reference to FIG. FIG. 9A illustrates the area code setting range on the tile. N represents the number of pixels on one side of the smoothing tile, and each tile is divided as shown in the figure (
なお各エリアのサイズが異なっているのは、文字などの一部がタイル分割で分断されタイル内でごく小さく存在する極小領域に対する扱いを考慮するためである。そのため少なくとも、タイル境界部とタイル中央部が定義されればよく、分割する領域の範囲(サイズ)はこれに限らない。例えばタイルを均等に16分割したうちのタイル境界線に接する部分をタイル境界部、それ以外をタイル中央部と設定してもよい。同じく、図9(A)ではタイル境界部とタイル中央部は複数の領域から構成されているが、分割する領域の数はこれに限定されるわけではなく、例えばタイル境界部とタイル中央部がそれぞれ1つの領域(計2つの領域)として定義してもいい。 Note that the size of each area is different in order to consider the handling of a very small area in which a part of a character or the like is divided by tile division and exists very small in the tile. Therefore, at least the tile boundary and the tile center need only be defined, and the range (size) of the area to be divided is not limited to this. For example, a portion in contact with a tile boundary line among 16 equally divided tiles may be set as a tile boundary portion, and the other portion may be set as a tile central portion. Similarly, in FIG. 9A, the tile boundary part and the tile center part are composed of a plurality of areas, but the number of areas to be divided is not limited to this, for example, the tile boundary part and the tile center part are Each may be defined as one area (two areas in total).
図9(B)にて示したように図9(A)にて定義したエリアそれぞれに対応したLocation情報を16ビットのエリアコードにて定義する。ここでは、16ビットのうちそれぞれ4ビットごとに、MIDDLE AREA、TOP/BOTTOM ENDS、RIGHT/LEFT ENDS、CORNERと定義する。そして、MIDDLE AREAは図9(A)におけるエリア906、907、910、911にそれぞれ対応する。同様にTOP/BOTTOM ENDSはエリア902、903、914、915と、RIGHT/LEFT ENDSは905、908、909、912と、CORNERは901、904、913、916とそれぞれ対応する。
As shown in FIG. 9B, the location information corresponding to each area defined in FIG. 9A is defined by a 16-bit area code. Here, every 4 bits out of 16 bits are defined as MIDDLE AREA, TOP / BOTTOM ENDS, RIGHT / LEFT ENDS, and CORNER. MIDDLE AREA corresponds to
S4087では、P_dsの画素位置を参照し、図9(A)で示したエリア901〜916のうち、どのエリアに入るかを判定し、該当するエリアコードのビットを0から1に更新する。例えば、ある階級に計上されたP_dsの画素位置がエリアコード設定範囲においてエリア901に該当した場合、図9(C)のようにエリア901に対応する右から4ビット目を0から1に更新する。S4083からS4087までの処理を平滑化タイルの画素分繰り返すと(S4082)、ある階級の位置情報はたとえば図9(D)のようになる。これは、この階級に計上された画素はエリアコード設定範囲におけるエリア909,910,913,914に存在していたことを意味している。
In S4087, the pixel position of P_ds is referred to, it is determined which of the
S4088はS4089の処理を階級数分繰り返すことを意味している。S4089では、色頻度分布の階級にカウントされた画素の色情報の平均を求めている。具体的にはS4086で各階級に加算された色情報の総和を、各階級の画素数で除算している。本処理をすべての階級分実施する。以上の処理により、平滑化タイルから、色頻度分布(ヒストグラム)の各階級における平均色の情報、および色頻度分布の各階級毎の位置情報(エリアコード)を生成する。 S4088 means that the process of S4089 is repeated for the number of classes. In S4089, the average of the color information of the pixels counted in the color frequency distribution class is obtained. Specifically, the sum of the color information added to each class in S4086 is divided by the number of pixels of each class. Implement this process for all classes. Through the above processing, the average color information for each class of the color frequency distribution (histogram) and the position information (area code) for each class of the color frequency distribution are generated from the smoothed tile.
次に、代表色選定部409について詳細を説明する。図10は代表色選定部409のフローチャートである。S4091では、代表色を決める手法を選択する。ここでは、ヒストグラムの分布形状から、代表色の決定方法を選択する。例えば、ヒストグラムのある一階級にタイル中の画素のすべて計上されている場合はタイルを1色化する処理に遷移する(method1、第一の代表色処理手段)。また、ある一階級にタイル中の画素のうち所定の数以上(例えば、90%以上)が計上され、残りの画素も近接する階級に計上されているヒストグラムであれば、タイルの代表色は1色である可能性が高いので、タイルを1色化する処理に遷移する(method1)。
Next, details of the representative
同一色相レベルのみに画素が存在するが、輝度レベル方向に極大点が複数あるヒストグラムや、異なる色相レベルの階級に画素が存在するヒストグラムは、タイル中に2色以上の色が存在している可能性が高い。よって、タイルから2色以上の複数色を代表色として選定する処理に遷移する(method2、第二の代表色処理手段)。 Pixels that exist only at the same hue level, but histograms with multiple local maxima in the luminance level direction and histograms with pixels in different hue level classes may have two or more colors in the tile. High nature. Therefore, the process shifts to processing for selecting two or more colors as representative colors from the tile (method2, second representative color processing means).
また、同一色相レベルにあるが、輝度レベル方向の分布の幅が狭い(すなわち、当該ブロック内の画素が有する輝度がいずれも近似している)ヒストグラムの場合、網点領域の色むら、もしくは残すべき極小領域の色情報が混ざっている可能性がある。よって、タイルから1〜2色の代表色を選定する処理に遷移する(method3、第三の代表色処理手段)。なお、ここでは3つの方法に分岐しているが、ヒストグラムや他の特徴量を見て、さらに適した減色手法を用意して選択してもよい。
Further, in the case of a histogram having the same hue level but a narrow distribution width in the luminance level direction (that is, the luminances of the pixels in the block are all approximated), the color unevenness of the halftone dot region is left or left. There is a possibility that the color information of the minimal region should be mixed. Therefore, the process shifts to a process of selecting one or two representative colors from the tile (
S4092では、代表色候補階級を決定する。ここでは、S4091で選ばれた代表色の決定方法に対応してそれぞれ分岐する。method1では、代表色を1色に決める処理であるので、最も画素数の多い階級を代表色候補階級とする。method2では、代表色を2色以上に決める処理である。ここでは色頻度の極大点となる階級を代表色候補階級とする。なお、ここで説明した代表色候補階級決定方法はこれに限られるものではなく、一般的なヒストグラムや他の特徴量を用いた画像処理の手法であれば他の方法を用いてもよい。method3では、代表色を1色、もしくは、2色に決める処理である。処理対象のタイルが、網点領域だけ存在するのか、タイル端で切れた極小領域をもつものなのかの判定には、周辺タイルの情報を用いるのが一般的である。しかし、該当タイル以外の隣接するタイルの色情報やページ全体の背景情報はメモリサイズの関係上参照できない可能性が高い。よって、method3は処理対象タイルのヒストグラムの情報のみで代表色を1色、もしくは、2色に決める。
In S4092, the representative color candidate class is determined. Here, the branching is performed corresponding to the representative color determination method selected in S4091. Since
[代表色決定方法(method3)]
上記に示したmethod3の代表色決定方法の詳細について図11を用いて説明する。S40921では、ヒストグラム中最も画素数の多い階級を代表色の“候補1”とする。S40922では、画素が計数されている階級のうち、候補1の階級から輝度レベル方向で最も離れている階級を代表色の“候補2”とする。背景色と文字などの前景の色は、人の眼に見やすいように輝度差をつける傾向にある特徴を利用している。S40923では、候補2の階級の画素数が十分大きいかを判定する。ここで画素数に対する判定基準となる閾値については、予め定義しておくものとし、経験的に決定してもよいし、任意の算出式により導いてもよい。画素数が十分大きいと判定された場合はS40925へ、そうでないならばS40924へ遷移する。S40924では、候補2が残すべき色情報か否かを判定する(必要極小領域色判定)。具体的には、候補2の階級が有する位置情報を参照し、エリアコードがタイル境界部のみか否かを判定する。
[Representative color determination method (method 3)]
Details of the
ここで、タイル境界部とは、図9(A)でいうと、エリア901〜905,908,909,912〜916を意味する。タイル分割で隣のタイルから一部ちぎれてしまった小さな文字領域はタイル境界部のみに存在する可能性がある。つまり、候補2の階級のエリアコードがタイル境界部のみであれば、この階級は残すべき極小領域の色とみなせる。従って、S40924でYesと判定されれば、S40925へ遷移し、候補2の階級を採用する。これに対し、画素数が小さく、エリアコードがタイル中央部のエリア906,907,910,911のいずれかに該当する場合、候補2の階級の色は網点の構成点の一部であり、残してはならない色(ノイズ)とみなせる。従って、S40924でNoと判定されれば、S40926へ遷移し、候補2の階級は代表色から却下される。以上、method1〜3により代表色候補階級が決定され、次の処理(図10、S4093)へ遷移する。
Here, the tile boundary portion means
S4093では代表色の色情報を決定する。詳細について図12を用いて説明する。S40931はS40932〜S40934の処理を代表色候補階級分繰り返すことを意味している。S40932では、候補階級の色情報をそのまま使うか、近接する階級の色情報と統合するかを判定する(階級色情報統合判定)。具体的には、候補階級と、この階級と隣接している非候補階級とを参照し、これらの階級の位置情報が一致するかを判定する。網点の構成点の色情報は単一の階級に納まらず、近接する階級にも分布している場合がある。となると、S4092で決めた候補階級(ヒストグラムにおける最頻度階級、もしくは極大点となる階級)がタイルごとにずれを生じ、階級が有する平均色情報をそのままタイルの代表色とするとタイル間での色差が大きくなる可能性がある。 In S4093, the color information of the representative color is determined. Details will be described with reference to FIG. S40931 means that the processing of S40932 to S40934 is repeated for the representative color candidate classes. In S40932, it is determined whether the color information of the candidate class is used as it is or is integrated with the color information of the adjacent class (class color information integration determination). Specifically, the candidate class and the non-candidate class adjacent to this class are referred to, and it is determined whether the position information of these classes matches. In some cases, the color information of halftone dots is not distributed in a single class but is distributed in adjacent classes. Then, the candidate class determined in S4092 (the most frequent class in the histogram, or the class that becomes the maximum point) is shifted for each tile, and if the average color information of the class is used as the representative color of the tile as it is, the color difference between the tiles May become large.
一般的には周辺タイルやページ全体の背景の色情報を参照し、タイル間の色差を小さくする補正を行うが、本実施形態では、該当タイルのヒストグラムの情報のみで解決する。つまり、ヒストグラムから同一網点領域に存在する網点の構成点の色情報を有する階級を捜し、候補階級の色情報と統合を行う。網点の構成点の色情報を有する階級か否かを判定するには、候補階級と同じ領域にある画素が加算されたか否かを判定基準とすればよい。つまり、階級のエリアコードが同じかどうかで判定できる。従って、S40932にてエリアコードが一致する場合(Yesの場合)は、S40933へ遷移し、互いの階級の色情報を統合した色を再計算し、この色情報を代表色に採用する。統合色の算出方法は互いの階級におけるRGB値の単純平均でもよく、その階級に加算された画素数を重みとした加重平均を取ってもよい。これに対しS40932にてNo、すなわち近接する階級のエリアコードが一致しないと判定されれば、S40934へ遷移し、候補階級の色情報そのものを代表色に採用する。以上の処理により代表色情報410(図4)が決定され、次の処理の色置換部411(図4)へ遷移する。 In general, correction is performed to reduce the color difference between the tiles by referring to the color information of the background of the surrounding tiles and the entire page, but in this embodiment, the problem is solved only by the histogram information of the corresponding tiles. That is, the class having the color information of the constituent points of the halftone dots existing in the same halftone dot area is searched from the histogram, and is integrated with the color information of the candidate class. In order to determine whether or not the class has color information of the constituent points of the halftone dots, whether or not pixels in the same area as the candidate class are added may be used as a determination criterion. That is, it can be determined whether the class area codes are the same. Therefore, when the area codes match in S40932 (in the case of Yes), the process proceeds to S40933, where a color obtained by integrating the color information of each class is recalculated, and this color information is adopted as the representative color. The calculation method of the integrated color may be a simple average of RGB values in each class, or a weighted average with the number of pixels added to the class as a weight. On the other hand, if it is determined No in S40932, that is, if the area codes of the adjacent classes do not match, the process proceeds to S40934, and the color information of the candidate class itself is adopted as the representative color. The representative color information 410 (FIG. 4) is determined by the above processing, and the process proceeds to the color replacement unit 411 (FIG. 4) of the next processing.
以上、説明したように本実施形態ではヒストグラム生成時に、ヒストグラムの各階級の位置情報を付与し、代表色選定時にヒストグラムの位置情報を用いる。これにより、処理対象タイルのヒストグラム情報だけで、代表色候補となる階級が1色か2色かを的確に判定できる。同様に、処理対象タイルのヒストグラム情報だけでより正確に網点領域の代表色を決定でき、タイル間の色差を低減させることが可能となる。 As described above, in the present embodiment, the position information of each class of the histogram is given when generating the histogram, and the position information of the histogram is used when selecting the representative color. Thereby, it is possible to accurately determine whether the representative color candidate class is one color or two colors only with the histogram information of the processing target tile. Similarly, the representative color of the halftone dot region can be determined more accurately only with the histogram information of the processing target tile, and the color difference between the tiles can be reduced.
<第二の実施形態>
第一の実施形態では、ヒストグラムの位置情報をmethod3(網点領域のタイルもしくは極小領域を含むタイルから代表色を1ないし2色選定する)において使用していた。しかし、ヒストグラムの位置情報はタイルの代表色を2色以上に決めるmethod2においても有効である。例えば、ヒストグラム中から候補となる階級を算出したのち、その候補階級が残すべき色か否かの判定に位置情報を用いる。エリアコードがタイル境界部のみであれば、代表色候補階級に採用し、そうでなければ却下する。
<Second Embodiment>
In the first embodiment, the position information of the histogram is used in method 3 (one or two representative colors are selected from tiles in a halftone dot area or tiles including a minimal area). However, the position information of the histogram is also effective in
以上により、代表色が2色以上存在するタイルにおいても、処理対象タイルのヒストグラム情報だけで、候補にあがった色を残すべきか否かを的確に判定できる。 As described above, even in a tile having two or more representative colors, it is possible to accurately determine whether or not a candidate color should be left based only on the histogram information of the processing target tile.
<その他の実施形態>
また、本発明は、以下の処理を実行することによっても実現される。即ち、上述した実施形態の機能を実現するソフトウェア(プログラム)を、ネットワーク又は各種記憶媒体を介してシステム或いは装置に供給し、そのシステム或いは装置のコンピュータ(またはCPUやMPU等)がプログラムを読み出して実行する処理である。
<Other embodiments>
The present invention can also be realized by executing the following processing. That is, software (program) that realizes the functions of the above-described embodiments is supplied to a system or apparatus via a network or various storage media, and a computer (or CPU, MPU, or the like) of the system or apparatus reads the program. It is a process to be executed.
Claims (10)
前記分割したタイルごとに当該分割したタイルに含まれる画素の色頻度分布を生成する色頻度分布生成手段と、
前記生成された色頻度分布の各階級に対し、当該各階級に属する当該タイルにおける画素の位置情報を付与する位置情報付与手段と、
当該タイルにおける代表色を選定する代表色選定手段と、
前記代表色選定手段で選定された代表色により、当該タイルの画素の色情報を置換する色置換手段と
を有し、
前記代表色選定手段は、
前記色頻度分布の階級における前記位置情報を用いて当該画素が有する色情報の中から代表色候補を判定する必要極小領域色判定手段と、
前記色頻度分布の階級における前記位置情報を用いて前記代表色候補である階級の色情報を統合し当該代表色を決定する階級色情報統合手段と
を有することを特徴とする画像処理装置。 Tile dividing means for dividing the input image data into tiles of a prescribed size;
Color frequency distribution generating means for generating a color frequency distribution of pixels included in the divided tile for each of the divided tiles;
Position information giving means for giving position information of pixels in the tile belonging to each class to each class of the generated color frequency distribution;
Representative color selection means for selecting a representative color in the tile;
Color replacement means for replacing color information of pixels of the tile with the representative color selected by the representative color selection means;
The representative color selection means is:
Necessary minimum area color determination means for determining a representative color candidate from color information of the pixel using the position information in the color frequency distribution class;
An image processing apparatus comprising: class color information integration means for integrating the color information of the class that is the representative color candidate using the position information in the class of the color frequency distribution and determining the representative color.
前記代表色候補を1色として決定する第一の代表色処理手段と、
前記代表色候補を複数色として決定する第二の代表色処理手段と、
前記代表色候補を1または2色として決定する第三の代表色処理手段と
を更に有し、
前記第一の代表色処理手段は、前記色頻度分布において当該タイルに含まれる全ての画素が同一の階級に位置する、もしくは所定の数以上の画素が同一の階級に位置しかつ当該階級の近接する階級に残りの画素が位置する場合に選択され、
前記第二の代表色処理手段は、前記色頻度分布において当該タイルに含まれる全ての画素が同一の色相を有しかつ輝度が同一の画素が複数ある、もしくは当該タイルに含まれる画素がそれぞれ異なる色相を有する場合に選択され、
前記第三の代表色処理手段は、前記色頻度分布において当該タイルに含まれる全ての画素が同一の色相を有しかつそれぞれの輝度が近似している場合に選択される
ことを特徴とする請求項1乃至3のいずれか一項に記載の画像処理装置。 The representative color selection means is a means for determining the representative color candidates.
First representative color processing means for determining the representative color candidate as one color;
Second representative color processing means for determining the representative color candidates as a plurality of colors;
And third representative color processing means for determining the representative color candidate as one or two colors,
In the color frequency distribution, the first representative color processing means is configured such that all pixels included in the tile are located in the same class, or a predetermined number or more of pixels are located in the same class and are close to the class. Selected when the remaining pixels are in the class
In the second representative color processing means, in the color frequency distribution, all the pixels included in the tile have the same hue and a plurality of pixels having the same luminance, or the pixels included in the tile are different. Selected if it has a hue,
The third representative color processing means is selected when all the pixels included in the tile in the color frequency distribution have the same hue and the respective luminances are approximate. Item 4. The image processing device according to any one of Items 1 to 3.
前記色頻度分布生成手段と前記位置情報付与手段と前記代表色選定手段とにおいて用いたタイルは、前記平滑化手段で生成した平滑化タイルであり、
前記色置換手段で用いたタイルは、前記平滑化処理する前のタイルであることを特徴とする請求項1乃至4のいずれか一項に記載の画像処理装置。 Smoothing means for generating a smoothed tile by smoothing the tile divided by the tile dividing means;
The tile used in the color frequency distribution generation means, the position information giving means, and the representative color selection means is a smoothing tile generated by the smoothing means,
The image processing apparatus according to claim 1, wherein the tile used in the color replacement unit is a tile before the smoothing process.
前記画像処理装置の色頻度分布生成手段が、前記分割したタイルごとに当該分割したタイルに含まれる画素の色頻度分布を生成する色頻度分布生成工程と、
前記画像処理装置の位置情報付与手段が、前記生成された色頻度分布の各階級に対し、当該各階級に属する当該タイルにおける画素の位置情報を付与する位置情報付与工程と、
前記画像処理装置の代表色選定手段が、当該タイルにおける代表色を選定する代表色選定工程と、
前記画像処理装置の色置換手段が、前記代表色選定工程で選定された代表色により、当該タイルの画素の色情報を置換する色置換工程と
を有し、
前記代表色選定工程は、
前記画像処理装置の必要極小領域色判定手段が、前記色頻度分布の階級における前記位置情報を用いて当該画素が有する色情報の中から代表色候補を判定する必要極小領域色判定工程と、
前記画像処理装置の階級色情報統合手段が、前記色頻度分布の階級における前記位置情報を用いて前記代表色候補である階級の色情報を統合し当該代表色を決定する階級色情報統合工程と
を有することを特徴とする制御方法。 A tile dividing step in which the tile dividing means of the image processing apparatus divides the input image data into tiles of a prescribed size;
A color frequency distribution generating step of generating a color frequency distribution of pixels included in the divided tile for each of the divided tiles;
A position information providing step in which the position information providing unit of the image processing apparatus assigns the position information of the pixels in the tile belonging to each class to each class of the generated color frequency distribution;
A representative color selection unit of the image processing apparatus selects a representative color in the tile;
A color replacement step of replacing the color information of the pixels of the tile by the representative color selected in the representative color selection step;
The representative color selection process includes
A necessary minimum area color determining unit of the image processing apparatus, which uses the position information in the color frequency distribution class to determine a representative color candidate from color information of the pixel;
A class color information integration step in which the class color information integration unit of the image processing apparatus integrates the color information of the class that is the representative color candidate using the position information in the class of the color frequency distribution and determines the representative color; A control method characterized by comprising:
入力画像データを規定の大きさのタイルに分割するタイル分割手段と、
前記分割したタイルごとに当該分割したタイルに含まれる画素の色頻度分布を生成する色頻度分布生成手段と、
前記生成された色頻度分布の各階級に対し、当該各階級に属する当該タイルにおける画素の位置情報を付与する位置情報付与手段と、
当該タイルにおける代表色を選定する代表色選定手段と、
前記代表色選定手段で選定された代表色により、当該タイルの画素の色情報を置換する色置換手段と
して機能させ、
前記代表色選定手段は、
前記色頻度分布の階級における前記位置情報を用いて当該画素が有する色情報の中から代表色候補を判定する必要極小領域色判定手段と、
前記色頻度分布の階級における前記位置情報を用いて前記代表色候補である階級の色情報を統合し当該代表色を決定する階級色情報統合手段と
して機能することを特徴とするプログラム。 Computer
Tile dividing means for dividing the input image data into tiles of a prescribed size;
Color frequency distribution generating means for generating a color frequency distribution of pixels included in the divided tile for each of the divided tiles;
Position information giving means for giving position information of pixels in the tile belonging to each class to each class of the generated color frequency distribution;
Representative color selection means for selecting a representative color in the tile;
The representative color selected by the representative color selection means functions as a color replacement means for replacing the color information of the pixel of the tile,
The representative color selection means is:
Necessary minimum area color determination means for determining a representative color candidate from color information of the pixel using the position information in the color frequency distribution class;
A program that functions as a class color information integration unit that integrates color information of a class that is a representative color candidate using the position information in the class of the color frequency distribution and determines the representative color.
前記分割したタイルごとに当該分割したタイルに含まれる画素の色頻度分布を生成する色頻度分布生成手段と、
前記生成された色頻度分布の各階級に対し、当該各階級に属する当該タイルにおける画素の位置情報を付与する位置情報付与手段と、
前記生成された色頻度分布と前記付与された位置情報とに基づいて、当該タイルにおける代表色を選定する代表色選定手段と、
前記代表色選定手段で選定された代表色により、当該タイルの画素の色情報を置換する色置換手段と
を有することを特徴とする画像処理装置。 Tile dividing means for dividing the input image data into tiles of a prescribed size;
Color frequency distribution generating means for generating a color frequency distribution of pixels included in the divided tile for each of the divided tiles;
Position information giving means for giving position information of pixels in the tile belonging to each class to each class of the generated color frequency distribution;
Representative color selecting means for selecting a representative color in the tile based on the generated color frequency distribution and the given position information;
An image processing apparatus comprising: a color replacement unit that replaces color information of pixels of the tile with the representative color selected by the representative color selection unit.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2010001569A JP5337060B2 (en) | 2010-01-06 | 2010-01-06 | Image processing apparatus, control method, and program |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2010001569A JP5337060B2 (en) | 2010-01-06 | 2010-01-06 | Image processing apparatus, control method, and program |
Publications (2)
Publication Number | Publication Date |
---|---|
JP2011142471A true JP2011142471A (en) | 2011-07-21 |
JP5337060B2 JP5337060B2 (en) | 2013-11-06 |
Family
ID=44458024
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP2010001569A Expired - Fee Related JP5337060B2 (en) | 2010-01-06 | 2010-01-06 | Image processing apparatus, control method, and program |
Country Status (1)
Country | Link |
---|---|
JP (1) | JP5337060B2 (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN113808120A (en) * | 2021-09-24 | 2021-12-17 | 维沃移动通信有限公司 | Image processing method, image processing device, electronic equipment and storage medium |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JPH10341347A (en) * | 1997-06-09 | 1998-12-22 | Fujitsu Ltd | Device for processing color image transfer and processing color image restoration, method therefor and color image transfer system |
JP2004336282A (en) * | 2003-05-06 | 2004-11-25 | Ricoh Co Ltd | Image processor, image processing program and recording medium recorded with relevant program |
JP2008113446A (en) * | 2002-09-05 | 2008-05-15 | Ricoh Co Ltd | Image processing device, image processing program and recording medium |
JP2009228229A (en) * | 2008-03-19 | 2009-10-08 | Miwa Lock Co Ltd | Connecting structure of inner and outer mounting seats for door |
-
2010
- 2010-01-06 JP JP2010001569A patent/JP5337060B2/en not_active Expired - Fee Related
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JPH10341347A (en) * | 1997-06-09 | 1998-12-22 | Fujitsu Ltd | Device for processing color image transfer and processing color image restoration, method therefor and color image transfer system |
JP2008113446A (en) * | 2002-09-05 | 2008-05-15 | Ricoh Co Ltd | Image processing device, image processing program and recording medium |
JP2004336282A (en) * | 2003-05-06 | 2004-11-25 | Ricoh Co Ltd | Image processor, image processing program and recording medium recorded with relevant program |
JP2009228229A (en) * | 2008-03-19 | 2009-10-08 | Miwa Lock Co Ltd | Connecting structure of inner and outer mounting seats for door |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN113808120A (en) * | 2021-09-24 | 2021-12-17 | 维沃移动通信有限公司 | Image processing method, image processing device, electronic equipment and storage medium |
WO2023045857A1 (en) * | 2021-09-24 | 2023-03-30 | 维沃移动通信有限公司 | Image processing method and apparatus, electronic device and storage medium |
Also Published As
Publication number | Publication date |
---|---|
JP5337060B2 (en) | 2013-11-06 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
JP2009225422A (en) | Image encoding apparatus, image processing apparatus, and control method thereof | |
US8335373B2 (en) | Image processing apparatus and control method thereof | |
JP5511468B2 (en) | Image processing apparatus, control method therefor, and program | |
US9253368B2 (en) | Image processing device setting binary value without using dither matrix when prescribed condition is satisfied | |
US7953296B2 (en) | Image resolution conversion with error detection | |
US8620081B2 (en) | Image processing apparatus, method, and storage medium for determining attributes | |
US8285036B2 (en) | Image processing method, image processing apparatus, and computer-readable storage medium for computer program | |
JP2015216455A (en) | Image processing device, image processing method and program | |
JP2006115500A (en) | High-speed low memory paper color suppression algorithm | |
JP5151708B2 (en) | Image processing apparatus and image processing program | |
JP6370080B2 (en) | Image processing apparatus, image processing method, and program. | |
EP3096294B1 (en) | Computer program, image processing apparatus, and method for improving quality of image data | |
JP5337060B2 (en) | Image processing apparatus, control method, and program | |
JP2004199622A (en) | Apparatus and method for image processing, recording media, and program | |
JP2013102300A (en) | Image processor and image processing method | |
JP6486082B2 (en) | Image processing apparatus, image processing method, and program | |
JP5337059B2 (en) | Image processing apparatus, control method, and program | |
JP2013102299A (en) | Image processor and image processing method | |
JP6765103B2 (en) | Image processing device, image processing program and image processing method | |
JP5457853B2 (en) | Image encoding apparatus, image encoding method, program, and storage medium | |
JP5915410B2 (en) | Image processing apparatus and program | |
JP2003116014A (en) | Image processing equipment and method therefor, computer program and computer readable storage medium | |
CN103856685A (en) | Image Processing Apparatus and Image Processing Method | |
JP5915411B2 (en) | Image processing apparatus and program | |
JP2012105065A (en) | Image processing system and program |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
A621 | Written request for application examination |
Free format text: JAPANESE INTERMEDIATE CODE: A621 Effective date: 20121227 |
|
A977 | Report on retrieval |
Free format text: JAPANESE INTERMEDIATE CODE: A971007 Effective date: 20130701 |
|
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: 20130705 |
|
A61 | First payment of annual fees (during grant procedure) |
Free format text: JAPANESE INTERMEDIATE CODE: A61 Effective date: 20130802 |
|
R151 | Written notification of patent or utility model registration |
Ref document number: 5337060 Country of ref document: JP Free format text: JAPANESE INTERMEDIATE CODE: R151 |
|
LAPS | Cancellation because of no payment of annual fees |