JP2013102300A - Image processor and image processing method - Google Patents
Image processor and image processing method Download PDFInfo
- Publication number
- JP2013102300A JP2013102300A JP2011243973A JP2011243973A JP2013102300A JP 2013102300 A JP2013102300 A JP 2013102300A JP 2011243973 A JP2011243973 A JP 2011243973A JP 2011243973 A JP2011243973 A JP 2011243973A JP 2013102300 A JP2013102300 A JP 2013102300A
- Authority
- JP
- Japan
- Prior art keywords
- color
- hue
- class
- frequency distribution
- classes
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
Landscapes
- Image Processing (AREA)
- Facsimile Image Signal Circuits (AREA)
- Color Image Communication Systems (AREA)
Abstract
【課題】 減色処理において、にじみが支配的になったヒストグラムから、簡易的に精度よく文字色を選択する。
【解決手段】 色相環において設定した複数の領域と輝度方向に設定した複数の輝度レベルとに基づいて構成される複数の階級を定め、入力画像から各階級の頻度分布を作成し、階級間の色相差が所定の閾値以上あるか否かを判定する。ここで、所定の閾値以上あると判定した場合は色相が最大の階級の色情報と色相が最小の階級の色情報とを代表色として選定する。一方、所定の閾値以上ないと判定した場合は、頻度分布が最大の階級の色情報と当該最大の階級から最も輝度差がある階級の色情報とを代表色として選定する。そして、入力画像に含まれる各画素値を選定された代表色に置換する。
【選択図】 図2PROBLEM TO BE SOLVED: To easily and accurately select a character color from a histogram in which blurring becomes dominant in color reduction processing.
SOLUTION: A plurality of classes configured based on a plurality of areas set in a hue circle and a plurality of luminance levels set in a luminance direction are determined, and a frequency distribution of each class is created from an input image, and It is determined whether the hue difference is equal to or greater than a predetermined threshold. Here, when it is determined that the threshold value is equal to or greater than the predetermined threshold, the color information of the class having the maximum hue and the color information of the class having the minimum hue are selected as the representative colors. On the other hand, when it is determined that it is not equal to or greater than the predetermined threshold, the color information of the class having the highest frequency distribution and the color information of the class having the most luminance difference from the maximum class are selected as representative colors. Then, each pixel value included in the input image is replaced with the selected representative color.
[Selection] Figure 2
Description
本発明は、入力画像の代表色を選定して減色処理を行う画像処理装置及び画像処理方法に関するものである。 The present invention relates to an image processing apparatus and an image processing method for performing a color reduction process by selecting a representative color of an input image.
近年、情報の電子化が進み、紙文書を保存するのではなく、紙文書をスキャナ等で読み込み、電子データとして保存し、その電子データを他装置に送信するシステムが普及している。また、紙文書そのものに使われる色も白黒の2値からカラー化(多値化)が進んでいる。 In recent years, the digitization of information has progressed, and instead of storing a paper document, a system that reads a paper document with a scanner or the like, stores it as electronic data, and transmits the electronic data to another device has become widespread. In addition, the color used for the paper document itself has been changed from black and white to color (multi-value).
電子データとして保存される電子文書には、可読性向上や高圧縮性を実現させるために文字部は鮮明な色が、背景は均一な色が求められている。しかし、実際に紙文書を電子化する際には、各種のノイズやにじみ、むらなどが発生する。特に、スクリーン等を使用したハーフトーンで構成されたカラー文書では、スクリーンの構成要素(網点と称す)そのものの色に起因したにじみ、むらなどが発生し、可読性や画質に影響を及ぼす。 An electronic document stored as electronic data is required to have a clear color for the character portion and a uniform color for the background 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 halftones using a screen or the like, blurring and unevenness due to the colors of the screen components (called halftone dots) themselves occur, which affects readability and image quality.
このため、文書の電子化処理において、画像中から代表色を選定し減色する減色処理を行うのが一般的である。 For this reason, in document digitization processing, color reduction processing is generally performed in which a representative color is selected from an image and reduced.
スキャン画像の減色処理は、一般的にスキャナや複合機などの機器に組み込み、リアルタイムで稼働させることが想定される。よって、減色処理には高精度もさることながら、高速化と省メモリ化が求められる。 It is assumed that the color reduction processing of the scanned image is generally incorporated in a device such as a scanner or a multifunction machine and is operated in real time. Therefore, the color reduction processing requires high speed and memory saving as well as high accuracy.
タイル単位での減色処理における領域境界に発生したにじみの色を判定する技術が公開されている(例えば、特許文献1参照)。まず、入力画像を規定のサイズのタイルに分割し、色頻度分布生成用の低解像度画像とエッジ頻度分布生成用のエッジ画像を生成する。低解像度画像のある画素を第一の頻度分布(色頻度分布)のある階級(binと称す)に加算した際に、加算画素と同じ位置の画像の画素がエッジ領域であれば、第二の頻度分布(エッジ頻度分布)に加算する。 A technique for determining a blur color generated at an area boundary in a color reduction process in units of tiles is disclosed (for example, see Patent Document 1). First, an input image is divided into tiles of a prescribed size, and a low-resolution image for generating a color frequency distribution and an edge image for generating an edge frequency distribution are generated. When a pixel in a low-resolution image is added to a class (referred to as bin) having a first frequency distribution (color frequency distribution), if the pixel in the image at the same position as the added pixel is an edge region, the second Add to the frequency distribution (edge frequency distribution).
このようにして作った2つの頻度分布のうち、第一の頻度分布の頻度上位3色を候補色とし、候補色の第二の頻度分布が大きければ、その色は領域の境界部にある色、すなわち、にじみと判断し、候補色から外している。 Of the two frequency distributions created in this way, the top three colors of the first frequency distribution are set as candidate colors, and if the second frequency distribution of the candidate colors is large, that color is the color at the boundary of the region. In other words, it is judged as blurring and excluded from the candidate colors.
また、一般的に、タイル中の背景と前景の境界長が短ければ、両方の色が混じって発生する境界のにじみの出現頻度は前景色及び背景色よりも小さい。よって、タイル画像中の出現頻度が高い色が当該タイル画像における前景や背景となる重要な色とみなせるので、頻度の高い色を代表色に選択するのが一般的である。 In general, when the boundary length between the background and the foreground in the tile is short, the appearance frequency of the boundary blur generated by mixing both colors is smaller than the foreground and background colors. Therefore, since a color with a high appearance frequency in the tile image can be regarded as an important color that becomes a foreground or background in the tile image, it is common to select a color with a high frequency as a representative color.
一方、図5に示す(F)のように、複雑な漢字の一部等で出現し易い前景と背景の境界が多いタイルでは、前景や背景そのものを表現している色よりも、境界のにじみの方が、出現頻度が大きくなる場合がある。 On the other hand, as shown in (F) of FIG. 5, in tiles with many foreground and background boundaries that tend to appear as part of complex Chinese characters, the border blurs more than the color representing the foreground and background itself. May appear more frequently.
そのため、代表色の選択基準を画素の出現頻度だけとすると、選ばれるべきではない色、すなわちにじみが代表色となってしまう場合がある。 Therefore, if the selection criterion of the representative color is only the appearance frequency of the pixel, a color that should not be selected, that is, blur may be the representative color.
また、特許文献1の技術では、色のにじみを判定するために別途エッジ画像と第二の頻度分布を利用する分のメモリが必要になる。 Further, in the technique of Patent Document 1, a separate memory for using the edge image and the second frequency distribution is required to determine color bleeding.
本発明は、にじみが支配的になったヒストグラムから、簡便に精度よく文字色を選択可能な装置及び方法を提供する。 The present invention provides an apparatus and method that can easily and accurately select a character color from a histogram in which blurring has become dominant.
本発明の画像処理装置は、彩度と色相とによって構成される色相環を所定の基準に基づいて分割することによって、前記色相環における複数の領域を設定し、更に、所定の色空間の輝度方向を分割することにより複数の輝度レベルを設定し、前記色相環において設定した複数の領域と前記輝度方向に設定した複数の輝度レベルとに基づいて構成される複数の階級を定める色空間分割手段と、
第1の画像データに含まれる全ての画素を対象として、前記色空間分割手段で決定された各階級に属する画素の数を計数することにより頻度分布を作成するとともに、各階級に属する画素の色情報の平均値を当該各階級の色情報として求める頻度分布作成手段と、
前記頻度分布作成手段で求めた前記各階級の色情報に基づいて、階級間の色相差が所定の閾値以上あるか否かを判定する判定手段と、
前記判定手段で前記階級間の色相差が前記所定の閾値以上あると判定した場合は、前記色相が最大の階級の色情報と前記色相が最小の階級の色情報とを代表色として選定する一方、前記判定手段で前記階級間の色相差が前記所定の閾値以上ないと判定した場合は、前記頻度分布作成手段で作成した頻度分布が最大の階級の色情報と当該最大の階級から最も輝度差がある階級の色情報とを代表色として選定する代表色選定手段と、
前記第1の画像データに含まれる画素の各画素値を、前記選定された代表色を用いて置換する置換手段と、
を有することを特徴とする。
The image processing apparatus of the present invention sets a plurality of regions in the hue circle by dividing a hue circle constituted by saturation and hue based on a predetermined criterion, and further, brightness of a predetermined color space Color space dividing means for setting a plurality of luminance levels by dividing a direction and defining a plurality of classes configured based on a plurality of areas set in the hue circle and a plurality of luminance levels set in the luminance direction When,
For all the pixels included in the first image data, a frequency distribution is created by counting the number of pixels belonging to each class determined by the color space dividing means, and the colors of the pixels belonging to each class A frequency distribution creating means for obtaining an average value of information as color information of each class;
Determination means for determining whether or not a hue difference between classes is greater than or equal to a predetermined threshold based on the color information of each class obtained by the frequency distribution creating means;
If the determination means determines that the hue difference between the classes is greater than or equal to the predetermined threshold, the color information of the class having the maximum hue and the color information of the class having the minimum hue are selected as representative colors. When the determination means determines that the hue difference between the classes is not equal to or greater than the predetermined threshold, the frequency distribution created by the frequency distribution creation means is the largest luminance difference from the color information of the maximum class and the maximum class. Representative color selection means for selecting color information of a certain class as a representative color;
Replacement means for replacing each pixel value of a pixel included in the first image data using the selected representative color;
It is characterized by having.
本発明によれば、減色処理において、にじみが支配的になったヒストグラムから、簡便に精度よく文字色を選択することができる。 According to the present invention, it is possible to easily and accurately select a character color from a histogram in which bleeding is dominant in the color reduction processing.
以下、図面を参照しながら発明を実施するための形態について詳細に説明する。尚、以下の実施形態はあくまで例示であり、本発明の範囲を限定する趣旨のものではない。 Hereinafter, embodiments for carrying out the invention will be described in detail with reference to the drawings. The following embodiments are merely examples, and are not intended to limit the scope of the present invention.
[第1の実施形態]
まず、第1の実施形態として、本発明に係る画像処理装置と、パーソナルコンピュータ(PC)とがネットワークを介して相互に接続される画像処理システムを例に挙げて説明する。
[First Embodiment]
First, as a first embodiment, an image processing system in which an image processing apparatus according to the present invention and a personal computer (PC) are connected to each other via a network will be described as an example.
<システム構成>
図1は、第1の実施形態による画像処理システムの全体構成を示すブロック図である。画像処理装置100は、原稿画像を読み取り、画像データを生成するスキャナ101及び外部装置とデータの入出力を行うためのネットワークI/F105を備えている。一方、PC120は、画像処理装置100とLAN110などのネットワークで接続され、画像処理装置100から送信されたデータを受信する。
<System configuration>
FIG. 1 is a block diagram showing the overall configuration of the image processing system according to the first embodiment. The image processing apparatus 100 includes a scanner 101 that reads a document image and generates image data, and a network I / F 105 for inputting / outputting data to / from an external apparatus. On the other hand, the PC 120 is connected to the image processing apparatus 100 via a network such as a LAN 110 and receives data transmitted from the image processing apparatus 100.
画像処理装置100は、スキャナ101により読み取った画像データ又はネットワークI/F105を介して外部装置から取得した画像データに画像処理を施すための処理プログラムを実行するCPU102を有する。更に、画像処理装置100は、処理プログラムを実行する際のワークメモリやデータの一時的な保存等に利用されるメモリ103、及びプログラムやデータを格納するハードディスク104を備えている。 The image processing apparatus 100 includes a CPU 102 that executes a processing program for performing image processing on image data read by the scanner 101 or image data acquired from an external apparatus via the network I / F 105. In addition, the image processing apparatus 100 includes a work memory when executing the processing program, a memory 103 used for temporary storage of data, and a hard disk 104 that stores the program and data.
図2は、画像処理装置100の機能構成を示すブロック図である。尚、以下で説明する処理部は、CPU102が各種の処理プログラムを実行することによって実現されることを想定するが、その一部又は全部を電気回路(ASIC等)で構成するようにしてもよい。 FIG. 2 is a block diagram illustrating a functional configuration of the image processing apparatus 100. The processing unit described below is assumed to be realized by the CPU 102 executing various processing programs. However, a part or all of the processing unit may be configured by an electric circuit (ASIC or the like). .
図2において、画像入力部201は、スキャナ101により読み取った画像データ又はネットワークI/F105を介して外部装置から取得した画像データを入力する。ここでは、入力される画像データは、RGBの色空間で表現され、解像度が600dpiとして生成されたカラー画像であるとして説明する。尚、画素値としては、24ビット(各色8ビット)で表現され、各色0〜255の値をとり得る。 In FIG. 2, an image input unit 201 inputs image data read by the scanner 101 or image data acquired from an external device via the network I / F 105. Here, it is assumed that the input image data is a color image that is expressed in an RGB color space and is generated with a resolution of 600 dpi. The pixel value is expressed by 24 bits (8 bits for each color), and can take values of 0 to 255 for each color.
図3に示す(A)は、画像入力部201から入力された入力画像の一例を示す図である。入力画像300の色情報は、背景領域301、文字領域302、画像領域304でそれぞれ異なり、領域303は背景領域301と文字領域302との境界で発生したにじみとする。また、領域305は背景領域301と画像領域304との境界で発生したにじみとする。ここで、背景領域301は有彩色赤、文字領域302は背景領域301よりも濃い有彩色赤、画像領域304は有彩色黄色とし、色は網点で表現している。尚、にじみは、原稿に元々存在するもの(印刷時に生じたもの)に由来するか、スキャナ101による原稿画像の読み取り時に生じるものである。 FIG. 3A is a diagram illustrating an example of an input image input from the image input unit 201. The color information of the input image 300 is different for the background area 301, the character area 302, and the image area 304, and the area 303 is a blur that occurs at the boundary between the background area 301 and the character area 302. An area 305 is a blur that occurs at the boundary between the background area 301 and the image area 304. Here, the background area 301 is chromatic red, the character area 302 is chromatic red that is darker than the background area 301, the image area 304 is chromatic yellow, and the color is represented by halftone dots. Note that the blur originates from what originally existed in the document (generated during printing) or occurs when the scanner 101 reads the document image.
ここで図2に戻り、タイル分割部202は、入力部201から入力された画像データを予め定められたサイズの複数のタイル画像(第1の画像データ)に分割する。タイル状に分割して順に処理していくことで、処理時に必要となるメモリ量を少なくすることができる。図3に示す(B)は、分割された複数のタイル画像を示す図であり、この例では、入力画像300を、32画素四方を1単位として18分割したものである。以下の処理は、タイル単位に分割した入力タイル203に対して実行する。 Returning to FIG. 2, the tile dividing unit 202 divides the image data input from the input unit 201 into a plurality of tile images (first image data) having a predetermined size. By dividing into tiles and processing sequentially, the amount of memory required for processing can be reduced. (B) shown in FIG. 3 is a diagram showing a plurality of divided tile images. In this example, the input image 300 is divided into 18 parts with 32 pixels square as one unit. The following processing is executed for the input tile 203 divided into tiles.
以下の説明のために、タイルの縦、横それぞれに番号を振り、タイルの位置は(縦番号、横番号)で定義する。図3に示す(B)の例では、最も左かつ最も上のタイルの位置は(0,0)、最も右かつ最も下のタイルの位置は(2,5)となる。 For the following explanation, numbers are assigned to the vertical and horizontal tiles, and the tile positions are defined by (vertical number, horizontal number). In the example of (B) shown in FIG. 3, the position of the leftmost and uppermost tile is (0, 0), and the position of the rightmost and lowermost tile is (2, 5).
ここで図2に戻り、ヒストグラム生成部204は、色空間分割部205、頻度分布生成部206で構成される。色空間分割部205で用いられる色空間は、HSV色空間のため、色空間分割部205にはRGB色空間からHSV色空間への変換処理が含まれる。尚、ヒストグラム生成部204の詳細については更に後述する。 Here, referring back to FIG. 2, the histogram generation unit 204 includes a color space division unit 205 and a frequency distribution generation unit 206. Since the color space used in the color space dividing unit 205 is an HSV color space, the color space dividing unit 205 includes conversion processing from the RGB color space to the HSV color space. Details of the histogram generation unit 204 will be described later.
一色多色判定部207は、タイル画像が背景のみ(1色)か、前景があるのか(多色)を判定する。ここではヒストグラムの分散(画素が加算されたbinの数、binが存在する色相範囲の数及び輝度レベルの数)を参照し、分散が所定の値より大きい場合は多色、そうでない場合は1色とする。ここで、binは、度数分布を表現するヒストグラムにおける階級である。 The one-color / multicolor determination unit 207 determines whether the tile image has only the background (one color) or has the foreground (multicolor). Here, reference is made to the histogram variance (number of bins with added pixels, number of hue ranges in which bins exist and number of luminance levels), and if the variance is greater than a predetermined value, it is multicolor, otherwise 1 Color. Here, bin is a class in the histogram expressing the frequency distribution.
代表色選定部208は、ヒストグラム生成部204が生成したヒストグラムからタイル内の代表色の色情報(代表色情報210)を決定する。この代表色選定部208は、頻度最大bin判定部209を有する。尚、代表色選定部208の詳細は更に後述する。 The representative color selection unit 208 determines color information (representative color information 210) of the representative color in the tile from the histogram generated by the histogram generation unit 204. The representative color selection unit 208 includes a maximum frequency bin determination unit 209. Details of the representative color selection unit 208 will be described later.
色置換部211は、入力タイル203の画素単位の色情報と代表色選定部208で決定された代表色情報210との色間の距離を求め、入力画像に最も距離が近い代表色に色を置き換える量子化処理を行う。この結果、タイル単位に減色処理が行われた量子化タイル212が生成される。 The color replacement unit 211 obtains the distance between the color information of the pixel unit of the input tile 203 and the representative color information 210 determined by the representative color selection unit 208, and assigns the color to the representative color closest to the input image. Perform replacement quantization. As a result, the quantized tile 212 that has been subjected to the color reduction processing for each tile is generated.
この例では、色置換部211は、注目画素と代表色のRGB空間のユークリッド距離を計算しているが、色空間、距離算出方法はこれに限られるものではない。 In this example, the color replacement unit 211 calculates the Euclidean distance between the target pixel and the representative color RGB space, but the color space and the distance calculation method are not limited to this.
次に、本発明に係る画像処理装置のヒストグラム生成部204、代表色選定部208について詳細に説明する。まず、ヒストグラム生成部204の色空間分部205による処理を説明する。 Next, the histogram generation unit 204 and the representative color selection unit 208 of the image processing apparatus according to the present invention will be described in detail. First, processing by the color space dividing unit 205 of the histogram generating unit 204 will be described.
<色空間分割>
色空間分割部205は、頻度分布作成部206の頻度分布情報を生成するために用いる複数のbinを決定する。
<Color space division>
The color space dividing unit 205 determines a plurality of bins used for generating the frequency distribution information of the frequency distribution creating unit 206.
まず、各画素に対応するRGB画素値から、HSV色空間の色相(H)と彩度(S)の値、及びYUV色空間の輝度(Y)の値を導出する。HSV色空間は、図4に示すような色相(Hue)、彩度(Saturation)、明度(Value)により構成される円錐として示される。ここで、半径方向が彩度であり、円錐の中心線からの距離に対応する0〜1の値により表される。円の中心(S=0)では無彩色であり、遠い方(1に近い値)がより鮮やかな有彩色になる。また、色相は円周方向(円の角度方向)に対応しており、0〜360度の値により色相を表現する。例えば、0度は赤系の色、50度は黄系の色、120度は緑系の色、200度は青系の色に対応する。明度Vは色の明るさを示し、0〜100(%)の値で示され、値が大きくなるにつれ明るくなる。尚、0%は黒色、100%は白色に対応している。 First, the hue (H) and saturation (S) values in the HSV color space and the luminance (Y) value in the YUV color space are derived from the RGB pixel values corresponding to each pixel. The HSV color space is shown as a cone composed of hue (Hue), saturation (Saturation), and lightness (Value) as shown in FIG. Here, the radial direction is saturation and is represented by a value of 0 to 1 corresponding to the distance from the center line of the cone. The center of the circle (S = 0) is an achromatic color, and the far side (value close to 1) is a more vivid chromatic color. The hue corresponds to the circumferential direction (the angular direction of the circle), and the hue is expressed by a value of 0 to 360 degrees. For example, 0 degree corresponds to a red color, 50 degrees corresponds to a yellow color, 120 degrees corresponds to a green color, and 200 degrees corresponds to a blue color. The lightness V indicates the brightness of the color and is indicated by a value from 0 to 100 (%), and becomes brighter as the value increases. Note that 0% corresponds to black and 100% corresponds to white.
RGB画素値(R,G,B)の値の最大値をMAXとし、最小値をMINとしたとき、HSV画素値(H,S,V)の各値は以下のように算出される。 When the maximum value of the RGB pixel values (R, G, B) is MAX and the minimum value is MIN, the HSV pixel values (H, S, V) are calculated as follows.
H=60×(G−B)/(MAX−MIN)+0 if MAX=R
H=60×(B−R)/(MAX−MIN)+120 if MAX=G
H=60×(R−G)/(MAX−MIN)+240 if MAX=B
S=(MAX−MIN)
V=MAX
ここで、RGBの各値は、0〜255の範囲で表されるものとする。尚、HSV色空間の明度Vよりも、YUV色空間の輝度Yの方がより人間の目で見た場合の明るさの感覚に近い。このため、第1の実施形態においては、明度Vの替わりにYUV色空間の輝度Yを用いる。
H = 60 × (GB) / (MAX−MIN) +0 if MAX = R
H = 60 × (BR) / (MAX−MIN) +120 if MAX = G
H = 60 × (RG) / (MAX−MIN) +240 if MAX = B
S = (MAX-MIN)
V = MAX
Here, each value of RGB shall be represented in the range of 0-255. It should be noted that the luminance Y in the YUV color space is closer to the sense of brightness when viewed by human eyes than the brightness V in the HSV color space. For this reason, in the first embodiment, the luminance Y of the YUV color space is used instead of the brightness V.
すなわち、第1の実施形態では、HSV色空間の色相及び彩度と、YUV色空間の輝度とを用いるものとする。以下では、HSV色空間の色相及び彩度、YUV色空間の輝度により表される色空間をY/HS色空間と呼ぶ。尚、輝度Yの値は、RGB画素値(R,G,B)から以下のように算出される。 That is, in the first embodiment, the hue and saturation of the HSV color space and the luminance of the YUV color space are used. Hereinafter, the color space represented by the hue and saturation of the HSV color space and the luminance of the YUV color space is referred to as a Y / HS color space. The value of luminance Y is calculated from the RGB pixel values (R, G, B) as follows.
Y=0.29891×R+0.58661×G+0.11448×B
上記の数式により、RGB画素値から、H,S,Yの値が算出できる。
Y = 0.29891 × R + 0.58661 × G + 10.1448 × B
With the above formula, the values of H, S, and Y can be calculated from the RGB pixel values.
次に、色相及び彩度における閾値と、輝度における閾値とを設定することにより色空間を分割する。輝度方向については、一次元の線形であるため、輝度値を所定の輝度閾値に基づいて分割するとよい。以下では、輝度レベルを16段階に設定した場合を例に挙げて説明する。このとき、各輝度値間の15個(所定のP個)の輝度閾値に基づいて、16個(P+1個)の領域(Y0〜Y15)に分割される。 Next, the color space is divided by setting a threshold value for hue and saturation and a threshold value for luminance. Since the luminance direction is one-dimensional linear, the luminance value may be divided based on a predetermined luminance threshold. Hereinafter, a case where the luminance level is set to 16 levels will be described as an example. At this time, the area is divided into 16 (P + 1) areas (Y0 to Y15) based on 15 (predetermined P) brightness thresholds between the brightness values.
図4に示す下段は、色相と彩度とにより表現される色相環401を複数の領域402〜406に分割する例を示す図である。まず、色相環401を無彩色領域(低彩度領域)と有彩色領域(高彩度領域)に分ける。上述のように、彩度は、色相環における半径方向の距離で表現でき、色相環の原点に近いほど白、灰色、黒などの無彩色に近づき、逆に原点から離れるほど鮮やかな有彩色となる。そこで、所定の彩度閾値S’(所定閾値)を設定し、彩度が当該彩度閾値S’より小さい範囲を、無彩色の領域402(H0)とする。 The lower part of FIG. 4 is a diagram illustrating an example in which the hue ring 401 expressed by hue and saturation is divided into a plurality of regions 402 to 406. First, the hue circle 401 is divided into an achromatic region (low saturation region) and a chromatic region (high saturation region). As described above, the saturation can be expressed by the radial distance in the hue circle.The closer to the origin of the hue circle, the closer to the achromatic color such as white, gray, black, etc. Become. Therefore, a predetermined saturation threshold S ′ (predetermined threshold) is set, and a range where the saturation is smaller than the saturation threshold S ′ is defined as an achromatic region 402 (H0).
次に、有彩色領域の分割について説明する。色相は、色相環における位相で表現されるため、色相環上を設定した角度で分割し、有彩色領域を区分する。第1の実施形態では、色空間を4等分、すなわち、90度間隔で区分色相値を設定し、有彩色領域403〜406をH1〜H4まで設定する。 Next, division of the chromatic color area will be described. Since the hue is expressed by the phase in the hue circle, the hue circle is divided at a set angle to divide the chromatic color region. In the first embodiment, the color space is divided into four equal parts, that is, the divided hue values are set at intervals of 90 degrees, and the chromatic color regions 403 to 406 are set to H1 to H4.
色相分割に際しての基準となるH1の区分色相値は、タイル画像に含まれる画素を順に走査し、最初に発見された彩度閾値S’以上の彩度を有する画素の色相値に±45度加算したものとする。以下、具体例を挙げて説明する。 The H1 divisional hue value used as a reference for hue division is obtained by sequentially scanning pixels included in the tile image and adding ± 45 degrees to the hue value of a pixel having a saturation equal to or higher than the saturation threshold S ′ that is first discovered. Shall be. Hereinafter, a specific example will be described.
図5に示す(A)は、図3に示すタイル画像(0,0)の色相環である。まず、H1の区分色相値は、タイル画像(0,0)を順に走査していき、彩度閾値S’以上を有する画素を発見すると、当該最初に発見した画素(基準画素)の画素値501を中心に±45度で色相環の分割位置を決定する。そして、90度間隔で区分色相値を設定することで、有彩色領域H1〜H4に分割する。色分布502は、タイル画像(0,0)をすべて走査した後の、画素値の分布を示している。このタイルに含まれているのは薄い赤の背景領域301に濃い赤の文字領域302のため、この2つの領域の色相に大きな差がない。よって、色相環上の色分布502は背景領域301、文字領域302の両方の画素値が含まれている。 (A) shown in FIG. 5 is a hue circle of the tile image (0, 0) shown in FIG. First, the H1 segmented hue value sequentially scans the tile image (0, 0), and when a pixel having a saturation threshold value S ′ or more is found, the pixel value 501 of the first found pixel (reference pixel). The division position of the hue circle is determined at ± 45 degrees with respect to the center. Then, the divided hue values are set at intervals of 90 degrees to divide into chromatic color regions H1 to H4. A color distribution 502 indicates a distribution of pixel values after all tile images (0, 0) are scanned. The tile includes a light red background region 301 and a dark red character region 302, so there is no significant difference in hue between the two regions. Therefore, the color distribution 502 on the hue circle includes the pixel values of both the background area 301 and the character area 302.
図5に示す(B)は、図3に示すタイル画像(0,3)の色相環である。まず、H1の区分色相値は、タイル画像(0,3)を順に走査し、最初に発見された彩度閾値S’以上の画素値503を中心に±45度で決定し、有彩色領域が分割される。色分布504、505、506は、タイル画像(0,3)をすべて走査した後の、画素値の分布を示している。このタイルに含まれているのは、薄い赤の背景領域301に、黄色い画像領域304なので、色相環上の色分布504は背景領域301、色分布505は画像領域304である。背景の赤と前景の黄色には色相に差があるため、色分布504と色分布505は色相環では離れて存在している。しかし、背景と文字の境界に発生したにじみの領域305があるため、文字と背景の色分布をつなぐ形でにじみの色分布506が色相環上に存在している。 (B) shown in FIG. 5 is a hue circle of the tile image (0, 3) shown in FIG. First, the segmented hue value of H1 is determined by scanning the tile image (0, 3) in order, and is determined at ± 45 degrees centering on the pixel value 503 equal to or greater than the first discovered saturation threshold S ′. Divided. Color distributions 504, 505, and 506 indicate pixel value distributions after the tile image (0, 3) has been scanned. Since the tile includes a light red background region 301 and a yellow image region 304, the color distribution 504 on the hue circle is the background region 301, and the color distribution 505 is the image region 304. Since there is a difference in hue between red in the background and yellow in the foreground, the color distribution 504 and the color distribution 505 are separated from each other in the hue circle. However, since there is a blurred area 305 generated at the boundary between the background and the character, a blurred color distribution 506 exists on the hue ring so as to connect the color distribution between the character and the background.
図5に示す(C)は、図3に示すタイル画像(1,4)の色相環である。まず、H1の区分色相値は、タイル画像(1、4)を順に走査し、最初に発見された彩度閾値S’以上の画素値507を中心に±45度で決定し、有彩色領域が分割される。色分布508、509、510は、タイル画像(1、4)をすべて走査した後の、画素値の分布を示している。タイル画像(1,4)は図5に示す(B)で説明したタイル画像(0,3)と同じく、薄い赤の背景領域301に、黄色い画像領域304が含まれている。色相環上の色分布508は背景領域301、色分布509は画像領域304、色分布510はにじみの領域305に相当する。 (C) shown in FIG. 5 is a hue circle of the tile image (1, 4) shown in FIG. First, the segmented hue value of H1 is determined at ± 45 degrees centering around the pixel value 507 equal to or higher than the saturation threshold S ′ that is found first by sequentially scanning the tile images (1, 4). Divided. Color distributions 508, 509, and 510 indicate pixel value distributions after the tile images (1, 4) have been scanned. The tile image (1, 4) includes a yellow image region 304 in a light red background region 301, like the tile image (0, 3) described in FIG. 5B. The color distribution 508 on the hue circle corresponds to the background area 301, the color distribution 509 corresponds to the image area 304, and the color distribution 510 corresponds to the blur area 305.
尚、以下の説明では、色相と彩度とにより表現される色相環401を分割したときの各領域(無彩色の領域H0と、分割された有彩色領域H1〜H4)とをまとめて、色相範囲と呼ぶこととする。 In the following description, each region (achromatic color region H0 and divided chromatic color regions H1 to H4) when the hue ring 401 expressed by hue and saturation is divided is grouped into hues. This is called a range.
<頻度分布情報の生成>
頻度分布生成部206は、まず色空間分割部205で輝度方向に分割した輝度レベルY(Y0〜Y15)と、色相と彩度で表される色相環を分割して求めた色相範囲H(H0〜H4)とで構成される二次元配列を作る。この二次元配列それぞれの配列要素(=階級(bin))に含まれるタイル画像内の画素の出現回数を計数(カウント)する。
<Generation of frequency distribution information>
First, the frequency distribution generation unit 206 divides the luminance level Y (Y0 to Y15) divided in the luminance direction by the color space division unit 205 and the hue ring represented by hue and saturation, and the hue range H (H0). To H4). The number of appearances of pixels in the tile image included in the array element (= class (bin)) of each two-dimensional array is counted (counted).
図6に示す(A)は、頻度分布の配列を示す図である。この(A)の頻度分布の各binには、各binに対応する輝度レベル及び色相範囲の色情報を持つタイル画像の画素出現数と、カウントされた画素に対応する色情報(色相、彩度、RGB)の平均値とを格納する。 FIG. 6A shows an arrangement of frequency distributions. In each bin of the frequency distribution of (A), the number of appearances of a tile image having luminance information and hue range color information corresponding to each bin, and color information (hue, saturation) corresponding to the counted pixels are included. , RGB) average values.
図6に示す(B)は、頻度分布のデータ構造を示す図である。頻度分布はbinの配列と色空間分割で定義した有彩色領域の区分の色相値を保持する。頻度分布作成では、画素の色情報がどのbinに当てはまるか否かを判定し、該当するbinの画素出現数を加算(インクリメント)する。これと同時にbinの色情報に、画素の色情報をそれぞれ加算する。 (B) shown in FIG. 6 is a diagram showing a data structure of a frequency distribution. The frequency distribution holds the hue value of the segment of the chromatic color area defined by the bin arrangement and the color space division. In creating the frequency distribution, it is determined to which bin the color information of the pixel applies, and the pixel appearance count of the corresponding bin is added (incremented). At the same time, the pixel color information is added to the bin color information.
すべてのタイル画像の画素を判定した後、各binの色情報を画素出現数で除算する。すなわち、binに加算された画素の色情報の平均値を算出し、この値を当該binの色情報と確定する。 After determining the pixels of all tile images, the color information of each bin is divided by the number of pixel appearances. That is, the average value of the color information of the pixel added to bin is calculated, and this value is determined as the color information of the bin.
図5に示す(D)〜(F)は、色相範囲及び輝度レベルによって定義された各binの頻度分布の例を示している。第1の実施形態で作成した頻度分布は、1つのタイル画像につき、5つの色相範囲の輝度ヒストグラムを作るのと等しい。また、入力画像の色は網点で表現されているため、本来人の目で見えているのは1色であっても、網点構成点の影響で画素単位の色情報にばらつきがある。このため、ヒストグラムでは複数の輝度レベルのbinに画素が加算されるのが一般的である。 (D) to (F) shown in FIG. 5 show examples of the frequency distribution of each bin defined by the hue range and the luminance level. The frequency distribution created in the first embodiment is equivalent to creating a luminance histogram of five hue ranges per tile image. In addition, since the color of the input image is represented by halftone dots, even if only one color is originally visible to the human eye, the color information for each pixel varies due to the influence of the halftone dot composing points. For this reason, in a histogram, pixels are generally added to bins having a plurality of luminance levels.
<代表色の決定>
代表色選定部208は、頻度分布生成部206で生成された情報に基づき代表色を決定する。もし、一色多色判定部207で1色、すなわち前景が存在しないと判定された場合、タイル画像の代表色はそのタイル画像の画素の色情報の平均値とすればよい。ここでは、一色多色判定で、多色、すなわち前景が存在する場合の代表色決定について詳細を説明する。
<Determination of representative colors>
The representative color selection unit 208 determines a representative color based on the information generated by the frequency distribution generation unit 206. If the one-color / multi-color determining unit 207 determines that one color, that is, no foreground exists, the representative color of the tile image may be the average value of the color information of the pixels of the tile image. Here, the details of the representative color determination in the case where there are multiple colors, that is, the foreground, in the one-color / multi-color determination will be described.
一般的には、タイル画像中の出現頻度が高い色が当該タイル画像の背景代表色であるとみなせる。また、印刷物は人の目に見やすいように前景と背景の輝度や色相に差をつけてデザインするケースがほとんどであるため、頻度最大の色から輝度や色相に差がある色を文字の代表色に採用することができる。 In general, a color having a high appearance frequency in a tile image can be regarded as a background representative color of the tile image. In addition, printed materials are often designed with a difference in brightness and hue between the foreground and background so that they can be easily seen by the human eye. Can be adopted.
以上のことから、代表色の算出に用いるべきbinの特徴を以下にまとめる。
*頻度が高いbin
*頻度が高いbinと比べて輝度レベルに差があるbin
*色相範囲が異なるbin
第1の実施形態では、ヒストグラム上で画素が加算された色相範囲の数により、代表色選択アルゴリズムを切り替えるため、アルゴリズムは2種類用意する。
(1)複数の色相範囲にbinが存在する場合
(2)同一色相範囲にのみbinが存在する場合
上記2種類のアルゴリズムの詳細を順に説明する。まず、上記(1)のアルゴリズムを詳細に説明する。複数の色相範囲にbinが存在するヒストグラムとなったタイルとは、入力画像の背景色と前景色の色相が異なり、色空間分割時にはそれぞれの色が別々の色相範囲に分配された状態である(色相環:図5の(B))。ヒストグラムで見ると、図5に示す(E)のように背景色binと前景色binは異なる色相範囲(図5(E)ではH1とH2)に出現する。
From the above, the characteristics of bins to be used for calculating representative colors are summarized below.
* Frequent bin
* Bin that has a difference in luminance level compared to bins with high frequency
* Bin with different hue range
In the first embodiment, two types of algorithms are prepared in order to switch the representative color selection algorithm depending on the number of hue ranges in which pixels are added on the histogram.
(1) When bins exist in a plurality of hue ranges (2) When bin exists only in the same hue range Details of the above two types of algorithms will be described in order. First, the algorithm (1) will be described in detail. A tile having a histogram in which bins exist in a plurality of hue ranges is a state in which the hue of the background color and the foreground color of the input image are different and each color is distributed to different hue ranges when the color space is divided ( Hue ring: (B) of FIG. When viewed from the histogram, as shown in FIG. 5E, the background color bin and the foreground color bin appear in different hue ranges (H1 and H2 in FIG. 5E).
このことから、複数の色相範囲にbinがあるヒストグラムの場合は、それぞれの色相範囲の頻度最大のbinと、そのbinから輝度レベルに差があるbinとを代表色に選べばよい。 Therefore, in the case of a histogram having bins in a plurality of hue ranges, a bin having the maximum frequency in each hue range and a bin having a difference in luminance level from the bins may be selected as representative colors.
上述の複数の色相範囲にbinが存在する場合の代表色選定処理を、図7を用いて説明する。この処理は、binが存在する色相範囲毎に実施する。まず、S701において、ある色相範囲での頻度最大のbinの色情報を代表色に採用し、S702へ遷移する。このS702では、この色相範囲に含まれる色の輝度レベルに差があるか否かを判定する。具体的には、無彩色領域H0ではH0の範囲で画素加算されたbinの数の大小で判断すればよい。 A representative color selection process when bins exist in the plurality of hue ranges described above will be described with reference to FIG. This process is performed for each hue range in which bins exist. First, in S701, the bin color information having the maximum frequency in a certain hue range is adopted as the representative color, and the process proceeds to S702. In S702, it is determined whether or not there is a difference in the luminance levels of the colors included in the hue range. Specifically, in the achromatic color region H0, the determination may be made based on the number of bins obtained by adding pixels in the range of H0.
また、有彩色領域H1〜H4における輝度差の有無の判定基準は無彩色領域と異なる。なぜなら、印刷物での有彩色の表現には網点が使われるため、表現したい色が1色であっても網点の構成の関係で画素単位の色情報は輝度差が発生しやすい。このため、画素加算されたbinの数だけでは、色相範囲中に代表色となるべきbinが複数存在するか否かを判断することができない。よって、確実に輝度の差があるかを確認するため、binが連続して存在しているか否かを判定基準とする。すなわち、色相範囲中にbinが連続していれば、輝度レベルに差がないと判断し、逆にbinが飛び石に存在していれば、この色相範囲は輝度レベルに差があるとみなす。 Further, the criterion for the presence or absence of a luminance difference in the chromatic color regions H1 to H4 is different from that of the achromatic color region. This is because halftone dots are used to represent chromatic colors in a printed matter, so that even if one color is desired to be represented, a difference in luminance is likely to occur in color information on a pixel basis due to the composition of the halftone dots. For this reason, it is impossible to determine whether or not there are a plurality of bins that should be representative colors in the hue range only by the number of bins to which pixels are added. Therefore, in order to confirm whether or not there is a difference in luminance, whether or not bins exist continuously is used as a criterion. That is, if bins are continuous in the hue range, it is determined that there is no difference in luminance level. Conversely, if bins are present in the stepping stone, this hue range is regarded as having a difference in luminance level.
S702で輝度レベルに差がある(YES)と判定されれば、S703へ遷移し、N0であれば、この色相範囲の代表色選択は終了し、他の色相範囲の代表色選択に移行する。このS703では、S701で選択した頻度最大のbinに対して同一色相範囲内で最も輝度レベルに差があるbinの色情報を代表色に採用する。具体的には、頻度最大binから輝度方向に一番離れた位置にあるbinである。 If it is determined in S702 that there is a difference in luminance level (YES), the process proceeds to S703, and if it is N0, the representative color selection in this hue range is completed, and the process proceeds to representative color selection in another hue range. In S703, bin color information having the greatest difference in luminance level within the same hue range with respect to the bin with the highest frequency selected in S701 is adopted as the representative color. Specifically, it is the bin that is located farthest from the maximum frequency bin in the luminance direction.
上述の代表色選択処理をタイル画像(0,3)のヒストグラム図5に示す(E)に適応した場合、H1とH2それぞれにおいて輝度レベルに差がないと判定されるので、選ばれる代表色はH[1]Y[7]とH[2]Y[11]となる。 When the above-described representative color selection processing is applied to the histogram (E) shown in FIG. 5 of the tile image (0, 3), it is determined that there is no difference in luminance level between H1 and H2, so the representative color to be selected is H [1] Y [7] and H [2] Y [11].
次に、上記(2)のアルゴリズムを詳細に説明する。同一の色相範囲にbinが存在するヒストグラムとなったタイルとは、色相は近いもしくは無彩色であり、濃度に差をつけた前景と背景の色の組み合わせ(色相環:図5の(A))が想定される。ヒストグラムでみると、図5に示す(D)のように、前景色binと背景色binは同じ色相範囲に出現している。このような同一の色相範囲だけにbinが出現した場合は、色相範囲内で頻度最大binが背景色、その背景色から最も輝度差のあるbinが前景の文字色となる。 Next, the algorithm (2) will be described in detail. A tile having a histogram in which bins exist in the same hue range is a hue that is close or achromatic, and a combination of foreground and background colors with different densities (hue ring: FIG. 5A) Is assumed. Looking at the histogram, as shown in FIG. 5D, the foreground color bin and the background color bin appear in the same hue range. When bins appear only in the same hue range, the maximum frequency bin in the hue range is the background color, and the bin having the most luminance difference from the background color is the foreground character color.
以上のことから、無彩色相範囲H0にのみbinが存在するならば、頻度最大binとそこから最も輝度レベルに差があるbinを代表色に選択すればよい。 From the above, if the bin exists only in the achromatic hue range H0, the bin having the highest frequency level and the bin having the most difference in luminance level may be selected as the representative color.
しかし、色相環が図5の(C)、ヒストグラムが図5の(F)のように、色相範囲H1を区分する際に用いた基準画素が前景と背景の境界で発生したにじみの場合、本来異なる色相範囲に区分されるべき前景色と背景色が同一の色相区分に配置されることがある。 However, when the hue circle is generated in the boundary between the foreground and the background as shown in FIG. 5C and the histogram in FIG. The foreground color and the background color that should be divided into different hue ranges may be arranged in the same hue division.
こういった場合、図5に示す(A)に挙げた前景と背景の色相が近い場合と同様の処理ではうまくいかないケースが出てくる。それは、タイル中の前景領域の形状が複雑なため、背景と前景との境界領域が多くなり、前景や背景そのものを表している色の出現頻度よりも、境界のにじみの色の出現頻度が高いケースである。 In such a case, there are cases where the same processing as in the case where the hues of the foreground and the background shown in FIG. Because the shape of the foreground area in the tile is complicated, the boundary area between the background and the foreground is increased, and the frequency of the blurring color of the boundary is higher than the frequency of the color representing the foreground and the background itself. It is a case.
このケースに対応するため、同一の有彩色相範囲にのみbinが出現したヒストグラムから代表色を選択する場合には、頻度最大のbinを代表色とすべきか否かを判定する。同一の有彩色相範囲H1にだけbinが出現した場合の代表色決定処理の詳細を、図8を用いて説明する。S801は各binの色情報を参照し、色相に差があるか否かを判定する。具体的には、最大色相値のbinと最小色相値のbinを抽出し、その差が一定以上(所定の閾値以上)あれば、階級間の色相差があると判断する。 In order to deal with this case, when a representative color is selected from a histogram in which bins appear only in the same chromatic hue range, it is determined whether or not the bin with the highest frequency should be the representative color. Details of the representative color determination process when bin appears only in the same chromatic hue range H1 will be described with reference to FIG. S801 refers to the color information of each bin and determines whether there is a difference in hue. Specifically, the bin of the maximum hue value and the bin of the minimum hue value are extracted, and if the difference is equal to or larger than a predetermined value (greater than a predetermined threshold), it is determined that there is a hue difference between classes.
S801において、階級間の色相差が一定以上あるならば(YESならば)、S802へ遷移し、色相最大のbinと色相最小のbinを代表色に選択する。しかし、NOであれば、S803へ遷移し、頻度最大binと頻度最大binから最も輝度差のあるbinを代表色に選択する。 In S801, if the hue difference between classes is greater than or equal to a certain level (if YES), the process proceeds to S802, and the bin with the largest hue and the bin with the smallest hue are selected as representative colors. However, if NO, the process proceeds to S803, and the bin having the highest luminance difference is selected as the representative color from the maximum frequency bin and the maximum frequency bin.
図5に示す(D)、(F)のヒストグラムを具体例にする。まず、図5に示す(D)のヒストグラムの場合、図5に示す(A)のとおり、色相の差は小さい。このため、S803に進み、代表色は頻度最大のH[1]Y[7]、そこから輝度レベルに差があるH[1]Y[3]を代表色に選択する。 The histograms (D) and (F) shown in FIG. First, in the case of the histogram shown in FIG. 5D, the difference in hue is small as shown in FIG. 5A. Therefore, the process proceeds to S803, where H [1] Y [7] having the maximum frequency is selected as the representative color, and H [1] Y [3] having a difference in luminance level is selected as the representative color.
次に、図5に示す(F)のヒストグラムの場合、図5に示す(C)のとおり、色相の差が大きい。このため、S802に進み、代表色は色相最大、最小のH[1][6]、H[1][12]を代表色に選択する。 Next, in the case of the histogram of (F) shown in FIG. 5, the difference in hue is large as shown in (C) of FIG. For this reason, the process proceeds to S802, and representative colors are selected from H [1] [6] and H [1] [12] having the maximum and minimum hues as representative colors.
第1の実施形態によれば、にじみが支配的な画像であっても、簡易的な処理で精度よく代表色を選択することが可能となる。 According to the first embodiment, it is possible to select a representative color with high accuracy by simple processing even for an image in which blurring is dominant.
[第2の実施形態]
次に、図面を参照しながら本発明に係る第2の実施形態を詳細に説明する。第1の実施形態では、同一の有彩色相範囲H1にのみbinがあった場合について、binの色相差に基づいて、頻度最大binを代表色に採用すべきか否かを判定した。第2の実施形態では、複数の色相範囲にbinがある場合についても、頻度最大binを代表色に採用すべきか否かを判定する。
[Second Embodiment]
Next, a second embodiment according to the present invention will be described in detail with reference to the drawings. In the first embodiment, when bins exist only in the same chromatic hue range H1, it is determined whether or not the maximum frequency bin should be adopted as the representative color based on the hue difference of bins. In the second embodiment, even when there are bins in a plurality of hue ranges, it is determined whether or not the maximum frequency bin should be adopted as the representative color.
図9は、複数の色相範囲にbinがある場合の代表色選定処理を示すフローチャートである。この処理は、binが存在する色相範囲毎に実施する。まず、S901において、ある色相範囲に含まれるbinの色情報を参照し、色相に差があるか否かを判定する。具体的には、同一色相範囲に含まれる最大色相値のbinと最小色相値のbinを抽出し、その差が一定以上あれば、階級間の色相差があると判断する。 FIG. 9 is a flowchart showing a representative color selection process when bins exist in a plurality of hue ranges. This process is performed for each hue range in which bins exist. First, in step S <b> 901, it is determined whether there is a difference in hue by referring to color information of bins included in a certain hue range. Specifically, the maximum hue value bin and the minimum hue value bin included in the same hue range are extracted, and if the difference is greater than or equal to a certain level, it is determined that there is a hue difference between classes.
S901で、階級間の色相差が大きいならば(YESならば)、S902へ遷移し、色相最大のbinと色相最小のbinを代表色に選択し、この色相範囲からの代表色選定処理を終了する。しかし、NOであれば、S903へ遷移し、判定対象の色相範囲内で頻度最大のbinを代表色に採用し、S904へ遷移する。S904、S905の輝度レベル判定処理は図7に示すS702、S703と同義であるため、ここでの説明を省く。 If the hue difference between the classes is large in S901 (if YES), the process proceeds to S902, where the bin with the largest hue and the bin with the smallest hue are selected as representative colors, and the representative color selection process from this hue range is completed. To do. However, if NO, the process proceeds to S903, the bin having the highest frequency within the hue range to be determined is adopted as the representative color, and the process proceeds to S904. Since the luminance level determination processing in S904 and S905 is synonymous with S702 and S703 shown in FIG. 7, description thereof is omitted here.
尚、第1の実施形態では、同一の有彩色相範囲H1にのみ頻度最大bin判定を行ったが、無彩色相範囲H0にのみbinがある場合にも頻度最大binが代表色か否かの判定を実行してもよい。この場合、すべてのbinの色相値の平均が0に近い場合は、色相が不定になるため、全binの色相値の平均が無彩色領域と有彩色領域を区分する所定閾値S’に近い時に実施する。 In the first embodiment, the frequency maximum bin determination is performed only in the same chromatic hue range H1, but whether or not the frequency maximum bin is a representative color even when there is a bin only in the achromatic hue range H0. A determination may be performed. In this case, when the average of the hue values of all the bins is close to 0, the hue becomes indefinite. Therefore, when the average of the hue values of all the bins is close to the predetermined threshold value S ′ that separates the achromatic color region and the chromatic color region. carry out.
[他の実施形態]
また、本発明は、以下の処理を実行することによっても実現される。即ち、上述した実施形態の機能を実現するソフトウェア(プログラム)を、ネットワーク又は各種記憶媒体を介してシステム或いは装置に供給し、そのシステム或いは装置のコンピュータ(または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 (7)
第1の画像データに含まれる全ての画素を対象として、前記色空間分割手段で決定された各階級に属する画素の数を計数することにより頻度分布を作成するとともに、各階級に属する画素の色情報の平均値を当該各階級の色情報として求める頻度分布作成手段と、
前記頻度分布作成手段で求めた前記各階級の色情報に基づいて、階級間の色相差が所定の閾値以上あるか否かを判定する判定手段と、
前記判定手段で前記階級間の色相差が前記所定の閾値以上あると判定した場合は、前記色相が最大の階級の色情報と前記色相が最小の階級の色情報とを代表色として選定する一方、前記判定手段で前記階級間の色相差が前記所定の閾値以上ないと判定した場合は、前記頻度分布作成手段で作成した頻度分布が最大の階級の色情報と当該最大の階級から最も輝度差がある階級の色情報とを代表色として選定する代表色選定手段と、
前記第1の画像データに含まれる画素の各画素値を、前記選定された代表色を用いて置換する置換手段と、
を有することを特徴とする画像処理装置。 By dividing a hue circle composed of saturation and hue based on a predetermined criterion, a plurality of regions in the hue ring are set, and further, a luminance direction of a predetermined color space is divided into a plurality of areas. A color space dividing means for setting a luminance level and defining a plurality of classes configured based on a plurality of regions set in the hue circle and a plurality of luminance levels set in the luminance direction;
For all the pixels included in the first image data, a frequency distribution is created by counting the number of pixels belonging to each class determined by the color space dividing means, and the colors of the pixels belonging to each class A frequency distribution creating means for obtaining an average value of information as color information of each class;
Determination means for determining whether or not a hue difference between classes is greater than or equal to a predetermined threshold based on the color information of each class obtained by the frequency distribution creating means;
If the determination means determines that the hue difference between the classes is greater than or equal to the predetermined threshold, the color information of the class having the maximum hue and the color information of the class having the minimum hue are selected as representative colors. When the determination means determines that the hue difference between the classes is not equal to or greater than the predetermined threshold, the frequency distribution created by the frequency distribution creation means is the largest luminance difference from the color information of the maximum class and the maximum class. Representative color selection means for selecting color information of a certain class as a representative color;
Replacement means for replacing each pixel value of a pixel included in the first image data using the selected representative color;
An image processing apparatus comprising:
前記入力手段で入力された画像データを複数のタイル画像に分割する分割手段と、を更に有し、
前記第1の画像データは、前記分割手段で分割されたタイル画像であることを特徴とする請求項1に記載の画像処理装置。 Input means for inputting image data;
Dividing means for dividing the image data input by the input means into a plurality of tile images,
The image processing apparatus according to claim 1, wherein the first image data is a tile image divided by the dividing unit.
前記2つ以上の領域に属すると判定された場合、それぞれの領域について、当該領域に属する階級のうちで前記頻度分布の頻度が最大の階級の色情報を代表色とし、更に、当該領域に属する階級のうちで前記頻度分布の頻度が最大の階級から一定以上の輝度差がある階級があれば当該階級の色情報も代表色に選定する手段と、を更に有し、
前記1つの領域に属すると判定された場合は、前記判定手段と前記代表色選定手段とによって前記代表色を選定するように処理することを特徴とする請求項1又は2に記載の画像処理装置。 All of the classes in which the number of pixels is counted based on the frequency distribution created by the frequency distribution creating means belong to two or more of the plurality of areas set in the hue circle, or in one area Means for determining whether to belong;
If it is determined that the image belongs to the two or more areas, the color information of the class having the maximum frequency of the frequency distribution among the classes belonging to the area is used as a representative color, and further belongs to the area Means for selecting the color information of the class as a representative color if there is a class having a luminance difference of a certain level or more from the class having the highest frequency of the frequency distribution among the classes,
3. The image processing apparatus according to claim 1, wherein when it is determined that the image belongs to the one area, the determination unit and the representative color selection unit perform processing so as to select the representative color. 4. .
前記2つ以上の領域に属すると判定された場合、それぞれの領域について、
前記頻度分布作成手段で求めた前記各階級の色情報に基づいて、階級間の色相差が所定の閾値以上あるか否か判定し、
前記階級間の色相差が前記所定の閾値以上あると判定した場合は、前記色相が最大の階級の色情報と前記色相が最小の階級の色情報とを代表色として選定する一方、
前記判定手段で前記階級間の色相差が前記所定の閾値以上ないと判定した場合は、当該領域に属する階級のうちで前記頻度分布の頻度が最大の階級の色情報を代表色とし、更に、当該領域に属する階級のうちで前記頻度分布の頻度が最大の階級から一定以上の輝度差がある階級があれば当該階級の色情報も代表色に選定する手段と、を更に有し、
前記1つの領域に属すると判定された場合は、前記判定手段と前記代表色選定手段とによって前記代表色を選定するように処理することを特徴とする請求項1乃至3の何れか1項に記載の画像処理装置。 All of the classes in which the number of pixels is counted based on the frequency distribution created by the frequency distribution creating means belong to two or more of the plurality of areas set in the hue circle, or in one area Means for determining whether to belong;
When determined to belong to the two or more areas, for each area,
Based on the color information of each class obtained by the frequency distribution creating means, it is determined whether the hue difference between classes is a predetermined threshold or more,
When it is determined that the hue difference between the classes is greater than or equal to the predetermined threshold, the color information of the class having the maximum hue and the color information of the class having the minimum hue are selected as representative colors,
If it is determined by the determination means that the hue difference between the classes is not greater than or equal to the predetermined threshold, the color information of the class having the maximum frequency of the frequency distribution among the classes belonging to the region is used as a representative color, Means for selecting the color information of the class as a representative color if there is a class having a luminance difference of a certain level or more from the class of the frequency distribution among the classes belonging to the region,
4. The process according to claim 1, wherein when it is determined that the image belongs to the one area, the determination unit and the representative color selection unit perform processing so as to select the representative color. 5. The image processing apparatus described.
色空間分割手段が、彩度と色相とによって構成される色相環を所定の基準に基づいて分割することによって、前記色相環における複数の領域を設定し、更に、所定の色空間の輝度方向を分割することにより複数の輝度レベルを設定し、前記色相環において設定した複数の領域と前記輝度方向に設定した複数の輝度レベルとに基づいて構成される複数の階級を定める色空間分割工程と、
頻度分布作成手段が、第1の画像データに含まれる全ての画素を対象として、前記色空間分割手段で決定された各階級に属する画素の数を計数することにより頻度分布を作成するとともに、各階級に属する画素の色情報の平均値を当該各階級の色情報として求める頻度分布作成工程と、
判定手段が、前記頻度分布作成工程で求めた前記各階級の色情報に基づいて、階級間の色相差が所定の閾値以上あるか否かを判定する判定工程と、
代表色選定手段が、前記判定工程において前記階級間の色相差が前記所定の閾値以上あると判定した場合は、前記色相が最大の階級の色情報と前記色相が最小の階級の色情報とを代表色として選定する一方、前記判定工程において前記階級間の色相差が前記所定の閾値以上ないと判定した場合は、前記頻度分布作成手段で作成した頻度分布が最大の階級の色情報と当該最大の階級から最も輝度差がある階級の色情報とを代表色として選定する代表色選定工程と、
置換手段が、前記第1の画像データに含まれる画素の各画素値を、前記選定された代表色を用いて置換する置換工程と、
を有することを特徴とする画像処理方法。 An image processing method of an image processing apparatus,
The color space dividing means sets a plurality of regions in the hue circle by dividing a hue circle constituted by saturation and hue based on a predetermined reference, and further sets a luminance direction of the predetermined color space. A color space dividing step of setting a plurality of luminance levels by dividing, and defining a plurality of classes configured based on a plurality of regions set in the hue circle and a plurality of luminance levels set in the luminance direction;
The frequency distribution creating means creates a frequency distribution by counting the number of pixels belonging to each class determined by the color space dividing means for all the pixels included in the first image data, A frequency distribution creating step for obtaining an average value of color information of pixels belonging to a class as color information of each class;
A determining step for determining whether or not a hue difference between the classes is equal to or greater than a predetermined threshold based on the color information of each class obtained in the frequency distribution creating step;
When the representative color selection unit determines that the hue difference between the classes is equal to or greater than the predetermined threshold in the determination step, the color information of the class having the maximum hue and the color information of the class having the minimum hue are obtained. While selecting as a representative color, if it is determined in the determining step that the hue difference between the classes is not greater than or equal to the predetermined threshold, the frequency information created by the frequency distribution creating means is the color information of the highest class and the maximum A representative color selection process for selecting, as a representative color, color information of a class having the most luminance difference from the class of
A replacement step of replacing each pixel value of the pixel included in the first image data by using the selected representative color;
An image processing method comprising:
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP2011243973A JP2013102300A (en) | 2011-11-07 | 2011-11-07 | Image processor and image processing method |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP2011243973A JP2013102300A (en) | 2011-11-07 | 2011-11-07 | Image processor and image processing method |
Publications (1)
| Publication Number | Publication Date |
|---|---|
| JP2013102300A true JP2013102300A (en) | 2013-05-23 |
Family
ID=48622529
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| JP2011243973A Pending JP2013102300A (en) | 2011-11-07 | 2011-11-07 | Image processor and image processing method |
Country Status (1)
| Country | Link |
|---|---|
| JP (1) | JP2013102300A (en) |
Cited By (5)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN112204608A (en) * | 2019-08-27 | 2021-01-08 | 深圳市大疆创新科技有限公司 | Image processing method and device |
| US10922857B2 (en) * | 2017-04-17 | 2021-02-16 | Samsung Electronics Co., Ltd. | Electronic device and operation method for performing a drawing function |
| CN114783192A (en) * | 2022-03-24 | 2022-07-22 | 杭州海康威视数字技术股份有限公司 | Signal lamp color processing method and device |
| CN116912112A (en) * | 2023-06-21 | 2023-10-20 | 广州市奥威亚电子科技有限公司 | Image handwriting processing methods, devices, equipment and storage media |
| CN117596489A (en) * | 2024-01-18 | 2024-02-23 | 荣耀终端有限公司 | Image processing method, image processing device, electronic equipment and storage medium |
-
2011
- 2011-11-07 JP JP2011243973A patent/JP2013102300A/en active Pending
Cited By (5)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US10922857B2 (en) * | 2017-04-17 | 2021-02-16 | Samsung Electronics Co., Ltd. | Electronic device and operation method for performing a drawing function |
| CN112204608A (en) * | 2019-08-27 | 2021-01-08 | 深圳市大疆创新科技有限公司 | Image processing method and device |
| CN114783192A (en) * | 2022-03-24 | 2022-07-22 | 杭州海康威视数字技术股份有限公司 | Signal lamp color processing method and device |
| CN116912112A (en) * | 2023-06-21 | 2023-10-20 | 广州市奥威亚电子科技有限公司 | Image handwriting processing methods, devices, equipment and storage media |
| CN117596489A (en) * | 2024-01-18 | 2024-02-23 | 荣耀终端有限公司 | Image processing method, image processing device, electronic equipment and storage medium |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| JP5511467B2 (en) | Image processing apparatus, control method therefor, and program | |
| JP6781406B2 (en) | Image processing equipment and computer programs | |
| JP5511468B2 (en) | Image processing apparatus, control method therefor, and program | |
| JP6127877B2 (en) | Image processing apparatus and computer program | |
| CN101277369B (en) | Image forming apparatus and control method thereof | |
| JP2013102300A (en) | Image processor and image processing method | |
| JP5932683B2 (en) | System to maintain image quality in economy printing mode | |
| JP6031921B2 (en) | Image processing apparatus and program | |
| JP5151708B2 (en) | Image processing apparatus and image processing program | |
| JP2015216455A (en) | Image processing apparatus, image processing method, and program. | |
| JP4264051B2 (en) | Image processing device | |
| JP4507279B2 (en) | Image processing apparatus, image processing method, and program thereof | |
| JP2013102299A (en) | Image processor and image processing method | |
| US20160012323A1 (en) | Method for printing a grayscale raster image | |
| JP5337060B2 (en) | Image processing apparatus, control method, and program | |
| JP6525518B2 (en) | Image processing apparatus, image processing method and program | |
| JP7205689B2 (en) | Image processing device and computer program | |
| JP6765103B2 (en) | Image processing device, image processing program and image processing method | |
| US10375275B2 (en) | Image processing apparatus specifying first and second pixels, and generating processed image data in which the first and second pixels have first and second colors respectively | |
| JP5949399B2 (en) | Image processing apparatus and program | |
| EP2894841B1 (en) | Information processing apparatus, information processing method, and storage medium | |
| JP3883056B2 (en) | Image processing apparatus, image processing method, printing apparatus, image processing program, and medium on which image processing program is recorded | |
| JP7248944B2 (en) | Image processing device and computer program | |
| JP5337059B2 (en) | Image processing apparatus, control method, and program | |
| JP2018174418A (en) | Image processing apparatus and computer program |