JP2008092553A - Image color judging apparatus, method and program - Google Patents

Image color judging apparatus, method and program Download PDF

Info

Publication number
JP2008092553A
JP2008092553A JP2007183148A JP2007183148A JP2008092553A JP 2008092553 A JP2008092553 A JP 2008092553A JP 2007183148 A JP2007183148 A JP 2007183148A JP 2007183148 A JP2007183148 A JP 2007183148A JP 2008092553 A JP2008092553 A JP 2008092553A
Authority
JP
Japan
Prior art keywords
color
unit
image
image data
determination
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
Application number
JP2007183148A
Other languages
Japanese (ja)
Other versions
JP4438834B2 (en
Inventor
Katsumi Minamino
勝巳 南野
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Murata Machinery Ltd
Original Assignee
Murata Machinery Ltd
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by Murata Machinery Ltd filed Critical Murata Machinery Ltd
Priority to JP2007183148A priority Critical patent/JP4438834B2/en
Priority to EP07016588A priority patent/EP1898625A3/en
Priority to US11/847,193 priority patent/US20080055682A1/en
Priority to CN2007101495213A priority patent/CN101141546B/en
Publication of JP2008092553A publication Critical patent/JP2008092553A/en
Application granted granted Critical
Publication of JP4438834B2 publication Critical patent/JP4438834B2/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Facsimile Image Signal Circuits (AREA)
  • Color Image Communication Systems (AREA)
  • Image Analysis (AREA)

Abstract

<P>PROBLEM TO BE SOLVED: To provide an image color judging apparatus performing color judgment processing of an image having ground color, and to provide an image color judging method and its program. <P>SOLUTION: The image color judging apparatus comprises a section for judging existence of the ground color of an object image based on the image data thereof, and judging the luminance and chrominance of the ground color when the object image has the ground color, and a section for judging the color of the object image based on the image data thereof wherein the object image judging section performs color judgment by utilizing the judgment results from the ground color judging section. <P>COPYRIGHT: (C)2008,JPO&INPIT

Description

本発明は、対象画像の地色を判定する画像色判定装置、画像色判定方法、およびプログラムに関するもので、特に、原稿に地色があっても良好に画像色判定を行うための改良に関する。   The present invention relates to an image color determination apparatus, an image color determination method, and a program for determining a ground color of a target image, and more particularly to an improvement for performing good image color determination even when a document has a ground color.

従来より、原稿の地色や背景色に基づいて、所定の処理を実行させる画像処理装置、および画像解析装置が知られている(例えば、特許文献1および2)。特許文献1には、原稿の地色部分の色彩と、それ以外の部分の色彩とを比較した結果に基づいて、原稿の地色以外の部分の色彩を置換する技術が開示されている。   Conventionally, an image processing apparatus and an image analysis apparatus that execute predetermined processing based on the background color and background color of an original are known (for example, Patent Documents 1 and 2). Patent Document 1 discloses a technique for replacing colors of portions other than the background color of the document based on a result of comparing the colors of the background color portion of the document with the colors of other portions.

また、特許文献2には、例えば、Hough変換等によって、入力画像から原稿端のおおよその位置を検出し、この検出された原稿端のRGB値のそれぞれにつき、ヒストグラムのピーク値から下地色候補および背景色候補を推定し、推定された下地色候補および背景色候補から最終的な原稿端を求める技術が開示されている。   Further, in Patent Document 2, for example, the approximate position of the document edge is detected from the input image by Hough conversion or the like, and for each of the detected RGB values of the document edge, the background color candidate and the background color candidate are detected from the peak value of the histogram. A technique for estimating a background color candidate and obtaining a final document edge from the estimated background color candidate and background color candidate is disclosed.

特開平09−149276号公報JP 09-149276 A 特開2004−096435号公報JP 2004-096435 A

ここで、原稿から読み取られた画像(以下、単に、「原稿画像」とも呼ぶ)をRGBの色空間からLab(明度Lと色度a,b)の色空間に変換し、色度が地色(有彩色)と略同一となる範囲および無彩色となる領域を無彩領域と定める場合において、処理モードの選択手法、および、この処理モードによる画像処理について検討する。   Here, an image read from an original (hereinafter, also simply referred to as “original image”) is converted from an RGB color space to a Lab (lightness L and chromaticity a, b) color space, and the chromaticity is ground color. In the case where a range that is substantially the same as (chromatic color) and a region that is an achromatic color are determined as an achromatic region, a method for selecting a processing mode and image processing by this processing mode are examined.

例えば、処理モードの選択において、原稿画像の各画素が無彩領域に属し、有彩領域に属さないと判断されるとき、原稿画像の処理モードとしてモノクロモードが選択される。そして、地色に該当する画素だけでなく、地色と同様な色度を有し、かつ、地色の明度より高い明度を有する画素についても白色に置換する地色除去処理と、地色除去後の原稿画像を記録紙に記録する記録処理とが、モノクロモードの画像処理として実行される場合、以下のような問題点が生じていた。   For example, in the selection of the processing mode, when it is determined that each pixel of the document image belongs to the achromatic region and does not belong to the chromatic region, the monochrome mode is selected as the processing mode of the document image. Then, not only the pixels corresponding to the ground color but also the ground color removal processing for replacing the pixels having the same chromaticity as the ground color and having a lightness higher than the lightness of the ground color with white, and ground color removal When the recording process for recording the subsequent document image on the recording paper is executed as an image process in the monochrome mode, the following problems have occurred.

すなわち、地色より明度の高い明度を有する画素も、地色と同一色(白色)に置換される。その結果、原稿画像の美観と記録紙に記録された記録画像の美観とが相違したものとなってしまうという問題が生じていた。   That is, pixels having lightness higher than the ground color are also replaced with the same color (white) as the ground color. As a result, there has been a problem that the aesthetics of the original image differ from the aesthetics of the recorded image recorded on the recording paper.

また、地色を中心とした所定の色度範囲および明度範囲に含まれる画素について地色除去処理を施す場合においても、カラーモードおよびモノクロモードに関わらず、地色除去の前後の美観(すなわち、原稿画像と記録画像との美観)が相違するという問題が生じていた。   Even when the ground color removal processing is performed on the pixels included in the predetermined chromaticity range and brightness range centered on the ground color, the aesthetics before and after the ground color removal (that is, regardless of the color mode and the monochrome mode) There has been a problem that the aesthetics of the original image and the recorded image are different.

さらに、地色と同様な色度を有し、かつ、地色の明度より高い明度を有する画素を有する原稿画像については、カラーとして判定し、処理モードとしてカラーモードを選択したいという要望もある。   Further, there is a demand for a document image having pixels having the same chromaticity as the ground color and having a lightness higher than the lightness of the ground color as a color and selecting the color mode as the processing mode.

そこで、本発明では、地色を有する画像に対して良好に色判定処理を実行することができる画像色判定装置、画像色判定方法、およびプログラムを提供することを目的とする。   Therefore, an object of the present invention is to provide an image color determination apparatus, an image color determination method, and a program that can execute a color determination process favorably on an image having a ground color.

上記の課題を解決するため、請求項1の発明は、対象画像に係る画像データに基づいて、前記対象画像の地色有無を判定するとともに、前記対象画像が地色を有する場合、地色の明るさおよび色度を判定する地色判定部と、前記対象画像に係る画像データに基づいて、前記対象画像の色判定を行う対象画像判定部とを備え、前記対象画像判定部は、前記地色判定部の判定結果を利用して、色判定を行うことを特徴とする。   In order to solve the above-described problem, the invention of claim 1 determines whether or not a ground color exists in the target image based on image data related to the target image, and if the target image has a ground color, A ground color determination unit that determines brightness and chromaticity; and a target image determination unit that performs color determination of the target image based on image data relating to the target image, wherein the target image determination unit includes: Color determination is performed using the determination result of the color determination unit.

また、請求項2の発明は、請求項1に記載の画像色判定装置において、前記対象画像判定部は、色判定において、判定対象となる画像データの色度および明るさが、前記地色の色度および明るさに相当する場合は無彩と判断し、前記地色の色度に相当し、且つ、前記地色の明るさと異なる場合には有彩と判断することを特徴とする。   According to a second aspect of the present invention, in the image color determination apparatus according to the first aspect, in the color determination, the chromaticity and brightness of the image data to be determined are determined by the target color determination unit. When it corresponds to chromaticity and brightness, it is determined to be achromatic, and when it corresponds to the chromaticity of the ground color and is different from the brightness of the ground color, it is determined to be chromatic.

また、請求項3の発明は、請求項1または請求項2に記載の画像色判定装置において、前記地色判定部は、2次元色平面において、色領域毎に画像データの構成単位の数を計数し、その計数結果を利用して地色有無を判定するものであり、前記対象画像判定部は、2次元色平面において、色領域毎に画像データの構成単位の数を計数し、その計数結果を利用して色判定を行うものであり、前記地色判定部による計数と前記対象画像判定部による計数とは共通の回路を使用することを特徴とする。   According to a third aspect of the present invention, in the image color determination apparatus according to the first or second aspect, the ground color determination unit determines the number of image data constituent units for each color region in a two-dimensional color plane. The target image determination unit counts the number of constituent units of the image data for each color region in the two-dimensional color plane, and counts the result using the counting result. Color determination is performed using the result, and a common circuit is used for the counting by the ground color determination unit and the counting by the target image determination unit.

また、請求項4の発明は、請求項1ないし請求項3のいずれかに記載の画像色判定装置において、前記対象画像判定部による色判定において、前記地色判定部の判定結果を利用するか否かを使用者が設定可能であることを特徴とする。   According to a fourth aspect of the present invention, in the image color determination apparatus according to any one of the first to third aspects, whether the determination result of the ground color determination unit is used in the color determination by the target image determination unit. The user can set whether or not.

また、請求項5の発明は、請求項1ないし請求項4のいずれかに記載の画像色判定装置において、前記対象画像判定部は、2次元色平面において、前記地色判定部で判定した地色の色度に対応する座標位置と、原点位置との位置関係に応じて、画像データに対して移動変換処理を実行するとともに、その移動方向に向かって無彩領域を拡大する処理を実行した上で、無彩領域および有彩領域について、画像データの構成単位の数を計数し、その計数結果を利用して色判定を行うものであることを特徴とする。   According to a fifth aspect of the present invention, in the image color determination apparatus according to any one of the first to fourth aspects, the target image determination unit is a ground determined by the ground color determination unit on a two-dimensional color plane. According to the positional relationship between the coordinate position corresponding to the chromaticity of the color and the origin position, the movement conversion process is performed on the image data, and the process of expanding the achromatic region toward the movement direction is performed. In the above, for the achromatic region and the chromatic region, the number of constituent units of the image data is counted, and color determination is performed using the counting result.

また、請求項6の発明は、請求項1ないし請求項4のいずれかに記載の画像色判定装置において、前記対象画像判定部は、2次元色平面において、前記地色判定部で判定した地色の色度に対応する座標位置を含む方向に、無彩領域を拡大させる処理を実行した上で、無彩領域および有彩領域について、画像データの構成単位の数を計数し、その計数結果を利用して色判定を行うものであることを特徴とする。   According to a sixth aspect of the present invention, in the image color determination apparatus according to any one of the first to fourth aspects, the target image determination unit is a ground determined by the ground color determination unit on a two-dimensional color plane. After executing the process of enlarging the achromatic region in the direction including the coordinate position corresponding to the chromaticity of the color, the number of image data constituent units is counted for the achromatic region and the chromatic region, and the counting result It is characterized in that color determination is performed by using.

また、請求項7の発明は、請求項1ないし請求項6のいずれかに記載の画像色判定装置において、前記地色判定部は、2次元色平面において、色領域毎に画像データの構成単位の数を計数し、その計数結果を利用して地色有無を判定するとともに、2次元色平面において、地色に相当する色領域に計数された構成単位の分布に基づいて、地色の色を判定することを特徴とする。   According to a seventh aspect of the present invention, in the image color determination apparatus according to any one of the first to sixth aspects, the ground color determination unit is a structural unit of image data for each color region in a two-dimensional color plane. The background color is determined based on the distribution of the constituent units counted in the color area corresponding to the ground color on the two-dimensional color plane. It is characterized by determining.

また、請求項8の発明は、請求項1ないし請求項7のいずれかに記載の画像色判定装置において、前記対象画像判定部は、複数の画素を含む画素集合毎に画像データを平均化し、該平均化された画素データを構成単位として画像データの色判定を行うことを特徴とする。   The image color determination apparatus according to any one of claims 1 to 7, wherein the target image determination unit averages image data for each pixel set including a plurality of pixels, The color determination of the image data is performed using the averaged pixel data as a constituent unit.

また、請求項9の発明は、対象画像に係る画像データに基づいて、前記対象画像の地色有無を判定するとともに、前記対象画像が地色を有する場合、地色の明るさおよび色度を判定する地色判定工程と、前記地色判定工程の判定結果を利用して、前記対象画像に係る画像データに基づいて、前記対象画像の色判定を行う対象画像判定工程とを備えることを特徴とする。   The invention of claim 9 determines the presence or absence of the ground color of the target image based on the image data relating to the target image, and if the target image has a ground color, the brightness and chromaticity of the ground color are determined. A ground color determination step for determining; and a target image determination step for performing color determination of the target image based on image data relating to the target image using a determination result of the ground color determination step. And

また、請求項10の発明は、対象画像の色判定を実行可能なコンピュータ読み取り可能なプログラムであって、対象画像に係る画像データに基づいて、前記対象画像の地色有無を判定するとともに、前記対象画像が地色を有する場合、地色の明るさおよび色度を判定する地色判定機能と、前記地色判定機能の判定結果を利用して、前記対象画像に係る画像データに基づいて、前記対象画像の色判定を行う対象画像判定機能とをコンピュータに実行させることを特徴とする。   The invention according to claim 10 is a computer-readable program capable of executing color determination of a target image, wherein the presence or absence of a ground color of the target image is determined based on image data relating to the target image, and When the target image has a ground color, using the ground color determination function for determining the brightness and chromaticity of the ground color and the determination result of the ground color determination function, based on the image data relating to the target image, A target image determination function for determining the color of the target image is executed by a computer.

請求項1ないし請求項10に記載の発明によれば、地色の色度だけでなく、地色の明るさまで考慮して色判定が行える。すなわち、地色と同様な色度を有し、且つ、地色と異なる明るさを有する色を、地色と区別した上で色判定が行える。   According to the first to tenth aspects, color determination can be performed in consideration of not only the chromaticity of the ground color but also the brightness of the ground color. That is, it is possible to perform color determination after distinguishing a color having the same chromaticity as the ground color and having brightness different from the ground color from the ground color.

特に、請求項2に記載の発明によれば、例えば、地色付きの紙に、地色より明るい色の文字等が記述されている原稿をカラーと判定できる。   In particular, according to the second aspect of the present invention, for example, it is possible to determine that a manuscript in which characters having a lighter color than the ground color are described on paper with a ground color is a color.

特に、請求項3に記載の発明によれば、画像色判定装置の構成が簡単になる。また、請求項4に記載の発明によれば、多様なユーザニーズに対応できる。例えば、使用者は、カラーの地色をモノクロと判定するとともに、地色よりも明るい色が存在する場合には、それをカラーと判定したいときには、地色判定結果を利用して色判定するように設定し、カラーの地色をカラーと判定したい場合には、地色判定結果を利用せずに色判定を行うように設定することができる。   In particular, according to the third aspect of the invention, the configuration of the image color determination device is simplified. Moreover, according to the invention of Claim 4, it can respond to various user needs. For example, the user determines that the background color of the color is monochrome and, when there is a color brighter than the background color, if the user wants to determine the color as a color, the user determines the color using the ground color determination result. If the background color of the color is determined to be color, the color determination can be performed without using the background color determination result.

特に、請求項5に記載の発明によれば、簡単な処理により、地色の色に相当する構成単位を無彩領域に属すると判定できる。   In particular, according to the invention described in claim 5, it is possible to determine that the structural unit corresponding to the ground color belongs to the achromatic region by a simple process.

特に、請求項7に記載の発明によれば、2次元色平面を使って、地色の色を簡単且つ正確に判定することができる。   In particular, according to the seventh aspect of the invention, it is possible to easily and accurately determine the color of the ground color using a two-dimensional color plane.

特に、請求項8に記載の発明によれば、偽色の影響を排除できる。   In particular, according to the invention described in claim 8, the influence of false color can be eliminated.

以下、図面を参照しつつ本発明の実施の形態について詳細に説明する。   Hereinafter, embodiments of the present invention will be described in detail with reference to the drawings.

<1.画像色判定装置の構成>
図1は、本実施の形態における画像色判定装置1の構成の一例を示す図である。ここで、画像色判定装置1は、スキャナ、プリンタ、複写機、ファクシミリ、またはこれらの機能を複合させた複合機である。また、画像色判定装置1は、例えばスキャナ部41によって読み取られた原稿の地色を検出することができる。
<1. Configuration of Image Color Determination Device>
FIG. 1 is a diagram illustrating an example of a configuration of an image color determination apparatus 1 according to the present embodiment. Here, the image color determination apparatus 1 is a scanner, a printer, a copier, a facsimile, or a complex machine that combines these functions. Further, the image color determination apparatus 1 can detect the background color of the document read by the scanner unit 41, for example.

図1に示すように、画像色判定装置1は、主として、モデム22と、スキャナ部41と、記録部51と、地色判定部70と、対象画像判定部80と、を備えている。ここで、「地色」とは、原稿に存在する背景色をいう。   As shown in FIG. 1, the image color determination apparatus 1 mainly includes a modem 22, a scanner unit 41, a recording unit 51, a ground color determination unit 70, and a target image determination unit 80. Here, “ground color” refers to a background color existing in the document.

モデム22は、デジタルデータを送信用の音声信号に変換したり、画像色判定装置1の外部から送信されて画像色判定装置1で受信された音声信号をデジタルデータに変換する。また、NCU21は、公衆電話交換回線網に画像色判定装置1を接続する際に必要となる機器であり、発着信やダイヤル制御を行う。さらに、通信部25は、ネットワークを介して接続された情報処理装置(図示省略)等との間でデータ通信を実行するLANインタフェースである。   The modem 22 converts digital data into an audio signal for transmission, or converts an audio signal transmitted from the outside of the image color determination device 1 and received by the image color determination device 1 into digital data. The NCU 21 is a device required when the image color determination apparatus 1 is connected to the public switched telephone network, and performs outgoing / incoming calls and dial control. Further, the communication unit 25 is a LAN interface that performs data communication with an information processing apparatus (not shown) connected via a network.

CODEC31は、ファクシミリ通信で送信される画像の可逆圧縮処理に使用される。CODEC31は、例えば、スキャナ部41によって原稿から読み取られ、画像処理回路61にて2値化された画像を符号化する。符号化された画像は画像メモリ16に記憶される。また、CODEC31は、他の画像色判定装置から送信されたファクシミリデータ(2値データ)を復号する。そして、復号された2値データは記録部51に供給され、記録処理が実行される。   The CODEC 31 is used for lossless compression processing of images transmitted by facsimile communication. For example, the CODEC 31 encodes an image read from a document by the scanner unit 41 and binarized by the image processing circuit 61. The encoded image is stored in the image memory 16. The CODEC 31 decodes facsimile data (binary data) transmitted from another image color determination device. The decoded binary data is supplied to the recording unit 51, and a recording process is executed.

なお、CODEC31による符号化としては、2値データを符号化する場合には、MH(Modified Huffman)、MR(Modified Read)、MMR(Modified MR)、および、JBIG(Joint Bi-level Image experts Group)のいずれかの方式が採用される。なお、CODEC31は、多値データの符号化も行う。多値データの符号化は、例えばJPEG方式にて行う。   As encoding by CODEC 31, when binary data is encoded, MH (Modified Huffman), MR (Modified Read), MMR (Modified MR), and JBIG (Joint Bi-level Image experts Group). Either method is adopted. The CODEC 31 also encodes multi-value data. Multi-level data is encoded by, for example, the JPEG method.

スキャナ部41は、原稿から画像を読み取る読取部である。スキャナ部41で読み取られた画像データ(読取画像データ)は、例えば、CODEC31によりJPEG方式にて圧縮され、画像メモリ16に記憶される。   The scanner unit 41 is a reading unit that reads an image from a document. The image data (read image data) read by the scanner unit 41 is compressed by, for example, the JPEG method by the CODEC 31 and stored in the image memory 16.

すなわち、スキャナ部41は、後述するCCDラインセンサ41aにより原稿に描かれた画像を読み取り、当該画像に係る画像データを生成する。スキャナ部41は、ADF(Automatic Document Feeder)方式又はFBS(Flat Bed Scanner)方式により原稿に描かれた画像を読み取る。ADF方式とは、複数枚の原稿を束ねた原稿束から原稿を一枚づつ繰り込んで読み取る方式であり、FBS方式とは、コンタクトガラス上に載置された原稿を読み取る方式である。ADF方式には、移動する原稿を静止した読取光学系で読み取る方式(シートスルー方式)と、静止した原稿を移動する読取光学系で読み取る方式とがあり、後者の方式を採用する場合、スキャナ部41は、コンタクトガラス上に原稿を静止させ、移動する読取光学系で静止した原稿を読み取り、読み取りが完了した原稿を排出するという読み取り手順を繰り返し実行する。なお、読み取られた画像データには、平均化処理が施されてもよい。   That is, the scanner unit 41 reads an image drawn on a document by a CCD line sensor 41a, which will be described later, and generates image data related to the image. The scanner unit 41 reads an image drawn on a document by an ADF (Automatic Document Feeder) method or an FBS (Flat Bed Scanner) method. The ADF method is a method of reading a document by feeding it one by one from a document bundle obtained by bundling a plurality of documents, and the FBS method is a method of reading a document placed on a contact glass. The ADF method includes a method of reading a moving document with a stationary reading optical system (sheet-through method) and a method of reading a stationary document with a reading optical system that moves. When the latter method is adopted, the scanner unit Reference numeral 41 repeatedly executes a reading procedure in which an original is stopped on a contact glass, the stationary original is read by a moving reading optical system, and the original that has been read is discharged. The read image data may be subjected to an averaging process.

CCDラインセンサ41aは、原稿からの光をCCDラインセンサ41aへ導く読取光学系が原稿を走査している際に、一定の周期で読み取りを繰り返すことにより、RGB色空間で表現された画像データ、すなわち、R(赤),G(緑),B(青)の色成分データを有する画像データを生成する。読取光学系の走査速度は、CCDラインセンサ41aが生成する画像データの副走査方向の解像度に基づいて設定する。具体的には、副走査方向の解像度が高くなるほど、読取光学系の走査速度を遅くし、副走査方向の解像度が低くなるほど、読取光学系の走査速度を速くする。「走査速度」とは、原稿と読取光学系との相対移動速度である。   The CCD line sensor 41a repeats reading at a constant cycle while the reading optical system that guides light from the document to the CCD line sensor 41a scans the document, whereby image data expressed in RGB color space, That is, image data having color component data of R (red), G (green), and B (blue) is generated. The scanning speed of the reading optical system is set based on the resolution in the sub-scanning direction of the image data generated by the CCD line sensor 41a. Specifically, the higher the resolution in the sub-scanning direction, the slower the scanning speed of the reading optical system, and the lower the resolution in the sub-scanning direction, the higher the scanning speed of the reading optical system. The “scanning speed” is a relative moving speed between the original and the reading optical system.

記録部51は、電子写真方式により、静電潜像に基づいたトナー画像を記録紙に記録する画像形成部である。例えば、記録部51は、読み取られた画像に基づいたトナー画像を感光体ドラム(図示省略)に形成し、このトナー画像を記録紙に転写する。このように、記録部51は、記録対象となる画像に対して記録処理を施す処理部として使用される。   The recording unit 51 is an image forming unit that records a toner image based on an electrostatic latent image on a recording sheet by an electrophotographic method. For example, the recording unit 51 forms a toner image based on the read image on a photosensitive drum (not shown), and transfers the toner image to a recording sheet. As described above, the recording unit 51 is used as a processing unit that performs a recording process on an image to be recorded.

画像処理回路61は、画像データに対して所定の画像処理を施す処理部である。画像処理回路61は、例えば、画像データに対してガンマ補正を施す処理、画像データの解像度を変換する処理、および画像データの色空間を第1色空間から第2色空間(例えば、RGBの色空間からLab(明度Lと色度a,b)の色空間)に変換する処理等を実行する。なお、これらの画像処理は、ROM13に格納されたプログラム13aに基づき、MPU11によってソフトウェア的に実現されてもよい。   The image processing circuit 61 is a processing unit that performs predetermined image processing on image data. The image processing circuit 61 performs, for example, a process of performing gamma correction on the image data, a process of converting the resolution of the image data, and a color space of the image data from the first color space to the second color space (for example, RGB color). Processing for converting from space to Lab (color space of lightness L and chromaticity a, b) is executed. Note that these image processes may be realized in software by the MPU 11 based on the program 13 a stored in the ROM 13.

表示部63は、いわゆる液晶ディスプレイによって構成されており、指や専用のペンで画面に触れることによって画面上の位置を指定できる「タッチパネル」としての機能を有している。したがって、画像色判定装置1の使用者(以下、単に「使用者」と呼ぶ)は、表示部63に表示された内容に基づき、表示部63の「タッチパネル」機能を使用した指示を行うことによって、画像色判定装置1に対して所定の動作を実行させることができる。このように、表示部63は入力部としても使用される。   The display unit 63 is configured by a so-called liquid crystal display, and has a function as a “touch panel” that can specify a position on the screen by touching the screen with a finger or a dedicated pen. Therefore, the user of the image color determination apparatus 1 (hereinafter simply referred to as “user”) performs an instruction using the “touch panel” function of the display unit 63 based on the content displayed on the display unit 63. The image color determination apparatus 1 can be caused to execute a predetermined operation. Thus, the display unit 63 is also used as an input unit.

操作部64は、いわゆるキーパッドによって構成される入力部である。使用者は、表示部63の表示内容に基づいた入力作業を行うことにより、画像色判定装置1に対して所定の動作を実行させることができる。   The operation unit 64 is an input unit configured by a so-called keypad. The user can cause the image color determination apparatus 1 to execute a predetermined operation by performing an input operation based on the display content of the display unit 63.

地色判定部70は、スキャナ部41によって原稿を読み取って得た画像や画像メモリ16に格納された画像(以下、「対象画像に係る画像データ」とも呼ぶ)に基づいて、対象画像の地色を判定する。すなわち、地色判定部70は、対象画像の地色の有無を検出(判定)し、対象画像が地色を有する画像(地色原稿)である場合、地色の色(2次元色平面上の座標位置)を検出(判定)する。   The ground color determination unit 70 is based on an image obtained by reading a document by the scanner unit 41 or an image stored in the image memory 16 (hereinafter also referred to as “image data related to the target image”). Determine. That is, the ground color determination unit 70 detects (determines) the presence or absence of the ground color of the target image. When the target image is an image having a ground color (ground color original), the ground color (on the two-dimensional color plane) Is detected (determined).

対象画像判定部80は、地色判定部70の判定結果を利用して、対象画像に係る画像データに基づいて、対象画像の色判定を実行する。また、対象画像判定部80は、色判定の結果に基づいて、記録部51や画像処理回路61等の処理部で実行される処理モードを選択する。例えば、対象画像判定部80は、処理モードとして、カラー処理の実行を可能とするカラーモードと、モノクロ処理の実行を可能とするモノクロモードと、を選択可能とされている。すなわち、対象画像判定部80は、地色判定部70によって設定された地色と同様な色度を有し、かつ、地色より明るい色が存在する場合には、処理モードとしてカラーモードを選択する。   The target image determination unit 80 executes the color determination of the target image based on the image data related to the target image using the determination result of the ground color determination unit 70. In addition, the target image determination unit 80 selects a processing mode to be executed by a processing unit such as the recording unit 51 or the image processing circuit 61 based on the result of the color determination. For example, the target image determination unit 80 can select a color mode that enables execution of color processing and a monochrome mode that enables execution of monochrome processing as processing modes. That is, the target image determination unit 80 selects the color mode as the processing mode when there is a chromaticity similar to the ground color set by the ground color determination unit 70 and there is a lighter color than the ground color. To do.

なお、地色判定部70および対象画像判定部80の詳細な構成については、後述する。地色判定部70は、2次元平面において、色領域毎に画像データの構成単位(単位画像データ)の数を計数し、その計数結果を利用して地色有無を判定する。すなわち、地色判定部70は、2次元色平面上に形成した色領域毎に構成単位を計数し、構成単位の分布が、特定の色領域に偏って存在するか否かによって、地色有無を判定する。特定の色領域に偏って存在する場合、その色領域に相当する色の地色が存在すると判定する。特定の色領域に偏って存在することがない場合、すなわち、複数の色領域に対して同程度にばらけている場合、地色は存在しないと判定する。また、無彩領域に偏って存在する場合も、地色は存在しないと判定する。対象画像判定部80は、2次元色平面において、色領域毎に画像データの構成単位(単位画像データ)の数を計数し、その計数結果を利用して色判定を行う。すなわち、対象画像判定部80は、2次元色平面上に形成した色領域毎に構成単位を計数し、その計数結果を利用して、対象画像の色判定を行う。色領域を無彩領域(原点付近の領域)と有彩領域(無彩領域を除く領域)とし、無彩領域および有彩領域における構成単位の分布に基づいて、対象画像がカラー画像であるかモノクロ画像であるかを判定することができる。例えば、無彩領域に存在する構成単位が多く、有彩領域に存在する構成単位が少ない場合には、モノクロ画像であると判定し、有彩領域に存在する構成単位が多い場合には、カラー画像であると判定することができる。   The detailed configurations of the ground color determination unit 70 and the target image determination unit 80 will be described later. The ground color determination unit 70 counts the number of structural units (unit image data) of image data for each color region on a two-dimensional plane, and determines the presence or absence of a ground color using the count result. That is, the ground color determination unit 70 counts the constituent units for each color region formed on the two-dimensional color plane, and determines whether or not there is a base color depending on whether the distribution of the constituent units is biased to a specific color region. Determine. If it exists in a specific color area, it is determined that there is a ground color corresponding to the color area. When there is no bias toward a specific color area, that is, when the same color is scattered over a plurality of color areas, it is determined that there is no ground color. In addition, even when there is a bias in the achromatic region, it is determined that the ground color does not exist. The target image determination unit 80 counts the number of structural units (unit image data) of image data for each color region on the two-dimensional color plane, and performs color determination using the count result. That is, the target image determination unit 80 counts the constituent units for each color region formed on the two-dimensional color plane, and performs color determination of the target image using the count result. Whether the target image is a color image based on the distribution of structural units in the achromatic region and the chromatic region, assuming that the color region is an achromatic region (region near the origin) and a chromatic region (region excluding the achromatic region) Whether the image is a monochrome image can be determined. For example, if there are many structural units in the achromatic area and few structural units in the chromatic area, the image is determined to be a monochrome image, and if there are many structural units in the chromatic area, color It can be determined that it is an image.

このように、地色判定部70と対象画像判定部80とは、異なる処理を実行するものであるが、色領域毎の計数処理を行う点で共通していることに着目し、本実施形態では、共通の回路を使用することにより、地色判定部70による計数および対象画像判定部80による計数を実行している。これにより、画像色判定装置1の構成を簡単化することができる。   As described above, the ground color determination unit 70 and the target image determination unit 80 execute different processes, but pay attention to the fact that they are common in that they perform the counting process for each color region. Then, by using a common circuit, the counting by the ground color determination unit 70 and the counting by the target image determination unit 80 are executed. Thereby, the structure of the image color determination apparatus 1 can be simplified.

RAM(Random Access Memory )12および画像メモリ16は、読み書き自在の揮発性メモリ(記憶部)である。ROM(Read Only Memory)13は、読出し専用メモリーである。MPU(Micro Processing Unit)11は、ROM13に格納されたプログラム13aに従った制御を実行する。また、MPU11、ROM13、記録部51等のそれぞれは、信号線15を介して電気的に接続されている。したがって、MPU11は、例えば、記録部51による記録処理等を所定のタイミングで実行させることができる。   A RAM (Random Access Memory) 12 and an image memory 16 are readable and writable volatile memories (storage units). A ROM (Read Only Memory) 13 is a read only memory. An MPU (Micro Processing Unit) 11 executes control according to a program 13 a stored in the ROM 13. In addition, each of the MPU 11, the ROM 13, the recording unit 51, and the like is electrically connected via the signal line 15. Therefore, the MPU 11 can execute, for example, a recording process by the recording unit 51 at a predetermined timing.

圧縮伸張部として機能するCODEC31は、画像データを取得し、圧縮画像データを生成し、当該圧縮画像データを画像メモリ16に蓄積する。   The CODEC 31 functioning as a compression / decompression unit acquires image data, generates compressed image data, and stores the compressed image data in the image memory 16.

なお、画像色判定装置1の処理モードには、上述のように、「モノクロモード」及び「カラーモード」がある。   Note that the processing modes of the image color determination apparatus 1 include the “monochrome mode” and the “color mode” as described above.

「カラーモード」でスキャンを行う際には、色空間変換部61bが、解像度変換部61aから入力された多階調のRGB画像データを多階調のYCbCr画像データへ変換し、CODEC31が、多階調のYCbCr画像データをJPEG方式等で圧縮して画像メモリ16に蓄積する。   When scanning in the “color mode”, the color space conversion unit 61b converts the multi-gradation RGB image data input from the resolution conversion unit 61a into multi-gradation YCbCr image data, and the CODEC 31 The gradation YCbCr image data is compressed by the JPEG method or the like and stored in the image memory 16.

「カラーモード」でコピーを行う際には、色空間変換部61bが、解像度変換部61aから入力された多階調のRGB画像データを多階調のLab画像データ(L*a*b*色空間で表現された画像データ)へ変換し、多階調のLab画像データをさらに多階調のCMYK画像データ(CMYK色空間で表現された画像データ)へ変換する。多階調のCMYK画像データは二階調のCMYK画像データへ二値化され、記録部51は、二階調のCMYK画像データを取得し、「Y」「M」「C」「K」の画像形成エンジン(4色の画像形成エンジン)のうち必要なものを用いて、記録媒体上にカラー画像を形成する。ここで、「「Y」「M」「C」「K」の画像形成エンジン(4色の画像形成エンジン)のうち必要なものを用いる」とは、画像に含まれる色を表現するために必要な画像形成エンジンのみを動作させればよいという趣旨である。例えば、画像に含まれる色の色区分が「Y」のみであれば、「Y」の画像形成エンジンのみを動作させればよく、画像に含まれる色の色区分が「R」であれば、「Y」及び「M」の画像形成エンジンのみを動作させればよい。   When copying in the “color mode”, the color space conversion unit 61b converts the multi-gradation RGB image data input from the resolution conversion unit 61a into multi-gradation Lab image data (L * a * b * color). Image data expressed in space), and the multi-tone Lab image data is further converted into multi-tone CMYK image data (image data expressed in the CMYK color space). The multi-tone CMYK image data is binarized into two-tone CMYK image data, and the recording unit 51 acquires the two-tone CMYK image data and forms “Y”, “M”, “C”, and “K” image formations. A color image is formed on a recording medium using a necessary engine (a four-color image forming engine). Here, “use necessary one of“ Y ”,“ M ”,“ C ”, and“ K ”image forming engines (four color image forming engines) is necessary to express colors included in an image. This means that it is only necessary to operate a simple image forming engine. For example, if the color classification of the color included in the image is only “Y”, only the image forming engine of “Y” may be operated. If the color classification of the color included in the image is “R”, Only the “Y” and “M” image forming engines need be operated.

原稿がグレー原稿(白黒写真原稿等)である場合に「モノクロモード」でスキャンを行うときには、色空間変換部61bが、解像度変換部61aから入力された多階調のRGB画像データを多階調のYCbCr画像データへ変換し、CODEC31が、多階調のYCbCr画像データの輝度成分YをJPEG方式で圧縮して画像メモリ16に蓄積する。   When scanning in the “monochrome mode” when the original is a gray original (monochrome photo original or the like), the color space conversion unit 61b converts the multi-gradation RGB image data input from the resolution conversion unit 61a into multiple gradations. Then, the CODEC 31 compresses the luminance component Y of the multi-gradation YCbCr image data by the JPEG method and stores the compressed YCbCr image data in the image memory 16.

又は、色空間変換部61bが、解像度変換部61aから入力された多階調のRGB画像データを多階調のYCbCr画像データへ変換する。多階調のYCbCr画像データの輝度成分Yは、二階調の輝度成分Yへ組織的ディザ法等で二値化され、CODEC31が、二階調の輝度成分YをJBIG方式等で圧縮して画像メモリ16に蓄積する。   Alternatively, the color space conversion unit 61b converts the multi-gradation RGB image data input from the resolution conversion unit 61a into multi-gradation YCbCr image data. The luminance component Y of the multi-gradation YCbCr image data is binarized into the two-gradation luminance component Y by a systematic dither method or the like, and the CODEC 31 compresses the two-gradation luminance component Y by the JBIG method or the like to generate an image memory. 16 accumulate.

一方、原稿が白黒原稿(白黒文字原稿等)である場合には、色空間変換部61bが、解像度変換部61aから入力された多階調のRGB画像データを多階調のYCbCr画像データへ変換する。多階調のYCbCr画像データの輝度成分Yは、二階調の輝度成分Yへ単純二値化法等で二値化され、CODEC31が、二階調の輝度成分YをJBIG方式等で圧縮して画像メモリ16に蓄積する。   On the other hand, when the document is a monochrome document (such as a monochrome character document), the color space conversion unit 61b converts the multi-gradation RGB image data input from the resolution conversion unit 61a into multi-gradation YCbCr image data. To do. The luminance component Y of the multi-gradation YCbCr image data is binarized into a two-gradation luminance component Y by a simple binarization method or the like, and the CODEC 31 compresses the two-gradation luminance component Y by a JBIG method or the like. Accumulate in memory 16.

原稿がグレー原稿である場合に「モノクロモード」でコピーを行うときには、色空間変換部61bが、解像度変換部61aから入力された多階調のRGB画像データを多階調のYCbCr画像データへ変換する。多階調のYCbCr画像データの輝度成分Yは、二階調の輝度成分Yへ組織的ディザ法や誤差拡散法等で二値化され、記録部51は、二階調の輝度成分Yを取得し、「K」の画像形成エンジンを用いて、記録媒体上にモノクロ画像を形成する。   When copying in the “monochrome mode” when the original is a gray original, the color space conversion unit 61b converts the multi-gradation RGB image data input from the resolution conversion unit 61a into multi-gradation YCbCr image data. To do. The luminance component Y of the multi-gradation YCbCr image data is binarized into a two-gradation luminance component Y by a systematic dither method, an error diffusion method, or the like, and the recording unit 51 acquires the two-gradation luminance component Y, A monochrome image is formed on the recording medium using the “K” image forming engine.

一方、原稿が白黒原稿である場合には、色空間変換部61bが、解像度変換部61aから入力された多階調のRGB画像データを多階調のYCbCr画像データへ変換する。多階調のYCbCr画像データの輝度成分Yは、二階調の輝度成分Yへ誤差拡散法や単純二値化法等で二値化され、記録部51は、二階調の輝度成分Yを取得し、「K」の画像形成エンジンを用いて、記録媒体上にモノクロ画像を形成する。   On the other hand, when the document is a monochrome document, the color space conversion unit 61b converts the multi-gradation RGB image data input from the resolution conversion unit 61a into multi-gradation YCbCr image data. The luminance component Y of the multi-gradation YCbCr image data is binarized into the two-gradation luminance component Y by an error diffusion method or a simple binarization method, and the recording unit 51 acquires the two-gradation luminance component Y. , “K” is used to form a monochrome image on the recording medium.

なお、グレー原稿のコピーを行う際の二値化は、白黒原稿のコピーを行う際よりも階調の再現性を重視して行うことが望ましく、白黒原稿のコピーを行う際の二値化は、グレー原稿のコピーを行う際よりも文字の再現性を重視して行うことが望ましい。   It should be noted that binarization when copying a gray document is preferably performed with more emphasis on reproducibility of gradation than when copying a black and white document, and binarization when copying a black and white document is performed. Therefore, it is desirable to emphasize character reproducibility rather than copying gray originals.

<2.地色判定部および対象画像判定部の構成>
ここでは、地色判定部70および対象画像判定部80の構成について説明する。図1に示すように、地色判定部70による地色判定機能は、第1単位画像データ判定部65aと、第1単位画像データ計数部66aと、第1ブロック判定部67aと、第1ブロック計数部68aと、地色設定部71と、によって実現される。
<2. Configuration of ground color determination unit and target image determination unit>
Here, the configurations of the ground color determination unit 70 and the target image determination unit 80 will be described. As shown in FIG. 1, the ground color determination function by the ground color determination unit 70 includes a first unit image data determination unit 65a, a first unit image data counting unit 66a, a first block determination unit 67a, and a first block. This is realized by the counting unit 68a and the ground color setting unit 71.

また、図1に示すように、対象画像判定部80による色判定機能は、第1単位画像データ判定部65bと、第2単位画像データ判定部82と、第1単位画像データ計数部66bと、第2単位画像データ計数部83と、第1ブロック判定部67bと、第2ブロック判定部84と、第1ブロック計数部68bと、第2ブロック計数部85と、対象画像変換部72と、モード選択部81と、によって実現される。   As shown in FIG. 1, the color determination function of the target image determination unit 80 includes a first unit image data determination unit 65b, a second unit image data determination unit 82, a first unit image data counting unit 66b, Second unit image data counting unit 83, first block determining unit 67b, second block determining unit 84, first block counting unit 68b, second block counting unit 85, target image converting unit 72, mode And the selection unit 81.

さらに、対象画像判定部80の第1単位画像データ判定部65b、第1単位画像データ計数部66b、第1ブロック判定部67b、および第1ブロック計数部68bは、それぞれ対応する地色判定部70の第1単位画像データ判定部65a、第1単位画像データ計数部66a、第1ブロック判定部67a、および第1ブロック計数部68aと同様な機能を実現する。   Further, the first unit image data determining unit 65b, the first unit image data counting unit 66b, the first block determining unit 67b, and the first block counting unit 68b of the target image determining unit 80 are respectively associated with the corresponding ground color determining units 70. Functions similar to those of the first unit image data determination unit 65a, the first unit image data counting unit 66a, the first block determination unit 67a, and the first block counting unit 68a are realized.

ここで、本実施の形態の第1単位画像データ判定部65(65a、65b)、第1単位画像データ計数部66(66a、66b)、第1ブロック判定部67(67a、67b)、第1ブロック計数部68(68a、68b)、第2単位画像データ判定部82、第2単位画像データ計数部83、第2ブロック判定部84、および第2ブロック計数部85のそれぞれは、対象画像を構成する画素データでなく、対象画像に基づいて取得された単位画像データ(構成単位)に基づいて、計数処理および判定処理を実行する。   Here, the first unit image data determination unit 65 (65a, 65b), the first unit image data counting unit 66 (66a, 66b), the first block determination unit 67 (67a, 67b), the first of the present embodiment. Each of the block counting unit 68 (68a, 68b), the second unit image data determining unit 82, the second unit image data counting unit 83, the second block determining unit 84, and the second block counting unit 85 constitutes a target image. The counting process and the determination process are executed based on unit image data (constituent unit) acquired based on the target image instead of the pixel data to be processed.

この単位画像データは、対象画像を隣接するn(nは自然数)画素毎に区分した画素群であり、各単位画像データの値としては、対応する画素群に含まれる各画素の値の平均値が使用される。   The unit image data is a pixel group obtained by dividing the target image into adjacent n (n is a natural number) pixels, and the value of each unit image data is an average value of the values of each pixel included in the corresponding pixel group. Is used.

例えば、各単位画像データが縦(副走査方向)2×横(主走査方向)2(すなわち、n=「4」)画素毎に区分した画素群によって構成されている。対象画像の色空間がRGBである場合において、各単位画像データの値(R,G,B)としては、対応する画素群に含まれる4つの画素のR値、G値、B値を平均したものが使用される。このように、本実施の形態において、単位画像データを生成する処理は、隣接する所定個数の画素データを平均化する処理であり、平均部61cによって実現されている。   For example, each unit image data is constituted by a pixel group divided into vertical (sub-scanning direction) 2 × horizontal (main scanning direction) 2 (that is, n = “4”) pixels. When the color space of the target image is RGB, the R value, G value, and B value of four pixels included in the corresponding pixel group are averaged as the values (R, G, B) of each unit image data. Things are used. Thus, in the present embodiment, the process of generating unit image data is a process of averaging a predetermined number of adjacent pixel data, and is realized by the averaging unit 61c.

また、本実施の形態において、第1単位画像データ判定部65、第1単位画像データ計数部66、第1ブロック判定部67、第1ブロック計数部68、第2単位画像データ判定部82、第2単位画像データ計数部83、第2ブロック判定部84、および第2ブロック計数部85による処理は、2次元色平面である色平面H上でアフィン変換された画像データに対して実行される。   In the present embodiment, the first unit image data determination unit 65, the first unit image data counting unit 66, the first block determination unit 67, the first block counting unit 68, the second unit image data determination unit 82, The processing by the two-unit image data counting unit 83, the second block determining unit 84, and the second block counting unit 85 is executed on image data that has been affine transformed on the color plane H that is a two-dimensional color plane.

そこで、以下では、まず、色平面Hについて説明し、続いて、地色判定部70および対象画像判定部80の構成要素である第1単位画像データ判定部65、第2単位画像データ判定部82、第1単位画像データ計数部66、第2単位画像データ計数部83、第1ブロック判定部67、第2ブロック判定部84、第1ブロック計数部68、第2ブロック計数部85、地色設定部71、対象画像変換部72、およびモード選択部81について説明する。   Therefore, in the following, first, the color plane H will be described, and then the first unit image data determination unit 65 and the second unit image data determination unit 82 which are constituent elements of the ground color determination unit 70 and the target image determination unit 80. , First unit image data counting unit 66, second unit image data counting unit 83, first block determining unit 67, second block determining unit 84, first block counting unit 68, second block counting unit 85, ground color setting The unit 71, the target image conversion unit 72, and the mode selection unit 81 will be described.

<2.1.色平面の構成>
図2は、色平面Hの一例を示す図である。図3は、色平面Hを取得する手法を説明する図である。色平面Hは、一般的なLab表色系の色度図に対して回転変換やスケーリング変換等のアフィン変換が施されることによって得られる。したがって、色平面Hは、色相及び彩度に関してLab色度図と同様の性質を有することになる。すなわち、原点Oを中心に放射状に各色が配置される。また、原点Oからの向きによって色相が示され、原点Oからの距離によって彩度が示される。
<2.1. Color plane configuration>
FIG. 2 is a diagram illustrating an example of the color plane H. As illustrated in FIG. FIG. 3 is a diagram illustrating a method for acquiring the color plane H. The color plane H is obtained by performing affine transformation such as rotation transformation and scaling transformation on a chromaticity diagram of a general Lab color system. Therefore, the color plane H has the same properties as the Lab chromaticity diagram with respect to hue and saturation. That is, each color is arranged radially around the origin O. Further, the hue is indicated by the direction from the origin O, and the saturation is indicated by the distance from the origin O.

また、図2に示すように、色平面Hは、横軸a3と縦軸b3とによる直交座標系によって構成されており、色平面Hの各点は、座標位置(a3,b3)によって表される。したがって、座標位置(a3,b3)は、色相及び彩度に関するパラメータ(以下、「色パラメータ」とも呼ぶ。)として使用される。各単位画像データが色平面H上のどこに位置するかは、その各単位画像データが有する色度値(a,b)によって決まる。   As shown in FIG. 2, the color plane H is constituted by an orthogonal coordinate system having a horizontal axis a3 and a vertical axis b3, and each point of the color plane H is represented by a coordinate position (a3, b3). The Therefore, the coordinate position (a3, b3) is used as a parameter relating to hue and saturation (hereinafter also referred to as “color parameter”). Where the unit image data is located on the color plane H is determined by the chromaticity values (a, b) of the unit image data.

ここで、色平面Hの原点O及びその近傍は、おおよそ無彩色となることが知られている。本実施の形態において、色平面Hの原点O近傍には、有彩色と無彩色との境界を示す彩度境界線D0が設定されている。これにより、彩度境界線D0の内側は、無彩色を示す無彩領域mAとなる。また、彩度境界線D0の外側は有彩色を示す有彩領域となる。   Here, it is known that the origin O of the color plane H and the vicinity thereof are approximately achromatic. In the present embodiment, a saturation boundary line D0 indicating a boundary between a chromatic color and an achromatic color is set near the origin O of the color plane H. Thereby, the inside of the saturation boundary line D0 becomes an achromatic region mA indicating an achromatic color. Further, the outside of the saturation boundary line D0 is a chromatic region indicating a chromatic color.

また、彩度境界線D0の外側の有彩領域には、色相の境界を示す6つの色相境界線D1〜D6が設定されている。各色相境界線D1〜D6は、原点側から放射状に伸びる半直線である。有彩領域は、これら色相境界線D1〜D6と、彩度境界線D0とによって、複数(本実施の形態では6つ)の色領域mC、mM、mY、mR、mG、mBに区分される。   In the chromatic region outside the saturation boundary line D0, six hue boundary lines D1 to D6 indicating the hue boundary are set. Each of the hue boundary lines D1 to D6 is a half straight line extending radially from the origin side. The chromatic area is divided into a plurality (six in this embodiment) of color areas mC, mM, mY, mR, mG, and mB by the hue boundary lines D1 to D6 and the saturation boundary line D0. .

すなわち、図2に示すように、色相境界線D1は、色領域mRと色領域mYとの境界となる。また、色相境界線D2は、色領域mYと色領域mGとの境界となる。また、色相境界線D3は色領域mGと色領域mCとの境界となる。また、色相境界線D4は、色領域mCと色領域mBとの境界となる。また、色相境界線D5は色領域mBと色領域mMとの境界となる。さらに、色相境界線D6は色領域mMと色領域mRとの境界となる。   That is, as shown in FIG. 2, the hue boundary line D1 is a boundary between the color region mR and the color region mY. Further, the hue boundary line D2 is a boundary between the color area mY and the color area mG. Further, the hue boundary line D3 is a boundary between the color region mG and the color region mC. Further, the hue boundary line D4 is a boundary between the color region mC and the color region mB. Further, the hue boundary line D5 is a boundary between the color region mB and the color region mM. Furthermore, the hue boundary line D6 is a boundary between the color region mM and the color region mR.

なお、これら色領域mC、mM、mY、mR、mG、mYは、それぞれ6つの判定色C(シアン)、M(マゼンタ)、Y(イエロー)、R(レッド)、G(グリーン)、B(ブルー)と対応する。   These color regions mC, mM, mY, mR, mG, and mY are six determination colors C (cyan), M (magenta), Y (yellow), R (red), G (green), and B ( Blue).

そして、本実施の形態の地色判定および色判定は、色平面H上における各単位画像データの座標位置(a3,b3)の位置に基づいて実行される。例えば、単位画像データの座標位置(a3,b3)が、無彩領域mAに存在する場合、単位画像データの色は無彩色であると判定される。一方、単位画像データの座標位置(a3,b3)が、色領域mC、mM、mY、mR、mG、mBのいずれかに存在する場合、単位画像データの色は、色領域に応じた色相および彩度を持つ有彩色C、M、Y、R、G、Bであると判定される。   The ground color determination and the color determination of the present embodiment are executed based on the position of the coordinate position (a3, b3) of each unit image data on the color plane H. For example, when the coordinate position (a3, b3) of the unit image data exists in the achromatic region mA, it is determined that the color of the unit image data is an achromatic color. On the other hand, when the coordinate position (a3, b3) of the unit image data is present in any of the color regions mC, mM, mY, mR, mG, mB, the color of the unit image data has a hue and a color corresponding to the color region. It is determined that the chromatic colors C, M, Y, R, G, and B have saturation.

ここで、色平面Hは以下の手順によって取得される。まず、Lab表色系の色平面H0に対して、色相境界線D1〜D6が設定される(図3左側参照)。この色平面H0は、一般的なLab表色系の色度図に相当し、横軸がa、縦軸がbとなる直交二次元座標系を有している。また、色相境界線D1〜D6は、人間の感覚に基づいて設定されてもよい。さらに、原点Oに関しておおよそ対称となる色相境界線の対は、一直線となるように設定されているが、これに限定されない。ただし、本実施の形態のように原点Oを挟む色相境界線の対が一直線となる場合、判定処理の計算コストを低減させることができる。   Here, the color plane H is acquired by the following procedure. First, hue boundary lines D1 to D6 are set for the color plane H0 of the Lab color system (see the left side of FIG. 3). This color plane H0 corresponds to a chromaticity diagram of a general Lab color system, and has an orthogonal two-dimensional coordinate system in which the horizontal axis is a and the vertical axis is b. Further, the hue boundary lines D1 to D6 may be set based on human senses. Furthermore, the hue boundary line pair that is approximately symmetric with respect to the origin O is set to be a straight line, but is not limited thereto. However, when the pair of hue boundary lines sandwiching the origin O is a straight line as in the present embodiment, the calculation cost of the determination process can be reduced.

続いて、色平面H0の縦軸bに近い色相境界線D1、D4が縦軸bと一致するように、色相全体が原点Oを中心に回転変換される。これにより、色平面H1が得られる(図3中央参照)。この色平面H1は、横軸がa2、縦軸がb2となる直交二次元座標系を有している。   Subsequently, the entire hue is rotationally converted around the origin O so that the hue boundary lines D1 and D4 close to the vertical axis b of the color plane H0 coincide with the vertical axis b. Thereby, the color plane H1 is obtained (see the center of FIG. 3). The color plane H1 has an orthogonal two-dimensional coordinate system in which the horizontal axis is a2 and the vertical axis is b2.

続いて、色相境界線D2、D3、D5、D6が横軸a2および縦軸b2のそれぞれに対して45度傾斜するように、色相全体に対して縦軸方向と横軸方向とで異なる率で拡大、縮小する変換が実行される。これにより、色平面H2が得られる(図3右側参照)。この色平面H2は、横軸がa3、縦軸がb3となる直交二次元座標系を有している。そして、この色平面H2に対して、さらに彩度境界線D0が設定されることにより、図2の色平面Hが得られることになる。   Subsequently, the hue boundaries D2, D3, D5, and D6 are inclined at 45 degrees with respect to the horizontal axis a2 and the vertical axis b2, respectively, at different rates in the vertical axis direction and the horizontal axis direction with respect to the entire hue. Conversion to enlarge or reduce is executed. Thereby, a color plane H2 is obtained (see the right side of FIG. 3). The color plane H2 has an orthogonal two-dimensional coordinate system in which the horizontal axis is a3 and the vertical axis is b3. Then, by setting a saturation boundary line D0 for this color plane H2, the color plane H in FIG. 2 is obtained.

なお、単位画像データの色判定は、Labで表現されたままの単位画像データの値を用い、その色度で示される座標位置(a,b)が、Lab表色系の色度図に相当する色平面H0のいずれの位置に存在するかを判断することによって行われてもよい。この場合、色度の他に色パラメータを求めることは必要とされない。   Note that the color determination of the unit image data uses the value of the unit image data as expressed in Lab, and the coordinate position (a, b) indicated by the chromaticity corresponds to the chromaticity diagram of the Lab color system. This may be done by determining at which position of the color plane H0 to be present. In this case, it is not necessary to obtain a color parameter in addition to chromaticity.

ただし、一般に色平面H0では、色相境界線D1〜D6の傾きが無理数となる場合もあり、単位画像データの色の判定には逆三角関数などの無理数計算が必要となって判定効率が悪くなる場合がある。そのため、第1単位画像データ判定部65、第2単位画像データ判定部82、第1単位画像データ計数部66、第2単位画像データ計数部83、第1ブロック判定部67、第2ブロック判定部84、第1ブロック計数部68、および第2ブロック計数部85の処理では、色平面H0上で画像データに少なくとも回転変換などのアフィン変換が施され、色相境界線D1〜D6の傾きが有理数となる色平面Hが使用されている。   However, in general, in the color plane H0, the slopes of the hue boundary lines D1 to D6 may become irrational numbers, and the determination of the color of the unit image data requires an irrational number calculation such as an inverse trigonometric function, and the determination efficiency is improved. It may get worse. Therefore, the first unit image data determining unit 65, the second unit image data determining unit 82, the first unit image data counting unit 66, the second unit image data counting unit 83, the first block determining unit 67, and the second block determining unit. 84, the first block counting unit 68 and the second block counting unit 85 perform at least affine transformation such as rotational transformation on the image data on the color plane H0, and the gradients of the hue boundary lines D1 to D6 are rational numbers. The color plane H is used.

<2.2.地色判定部および対象画像判定部の構成要素>
ここでは、地色判定部70および対象画像判定部80の構成要素について説明する。第1単位画像データ判定部65(65a、65b)は、画像処理回路61によってRGBの色空間からLabの色空間に変換された画像データについて判定処理を実行する。すなわち、第1単位画像データ判定部65は、画像データに基づいて取得された単位画像データが、色平面Hのうち、特定の有彩色と対応する色領域mC、mM、mY、mR、mG、mBと、無彩領域mAと、のいずれに属するかを判定する。
<2.2. Components of Ground Color Determination Unit and Target Image Determination Unit>
Here, components of the ground color determination unit 70 and the target image determination unit 80 will be described. The first unit image data determination unit 65 (65a, 65b) executes a determination process on the image data converted from the RGB color space to the Lab color space by the image processing circuit 61. That is, the first unit image data determination unit 65 determines that the unit image data acquired based on the image data has a color region mC, mM, mY, mR, mG, corresponding to a specific chromatic color in the color plane H. Whether it belongs to mB or achromatic region mA is determined.

第1単位画像データ計数部66(66a、66b)は、画像データを、例えば縦30×横30(計900個)の単位画像データによって構成された複数のブロックに区分する。また、第1単位画像データ計数部66は、第1単位画像データ判定部65の判定結果に基づき、複数の色領域mC、mM、mY、mR、mG、mBと、無彩領域mAとのそれぞれに属する単位画像データの個数を、各ブロック毎に計数する。   The first unit image data counting unit 66 (66a, 66b) divides the image data into a plurality of blocks composed of unit image data of, for example, 30 × 30 (total 900). In addition, the first unit image data counting unit 66, based on the determination result of the first unit image data determination unit 65, each of the plurality of color regions mC, mM, mY, mR, mG, mB and the achromatic region mA. The number of unit image data belonging to is counted for each block.

例えば、第1単位画像データ計数部66は、ブロックに含まれている900個の単位画像データのうち色領域mCに属するものの個数を計数し、計数結果をRAM12に格納する。また同様に、第1単位画像データ計数部66は、色領域mM、mY、mR、mG、mB、および無彩領域mAのそれぞれに属する単位画像データの個数を計数し、各計数結果をRAM12に格納する。   For example, the first unit image data counting unit 66 counts the number of 900 unit image data included in the block that belongs to the color area mC, and stores the count result in the RAM 12. Similarly, the first unit image data counting unit 66 counts the number of unit image data belonging to each of the color regions mM, mY, mR, mG, mB, and the achromatic region mA, and stores each count result in the RAM 12. Store.

第1ブロック判定部67(67a、67b)は、第1単位画像データ計数部66の計数結果に基づいて、各ブロックに含まれる色を判定する。すなわち、ブロック判定部67は、各ブロックについて、各色領域mC,mM,mY,mR,mG,mBおよび無彩領域mAのそれぞれの計数値と存在確認用基準値とを比較し、当該ブロックに含まれる色を判定する。   The first block determination unit 67 (67a, 67b) determines the color included in each block based on the counting result of the first unit image data counting unit 66. That is, for each block, the block determination unit 67 compares each count value of each color region mC, mM, mY, mR, mG, mB and the achromatic region mA with the reference value for existence confirmation, and includes the block. Determine the color to be displayed.

例えば、あるブロックについて、色領域mCとmMとのみ、計数値が存在確認用基準値を超えている場合、当該ブロックにはシアンCとマゼンタMとが含まれると判定する。また、あるブロックについて、無彩領域mAのみ、計数値が存在確認用基準値を超えている場合、当該ブロックには無彩色のみが存在すると判定する。   For example, for a certain block, when only the color regions mC and mM have count values exceeding the existence confirmation reference value, it is determined that the block includes cyan C and magenta M. In addition, in a certain block, when only the achromatic region mA has a count value exceeding the existence confirmation reference value, it is determined that only the achromatic color exists in the block.

なお、単位画像データの存在確認に使用される閾値(存在確認用閾値)は、各色領域mC、mM、mY、mR、mG、mB、および無彩領域mA毎に異なった値であってもよいし、同一の値であってもよい。   Note that the threshold value (presence confirmation threshold value) used for the presence confirmation of the unit image data may be a different value for each color region mC, mM, mY, mR, mG, mB, and the achromatic region mA. The same value may be used.

第1ブロック計数部68(68a、68b)は、第1ブロック判定部67によって実行された各ブロックの判定結果に基づいて、各色領域mC,mM,mY,mR,mG,mBおよび無彩領域mA毎にブロック計数値を算出する。すなわち、第1ブロック計数部68は、第1ブロック判定部67によって、各ブロックに含まれると判定された色に対応する色領域および無彩領域の計数値(ブロック計数値)を加算する。例えば、第1ブロック判定部67によって、あるブロックにシアンCとマゼンタMのみが含まれると判定された場合、第1ブロック計数部68は、当該ブロックに係る計数処理として、色領域mCとmMとの計数値を加算する。また、第1ブロック判定部67によって、あるブロックに無彩色のみが含まれると判定された場合、第1ブロック計数部68は、当該ブロックに係る計数処理として、無彩領域mAの計数値を加算する。そして、第1ブロック計数部68は、複数の色領域mC、mM、mY、mR、mG、mB、および無彩領域mA毎に計数した結果(ブロック計数値)を、RAM12に格納する。   The first block counting unit 68 (68a, 68b), based on the determination result of each block executed by the first block determination unit 67, each color region mC, mM, mY, mR, mG, mB and achromatic region mA. A block count value is calculated every time. That is, the first block counting unit 68 adds the count values (block count values) of the color region and the achromatic region corresponding to the color determined to be included in each block by the first block determination unit 67. For example, when it is determined by the first block determination unit 67 that only a cyan C and magenta M are included in a certain block, the first block counting unit 68 performs the color regions mC and mM as the counting process related to the block. Add the count value. When the first block determination unit 67 determines that a certain block includes only an achromatic color, the first block counting unit 68 adds the count value of the achromatic region mA as a counting process related to the block. To do. Then, the first block counting unit 68 stores the result (block count value) counted for each of the plurality of color regions mC, mM, mY, mR, mG, mB and the achromatic region mA in the RAM 12.

地色設定部71は、画像データに対して、第1単位画像データ判定部65aと、第1単位画像データ計数部66aと、第1ブロック判定部67aと、第1ブロック計数部68aとによる処理が実行された場合において、第1ブロック計数部68aの計数結果に基づき、画像データの地色を設定する。   The ground color setting unit 71 processes the image data by the first unit image data determining unit 65a, the first unit image data counting unit 66a, the first block determining unit 67a, and the first block counting unit 68a. Is executed, the background color of the image data is set based on the counting result of the first block counting unit 68a.

例えば、複数の色領域mC、mM、mY、mR、mG、mB、および無彩領域mA毎に計数したブロック計数値のうちのひとつ又はふたつが地色基準値以上となる場合、地色設定部71は、地色基準値以上となる色領域に地色が存在すると判断し、該対応する色領域を選択する。   For example, when one or two of the block count values counted for each of the plurality of color regions mC, mM, mY, mR, mG, mB and the achromatic region mA is equal to or greater than the ground color reference value, the ground color setting unit 71 determines that a ground color exists in a color region that is equal to or greater than the ground color reference value, and selects the corresponding color region.

すなわち、地色設定部71は、各色領域(2次元色平面における各色領域)のブロック計数値と地色基準値とに基づいて、地色の有無を判定するとともに、地色があると判定した場合、地色に対応する色領域を判定する。   That is, the ground color setting unit 71 determines the presence / absence of a ground color based on the block count value and ground color reference value of each color region (each color region in the two-dimensional color plane) and determines that there is a ground color. In this case, the color area corresponding to the ground color is determined.

地色設定部71は、ブロック計数値が地色基準値を超えている色領域があれば、地色があると判定する。そして、その色領域が地色に対応する色領域であると判定する。なお、地色基準値は複数備え、1つの色領域が第1の地色基準値を超えている場合だけでなく、2つの色領域が第2の地色基準値を超えている場合も、地色ありと判定される。   If there is a color region in which the block count value exceeds the ground color reference value, the ground color setting unit 71 determines that there is a ground color. Then, it is determined that the color area is a color area corresponding to the ground color. It should be noted that a plurality of ground color reference values are provided, not only when one color region exceeds the first ground color reference value, but also when two color regions exceed the second ground color reference value. It is determined that there is a ground color.

そして、地色設定部71は、第1ブロック計数部68の計数結果に基づいて選択された色領域につき、該選択された色領域に含まれる複数の単位画像データの重心位置に基づいて地色位置を設定し、該選択された色領域に含まれる複数の単位画像データの3次元的な分布に基づいて、3次元的な地色領域P1を算出する。   The ground color setting unit 71 then selects a ground color based on the barycentric positions of the plurality of unit image data included in the selected color region for the color region selected based on the counting result of the first block counting unit 68. A position is set, and a three-dimensional ground color region P1 is calculated based on a three-dimensional distribution of a plurality of unit image data included in the selected color region.

例えば、3次元的な地色領域P1の設定では、まず、選択された色領域に含まれる複数の単位画像データについて、L値、a3値、b3値の最大値および最小値が求められる。すなわち、色領域内の単位画像データの3次元的な分布に基づいて、地色の明度範囲と色度範囲とが求められる。そして、求められた明度範囲および色度範囲(すなわち、地色領域P1(図6参照))に含まれる単位画像データに基づいた重心位置が地色位置として求められる。そのため、誤った地色の検出をさらに防止することができる。   For example, in the setting of the three-dimensional ground color region P1, first, the maximum value and the minimum value of the L value, the a3 value, and the b3 value are obtained for a plurality of unit image data included in the selected color region. That is, the lightness range and chromaticity range of the ground color are obtained based on the three-dimensional distribution of the unit image data in the color region. Then, the barycentric position based on the unit image data included in the calculated brightness range and chromaticity range (that is, the ground color region P1 (see FIG. 6)) is determined as the ground color position. Therefore, detection of an erroneous ground color can be further prevented.

なお、地色位置の演算手法は、これに限定されない。例えば、選択された色領域に含まれる単位画像データの最大値および最小値に基づいて(例えば、最大値と最小値との平均値)演算してもよい。また、地色の設定の際に求められたL値、a3値、およびb3値の最大値および最小値は、RAM12に格納される。   The ground color position calculation method is not limited to this. For example, the calculation may be performed based on the maximum value and the minimum value of the unit image data included in the selected color region (for example, the average value of the maximum value and the minimum value). Further, the maximum value and the minimum value of the L value, the a3 value, and the b3 value obtained when setting the ground color are stored in the RAM 12.

対象画像変換部72は、地色設定部71によって設定された地色に基づいて、色平面Hで画像データ(単位画像データ)にアフィン変換を実行する。具体的には、対象画像変換部72は、地色設定部71によって演算された地色位置(重心位置)が、複数の色領域mC、mM、mY、mR、mG、mBと、無彩領域mAとによって構成される色平面Hの原点となるように、判定対象となる画像データを平行移動させる。   The target image conversion unit 72 performs affine transformation on the image data (unit image data) on the color plane H based on the ground color set by the ground color setting unit 71. Specifically, in the target image conversion unit 72, the ground color position (center of gravity position) calculated by the ground color setting unit 71 includes a plurality of color regions mC, mM, mY, mR, mG, mB, and an achromatic region. The image data to be determined is translated so as to be the origin of the color plane H constituted by mA.

第2単位画像データ判定部82は、対象画像変換部72によるアフィン変換が施された画像データについて判定処理を実行する。すなわち、第2単位画像データ判定部82は、アフィン変換後の画像データに基づき取得された単位画像データについて、地色設定部71によって設定された地色の色度範囲に含まれ、かつ、明るさが地色設定部71によって設定された明るさ閾値以上となるか否かを判定する。なお、明るさ閾値としては、地色設定部71によって求められたL値の最大値を使用してもよい。   The second unit image data determination unit 82 performs a determination process on the image data that has been subjected to affine transformation by the target image conversion unit 72. That is, the second unit image data determination unit 82 includes unit image data acquired based on the image data after the affine transformation included in the chromaticity range of the ground color set by the ground color setting unit 71 and is bright. Is determined to be equal to or greater than the brightness threshold set by the ground color setting unit 71. Note that the maximum value of the L value obtained by the ground color setting unit 71 may be used as the brightness threshold.

第2単位画像データ計数部83は、第2単位画像データ判定部82の判定結果に基づいた計数処理を実行する。すなわち、第2単位画像データ計数部83は、地色設定部71によって設定された地色の色度範囲に含まれ、かつ、明るさが地色設定部71によって設定された明るさ閾値以上となる単位画像データ(以下、「地色上方画像データ」とも呼ぶ)の個数を計数する。   The second unit image data counting unit 83 executes a counting process based on the determination result of the second unit image data determining unit 82. That is, the second unit image data counting unit 83 is included in the chromaticity range of the ground color set by the ground color setting unit 71, and the brightness is equal to or higher than the brightness threshold set by the ground color setting unit 71. The number of unit image data (hereinafter also referred to as “background color upper image data”) is counted.

第2ブロック判定部84は、第2単位画像データ計数部83の計数結果に基づいて、各ブロックに地色上方画像データが含まれるか否かを判定する。例えば、第2単位画像データ計数部83による計数結果が所定の閾値以上となる場合、第2ブロック判定部84は、着目ブロックに地色上方画像データが含まれると判断する。一方、第2単位画像データ計数部83による計数結果が所定の閾値より小さい場合、第2ブロック判定部84は、着目ブロックに地色上方画像データが含まれていないと判断する。   The second block determination unit 84 determines whether or not the background color upper image data is included in each block based on the counting result of the second unit image data counting unit 83. For example, when the count result by the second unit image data counting unit 83 is equal to or greater than a predetermined threshold, the second block determination unit 84 determines that the background color upper image data is included in the block of interest. On the other hand, when the counting result by the second unit image data counting unit 83 is smaller than the predetermined threshold, the second block determination unit 84 determines that the background color upper image data is not included in the target block.

第2ブロック計数部85は、第2ブロック判定部84による各ブロックの判定結果に基づき、地色上方画像データが含まれていると判断されたブロックの個数を計数する。そして、第2ブロック計数部85は、計数結果(ブロック計数値)を、RAM12に格納する。   The second block counting unit 85 counts the number of blocks determined to include the ground color upper image data based on the determination result of each block by the second block determining unit 84. Then, the second block counting unit 85 stores the count result (block count value) in the RAM 12.

モード選択部81は、地色位置を色平面Hの原点とするアフィン変換が色平面Hで施された画像データに基づいて、色判定を行い、その色判定結果に基づいて、処理モードの選択を実行する。すなわち、対象画像変換部72によってアフィン変換が実行された画像データに対して、第1単位画像データ判定部65bと、第2単位画像データ判定部82と、第1単位画像データ計数部66bと、第2単位画像データ計数部83と、第1ブロック判定部67bと、第2ブロック判定部84と、第1ブロック計数部68bと、第2ブロック計数部85とによる処理が実行された場合において、モード選択部81は、第1ブロック計数部68bおよび第2ブロック計数部85の計数結果に基づき、処理モードを選択する。   The mode selection unit 81 performs color determination based on image data on which the affine transformation with the ground color position as the origin of the color plane H is performed on the color plane H, and selects a processing mode based on the color determination result Execute. That is, the first unit image data determination unit 65b, the second unit image data determination unit 82, the first unit image data counting unit 66b, and the image data subjected to affine transformation by the target image conversion unit 72, When processing by the second unit image data counting unit 83, the first block determining unit 67b, the second block determining unit 84, the first block counting unit 68b, and the second block counting unit 85 is executed, The mode selection unit 81 selects a processing mode based on the count results of the first block counting unit 68b and the second block counting unit 85.

例えば、色領域mCのブロック計数値が所定の閾値以上となる場合、モード選択部81は、対象画像はカラー画像であると判定し、処理モードとして「カラーモード」を選択する。同様に色領域mM、mY、mR、mG、mBのブロック計数値のいずれかが所定の閾値以上となる場合、モード選択部81は、対象画像はカラー画像であると判定し、処理モードとして「カラーモード」を選択する。   For example, when the block count value of the color region mC is equal to or greater than a predetermined threshold, the mode selection unit 81 determines that the target image is a color image, and selects “color mode” as the processing mode. Similarly, when any of the block count values of the color regions mM, mY, mR, mG, and mB is equal to or greater than a predetermined threshold value, the mode selection unit 81 determines that the target image is a color image, and “ Select “Color Mode”.

また、第2ブロック計数部85による計数結果(ブロック計数値)が明るさ基準値以上となる場合、モード選択部81は、処理モードとして「カラーモード」を選択する。そのため、画像データ上において地色の色範囲に含まれ、かつ、明るさ閾値以上となる部分についても、記録部51や画像処理回路61等の処理部により、美観を損なうことなく良好な処理を実行することができる。   Further, when the count result (block count value) by the second block counting unit 85 is equal to or higher than the brightness reference value, the mode selection unit 81 selects “color mode” as the processing mode. For this reason, the processing unit such as the recording unit 51 or the image processing circuit 61 performs good processing on the portion of the image data that is included in the background color range and is equal to or greater than the brightness threshold without losing aesthetics. Can be executed.

一方、色領域mC、mM、mY、mR、mG、mBのブロック計数値がいずれも所定の閾値より小さい場合、モード選択部81は、対象画像はモノクロ画像であると判定し、「モノクロモード」を選択する。また、第2ブロック計数部85による計数結果が明るさ基準値より小さい場合、モード選択部81は、モノクロモードを選択する。   On the other hand, if the block count values of the color regions mC, mM, mY, mR, mG, and mB are all smaller than the predetermined threshold, the mode selection unit 81 determines that the target image is a monochrome image, and “monochrome mode”. Select. When the count result by the second block counting unit 85 is smaller than the brightness reference value, the mode selection unit 81 selects the monochrome mode.

そして、記録部51や画像処理回路61等の処理部は、モード選択部81によって選択された処理モード(カラーモード、モノクロモード)に基づいて、対象画像に係る画像データに対して所定の処理を施す。   Then, the processing units such as the recording unit 51 and the image processing circuit 61 perform predetermined processing on the image data related to the target image based on the processing mode (color mode or monochrome mode) selected by the mode selection unit 81. Apply.

例えば、モード選択部81によってモノクロモードが選択された場合、記録部51は、モノクロに変換された画像データを記録紙に記録する。また、モード選択部81にカラーモードが選択された場合、CODEC31は、画像データをカラーデータとしてJPEG圧縮する。   For example, when the monochrome mode is selected by the mode selection unit 81, the recording unit 51 records the image data converted to monochrome on a recording sheet. When the color mode is selected by the mode selection unit 81, the CODEC 31 performs JPEG compression using the image data as color data.

なお、色判定に使用される閾値は、各色領域mC、mM、mY、mR、mG、mB、および無彩領域mA毎に異なった値であってもよいし、同一の値であってもよい。   The threshold value used for color determination may be a different value for each color region mC, mM, mY, mR, mG, mB, and achromatic region mA, or the same value. .

<3.地色判定および色判定の手順>
図4は、地色判定の手順を説明するためのフローチャートである。図5は、色判定の手順を説明するためのフローチャートである。以下では、地色判定の手順について説明し、続いて、色判定の手順について説明する。
<3. Ground color determination and color determination procedure>
FIG. 4 is a flowchart for explaining the ground color determination procedure. FIG. 5 is a flowchart for explaining the color determination procedure. Hereinafter, the ground color determination procedure will be described, and then the color determination procedure will be described.

<3.1.地色判定の手順>
ここでは、画像データの地色判定の手順について説明する。図4に示すように、ステップS101では、地色判定に先立ち、画像データのうち原稿先頭から所定ライン(例えば、数十〜数百ライン)の画像(以下、「原稿先頭画像」とも呼ぶ)について判定前処理が実行される。
<3.1. Ground color judgment procedure>
Here, the ground color determination procedure of the image data will be described. As shown in FIG. 4, in step S101, prior to the background color determination, an image of predetermined lines (for example, several tens to several hundred lines) from the top of the document (hereinafter also referred to as “original document image”) in the image data. Pre-determination processing is executed.

例えば、ステップS101の判定前処理として、画像処理回路61は、RGBの色空間の画像データから単位画像データを生成する処理(平均化処理)を実行する。また、画像処理回路61は、生成された単位画像データに対してガンマ補正処理を施す。さらに、画像処理回路61は、ガンマ補正処理が施された単位画像データの色空間をRGBからLab(明度Lと色度a、b)に変換する処理を実行する。   For example, as the pre-determination process in step S101, the image processing circuit 61 executes a process (averaging process) for generating unit image data from image data in the RGB color space. The image processing circuit 61 performs gamma correction processing on the generated unit image data. Further, the image processing circuit 61 executes processing for converting the color space of the unit image data subjected to the gamma correction processing from RGB to Lab (lightness L and chromaticity a, b).

なお、単位画像データとしては、平均化処理が施されていない画素データがそのまま使用されてもよい。ただし、単位画像データとして画素データでなく画素集合ごとの平均値を用いれば、スキャナ部41におけるラインセンサ等の微小な機械的誤差に起因した偽色や、コピー機能の変倍率に起因した偽色を補正することができ、以降の判定の精度を向上できる点で好ましい。   Note that pixel data that has not been subjected to averaging processing may be used as unit image data. However, if an average value for each pixel set is used as unit image data instead of pixel data, a false color caused by a minute mechanical error such as a line sensor in the scanner unit 41 or a false color caused by a scaling factor of a copy function Can be corrected, and the accuracy of the subsequent determination can be improved.

したがって、画素集合ごとの色成分データの平均値Ravg,Gavg,Bavgで単位データを構成すれば、CCDラインセンサ41aにおいてR,G,Bの読み取りラインが数μmのライン間隔をおいて設けられていることに起因する偽色の影響を排除でき、単位画像データ判定部65における判定を精度よく行うことができるようになる。   Therefore, if the unit data is composed of the average values Ravg, Gavg, and Bavg of the color component data for each pixel set, the R, G, and B reading lines are provided with a line interval of several μm in the CCD line sensor 41a. Therefore, the influence of the false color due to the presence of the image can be eliminated, and the determination in the unit image data determination unit 65 can be performed with high accuracy.

なお、上述の偽色は、変倍コピーを行う際に問題となることが多い。これは、CCDラインセンサ41aのR,G,Bの読み取りラインのライン間隔が、副走査方向の読み取り間隔の整数倍に相当するものであれば、後続する読み取りラインにおける読み取りタイミングを先行する読み取りラインより遅延させることにより偽色を防止することができるが、等倍コピーを行う際に「整数倍」の関係が成立しても、変倍コピーを行う際に「整数倍」の関係が成立するとは限らないためである。   The false color described above often becomes a problem when performing variable-size copying. This is because if the line interval of the R, G, B reading lines of the CCD line sensor 41a corresponds to an integral multiple of the reading interval in the sub-scanning direction, the reading line preceding the reading timing in the subsequent reading line. Although it is possible to prevent false colors by delaying more, even if the “integer multiple” relationship is established when performing the same size copy, the “integer multiple” relationship is established when performing the variable size copy. This is because there is no limit.

例えば、等倍コピーを行う際の副走査方向の解像度が600dpiであり、ライン間隔が読み取り間隔の4倍に相当する場合を考える。この場合、等倍コピーを行う際には、後続する読み取りラインにおける読み取りタイミングを先行する読み取りラインより4周期遅延させることにより偽色を防止することができるが、70%縮小コピーを行う際には、副走査方向の解像度が420dpiとなり、ライン間隔が読み取り間隔の2.8倍に相当するから、後続する読み取りラインにおける読み取りタイミングを先行する読み取りラインより3周期遅延させても、先行する読み取りラインと後続する読み取りラインとの間で読み取り間隔の0.2倍の読み取り位置のずれが生じ、偽色の原因となる。   For example, let us consider a case where the resolution in the sub-scanning direction at the time of copying at the same magnification is 600 dpi and the line interval corresponds to four times the reading interval. In this case, when performing the same-size copy, the false timing can be prevented by delaying the read timing in the subsequent read line by four cycles from the preceding read line, but when performing the 70% reduced copy. Since the resolution in the sub-scanning direction is 420 dpi and the line interval corresponds to 2.8 times the reading interval, even if the reading timing in the subsequent reading line is delayed by three cycles from the preceding reading line, The reading position is shifted by 0.2 times the reading interval from the subsequent reading line, which causes false color.

この他、CCDラインセンサ41aのR,G,Bの読み取りラインの形成位置の機械的なずれが偽色の原因となる場合もある。   In addition, a mechanical shift in the formation position of the R, G, B reading lines of the CCD line sensor 41a may cause false colors.

また、画素集合の大きさは、当該ライン間隔及び変倍率等に応じて決定すべきであり、上述の「縦2個×横2個の隣接する4個の画素」というのは、例示に過ぎない。   In addition, the size of the pixel set should be determined according to the line interval, scaling factor, and the like, and the above-mentioned “vertical 2 × 2 horizontal 4 pixels” is merely an example. Absent.

例えば、変倍コピーを行う際の偽色の影響を排除するためには、「読み取り位置のずれ」が大きくなるほど画素集合の副走査方向の画素数を増加させることが有効であるが、「読み取り位置のずれ」は変倍率によって決まるので、変倍率と画素集合の副走査方向の画素数との関係を記述したテーブルをROM13にあらかじめ準備しておき、当該テーブルを参照して、指定された変倍率に応じて画素集合の副走査方向の画素数を決定することが望ましい。   For example, in order to eliminate the influence of false colors when performing variable magnification copying, it is effective to increase the number of pixels in the sub-scanning direction of the pixel set as the “reading position shift” increases. Since the “positional deviation” is determined by the scaling factor, a table describing the relationship between the scaling factor and the number of pixels in the sub-scanning direction of the pixel set is prepared in the ROM 13 in advance, and the specified scaling factor is referred to the table. It is desirable to determine the number of pixels in the sub-scanning direction of the pixel set according to the magnification.

なお、平均部61cは、解像度変換部61aによる解像度の変換が施されていない画像データについて平均化を行うので、画素集合の主走査方向の画素数が一定であっても特に問題とはならない。   Note that the averaging unit 61c averages image data that has not been subjected to resolution conversion by the resolution conversion unit 61a. Therefore, there is no particular problem even if the number of pixels in the main scanning direction of the pixel set is constant.

次に、所定数(例えば、30×30=900個)の第1単位画像データ計数部66aによって区分された各ブロックについて、第1単位画像データ判定部65aは、着目ブロックに含まれる単位画像データが複数の色領域mC、mM、mY、mR、mG、mB、および無彩領域mAのいずれに属するかを判定する(S102)。続いて、第1単位画像データ計数部66aは、第1単位画像データ判定部65aの判定結果に基づいて、各色領域mC、mM、mY、mR、mG、mB、および無彩領域mAのそれぞれに属する単位画像データの個数を計数する(S103)。これらステップS102およびS103による単位画像データの判定処理および計数処理は、着目ブロック内のすべての単位画像データについて実行される(S104)。   Next, for each block divided by a predetermined number (for example, 30 × 30 = 900) of the first unit image data counting unit 66a, the first unit image data determination unit 65a includes the unit image data included in the block of interest. Belongs to a plurality of color regions mC, mM, mY, mR, mG, mB and achromatic region mA (S102). Subsequently, the first unit image data counting unit 66a applies to each of the color regions mC, mM, mY, mR, mG, mB, and the achromatic region mA based on the determination result of the first unit image data determination unit 65a. The number of unit image data to which it belongs is counted (S103). The unit image data determination process and counting process in steps S102 and S103 are executed for all unit image data in the block of interest (S104).

続いて、着目ブロック内のすべての単位画像データについて判定処理および計数処理が完了すると、第1ブロック判定部67aは、第1単位画像データ計数部66aの計数結果に基づいて、着目ブロックの判定処理を実行する。すなわち、第1ブロック判定部67aは、着目ブロックに含まれる色の判定処理を実行する(S105)。   Subsequently, when the determination process and the counting process are completed for all the unit image data in the target block, the first block determination unit 67a performs the target block determination process based on the counting result of the first unit image data counting unit 66a. Execute. That is, the first block determination unit 67a performs a determination process for the color included in the block of interest (S105).

続いて、第1ブロック計数部68aは、第1ブロック判定部67aの判定結果に基づき、必要な色領域mC、mM、mY、mR、mG、mB、および無彩領域mAのブロック計数値を加算する(S106)。   Subsequently, the first block counting unit 68a adds the block count values of the necessary color regions mC, mM, mY, mR, mG, mB and the achromatic region mA based on the determination result of the first block determining unit 67a. (S106).

これらステップS105およびS106によるブロックの判定処理および計数処理は、原稿先頭画像内のすべてのブロックについて実行される(S107)。   The block determination processing and counting processing in steps S105 and S106 are executed for all blocks in the document head image (S107).

続いて、地色設定部71は、第1ブロック計数部68aによって計数された複数の色領域mC、mM、mY、mR、mG、mB、および無彩領域mA毎のブロック計数値に基づいて、地色を設定し、地色領域P1に基づいた重心位置(地色位置)を演算する(S108)。そして、ステップS108で設定された地色に基づいて、色平面Hにおけるアフィン変換式が算出され(S109)、地色の判定処理が終了する。   Subsequently, the ground color setting unit 71 is based on the block count value for each of the plurality of color regions mC, mM, mY, mR, mG, mB and the achromatic region mA counted by the first block counting unit 68a. A ground color is set, and the center of gravity position (ground color position) based on the ground color region P1 is calculated (S108). Then, based on the ground color set in step S108, an affine transformation formula in the color plane H is calculated (S109), and the ground color determination process ends.

このように、本実施の形態における画像データの地色判定および色判定では、各ブロック毎に判定および計数を行うことができる。そのため、誤った有彩・無彩判定の積み重ねによって、誤った地色が検出されること、および誤った地色に基づいて画像データの色判定が実行されることを防止できる。また、計数用のカウンタを小規模なものにできる。   Thus, in the ground color determination and color determination of image data in the present embodiment, determination and counting can be performed for each block. Therefore, it is possible to prevent an erroneous ground color from being detected by accumulating erroneous chromatic / achromatic determinations and performing color determination of image data based on the erroneous ground color. In addition, the counter for counting can be made small.

また、本実施の形態では、選択された色領域に含まれる単位画像データに基づいて地色を設定することができる。そのため、誤った地色の検出をさらに防止することができる。   In the present embodiment, the ground color can be set based on the unit image data included in the selected color region. Therefore, detection of an erroneous ground color can be further prevented.

<3.2.色判定の手順>
ここでは、対象画像の色判定について説明する。図5に示すように、ステップS201では、色判定に先立ち、地色判定処理において算出したアフィン変換式に基づいてアフィン変換された画像データに対して判定前処理が実行される。
<3.2. Color judgment procedure>
Here, the color determination of the target image will be described. As shown in FIG. 5, in step S201, a pre-determination process is performed on image data that has been affine transformed based on the affine transformation equation calculated in the ground color judgment process prior to color judgment.

例えば、ステップS201の判定前処理として、画像処理回路61は、図4のステップS101と同様に、RGBの色空間の画像データから単位画像データを生成する処理を実行する。また、画像処理回路61は、生成された単位画像データに対してガンマ補正処理を施す。さらに、画像処理回路61は、ガンマ補正処理が施された単位画像データの色空間をRGBからLab(明度Lと色度a、b)に変換する処理を実行する。   For example, as pre-determination processing in step S201, the image processing circuit 61 executes processing for generating unit image data from image data in the RGB color space, as in step S101 in FIG. The image processing circuit 61 performs gamma correction processing on the generated unit image data. Further, the image processing circuit 61 executes processing for converting the color space of the unit image data subjected to the gamma correction processing from RGB to Lab (lightness L and chromaticity a, b).

なお、単位画像データとしては、このような平均化処理を行わずに、画像データの画素データをそのまま使用してもよい。ただし、好ましくは、上述したように、画素データそのものでなく、画素群に含まれる各画素の値の平均値を単位画像データとして使用する。   As the unit image data, the pixel data of the image data may be used as it is without performing such an averaging process. However, preferably, as described above, not the pixel data itself but an average value of the values of each pixel included in the pixel group is used as the unit image data.

次に、第1単位画像データ判定部65bは、着目ブロックに含まれる単位画像データが複数の色領域mC、mM、mY、mR、mG、mB、および無彩領域mAのいずれに属するかを判定する(S202)。また、ステップS202において、第2単位画像データ判定部82は、着目ブロックに地色上方画像データが含まれるかを判定する。   Next, the first unit image data determination unit 65b determines whether the unit image data included in the block of interest belongs to a plurality of color regions mC, mM, mY, mR, mG, mB, or an achromatic region mA. (S202). In step S202, the second unit image data determination unit 82 determines whether the background color upper image data is included in the block of interest.

続いて、第1単位画像データ計数部66bは、第1単位画像データ判定部65bの判定結果に基づいて、各色領域mC、mM、mY、mR、mG、mB、および無彩領域mAのそれぞれに属する単位画像データの個数を計数する(S203)。また、第2単位画像データ計数部83は、第2単位画像データ判定部82の計数結果に基づいて地色上方画像データの個数を計数する(S203)。   Subsequently, the first unit image data counting unit 66b applies to each of the color regions mC, mM, mY, mR, mG, mB and the achromatic region mA based on the determination result of the first unit image data determination unit 65b. The number of unit image data to which it belongs is counted (S203). Further, the second unit image data counting unit 83 counts the number of background color upper image data based on the counting result of the second unit image data determining unit 82 (S203).

そして、ステップS202およびS203による単位画像データの判定および計数処理は、着目ブロック内のすべての単位画像データについて完了するまで実行される(S204)。   The unit image data determination and counting process in steps S202 and S203 is executed until completion for all unit image data in the block of interest (S204).

図6は、地色設定部71によって演算された地色位置を説明するための図である。図7は、地色設定部71によって設定された地色に基づき画像データにアフィン変換を施した場合における無彩領域の拡大手法を説明するための図である。図8および図9は、地色領域P1を説明するための図である。   FIG. 6 is a diagram for explaining the ground color position calculated by the ground color setting unit 71. FIG. 7 is a diagram for explaining a method for enlarging the achromatic region when the image data is subjected to affine transformation based on the ground color set by the ground color setting unit 71. 8 and 9 are diagrams for explaining the ground color region P1.

ここで、対象画像変換部72がアフィン変換(地色位置を原点に移動させる内容の変換)を施すので、図7に示すように、無彩領域をその移動に相当する方向に拡大させる。すなわち、無彩色に相当する単位画像データ(アフィン変換前に原点付近に存在する単位画像データ)が無彩領域から外れないように、無彩領域の拡大処理を行う。図6に示すように、拡大処理前の無彩領域mAは、正方形状、かつ、平面Hの原点に対して点対称な形状を有しており、該無彩領域mAの1辺の長さが2Wとなる。a3=−Δa、かつ、b3=Δbとなる色領域mG上の地色位置(重心位置)がアフィン変換によって色平面Hの原点に移動させられると、無彩色と判定すべき領域mAは、色平面Hの原点を挟んで色領域mGと対称の色領域mBにおいて、a3軸正方向にΔa、b軸負方向にΔb、それぞれ拡大させる必要がある(図7参照)。すなわち、無彩色と判定すべき領域は、地色設定部71によって設定された地色位置に基づいて、色平面H上の原点を挟んで地色の色領域と対称の色領域側に拡大される。   Here, since the target image conversion unit 72 performs affine conversion (conversion of contents for moving the ground color position to the origin), the achromatic region is expanded in a direction corresponding to the movement, as shown in FIG. That is, the achromatic region is enlarged so that unit image data corresponding to the achromatic color (unit image data existing near the origin before affine transformation) does not deviate from the achromatic region. As shown in FIG. 6, the achromatic region mA before the enlargement process has a square shape and a point-symmetric shape with respect to the origin of the plane H, and the length of one side of the achromatic region mA. Becomes 2W. When the ground color position (centroid position) on the color area mG where a3 = −Δa and b3 = Δb is moved to the origin of the color plane H by affine transformation, the area mA to be determined as an achromatic color is In the color area mB symmetrical to the color area mG across the origin of the plane H, it is necessary to enlarge Δa in the positive direction of the a3 axis and Δb in the negative direction of the b axis, respectively (see FIG. 7). That is, the area to be determined as an achromatic color is enlarged toward the color area side symmetrical to the ground color area with the origin on the color plane H sandwiched between the ground color positions set by the ground color setting unit 71. The

このように、対象画像変換部72により色平面Hでアフィン変換された画像データに対して判定処理が実行される場合、第1単位画像データ判定部65は、色平面Hの原点を挟んで地色の色領域と対称の色領域に、無彩色と判定すべき領域を拡大させる。すなわち、アフィン変換後の判定処理において、無彩領域mAは、地色領域と無彩領域とを含めた領域となる。そして、第1単位画像データ判定部65は、拡大された無彩領域mAと、複数の色領域mC、mM、mY、mR、mG、mBとによって、各単位画像データの判定処理を実行する。これにより、例えば色付きの紙等のように地色のある原稿から読み取られた画像データについて、地色を無彩として処理モードを選択することが可能となる。   As described above, when the determination process is executed on the image data affine-transformed on the color plane H by the target image conversion unit 72, the first unit image data determination unit 65 sandwiches the origin of the color plane H across the ground. An area to be determined as an achromatic color is enlarged to a color area symmetrical to the color area. That is, in the determination process after affine transformation, the achromatic region mA is a region including the ground color region and the achromatic region. Then, the first unit image data determination unit 65 executes determination processing for each unit image data by using the enlarged achromatic region mA and the plurality of color regions mC, mM, mY, mR, mG, and mB. This makes it possible to select a processing mode for the image data read from a document having a ground color, such as colored paper, with the ground color being achromatic.

また、対象画像変換部72が地色に基づいてアフィン変換を施すと、地色領域P1は、図8および図9に示すように、明度範囲がLmin≦L≦Lmaxのまま、色度範囲が、amin≦a3≦amaxおよびbmin≦b3≦bmaxに移動させられる。そして、第2単位画像データ判定部82は、この色度範囲と、明るさ閾値として使用される明度範囲の最大値Lmaxとによって、各単位画像データの判定処理を実行する。   Further, when the target image conversion unit 72 performs affine transformation based on the ground color, the ground color region P1 has a lightness range of Lmin ≦ L ≦ Lmax and a chromaticity range as shown in FIGS. , Amin ≦ a3 ≦ amax and bmin ≦ b3 ≦ bmax. Then, the second unit image data determination unit 82 executes determination processing for each unit image data based on the chromaticity range and the maximum value Lmax of the brightness range used as the brightness threshold.

なお、地色に基づいた無彩領域mAの拡大処理は、表示部63や操作部64を介した使用者の設定に基づいて実行してもよい。例えば、カラーの地色付き原稿(文字等は黒字)をモノクロとして判定したい場合には、使用者は、地色に基づいた無彩領域mAの拡大処理をON設定する。一方、カラーの地色付き原稿(文字等は黒字)をカラーとして判定したい場合には、OFF設定する。このように、対象画像判定部80は、表示部63や操作部64を介した使用者の設定に基づいて、原稿の地色部分を無彩色と判断してもよい。   Note that the enlargement process of the achromatic region mA based on the ground color may be executed based on the setting of the user via the display unit 63 or the operation unit 64. For example, when it is desired to determine a document with a colored ground color (characters and the like are black) as monochrome, the user sets ON the enlargement process of the achromatic region mA based on the ground color. On the other hand, when it is desired to determine a document with a colored ground color (characters are black characters) as a color, it is set to OFF. As described above, the target image determination unit 80 may determine that the background color portion of the document is an achromatic color based on the setting of the user via the display unit 63 and the operation unit 64.

続いて、着目ブロック内のすべての単位画像データについて、判定処理および計数処理が完了すると、第1ブロック判定部67bは、第1単位画像データ計数部66bの計数結果に基づき、着目ブロックに属する複数の単位画像データが、複数の色領域mC、mM、mY、mR、mG、mB、および無彩領域mAのそれぞれに含まれるか否かを判定する(S205)。また、第2ブロック判定部84は、第2単位画像データ計数部83の計数結果に基づき、着目ブロックに含まれる色を判定する(S205)。   Subsequently, when the determination process and the counting process are completed for all the unit image data in the target block, the first block determination unit 67b, based on the counting result of the first unit image data counting unit 66b, Is determined to be included in each of the plurality of color regions mC, mM, mY, mR, mG, mB, and the achromatic region mA (S205). Further, the second block determination unit 84 determines the color included in the block of interest based on the counting result of the second unit image data counting unit 83 (S205).

続いて、第1ブロック計数部68bは、第1ブロック判定部67bの判定結果に基づき、複数の色領域mC、mM、mY、mR、mG、mB、および無彩領域mAのそれぞれについて、当該ブロックに含まれていると判定した領域のブロック計数値を加算する(S206)。また、第2ブロック計数部85は、地色上方画像データが含まれていると判断されたブロックの数を計数する(S206)。   Subsequently, based on the determination result of the first block determination unit 67b, the first block counting unit 68b is configured to block the block for each of the plurality of color regions mC, mM, mY, mR, mG, mB, and the achromatic region mA. The block count value of the area determined to be included in the area is added (S206). Further, the second block counting unit 85 counts the number of blocks determined to include the ground color upper image data (S206).

これらステップS205およびS206によるブロックの判定処理および計数処理は、画像データ内のすべてのブロックについて完了するまで実行される(S207)。   The block determination processing and counting processing in steps S205 and S206 are executed until completion for all the blocks in the image data (S207).

そして、モード選択部81による処理モードが選択されると、色判定処理が終了する(S208〜S210)。すなわち、複数の色領域mC、mM、mY、mR、mG、mB、および地色上方画像データのブロック計数値のいずれかが、所定の閾値以上または明るさ基準値以上となる場合、モード選択部81は、処理部の動作モードとしてカラーモードを選択する(S209)。一方、いずれのブロック計数値も、所定の閾値または明るさ基準値より小さい場合(S208)、モード選択部81は、動作モードとしてモノクロモードを選択する(S210)。   When the processing mode is selected by the mode selection unit 81, the color determination process ends (S208 to S210). That is, when any of the plurality of color regions mC, mM, mY, mR, mG, mB and the block count value of the background color upper image data is equal to or greater than a predetermined threshold value or a brightness reference value, the mode selection unit In 81, the color mode is selected as the operation mode of the processing unit (S209). On the other hand, when any block count value is smaller than the predetermined threshold value or the brightness reference value (S208), the mode selection unit 81 selects the monochrome mode as the operation mode (S210).

<4.変形例>
(1)本実施の形態において、地色判定部70および対象画像判定部80は、それぞれ第1単位画像データ判定部65(65a、65b)、第1単位画像データ計数部66(66a、66b)、第1ブロック判定部67(67a、67b)、および第1ブロック計数部68(68a、68b)を有するものとして説明したが、画像色判定装置1の構成はこれに限定されるものでない。
<4. Modification>
(1) In the present embodiment, the ground color determination unit 70 and the target image determination unit 80 include a first unit image data determination unit 65 (65a, 65b) and a first unit image data count unit 66 (66a, 66b), respectively. The first block determination unit 67 (67a, 67b) and the first block counting unit 68 (68a, 68b) have been described as being included, but the configuration of the image color determination device 1 is not limited to this.

例えば、図10に示すように、地色判定部70および対象画像判定部80は、その機能を共通の第1単位画像データ判定部65、第1単位画像データ計数部66、第1ブロック判定部67、および第1ブロック計数部68によって実現してもよい。   For example, as shown in FIG. 10, the ground color determination unit 70 and the target image determination unit 80 share the same functions with a first unit image data determination unit 65, a first unit image data counting unit 66, and a first block determination unit. 67 and the first block counting unit 68.

(2)また、本実施の形態において、地色判定部70および対象画像判定部80は、回路的(ハードウェア的)に実現されるものとして説明したが、これに限定されるものでない。例えば、ROM13に格納されたプログラム13aに基づきMPU11によって、地色判定部70および対象画像判定部80の機能が実現されてもよい。   (2) In the present embodiment, the ground color determination unit 70 and the target image determination unit 80 have been described as being implemented in a circuit (hardware) manner, but are not limited thereto. For example, the functions of the ground color determination unit 70 and the target image determination unit 80 may be realized by the MPU 11 based on the program 13 a stored in the ROM 13.

(3)また、本実施の形態において、地色判定部70は、原稿先頭画像に基づいて地色判定を行っているが、これに限定されるものでない。地色判定は、例えば、画像データの後端や、右端先端の一部の画像データを用いて行われてもよい。   (3) In the present embodiment, the ground color determination unit 70 performs ground color determination based on the document head image. However, the present invention is not limited to this. The background color determination may be performed using, for example, a part of the image data at the rear end of the image data or the front end of the right end.

本実施の形態では、原稿先頭画像に基づいて地色判定を行っているので、原稿画像に係る画像データを1頁分同時に蓄積できる記憶手段がなく、原稿先頭画像から原稿後端画像に向けて逐次処理を行う画像色判定装置にも適用できる。すなわち、記憶手段の容量が1頁分以下であっても、原稿先頭画像に基づいて行った地色判定の結果を、それ以降の原稿画像データの色判定処理に反映させることができる。なお、原稿画像データ1頁分を同時に蓄積できる記憶手段を備える場合には、原稿先頭画像に限らず、原稿後端画像や原稿右端画像に基づいて地色判定が行える。   In this embodiment, since the ground color determination is performed based on the leading image of the document, there is no storage means that can simultaneously store image data related to the document image for one page, and from the document leading image toward the document trailing edge image. The present invention can also be applied to an image color determination apparatus that performs sequential processing. That is, even if the capacity of the storage means is less than or equal to one page, the ground color determination result based on the document head image can be reflected in the subsequent color determination processing of the document image data. In the case where a storage unit capable of storing one page of document image data at the same time is provided, ground color determination can be performed based on not only the document leading image but also the document trailing edge image or document right edge image.

(4)また、本実施の形態において、無彩と判定すべき領域(無彩領域)は、図7に示すように、画像データをアフィン変換によって移動させる方向に拡大させているが、拡大方法は必ずしもこれに限定されるものではない。すなわち、地色判定において、2次元色平面H上の地色位置を判定すると、無彩領域mAを、その地色位置を含む方向に拡大させることもできる。無彩領域mAを拡大させる方向および大きさは、色平面H上の地色位置と原点との位置関係に応じて決定される。この場合においては、色判定のための、画像データに対するアフィン変換は不要である。   (4) In the present embodiment, the area to be determined as achromatic (achromatic area) is enlarged in the direction in which the image data is moved by affine transformation as shown in FIG. Is not necessarily limited to this. That is, when the ground color position on the two-dimensional color plane H is determined in the ground color determination, the achromatic region mA can be enlarged in a direction including the ground color position. The direction and size for enlarging the achromatic region mA are determined according to the positional relationship between the ground color position on the color plane H and the origin. In this case, affine transformation for the image data for color determination is not necessary.

(5)さらに、本実施の形態において、第1単位画像データ判定部65は、Labで表現された画像データに対して地色判定および色判定を実行するものとして説明したが、これに限定されるものでない。YCbCr、YIQ、Luvなど、明るさに関するパラメータ(例えば、Lab色空間の明度LやYCbCr色空間の輝度Y)と、色相および彩度に関するパラメータ(色差、色度)を有する表色系であれば、Lab以外の表色系も利用することができる。なお、本実施の形態において、色度とは、色差、色相、および彩度のすべてを含む概念としても使用する。   (5) Furthermore, in the present embodiment, the first unit image data determination unit 65 has been described as executing ground color determination and color determination on image data expressed in Lab. However, the present invention is not limited to this. It is not something. YCbCr, YIQ, Luv, etc., a color system that has parameters relating to brightness (for example, lightness L in Lab color space or luminance Y in YCbCr color space) and parameters relating to hue and saturation (color difference, chromaticity) Color systems other than Lab can also be used. In this embodiment, chromaticity is also used as a concept including all of color difference, hue, and saturation.

本発明の実施の形態における画像色判定装置の構成の一例を示す図である。It is a figure which shows an example of a structure of the image color determination apparatus in embodiment of this invention. 第1および第2単位画像データ判定部と、第1および第2単位画像データ計数部と、第1および第2ブロック判定部と、第1および第2ブロック計数部と、による処理に使用される色平面の一例を示す図である。Used for processing by the first and second unit image data determination unit, the first and second unit image data counting unit, the first and second block determination unit, and the first and second block counting unit. It is a figure which shows an example of a color plane. 色平面を取得する手法を説明するための図である。It is a figure for demonstrating the method of acquiring a color plane. 地色判定の手順を説明するためのフローチャートである。It is a flowchart for demonstrating the procedure of ground color determination. 色判定の手順を説明するためのフローチャートである。It is a flowchart for demonstrating the procedure of a color determination. 地色設定部によって演算された地色位置を説明するための図である。It is a figure for demonstrating the ground color position calculated by the ground color setting part. 地色設定部によって設定された地色に基づき対象画像にアフィン変換を施した場合における無彩領域の拡大手法を説明するための図である。It is a figure for demonstrating the expansion method of an achromatic area | region when affine transformation is performed to the target image based on the ground color set by the ground color setting part. 地色領域を説明するための図である。It is a figure for demonstrating a ground color area | region. 地色領域を説明するための図である。It is a figure for demonstrating a ground color area | region. 本発明の実施の形態における画像色判定装置の構成の他の例を示す図である。It is a figure which shows the other example of a structure of the image color determination apparatus in embodiment of this invention.

符号の説明Explanation of symbols

1、100 画像色判定装置
21 NCU
22 モデム
25 通信部
31 CODEC
41 スキャナ部
51 記録部
61 画像処理回路
63 表示部
64 操作部
65 第1単位画像データ判定部
66 第1単位画像データ計数部
67 第1ブロック判定部
68 第1ブロック計数部
70 地色判定部
71 地色設定部
72 対象画像変換部
80 対象画像判定部
81 モード選択部
82 第2単位画像データ判定部
83 第2単位画像データ計数部
84 第2ブロック判定部
85 第2ブロック計数部
1,100 Image color determination device 21 NCU
22 MODEM 25 COMMUNICATION UNIT 31 CODEC
Reference Signs List 41 Scanner Unit 51 Recording Unit 61 Image Processing Circuit 63 Display Unit 64 Operation Unit 65 First Unit Image Data Determination Unit 66 First Unit Image Data Counting Unit 67 First Block Determination Unit 68 First Block Counting Unit 70 Ground Color Determination Unit 71 Ground color setting unit 72 Target image converting unit 80 Target image determining unit 81 Mode selecting unit 82 Second unit image data determining unit 83 Second unit image data counting unit 84 Second block determining unit 85 Second block counting unit

Claims (10)

対象画像に係る画像データに基づいて、前記対象画像の地色有無を判定するとともに、前記対象画像が地色を有する場合、地色の明るさおよび色度を判定する地色判定部と、
前記対象画像に係る画像データに基づいて、前記対象画像の色判定を行う対象画像判定部と、
を備え、
前記対象画像判定部は、前記地色判定部の判定結果を利用して、色判定を行うことを特徴とする画像色判定装置。
A ground color determination unit that determines the presence or absence of the ground color of the target image based on image data related to the target image, and determines the brightness and chromaticity of the ground color when the target image has a ground color;
A target image determination unit that performs color determination of the target image based on image data relating to the target image;
With
The target image determination unit performs color determination using the determination result of the ground color determination unit.
請求項1に記載の画像色判定装置において、
前記対象画像判定部は、色判定において、判定対象となる画像データの色度および明るさが、前記地色の色度および明るさに相当する場合は無彩と判断し、前記地色の色度に相当し、且つ、前記地色の明るさと異なる場合には有彩と判断することを特徴とする画像色判定装置。
The image color determination apparatus according to claim 1,
In the color determination, the target image determination unit determines that the chromaticity and brightness of the image data to be determined are achromatic when the chromaticity and brightness of the ground color correspond to the ground color. An image color determination apparatus characterized in that the image color is determined to be chromatic when the brightness is different from the brightness of the ground color.
請求項1または請求項2に記載の画像色判定装置において、
前記地色判定部は、2次元色平面において、色領域毎に画像データの構成単位の数を計数し、その計数結果を利用して地色有無を判定するものであり、
前記対象画像判定部は、2次元色平面において、色領域毎に画像データの構成単位の数を計数し、その計数結果を利用して色判定を行うものであり、
前記地色判定部による計数と前記対象画像判定部による計数とは共通の回路を使用することを特徴とする画像色判定装置。
The image color determination apparatus according to claim 1 or 2,
In the two-dimensional color plane, the ground color determination unit counts the number of constituent units of image data for each color region, and determines the presence or absence of a ground color using the count result.
The target image determination unit counts the number of constituent units of image data for each color region in a two-dimensional color plane, and performs color determination using the count result.
An image color determination apparatus characterized in that a common circuit is used for counting by the ground color determination unit and counting by the target image determination unit.
請求項1ないし請求項3のいずれかに記載の画像色判定装置において、
前記対象画像判定部による色判定において、前記地色判定部の判定結果を利用するか否かを使用者が設定可能であることを特徴とする画像色判定装置。
The image color determination apparatus according to any one of claims 1 to 3,
An image color determination apparatus, wherein a user can set whether or not to use a determination result of the ground color determination unit in color determination by the target image determination unit.
請求項1ないし請求項4のいずれかに記載の画像色判定装置において、
前記対象画像判定部は、2次元色平面において、前記地色判定部で判定した地色の色度に対応する座標位置と、原点位置との位置関係に応じて、画像データに対して移動変換処理を実行するとともに、その移動方向に向かって無彩領域を拡大する処理を実行した上で、無彩領域および有彩領域について、画像データの構成単位の数を計数し、その計数結果を利用して色判定を行うものであることを特徴とする画像色判定装置。
The image color determination apparatus according to any one of claims 1 to 4,
In the two-dimensional color plane, the target image determination unit moves and converts image data according to the positional relationship between the coordinate position corresponding to the chromaticity of the ground color determined by the ground color determination unit and the origin position. After executing the process and executing the process of enlarging the achromatic area in the direction of movement, count the number of image data constituent units for the achromatic area and the chromatic area, and use the count result. An image color determination apparatus characterized by performing color determination.
請求項1ないし請求項4のいずれかに記載の画像色判定装置において、
前記対象画像判定部は、2次元色平面において、前記地色判定部で判定した地色の色度に対応する座標位置を含む方向に、無彩領域を拡大させる処理を実行した上で、無彩領域および有彩領域について、画像データの構成単位の数を計数し、その計数結果を利用して色判定を行うものであることを特徴とする画像色判定装置。
The image color determination apparatus according to any one of claims 1 to 4,
The target image determination unit executes a process of enlarging the achromatic region in a direction including a coordinate position corresponding to the chromaticity of the ground color determined by the ground color determination unit on the two-dimensional color plane. An image color determination apparatus that counts the number of constituent units of image data for a chromatic region and a chromatic region, and performs color determination using the count result.
請求項1ないし請求項6のいずれかに記載の画像色判定装置において、
前記地色判定部は、2次元色平面において、色領域毎に画像データの構成単位の数を計数し、その計数結果を利用して地色有無を判定するとともに、地色に相当する色領域に計数された構成単位の3次元的な分布に基づいて、地色の明るさおよび色度を判定することを特徴とする画像色判定装置。
The image color determination apparatus according to any one of claims 1 to 6,
The ground color determination unit counts the number of constituent units of image data for each color region on a two-dimensional color plane, determines the presence / absence of a ground color using the count result, and a color region corresponding to the ground color An image color determination apparatus, wherein the brightness and chromaticity of a ground color are determined based on a three-dimensional distribution of constituent units counted in step (b).
請求項1ないし請求項7のいずれかに記載の画像色判定装置において、
前記対象画像判定部は、複数の画素を含む画素集合毎に画像データを平均化し、該平均化された画素データを構成単位として画像データの色判定を行うことを特徴とする画像色判定装置。
The image color determination apparatus according to any one of claims 1 to 7,
The target image determination unit averages image data for each pixel set including a plurality of pixels, and performs color determination of the image data using the averaged pixel data as a constituent unit.
対象画像に係る画像データに基づいて、前記対象画像の地色有無を判定するとともに、前記対象画像が地色を有する場合、地色の明るさおよび色度を判定する地色判定工程と、
前記地色判定工程の判定結果を利用して、前記対象画像に係る画像データに基づいて、前記対象画像の色判定を行う対象画像判定工程と、
を備えることを特徴とする画像色判定方法。
A ground color determination step for determining the presence or absence of the ground color of the target image based on image data related to the target image, and for determining the brightness and chromaticity of the ground color when the target image has a ground color;
A target image determination step of performing color determination of the target image based on image data relating to the target image using a determination result of the ground color determination step;
An image color determination method comprising:
対象画像の色判定を実行可能なコンピュータ読み取り可能なプログラムであって、
対象画像に係る画像データに基づいて、前記対象画像の地色有無を判定するとともに、前記対象画像が地色を有する場合、地色の明るさおよび色度を判定する地色判定機能と、
前記地色判定機能の判定結果を利用して、前記対象画像に係る画像データに基づいて、前記対象画像の色判定を行う対象画像判定機能と、
をコンピュータに実行させることを特徴とするプログラム。
A computer-readable program capable of executing color determination of a target image,
Based on the image data relating to the target image, the presence / absence of the ground color of the target image is determined, and when the target image has a ground color, a ground color determination function for determining the brightness and chromaticity of the ground color;
A target image determination function for performing color determination of the target image based on image data relating to the target image using a determination result of the ground color determination function;
A program that causes a computer to execute.
JP2007183148A 2006-09-06 2007-07-12 Image color determination apparatus, image color determination method, and program Expired - Fee Related JP4438834B2 (en)

Priority Applications (4)

Application Number Priority Date Filing Date Title
JP2007183148A JP4438834B2 (en) 2006-09-06 2007-07-12 Image color determination apparatus, image color determination method, and program
EP07016588A EP1898625A3 (en) 2006-09-06 2007-08-23 Apparatus and method for deciding image color
US11/847,193 US20080055682A1 (en) 2006-09-06 2007-08-29 Apparatus and Method for Deciding Image Color
CN2007101495213A CN101141546B (en) 2006-09-06 2007-09-04 Apparatus and method for deciding image color

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
JP2006242193 2006-09-06
JP2007183148A JP4438834B2 (en) 2006-09-06 2007-07-12 Image color determination apparatus, image color determination method, and program

Publications (2)

Publication Number Publication Date
JP2008092553A true JP2008092553A (en) 2008-04-17
JP4438834B2 JP4438834B2 (en) 2010-03-24

Family

ID=39376156

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2007183148A Expired - Fee Related JP4438834B2 (en) 2006-09-06 2007-07-12 Image color determination apparatus, image color determination method, and program

Country Status (1)

Country Link
JP (1) JP4438834B2 (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2011024055A (en) * 2009-07-16 2011-02-03 Fuji Xerox Co Ltd Image reading apparatus and image processor
JP2013179408A (en) * 2012-02-28 2013-09-09 Brother Ind Ltd Image processing apparatus and image processing program
JP2014192552A (en) * 2013-03-26 2014-10-06 Brother Ind Ltd Image processing device and image processing program
CN113031281A (en) * 2021-04-21 2021-06-25 南昌三极光电有限公司 Optical system

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2011024055A (en) * 2009-07-16 2011-02-03 Fuji Xerox Co Ltd Image reading apparatus and image processor
JP2013179408A (en) * 2012-02-28 2013-09-09 Brother Ind Ltd Image processing apparatus and image processing program
JP2014192552A (en) * 2013-03-26 2014-10-06 Brother Ind Ltd Image processing device and image processing program
CN113031281A (en) * 2021-04-21 2021-06-25 南昌三极光电有限公司 Optical system
CN113031281B (en) * 2021-04-21 2022-11-08 南昌三极光电有限公司 Optical system

Also Published As

Publication number Publication date
JP4438834B2 (en) 2010-03-24

Similar Documents

Publication Publication Date Title
JP4293212B2 (en) Image color determination apparatus, image color determination method, and program
JP4861967B2 (en) Image processing apparatus, image processing method, image processing program, image forming apparatus, and storage medium
JP5220828B2 (en) Image processing apparatus, image forming apparatus, image reading apparatus, image processing method, program, and recording medium
US8009902B2 (en) Image processing apparatus and method for detecting a background color based on data chrominance distribution
JP2005045404A (en) Image processor and method, and program
US20080055677A1 (en) Image Color Determining Device and Image Color Determining Method
JP4438834B2 (en) Image color determination apparatus, image color determination method, and program
CN111835931B (en) Image processing apparatus, image forming apparatus, image reading apparatus, and control method
US7835045B2 (en) Image processing device and image processing method
JP4470958B2 (en) Image processing device
JP2009017247A (en) Image processing device and program
EP1898625A2 (en) Apparatus and method for deciding image color
JP4386110B2 (en) Image color determination apparatus, image color determination method, and program
JP2008172677A (en) Image processor and ground color detection method
JP3838981B2 (en) Image processing apparatus, image processing method, and image processing program
JP2006333200A (en) Color image input/output apparatus
JP2008259016A (en) Image forming apparatus and image forming method
US20100188670A1 (en) Image processing apparatus, image processing method and program executing the image processing method
JP2011139373A (en) Black color determining apparatus and black color determining method
JP2010258706A (en) Image processing apparatus, image forming apparatus, method of controlling image processing apparatus, program, and recording medium
JP2006287707A (en) Image processor
JP2008066950A (en) Image color deciding device, image color deciding method, and image color deciding program
JP2008219465A (en) Image reader
JP2008066920A (en) Image color deciding device, image color deciding method, and image color deciding program
JP2008066928A (en) Image color deciding device, image color deciding method, and program

Legal Events

Date Code Title Description
A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20080903

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20081028

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20081218

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20090526

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20090717

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20090915

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20091009

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: 20091215

A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20091228

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20130115

Year of fee payment: 3

R150 Certificate of patent or registration of utility model

Ref document number: 4438834

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R150

Free format text: JAPANESE INTERMEDIATE CODE: R150

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20140115

Year of fee payment: 4

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

LAPS Cancellation because of no payment of annual fees