JP7495660B2 - Image processing device and computer program - Google Patents

Image processing device and computer program Download PDF

Info

Publication number
JP7495660B2
JP7495660B2 JP2020105644A JP2020105644A JP7495660B2 JP 7495660 B2 JP7495660 B2 JP 7495660B2 JP 2020105644 A JP2020105644 A JP 2020105644A JP 2020105644 A JP2020105644 A JP 2020105644A JP 7495660 B2 JP7495660 B2 JP 7495660B2
Authority
JP
Japan
Prior art keywords
pixel
interest
value
color
conversion process
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.)
Active
Application number
JP2020105644A
Other languages
Japanese (ja)
Other versions
JP2021197717A (en
Inventor
拓郎 西村
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.)
Brother Industries Ltd
Original Assignee
Brother Industries Ltd
Filing date
Publication date
Application filed by Brother Industries Ltd filed Critical Brother Industries Ltd
Priority to JP2020105644A priority Critical patent/JP7495660B2/en
Publication of JP2021197717A publication Critical patent/JP2021197717A/en
Application granted granted Critical
Publication of JP7495660B2 publication Critical patent/JP7495660B2/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Description

本明細書は、メージセンサを用いて原稿を光学的に読み取ることによって得られる対象画像データに対して実行される画像処理に関する。 This specification relates to image processing performed on target image data obtained by optically reading a document using an image sensor.

特許文献1に開示された画像処理は、スキャンデータに対して、下地レベル以上の輝度を有する画素を白に置き換えるいわゆる下地飛ばし処理を実行する。この画像処理装置は、下地飛ばし処理を実行する前に、画像内のハイライト色を有する画素を示すフラグデータを作成する。ハイライト色は、ライトシアン、ライトマゼンタなどの淡トナーを用いて再現される色である。画像処理装置は、ハイライト色を有する画素に対して、下地レベルAを用いて下地飛ばし処理を実行し、ハイライト色を有しない画素に対して、下地レベルAよりも低い輝度を示す下地レベルBを用いて下地飛ばし処理を実行する。これによって、画像内のハイライト色の再現性と下地除去とを両立させる下地除去処理が可能となる、とされている。 The image processing disclosed in Patent Document 1 performs so-called background removal processing on the scan data, replacing pixels with a brightness equal to or greater than the background level with white. Before performing the background removal processing, this image processing device creates flag data indicating pixels with a highlight color in the image. Highlight colors are colors reproduced using light toners such as light cyan and light magenta. The image processing device performs background removal processing on pixels with a highlight color using background level A, and performs background removal processing on pixels without a highlight color using background level B, which has a brightness lower than background level A. This is said to enable background removal processing that achieves both the reproduction of highlight colors in an image and background removal.

特開2008-5317号公報JP 2008-5317 A

このように、明るい色の再現と、下地の色の変換と、を両立させる技術が求められている。 As such, there is a demand for technology that can both reproduce bright colors and convert the color of the base.

本明細書は、明るい色の再現と、下地の色の変換と、を両立できる新たな技術を開示する。 This specification discloses a new technology that can simultaneously reproduce bright colors and convert the color of the background.

本明細書に開示された技術は、上述の課題の少なくとも一部を解決するためになされたものであり、以下の適用例として実現することが可能である。 The technology disclosed in this specification has been made to solve at least some of the problems described above, and can be realized as the following application examples.

[適用例1]画像処理装置であって、イメージセンサを用いて原稿を光学的に読み取ることによって得られる対象画像データを取得する取得部と、前記対象画像データによって示される対象画像内の注目画素が特定の調整条件を満たすか否かを判断する判断部であって、前記特定の調整条件は、前記注目画素が、第1基準以上の明るさを有し、かつ、第2基準以上の彩度を有することを含む、前記判断部と、前記対象画像データに対して補正処理を実行して、処理済画像を示す処理済画像データを生成する補正処理部と、を備え、前記補正処理は、前記注目画素に対する特定の変換処理であって、前記注目画素が第3基準以上の明るさを有する場合に前記注目画素の色が色になるように、前記注目画素の値を変換する前記特定の変換処理と、前記変換処理前の前記注目画素が前記特定の調整条件を満たす場合に、前記変換処理前の前記注目画素の値を用いて、前記変換処理済みの前記注目画素の値を調整する調整処理と、を含む、画像処理装置。 [Application Example 1] An image processing device comprising: an acquisition unit that acquires target image data obtained by optically reading a document using an image sensor; a judgment unit that judges whether a target pixel in a target image represented by the target image data satisfies specific adjustment conditions, the specific adjustment conditions including that the target pixel has a brightness equal to or greater than a first standard and a saturation equal to or greater than a second standard; and a correction processing unit that performs a correction process on the target image data to generate processed image data that indicates a processed image, the correction process being a specific conversion process on the target pixel that converts the value of the target pixel so that the color of the target pixel becomes white when the target pixel has a brightness equal to or greater than a third standard; and an adjustment process that adjusts the value of the target pixel after the conversion process using the value of the target pixel before the conversion process when the target pixel before the conversion process satisfies the specific adjustment conditions.

上記構成によれば、補正処理は、注目画素が第3基準以上の明るさを有する場合に注目画素の色が色になるように、注目画素の値を変換する変換処理を含むので、処理済画像において、第3基準以上の明るさを有する下地の色を適切に変換できる。例えば、下地の色を白に変換するいわゆる下地除去を適切に実現できる。さらに、補正処理は、変換処理前の注目画素が特定の調整条件を満たす場合に、変換処理前の注目画素の値を用いて、変換処理済みの注目画素の値を調整する調整処理を含むので、処理済画像において、第1基準以上の明るさを有し、かつ、第2基準以上の彩度を有する明るい色の再現性を向上できる。したがって、処理済み画像において、明るい色の再現と、下地の色の変換と、を両立できる。
According to the above configuration, the correction process includes a conversion process for converting the value of the pixel of interest so that the color of the pixel of interest becomes white when the pixel of interest has a brightness equal to or greater than a third reference, so that the color of the background having a brightness equal to or greater than the third reference can be appropriately converted in the processed image. For example, so-called background removal, which converts the color of the background to white, can be appropriately realized. Furthermore, the correction process includes an adjustment process for adjusting the value of the pixel of interest after the conversion process using the value of the pixel of interest before the conversion process when the pixel of interest before the conversion process satisfies a specific adjustment condition, so that the reproducibility of bright colors having a brightness equal to or greater than a first reference and a saturation equal to or greater than a second reference can be improved in the processed image. Therefore, the reproduction of bright colors and the conversion of the color of the background can be achieved at the same time in the processed image.

なお、本発明は、種々の形態で実現可能であり、例えば、印刷装置の制御装置、画像読取装置の制御装置、画像処理方法、これらの装置および方法の機能を実現するためのコンピュータプログラム、そのコンピュータプログラムを記録した記録媒体、等の形態で実現することができる。 The present invention can be realized in various forms, such as a control device for a printing device, a control device for an image reading device, an image processing method, a computer program for realizing the functions of these devices and methods, a recording medium on which the computer program is recorded, etc.

本発明の一実施例としての複合機200の構成を示すブロック図。FIG. 1 is a block diagram showing a configuration of a multifunction peripheral 200 according to an embodiment of the present invention. 実施例のコピー処理のフローチャート。11 is a flowchart of a copy process according to an embodiment. コピー処理にて用いられる画像の一例を示す図。FIG. 4 is a diagram showing an example of an image used in a copy process. 下地除去処理のフローチャート。13 is a flowchart of a background removal process. 注目画素Ptと周囲画素Pnとの説明図。4 is an explanatory diagram of a pixel of interest Pt and surrounding pixels Pn; 変換処理で用いられるトーンカーブTCの一例を示す図。FIG. 4 is a diagram showing an example of a tone curve TC used in the conversion process. 下地除去処理におけるRGB値の一例を示す図。6A and 6B are diagrams showing an example of RGB values in the background removal process. 下地除去処理におけるRGB値の一例を示す図。6A and 6B are diagrams showing an example of RGB values in the background removal process. 比較例の処理済画像DIxの一例を示す図。FIG. 13 is a diagram showing an example of a processed image DIx in a comparative example.

A.実施例
A-1.複合機200の構成
次に、本発明の実施の形態を実施例に基づき説明する。図1は、本発明の一実施例としての複合機200の構成を示すブロック図である。
A. Example A-1. Configuration of multifunction device 200 Next, an embodiment of the present invention will be described based on an example. Fig. 1 is a block diagram showing the configuration of a multifunction device 200 as an example of the present invention.

複合機200は、CPU210と、ハードディスクドライブやEEPROMなどの不揮発性記憶装置220と、RAMなどの揮発性記憶装置230と、所定の方式(例えば、インクジェット方式、レーザー方式)で画像を印刷するプリンタ部240と、一次元イメージセンサを用いて光学的に対象物(例えば、紙の原稿)を読み取ることによってスキャンデータを生成するスキャナ部250と、タッチパネルやボタンなどの操作部260と、タッチパネルと重畳された液晶パネルなどの表示部270と、端末装置やUSBメモリ(図示省略)などの外部装置とデータ通信を行うためのインターフェースを含む通信部280と、を備えている。 The multifunction device 200 comprises a CPU 210, a non-volatile storage device 220 such as a hard disk drive or EEPROM, a volatile storage device 230 such as a RAM, a printer unit 240 that prints images using a predetermined method (e.g., inkjet method, laser method), a scanner unit 250 that generates scan data by optically reading an object (e.g., a paper document) using a one-dimensional image sensor, an operation unit 260 such as a touch panel or buttons, a display unit 270 such as a liquid crystal panel superimposed on the touch panel, and a communication unit 280 that includes an interface for data communication with external devices such as a terminal device or a USB memory (not shown).

不揮発性記憶装置220は、コンピュータプログラム222を格納している。プログラム222は、例えば、CD-ROMやDVD-ROMなどに格納された形態で提供される。あるいは、コンピュータプログラム222は、例えば、複合機200の出荷時に、予め不揮発性記憶装置220に記憶されている。あるいは、コンピュータプログラム222は、ネットワークを介して複合機200に接続されたサーバ(図示省略)からダウンロードされる形態で提供される。揮発性記憶装置230には、CPU210が処理を行う際に生成される種々の中間データを一時的に格納するバッファ領域231が設けられている。 The non-volatile storage device 220 stores a computer program 222. The program 222 is provided, for example, in a form stored on a CD-ROM or DVD-ROM. Alternatively, the computer program 222 is stored in the non-volatile storage device 220 in advance, for example, when the multifunction device 200 is shipped. Alternatively, the computer program 222 is provided in a form downloaded from a server (not shown) connected to the multifunction device 200 via a network. The volatile storage device 230 is provided with a buffer area 231 that temporarily stores various intermediate data generated when the CPU 210 performs processing.

CPU210は、コンピュータプログラム222を実行することにより、複合機200の全体を制御する機能や、後述するコピー処理を実行する機能を実現する。 By executing the computer program 222, the CPU 210 realizes the function of controlling the entire multifunction device 200 and the function of executing the copy process described below.

A-2.コピー処理
図2は、実施例のコピー処理のフローチャートである。コピー処理は、原稿を示すスキャンデータを生成し、該スキャンデータを用いて、原稿を示す画像を用紙に印刷する処理である。例えば、コピー処理は、ユーザがスキャナ部250に原稿を載置してコピー指示を行ったときに実行される。
A-2. Copying process Fig. 2 is a flowchart of the copying process of the embodiment. The copying process is a process of generating scan data representing an original document and printing an image representing the original document on paper using the scan data. For example, the copying process is executed when a user places an original document on the scanner unit 250 and issues a copy instruction.

S10では、CPU210(図1)は、処理対象の対象画像データとして、スキャンデータを取得する。CPU210は、例えば、スキャナ部250を用いて原稿を読み取ることによって、あるいは、不揮発性記憶装置220から読み出すことによって、スキャンデータを取得する。スキャンデータは、各画素の色をRGB値で表すRGB画像データである。RGB値は、赤(R)と緑(G)と青(B)との3個の色成分の値を含むRGB表色系の色値である。RGB値の各色成分の値を、それぞれ、R値、G値、B値とも呼ぶ。なお、本実施例では、S10にて取得された時点のRGB値の各色成分の値は、それぞれ、0~1023の範囲の値(10ビットの値)をとる1024階調の値である。 In S10, the CPU 210 (FIG. 1) acquires scan data as target image data to be processed. The CPU 210 acquires the scan data, for example, by reading an original using the scanner unit 250 or by reading from the non-volatile storage device 220. The scan data is RGB image data that expresses the color of each pixel with RGB values. The RGB values are color values of the RGB color system that include the values of the three color components red (R), green (G), and blue (B). The values of each color component of the RGB value are also called the R value, G value, and B value, respectively. Note that in this embodiment, the values of each color component of the RGB value acquired in S10 are 1024 gradation values that take values in the range of 0 to 1023 (10-bit values).

図3は、コピー処理にて用いられる画像の一例を示す図である。図3(A)には、スキャンデータによって示されるスキャン画像SIの一例が示されている。図3(A)のスキャン画像SIは、文字TXと、マーカーMKと、写真PCと、背景BGと、を含んでいる。マーカーMKは、文字TXを囲む略矩形の領域であって薄い有彩色(例えば、薄い赤、緑)を有する領域である。マーカーMKは、原稿上の当該矩形の領域に対していわゆる蛍光ペンを用いて記入されたオブジェクトである。背景BGは、原稿の用紙の色を示す部分である。スキャナ部250のイメージセンサは、白に近い薄い色の階調が消失しないように調整されている。また、背景BGは、イメージセンサの出力のバラツキなどに起因する色のムラを含んでいる。このために、原稿が一般的な白の用紙である場合でも、背景BGは、完全な白(本実施例では、(R、G、B)=(1023、1023、1023)に相当する色)ではなく、白とは異なる色(例えば、薄いグレー)を有する部分を含む。 3 is a diagram showing an example of an image used in the copy process. FIG. 3(A) shows an example of a scan image SI shown by scan data. The scan image SI in FIG. 3(A) includes a character TX, a marker MK, a photo PC, and a background BG. The marker MK is a substantially rectangular area surrounding the character TX and having a light chromatic color (e.g., light red, green). The marker MK is an object that is written in the rectangular area on the document using a so-called highlighter pen. The background BG is a portion that shows the color of the document paper. The image sensor of the scanner unit 250 is adjusted so that the gradation of a light color close to white does not disappear. In addition, the background BG includes color unevenness due to variations in the output of the image sensor. For this reason, even if the document is a general white paper, the background BG is not completely white (in this embodiment, a color corresponding to (R, G, B) = (1023, 1023, 1023)), but includes a portion that has a color different from white (e.g., light gray).

図2のS20では、CPU210は、スキャンデータに対して、下地除去処理を実行して、処理済画像DIを示す処理済画像データを生成する。下地除去処理は、スキャン画像SIの背景BGの色を白色に変換する処理である。なお、本実施例の下地除去処理は、RGB値の各色成分の値を、1024階調の値から、0~255の範囲の値(8ビットの値)をとる256階調の値に変換する処理を含む(詳細は後述)。このために、処理済画像データに含まれるRGB値の各色成分の値は、256階調の値である。図3(B)には、処理済画像DIの一例が示されている。処理済画像DIの背景BGsは、白色(本実施例では、(R、G、B)=(255、255、255)に相当する色)を有する。 In S20 of FIG. 2, the CPU 210 executes a background removal process on the scan data to generate processed image data representing a processed image DI. The background removal process is a process of converting the color of the background BG of the scan image SI to white. Note that the background removal process in this embodiment includes a process of converting the value of each color component of the RGB value from a value of 1024 gradations to a value of 256 gradations having a value in the range of 0 to 255 (8-bit value) (details will be described later). For this reason, the value of each color component of the RGB value contained in the processed image data is a value of 256 gradations. FIG. 3(B) shows an example of the processed image DI. The background BGs of the processed image DI has a white color (a color equivalent to (R, G, B) = (255, 255, 255) in this embodiment).

S30では、CPU210は、S20にて生成された処理済画像データに対して、画質調整処理を実行する。画質調整処理は、図3(B)の処理済画像DIの見栄えを向上させる処理である。画質調整処理には、任意の画像処理が採用され得るが、例えば、彩度を向上させる処理、平滑化処理、エッジ強調処理、あるいは、これらの処理を組み合わせた画像処理が採用され得る。 In S30, the CPU 210 executes image quality adjustment processing on the processed image data generated in S20. The image quality adjustment processing is processing for improving the appearance of the processed image DI in FIG. 3(B). Any image processing may be used for the image quality adjustment processing, such as processing for improving saturation, smoothing processing, edge enhancement processing, or image processing that combines these processes.

S40では、CPU210は、S30にて生成された画質調整後の処理済画像データに対して、色変換処理やハーフトーン処理を含む印刷データ生成処理を実行して、印刷データを生成する。色変換処理は、各画素のRGB値をCMYK値に変換する処理である。CMYK値は、印刷に用いられるインクに対応する成分値(本実施例では、C、M、Y、Kの成分値)を含むCMYK表色系の色値である。色変換処理は、例えば、RGB値とCMYK値との対応関係を規定する公知のルックアップテーブルを参照して実行される。ハーフトーン処理は、CMYKのそれぞれの色成分について、ドット形成状態を画素ごとに表すドットデータを生成する処理である。ドットデータの各画素の値は、例えば、「ドット無し」「小」「中」「大」の4階調のドットの形成状態を示す。これに代えて、ドットデータの各画素の値は、「ドット無し」と「ドット有り」の2階調のドットの形成状態を示しても良い。ハーフトーン処理は、ディザ法や誤差拡散法などの公知の手法を用いて実行される。本ステップで生成される印刷データは、ドットデータを含むデータである。 In S40, the CPU 210 executes print data generation processing including color conversion processing and halftone processing on the processed image data after image quality adjustment generated in S30 to generate print data. The color conversion processing is a process of converting the RGB values of each pixel into CMYK values. The CMYK values are color values of the CMYK color system including component values (in this embodiment, the component values of C, M, Y, and K) corresponding to the ink used in printing. The color conversion processing is executed, for example, by referring to a known lookup table that specifies the correspondence between the RGB values and the CMYK values. The halftone processing is a process of generating dot data that represents the dot formation state for each pixel for each color component of CMYK. The value of each pixel of the dot data indicates the formation state of dots in four gradations, for example, "no dot", "small", "medium", and "large". Alternatively, the value of each pixel of the dot data may indicate the formation state of dots in two gradations, "no dot" and "dot". The halftone processing is executed using a known method such as a dither method or an error diffusion method. The print data generated in this step contains dot data.

S50では、CPU210は、S40にて生成された印刷データを用いて印刷処理を実行する。すなわち、CPU210は、印刷データをプリンタ部240に供給して、プリンタ部240に該印刷データに従う印刷を実行させる。これによって、画質調整後の処理済画像DIが用紙に印刷される。 In S50, the CPU 210 executes a print process using the print data generated in S40. That is, the CPU 210 supplies the print data to the printer unit 240 and causes the printer unit 240 to execute printing according to the print data. As a result, the processed image DI after image quality adjustment is printed on paper.

A-3.下地除去処理
図2のS20の下地除去処理について説明する。図4は、下地除去処理のフローチャートである。S100では、CPU210は、スキャン画像SI(図3(A))内の複数個の画素の中から、1個の注目画素Ptを選択する。
A-3. Background Removal Processing The background removal processing of S20 in Fig. 2 will now be described. Fig. 4 is a flowchart of the background removal processing. In S100, the CPU 210 selects one pixel of interest Pt from among a plurality of pixels in the scanned image SI (Fig. 3A).

S105では、CPU210は、保存済みの成分間差分値ΔV1、ΔV2を初期化する。例えば、成分間差分値ΔV1、ΔV2の初期値は、ゼロである。成分間差分値ΔV1、ΔV2は、後述するRGB値の調整(S155)に用いられる値であり、詳細は後述する。 In S105, the CPU 210 initializes the inter-component difference values ΔV1 and ΔV2 that have already been stored. For example, the initial values of the inter-component difference values ΔV1 and ΔV2 are zero. The inter-component difference values ΔV1 and ΔV2 are values used in the adjustment of the RGB values (S155) described below, and details will be described later.

S110では、CPU210は、注目画素PtのRGB値の全ての色成分の値(R値、G値、B値)が閾値TH1以上であるか否かを判断する。RGB値が1024階調の値(10ビットの値)であるので、閾値TH1は1024階調の値である。例えば、閾値TH1は、800程度の値である。各色成分の値が大きいほど明度が高くなるので、本ステップは、注目画素Ptが閾値TH1に基づく基準以上の明るさを有するか否かを判断するステップである、と言うことができる。本明細書では、RGB値の全ての色成分の値が閾値TH1以上である画素を高明度画素とも呼ぶ。 In S110, the CPU 210 determines whether the values of all color components (R, G, B values) of the RGB value of the pixel of interest Pt are equal to or greater than the threshold value TH1. Since the RGB value is a value of 1024 gradations (10-bit value), the threshold value TH1 is a value of 1024 gradations. For example, the threshold value TH1 is a value of approximately 800. Since the brightness increases as the value of each color component increases, this step can be said to be a step for determining whether the pixel of interest Pt has a brightness equal to or greater than a standard based on the threshold value TH1. In this specification, a pixel whose values of all color components of the RGB value are equal to or greater than the threshold value TH1 is also referred to as a high-brightness pixel.

注目画素PtのRGB値の少なくとも1個の色成分の値が閾値TH1未満である場合には(S110:NO)、CPU210は、後述のS145に処理を進める。注目画素PtのRGB値の全ての色成分の値が閾値TH1以上である場合には(S110:YES)、S115にて、CPU210は、注目画素PtのRGB値の成分間差分値ΔV1、ΔV2を算出する。 If the value of at least one color component of the RGB values of the pixel of interest Pt is less than the threshold value TH1 (S110: NO), the CPU 210 proceeds to S145 described below. If the values of all color components of the RGB values of the pixel of interest Pt are equal to or greater than the threshold value TH1 (S110: YES), in S115, the CPU 210 calculates the inter-component difference values ΔV1 and ΔV2 of the RGB values of the pixel of interest Pt.

成分間差分値は、RGB値の3個の色成分の値(R値、G値、B値)のうちの2個の値の差分である。例えば、成分間差分値ΔV1は、R値、G値、B値のうちの最大値と最小値との間の差分値である。成分間差分値ΔV2は、R値、G値、B値のうちの最大値と2番目の値との間の差分値である。ここで、本実施例では、成分間差分値ΔV1、ΔV2は、256階調の値で算出される。例えば、R値、G値、B値のうちの最大値、2番目の値、最小値をVmax、V2nd、Vminとすると、成分間差分値ΔV1、ΔV2は、以下の式(1)、(2)を用いて算出される。
ΔV1=(Vmax-Vmin)×(256/1024) …(1)
ΔV2=(Vmax-V2nd)×(256/1024) …(2)
The inter-component difference value is the difference between two values of the three color component values (R value, G value, B value) of the RGB values. For example, the inter-component difference value ΔV1 is the difference value between the maximum value and the minimum value of the R value, the G value, and the B value. The inter-component difference value ΔV2 is the difference value between the maximum value and the second value of the R value, the G value, and the B value. Here, in this embodiment, the inter-component difference values ΔV1 and ΔV2 are calculated with values of 256 gradations. For example, if the maximum value, the second value, and the minimum value of the R value, the G value, and the B value are Vmax, V2nd, and Vmin, respectively, the inter-component difference values ΔV1 and ΔV2 are calculated using the following formulas (1) and (2).
ΔV1=(Vmax-Vmin)×(256/1024) ... (1)
ΔV2=(Vmax-V2nd)×(256/1024) ... (2)

S120では、CPU210は、注目画素Ptの成分間差分値ΔV1、ΔV2のうち少なくとも一つの値が閾値TH2以上であるか否かを判断する。成分間差分値ΔV1、ΔV2の両方が0である場合には、3個の色成分の値(R値、G値、B値)が互いに等しいので、注目画素Ptの色は無彩色である。成分間差分値ΔV1、ΔV2の少なくとも1つが大きいほど、注目画素Ptの彩度が大きい。このため、本ステップは、注目画素Ptが閾値TH2に基づく基準以上の彩度を有するか否かを判断するステップである、と言うことができる。本明細書では、成分間差分値ΔV1、ΔV2のうち少なくとも一つの値が閾値TH2以上である画素を、有彩色画素とも呼び、成分間差分値ΔV1、ΔV2の両方が閾値TH2未満である画素を、無彩色画素とも呼ぶ。 In S120, the CPU 210 judges whether at least one of the inter-component difference values ΔV1, ΔV2 of the pixel of interest Pt is equal to or greater than the threshold value TH2. When both inter-component difference values ΔV1, ΔV2 are 0, the values of the three color components (R, G, B) are equal to each other, and the color of the pixel of interest Pt is achromatic. The greater the value of at least one of the inter-component difference values ΔV1, ΔV2, the greater the saturation of the pixel of interest Pt. For this reason, this step can be said to be a step for judging whether the pixel of interest Pt has a saturation equal to or greater than a reference based on the threshold value TH2. In this specification, a pixel in which at least one of the inter-component difference values ΔV1, ΔV2 is equal to or greater than the threshold value TH2 is also referred to as a chromatic pixel, and a pixel in which both inter-component difference values ΔV1, ΔV2 are less than the threshold value TH2 is also referred to as an achromatic pixel.

成分間差分値ΔV1、ΔV2が256階調の値(8ビットの値)であるので、閾値TH2は256階調の値である。閾値TH2は、下地除去処理にて、白に変換されるべきでない色の彩度の下限に相当する値に設定される。例えば、閾値TH2は、上述した閾値TH1を256階調に変換した値を、TH1s(TH1s=TH1×(256/1024))とする場合に、(255-TH1s)よりも小さな値に設定される。本実施例では、TH1は800程度の値であるので、TH1sは、200程度の値である。このために、例えば、閾値TH2は、55より小さな値、例えば、20~30程度の値に設定されている。 Since the inter-component difference values ΔV1 and ΔV2 are 256-level values (8-bit values), the threshold value TH2 is a value of 256 levels. The threshold value TH2 is set to a value equivalent to the lower limit of the saturation of colors that should not be converted to white in the background removal process. For example, if the value obtained by converting the above-mentioned threshold value TH1 to 256 levels is TH1s (TH1s = TH1 x (256/1024)), the threshold value TH2 is set to a value smaller than (255 - TH1s). In this embodiment, TH1 is a value of approximately 800, so TH1s is a value of approximately 200. For this reason, for example, the threshold value TH2 is set to a value smaller than 55, for example, a value of approximately 20 to 30.

注目画素Ptの成分間差分値ΔV1、ΔV2の両方が閾値TH2未満である場合には(S120:NO)、CPU210は、後述のS145に処理を進める。注目画素Ptの成分間差分値ΔV1、ΔV2のうち少なくとも一つの値は閾値TH2以上である場合には(S120:YES)、S125にて、CPU210は、周囲画素Pnの成分間差分値ΔV1、ΔV2を算出する。 If both inter-component difference values ΔV1, ΔV2 of the pixel of interest Pt are less than the threshold value TH2 (S120: NO), the CPU 210 proceeds to S145 described below. If at least one of the inter-component difference values ΔV1, ΔV2 of the pixel of interest Pt is equal to or greater than the threshold value TH2 (S120: YES), in S125, the CPU 210 calculates the inter-component difference values ΔV1, ΔV2 of the surrounding pixels Pn.

図5は、注目画素Ptと周囲画素Pnとの説明図である。図5(A)、(B)に示すように、本実施例では、注目画素Ptの周囲を囲む8個の画素が、周囲画素Pnとして特定される。換言すれば、本実施例の8個の周囲画素Pnは、注目画素Ptを中心とする縦3画素×横3画素の矩形の範囲内の9個の画素のうち、中心の注目画素Ptを除いた画素である。CPU210は、8個の周囲画素Pnのそれぞれの成分間差分値ΔV1、ΔV2を算出する。 Figure 5 is an explanatory diagram of the pixel of interest Pt and surrounding pixels Pn. As shown in Figures 5 (A) and (B), in this embodiment, eight pixels surrounding the pixel of interest Pt are identified as surrounding pixels Pn. In other words, the eight surrounding pixels Pn in this embodiment are the nine pixels within a rectangular range of three pixels vertical by three pixels horizontal with the pixel of interest Pt at its center, excluding the central pixel of interest Pt. The CPU 210 calculates the inter-component difference values ΔV1 and ΔV2 for each of the eight surrounding pixels Pn.

S130では、CPU210は、8個の周囲画素Pnの中に、2つの成分間差分値ΔV1、ΔV2の少なくとも1個の値が閾値TH2以上である周囲画素があるか否かを判断する。換言すれば、8個の周囲画素Pnの中に、1以上の有彩色画素が存在するか否かが判断される。図5(A)、(B)の例において、ハッチングされた画素は有彩色画素であり、ハッチングされていない画素は無彩色画素である。 In S130, the CPU 210 determines whether or not there is a surrounding pixel among the eight surrounding pixels Pn for which at least one of the two inter-component difference values ΔV1, ΔV2 is equal to or greater than the threshold value TH2. In other words, it is determined whether or not there is one or more chromatic pixels among the eight surrounding pixels Pn. In the examples of Figures 5(A) and (B), the hatched pixels are chromatic pixels, and the unhatched pixels are achromatic pixels.

成分間差分値ΔV1、ΔV2の少なくとも1個の値が閾値TH2以上である周囲画素Pnが1つもない場合は(S130:NO)、図5(A)に示すように、注目画素Ptのみが有彩色画素であり、8個の周囲画素Pnはいずれも無彩色画素である。この場合には、注目画素Ptは、コピーされた画像内に再現されるべきオブジェクトを構成する画素ではなく、孤立したノイズを示すノイズ画素であると考えられる。ノイズ画素は、原稿や原稿台に付着したゴミやスキャンデータの生成時における原稿の浮きなどに起因して生じる。 If there is no surrounding pixel Pn for which at least one of the inter-component difference values ΔV1, ΔV2 is equal to or greater than the threshold value TH2 (S130: NO), then as shown in FIG. 5(A), only the target pixel Pt is a chromatic pixel, and all eight surrounding pixels Pn are achromatic pixels. In this case, the target pixel Pt is not considered to be a pixel that constitutes an object to be reproduced in the copied image, but is considered to be a noise pixel that indicates isolated noise. Noise pixels are generated due to dust on the document or document table, or due to the document floating when the scanned data is generated.

このために、成分間差分値ΔV1、ΔV2の少なくとも1個の値が閾値TH2以上である周囲画素Pnが1つもない場合は(S130:NO)、S140にて、CPU210は、注目画素のRGB値を、8個の周囲画素のRGB値の平均値に置換する。また、この場合には、処理済画像DIにおいて、注目画素Ptの成分間差分値ΔV1、ΔV2を維持する必要はないので、成分間差分値ΔV1、ΔV2の保存(図4のS135)は実行されない。 For this reason, if there is no surrounding pixel Pn for which at least one of the inter-component difference values ΔV1, ΔV2 is equal to or greater than the threshold value TH2 (S130: NO), then in S140 the CPU 210 replaces the RGB value of the pixel of interest with the average value of the RGB values of the eight surrounding pixels. In this case, since there is no need to maintain the inter-component difference values ΔV1, ΔV2 of the pixel of interest Pt in the processed image DI, the inter-component difference values ΔV1, ΔV2 are not saved (S135 in FIG. 4).

成分間差分値ΔV1、ΔV2の少なくとも1個の値が閾値TH2以上である周囲画素Pnが1以上ある場合には(S130:YES)、図5(B)に示すように、注目画素Ptと1以上の周囲画素Pnが有彩色画素である。この場合には、注目画素Ptは、コピーされた画像内に再現されるべきオブジェクトを構成する有彩色画素であると考えられる。この場合には、処理済画像DIにおいて、注目画素Ptの成分間差分値ΔV1、ΔV2を維持する必要がある。このために、成分間差分値ΔV1、ΔV2の少なくとも1個の値が閾値TH2以上である周囲画素Pnが1以上ある場合には(S130:YES)、S135にて、CPU210は、S115にて算出済みの注目画素Ptの成分間差分値ΔV1、ΔV2を揮発性記憶装置230に保存する。 If there is one or more surrounding pixels Pn for which at least one of the inter-component difference values ΔV1, ΔV2 is equal to or greater than the threshold value TH2 (S130: YES), then the pixel of interest Pt and one or more surrounding pixels Pn are chromatic pixels, as shown in FIG. 5B. In this case, the pixel of interest Pt is considered to be a chromatic pixel that constitutes an object to be reproduced in the copied image. In this case, it is necessary to maintain the inter-component difference values ΔV1, ΔV2 of the pixel of interest Pt in the processed image DI. To this end, if there is one or more surrounding pixels Pn for which at least one of the inter-component difference values ΔV1, ΔV2 is equal to or greater than the threshold value TH2 (S130: YES), then in S135, the CPU 210 stores the inter-component difference values ΔV1, ΔV2 of the pixel of interest Pt calculated in S115 in the volatile storage device 230.

以上までの説明から解るように、S130は、注目画素Ptがノイズ画素であるか否かを判定する処理である、と言うことができる。 As can be seen from the above explanation, S130 can be said to be a process for determining whether or not the pixel of interest Pt is a noise pixel.

S145では、CPU210は、トーンカーブTCを用いて、注目画素Ptに対して変換処理を実行する。この変換処理は、注目画素Ptに対して無条件で実行されるので、スキャン画像SI内の全ての画素に対して実行される。 In S145, the CPU 210 uses the tone curve TC to perform a conversion process on the pixel of interest Pt. This conversion process is performed unconditionally on the pixel of interest Pt, and is therefore performed on all pixels in the scanned image SI.

図6は、変換処理で用いられるトーンカーブTCの一例を示す図である。トーンカーブTCは、入力値Vinと出力値Voutとの対応関係を規定する一次元変換テーブルである。図6において、横軸は、ゼロから1023の範囲内で変化し得る入力値Vinを示し、縦軸は、出力値Voutを示している。入力値Vinは1024階調の値(10ビットの値)であるので、図6の閾値TH3は1024階調の値である。 Figure 6 shows an example of a tone curve TC used in the conversion process. The tone curve TC is a one-dimensional conversion table that defines the correspondence between the input value Vin and the output value Vout. In Figure 6, the horizontal axis indicates the input value Vin, which can vary within the range of zero to 1023, and the vertical axis indicates the output value Vout. Since the input value Vin is a value of 1024 gradations (a 10-bit value), the threshold value TH3 in Figure 6 is a value of 1024 gradations.

図中の破線L1は、階調数を1024階調から256階調に変換する対応関係を示すラインである。図中の破線L2は、閾値TH3以上の入力値(1024階調)を256階調の最大値(255)に変換し、閾値TH3未満の入力値(1024階調)を256階調の0~255の範囲に線形変換する対応関係を示すラインである。なお、図6に示すように、閾値TH3は、上述した閾値TH1よりも大きい。すなわち、破線L1は、1024階調から256階調への階調変換を示すラインである。破線L2は、閾値TH3以上の高明度範囲の値を最大値に変換する下地除去を示すラインである。図6に示すように、実線で示すトーンカーブTCは、階調変換と、下地除去と、ガンマ補正と、を行うためのトーンカーブである。 The dashed line L1 in the figure is a line showing the correspondence relationship for converting the number of gradations from 1024 to 256. The dashed line L2 in the figure is a line showing the correspondence relationship for converting an input value (1024 gradations) equal to or greater than the threshold value TH3 to the maximum value (255) of 256 gradations, and linearly converting an input value (1024 gradations) less than the threshold value TH3 to the range of 0 to 255 of 256 gradations. As shown in FIG. 6, the threshold value TH3 is greater than the above-mentioned threshold value TH1. That is, the dashed line L1 is a line showing the gradation conversion from 1024 gradations to 256 gradations. The dashed line L2 is a line showing the background removal for converting values in the high brightness range equal to or greater than the threshold value TH3 to the maximum value. As shown in FIG. 6, the tone curve TC shown by a solid line is a tone curve for performing gradation conversion, background removal, and gamma correction.

本実施例では、R値、G値、B値のためのトーンカーブTCがそれぞれ予め用意されてコンピュータプログラム222に組み込まれている。各トーンカーブTCにおいて、閾値TH3未満の入力範囲の曲線の形状が若干異なるが、閾値TH3以上の入力範囲の形状は同一である。CPU210は、注目画素PtのRGB値の各色成分の値(1024階調)を入力値Vinとして、対応するトーンカーブTCを参照して、出力値Voutを取得する。これによって、注目画素PtのRGB値は、256階調のRGB値に変換される。 In this embodiment, tone curves TC for R, G, and B values are prepared in advance and incorporated into the computer program 222. For each tone curve TC, the shape of the curve in the input range below the threshold TH3 is slightly different, but the shape of the input range above the threshold TH3 is the same. The CPU 210 uses the value of each color component of the RGB value of the pixel of interest Pt (1024 gradations) as the input value Vin, and references the corresponding tone curve TC to obtain the output value Vout. As a result, the RGB value of the pixel of interest Pt is converted into an RGB value with 256 gradations.

S150では、CPU210は、S135にて注目画素Ptの成分間差分値ΔV1、ΔV2が保存されているか否かを判断する。注目画素Ptの成分間差分値ΔV1、ΔV2が保存されている場合には(S150:YES)、S155にて、CPU210は、保存済みの成分間差分値ΔV1、ΔV2に基づいて、S145にて変換された後の256階調のRGB値を調整する。具体的には、CPU210は、注目画素Ptの変換後のRGB値の成分間差分値が、保存された成分間差分値(すなわち、変換前の成分間差分値ΔV1、ΔV2)と等しくなるように、注目画素Ptの変換後のRGB値を調整する。変換後(調整前)のRGB値の3個の色成分の値(R値、G値、B値)の最大値をVAmaxとすると、調整後のRGB値の3個の色成分の値の最大値VBmax、2番目の値VB2nd、最小値VBminは、以下の式で示される。 In S150, the CPU 210 determines whether the inter-component difference values ΔV1 and ΔV2 of the pixel of interest Pt have been saved in S135. If the inter-component difference values ΔV1 and ΔV2 of the pixel of interest Pt have been saved (S150: YES), in S155, the CPU 210 adjusts the 256-level RGB values converted in S145 based on the saved inter-component difference values ΔV1 and ΔV2. Specifically, the CPU 210 adjusts the converted RGB values of the pixel of interest Pt so that the inter-component difference values of the RGB values of the pixel of interest Pt after conversion are equal to the saved inter-component difference values (i.e., the inter-component difference values ΔV1 and ΔV2 before conversion). If the maximum value of the three color component values (R value, G value, B value) of the RGB value after conversion (before adjustment) is VAmax, the maximum value VBmax, the second value VB2nd, and the minimum value VBmin of the three color component values of the RGB value after adjustment are expressed by the following formulas.

VBmax=VAmax
VB2nd=VAmax-ΔV2
VBmin=VAmax-ΔV1
VBmax = VAmax
VB2nd = VAmax - ΔV2
VBmin=VAmax-ΔV1

注目画素Ptの成分間差分値ΔV1、ΔV2が保存されていない場合には(S150:NO)、CPU210は、S155をスキップする。 If the inter-component difference values ΔV1 and ΔV2 of the pixel of interest Pt have not been stored (S150: NO), the CPU 210 skips S155.

S160では、CPU210は、スキャン画像SI内の全ての画素を注目画素として処理したか否かを判断する。未処理の画素がある場合には(S160:NO)、CPU210は、S100に戻って、未処理の画素を次の注目画素として選択する。全ての画素が処理された場合には(S160:YES)、CPU210は、下地除去処理を終了する。 In S160, the CPU 210 determines whether all pixels in the scan image SI have been processed as pixels of interest. If there are unprocessed pixels (S160: NO), the CPU 210 returns to S100 and selects an unprocessed pixel as the next pixel of interest. If all pixels have been processed (S160: YES), the CPU 210 ends the background removal process.

図3(B)には、下地除去処理によって生成される処理済画像データによって示される処理済画像DIの一例が図示されている。図3(A)のスキャン画像SIの背景BGの色(例えば、白に近い薄いグレー)は、下地除去処理によって完全な白に変換されるので、図3(B)の処理済画像DIにおいて、背景BGsの色は白である。スキャン画像SIのマーカーMKの色は、下地除去処理によって白には変換されずに有彩色(例えば、薄い赤や緑)のまま維持されるので、処理済画像DIにおいて、マーカーMKの色はスキャン画像SIのマーカーMKと同様の有彩色である。同様に、スキャン画像SIの写真PCは薄い有彩色の部分を含み得るが、下地除去処理によって白には変換されずに有彩色のまま維持されるので、処理済画像DIにおいて、写真PCの色が部分的に変化することが抑制される。 Figure 3 (B) shows an example of a processed image DI shown by processed image data generated by the background removal process. The color of the background BG of the scanned image SI in Figure 3 (A) (e.g., a light gray close to white) is converted to completely white by the background removal process, so the color of the background BGs is white in the processed image DI in Figure 3 (B). The color of the marker MK in the scanned image SI is not converted to white by the background removal process but is maintained as a chromatic color (e.g., a light red or green), so in the processed image DI, the color of the marker MK is the same chromatic color as the marker MK in the scanned image SI. Similarly, the photo PC in the scanned image SI may include light chromatic parts, but the background removal process does not convert them to white but maintains them as a chromatic color, so that partial changes in the color of the photo PC in the processed image DI are suppressed.

図7、図8を参照して、さらに説明する。図7、図8は、下地除去処理におけるRGB値の一例を示す図である。下地除去処理において図4のS155のRGB値の調整が行われる調整条件は、以下の(1)、(2)が満たされることである。
(1)注目画素PtのR値、B値、G値のいずれも閾値TH1以上である(図4のS110)。換言すれば、注目画素Ptが高明度画素であること
(2)注目画素Ptの成分間差分値ΔV1、ΔV2の少なくとも1つが閾値TH2以上である(図4のS120)。換言すれば、注目画素Ptが有彩色画素であること
Further description will be made with reference to Fig. 7 and Fig. 8. Fig. 7 and Fig. 8 are diagrams showing an example of RGB values in the background removal process. In the background removal process, the adjustment condition for adjusting the RGB values in S155 of Fig. 4 is that the following (1) and (2) are satisfied.
(1) The R, B, and G values of the pixel of interest Pt are all equal to or greater than the threshold value TH1 (S110 in FIG. 4). In other words, the pixel of interest Pt is a high-brightness pixel. (2) At least one of the inter-component difference values ΔV1 and ΔV2 of the pixel of interest Pt is equal to or greater than the threshold value TH2 (S120 in FIG. 4). In other words, the pixel of interest Pt is a chromatic pixel.

さらに、注目画素Ptが上述の調整条件を満たす場合であっても、注目画素Ptがノイズ画素である場合には、S155のRGB値の調整は行われない。注目画素Ptがノイズ画素であると判定される条件は、以下の(3)の条件である。
(3)注目画素Ptの8個の周囲画素Pnの中に有彩色画素があること(図4のS130)。
Furthermore, even if the pixel of interest Pt satisfies the above-mentioned adjustment conditions, if the pixel of interest Pt is a noise pixel, the adjustment of the RGB values in S155 is not performed. The condition for determining that the pixel of interest Pt is a noise pixel is the following condition (3).
(3) There is a chromatic pixel among the eight surrounding pixels Pn of the pixel of interest Pt (S130 in FIG. 4).

このように、下地除去処理では、上述の(1)~(3)の条件が全て満たされる場合に、S155にてRGB値の調整が行われ、(1)~(3)の条件の少なくとも1つが満たされない場合には、RGB値の調整は行われない。 In this way, in the background removal process, if all of the above conditions (1) to (3) are met, the RGB values are adjusted in S155, and if at least one of the conditions (1) to (3) is not met, the RGB values are not adjusted.

図7(A)は、図4のS155のRGB値の調整を行わない例である。注目画素PtのRGB値の初期値(図7(A1))は、薄いグレーを示す。この例では、注目画素PtのRGB値の初期値(図7(A1))において、R値、B値、G値は、いずれも閾値TH1よりも大きい。したがって、この例では、図4のS110にて注目画素Ptは高明度画素であると判断される(S110にてYES)。この例では、注目画素PtのRGB値(256階調に正規化後)において、成分間差分値ΔV1、ΔV2はいずれも閾値TH1未満である。したがって、この例では、図4のS120にて注目画素Ptは無彩色画素であると判断される(S120にてNO)。このために、図7(A)の例では、注目画素Ptの変換後のRGB値は、図4のS155の調整の対象とはされない。 Fig. 7(A) is an example in which the RGB value adjustment of S155 in Fig. 4 is not performed. The initial values of the RGB values of the pixel of interest Pt (Fig. 7(A1)) are light gray. In this example, the R value, B value, and G value of the initial values of the RGB values of the pixel of interest Pt (Fig. 7(A1)) are all greater than the threshold value TH1. Therefore, in this example, the pixel of interest Pt is determined to be a high-brightness pixel in S110 in Fig. 4 (YES in S110). In this example, in the RGB values of the pixel of interest Pt (after normalization to 256 gradations), the inter-component difference values ΔV1 and ΔV2 are all less than the threshold value TH1. Therefore, in this example, the pixel of interest Pt is determined to be an achromatic pixel in S120 in Fig. 4 (NO in S120). For this reason, in the example of Fig. 7(A), the converted RGB values of the pixel of interest Pt are not subject to adjustment in S155 in Fig. 4.

このために、図7(A)の例では、注目画素Ptの色は、S145の変換処理によって、薄いグレーから完全な白(例えば、RGB=(255、255、255))に変換され(図7(A3))、その後の調整は行われない。例えば、上述したスキャン画像SIの背景BGを構成する画素に対する下地除去処理は、図7(A)の例に示す処理となる。 For this reason, in the example of FIG. 7(A), the color of the pixel of interest Pt is converted from light gray to completely white (for example, RGB=(255, 255, 255)) by the conversion process of S145 (FIG. 7(A3)), and no further adjustment is made. For example, the background removal process for the pixels that make up the background BG of the above-mentioned scanned image SI is the process shown in the example of FIG. 7(A).

図7(B)は、図4のS155のRGB値の調整を行う例である。注目画素PtのRGB値の初期値(図7(B1))は、薄い有彩色を示す。この例では、注目画素PtのRGB値の初期値(図7(B1))において、R値、B値、G値は、いずれも閾値TH1よりも大きい。したがって、この例では、図4のS110にて注目画素Ptは高明度画素であると判断される(S110にてYES)。この例では、注目画素PtのRGB値(256階調に正規化後)において、成分間差分値ΔV1、ΔV2は閾値TH2以上である。したがって、この例では、図4のS120にて注目画素Ptは有彩色画素であると判断される(S120にてYES)。このために、図7(B)の例では、注目画素Ptがノイズ画素ではないことを条件に、注目画素Ptの変換後のRGB値は、図4のS155の調整の対象とされる。 Figure 7 (B) is an example of adjusting the RGB values in S155 of Figure 4. The initial values of the RGB values of the pixel of interest Pt (Figure 7 (B1)) indicate a light chromatic color. In this example, in the initial values of the RGB values of the pixel of interest Pt (Figure 7 (B1)), the R value, the B value, and the G value are all greater than the threshold value TH1. Therefore, in this example, the pixel of interest Pt is determined to be a high-brightness pixel in S110 of Figure 4 (YES in S110). In this example, in the RGB values of the pixel of interest Pt (after normalization to 256 gradations), the inter-component difference values ΔV1 and ΔV2 are greater than or equal to the threshold value TH2. Therefore, in this example, the pixel of interest Pt is determined to be a chromatic pixel in S120 of Figure 4 (YES in S120). For this reason, in the example of FIG. 7B, provided that the pixel of interest Pt is not a noise pixel, the converted RGB values of the pixel of interest Pt are subject to adjustment in S155 of FIG. 4.

このために、図7(B)の例では、注目画素Ptの色は、S145の変換処理によって、有彩色から完全な白(例えば、RGB=(255、255、255))に変換され(図7(B3))、その後に調整が行われる。すなわち、図4のS155にて、注目画素PtのRGB値は、変換前の成分間差分値ΔV1、ΔV2を維持するように調整される(図7(B4))。したがって、最終的に注目画素Ptの色は、下地除去処理前と同様の有彩色に維持される。 For this reason, in the example of FIG. 7(B), the color of the pixel of interest Pt is converted from a chromatic color to completely white (e.g., RGB=(255, 255, 255)) by the conversion process of S145 (FIG. 7(B3)), and then adjustment is performed. That is, in S155 of FIG. 4, the RGB values of the pixel of interest Pt are adjusted so as to maintain the inter-component difference values ΔV1, ΔV2 before the conversion (FIG. 7(B4)). Therefore, the color of the pixel of interest Pt is ultimately maintained as a chromatic color, the same as before the background removal process.

図8は、図7(B)と同様に、図4のS155のRGB値の調整を行う例である。注目画素PtのRGB値の初期値(図8(A))は、薄い有彩色を示す。この例では、注目画素PtのRGB値の初期値(図8(A))において、R値、B値、G値は、いずれも閾値TH1よりも大きい。したがって、この例では、図4のS110にて注目画素Ptは高明度画素であると判断される(S110にてYES)。この例では、注目画素PtのRGB値(256階調に正規化後)において、成分間差分値ΔV1は閾値TH2以上である。したがって、この例では、図4のS120にて注目画素Ptは有彩色画素であると判断される(S120にてYES)。なお、図8の例では、G値とB値とが等しいので、成分間差分値ΔV2はゼロである。したがって、図8の例では、注目画素Ptがノイズ画素ではないことを条件に、注目画素Ptの変換後のRGB値は、図4のS155の調整の対象とされる。 Figure 8 is an example of adjusting the RGB values in S155 of Figure 4, similar to Figure 7 (B). The initial values of the RGB values of the pixel of interest Pt (Figure 8 (A)) indicate a light chromatic color. In this example, the R value, B value, and G value in the initial values of the RGB values of the pixel of interest Pt (Figure 8 (A)) are all greater than the threshold value TH1. Therefore, in this example, the pixel of interest Pt is determined to be a high-brightness pixel in S110 of Figure 4 (YES in S110). In this example, in the RGB values of the pixel of interest Pt (after normalization to 256 gradations), the component difference value ΔV1 is greater than or equal to the threshold value TH2. Therefore, in this example, the pixel of interest Pt is determined to be a chromatic pixel in S120 of Figure 4 (YES in S120). In the example of Figure 8, the G value and the B value are equal, so the component difference value ΔV2 is zero. Therefore, in the example of FIG. 8, provided that the pixel of interest Pt is not a noise pixel, the converted RGB values of the pixel of interest Pt are subject to adjustment in S155 of FIG. 4.

このために、図8の例では、注目画素Ptの色は、S145の変換処理によって、有彩色から白に近い色値に変換され(図8(C))、その後に調整が行われる。ここで、変換処理によって、完全な白に変換されていないのは、注目画素Ptの変換前のR値が閾値TH3未満であるためである(図8(A))。例えば、図4のS155にて、注目画素PtのRGB値は、変換前の成分間差分値ΔV1、ΔV2を維持するように調整される(図8(D))。したがって、最終的に注目画素Ptの色は、下地除去処理前と同様の有彩色に維持される。 For this reason, in the example of Figure 8, the color of the pixel of interest Pt is converted from a chromatic color to a color value close to white by the conversion process of S145 (Figure 8 (C)), and then adjustment is performed. Here, the conversion process does not convert the pixel of interest Pt to completely white because the R value of the pixel of interest Pt before conversion is less than the threshold value TH3 (Figure 8 (A)). For example, in S155 of Figure 4, the RGB values of the pixel of interest Pt are adjusted so as to maintain the inter-component difference values ΔV1 and ΔV2 before conversion (Figure 8 (D)). Therefore, the color of the pixel of interest Pt is ultimately maintained as a chromatic color, similar to that before the background removal process.

例えば、上述したスキャン画像SIのマーカーMKを構成する画素に対する下地除去処理や、写真PC内の薄い有彩色の部分を構成する画素に対する下地除去処理は、図7(B)や図8の例に示す処理となる。 For example, the background removal process for the pixels that make up the marker MK in the above-mentioned scanned image SI, and the background removal process for the pixels that make up the light chromatic color parts in the photo PC, are the processes shown in the examples of Figures 7 (B) and 8.

以上説明した本実施例では、CPU210は、対象画像データとしてのスキャンデータを取得する(図2のS10)。CPU210は、スキャンデータによって示されるスキャン画像SI内の注目画素Ptが特定の調整条件を満たすか否かを判断する(図4のS110、S120、S130)。特定の調整条件は、注目画素Ptが、第1基準以上の明るさを有し(S110)、かつ、第2基準以上の彩度を有する(S130)ことを含む。CPU210は、スキャンデータに対して補正処理を実行して、処理済画像DI(図3(B))を示す処理済画像データを生成する。この補正処理は、注目画素Ptに対する特定の変換処理(図4のS145)を含む。特定の変換処理は、注目画素Ptが第3基準以上の明るさ(閾値TH3以上の明るさ)を有する場合に注目画素Ptの色が特定の高明度色(本実施例では白)になるように、注目画素Ptの値を変換する処理である。補正処理は、さらに、変換処理前の注目画素Ptが上述の特定の調整条件を満たす場合に、変換処理前の注目画素Ptの値を用いて、変換処理済みの注目画素Ptの値を調整する調整処理(図4のS155)と、を含む。この結果、本実施例によれば、下地除去処理にて、変換処理が行われるので、処理済画像DIにおいて、第3基準以上の明るさを有する下地の色(例えば、背景BGの色)を適切に変換できる。例えば、下地の色を白に変換するいわゆる下地除去を適切に実現できる。さらに、下地除去処理では、変換処理前の注目画素Ptが特定の調整条件を満たす場合に、変換処理前の注目画素Ptの値を用いて、変換処理済みの注目画素Ptの値が調整されるので、処理済画像DIにおいて、第1基準以上の明るさを有し、かつ、第2基準以上の彩度を有する明るい色の再現性を向上できる。したがって、処理済画像DIにおいて、明るい色の再現と、下地の色の変換と、を両立できる。 In the present embodiment described above, the CPU 210 acquires scan data as target image data (S10 in FIG. 2). The CPU 210 determines whether or not the pixel of interest Pt in the scan image SI indicated by the scan data satisfies a specific adjustment condition (S110, S120, S130 in FIG. 4). The specific adjustment condition includes that the pixel of interest Pt has a brightness equal to or greater than a first standard (S110) and a saturation equal to or greater than a second standard (S130). The CPU 210 executes a correction process on the scan data to generate processed image data indicating the processed image DI (FIG. 3(B)). This correction process includes a specific conversion process (S145 in FIG. 4) for the pixel of interest Pt. The specific conversion process is a process of converting the value of the pixel of interest Pt so that the color of the pixel of interest Pt becomes a specific high-brightness color (white in this embodiment) when the pixel of interest Pt has a brightness equal to or greater than a third standard (brightness equal to or greater than a threshold value TH3). The correction process further includes an adjustment process (S155 in FIG. 4) in which, if the pixel of interest Pt before the conversion process satisfies the above-mentioned specific adjustment condition, the value of the pixel of interest Pt after the conversion process is adjusted using the value of the pixel of interest Pt before the conversion process. As a result, according to this embodiment, since the conversion process is performed in the background removal process, the color of the background (e.g., the color of the background BG) having a brightness equal to or higher than the third standard can be appropriately converted in the processed image DI. For example, so-called background removal, which converts the color of the background to white, can be appropriately realized. Furthermore, in the background removal process, if the pixel of interest Pt before the conversion process satisfies the specific adjustment condition, the value of the pixel of interest Pt after the conversion process is adjusted using the value of the pixel of interest Pt before the conversion process, so that the reproducibility of bright colors having a brightness equal to or higher than the first standard and a saturation equal to or higher than the second standard can be improved in the processed image DI. Therefore, in the processed image DI, it is possible to achieve both reproduction of bright colors and conversion of the color of the background.

図9は、比較例の処理済画像DIxの一例を示す図である。この処理済画像DIxは、比較例の下地除去処理を用いて生成される。比較例の下地除去処理は、全ての画素に対して、実施例のS145の変換処理のみを実行する処理であり、図4のS155のRGB値の調整を実行しない。この場合には、処理済画像DIxにおいて、背景BGsが白色に変換されるとともに、マーカーMKや写真PCの薄い有彩色を有する部分も白色に変換されてしまう。このために、比較例の処理済画像DIxでは、マーカーMKが消失しているとともに、写真PCの薄い有彩色が白色に変化している。下地除去処理にて一度消失した色は、その後の画像処理(例えば、図2のS30の画質調整処理)によって復活させることは困難である。本実施例によれば、比較例とは異なり、処理済画像においても再現されるべきオブジェクトであるマーカーMKや写真PCの一部が消失する不具合や大幅に異なる色に変化する不具合を抑制することができる。ひいては、下地の色を適切に変換しつつも、処理済画像DIにて表現される色の範囲(特に、高明度の薄い色の範囲)が狭くなることを抑制して、処理済画像DIの画質を向上することができる。 9 is a diagram showing an example of a processed image DIx of the comparative example. This processed image DIx is generated using the background removal process of the comparative example. The background removal process of the comparative example is a process in which only the conversion process of S145 of the embodiment is performed on all pixels, and the adjustment of the RGB values of S155 of FIG. 4 is not performed. In this case, in the processed image DIx, the background BGs is converted to white, and the marker MK and the light chromatic parts of the photo PC are also converted to white. For this reason, in the processed image DIx of the comparative example, the marker MK has disappeared, and the light chromatic colors of the photo PC have changed to white. It is difficult to restore a color that has disappeared once in the background removal process by subsequent image processing (for example, the image quality adjustment process of S30 in FIG. 2). According to this embodiment, unlike the comparative example, it is possible to suppress the defect that a part of the marker MK or the photo PC, which is an object that should be reproduced in the processed image, disappears or changes to a significantly different color. In addition, while appropriately converting the background color, the range of colors represented in the processed image DI (especially the range of light, high-brightness colors) is prevented from narrowing, improving the image quality of the processed image DI.

さらに、本実施例によれば、図4のS155の調整処理は、変換処理前の注目画素Ptの成分間差分値ΔV1、ΔV2に基づいて、変換処理済みの注目画素Ptの成分間差分値を調整する処理である(図7(B)、図8)。この結果、変換処理済みの注目画素Ptの成分間差分値を適切に調整できるので、例えば、処理済画像DIにおいて、明るい色の色成分の差分が過度に小さくなることを抑制できる。したがって、例えば、処理済画像DIにおいて、明るい色の色味が失われることを抑制できる。例えば、マーカーMKの色が、S145の変換処理によって消失したとしても、変換処理前の成分間差分値ΔV1、ΔV2を保存して(図4のS135)、S155にて、該成分間差分値ΔV1、ΔV2に基づいてマーカーMKの色味を適切に再現することができる。 Furthermore, according to this embodiment, the adjustment process of S155 in FIG. 4 is a process of adjusting the inter-component difference value of the converted pixel of interest Pt based on the inter-component difference values ΔV1 and ΔV2 of the pixel of interest Pt before the conversion process (FIGS. 7B and 8). As a result, the inter-component difference value of the pixel of interest Pt after the conversion process can be appropriately adjusted, so that, for example, in the processed image DI, the difference of the light color component can be prevented from becoming excessively small. Therefore, for example, in the processed image DI, the loss of the color tone of the light color can be prevented. For example, even if the color of the marker MK is lost by the conversion process of S145, the inter-component difference values ΔV1 and ΔV2 before the conversion process can be saved (S135 in FIG. 4), and the color tone of the marker MK can be appropriately reproduced in S155 based on the inter-component difference values ΔV1 and ΔV2.

さらに、本実施例によれば、図4のS145の変換処理は、RGB表色系の各色成分の階調数を、第1の階調数(本実施例では1024階調)から、第1の階調数よりも小さな第2の階調数(本実施例では256階調)に変換する処理を含む(図6)。図4のS155の調整処理は、変換処理前の注目画素Ptの成分間差分値ΔV1、ΔV2を第2の階調数(256階調)で示す値(上述の式(1)、(2))と等しくなるように、変換処理済みの注目画素Ptの成分間差分を調整する処理である(図7(B)、図8)。この結果、処理済画像DIにおいて、スキャン画像SIにおける明るい色を示す画素の成分間差分値が、処理済画像DIにおいても維持されるので、処理済画像DIにおいて明るい色の色味をスキャン画像SIの色味と同等に維持できる。 Furthermore, according to this embodiment, the conversion process of S145 in FIG. 4 includes a process of converting the number of gradations of each color component of the RGB color system from the first number of gradations (1024 gradations in this embodiment) to a second number of gradations (256 gradations in this embodiment) smaller than the first number of gradations (FIG. 6). The adjustment process of S155 in FIG. 4 is a process of adjusting the inter-component difference of the target pixel Pt after the conversion process so that the inter-component difference values ΔV1 and ΔV2 of the target pixel Pt before the conversion process are equal to the values indicated by the second number of gradations (256 gradations) (the above-mentioned formulas (1) and (2)) (FIGS. 7(B) and 8). As a result, in the processed image DI, the inter-component difference values of pixels indicating bright colors in the scanned image SI are also maintained in the processed image DI, so that the color of bright colors in the processed image DI can be maintained equivalent to the color of the scanned image SI.

さらに、本実施例によれば、CPU210は、注目画素Ptの複数個の色成分のそれぞれの値(本実施例では、R値、G値、B値)が閾値TH1よりも高明度側の値(本実施例では最大値側の値)である場合に、注目画素Ptは第1基準以上の明るさを有すると判断する(図4のS110)。この結果、複数個の色成分の値に基づいて、特定の調整条件を満たすか否かを適切に判断できる。 Furthermore, according to this embodiment, when the values of the multiple color components of the target pixel Pt (in this embodiment, the R value, the G value, and the B value) are higher in brightness than the threshold value TH1 (in this embodiment, the maximum value), the CPU 210 determines that the target pixel Pt has a brightness equal to or higher than the first standard (S110 in FIG. 4). As a result, it is possible to appropriately determine whether or not a specific adjustment condition is satisfied based on the values of the multiple color components.

さらに、本実施例によれば、CPU210は、注目画素Ptの少なくとも一つの成分間差分値(ΔV1、ΔV2のうちの少なくとも1つ)が閾値TH2以上である場合に、注目画素Ptは第2基準以上の彩度を有すると判断する(図4のS120)。この結果、成分間差分値ΔV1、ΔV2に基づいて、特定の調整条件を満たすか否かを適切に判断できる。 Furthermore, according to this embodiment, when at least one inter-component difference value (at least one of ΔV1 and ΔV2) of the pixel of interest Pt is equal to or greater than the threshold value TH2, the CPU 210 determines that the pixel of interest Pt has a saturation equal to or greater than the second standard (S120 in FIG. 4). As a result, it is possible to appropriately determine whether or not a specific adjustment condition is satisfied based on the inter-component difference values ΔV1 and ΔV2.

さらに、本実施例によれば、上述のように図4のS145の変換処理は、RGB表色系の各色成分の階調数を、第1の階調数(本実施例では1024階調)から、第1の階調数よりも小さな第2の階調数(本実施例では256階調)に変換する処理を含む(図6)。そして、CPU210は、注目画素Ptの少なくとも一つの成分間差分値を第2の階調数で示す値が閾値TH2以上である場合に、注目画素Ptは第2基準以上の彩度を有すると判断する(図4のS120)。この結果、階調数の変換を考慮した上で、成分間差分値ΔV1、ΔV2に基づいて、特定の調整条件を満たすか否かを適切に判断できる。 Furthermore, according to this embodiment, as described above, the conversion process of S145 in FIG. 4 includes a process of converting the number of gradations of each color component of the RGB color system from a first number of gradations (1024 gradations in this embodiment) to a second number of gradations (256 gradations in this embodiment) that is smaller than the first number of gradations (FIG. 6). Then, when the value of at least one inter-component difference value of the target pixel Pt expressed in the second number of gradations is equal to or greater than the threshold value TH2, the CPU 210 determines that the target pixel Pt has a saturation equal to or greater than the second standard (S120 in FIG. 4). As a result, it is possible to appropriately determine whether or not a specific adjustment condition is satisfied based on the inter-component difference values ΔV1 and ΔV2, taking into account the conversion of the number of gradations.

さらに、本実施例では、CPU210は、注目画素Ptがノイズを示すノイズ画素であるか否かを判定する(図4のS130)。本実施例の下地除去処理では、S145の変換処理前の注目画素Ptがノイズ画素であると判定される場合には、特定の調整条件を満たすか否かに関わらず、ノイズ画素に対して調整処理を実行しない(S130にてNO)。ノイズ画素は、処理済画像DIにおいて再現する必要性がなく、処理済画像DIにおいてノイズ画素が目立つと処理済画像DIの画質が低下する。ノイズ画素に対して調整処理を実行すると、処理済画像DIにおいてノイズが目立つ可能性がある。本実施例によれば、ノイズ画素に対して調整処理を実行しないので、処理済画像DIにおいてノイズが目立つことを抑制できる。 Furthermore, in this embodiment, the CPU 210 determines whether the pixel of interest Pt is a noise pixel that indicates noise (S130 in FIG. 4). In the background removal process of this embodiment, if the pixel of interest Pt before the conversion process of S145 is determined to be a noise pixel, regardless of whether the specific adjustment condition is satisfied, no adjustment process is performed on the noise pixel (NO in S130). Noise pixels do not need to be reproduced in the processed image DI, and if noise pixels stand out in the processed image DI, the image quality of the processed image DI decreases. If adjustment process is performed on noise pixels, there is a possibility that noise will stand out in the processed image DI. According to this embodiment, adjustment process is not performed on noise pixels, so it is possible to prevent noise from being noticeable in the processed image DI.

さらに、本実施例では、CPU210は、ノイズ画素の値を、ノイズ画素の周囲に位置する周囲画素の値に基づいて決定される値(本実施例では、周囲画素PnのRGB値の平均値)に変更する(図4のS140)。上記構成によれば、処理済画像DIにおいてノイズが目立つことをさらに抑制できる。 Furthermore, in this embodiment, the CPU 210 changes the value of the noise pixel to a value determined based on the values of the surrounding pixels located around the noise pixel (in this embodiment, the average value of the RGB values of the surrounding pixels Pn) (S140 in FIG. 4). With the above configuration, it is possible to further prevent noise from being noticeable in the processed image DI.

さらに、本実施例では、CPU210は、特定の調整条件(上述の条件(1)、(2))を満たすと判断される注目画素Pt、すなわち、S110にてYES、かつ、S120にてYESと判断される注目画素Ptに対してノイズ画素であるか否かを判定する(図4のS130)。この判定では、CPU210は、注目画素Ptの周囲の所定範囲内の周囲画素Pn(図5)の中に、特定の調整条件の少なくとも一部(本実施例では上述の条件(2))を満たす基準個数(本実施例では1個)以上の画素が存在するか否かを判定する(図4のS130)。そして、CPU210は、該特定の調整条件を満たす基準個数以上の画素が存在しない場合に、注目画素Ptはノイズ画素であると判定する。特定の調整条件を満たすと判断される画素がノイズ画素でない場合には、その画素は、ある程度の大きさのオブジェクトを構成していると考えられる。このために、ノイズ画素でない場合には、その画素の周囲には、その画素と同様の色味を有する画素(例えば、有彩色画素)が存在する可能性が高い。このために、本実施例によれば、周囲の所定範囲内の画素に基づいて、注目画素Ptがノイズ画素であるか否かを適切に判定できる。 Furthermore, in this embodiment, the CPU 210 judges whether or not the pixel of interest Pt that is judged to satisfy the specific adjustment condition (conditions (1) and (2) described above), i.e., the pixel of interest Pt that is judged to satisfy YES in S110 and YES in S120, is a noise pixel (S130 in FIG. 4). In this judgment, the CPU 210 judges whether or not there are a reference number (one in this embodiment) or more pixels that satisfy at least a part of the specific adjustment condition (condition (2) described above in this embodiment) among the surrounding pixels Pn (FIG. 5) within a predetermined range around the pixel of interest Pt (S130 in FIG. 4). Then, if there are no pixels that satisfy the reference number or more of the specific adjustment condition, the CPU 210 judges that the pixel of interest Pt is a noise pixel. If a pixel that is judged to satisfy the specific adjustment condition is not a noise pixel, it is considered that the pixel constitutes an object of a certain size. For this reason, if the pixel is not a noise pixel, there is a high possibility that there are pixels (for example, chromatic pixels) that have a similar color to the pixel of interest around the pixel of interest Pt. Therefore, according to this embodiment, it is possible to appropriately determine whether or not the pixel of interest Pt is a noise pixel based on the pixels within a specified range surrounding it.

さらに、本実施例の下地除去処理は、コピー処理の一部として実行される。このために、本実施例では、CPU210は、処理済画像データを用いて、処理済画像を印刷するための印刷データを生成する(図2のS40)。コピー処理の場合には、背景BGが白に適切に変換されずに、例えば、背景BGのムラやノイズなどが処理済画像DIに残存していると、残存したムラやノイズが用紙に印刷される。この場合には、印刷される画像の画質が低下することに加えて、ムラやノイズを印刷するために印刷材が消費されるので印刷材の無駄が発生する。このために、コピー処理では、下地除去処理において、例えば、上述の閾値TH3(図6)を比較的低い値に設定して、比較的広い範囲のRGB値を白に変換する必要性が高い。このために、上述した比較例の下地除去処理が行われる場合には、マーカーMKなどの薄い有彩色が消失する可能性が高くなる。これに対して、本実施例によれば、コピー処理の場合であっても、背景BGを適切に白に変換しつつ、薄い有彩色が消失する不具合や大幅に異なる色に変化する不具合を抑制することができる。 Furthermore, the background removal process of this embodiment is executed as a part of the copy process. For this reason, in this embodiment, the CPU 210 uses the processed image data to generate print data for printing the processed image (S40 in FIG. 2). In the case of the copy process, if the background BG is not properly converted to white and, for example, unevenness or noise of the background BG remains in the processed image DI, the remaining unevenness or noise is printed on the paper. In this case, in addition to the deterioration of the image quality of the printed image, printing material is consumed to print the unevenness and noise, so that printing material is wasted. For this reason, in the copy process, it is highly necessary to set the above-mentioned threshold value TH3 (FIG. 6) to a relatively low value in the background removal process and convert a relatively wide range of RGB values to white. For this reason, when the background removal process of the comparative example described above is performed, there is a high possibility that light chromatic colors such as the marker MK will disappear. In contrast, according to this embodiment, even in the case of the copy process, the background BG can be properly converted to white while suppressing the defect of the light chromatic color disappearing or changing to a significantly different color.

さらに、本実施例では、図6に示すように、S110にて調整条件の判断に用いられる閾値TH1は、S145の変換処理における閾値TH3よりも小さな値(低明度側の値)に設定されている。この結果、S145の変換処理において完全な白に変換される色だけでなく、比較的広い範囲の薄い色の画素を、S155の調整の対象とすることができる。したがって、S145の変換処理によって完全な白には変換されないが、彩度や色相が大幅に変化してしまう色についても、適切に調整することができるので、処理済画像DIにおいて、このような色の再現性を向上することができる。 Furthermore, in this embodiment, as shown in FIG. 6, the threshold value TH1 used to determine the adjustment conditions in S110 is set to a smaller value (lower brightness value) than the threshold value TH3 in the conversion process of S145. As a result, not only colors that are converted to completely white in the conversion process of S145, but also pixels of light colors over a relatively wide range can be subject to adjustment in S155. Therefore, colors that are not converted to completely white by the conversion process of S145 but whose saturation or hue changes significantly can also be appropriately adjusted, thereby improving the reproducibility of such colors in the processed image DI.

B.変形例:
(1)上記実施例では、S110にて調整条件の判断に用いられる閾値TH1は、S145の変換処理における閾値TH3よりも小さな値に設定されている。これに代えて、閾値TH1は、閾値TH3と同じ値であっても良い。この場合には、S145の変換処理にて、完全な白に変換される画素のみが、S155の調整の対象とされる。
B. Variations:
(1) In the above embodiment, the threshold value TH1 used in determining the adjustment condition in S110 is set to a value smaller than the threshold value TH3 in the conversion process in S145. Alternatively, the threshold value TH1 may be the same value as the threshold value TH3. In this case, only pixels that are converted to completely white in the conversion process in S145 are subject to the adjustment in S155.

(2)上記実施例では、図4のS110にて、CPU210は、注目画素Ptの成分間差分値ΔV1、ΔV2のうち少なくとも一つの値が閾値TH2以上である場合に、注目画素Ptが第2基準以上の彩度を有すると判断している。これに限らず、他の方法を用いて注目画素Ptが第2基準以上の彩度を有するか否かを判断しても良い。例えば、CPU210は、注目画素PtのRGB値を用いて、所定の算出式に従って、注目画素Ptの彩度を算出し、該彩度が所定の閾値以上である場合に、注目画素Ptが第2基準以上の彩度を有すると判断しても良い。 (2) In the above embodiment, in S110 of FIG. 4, the CPU 210 determines that the pixel of interest Pt has a saturation equal to or greater than the second reference if at least one of the inter-component difference values ΔV1, ΔV2 of the pixel of interest Pt is equal to or greater than the threshold value TH2. This is not a limitation, and other methods may be used to determine whether the pixel of interest Pt has a saturation equal to or greater than the second reference. For example, the CPU 210 may use the RGB values of the pixel of interest Pt to calculate the saturation of the pixel of interest Pt according to a predetermined calculation formula, and determine that the pixel of interest Pt has a saturation equal to or greater than the second reference if the saturation is equal to or greater than a predetermined threshold.

(3)上記実施例では、図4のS135にて、変換処理前の注目画素Ptの成分間差分値ΔV1、ΔV2を保存し、S155にて、CPU210は、成分間差分値ΔV1、ΔV2に基づいて、変換処理済みの注目画素PtのRGB値を調整している。これに代えて、他の方法を用いて、変換処理済みの注目画素PtのRGB値を調整しても良い。例えば、CPU210は、変換処理前の注目画素PtのRGB値を、彩度(S値)、色相(H値)、輝度(V値)を成分とするHSB表色系の色値に変換する。そして、CPU210は、変換処理前の注目画素PtのS値とH値とを用いて、変換処理済みの注目画素PtのRGB値を、変換処理前の注目画素Ptの彩度と色相と同一または近似した彩度と色相を有するように調整しても良い。 (3) In the above embodiment, in S135 of FIG. 4, the inter-component difference values ΔV1 and ΔV2 of the pixel of interest Pt before the conversion process are stored, and in S155, the CPU 210 adjusts the RGB values of the pixel of interest Pt after the conversion process based on the inter-component difference values ΔV1 and ΔV2. Alternatively, the RGB values of the pixel of interest Pt after the conversion process may be adjusted using other methods. For example, the CPU 210 converts the RGB values of the pixel of interest Pt before the conversion process into color values of the HSB color system, whose components are saturation (S value), hue (H value), and luminance (V value). Then, the CPU 210 may use the S value and H value of the pixel of interest Pt before the conversion process to adjust the RGB values of the pixel of interest Pt after the conversion process so that they have the same or similar saturation and hue as the pixel of interest Pt before the conversion process.

(4)上記実施例では、CPU210は、1024階調(10ビット)のRGB値と1024階調の閾値TH1とを用いて、S110の判断を実行し、256階調(8ビット)の成分間差分値ΔV1、ΔV2と256階調の閾値TH2とを用いて、S120の判断を実行する。これに代えて、例えば、CPU210は、S110の前に、注目画素のRGB値を1024階調から256階調に変換し、256階調のRGB値と256階調の閾値TH1、TH2とを用いてS110の判断やS120の判断を実行しても良い。あるいは、CPU210は、S105~S155までの処理を1024階調のRGB値を用いて実行し、S155の後に、注目画素PtのRGB値を1024階調から256階調に変換しても良い。 (4) In the above embodiment, the CPU 210 executes the determination in S110 using 1024-level (10-bit) RGB values and a 1024-level threshold TH1, and executes the determination in S120 using 256-level (8-bit) inter-component difference values ΔV1, ΔV2 and a 256-level threshold TH2. Alternatively, for example, the CPU 210 may convert the RGB values of the pixel of interest from 1024 to 256 gradations before S110, and execute the determination in S110 and the determination in S120 using the 256-level RGB values and the 256-level thresholds TH1, TH2. Alternatively, the CPU 210 may execute the processes from S105 to S155 using 1024-level RGB values, and execute the determination in S155 by converting the RGB values of the pixel of interest Pt from 1024 to 256 gradations.

(5)上記実施例では、図4のS130にて、CPU210は、成分間差分値ΔV1、ΔV2のうち少なくとも一つの値が閾値TH2以上である周囲画素Pnが存在しない場合に、注目画素Ptはノイズ画素であると判定している。これに限らず、他の方法を用いて、注目画素Ptがノイズ画素であるか否かが判定されても良い。例えば、CPU210は、注目画素Ptの周囲に注目画素Ptと類似する色を有する画素が存在しない場合に、注目画素Ptはノイズ画素であると判定しても良い。 (5) In the above embodiment, in S130 of FIG. 4, the CPU 210 determines that the pixel of interest Pt is a noise pixel if there is no surrounding pixel Pn for which at least one of the inter-component difference values ΔV1, ΔV2 is equal to or greater than the threshold value TH2. This is not limiting, and other methods may be used to determine whether the pixel of interest Pt is a noise pixel. For example, the CPU 210 may determine that the pixel of interest Pt is a noise pixel if there is no pixel around the pixel of interest Pt that has a color similar to that of the pixel of interest Pt.

(6)上記実施例の下地除去処理は一例であり、適宜に変形され得る。例えば、図4のS140は省略されても良い。また、図4のS140に加えて、S125、S135を省略し、注目画素Ptの少なくとも1つの成分間差分値が閾値TH2以上である場合には(S120:YES)、CPU210はS135に処理を進めても良い。 (6) The background removal process in the above embodiment is an example and may be modified as appropriate. For example, S140 in FIG. 4 may be omitted. Also, in addition to S140 in FIG. 4, S125 and S135 may be omitted, and if at least one inter-component difference value of the target pixel Pt is equal to or greater than the threshold value TH2 (S120: YES), the CPU 210 may proceed to S135.

(7)上記実施例の下地除去処理は、コピー処理の一部として実行される。これに代えて、処理済画像DIを示すスキャンデータを保存用に生成するために、図4の下地除去処理が実行されても良い。あるいは、処理済画像DIを液晶パネルなどの表示装置に表示するために、図4の下地除去処理が実行されても良い。 (7) The background removal process in the above embodiment is executed as part of the copy process. Alternatively, the background removal process in FIG. 4 may be executed to generate scan data representing the processed image DI for storage. Alternatively, the background removal process in FIG. 4 may be executed to display the processed image DI on a display device such as an LCD panel.

(8)上記実施例では、対象画像データは、スキャンデータである。これに代えて、対象画像データは、二次元イメージセンサを備えるデジタルカメラによって原稿を撮影することによって生成される画像データであっても良い。 (8) In the above embodiment, the target image data is scan data. Alternatively, the target image data may be image data generated by photographing an original document with a digital camera equipped with a two-dimensional image sensor.

(9)複合機200のCPU210によるコピー処理の全部または一部は、他の装置、例えば、スキャナやプリンタに接続されたパーソナルコンピュータのCPUによって実行されても良い。また、下地除去処理が処理済画像DIを示すスキャンデータを保存用に生成するために実行される場合には、該下地除去処理は、スキャナのCPUによって実行されても良い。また、下地除去処理は、複合機200やスキャナと通信可能に接続されたクラウドサーバによって実行されても良い。この場合には、例えば、クラウドサーバは、複合機200やスキャナからスキャンデータを受信して、図4の下地除去処理を実行して処理済画像データを生成する。クラウドサーバは、生成した処理済画像データを複合機200やスキャナに送信する。一般的には、図4の下地除去処理を実行する画像処理装置は、複合機、プリンタ、デジタルカメラ、スキャナなどの画像関連機器の内部のコンピュータ、汎用のパーソナルコンピュータ、ネットワークに接続されたサーバ等のいずれであっても良い。また、ネットワークを介して互いに通信可能な複数のコンピュータが分担して、全体として下地除去処理を実行しても良い。この場合、複数のコンピュータの全体が、請求項における画像処理装置に対応する。 (9) All or part of the copy process by the CPU 210 of the multifunction device 200 may be executed by the CPU of another device, for example, a personal computer connected to a scanner or printer. In addition, when the background removal process is executed to generate scan data indicating the processed image DI for storage, the background removal process may be executed by the CPU of the scanner. In addition, the background removal process may be executed by a cloud server communicably connected to the multifunction device 200 or the scanner. In this case, for example, the cloud server receives scan data from the multifunction device 200 or the scanner, executes the background removal process of FIG. 4 to generate processed image data. The cloud server transmits the generated processed image data to the multifunction device 200 or the scanner. In general, the image processing device that executes the background removal process of FIG. 4 may be any of a computer inside an image-related device such as a multifunction device, a printer, a digital camera, or a scanner, a general-purpose personal computer, a server connected to a network, etc. In addition, the background removal process may be executed as a whole by sharing among multiple computers that can communicate with each other via a network. In this case, the multiple computers as a whole correspond to the image processing device in the claims.

(10)上記各実施例において、ハードウェアによって実現されていた構成の一部をソフトウェアに置き換えるようにしてもよく、逆に、ソフトウェアによって実現されていた構成の一部あるいは全部をハードウェアに置き換えるようにしてもよい。 (10) In each of the above embodiments, a portion of the configuration realized by hardware may be replaced by software, and conversely, a portion or all of the configuration realized by software may be replaced by hardware.

以上、実施例、変形例に基づき本発明について説明してきたが、上記した発明の実施の形態は、本発明の理解を容易にするためのものであり、本発明を限定するものではない。本発明は、その趣旨並びに特許請求の範囲を逸脱することなく、変更、改良され得ると共に、本発明にはその等価物が含まれる。 The present invention has been described above based on examples and modified examples, but the above-mentioned embodiments of the invention are intended to facilitate understanding of the present invention and do not limit the present invention. The present invention may be modified or improved without departing from the spirit and scope of the claims, and the present invention includes equivalents thereof.

200…複合機,210…CPU,220…不揮発性記憶装置,222…コンピュータプログラム,230…揮発性記憶装置,240…プリンタ部,250…スキャナ部,260…操作部,270…表示部,280…通信部,BG…背景,BGs…背景,DI…処理済画像,Pn…周囲画素,Pt…注目画素,SI…スキャン画像,TC…トーンカーブ,TH1~TH3…閾値 200...Multifunction device, 210...CPU, 220...Non-volatile storage device, 222...Computer program, 230...Volatile storage device, 240...Printer unit, 250...Scanner unit, 260...Operation unit, 270...Display unit, 280...Communication unit, BG...Background, BGs...Background, DI...Processed image, Pn...Surrounding pixels, Pt...Pixel of interest, SI...Scanned image, TC...Tone curve, TH1-TH3...Threshold values

Claims (11)

画像処理装置であって、
イメージセンサを用いて原稿を光学的に読み取ることによって得られる対象画像データを取得する取得部と、
前記対象画像データによって示される対象画像内の注目画素が特定の調整条件を満たすか否かを判断する判断部であって、前記特定の調整条件は、前記注目画素が、第1基準以上の明るさを有し、かつ、第2基準以上の彩度を有することを含む、前記判断部と、
前記対象画像データに対して補正処理を実行して、処理済画像を示す処理済画像データを生成する補正処理部と、
を備え、
前記補正処理は、
前記注目画素に対する特定の変換処理であって、前記注目画素が第3基準以上の明るさを有する場合に前記注目画素の色が色になるように、前記注目画素の値を変換する前記特定の変換処理と、
前記変換処理前の前記注目画素が前記特定の調整条件を満たす場合に、前記変換処理前の前記注目画素の値を用いて、前記変換処理済みの前記注目画素の値を調整する調整処理と、
を含む、画像処理装置。
An image processing device,
an acquisition unit that acquires target image data obtained by optically reading a document using an image sensor;
a determination unit that determines whether a pixel of interest in a target image represented by the target image data satisfies a specific adjustment condition, the specific adjustment condition including that the pixel of interest has a brightness equal to or greater than a first standard and a saturation equal to or greater than a second standard;
a correction processing unit that performs a correction process on the target image data to generate processed image data indicative of a processed image;
Equipped with
The correction process includes:
a specific conversion process for the pixel of interest, the specific conversion process converting a value of the pixel of interest so that a color of the pixel of interest becomes white when the pixel of interest has a brightness equal to or greater than a third reference value;
an adjustment process of adjusting a value of the pixel of interest after the conversion process using a value of the pixel of interest before the conversion process when the pixel of interest before the conversion process satisfies the specific adjustment condition;
23. An image processing device comprising:
請求項1に記載の画像処理装置であって、
前記注目画素の値は、複数個の色成分の値を含む特定の表色系の色値であり、
前記調整処理は、前記変換処理前の前記注目画素の成分間差分値であって前記複数個の色成分の値のうちの2個の値の差分である前記成分間差分値に基づいて、前記変換処理済みの前記注目画素の前記成分間差分値を調整する処理である、画像処理装置。
2. The image processing device according to claim 1,
the value of the pixel of interest is a color value of a specific color system including values of a plurality of color components;
The adjustment process is a process of adjusting the inter-component difference value of the pixel of interest after the conversion process based on the inter-component difference value of the pixel of interest before the conversion process, which is the difference between two values of the multiple color components.
請求項2に記載の画像処理装置であって、
前記特定の変換処理は、前記特定の表色系の各色成分の階調数を、第1の階調数から、前記第1の階調数よりも小さな第2の階調数に変換する処理を含み、
前記調整処理は、前記変換処理前の前記注目画素の前記成分間差分値を前記第2の階調数で示す値と等しくなるように、前記変換処理済みの前記注目画素の前記成分間差分値を調整する処理である、画像処理装置。
3. The image processing device according to claim 2,
the specific conversion process includes a process of converting a number of gradations of each color component of the specific color system from a first number of gradations to a second number of gradations smaller than the first number of gradations,
The image processing device, wherein the adjustment process is a process of adjusting the inter-component difference value of the pixel of interest after the conversion process so that the inter-component difference value of the pixel of interest before the conversion process is equal to a value indicated by the second number of gradations.
請求項1~3のいずれかに記載の画像処理装置であって、
前記注目画素の値は、複数個の色成分の値を含む特定の表色系の色値であり、
前記判断部は、前記注目画素の前記複数個の色成分の値のそれぞれが第1閾値よりも高明度側の値である場合に、前記注目画素は前記第1基準以上の明るさを有すると判断する、画像処理装置。
The image processing device according to any one of claims 1 to 3,
the value of the pixel of interest is a color value of a specific color system including values of a plurality of color components;
The image processing device, wherein the judgment unit judges that the pixel of interest has brightness equal to or greater than the first standard when each of the values of the multiple color components of the pixel of interest is a value on the higher brightness side than a first threshold.
請求項1~4のいずれかに記載の画像処理装置であって、
前記注目画素の値は、複数個の色成分の値を含む特定の表色系の色値であり、
前記判断部は、前記注目画素の少なくとも一つの成分間差分値であって前記複数個の色成分の値のうちの2個の値の差分である前記成分間差分値が第2閾値以上である場合に、前記注目画素は前記第2基準以上の彩度を有すると判断する、画像処理装置。
The image processing device according to any one of claims 1 to 4,
the value of the pixel of interest is a color value of a specific color system including values of a plurality of color components;
The image processing device, wherein the judgment unit judges that the pixel of interest has a saturation equal to or greater than the second standard when at least one inter-component difference value of the pixel of interest, which is the difference between two values of the multiple color components, is equal to or greater than a second threshold.
請求項5に記載の画像処理装置であって、
前記特定の変換処理は、前記特定の表色系の各色成分の階調数を、第1の階調数から、前記第1の階調数よりも小さな第2の階調数に変換する処理を含み、
前記判断部は、前記注目画素の少なくとも一つの前記成間差分値を前記第2の階調数で示す値が前記第2閾値以上である場合に、前記注目画素は前記第2基準以上の彩度を有すると判断する、画像処理装置。
6. The image processing device according to claim 5,
the specific conversion process includes a process of converting a number of gradations of each color component of the specific color system from a first number of gradations to a second number of gradations smaller than the first number of gradations,
The image processing device, wherein the judgment unit judges that the pixel of interest has a saturation equal to or greater than the second standard when a value indicating at least one inter- component difference value of the pixel of interest, expressed by the second number of gradations, is equal to or greater than the second threshold.
請求項1~6のいずれかに記載の画像処理装置であって、さらに、
前記対象画像内の前記注目画素がノイズを示すノイズ画素であるか否かを判定する判定処理を実行する判定部を備え、
前記補正処理部は、前記変換処理前の前記注目画素が前記ノイズ画素であると判定される場合には、前記特定の調整条件を満たすか否かに関わらず、前記ノイズ画素に対して前記調整処理を実行しない、画像処理装置。
The image processing device according to any one of claims 1 to 6, further comprising:
a determination unit that performs a determination process to determine whether or not the pixel of interest in the target image is a noise pixel that indicates noise,
An image processing device, wherein when the pixel of interest before the conversion processing is determined to be a noise pixel, the correction processing unit does not perform the adjustment processing on the noise pixel regardless of whether or not the specific adjustment condition is satisfied.
請求項7に記載の画像処理装置であって、
前記補正処理は、前記ノイズ画素の値を、前記ノイズ画素の周囲に位置する周囲画素の値の平均値に変更する変更処理を含む、画像処理装置。
8. The image processing device according to claim 7,
The correction process includes a change process of changing the value of the noise pixel to an average value of the values of surrounding pixels located around the noise pixel.
請求項7または8に記載の画像処理装置であって、
前記判定部は、前記判断部によって前記特定の調整条件を満たすと判断される前記注目画素に対して前記判定処理を実行し、
前記判定部は、
前記注目画素の周囲の所定範囲内に前記特定の調整条件の少なくとも一部を満たす基準個数以上の画素が存在するか否かを判定し、
前記所定範囲内に前記特定の調整条件の少なくとも一部を満たす前記基準個数以上の画素が存在しない場合に、前記注目画素は前記ノイズ画素であると判定する、画像処理装置。
9. The image processing device according to claim 7,
the determination unit performs the determination process on the pixel of interest that is determined by the determination unit to satisfy the specific adjustment condition;
The determination unit is
determining whether or not there are a reference number or more of pixels that satisfy at least a part of the specific adjustment condition within a predetermined range around the pixel of interest;
When there are no pixels within the predetermined range that satisfy at least a portion of the specific adjustment condition, the pixel of interest is determined to be the noise pixel.
請求項1~9のいずれかに記載の画像処理装置であって、さらに、
前記処理済画像データを用いて、前記処理済画像を印刷するための印刷データを生成する生成部を備える、画像処理装置。
The image processing device according to any one of claims 1 to 9, further comprising:
an image processing apparatus comprising: a generating unit that generates print data for printing the processed image using the processed image data;
コンピュータプログラムであって、
イメージセンサを用いて原稿を光学的に読み取ることによって得られる対象画像データを取得する取得機能と、
前記対象画像データによって示される対象画像内の注目画素が特定の調整条件を満たすか否かを判断する判断機能であって、前記特定の調整条件は、前記注目画素が、第1基準以上の明るさを有し、かつ、第2基準以上の彩度を有することを含む、前記判断機能と、
前記対象画像データに対して補正処理を実行して、処理済画像を示す処理済画像データを生成する補正処理機能と、
をコンピュータに実現させ、
前記補正処理は、
前記注目画素に対する特定の変換処理であって、前記注目画素が第3基準以上の明るさを有する場合に前記注目画素の色が色になるように、前記注目画素の値を変換する前記特定の変換処理と、
前記変換処理前の前記注目画素が前記特定の調整条件を満たす場合に、前記変換処理前の前記注目画素の値を用いて、前記変換処理済みの前記注目画素の値を調整する調整処理と、
を含む、コンピュータプログラム。
A computer program comprising:
An acquisition function for acquiring target image data obtained by optically reading an original using an image sensor;
a judgment function for judging whether a pixel of interest in a target image represented by the target image data satisfies a specific adjustment condition, the specific adjustment condition including that the pixel of interest has a brightness equal to or greater than a first standard and a saturation equal to or greater than a second standard;
a correction processing function for executing a correction process on the target image data to generate processed image data representing a processed image;
This is realized on a computer.
The correction process includes:
a specific conversion process for the pixel of interest, the specific conversion process converting a value of the pixel of interest so that a color of the pixel of interest becomes white when the pixel of interest has a brightness equal to or greater than a third reference value;
an adjustment process of adjusting a value of the pixel of interest after the conversion process using a value of the pixel of interest before the conversion process when the pixel of interest before the conversion process satisfies the specific adjustment condition;
A computer program comprising:
JP2020105644A 2020-06-18 Image processing device and computer program Active JP7495660B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2020105644A JP7495660B2 (en) 2020-06-18 Image processing device and computer program

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2020105644A JP7495660B2 (en) 2020-06-18 Image processing device and computer program

Publications (2)

Publication Number Publication Date
JP2021197717A JP2021197717A (en) 2021-12-27
JP7495660B2 true JP7495660B2 (en) 2024-06-05

Family

ID=

Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2009206721A (en) 2008-02-27 2009-09-10 Oki Data Corp Image processor

Patent Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2009206721A (en) 2008-02-27 2009-09-10 Oki Data Corp Image processor

Similar Documents

Publication Publication Date Title
US7903872B2 (en) Image-processing apparatus and method, computer program, and storage medium
US8363125B2 (en) Image processing apparatus, image processing method, and computer program product
JP5953946B2 (en) Image processing apparatus and computer program
JP5525548B2 (en) Image processing system for processing digital image and image processing method for processing digital image
JP4368833B2 (en) Image processing apparatus, image processing method, image forming apparatus, program, and recording medium
US10848644B2 (en) Image processing apparatus, image processing method, and non-transitory computer-readable storage medium
JP2010166506A (en) Image output device, image output method, image output program and recording medium
US20030071823A1 (en) Output image adjustment of graphics data
JP4226278B2 (en) Image processing apparatus, image forming apparatus, image processing method, image processing program, and recording medium recording the same
JP2017184040A (en) Image processing device, and computer program
JP2010028314A (en) Image processing apparatus, method, and program
JP7495660B2 (en) Image processing device and computer program
JP2019134232A (en) Image formation device, and method and program for the device
JP4814162B2 (en) Image processing apparatus and image processing method
US11032442B2 (en) Image processing apparatus and image processing method
JP2021197717A (en) Image processing device and computer program
JP2007251619A (en) Apparatus, method and program for image processing
US20210360125A1 (en) Image processing apparatus, control method thereof, and storage medium
JP2006011754A (en) Image processing device and image processing method
JP7193779B2 (en) Computer program and method
JP5067277B2 (en) Image processing apparatus, image processing method, image processing program, copying apparatus, copying method, and copying program
JP4101741B2 (en) Image processing apparatus, image forming apparatus, image processing method, image processing program, and recording medium
JP4342773B2 (en) Background adjustment method in color reproduction apparatus, program for background adjustment, and color reproduction apparatus
JP4499685B2 (en) Image processing apparatus, image forming apparatus including the same, image processing method, image processing program, and recording medium
JP2009004917A (en) Color processing device and its method