JP4840295B2 - Image processing apparatus and image processing program - Google Patents

Image processing apparatus and image processing program Download PDF

Info

Publication number
JP4840295B2
JP4840295B2 JP2007226091A JP2007226091A JP4840295B2 JP 4840295 B2 JP4840295 B2 JP 4840295B2 JP 2007226091 A JP2007226091 A JP 2007226091A JP 2007226091 A JP2007226091 A JP 2007226091A JP 4840295 B2 JP4840295 B2 JP 4840295B2
Authority
JP
Japan
Prior art keywords
image
feature amount
value
feature
region
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.)
Expired - Fee Related
Application number
JP2007226091A
Other languages
Japanese (ja)
Other versions
JP2009059180A (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
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 Brother Industries Ltd filed Critical Brother Industries Ltd
Priority to JP2007226091A priority Critical patent/JP4840295B2/en
Priority to US12/194,680 priority patent/US8159716B2/en
Publication of JP2009059180A publication Critical patent/JP2009059180A/en
Application granted granted Critical
Publication of JP4840295B2 publication Critical patent/JP4840295B2/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Landscapes

  • Image Processing (AREA)

Description

本発明は、画像補正処理を行うための画像処理装置及び画像処理プログラムに関するものである。   The present invention relates to an image processing apparatus and an image processing program for performing image correction processing.

従来、ユーザの好みに応じた画像補正を行う画像処理装置が知られている。
例えば、あらかじめ用意されている複数種類の調整用データの中から1つの調整用データを選択したり、任意の調整用データを設定したりすることで特定された調整用データに基づき、画像調整を行う構成のものがある(特許文献1参照)。
特開2007−89179号公報
2. Description of the Related Art Conventionally, an image processing apparatus that performs image correction according to user preferences is known.
For example, image adjustment is performed based on the adjustment data specified by selecting one adjustment data from a plurality of types of adjustment data prepared in advance or by setting arbitrary adjustment data. There exists a structure to perform (refer patent document 1).
JP 2007-89179 A

しかしながら、前述したような構成で所望の画像補正が行われるような調整用データを設定するためには、画像に関する専門知識が必要となり、直感的に設定を行うことは困難であった。   However, in order to set adjustment data so that desired image correction is performed with the above-described configuration, specialized knowledge about images is required, and it is difficult to set intuitively.

本発明は、こうした問題にかんがみてなされたものであり、画像補正の設定を直感的に行うことが可能な画像処理装置及び画像処理プログラムを提供することを目的としている。   The present invention has been made in view of these problems, and an object thereof is to provide an image processing apparatus and an image processing program capable of intuitively performing image correction settings.

上記目的を達成するためになされた本発明の画像処理装置は、複数種類の第1画像を入力可能な第1画像入力手段と、前記第1画像入力手段により入力された各第1画像の特徴を表す第1特徴量を特定する第1特徴量特定手段と、前記第1特徴量特定手段により特定された各第1特徴量に基づいて、前記複数種類の第1画像全体の特徴を表す複数の代表値が含まれた総合第1特徴量を特定する総合第1特徴量特定手段と、画像補正の対象とする画像である第2画像を入力する第2画像入力手段と、前記第2画像入力手段により入力された第2画像の特徴を表す複数の代表値が含まれた第2特徴量を特定する第2特徴量特定手段と、前記総合第1特徴量の複数の代表値と前記第2特徴量の複数の代表値との対応関係に基づいて前記第2画像に対する画像補正処理を行う画像補正手段と、を備える。本明細書の第1の構成の画像処理装置は、複数種類の第1画像を入力可能な第1画像入力手段と、第1画像入力手段により入力された複数種類の第1画像の特徴を表す総合第1特徴量を特定する総合第1特徴量特定手段と、画像補正の対象とする画像である第2画像を入力する第2画像入力手段と、第2画像入力手段により入力された第2画像の特徴を表す第2特徴量を特定する第2特徴量特定手段と、第2特徴量特定手段により特定された第2特徴量を総合第1特徴量特定手段により特定された総合第1特徴量に近づけるように、第2画像に対する画像補正処理を行う画像補正手段とを備える。 In order to achieve the above object, an image processing apparatus of the present invention includes a first image input unit capable of inputting a plurality of types of first images, and a feature of each first image input by the first image input unit. A first feature quantity specifying unit that specifies a first feature quantity that represents a plurality of types of features of the plurality of types of first images based on the first feature quantities specified by the first feature quantity specifying unit. An overall first feature amount specifying means for specifying an overall first feature amount including a representative value of the image, a second image input means for inputting a second image that is an image to be corrected, and the second image A second feature amount specifying means for specifying a second feature amount including a plurality of representative values representing features of the second image inputted by the input means; a plurality of representative values of the total first feature amount; 2 The second image is matched with the second image based on the correspondence relationship with the plurality of representative values. Comprising an image correcting means for performing image correction processing that, the. The image processing apparatus having the first configuration of the present specification represents a first image input unit capable of inputting a plurality of types of first images, and features of the plurality of types of first images input by the first image input unit. Overall first feature quantity specifying means for specifying the overall first feature quantity, second image input means for inputting a second image as an image to be corrected, and second input by the second image input means. A second feature quantity specifying unit that specifies a second feature quantity that represents a feature of the image; and a second first feature quantity that is specified by the second feature quantity specifying unit, and an overall first feature that is specified by the overall first feature quantity specifying unit. Image correction means for performing image correction processing on the second image so as to approach the amount.

このような画像処理装置によれば、ユーザは、第1画像を用いることで、画像補正の設定を直感的に行うことができる。特に、この画像処理装置では、複数種類の第1画像を用いることにより、それらの特徴に基づく画像補正処理が可能となるため、1つの第1画像のみを用いる場合に比べ、画像補正の設定をより詳細に行うことができる。   According to such an image processing apparatus, the user can intuitively set the image correction by using the first image. In particular, in this image processing apparatus, by using a plurality of types of first images, it is possible to perform image correction processing based on those characteristics. Therefore, compared with the case where only one first image is used, image correction settings are set. Can be done in more detail.

具体的には、例えば第2の構成のように、総合第1特徴量特定手段は、第1画像入力手段により入力された複数種類の第1画像から構成される1つの全体画像の特徴を表す特徴量を総合第1特徴量として特定するとよい。このようにすれば、例えば、1つの画像を複数に分割して読み込ませた場合に、1つの画像をそのまま読み込ませた場合と同様の画像補正を行うことができる。 Specifically, for example, as in the second configuration , the comprehensive first feature amount specifying unit represents the characteristics of one whole image composed of a plurality of types of first images input by the first image input unit. The feature amount may be specified as the comprehensive first feature amount. In this way, for example, when one image is divided and read, the same image correction as when one image is read as it is can be performed.

また、例えば第3の構成のように、第1画像入力手段により入力された各第1画像の特徴を表す第1特徴量を特定する第1特徴量特定手段を備え、総合第1特徴量特定手段は、第1特徴量特定手段により特定された各第1特徴量から、複数種類の第1画像全体の特徴を表す総合第1特徴量を特定してもよい。このようにすれば、入力されたすべての第1画像を同時に記憶する必要がなくなるため、第1画像を記憶するために必要な記憶容量を節約することが可能となる。 Further, for example, as in the third configuration , the first feature amount specifying means for specifying the first feature amount representing the feature of each first image input by the first image input means is provided, and the comprehensive first feature amount specifying The means may specify an overall first feature quantity that represents the features of the plurality of types of first images from the first feature quantities specified by the first feature quantity specifying means. In this way, since it is not necessary to store all the input first images at the same time, it is possible to save the storage capacity necessary for storing the first images.

そして、このように各第1画像の第1特徴量に基づき総合第1特徴量を特定する場合には、例えば、第1画像入力手段により入力された複数種類の第1画像の相対的な大きさの違いを加味せずに総合第1特徴量を特定することが考えられる。このようにすれば、大きさの異なる第1画像を用いた場合にも、その大きさの違いに影響されることなく画像補正を行うことができる。   And when specifying the comprehensive first feature quantity based on the first feature quantity of each first image in this way, for example, the relative sizes of the plurality of types of first images input by the first image input means are used. It is conceivable to specify the comprehensive first feature amount without taking into account the difference. In this way, even when the first images having different sizes are used, image correction can be performed without being affected by the difference in size.

一方、これとは逆に、例えば第4の構成のように、第1画像入力手段により入力された複数種類の第1画像について、各第1画像から特定された第1特徴量と、その第1特徴量を特定するために用いた第1画像の範囲の大きさとから、総合第1特徴量を特定することも考えられる。このようにすれば、1つの画像を異なる大きさで複数に分割して読み込ませた場合のように、第1画像の大きさを加味すべき場合に適切な画像補正を行うことが可能となる。 On the other hand, for example, as in the fourth configuration , the first feature amount specified from each first image and the first feature amount for the plurality of types of first images input by the first image input means, It is also conceivable to specify the total first feature value from the size of the range of the first image used to specify one feature value. In this way, it is possible to perform appropriate image correction when the size of the first image should be taken into account, such as when one image is divided into a plurality of different sizes and read. .

また、第5の構成の画像処理装置は、画像補正手段による画像補正処理結果を表す補正イメージ画像を出力する出力手段と、画像補正手段により画像補正処理が行われた第2画像を印刷する印刷制御手段とを備える。このような画像処理装置によれば、ユーザは、補正イメージ画像に基づき、所望の補正結果が得られるか否かを簡易的に判断することができる。 An image processing apparatus having a fifth configuration includes an output unit that outputs a corrected image representing an image correction process result by the image correction unit, and a print that prints the second image on which the image correction process has been performed by the image correction unit. Control means. According to such an image processing device, the user can easily determine whether or not a desired correction result is obtained based on the corrected image.

そして、第6の構成の画像処理装置では、出力手段により補正イメージ画像が出力されたことを条件として、第1画像入力手段により第1画像を入力し、画像補正手段は、その入力された第1画像及び出力手段により出力された補正イメージ画像の画像補正処理に用いた第1画像、における総合第1特徴量から、第2画像に対する画像補正処理を行う。このような画像処理装置によれば、第1画像を追加して補正を微調整することが可能となる。例えば、出力結果を見たユーザが補正イメージ画像に基づき所望の補正結果が得られていないと判断した場合に、新たに第1画像を画像入力手段により入力するように指示して補正の微調整をすることができる。 In the image processing apparatus having the sixth configuration , on the condition that the corrected image is output by the output unit, the first image input unit inputs the first image, and the image correction unit receives the input first image. The image correction process is performed on the second image from the overall first feature quantity in the first image used for the image correction process of one image and the corrected image output by the output unit. According to such an image processing apparatus, it is possible to finely adjust the correction by adding the first image. For example, when the user who has seen the output result determines that the desired correction result has not been obtained based on the corrected image image, the user inputs an instruction to newly input the first image by the image input means and finely adjust the correction. Can do.

また、第7の構成の画像処理装置では、画像補正手段は、出力手段により補正イメージ画像が出力されたことを条件として、出力手段により出力された補正イメージ画像の画像補正処理に用いた複数種類の第1画像のうち、所定の第1画像以外の第1画像に基づく総合第1特徴量から、第2画像に対する画像補正処理を行う。このような画像処理装置によれば、不要な第1画像を除外して補正を微調整することが可能となる。例えば、出力手段による出力結果を見たユーザが補正イメージ画像に基づき所望の補正結果が得られていないと判断した場合に、不要な第1画像を選択するなどにより補正の微調整をすることができる。 Further, in the image processing apparatus having the seventh configuration , the image correction unit includes a plurality of types used in the image correction process of the corrected image image output by the output unit on condition that the corrected image image is output by the output unit. Among the first images, image correction processing is performed on the second image from the overall first feature amount based on the first image other than the predetermined first image. According to such an image processing apparatus, it is possible to finely adjust the correction by excluding the unnecessary first image. For example, when the user who has seen the output result from the output means determines that a desired correction result has not been obtained based on the corrected image image, the correction may be finely adjusted by selecting an unnecessary first image or the like. it can.

ここで、補正イメージ画像は、例えば第8の構成のように、第2画像の縮小画像に対して画像補正処理を行ったものとするとよい。このようにすれば、第2画像自体に対して画像補正処理を行うのに比べ、補正イメージ画像を生成する処理を簡素化することができる。 Here, the corrected image image may be obtained by performing image correction processing on the reduced image of the second image, for example, as in the eighth configuration . In this way, it is possible to simplify the process of generating a corrected image compared to performing the image correction process on the second image itself.

一方、第9の構成の画像処理装置において、第1画像入力手段は、所定の読取位置にセットされた印刷媒体から光学的に読み取られる画像を入力するものであり、読取位置にセットされた印刷媒体から複数の画像が読み取られた場合に、各画像をそれぞれ独立した第1画像として入力可能なものである。このような画像処理装置によれば、ユーザは、複数の印刷媒体を一度に読取位置にセットしたり、複数の画像が印刷された印刷媒体を読取位置にセットしたりすることで、複数の第1画像を容易に読み取らせることが可能となり、作業時間を短縮することができる。 On the other hand, in the image processing apparatus having the ninth configuration , the first image input means inputs an image optically read from a print medium set at a predetermined reading position, and prints set at the reading position. When a plurality of images are read from the medium, each image can be input as an independent first image. According to such an image processing apparatus, the user sets a plurality of print media at a reading position at a time or sets a printing medium on which a plurality of images are printed at a reading position. One image can be easily read, and the working time can be shortened.

具体的には、例えば第10の構成のように、第1画像入力手段は、読取位置を複数に分割した各読取領域で読み取られる画像を独立した第1画像として入力するようにすれば、複数の画像の認識を比較的正確に行うことができる。 Specifically, as in the tenth configuration , for example, the first image input means can input a plurality of images read in each reading area obtained by dividing the reading position into a plurality of images as independent first images. Can be recognized relatively accurately.

そして特に、例えば第11の構成のように、第1画像入力手段が、読取領域で読み取られた画像の平均輝度値が所定値以上の場合には、その読取領域には画像が存在しないと判定するようにすれば、画像が存在しない部分を第1画像として入力してしまうことを防ぐことができる。 In particular, as in the eleventh configuration , for example, when the average luminance value of the image read in the reading area is greater than or equal to a predetermined value, the first image input unit determines that there is no image in the reading area. By doing so, it is possible to prevent a portion where no image exists from being input as the first image.

次に、第12の構成の画像処理プログラムは、複数種類の第1画像を入力可能な第1画像入力手段と、第1画像入力手段により入力された複数種類の第1画像の特徴を表す総合第1特徴量を特定する総合第1特徴量特定手段と、画像補正の対象とする画像である第2画像を入力する第2画像入力手段と、第2画像入力手段により入力された第2画像の特徴を表す第2特徴量を特定する第2特徴量特定手段と、第2特徴量特定手段により特定された第2特徴量を総合第1特徴量特定手段により特定された総合第1特徴量に近づけるように、第2画像に対する画像補正処理を行う画像補正手段としてコンピュータを機能させる。 Next, an image processing program having a twelfth configuration includes a first image input unit capable of inputting a plurality of types of first images, and a comprehensive feature representing the characteristics of the plurality of types of first images input by the first image input unit. Overall first feature quantity specifying means for specifying the first feature quantity, second image input means for inputting a second image that is an image to be corrected, and a second image input by the second image input means A second feature quantity specifying unit that specifies a second feature quantity that represents a feature of the first feature quantity, and a second feature quantity that is specified by the second feature quantity specifying unit, and a total first feature quantity that is specified by the total first feature quantity specifying unit. The computer is caused to function as an image correction unit that performs an image correction process on the second image so as to approach the image.

このような画像処理プログラムによれば、第1の構成の画像処理装置としてコンピュータを機能させることができ、これにより前述した効果を得ることができる。 According to such an image processing program, it is possible to cause a computer to function as the image processing apparatus having the first configuration , thereby obtaining the above-described effects.

以下、本発明が適用された実施形態について、図面を用いて説明する。
[1.第1実施形態]
[1−1.全体構成]
図1は、第1実施形態の画像処理装置としての複合機10の外観を示す斜視図である。
Embodiments to which the present invention is applied will be described below with reference to the drawings.
[1. First Embodiment]
[1-1. overall structure]
FIG. 1 is a perspective view showing an appearance of a multifunction machine 10 as an image processing apparatus according to the first embodiment.

この複合機10は、プリンタ機能の他、スキャナ機能やカラーコピー機能等を有したものであり、本体ケーシング11における上部位置に、原稿の読み取りに用いられる画像読取部20を備えている。   The multifunction machine 10 has a printer function, a scanner function, a color copy function, and the like, and includes an image reading unit 20 used for reading a document at an upper position in the main body casing 11.

画像読取部20は、原稿載置面(ガラス台)にセット(載置)された原稿から画像を光学的に読み取るいわゆるフラットベッドスキャナである。ここで、原稿載置面は、その上面が薄板状の原稿カバー21によって覆われており、原稿カバー21を上方へ開くことにより、原稿載置面への原稿のセット及びセットされた原稿の除去(つまり原稿の出し入れ)が可能となる。また、原稿カバー21における原稿載置面と対向する側の面は白色となっており、原稿カバー21が閉じられた状態(図1に示す状態)で画像の読み取りが行われた場合に、原稿載置面における原稿の載置されていない部分は白色に読み取られる。   The image reading unit 20 is a so-called flatbed scanner that optically reads an image from a document set (placed) on a document placement surface (glass table). Here, the upper surface of the document placement surface is covered with a thin plate-like document cover 21, and the document cover 21 is opened upward to set the document on the document placement surface and remove the set document. (In other words, it is possible to put a document in and out). Further, the surface of the document cover 21 opposite to the document placement surface is white, and the document is read when the image is read with the document cover 21 closed (the state shown in FIG. 1). The portion of the placement surface where no document is placed is read in white.

一方、複合機10は、画像読取部20の前方位置(手前側の位置)に、各種操作ボタンを配置した操作部31及びメッセージ等の画像を表示する表示部(例えば液晶ディスプレイ)32からなる操作パネル30を備えている。   On the other hand, the multifunction device 10 includes an operation unit 31 in which various operation buttons are arranged at a front position (front side position) of the image reading unit 20 and a display unit (for example, a liquid crystal display) 32 that displays an image such as a message. A panel 30 is provided.

また、複合機10は、画像読取部20の下方位置に、用紙等の印刷媒体にカラー画像を印刷可能な画像印刷部40を備えている。この画像印刷部40で画像が印刷された用紙は、本体ケーシング11の前面に形成された開口12から排紙される。   In addition, the multifunction machine 10 includes an image printing unit 40 that can print a color image on a printing medium such as paper at a position below the image reading unit 20. The sheet on which the image is printed by the image printing unit 40 is discharged from the opening 12 formed on the front surface of the main body casing 11.

さらに、複合機10は、本体ケーシング11の前面における開口12の上方位置に、SDカードやCFカード等の各種メモリカード(可搬型記憶媒体)を挿入可能なカードスロット50を備えている。また、複合機10は、パーソナルコンピュータ等の情報処理装置を介さずに直接メモリカードから画像(デジタルスチルカメラで撮影した画像等)を読み取ってその画像を印刷する機能(いわゆるダイレクトプリント機能)を有している。   Furthermore, the multifunction machine 10 includes a card slot 50 into which various memory cards (portable storage media) such as an SD card and a CF card can be inserted at a position above the opening 12 on the front surface of the main casing 11. The multifunction device 10 has a function (so-called direct print function) for reading an image (such as an image taken with a digital still camera) directly from a memory card and printing the image without using an information processing device such as a personal computer. is doing.

次に、複合機10の制御系について説明する。
図2は、複合機10の制御系の概略構成を示すブロック図である。
同図に示すように、複合機10は、前述した画像読取部20、操作パネル30、画像印刷部40及びカードスロット50と、通信部60と、制御部70とを備えており、これらは信号線80を介して接続されている。
Next, a control system of the multifunction machine 10 will be described.
FIG. 2 is a block diagram illustrating a schematic configuration of a control system of the multifunction machine 10.
As shown in the figure, the multifunction machine 10 includes the image reading unit 20, the operation panel 30, the image printing unit 40, the card slot 50, the communication unit 60, and the control unit 70 described above. They are connected via a line 80.

通信部60は、通信ケーブル(LANケーブル)が接続された状態でその通信ケーブルを介したデータの送受信処理を行う。つまり、外部装置との間でデータ通信を行うためのものであり、例えば、LANに存在するパーソナルコンピュータや、インターネット上に存在するウェブサーバとの間でデータ通信が可能となっている。   The communication unit 60 performs data transmission / reception processing via the communication cable in a state where the communication cable (LAN cable) is connected. That is, it is for performing data communication with an external device. For example, data communication can be performed with a personal computer in a LAN or a web server on the Internet.

制御部70は、CPU71、ROM72、RAM73等からなるマイクロコンピュータを中心に構成されており、複合機10を構成する各部を統括制御する。また、ROM72には、後述する色変換処理をCPU71に実行させるためのプログラムが記憶されている。   The control unit 70 is configured mainly with a microcomputer including a CPU 71, a ROM 72, a RAM 73, and the like, and performs overall control of each unit constituting the multifunction machine 10. The ROM 72 stores a program for causing the CPU 71 to execute a color conversion process described later.

[1−2.色変換処理の概要]
次に、複合機10が行う色変換処理の概要について説明する。
本実施形態の複合機10は、色変換対象の画像に対し、色変換の見本となる画像(以下「お手本画像」ともいう。)に基づく色変換処理を行う。ここで、まず、このような色変換処理の基本的な流れについて、図3を用いて説明する。
[1-2. Overview of color conversion process]
Next, an outline of color conversion processing performed by the multifunction machine 10 will be described.
The MFP 10 according to the present embodiment performs color conversion processing based on an image (hereinafter also referred to as “example image”) serving as a sample for color conversion on an image to be subjected to color conversion. Here, first, the basic flow of such color conversion processing will be described with reference to FIG.

ユーザが、お手本画像の印刷された原稿(例えば写真)を画像読取部20の原稿載置面にセットし、操作部31で原稿読取操作を行うと(1)、複合機10は、原稿載置面における設定範囲(L版サイズ、A4サイズ等、ユーザによって設定された範囲)からお手本画像を読み取る(2)。これにより、原稿載置面にセットされた原稿からお手本画像が読み込まれる。   When a user sets a document (for example, a photograph) on which a model image is printed on the document placement surface of the image reading unit 20 and performs a document reading operation with the operation unit 31 (1), the multifunction machine 10 places the document on the document. A model image is read from a set range on the surface (a range set by the user, such as L size and A4 size) (2). As a result, the model image is read from the document set on the document placement surface.

次に、ユーザが、色変換の対象とする画像が記憶されたメモリカードをカードスロット50に挿入すると(3)、複合機10は、挿入されたメモリカードを認識し、ユーザに対し、メモリカードに記憶されている画像のうち色変換の対象とするものを選択させる(4)。なお、ユーザに画像を選択させるための処理としては、公知の処理(例えば、メモリカードに記憶されている各画像を表示部32に表示させて操作部31での操作により選択させる処理)を適宜採用可能である。   Next, when the user inserts a memory card storing an image to be color-converted into the card slot 50 (3), the multi-function device 10 recognizes the inserted memory card and notifies the user of the memory card. The image to be subjected to color conversion is selected from the images stored in (4). In addition, as a process for making a user select an image, a well-known process (For example, the process which displays each image memorize | stored in the memory card on the display part 32, and makes it select by operation in the operation part 31) suitably. It can be adopted.

そして、色変換対象の画像がユーザにより選択されると(5)、複合機10は、選択された画像を読み込む(6)。なお、以下の説明において、当該画像を「元画像」ということがある。   When the user selects a color conversion target image (5), the multifunction machine 10 reads the selected image (6). In the following description, the image may be referred to as an “original image”.

その後、複合機10は、画像読取部20から読み込んだお手本画像を見本として、メモリカードから読み込んだ元画像を補正する処理を行う(7)。
なお、ここでは、画像読取部20からお手本画像を読み込んだ後にメモリカードから元画像を読み込む手順を例示したが、これに限定されるものではなく、先にメモリカードから元画像を読み込み、その後に画像読取部20からお手本画像を読み込むようにしてもよい。
Thereafter, the multifunction machine 10 performs a process of correcting the original image read from the memory card using the model image read from the image reading unit 20 as a sample (7).
Here, the procedure for reading the original image from the memory card after reading the model image from the image reading unit 20 is illustrated, but the present invention is not limited to this, and the original image is read from the memory card first, and then A model image may be read from the image reading unit 20.

このような色変換処理によれば、ユーザは、お手本画像を用いることで、元画像の色変換を簡単な操作でかつ感覚的に行うことができる。
具体的には、例えば、建物と空が写っている元画像に対し、空の青を鮮やかな海の青に変換したい場合は、鮮やかな海の写っているお手本画像を用いることによって、元画像の青色を鮮やかな海の青に変換することができる。
According to such color conversion processing, the user can perform color conversion of the original image with a simple operation and sensuously by using the model image.
Specifically, for example, if you want to convert the sky blue to the vivid ocean blue for the original image showing the building and the sky, you can use the model image that captures the vivid ocean, Blue can be converted into vivid sea blue.

また、人の顔が映っている元画像に対し、肌色を明るく変換したい場合は、明るい肌色の写っているお手本画像を用いることによって、元画像の肌色を明るい肌色に変換することができる。   Further, when it is desired to brightly convert the skin color with respect to the original image in which the human face is reflected, the skin color of the original image can be converted into a bright skin color by using a model image showing a bright skin color.

このように、ユーザは、何ら専門的な知識を必要とせず、お手本画像を画像読取部20に読み取らせるだけで、所望の色変換を行うことができる。さらに、色変換を行う領域が自動的に選択されるので、知覚されにくい領域の変換を中止又は低減し、知覚されやすい領域のみを変換することもできる。   As described above, the user can perform desired color conversion only by causing the image reading unit 20 to read the model image without requiring any specialized knowledge. Furthermore, since the area for color conversion is automatically selected, it is possible to stop or reduce the conversion of areas that are difficult to perceive, and to convert only the areas that are easily perceived.

しかしながら、1つのお手本画像のみでは所望の色変換処理を行うことができないことが考えられる。
そこで、本実施形態の複合機10では、複数種類のお手本画像を用いた色変換処理を可能としている。
However, it is conceivable that a desired color conversion process cannot be performed with only one model image.
Therefore, in the MFP 10 according to the present embodiment, color conversion processing using a plurality of types of model images is possible.

[1−3.色変換処理の具体的内容]
以下、本実施形態の複合機10が行う色変換処理の具体的内容について説明する。
[1−3−1.色変換処理]
図4は、CPU71が実行する色変換処理のフローチャートである。
[1-3. Specific contents of color conversion processing]
Hereinafter, specific contents of the color conversion process performed by the multifunction machine 10 of the present embodiment will be described.
[1-3-1. Color conversion process]
FIG. 4 is a flowchart of the color conversion process executed by the CPU 71.

CPU71は、色変換処理を開始すると、まず、S101で、画像読取部20の原稿載置面における設定範囲をお手本画像として読み取る。なお、読み取った画像の形式は特に限定されないが、本実施形態ではRGB形式を前提として説明する。   When the CPU 71 starts the color conversion process, first, in S101, the CPU 71 reads a set range on the document placement surface of the image reading unit 20 as a model image. Although the format of the read image is not particularly limited, the present embodiment will be described on the assumption of the RGB format.

続いて、S102では、S101で読み取ったお手本画像を構成する各画素をHSVパラメータ(H値:0〜360、S値及びV値:0〜1)に変換する処理を行う。
なお、RGBからHSVパラメータへの変換や、HSVからRGBへの変換は、以下に示す公知の変換式に従い行うことができる。
(1)RGB⇒HSVの変換式
max(a,b,c)はa,b,cの中で最も大きい値を表す。
min(a,b,c)はa,b,cの中で最も小さい値を表す。
V = max(R/255,G/255,B/255)
Vが0でない時、
S = [V - min(R,G,B)] ÷ V
Vが0の時、
S = 0
[V - min(R,G,B)]が0でない時、
r = (V - R/255)÷(V-min(R,G,B)
g = (V - G/255)÷(V-min(R,G,B)
b = (V - B/255)÷(V-min(R,G,B)
[V - min(R,G,B)]が0の時、
r = 0
g = 0
b = 0
V = R/255の時
H = 60 × (b-g)
V = G/255の時
H = 60 × (2+r-g)
V = B/255の時
H = 60 × (4+g-r)
ただしH<0の時
H = H+360
として、RGBからHSVへ変換される。また、HSVからRGBへは、
(2)HSV⇒RGBの変換式
(以下で示すin, fl, m, nは、HSVからRGBを算出する過程で利用する媒介変数である)
in を (H/60)の整数部分
fl を (H/60)の小数部分とする。
in が偶数の場合
fl = 1-fl
m = V × (1-S)
n = V × (1-S×fl)
inが0の時
R = V × 255
G = n × 255
B = m × 255
inが1の時
R = n × 255
G = V × 255
B = m × 255
inが2の時
R = m × 255
G = V × 255
B = n × 255
inが3の時
R = m × 255
G = n × 255
B = V × 255
inが4の時
R = n × 255
G = m × 255
B = V × 255
inが5の時
R = V × 255
G = m × 255
B = n × 255
として変換される。
Subsequently, in S102, a process of converting each pixel constituting the model image read in S101 into an HSV parameter (H value: 0 to 360, S value and V value: 0 to 1) is performed.
Note that the conversion from RGB to HSV parameters and the conversion from HSV to RGB can be performed according to the known conversion formulas shown below.
(1) RGB → HSV conversion formula
max (a, b, c) represents the largest value among a, b, and c.
min (a, b, c) represents the smallest value among a, b, and c.
V = max (R / 255, G / 255, B / 255)
When V is not 0
S = [V-min (R, G, B)] ÷ V
When V is 0
S = 0
When [V-min (R, G, B)] is not 0,
r = (V-R / 255) ÷ (V-min (R, G, B)
g = (V-G / 255) / (V-min (R, G, B)
b = (V-B / 255) / (V-min (R, G, B)
When [V-min (R, G, B)] is 0,
r = 0
g = 0
b = 0
When V = R / 255
H = 60 × (bg)
When V = G / 255
H = 60 × (2 + rg)
When V = B / 255
H = 60 × (4 + gr)
However, when H <0
H = H + 360
Are converted from RGB to HSV. Also, from HSV to RGB,
(2) HSV-> RGB conversion formula
(In, fl, m, and n shown below are parameters used in the process of calculating RGB from HSV)
in the integer part of (H / 60)
Let fl be the fractional part of (H / 60).
If in is an even number
fl = 1-fl
m = V × (1-S)
n = V × (1-S × fl)
When in is 0
R = V × 255
G = n × 255
B = m × 255
When in is 1
R = n × 255
G = V × 255
B = m × 255
When in is 2
R = m × 255
G = V × 255
B = n × 255
When in is 3
R = m × 255
G = n × 255
B = V × 255
When in is 4
R = n × 255
G = m × 255
B = V × 255
When in is 5
R = V × 255
G = m × 255
B = n × 255
Is converted as

続いて、S103では、S102での変換処理により得られたHSVパラメータに基づいて、お手本画像の特徴を表す特徴量である第1特徴量を特定する第1特徴量特定処理を行う。なお、第1特徴量特定処理の具体的な処理内容については後述する(図6)。   Subsequently, in S103, based on the HSV parameter obtained by the conversion process in S102, a first feature quantity specifying process for specifying a first feature quantity that is a feature quantity representing the feature of the model image is performed. The specific processing content of the first feature quantity specifying process will be described later (FIG. 6).

続いて、S104では、S103で特定した第1特徴量をRAM73に記憶させる。ここで、既に別のお手本画像についての第1特徴量がRAM73に記憶されている場合には、その第1特徴量の記憶状態を維持しつつ、新たに追加する形で記憶させる。具体的には、RAM73に記憶される第1特徴量は、本色変換処理の開始時又は終了時に消去されるようになっており、本色変換処理が開始されてから終了されるまでの間は記憶状態が維持される。したがって、S101〜S104の処理が繰り返されることにより、複数のお手本画像についての複数の第1特徴量がRAM73に記憶されることになる。なお、第1特徴量の記憶先はRAM73に限定されるものではなく、例えば複合機10がハードディスクを備えている場合にはハードディスクに記憶させてもよい。   Subsequently, in S104, the first feature amount specified in S103 is stored in the RAM 73. Here, if the first feature value for another model image is already stored in the RAM 73, the first feature value is stored in a newly added form while maintaining the storage state of the first feature value. Specifically, the first feature amount stored in the RAM 73 is erased at the start or end of the main color conversion process, and is stored between the start and end of the main color conversion process. State is maintained. Therefore, by repeating the processing of S101 to S104, a plurality of first feature values for a plurality of model images are stored in the RAM 73. Note that the storage destination of the first feature value is not limited to the RAM 73. For example, when the multifunction device 10 includes a hard disk, the first feature value may be stored in the hard disk.

続いて、S105では、まだ読み取りを行っていない原稿が存在するか否かを判定する。具体的には、例えば次の(1)〜(3)のいずれかの方法で判定することができる。
(1)原稿の枚数をあらかじめユーザに設定させ、その枚数に達したか否かを判定する。
In step S105, it is determined whether there is a document that has not been read. Specifically, it can be determined by any one of the following methods (1) to (3), for example.
(1) The user sets the number of documents in advance and determines whether or not the number has been reached.

(2)すべての原稿の読み取りが終了した時点でユーザに規定のボタン(例えば印刷ボタン)を押下させるようにし、規定のボタンが押下されたか否かを判定する。
(3)すべての原稿の大きさを合計した用紙サイズをあらかじめユーザに設定させ、そのサイズに達したか否かを判定する。なお、この方法は、原稿載置面よりも大きい用紙サイズの原稿を複数に分割して読み取るような場合に有効である。
(2) When all the originals have been read, the user is allowed to press a specified button (for example, a print button), and it is determined whether or not the specified button has been pressed.
(3) The user sets in advance a paper size that is the sum of the sizes of all the originals, and determines whether or not the size has been reached. This method is effective when an original having a paper size larger than the original placing surface is divided into a plurality of parts and read.

そして、S105で、まだ読み取りを行っていないお手本画像が存在すると判定した場合には、S101へ戻る。つまり、原稿の読取操作を再び行うことで、複数種類のお手本画像を読み取ることができるようにしている。   If it is determined in S105 that there is a model image that has not yet been read, the process returns to S101. That is, by performing the document reading operation again, a plurality of types of model images can be read.

一方、S105で、まだ読み取りを行っていないお手本画像が存在しない(すべてのお手本画像の読み取りを行った)と判定した場合には、S106へ移行し、S104でRAM73に記憶させたすべての第1特徴量(以下「第1特徴量群」ともいう。)を読み出す。   On the other hand, if it is determined in S105 that there is no model image that has not yet been read (all model images have been read), the process proceeds to S106, and all the first images stored in the RAM 73 in S104. Feature values (hereinafter also referred to as “first feature value group”) are read out.

続いて、S107では、S106で読み出した第1特徴量群に基づき、複数種類のお手本画像の総合的な特徴を表す第1特徴量(以下「総合第1特徴量」ともいう。)を特定する。なお、具体的な特定方法については後述する。   Subsequently, in S107, based on the first feature value group read in S106, a first feature value (hereinafter, also referred to as “total first feature value”) that represents a comprehensive feature of a plurality of types of model images is specified. . A specific identification method will be described later.

続いて、S108では、メモリカードに記憶されている色変換対象の画像(元画像)をRAM73に読み込む。なお、読み込む画像の形式は特に限定されないが、本実施形態ではRGB形式を前提として説明する。   Subsequently, in S108, the color conversion target image (original image) stored in the memory card is read into the RAM 73. Although the format of the image to be read is not particularly limited, the present embodiment will be described on the assumption that the RGB format is used.

続いて、S109では、S108で読み込んだ元画像のサムネイル画像を生成する。すなわち、元画像に対し、あらかじめ設定されているサムネイル画像のサイズとなるようにサイズ変更処理(縮小処理)を行う。なお、元画像はサムネイル画像よりも大きいことが通常であるため、ここではサイズ変更処理として縮小処理を行うと説明したが、元画像がサムネイル画像のサイズよりも小さい場合には、サイズ変更処理として拡大処理を行うことになる。   Subsequently, in S109, a thumbnail image of the original image read in S108 is generated. That is, a size change process (reduction process) is performed on the original image so as to have a preset thumbnail image size. Since the original image is usually larger than the thumbnail image, it has been described here that the reduction process is performed as the size change process. However, when the original image is smaller than the thumbnail image size, the size change process is performed. An enlargement process is performed.

続いて、S110では、S108で読み込んだ元画像(S109で生成したサムネイル画像ではない)を構成する各画素をHSVパラメータに変換する処理を行う。
続いて、S111では、S110での変換処理により得られたHSVパラメータに基づいて、元画像の特徴を表す特徴量である第2特徴量を特定する第2特徴量特定処理を行う。なお、第2特徴量特定処理の具体的な処理内容については後述する(図7)。
Subsequently, in S110, a process of converting each pixel constituting the original image read in S108 (not the thumbnail image generated in S109) into an HSV parameter is performed.
Subsequently, in S111, based on the HSV parameter obtained by the conversion process in S110, a second feature amount specifying process for specifying a second feature amount that is a feature amount representing the feature of the original image is performed. The specific processing content of the second feature amount specifying processing will be described later (FIG. 7).

続いて、S112では、第1特徴量及び第2特徴量の値を条件に応じて再設定する代表値再設定処理を行う。なお、代表値再設定処理の具体的な処理内容については後述する(図9)。   Subsequently, in S112, a representative value resetting process is performed in which the values of the first feature value and the second feature value are reset according to conditions. The specific processing contents of the representative value resetting process will be described later (FIG. 9).

続いて、S113では、総合第1特徴量及び第2特徴量に基づいてサムネイル画像を補正する。なお、具体的な補正方法については後述する。
続いて、S114では、図5に示すように、S113で補正された補正後のサムネイル画像(以下「補正イメージ画像」ともいう。)と、この補正結果で印刷して問題ないか否かの確認を促すメッセージを表示部32に表示させる。
Subsequently, in S113, the thumbnail image is corrected based on the total first feature amount and the second feature amount. A specific correction method will be described later.
Subsequently, in S114, as shown in FIG. 5, the corrected thumbnail image corrected in S113 (hereinafter also referred to as “corrected image image”) and confirmation of whether there is no problem in printing with this correction result are confirmed. A message for prompting is displayed on the display unit 32.

続いて、S115では、S114で表示部32に表示させた内容に対して操作部31で行われる操作に従い、印刷を行うかを判定する。
そして、S115で、印刷を行わないと判定した場合には、S116へ移行し、お手本画像を増やすか否か(減らすか)を判定する。具体的には、表示部32にメッセージを表示して操作部31での操作を促すことにより、お手本画像を増やすか減らすかについてのユーザの意思を確認する。
Subsequently, in S115, it is determined whether to perform printing according to the operation performed on the operation unit 31 with respect to the content displayed on the display unit 32 in S114.
If it is determined in S115 that printing is not performed, the process proceeds to S116, where it is determined whether to increase (decrease) the model image. Specifically, the user's intention about whether to increase or decrease the model image is confirmed by displaying a message on the display unit 32 and prompting an operation on the operation unit 31.

このS116で、お手本画像を増やすと判定した場合には、S101に戻り、新たなお手本画像の読み取りを行う。
一方、S116で、お手本画像を増やさない(減らす)と判定した場合には、S117へ移行し、S104でRAM73に記憶させたすべての第1特徴量のそれぞれに対応するカラーパッチを表示部32に表示させる。具体的には、後述するように、第1特徴量には、お手本画像の構成画素を色相に応じて6つの領域に分割した各領域の代表値が含まれており、ここでは、各お手本画像について、6つの代表値をカラーパッチとして表示する。
If it is determined in S116 that the model images are to be increased, the process returns to S101, and a new model image is read.
On the other hand, if it is determined in S116 that the model image is not increased (decreased), the process proceeds to S117, and the color patches corresponding to each of all the first feature values stored in the RAM 73 in S104 are displayed on the display unit 32. Display. Specifically, as will be described later, the first feature amount includes a representative value of each region obtained by dividing the constituent pixels of the sample image into six regions according to the hue. Here, each sample image 6 representative values are displayed as color patches.

続いて、S118では、操作部31での操作により選択されたカラーパッチの第1特徴量を無効に設定する。つまり、RAM73に記憶されている複数の第1特徴量(画像読取部20で読み取った複数種類のお手本画像)のうち、カラーパッチが選択されたお手本画像を除外するようにしている。   Subsequently, in S118, the first feature amount of the color patch selected by the operation on the operation unit 31 is set to be invalid. That is, the model image for which the color patch is selected is excluded from the plurality of first feature amounts (a plurality of types of model images read by the image reading unit 20) stored in the RAM 73.

続いて、S119では、RAM73に記憶されている第1特徴量のうち、無効に設定されている第1特徴量以外の第1特徴量に基づき、S107と同様の手法で総合第1特徴量を特定する。その後、S112へ戻る。   Subsequently, in S119, based on the first feature quantity other than the first feature quantity set to invalid among the first feature quantities stored in the RAM 73, the overall first feature quantity is obtained by the same method as in S107. Identify. Thereafter, the process returns to S112.

一方、S115で、印刷を行うと判定した場合には、S120へ移行し、総合第1特徴量及びS111で特定した第2特徴量に基づいて元画像(サムネイル画像ではない)を補正する。なお、具体的な補正方法については後述する。   On the other hand, if it is determined in S115 that printing is to be performed, the process proceeds to S120, and the original image (not the thumbnail image) is corrected based on the total first feature value and the second feature value specified in S111. A specific correction method will be described later.

続いて、S122では、S121で補正された補正後の元画像を画像印刷部40に印刷させた後、本色変換処理を終了する。
[1−3−2.第1特徴量特定処理]
次に、色変換処理(図4)におけるS103で行われる第1特徴量特定処理について、図6のフローチャートを用いて説明する。なお、この第1特徴量特定処理においては、H値は、−30〜330の値をとるものとし、H値がこの範囲内にない場合は、H値を適宜変換することにより(例えば、“H値+360×n”又は“H値−360×n”、nは整数)、この範囲内に調整する。
Subsequently, in S122, after the original image corrected in S121 is printed on the image printing unit 40, the main color conversion process is terminated.
[1-3-2. First feature amount specifying process]
Next, the first feature amount specifying process performed in S103 in the color conversion process (FIG. 4) will be described with reference to the flowchart of FIG. In the first feature amount specifying process, the H value takes a value of −30 to 330. If the H value is not within this range, the H value is appropriately converted (for example, “ H value + 360 × n ”or“ H value−360 × n ”, where n is an integer), and adjust within this range.

CPU71は、第1特徴量特定処理を開始すると、まず、S201で、処理対象のお手本画像を複数の領域に分割する。本実施形態では、一般的に用いられる6つの色相に基づいて分割する。具体的には、それぞれの画素のH値に基づき、
・R領域: −30以上〜30未満
・Y領域: 30以上〜90未満
・G領域: 90以上〜150未満
・C領域: 150以上〜210未満
・B領域: 210以上〜270未満
・M領域: 270以上〜330未満
に分割する。つまり、お手本画像の構成画素をその色相値に応じた上記分類基準に従い、6つの分類項目に分類する処理を行う。なお、これらの領域とH値の対応関係はあくまでも一例であり、適宜変更可能なものである。
When starting the first feature amount specifying process, the CPU 71 first divides the model image to be processed into a plurality of regions in S201. In this embodiment, the image is divided based on six commonly used hues. Specifically, based on the H value of each pixel,
-R region: -30 or more and less than 30-Y region: 30 or more and less than 90-G region: 90 or more and less than 150-C region: 150 or more and less than 210-B region: 210 or more and less than 270-M region: Divide into 270 or more and less than 330. That is, a process of classifying the constituent pixels of the model image into six classification items according to the classification standard corresponding to the hue value is performed. The correspondence relationship between these areas and the H value is merely an example, and can be changed as appropriate.

続いて、S202では、S201で分割した領域ごとに、各領域がお手本画像中に占める割合と、各領域に属する構成画素の特徴を表す代表値(HSV値)とを、第1特徴量として算出する。   Subsequently, in S202, for each region divided in S201, the ratio of each region in the model image and the representative value (HSV value) representing the characteristics of the constituent pixels belonging to each region are calculated as the first feature amount. To do.

ここで、各領域の代表値(HSV値)を、以下のように定義する。
・R領域の代表値:sHr,sSr,sVr
・G領域の代表値:sHg,sSg,sVg
・B領域の代表値:sHb,sSb,sVb
・C領域の代表値:sHc,sSc,sVc
・M領域の代表値:sHm,sSm,sVm
・Y領域の代表値:sHy,sSy,sSy
本実施形態では、各領域に属する構成画素のHSV値それぞれの平均値を代表値として特定する。なお、代表値は平均値に限定されるものではなく、例えば中間値を用いることもできる。
Here, the representative value (HSV value) of each region is defined as follows.
-Typical values of R region: sHr, sSr, sVr
-Typical values in the G region: sHg, sSg, sVg
-Typical values of the B region: sHb, sSb, sVb
-Typical value of C region: sHc, sSc, sVc
-Typical values in the M region: sHm, sSm, sVm
-Typical values of the Y region: sHy, sSy, sSy
In this embodiment, the average value of each HSV value of the constituent pixels belonging to each region is specified as a representative value. The representative value is not limited to the average value, and for example, an intermediate value can be used.

また、各領域がお手本画像中に占める割合を、以下のように定義する。
・R領域がお手本画像中に占める割合:sRateR
・G領域がお手本画像中に占める割合:sRateG
・B領域がお手本画像中に占める割合:sRateB
・C領域がお手本画像中に占める割合:sRateC
・M領域がお手本画像中に占める割合:sRateM
・Y領域がお手本画像中に占める割合:sRateY
例えばR領域については、
sRateR=(お手本画像中のR領域の画素数)÷(お手本画像の全画素数)
とすることができる。なお、他の式によって定義してもよい。
Further, the ratio of each area in the model image is defined as follows.
The ratio of the R region in the model image: sRateR
-Ratio of the G area in the model image: sRateG
-Ratio of area B in the model image: sRateB
-Ratio of the C area in the model image: sRateC
-Ratio of M area in the model image: sRateM
The ratio of the Y area in the model image: sRateY
For example, for the R region:
sRateR = (number of pixels in the R region in the model image) / (total number of pixels in the model image)
It can be. In addition, you may define by another type | formula.

[1−3−3.総合第1特徴量を特定する処理]
次に、前述した色変換処理(図4)におけるS107で行われる総合第1特徴量(全お手本画像の特徴を加味した第1特徴量)を特定する処理について説明する。
[1-3-3. Processing for specifying the overall first feature amount]
Next, a process for specifying the comprehensive first feature value (first feature value taking into account the features of all model images) performed in S107 in the color conversion process (FIG. 4) described above will be described.

ここでは、画像読取部20で3つのお手本画像A〜Cを読み取った場合を例に挙げて説明する。ここで、各お手本画像A〜Cの第1特徴量を以下のように定義する。
<お手本画像Aの第1特徴量>
・R領域の代表値:sHr(A),sSr(A),sVr(A)
・G領域の代表値:sHg(A),sSg(A),sVg(A)
・B領域の代表値:sHb(A),sSb(A),sVb(A)
・C領域の代表値:sHc(A),sSc(A),sVc(A)
・M領域の代表値:sHm(A),sSm(A),sVm(A)
・Y領域の代表値:sHy(A),sSy(A),sSy(A)
・R領域がお手本画像中に占める割合:sRateR(A)
・G領域がお手本画像中に占める割合:sRateG(A)
・B領域がお手本画像中に占める割合:sRateB(A)
・C領域がお手本画像中に占める割合:sRateC(A)
・M領域がお手本画像中に占める割合:sRateM(A)
・Y領域がお手本画像中に占める割合:sRateY(A)
<お手本画像Bの第1特徴量>
・R領域の代表値:sHr(B),sSr(B),sVr(B)
・G領域の代表値:sHg(B),sSg(B),sVg(B)
・B領域の代表値:sHb(B),sSb(B),sVb(B)
・C領域の代表値:sHc(B),sSc(B),sVc(B)
・M領域の代表値:sHm(B),sSm(B),sVm(B)
・Y領域の代表値:sHy(B),sSy(B),sSy(B)
・R領域がお手本画像中に占める割合:sRateR(B)
・G領域がお手本画像中に占める割合:sRateG(B)
・B領域がお手本画像中に占める割合:sRateB(B)
・C領域がお手本画像中に占める割合:sRateC(B)
・M領域がお手本画像中に占める割合:sRateM(B)
・Y領域がお手本画像中に占める割合:sRateY(B)
<お手本画像Cの第1特徴量>
・R領域の代表値:sHr(C),sSr(C),sVr(C)
・G領域の代表値:sHg(C),sSg(C),sVg(C)
・B領域の代表値:sHb(C),sSb(C),sVb(C)
・C領域の代表値:sHc(C),sSc(C),sVc(C)
・M領域の代表値:sHm(C),sSm(C),sVm(C)
・Y領域の代表値:sHy(C),sSy(C),sSy(C)
・R領域がお手本画像中に占める割合:sRateR(C)
・G領域がお手本画像中に占める割合:sRateG(C)
・B領域がお手本画像中に占める割合:sRateB(C)
・C領域がお手本画像中に占める割合:sRateC(C)
・M領域がお手本画像中に占める割合:sRateM(C)
・Y領域がお手本画像中に占める割合:sRateY(C)
また、S107で特定する総合第1特徴量の各領域の代表値(HSV値)及び各領域のお手本画像中に占める割合を、以下のように定義する。
・R領域の代表値:sHr,sSr,sVr
・G領域の代表値:sHg,sSg,sVg
・B領域の代表値:sHb,sSb,sVb
・C領域の代表値:sHc,sSc,sVc
・M領域の代表値:sHm,sSm,sVm
・Y領域の代表値:sHy,sSy,sSy
・R領域がお手本画像中に占める割合:sRateR
・G領域がお手本画像中に占める割合:sRateG
・B領域がお手本画像中に占める割合:sRateB
・C領域がお手本画像中に占める割合:sRateC
・M領域がお手本画像中に占める割合:sRateM
・Y領域がお手本画像中に占める割合:sRateY
そして、S107では、各お手本画像A〜Cの第1特徴量の平均値を、総合第1特徴量として特定する。
Here, a case where the image reading unit 20 reads three example images A to C will be described as an example. Here, the first feature amount of each of the model images A to C is defined as follows.
<First feature amount of model image A>
-Representative values of R region: sHr (A), sSr (A), sVr (A)
-Representative values of G region: sHg (A), sSg (A), sVg (A)
-Representative value of B region: sHb (A), sSb (A), sVb (A)
-Representative value of C region: sHc (A), sSc (A), sVc (A)
-Typical values of M region: sHm (A), sSm (A), sVm (A)
-Representative values of the Y region: sHy (A), sSy (A), sSy (A)
The ratio of the R region in the model image: sRateR (A)
-Ratio of the G area in the model image: sRateG (A)
-Ratio of area B in the model image: sRateB (A)
-Ratio of the C area in the model image: sRateC (A)
-Ratio of M area in model image: sRateM (A)
-Proportion of the Y area in the model image: sRateY (A)
<First feature amount of model image B>
・ Representative value of R region: sHr (B), sSr (B), sVr (B)
-Typical values in the G region: sHg (B), sSg (B), sVg (B)
-Representative value of B region: sHb (B), sSb (B), sVb (B)
-Representative value of C region: sHc (B), sSc (B), sVc (B)
-Typical values in the M region: sHm (B), sSm (B), sVm (B)
-Representative values of the Y region: sHy (B), sSy (B), sSy (B)
The ratio of the R area in the model image: sRateR (B)
-Ratio of the G area in the model image: sRateG (B)
-Ratio of area B in the model image: sRateB (B)
-Ratio of the C area in the model image: sRateC (B)
The ratio of the M area in the model image: sRateM (B)
-Proportion of the Y area in the model image: sRateY (B)
<First feature amount of model image C>
-Typical values of R region: sHr (C), sSr (C), sVr (C)
-Representative value of G region: sHg (C), sSg (C), sVg (C)
-Representative value of B region: sHb (C), sSb (C), sVb (C)
-Representative value of C region: sHc (C), sSc (C), sVc (C)
-Representative values of M region: sHm (C), sSm (C), sVm (C)
-Representative values of the Y region: sHy (C), sSy (C), sSy (C)
The ratio of the R region in the model image: sRateR (C)
-Ratio of the G area in the model image: sRateG (C)
-Ratio of area B in the model image: sRateB (C)
-Ratio of the C area in the model image: sRateC (C)
-Ratio of the M area in the model image: sRateM (C)
The ratio of the Y area in the model image: sRateY (C)
Further, the representative value (HSV value) of each area of the comprehensive first feature amount specified in S107 and the ratio of each area in the model image are defined as follows.
-Typical values of R region: sHr, sSr, sVr
-Typical values in the G region: sHg, sSg, sVg
-Typical values of the B region: sHb, sSb, sVb
-Typical value of C region: sHc, sSc, sVc
-Typical values in the M region: sHm, sSm, sVm
-Typical values of the Y region: sHy, sSy, sSy
The ratio of the R region in the model image: sRateR
-Ratio of the G area in the model image: sRateG
-Ratio of area B in the model image: sRateB
-Ratio of the C area in the model image: sRateC
-Ratio of M area in the model image: sRateM
The ratio of the Y area in the model image: sRateY
In S107, the average value of the first feature values of the model images A to C is specified as the comprehensive first feature value.

具体的には、例えばR領域の代表値については次のように求める。
sHr=((sHr(A)×sRateR(A))
+(sHr(B)×sRateR(B))
+(sHr(C)×sRateR(C)))
/(sRateR(A)+sRateR(B)+sRateR(C))
sSr=((sSr(A)×sRateR(A))
+(sSr(B)×sRateR(B))
+(sSr(C)×sRateR(C)))
/(sRateR(A)+sRateR(B)+sRateR(C))
sVr=((sVr(A)×sRateR(A))
+(sVr(B)×sRateR(B))
+(sVr(C)×sRateR(C)))
/(sRateR(A)+sRateR(B)+sRateR(C))
このように、お手本画像の相対的な大きさの違いは加味せず、各お手本画像中に占める割合を加味して、各代表値の平均値を算出する。なお、他の領域の代表値についても同様に算出する。
Specifically, for example, the representative value of the R region is obtained as follows.
sHr = ((sHr (A) × sRateR (A))
+ (SHr (B) × sRateR (B))
+ (SHr (C) × sRateR (C)))
/ (SRateR (A) + sRateR (B) + sRateR (C))
sSr = ((sSr (A) × sRateR (A))
+ (SSr (B) × sRateR (B))
+ (SSr (C) × sRateR (C)))
/ (SRateR (A) + sRateR (B) + sRateR (C))
sVr = ((sVr (A) × sRateR (A))
+ (SVr (B) × sRateR (B))
+ (SVr (C) × sRateR (C)))
/ (SRateR (A) + sRateR (B) + sRateR (C))
In this way, the average value of the representative values is calculated by taking into account the proportion of each model image without considering the relative size difference of the model images. It should be noted that the representative values of other areas are calculated in the same manner.

また、各領域がお手本画像中に占める割合については、次のように求める。
sRateR
=(sRateR(A)+sRateR(B)+sRateR(C))/3
sRateG
=(sRateG(A)+sRateG(B)+sRateG(C))/3
sRateB
=(sRateB(A)+sRateB(B)+sRateB(C))/3
sRateC
=(sRateC(A)+sRateC(B)+sRateC(C))/3
sRateM
=(sRateM(A)+sRateM(B)+sRateM(C))/3
sRateY
=(sRateY(A)+sRateY(B)+sRateY(C))/3
[1−3−4.第2特徴量特定処理]
次に、前述した色変換処理(図4)におけるS111で行われる第2特徴量特定処理について、図7のフローチャートを用いて説明する。なお、この第2特徴量特定処理では、前述した第1特徴量特定処理(図6)でお手本画像に対して行った処理と同様の処理を、元画像に対して行う。
The ratio of each area in the model image is obtained as follows.
sRateR
= (SRateR (A) + sRateR (B) + sRateR (C)) / 3
sRateG
= (SRateG (A) + sRateG (B) + sRateG (C)) / 3
sRateB
= (SRateB (A) + sRateB (B) + sRateB (C)) / 3
sRateC
= (SRateC (A) + sRateC (B) + sRateC (C)) / 3
sRateM
= (SRateM (A) + sRateM (B) + sRateM (C)) / 3
sRateY
= (SRateY (A) + sRateY (B) + sRateY (C)) / 3
[1-3-4. Second feature value specifying process]
Next, the second feature amount specifying process performed in S111 in the above-described color conversion process (FIG. 4) will be described with reference to the flowchart of FIG. In the second feature quantity specifying process, the same process as that performed on the model image in the first feature quantity specifying process (FIG. 6) described above is performed on the original image.

すなわち、CPU71は、第2特徴量特定処理を開始すると、まず、S301で、元画像を6つの領域に分割する。この処理内容は、第1特徴量特定処理におけるS201の処理と同様であるので、具体的な説明については省略する。   That is, when the CPU 71 starts the second feature amount specifying process, first, in S301, the original image is divided into six regions. Since the processing content is the same as the processing of S201 in the first feature amount specifying processing, a detailed description thereof will be omitted.

続いて、S302では、元画像に対し、第1特徴量特定処理におけるS202の処理と同様の処理を行うことにより、第2特徴量を算出する。ここでは、各領域の代表値(HSV値)を、以下のように定義する。
・R領域の代表値:iHr,iSr,iVr
・G領域の代表値:iHg,iSg,iVg
・B領域の代表値:iHb,iSb,iVb
・C領域の代表値:iHc,iSc,iVc
・M領域の代表値:iHm,iSm,iVm
・Y領域の代表値:iHy,iSy,iSy
また、各領域が元画像中に占める割合を、以下のように定義する。
・R領域が元画像中に占める割合:iRateR
・G領域が元画像中に占める割合:iRateG
・B領域が元画像中に占める割合:iRateB
・C領域が元画像中に占める割合:iRateC
・M領域が元画像中に占める割合:iRateM
・Y領域が元画像中に占める割合:iRateY
[1−3−5.元画像の補正処理]
次に、前述した色変換処理(図4)におけるS113及びS120で行われる元画像(S113では元画像のサムネイル画像。以下同様に読み替える。)の補正処理の具体的方法について説明する。この処理は、元画像の各画素のH値、S値、V値をそれぞれ変換することによって行われる。
Subsequently, in S302, the second feature value is calculated by performing the same process as the process of S202 in the first feature value specifying process on the original image. Here, the representative value (HSV value) of each region is defined as follows.
・ Representative value of R region: iHr, iSr, iVr
・ Representative value of G region: iHg, iSg, iVg
・ Representative value of B area: iHb, iSb, iVb
-Typical value of C region: iHc, iSc, iVc
-Typical values in the M region: iHm, iSm, iVm
・ Representative value of Y area: iHy, iSy, iSy
Further, the ratio of each area in the original image is defined as follows.
-Ratio of R area in original image: iRateR
-Ratio of the G area in the original image: iRateG
-Ratio of B area in original image: iRateB
-Ratio of the C area in the original image: iRateC
-Ratio of M area in original image: iRateM
The ratio of the Y area in the original image: iRateY
[1-3-5. Original image correction processing]
Next, a specific method of the correction process of the original image (the thumbnail image of the original image in S113, which will be read similarly hereinafter) performed in S113 and S120 in the color conversion process (FIG. 4) described above will be described. This process is performed by converting the H value, S value, and V value of each pixel of the original image.

まず、H値における変換処理について説明する。
第2特徴量のH値の代表値をX軸にとり、総合第1特徴量のH値の代表値をY軸にとって領域ごとのH値の代表値をプロットする。そしてプロットされた点の間を、例えば線形補間することにより、図8に示す色相補正テーブルを作成する。ここで、この色相補正テーブルによる補正後のH値(Y軸のH値)をH’とし、H’<0の場合は、H’=H’+360とし、H’>360の場合は、H’=H’−360とする。
First, the conversion process for the H value will be described.
The representative value of the H value of the second feature amount is plotted on the X axis, and the representative value of the H value of the total first feature amount is plotted on the Y axis, and the representative value of the H value for each region is plotted. Then, a hue correction table shown in FIG. 8 is created by, for example, linear interpolation between the plotted points. Here, the H value after correction by the hue correction table (H value of the Y-axis) is H ′. When H ′ <0, H ′ = H ′ + 360, and when H ′> 360, H ′> 360. '= H'-360.

そして、元画像のそれぞれの画素に対し、上記色相補正テーブルを適用することによって、H値を補正する。具体的には、補正後のH’は、以下の式で定義することができる。
H’=(y2-y1)÷(x2-x1) × H
- (y2-y1)÷(x2-x1) × x2 + y2
・・・(式1)
ここで、x1,x2,y1,y2は、以下のように定義される。
Then, the H value is corrected by applying the hue correction table to each pixel of the original image. Specifically, H ′ after correction can be defined by the following equation.
H ′ = (y2−y1) ÷ (x2−x1) × H
-(y2-y1) ÷ (x2-x1) x x2 + y2
... (Formula 1)
Here, x1, x2, y1, and y2 are defined as follows.

H<iHrのときは、
(x1,y1)= (iHm−360,sHm−360)
(x2,y2)= (iHr,sHr)
iHr≦H<iHyのときは、
(x1,y1)= (iHr,sHr)
(x2,y2)= (iHy,sHy)
iHy≦H<iHgのときは、
(x1,y1)= (iHy,sHy)
(x2,y2)= (iHg,sHg)
iHg≦H<iHcのときは、
(x1,y1)= (iHg,sHg)
(x2,y2)= (iHc,sHc)
iHc≦H<iHbのときは、
(x1,y1)= (iHc,sHc)
(x2,y2)= (iHb,sHb)
iHb≦H<iHmのときは、
(x1,y1)= (iHb,sHb)
(x2,y2)= (iHm,sHm)
iHm≦Hのときは、
(x1,y1)= (iHm,sHm)
(x2,y2)= (iHr+360,sHr+360)
次に、S値及びV値における変換について説明する。
When H <iHr,
(X1, y1) = (iHm-360, sHm-360)
(X2, y2) = (iHr, sHr)
When iHr ≦ H <iHy,
(X1, y1) = (iHr, sHr)
(X2, y2) = (iHy, sHy)
When iHy ≦ H <iHg,
(X1, y1) = (iHy, sHy)
(X2, y2) = (iHg, sHg)
When iHg ≦ H <iHc,
(X1, y1) = (iHg, sHg)
(X2, y2) = (iHc, sHc)
When iHc ≦ H <iHb,
(X1, y1) = (iHc, sHc)
(X2, y2) = (iHb, sHb)
When iHb ≦ H <iHm,
(X1, y1) = (iHb, sHb)
(X2, y2) = (iHm, sHm)
When iHm ≦ H,
(X1, y1) = (iHm, sHm)
(X2, y2) = (iHr + 360, sHr + 360)
Next, conversion in the S value and the V value will be described.

S値及びV値は、H値によって分割された領域ごとに値が変換される。例えば、R領域について、
S ≦ iSrのときは、
S’=S×(sSr÷iSr) ・・・(式2)
S > iSrのときは、
S’=1+(S−1)×{(1−sSr)÷(1−iSr)} ・・・(式3)
V ≦ iVrのときは、
V’=V×(sVr÷iVr) ・・・(式4)
V > iVrのときは、
V’=1+(V−1)×{(1−sVr)÷(1−iVr)} ・・・(式5)
の式で求めることができる。また、その他の領域の計算についても同様に算出することができる。なお、以下においては、上記S値の変換式で定義される変換テーブルを彩度補正テーブルということがあり、また、上記V値の変換式で定義される変換テーブルを明度補正テーブルということがある。
The S value and the V value are converted for each area divided by the H value. For example, for the R region:
When S ≦ iSr,
S ′ = S × (sSr ÷ iSr) (Formula 2)
When S> iSr,
S ′ = 1 + (S−1) × {(1-sSr) ÷ (1-iSr)} (Formula 3)
When V ≦ iVr,
V ′ = V × (sVr ÷ iVr) (Formula 4)
When V> iVr,
V ′ = 1 + (V−1) × {(1−sVr) ÷ (1−iVr)} (Formula 5)
It can be calculated by the following formula. Further, other areas can be similarly calculated. In the following, the conversion table defined by the S value conversion formula may be referred to as a saturation correction table, and the conversion table defined by the V value conversion formula may be referred to as a brightness correction table. .

その後、変換されたHSV値を、画像印刷部40に適するフォーマット(例えば、RGB値)に変換する。なお、HSV値からRGB値への変換は、前述した公知の変換式に従い行うことができる。   Thereafter, the converted HSV value is converted into a format suitable for the image printing unit 40 (for example, RGB value). The conversion from the HSV value to the RGB value can be performed according to the above-described known conversion formula.

このように、H値に基づいて分割された領域ごとに、第2特徴量を第1特徴量に近づけるように元画像に対する補正処理を行うことによって、元画像の色合いをお手本画像の色合いに変換することができる。   In this way, the hue of the original image is converted to the hue of the model image by performing correction processing on the original image so that the second feature amount approaches the first feature amount for each region divided based on the H value. can do.

[1−3−6.代表値再設定処理]
次に、前述した色変換処理(図4)におけるS112で行われる代表値再設定処理について、図9のフローチャートを用いて説明する。
[1-3-6. Representative value reset process]
Next, the representative value resetting process performed in S112 in the above-described color conversion process (FIG. 4) will be described with reference to the flowchart of FIG.

CPU71は、代表値再設定処理を開始すると、まず、S401で、元画像において色相ごとに分割した6つの領域のうちの1つの領域について、色変換処理の対象とするか否かを判定する。ここで、その領域を色変換処理の対象とするか否かは、その領域が後述の変換対象条件を満たすか否かによって判定する。そして、色変換の対象とすると判定した場合には(S401:YES)、S403へ移行する。一方、色変換の対象としないと判定した場合には(S401:NO)、S402へ移行し、その領域に係る総合第1特徴量及び第2特徴量の代表値を再設定した後、S403へ移行する。なお、代表値の再設定方法については後述する。   When the CPU 71 starts the representative value resetting process, first, in S401, the CPU 71 determines whether one of the six areas divided for each hue in the original image is to be subjected to color conversion processing. Here, whether or not the area is to be subjected to color conversion processing is determined depending on whether or not the area satisfies a conversion target condition described later. If it is determined that the color conversion is to be performed (S401: YES), the process proceeds to S403. On the other hand, if it is determined not to be subject to color conversion (S401: NO), the process proceeds to S402, the representative values of the overall first feature value and the second feature value relating to the region are reset, and then the process proceeds to S403. Transition. A method for resetting the representative value will be described later.

S403では、6つの領域すべてについて、色変換の対象とするか否かの判定処理を行ったか否かを判定する。そして、色変換の対象とするか否かの判定処理を行っていない領域が残っていると判定した場合には(S403:NO)、S401に戻り処理を繰り返す。一方、すべての領域について判定処理を行ったと判定した場合には(S403:YES)、本代表値再設定処理を終了する。   In S403, it is determined whether or not the determination process for determining whether or not to make all six areas subject to color conversion has been performed. If it is determined that there remains an area for which the process for determining whether or not to perform color conversion remains (S403: NO), the process returns to S401 and is repeated. On the other hand, if it is determined that the determination process has been performed for all regions (S403: YES), the representative value resetting process is terminated.

ここで、S401の変換対象条件について説明する。
(A)しきい値Threを用いる方法
S401では、総合第1特徴量及び第2特徴量における対象領域についての割合値(お手本画像中又は元画像中に占める割合)がしきい値Thre以上である場合に、変換対象条件を満たす(色変換の対象とする)と判定する。そして、総合第1特徴量及び第2特徴量の少なくとも一方における対象領域についての割合値がしきい値Thre未満の場合には、S402で、その領域に係る総合第1特徴量及び第2特徴量の代表値を同じ値に変更し、変更後の代表値を用いて補正処理が行われるようにする。具体的には、代表値を次のように再設定する。
Here, the conversion target condition in S401 will be described.
(A) Method Using Threshold Thre In S401, the ratio value (the ratio occupied in the model image or the original image) for the target area in the total first feature value and the second feature value is equal to or greater than the threshold value Thre. In this case, it is determined that the conversion target condition is satisfied (the color conversion target). If the ratio value for the target region in at least one of the total first feature amount and the second feature amount is less than the threshold value Thre, in step S402, the total first feature amount and second feature amount relating to that region. The representative value is changed to the same value, and correction processing is performed using the changed representative value. Specifically, the representative value is reset as follows.

sRateR<Thre 又は iRateR<Thre のときは、
sHr=0,sSr=0.5,sVr=0.5,
iHr=0,iSr=0.5,iVr=0.5
sRateG<Thre 又は iRateG<Thre のときは、
sHg=120,sSg=0.5,sVg=0.5,
iHg=120,iSg=0.5,iVg=0.5
sRateB<Thre 又は iRateB<Thre のときは、
sHb=240,sSb=0.5,sVb=0.5,
iHb=240,iSb=0.5,iVb=0.5
sRateC<Thre 又は iRateC<Thre のときは、
sHc=180,sSc=0.5,sVc=0.5,
iHc=180,iSc=0.5,iVc=0.5
sRateM<Thre 又は iRateM<Thre のときは、
sHm=300,sSm=0.5,sVm=0.5,
iHm=300,iSm=0.5,iVm=0.5
sRateY<Thre 又は iRateY<Thre のときは、
sHy=60,sSy=0.5,sVy=0.5,
iHy=60,iSy=0.5,iVy=0.5
本実施形態では、S値及びV値については、そのとり得る値(0〜1)の中間値である0.5を採用し、H値においては、それぞれの領域の中間値を採用したが、これらはあくまでも一例に過ぎず、これらの数値に限定されるものではない。
When sRateR <Thre or iRateR <Thre,
sHr = 0, sSr = 0.5, sVr = 0.5,
iHr = 0, iSr = 0.5, iVr = 0.5
When sRateG <Thre or iRateG <Thre,
sHg = 120, sSg = 0.5, sVg = 0.5,
iHg = 120, iSg = 0.5, iVg = 0.5
When sRateB <Thre or iRateB <Thre,
sHb = 240, sSb = 0.5, sVb = 0.5,
iHb = 240, iSb = 0.5, iVb = 0.5
When sRateC <Thre or iRateC <Thre,
sHc = 180, sSc = 0.5, sVc = 0.5,
iHc = 180, iSc = 0.5, iVc = 0.5
When sRateM <Thre or iRateM <Thre,
sHm = 300, sSm = 0.5, sVm = 0.5,
iHm = 300, iSm = 0.5, iVm = 0.5
When sRateY <Thre or iRateY <Thre,
sHy = 60, sSy = 0.5, sVy = 0.5,
iHy = 60, iSy = 0.5, iVy = 0.5
In the present embodiment, for the S value and the V value, 0.5, which is an intermediate value of possible values (0 to 1), is adopted, and for the H value, the intermediate value of each region is adopted. These are merely examples, and are not limited to these numerical values.

このように代表値を変更することで、補正処理において、S値及びV値については、前述した変換式(式2)〜(式5)から明らかなように値が変換されない。すなわち、例えばR領域に関して、S ≦ iSrのときは、前述した(式2)のとおり、
S’=S×(sSr÷iSr)
の式で算出されるが、当該式において、sSr=0.5,iSr=0.5となるので、前述した式は、
S’=S×(0.5÷0.5)=S ・・・(式6)
となる。S>iSrのときも同様にS’=Sとなる。また、V値及び他の領域についても同様に変換されない。
By changing the representative value in this way, in the correction process, the values of the S value and the V value are not converted as is apparent from the conversion expressions (Expression 2) to (Expression 5) described above. That is, for example, with respect to the R region, when S ≦ iSr,
S ′ = S × (sSr ÷ iSr)
In this equation, sSr = 0.5 and iSr = 0.5, so the above-described equation is
S ′ = S × (0.5 ÷ 0.5) = S (Expression 6)
It becomes. Similarly, when S> iSr, S ′ = S. Similarly, the V value and other areas are not converted.

一方、H値については、図8においてプロットされる点が代表値に変更されるので、その領域における変換量を小さくすることができる。すなわち、前述した変換式(式1)を利用した場合であっても、代表値を変更することによって変換量が小さくなる。   On the other hand, for the H value, the points plotted in FIG. 8 are changed to the representative values, so that the conversion amount in that region can be reduced. That is, even when the above-described conversion formula (Formula 1) is used, the conversion amount is reduced by changing the representative value.

次に、しきい値Threの決定方法について説明する。この値は、例えば官能評価に基づいて決定することができる。官能評価では、約6%以上の面積を占めていれば、その領域は知覚されやすいことを確認した。したがって、しきい値Threとして、6%を採用することができる。ただし、しきい値Threは6%に限定されるものではない。   Next, a method for determining the threshold value Thre will be described. This value can be determined based on sensory evaluation, for example. In sensory evaluation, it was confirmed that if the area occupied about 6% or more, the area was easily perceived. Therefore, 6% can be adopted as the threshold value Thre. However, the threshold value Thre is not limited to 6%.

また、例えば、他の領域に対して相対的に面積が大きい領域を抽出するようにしきい値Threを決定してもよい。具体的には、分割される領域の数が6であれば、その逆数である1/6をしきい値Threとする。   For example, the threshold value Thre may be determined so as to extract a region having a relatively large area with respect to other regions. Specifically, if the number of regions to be divided is 6, the reciprocal 1/6 is set as the threshold value Thre.

ここで、分割される領域の数が6とは、色彩を表現する色域の1つであるRGB空間(頂点数8)から、無彩色である白と黒とを除いた残りの6つの頂点である。人が色彩を識別するには、色域を頂点数6に分類すれば十分であり、6より少なくすると、元画像がお手本画像のように変換されていないとユーザが感じる可能性が高くなる。逆に、6より細かく分割すれば、変換精度は高くなるが、人には識別できなくなる可能性が高くなる。また、分割数の増加に伴い計算量も増えるため、印刷結果が得られるまでの時間が長くなり、ユーザの不満も増加する可能性も高くなるので、分割される領域の数は6が好ましい。   Here, the number of divided areas is six. The remaining six vertices excluding white and black, which are achromatic colors, from the RGB space (number of vertices 8) which is one of the color gamuts expressing colors. It is. In order for a person to identify a color, it is sufficient to classify the color gamut into the number of vertices of 6, and if the number is less than 6, the user is more likely to feel that the original image is not converted like a model image. On the other hand, if the data is divided more finely than 6, the conversion accuracy is improved, but the possibility that the person cannot be identified increases. In addition, since the amount of calculation increases as the number of divisions increases, the time until a print result is obtained increases and the possibility of increasing user dissatisfaction increases. Therefore, the number of divided regions is preferably six.

なお、本実施形態では、すべての領域において同一のしきい値Threを用いているが、これに限定されるものではなく、領域ごとにしきい値Threを変更してもよい。
(B)最大領域の情報を用いる方法
上記(A)の方法では、しきい値Threを設定し、当該しきい値Threに基づいて代表値の変更、すなわち、色変換処理の停止、変換量の減少の制御を行った。ここでは、お手本画像の特定の色のみについて元画像に反映させるために、画像中の最大領域の情報を用いる方法について説明する。
In the present embodiment, the same threshold value Thre is used in all regions. However, the present invention is not limited to this, and the threshold value Thre may be changed for each region.
(B) Method Using Information on Maximum Region In the method (A) above, a threshold value Thre is set, and the representative value is changed based on the threshold value Thre, that is, the color conversion process is stopped, the conversion amount is changed. Reduction control was performed. Here, a method of using information on the maximum area in the image in order to reflect only a specific color of the model image in the original image will be described.

この場合、S401では、総合第1特徴量及び第2特徴量のいずれにおいても最も割合値が大きい領域である場合に、変換対象条件を満たす(色変換の対象とする)と判定する。そして、変換対象条件を満たさない領域については、S402で、その領域に係る総合第1特徴量及び第2特徴量の代表値を次のように再設定する。ここで、総合第1特徴量の割合値のうち最も大きい割合値を、sMaxRateとする。また、第2特徴量の割合値のうち最も大きい割合値を、iMaxRateとする。   In this case, in S401, it is determined that the conversion target condition is satisfied (to be color conversion target) when the region has the largest ratio value in both the total first feature amount and the second feature amount. And about the area | region which does not satisfy | fill conversion object conditions, the representative value of the comprehensive 1st feature value and 2nd feature value which concerns on the area | region is reset as follows in S402. Here, the largest ratio value among the ratio values of the overall first feature amount is sMaxRate. Further, the largest ratio value among the ratio values of the second feature amount is assumed to be iMaxRate.

sRateR≠iMaxRate又はiRateR≠sMaxRateのとき、
sHr=0,sSr=0.5,sVr=0.5,
iHr=0,iSr=0.5,iVr=0.5
sRateG≠iMaxRate又はiRateG≠sMaxRateのとき、
sHg=120,sSg=0.5,sVg=0.5,
iHg=120,iSg=0.5,iVg=0.5
sRateB≠iMaxRate又はiRateB≠sMaxRateのとき、
sHb=240,sSb=0.5,sVb=0.5,
iHb=240,iSb=0.5,iVb=0.5
sRateC≠iMaxRate又はiRateC≠sMaxRateのとき、
sHc=120,sSc=0.5,sVc=0.5,
iHc=120,iSc=0.5,iVc=0.5
sRateM≠iMaxRate又はiRateM≠sMaxRateのとき、
sHm=300,sSm=0.5,sVm=0.5,
iHm=300,iSm=0.5,iVm=0.5
sRateY≠iMaxRate又はiRateY≠sMaxRateのとき、
sHy=60,sSy=0.5,sVy=0.5,
iHy=60,iSy=0.5,iVy=0.5
このように代表値を設定することで、総合第1特徴量及び第2特徴量のいずれにおいても最も割合値の大きい領域のみが変換対象となるから、変換対象とならなかった領域のS値及びV値については変換が行われず、また、H値については変換量を減少させることができる。
When sRateR ≠ iMaxRate or iRateR ≠ sMaxRate,
sHr = 0, sSr = 0.5, sVr = 0.5,
iHr = 0, iSr = 0.5, iVr = 0.5
When sRateG ≠ iMaxRate or iRateG ≠ sMaxRate,
sHg = 120, sSg = 0.5, sVg = 0.5,
iHg = 120, iSg = 0.5, iVg = 0.5
When sRateB ≠ iMaxRate or iRateB ≠ sMaxRate,
sHb = 240, sSb = 0.5, sVb = 0.5,
iHb = 240, iSb = 0.5, iVb = 0.5
When sRateC ≠ iMaxRate or iRateC ≠ sMaxRate,
sHc = 120, sSc = 0.5, sVc = 0.5,
iHc = 120, iSc = 0.5, iVc = 0.5
When sRateM ≠ iMaxRate or iRateM ≠ sMaxRate,
sHm = 300, sSm = 0.5, sVm = 0.5,
iHm = 300, iSm = 0.5, iVm = 0.5
When sRateY ≠ iMaxRate or iRateY ≠ sMaxRate,
sHy = 60, sSy = 0.5, sVy = 0.5,
iHy = 60, iSy = 0.5, iVy = 0.5
Since the representative value is set in this way, only the region having the largest ratio value in both the overall first feature amount and the second feature amount is to be converted. Conversion is not performed for the V value, and the conversion amount can be reduced for the H value.

具体的には、例えばB領域のみを変換対象とした場合、図10に示すような色相補正テーブルが作成されることになる。この色相補正テーブルにおいては、色空間上B領域に隣接するC領域におけるH値の代表値(iHc=180,sHc=180)とB領域におけるH値の代表値(iHb,sHb)とが直線で結ばれ、また、色空間上B領域に隣接するM領域におけるH値の代表値(iHm=300,sHm=300)とB領域におけるH値の代表値(iHb,sHb)とが直線で結ばれることになる。   Specifically, for example, when only the B region is to be converted, a hue correction table as shown in FIG. 10 is created. In this hue correction table, the H value representative value (iHc = 180, sHc = 180) in the C region adjacent to the B region in the color space and the H value representative value (iHb, sHb) in the B region are linear. In addition, the representative value of the H value (iHm = 300, sHm = 300) in the M region adjacent to the B region in the color space and the representative value of the H value in the B region (iHb, sHb) are connected by a straight line. It will be.

このため、H値が180<H≦210のC領域、及びH値が270<H≦300のM領域についても変換されることになる。この変換量は、B領域に近い値ほど大きくなる。
このように、変換対象の領域を選択可能であり、また、変換対象ではない領域であっても、色空間上隣接するH値については一部変換されることになるから、変換対象の領域の変換対象ではない領域との間に擬似輪郭(階調とび)が生成されることを防ぐことができる。
Therefore, the C region where the H value is 180 <H ≦ 210 and the M region where the H value is 270 <H ≦ 300 are also converted. This conversion amount becomes larger as the value is closer to the B region.
In this way, the conversion target region can be selected, and even if the region is not the conversion target, the H value adjacent in the color space is partially converted. It is possible to prevent a pseudo contour (tone jump) from being generated between a region that is not a conversion target.

このような代表値再設定処理を行うことにより、分割されたそれぞれの領域に対し、領域の大きさに基づいて補正処理の一部を停止したり、変換量を小さくしたりすることができるため、ユーザは、お手本画像の一部の色合いのみを元画像の色合いに反映させるといったことが可能となる。   By performing such a representative value resetting process, it is possible to stop a part of the correction process or reduce the conversion amount for each divided area based on the size of the area. The user can reflect only a part of the hue of the model image in the hue of the original image.

[1−4.効果]
以上説明したように、本実施形態の複合機10は、複数種類のお手本画像を画像読取部20から入力し(S101,S105)、入力した複数種類のお手本画像の総合的な特徴を表す第1特徴量である総合第1特徴量を特定する(S102〜S104,S106,S107)。また、色変換の対象とする元画像をメモリカードから入力し(S108)、入力した元画像の特徴を表す第2特徴量を特定する(S110,S111)。そして、第2特徴量を総合第1特徴量に近づけるように、元画像に対する色変換処理を行う(S112,S120)。
[1-4. effect]
As described above, the multifunction machine 10 of the present embodiment inputs a plurality of types of model images from the image reading unit 20 (S101, S105), and represents the first characteristic representing the overall characteristics of the input types of model images. An overall first feature quantity that is a feature quantity is specified (S102 to S104, S106, S107). In addition, an original image to be subjected to color conversion is input from the memory card (S108), and a second feature amount representing the characteristics of the input original image is specified (S110, S111). Then, color conversion processing is performed on the original image so that the second feature amount approaches the overall first feature amount (S112, S120).

このような複合機10によれば、ユーザは、複数種類のお手本画像を用いることにより、それらの特徴に基づく色変換処理を複合機10に行わせることができる。このため、ユーザは、直感的に複数種類のお手本画像の色を混ぜ合わせるようなイメージで、手元のお手本画像には存在しない色を作り出すことが可能となり、1つのお手本画像のみを用いる場合に比べ、ユーザの意図をより正確に反映した色変換処理を行うことができる。   According to such a multifunction device 10, the user can cause the multifunction device 10 to perform color conversion processing based on these features by using a plurality of types of model images. For this reason, the user can intuitively create colors that do not exist in the model image at hand by using an image that mixes the colors of multiple types of model images, compared to the case where only one model image is used. Therefore, it is possible to perform color conversion processing that reflects the user's intention more accurately.

具体的には、お手本画像を入力すると(S101)、そのお手本画像の特徴を表す第1特徴量を特定して記憶し(S102〜S104)、各お手本画像の第1特徴量に基づき総合第1特徴量を特定するようにしている(S106,S107)。このため、入力したすべてのお手本画像を同時に記憶しておく必要がなく、お手本画像を記憶するために必要な記憶容量を節約することが可能となる。   Specifically, when a model image is input (S101), a first feature amount representing the feature of the model image is specified and stored (S102 to S104), and the first comprehensive amount based on the first feature amount of each model image is stored. The feature amount is specified (S106, S107). For this reason, it is not necessary to store all the input model images at the same time, and it is possible to save the storage capacity necessary for storing the model images.

また、図11に示すように、入力した複数種類のお手本画像の相対的な大きさの違いを加味することなく、各お手本画像の第1特徴量のみに基づき総合第1特徴量を特定するようにしているため、大きさの異なるお手本画像を用いた場合にも、その大きさの違いに影響されることなく色変換を行うことができる。   Further, as shown in FIG. 11, the total first feature amount is specified based on only the first feature amount of each model image without taking into account the relative size difference between the input multiple types of model images. Therefore, even when model images having different sizes are used, color conversion can be performed without being affected by the difference in size.

一方、この複合機10では、画像が印刷される前に色変換処理結果を表す補正イメージ画像が表示部32に表示されるため(S114)、ユーザは、所望の色変換処理結果が得られるか否かを補正イメージ画像に基づき簡易的に判断することができる。そして、ユーザは、補正イメージ画像が所望の色変換処理結果を表すものでなければ、色変換処理に用いるお手本画像を新たに追加したり不要なお手本画像を除外したりすることができる(S115〜S119)。このため、印刷を無駄に行うことなく色変換処理の微調整が可能となり、ユーザが意図する適切な色変換処理結果を得ることができる。   On the other hand, in this multifunction device 10, since the corrected image image representing the color conversion processing result is displayed on the display unit 32 before the image is printed (S114), can the user obtain the desired color conversion processing result? It is possible to easily determine whether or not based on the corrected image. Then, if the corrected image does not represent a desired color conversion processing result, the user can newly add a model image used for the color conversion process or exclude an unnecessary model image (S115). S119). For this reason, it is possible to finely adjust the color conversion process without wasteful printing, and an appropriate color conversion process result intended by the user can be obtained.

加えて、元画像の縮小画像に対して色変換処理を行うことにより補正イメージ画像を生成するようにしているため、元画像自体に対して色変換処理を行う場合に比べ、補正イメージ画像を生成する処理を簡素化することができる。   In addition, since a corrected image is generated by performing color conversion processing on the reduced image of the original image, a corrected image image is generated as compared with the case where color conversion processing is performed on the original image itself. The processing to be performed can be simplified.

[1−5.特許請求の範囲との対応]
なお、第1実施形態の複合機10では、色変換処理(図4)におけるS101,S105の処理を実行するCPU71が、第1画像入力手段に相当し、S102,S103の処理を実行するCPU71が、第1特徴量特定手段に相当し、S104,S106,S107の処理を実行するCPU71が、総合第1特徴量特定手段に相当する。また、S108の処理を実行するCPU71が、第2画像入力手段に相当し、S109,S113,S114の処理を実行するCPU71が、出力手段に相当する。また、S110,S111の処理を実行するCPU71が、第2特徴量特定手段に相当し、S112,S115〜S120の処理を実行するCPU71が、画像補正手段に相当する。
[1-5. Correspondence with Claims]
In the MFP 10 of the first embodiment, the CPU 71 that executes the processing of S101 and S105 in the color conversion processing (FIG. 4) corresponds to the first image input means, and the CPU 71 that executes the processing of S102 and S103. The CPU 71 that executes the processes of S104, S106, and S107 corresponds to the first feature amount specifying means. The CPU 71 that executes the process of S108 corresponds to the second image input unit, and the CPU 71 that executes the processes of S109, S113, and S114 corresponds to the output unit. Further, the CPU 71 that executes the processes of S110 and S111 corresponds to a second feature amount specifying unit, and the CPU 71 that executes the processes of S112 and S115 to S120 corresponds to an image correcting unit.

[2.第2実施形態]
次に、第2実施形態の複合機10について説明する。
第2実施形態の複合機10は、前述した第1実施形態の色変換処理(図4)に代えて、図12のフローチャートに示す色変換処理を行う点が第1実施形態の複合機10と異なる。その他、共通する内容については説明を省略する。
[2. Second Embodiment]
Next, the multifunction machine 10 of the second embodiment will be described.
The MFP 10 of the second embodiment is different from the MFP 10 of the first embodiment in that the color conversion process shown in the flowchart of FIG. 12 is performed instead of the color conversion process (FIG. 4) of the first embodiment described above. Different. Description of other common contents will be omitted.

図12の色変換処理は、図4の色変換処理と対比すると、S504,S506,S507の処理内容が、S104,S106,S107の処理内容と一部異なっており、残りのS501〜S503,S505,S508〜S521の各処理内容は、S101〜S103,S105,S108〜S121の各処理内容と共通している。そこで、この相違点に係る処理を中心に説明し、共通する部分については説明を省略する。   Compared with the color conversion process of FIG. 4, the color conversion process of FIG. 12 is partially different from the process contents of S104, S106, and S107, and the remaining S501 to S503 and S505. , S508 to S521 have the same processing contents as S101 to S103, S105, and S108 to S121. Therefore, the processing related to this difference will be mainly described, and description of common portions will be omitted.

S504では、S503で特定した第1特徴量と、第1特徴量を特定するのに用いられた範囲をRAM73に記憶させる。ここで、「範囲」とは、各代表値を算出するために用いられた構成画素の画素数(つまり、各領域に属する構成画素の画素数)のことである。また、既に別のお手本画像についての第1特徴量及び範囲がRAM73に記憶されている場合には、その第1特徴量及び範囲の記憶状態を維持しつつ、新たに追加する形で記憶させる。具体的には、RAM73に記憶される第1特徴量及び範囲は、本色変換処理の開始時又は終了時に消去されるようになっており、本色変換処理が開始されてから終了されるまでの間は記憶状態が維持される。したがって、S501〜S504の処理が繰り返されることにより、複数のお手本画像についての複数の第1特徴量及び範囲がRAM73に記憶されることになる。なお、第1特徴量及び範囲の記憶先はRAM73に限定されるものではなく、例えば複合機10がハードディスクを備えている場合にはハードディスクに記憶させてもよい。   In S504, the first feature value specified in S503 and the range used to specify the first feature value are stored in the RAM 73. Here, the “range” is the number of constituent pixels used for calculating each representative value (that is, the number of constituent pixels belonging to each region). If the first feature amount and range for another model image are already stored in the RAM 73, the first feature amount and range are stored in a newly added form while maintaining the storage state of the first feature amount and range. Specifically, the first feature value and range stored in the RAM 73 are erased at the start or end of the main color conversion process, and from the start to the end of the main color conversion process. The memory state is maintained. Therefore, by repeating the processing of S501 to S504, a plurality of first feature amounts and ranges for a plurality of model images are stored in the RAM 73. Note that the storage destination of the first feature amount and the range is not limited to the RAM 73. For example, when the multifunction machine 10 includes a hard disk, it may be stored in the hard disk.

S506では、S504でRAM73に記憶させたすべての第1特徴量(以下「第1特徴量群」ともいう。)及び範囲(以下「範囲群」ともいう。)を読み出す。
続いて、S507では、S506で読み出した第1特徴量群及び範囲群に基づき、複数種類のお手本画像の総合的な特徴を表す第1特徴量である総合第1特徴量を特定する。
In S506, all the first feature values (hereinafter also referred to as “first feature value group”) and ranges (hereinafter also referred to as “range groups”) stored in the RAM 73 in S504 are read out.
Subsequently, in S507, based on the first feature amount group and the range group read in S506, an overall first feature amount that is a first feature amount representing the overall features of a plurality of types of model images is specified.

ここでは、画像読取部20で3つのお手本画像A〜Cを読み取った場合を例に挙げて説明する。ここで、各お手本画像A〜Cの第1特徴量を以下のように定義する。
<お手本画像Aの第1特徴量及び範囲>
・R領域の代表値:sHr(A),sSr(A),sVr(A)
・G領域の代表値:sHg(A),sSg(A),sVg(A)
・B領域の代表値:sHb(A),sSb(A),sVb(A)
・C領域の代表値:sHc(A),sSc(A),sVc(A)
・M領域の代表値:sHm(A),sSm(A),sVm(A)
・Y領域の代表値:sHy(A),sSy(A),sSy(A)
・R領域がお手本画像中に占める割合:sRateR(A)
・G領域がお手本画像中に占める割合:sRateG(A)
・B領域がお手本画像中に占める割合:sRateB(A)
・C領域がお手本画像中に占める割合:sRateC(A)
・M領域がお手本画像中に占める割合:sRateM(A)
・Y領域がお手本画像中に占める割合:sRateY(A)
・R領域の第1特徴量を算出するのに用いた範囲(Pixel):sAreaR(A)
・G領域の第1特徴量を算出するのに用いた範囲(Pixel):sAreaG(A)
・B領域の第1特徴量を算出するのに用いた範囲(Pixel):sAreaB(A)
・C領域の第1特徴量を算出するのに用いた範囲(Pixel):sAreaC(A)
・M領域の第1特徴量を算出するのに用いた範囲(Pixel):sAreaM(A)
・Y領域の第1特徴量を算出するのに用いた範囲(Pixel):sAreaY(A)
<お手本画像Bの第1特徴量及び範囲>
・R領域の代表値:sHr(B),sSr(B),sVr(B)
・G領域の代表値:sHg(B),sSg(B),sVg(B)
・B領域の代表値:sHb(B),sSb(B),sVb(B)
・C領域の代表値:sHc(B),sSc(B),sVc(B)
・M領域の代表値:sHm(B),sSm(B),sVm(B)
・Y領域の代表値:sHy(B),sSy(B),sSy(B)
・R領域がお手本画像中に占める割合:sRateR(B)
・G領域がお手本画像中に占める割合:sRateG(B)
・B領域がお手本画像中に占める割合:sRateB(B)
・C領域がお手本画像中に占める割合:sRateC(B)
・M領域がお手本画像中に占める割合:sRateM(B)
・Y領域がお手本画像中に占める割合:sRateY(B)
・R領域の第1特徴量を算出するのに用いた範囲(Pixel):sAreaR(B)
・G領域の第1特徴量を算出するのに用いた範囲(Pixel):sAreaG(B)
・B領域の第1特徴量を算出するのに用いた範囲(Pixel):sAreaB(B)
・C領域の第1特徴量を算出するのに用いた範囲(Pixel):sAreaC(B)
・M領域の第1特徴量を算出するのに用いた範囲(Pixel):sAreaM(B)
・Y領域の第1特徴量を算出するのに用いた範囲(Pixel):sAreaY(B)
<お手本画像Cの第1特徴量及び範囲>
・R領域の代表値:sHr(C),sSr(C),sVr(C)
・G領域の代表値:sHg(C),sSg(C),sVg(C)
・B領域の代表値:sHb(C),sSb(C),sVb(C)
・C領域の代表値:sHc(C),sSc(C),sVc(C)
・M領域の代表値:sHm(C),sSm(C),sVm(C)
・Y領域の代表値:sHy(C),sSy(C),sSy(C)
・R領域がお手本画像中に占める割合:sRateR(C)
・G領域がお手本画像中に占める割合:sRateG(C)
・B領域がお手本画像中に占める割合:sRateB(C)
・C領域がお手本画像中に占める割合:sRateC(C)
・M領域がお手本画像中に占める割合:sRateM(C)
・Y領域がお手本画像中に占める割合:sRateY(C)
・R領域の第1特徴量を算出するのに用いた範囲(Pixel):sAreaR(C)
・G領域の第1特徴量を算出するのに用いた範囲(Pixel):sAreaG(C)
・B領域の第1特徴量を算出するのに用いた範囲(Pixel):sAreaB(C)
・C領域の第1特徴量を算出するのに用いた範囲(Pixel):sAreaC(C)
・M領域の第1特徴量を算出するのに用いた範囲(Pixel):sAreaM(C)
・Y領域の第1特徴量を算出するのに用いた範囲(Pixel):sAreaY(C)
また、S507で特定する総合第1特徴量の各領域の代表値(HSV値)及び各領域のお手本画像中に占める割合を、以下のように定義する。
・R領域の代表値:sHr,sSr,sVr
・G領域の代表値:sHg,sSg,sVg
・B領域の代表値:sHb,sSb,sVb
・C領域の代表値:sHc,sSc,sVc
・M領域の代表値:sHm,sSm,sVm
・Y領域の代表値:sHy,sSy,sSy
・R領域がお手本画像中に占める割合:sRateR
・G領域がお手本画像中に占める割合:sRateG
・B領域がお手本画像中に占める割合:sRateB
・C領域がお手本画像中に占める割合:sRateC
・M領域がお手本画像中に占める割合:sRateM
・Y領域がお手本画像中に占める割合:sRateY
そして、S507では、各お手本画像A〜Cの第1特徴量の平均値(範囲に基づき重み付けした平均値)を、総合第1特徴量として特定する。
Here, a case where the image reading unit 20 reads three example images A to C will be described as an example. Here, the first feature amount of each of the model images A to C is defined as follows.
<First feature amount and range of sample image A>
-Representative values of R region: sHr (A), sSr (A), sVr (A)
-Representative values of G region: sHg (A), sSg (A), sVg (A)
-Representative value of B region: sHb (A), sSb (A), sVb (A)
-Representative value of C region: sHc (A), sSc (A), sVc (A)
-Typical values of M region: sHm (A), sSm (A), sVm (A)
-Representative values of the Y region: sHy (A), sSy (A), sSy (A)
The ratio of the R region in the model image: sRateR (A)
-Ratio of the G area in the model image: sRateG (A)
-Ratio of area B in the model image: sRateB (A)
-Ratio of the C area in the model image: sRateC (A)
-Ratio of M area in model image: sRateM (A)
-Proportion of the Y area in the model image: sRateY (A)
A range (Pixel) used to calculate the first feature amount of the R region: sAreaR (A)
A range (Pixel) used to calculate the first feature amount of the G region: sAreaG (A)
A range (Pixel) used to calculate the first feature amount of the B area: sAreaB (A)
A range (Pixel) used to calculate the first feature amount of the C area: sAreaC (A)
A range (Pixel) used to calculate the first feature amount of the M region: sAreaM (A)
A range (Pixel) used to calculate the first feature amount of the Y region: sAreaY (A)
<First feature amount and range of model image B>
・ Representative value of R region: sHr (B), sSr (B), sVr (B)
-Typical values in the G region: sHg (B), sSg (B), sVg (B)
-Representative value of B region: sHb (B), sSb (B), sVb (B)
-Representative value of C region: sHc (B), sSc (B), sVc (B)
-Typical values in the M region: sHm (B), sSm (B), sVm (B)
-Representative values of the Y region: sHy (B), sSy (B), sSy (B)
The ratio of the R area in the model image: sRateR (B)
-Ratio of the G area in the model image: sRateG (B)
-Ratio of area B in the model image: sRateB (B)
-Ratio of the C area in the model image: sRateC (B)
The ratio of the M area in the model image: sRateM (B)
-Proportion of the Y area in the model image: sRateY (B)
A range (Pixel) used to calculate the first feature amount of the R region: sAreaR (B)
A range (Pixel) used to calculate the first feature amount of the G region: sAreaG (B)
A range (Pixel) used to calculate the first feature amount of the B area: sAreaB (B)
A range (Pixel) used to calculate the first feature amount of the C area: sAreaC (B)
A range (Pixel) used to calculate the first feature amount of the M region: sAreaM (B)
A range (Pixel) used to calculate the first feature amount of the Y region: sAreaY (B)
<First feature amount and range of model image C>
・ Representative values of R region: sHr (C), sSr (C), sVr (C)
-Representative value of G region: sHg (C), sSg (C), sVg (C)
-Representative value of B region: sHb (C), sSb (C), sVb (C)
-Representative value of C region: sHc (C), sSc (C), sVc (C)
-Representative values of M region: sHm (C), sSm (C), sVm (C)
-Representative values of the Y region: sHy (C), sSy (C), sSy (C)
The ratio of the R region in the model image: sRateR (C)
-Ratio of the G area in the model image: sRateG (C)
-Ratio of area B in the model image: sRateB (C)
-Ratio of the C area in the model image: sRateC (C)
-Ratio of the M area in the model image: sRateM (C)
The ratio of the Y area in the model image: sRateY (C)
A range (Pixel) used to calculate the first feature amount of the R region: sAreaR (C)
A range (Pixel) used to calculate the first feature amount of the G region: sAreaG (C)
A range (Pixel) used to calculate the first feature amount of the B area: sAreaB (C)
A range (Pixel) used to calculate the first feature amount of the C area: sAreaC (C)
A range (Pixel) used to calculate the first feature amount of the M region: sAreaM (C)
A range (Pixel) used to calculate the first feature amount of the Y region: sAreaY (C)
Further, the representative value (HSV value) of each area of the total first feature amount specified in S507 and the ratio of each area in the model image are defined as follows.
-Typical values of R region: sHr, sSr, sVr
-Typical values in the G region: sHg, sSg, sVg
-Typical values of the B region: sHb, sSb, sVb
-Typical value of C region: sHc, sSc, sVc
-Typical values in the M region: sHm, sSm, sVm
-Typical values of the Y region: sHy, sSy, sSy
The ratio of the R region in the model image: sRateR
-Ratio of the G area in the model image: sRateG
-Ratio of area B in the model image: sRateB
-Ratio of the C area in the model image: sRateC
-Ratio of M area in the model image: sRateM
The ratio of the Y area in the model image: sRateY
In step S507, the average value (average value weighted based on the range) of the first feature amounts of the model images A to C is specified as the comprehensive first feature amount.

具体的には、例えばR領域の代表値については次のように求める。
sHr=((sHr(A)×sAreaR(A))
+(sHr(B)×sAreaR(B))
+(sHr(C)×sAreaR(C)))
/(sAreaR(A)+sAreaR(B)+sAreaR(C))
sSr=((sSr(A)×sAreaR(A))
+(sSr(B)×sAreaR(B))
+(sSr(C)×sAreaR(C)))
/(sAreaR(A)+sAreaR(B)+sAreaR(C))
sVr=((sVr(A)×sAreaR(A))
+(sVr(B)×sAreaR(B))
+(sVr(C)×sAreaR(C)))
/(sAreaR(A)+sAreaR(B)+sAreaR(C))
このように、お手本画像の相対的な大きさの違いを加味して、各代表値の平均値を算出する。なお、他の領域の代表値についても同様に算出する。
Specifically, for example, the representative value of the R region is obtained as follows.
sHr = ((sHr (A) × sAreaR (A))
+ (SHr (B) × sAreaR (B))
+ (SHr (C) × sAreaR (C)))
/ (SAreaR (A) + sAreaR (B) + sAreaR (C))
sSr = ((sSr (A) × sAreaR (A))
+ (SSr (B) × sAreaR (B))
+ (SSr (C) × sAreaR (C)))
/ (SAreaR (A) + sAreaR (B) + sAreaR (C))
sVr = ((sVr (A) × sAreaR (A))
+ (SVr (B) × sAreaR (B))
+ (SVr (C) × sAreaR (C)))
/ (SAreaR (A) + sAreaR (B) + sAreaR (C))
In this way, the average value of the representative values is calculated in consideration of the relative size difference of the model images. It should be noted that the representative values of other areas are calculated in the same manner.

また、各領域がお手本画像中に占める割合については、次のように求める。
まず、各色の範囲の合計値を算出する。
sumAreaR=sAreaR(A)+sAreaR(B)+sAreaR(C)
sumAreaG=sAreaG(A)+sAreaG(B)+sAreaG(C)
sumAreaB=sAreaB(A)+sAreaB(B)+sAreaB(C)
sumAreaC=sAreaC(A)+sAreaC(B)+sAreaC(C)
sumAreaM=sAreaM(A)+sAreaM(B)+sAreaM(C)
sumAreaY=sAreaY(A)+sAreaY(B)+sAreaY(C)
次に、すべての範囲の合計値を算出する。
The ratio of each area in the model image is obtained as follows.
First, the total value of each color range is calculated.
sumAreaR = sAreaR (A) + sAreaR (B) + sAreaR (C)
sumAreaG = sAreaG (A) + sAreaG (B) + sAreaG (C)
sumAreaB = sAreaB (A) + sAreaB (B) + sAreaB (C)
sumAreaC = sAreaC (A) + sAreaC (B) + sAreaC (C)
sumAreaM = sAreaM (A) + sAreaM (B) + sAreaM (C)
sumAreaY = sAreaY (A) + sAreaY (B) + sAreaY (C)
Next, the total value of all ranges is calculated.

sumArea=sumAreaR+sumAreaG+sumAreaB
+sumAreaC+sumAreaM+sumAreaY
この合計値を用いて、各領域の存在割合を算出する。
・R領域がお手本画像中に占める割合:
sRateR=sumAreaR/sumArea
・G領域がお手本画像中に占める割合:
sRateG=sumAreaG/sumArea
・B領域がお手本画像中に占める割合:
sRateB=sumAreaB/sumArea
・C領域がお手本画像中に占める割合:
sRateC=sumAreaC/sumArea
・M領域がお手本画像中に占める割合:
sRateM=sumAreaM/sumArea
・Y領域がお手本画像中に占める割合:
sRateY=sumAreaY/sumArea
以上のように、第2実施形態の複合機10では、図13に示すように、入力した複数種類のお手本画像について、各お手本画像の第1特徴量と、その第1特徴量を特定するために用いたお手本画像の範囲の大きさとから、総合第1特徴量を特定する。このため、お手本画像の相対的な大きさの違いを反映させて、複数種類のお手本画像の色を混ぜ合わせることができる。この結果、例えば、画像読取部20の原稿載置面よりもサイズの大きい画像をお手本画像として用いたい場合に、その画像を複数に分割して読み取らせることで、擬似的に元の画像を一度に読み取らせた場合と同等の色変換処理が可能となる。
sumArea = sumAreaR + sumAreaG + sumAreaB
+ SumAreaC + sumAreaM + sumAreaY
Using this total value, the existence ratio of each region is calculated.
The ratio of the R region in the model image:
sRateR = sumAreaR / sumArea
-Ratio of G area in the model image:
sRateG = sumAreaG / sumArea
-Ratio of area B in the model image:
sRateB = sumAreaB / sumArea
-Ratio of the C area in the model image:
sRateC = sumAreaC / sumArea
-Ratio of the M area in the model image:
sRateM = sumAreaM / sumArea
The ratio of the Y area in the model image:
sRateY = sumAreaY / sumArea
As described above, in the multifunction machine 10 according to the second embodiment, as shown in FIG. 13, the first feature amount of each model image and the first feature amount thereof are specified for a plurality of types of model images input. The total first feature value is specified from the size of the range of the model image used in the above. Therefore, it is possible to mix the colors of a plurality of types of model images by reflecting the difference in relative sizes of the model images. As a result, for example, when an image having a size larger than the document placement surface of the image reading unit 20 is to be used as a model image, the original image is temporarily reproduced once by dividing the image into a plurality of images. The color conversion process equivalent to the case where the image data is read by can be performed.

なお、第2実施形態の複合機10では、色変換処理(図12)におけるS501,S505の処理を実行するCPU71が、第1画像入力手段に相当し、S502,S503の処理を実行するCPU71が、第1特徴量特定手段に相当し、S504,S506,S507の処理を実行するCPU71が、総合第1特徴量特定手段に相当する。また、S508の処理を実行するCPU71が、第2画像入力手段に相当し、S509,S513,S514の処理を実行するCPU71が、出力手段に相当する。また、S510,S511の処理を実行するCPU71が、第2特徴量特定手段に相当し、S512,S515〜S520の処理を実行するCPU71が、画像補正手段に相当する。   In the MFP 10 of the second embodiment, the CPU 71 that executes the processes of S501 and S505 in the color conversion process (FIG. 12) corresponds to the first image input means, and the CPU 71 that executes the processes of S502 and S503. The CPU 71 that corresponds to the first feature quantity specifying means and executes the processes of S504, S506, and S507 corresponds to the comprehensive first feature quantity specifying means. The CPU 71 that executes the process of S508 corresponds to the second image input unit, and the CPU 71 that executes the processes of S509, S513, and S514 corresponds to the output unit. Further, the CPU 71 that executes the processes of S510 and S511 corresponds to the second feature amount specifying means, and the CPU 71 that executes the processes of S512, S515 to S520 corresponds to the image correcting means.

[3.第3実施形態]
次に、第3実施形態の複合機10について説明する。
第3実施形態の複合機10は、前述した第1実施形態の色変換処理(図4)に代えて、図14のフローチャートに示す色変換処理を行う点が第1実施形態の複合機10と異なる。その他、共通する内容については説明を省略する。
[3. Third Embodiment]
Next, the multifunction machine 10 of the third embodiment will be described.
The MFP 10 of the third embodiment is different from the MFP 10 of the first embodiment in that the color conversion process shown in the flowchart of FIG. 14 is performed instead of the color conversion process (FIG. 4) of the first embodiment described above. Different. Description of other common contents will be omitted.

図14の色変換処理は、図4の色変換処理と対比すると、S101〜S107の処理に代えて、S601〜S606の処理を行う点と、S117〜S119の処理に代えて、S616〜S618の処理を行う点が異なっている。その他、S607〜S615,S619,S620の各処理内容は、S108〜S116,S120,S121の各処理内容と共通している。そこで、この相違点に係る処理を中心に説明し、共通する部分につては説明を省略する。   The color conversion process of FIG. 14 is compared with the color conversion process of FIG. 4 in that the process of S601 to S606 is performed instead of the process of S101 to S107, and the process of S616 to S618 is replaced with the process of S117 to S119. The difference is in the processing. In addition, the processing contents of S607 to S615, S619, and S620 are the same as the processing contents of S108 to S116, S120, and S121. Therefore, the processing related to this difference will be mainly described, and description of common portions will be omitted.

CPU71は、色変換処理を開始すると、まず、S601で、画像読取部20の原稿載置面全域を1つの全体画像として読み取る。なお、読み取った画像の形式は特に限定されないが、本実施形態ではRGB形式を前提として説明する。   When the CPU 71 starts the color conversion process, first, in step S601, the entire document placement surface of the image reading unit 20 is read as one whole image. Although the format of the read image is not particularly limited, the present embodiment will be described on the assumption of the RGB format.

続いて、S602では、S601で読み取った全体画像から、お手本画像を抽出する。本実施形態では、原稿載置面を複数に分割した各読取領域で読み取られる画像を独立したお手本画像として認識するようにしている。具体的には、例えば図15(b)に示すように、原稿載置面を縦横にそれぞれ二分して4つの読取領域に分割することが可能であり、この場合には、図15(a)に示すように複数(図の例では3枚)の写真をセットすれば、図15(c)に示すように各写真の画像が独立した画像として認識される。したがって、この段階では、写真がセットされていない読取領域(図15(c)でいうImage1)についても、1つの画像(白色の画像)として認識されることとなる。なお、読取領域の分割数は、あらかじめ設定されていてもよく、ユーザが設定できるようにしてもよい。   In step S602, a model image is extracted from the entire image read in step S601. In this embodiment, an image read in each reading area obtained by dividing the document placement surface into a plurality of parts is recognized as an independent model image. Specifically, for example, as shown in FIG. 15 (b), the document placement surface can be divided into four reading areas in the vertical and horizontal directions. In this case, FIG. As shown in FIG. 15, if a plurality of (three in the example in the figure) photos are set, the images of the photos are recognized as independent images as shown in FIG. Therefore, at this stage, the reading area (Image 1 in FIG. 15C) where no photograph is set is also recognized as one image (white image). Note that the number of divisions of the reading area may be set in advance or may be set by the user.

続いて、S603では、S602で抽出した各お手本画像のうち、画像全体の平均輝度値meanVが、あらかじめ設定されているしきい値ThreV(例えば0.97)以上のものが存在するか否かを判定する。ここで、しきい値ThreVは、画像読取部20の原稿載置面に原稿がセットされているか否かの判定基準値として設定されており、平均輝度値meanVがしきい値ThreV以上の場合(白色のみの画像と判断される場合)には、原稿が存在しない可能性が高いことになる。   Subsequently, in S603, it is determined whether or not there is a sample image extracted in S602 having an average luminance value meanV of the entire image equal to or higher than a preset threshold value ThreV (for example, 0.97). judge. Here, the threshold value ThreV is set as a reference value for determining whether or not a document is set on the document placement surface of the image reading unit 20, and the average luminance value meanV is equal to or greater than the threshold value ThreV ( If it is determined that the image is white only), there is a high possibility that the document does not exist.

そして、S603で、平均輝度値meanVがしきい値ThreV以上のお手本画像が存在すると判定した場合には、S604へ移行し、そのお手本画像を排除した後、S605へ移行する。つまり、前述した図15の例では、4つの読取領域のうちImage1で読み取られた画像(白色の画像)が排除される。   If it is determined in S603 that there is a model image whose average luminance value meanV is equal to or greater than the threshold value ThreV, the process proceeds to S604, and after the model image is excluded, the process proceeds to S605. That is, in the example of FIG. 15 described above, an image (white image) read by Image1 is excluded from the four reading regions.

一方、S603で、平均輝度値meanVがしきい値ThreV以上のお手本画像が存在しないと判定した場合には、そのままS605へ移行する。
S605では、S601〜S604の処理の結果として抽出された複数種類のお手本画像(お手本画像群)を1つのお手本画像(1つにつなぎ合わせた画像)とみなして、そのお手本画像を構成する各画素をHSVパラメータ(H値:0〜360、S値及びV値:0〜1)に変換する処理を行う。なお、RGBからHSVパラメータへの変換や、HSVからRGBへの変換は、前述した公知の変換式に従い行うことができる。
On the other hand, if it is determined in S603 that there is no model image whose average luminance value meanV is equal to or greater than the threshold ThreV, the process proceeds to S605 as it is.
In S605, a plurality of types of model images (group of model images) extracted as a result of the processing in S601 to S604 are regarded as one model image (an image connected to one), and each pixel constituting the model image Is converted into HSV parameters (H value: 0 to 360, S value and V value: 0 to 1). Note that the conversion from RGB to HSV parameters and the conversion from HSV to RGB can be performed according to the above-described known conversion formulas.

続いて、S606では、S605での変換処理により得られたHSVパラメータに基づいて、お手本画像の特徴を表す特徴量である第1特徴量(前述した各実施形態における総合第1特徴量に相当)を特定する第1特徴量特定処理を行う。なお、第1特徴量特定処理の具体的な処理内容は前述したとおりである(図6)。   Subsequently, in S606, based on the HSV parameter obtained by the conversion process in S605, a first feature amount that is a feature amount representing the feature of the model image (corresponding to the comprehensive first feature amount in each of the embodiments described above). A first feature amount specifying process for specifying is performed. The specific processing content of the first feature amount specifying processing is as described above (FIG. 6).

また、S616では、S602で抽出した各お手本画像のサムネイル画像を生成し、表示部32に表示させる。
続いて、S617では、操作部31での操作により選択されたサムネイル画像のお手本画像を無効に設定する。つまり、S602で抽出した複数種類のお手本画像のうち、サムネイル画像が選択されたお手本画像を除外するようにしている。
In S616, a thumbnail image of each model image extracted in S602 is generated and displayed on the display unit 32.
Subsequently, in S617, the model image of the thumbnail image selected by the operation on the operation unit 31 is set to be invalid. That is, the model image from which the thumbnail image is selected is excluded from the plurality of types of model images extracted in S602.

続いて、S618では、S602で抽出した複数種類のお手本画像のうち、無効に設定されているお手本画像以外のお手本画像に基づき、S605,S606と同様の手法で第1特徴量を特定する。その後、S611へ戻る。   Subsequently, in S618, the first feature amount is specified by the same method as in S605 and S606 based on a model image other than the model image set to invalid among a plurality of types of model images extracted in S602. Thereafter, the process returns to S611.

以上のように、第3実施形態の複合機10では、入力した複数種類のお手本画像から構成される1つの全体画像の特徴を表す特徴量を第1特徴量として特定する。このため、お手本画像の相対的な大きさの違いを反映させて、複数種類のお手本画像の色を混ぜ合わせることができる。この結果、例えば、画像読取部20の原稿載置面よりもサイズの大きい画像をお手本画像として用いたい場合に、その画像を複数に分割して読み取らせることで、擬似的に元の画像を一度に読み取らせた場合と同等の色変換処理が可能となる。   As described above, in the multifunction machine 10 according to the third embodiment, the feature amount representing the feature of one entire image composed of the input plural types of model images is specified as the first feature amount. Therefore, it is possible to mix the colors of a plurality of types of model images by reflecting the difference in relative sizes of the model images. As a result, for example, when an image having a size larger than the document placement surface of the image reading unit 20 is to be used as a model image, the original image is temporarily reproduced once by dividing the image into a plurality of images. The color conversion process equivalent to the case where the image data is read by can be performed.

また、この複合機10では、原稿載置面を複数に分割した各読取領域で読み取られる画像を独立したお手本画像として入力するようにしているため、ユーザは、複数のお手本画像を容易に読み取らせることが可能となり、作業時間を短縮することができる。   Further, in this multifunction machine 10, since an image read in each reading area obtained by dividing the document placement surface into a plurality of parts is input as an independent model image, the user can easily read a plurality of model images. And the working time can be shortened.

加えて、読取領域で読み取られた画像の平均輝度値がしきい値ThreV以上の場合には、その読取領域には画像が存在しないと判定するようにしているため、画像が存在しない部分をお手本画像として入力してしまうことを防ぐことができる。   In addition, if the average luminance value of the image read in the reading area is greater than or equal to the threshold value ThreV, it is determined that no image exists in the reading area. Inputting as an image can be prevented.

なお、第3実施形態の複合機10では、色変換処理(図14)におけるS601〜S604の処理を実行するCPU71が、第1画像入力手段に相当し、S605,S606の処理を実行するCPU71が、総合第1特徴量特定手段に相当する。また、S607の処理を実行するCPU71が、第2画像入力手段に相当し、S608,S612,S613の処理を実行するCPU71が、出力手段に相当する。また、S609,S610の処理を実行するCPU71が、第2特徴量特定手段に相当し、S611,S614〜S619の処理を実行するCPU71が、画像補正手段に相当する。   In the multifunction machine 10 of the third embodiment, the CPU 71 that executes the processes of S601 to S604 in the color conversion process (FIG. 14) corresponds to the first image input unit, and the CPU 71 that executes the processes of S605 and S606. This corresponds to the comprehensive first feature value specifying means. The CPU 71 that executes the process of S607 corresponds to a second image input unit, and the CPU 71 that executes the processes of S608, S612, and S613 corresponds to an output unit. Further, the CPU 71 that executes the processes of S609 and S610 corresponds to the second feature amount specifying means, and the CPU 71 that executes the processes of S611, S614 to S619 corresponds to the image correcting means.

[4.他の形態]
以上、本発明の実施形態について説明したが、本発明は、種々の形態をとり得ることは言うまでもない。
[4. Other forms]
As mentioned above, although embodiment of this invention was described, it cannot be overemphasized that this invention can take a various form.

(1)上記第3実施形態では、複合機10が原稿載置面を複数に分割した各読取領域で読み取られる画像を独立したお手本画像として入力する例について説明したが、これに限定されるものではない。例えば、原稿載置面全域を1つの全体画像として読み取り、その全体画像の内容を解析して画像を抽出するようにしてもよい。このようにすれば、原稿載置面における位置に関係なく複数の画像を独立した画像として抽出することができる。また、お手本画像は1枚の原稿につき1つである必要はなく、複数の画像が印刷された原稿から各画像をそれぞれ独立したお手本画像として抽出するようにしてもよい。   (1) In the third embodiment, the example in which the multifunction device 10 inputs an image read in each reading area obtained by dividing the document placement surface into a plurality of reading images as an independent model image has been described. However, the present invention is not limited to this. is not. For example, the entire document placement surface may be read as one whole image, and the contents of the whole image may be analyzed to extract the image. In this way, a plurality of images can be extracted as independent images regardless of the position on the document placement surface. Further, one model image is not necessarily required for each document, and each image may be extracted as an independent model image from a document on which a plurality of images are printed.

(2)上記第3実施形態では、複数のお手本画像を一度に読み取る例について説明したが、これに限定されるものではなく、上記第1実施形態と同様、お手本画像の読取操作を繰り返し行うことにより、お手本画像を1つずつ読み取るようにしてもよい。このようにすれば、1つの画像を複数の画像と誤認識したり、逆に複数の画像を1つの画像と誤認識したりすることを確実に防ぐことができる。   (2) In the third embodiment, an example in which a plurality of model images are read at once has been described. However, the present invention is not limited to this, and the model image reading operation is repeatedly performed as in the first embodiment. Thus, the model images may be read one by one. In this way, it is possible to reliably prevent one image from being misrecognized as a plurality of images, or conversely, misrecognizing a plurality of images as one image.

(3)上記第1、第2実施形態では、お手本画像の読取操作を繰り返し行うことにより、お手本画像を1つずつ読み取る例について説明したが、これに限定されるものではなく、上記第3実施形態と同様、複数のお手本画像を一度に読み取るようにしてもよい
(4)上記実施形態では、複合機10がお手本画像を画像読取部20で読み取る例について説明したが、これに限定されるものではない。例えば、メモリカードから読み込んだ画像や、通信部60を介して外部から受信した画像をお手本画像としてもよい。
(3) In the first and second embodiments, the example in which the model images are read one by one by repeatedly performing the model image reading operation has been described. However, the present invention is not limited to this. Similarly to the embodiment, a plurality of model images may be read at once. (4) In the above-described embodiment, the example in which the multifunction machine 10 reads the model images with the image reading unit 20 has been described. However, the present invention is not limited to this. is not. For example, an image read from a memory card or an image received from the outside via the communication unit 60 may be used as a model image.

(5)上記実施形態では、色変換の対象とする画像(元画像)をメモリカードから入力する例について説明したが、これに限定されるものではない。例えば、画像読取部20で読み取られた画像や、通信部60を介して外部から受信した画像を色変換の対象としてもよい。   (5) In the above embodiment, an example in which an image (original image) to be subjected to color conversion is input from a memory card has been described. However, the present invention is not limited to this. For example, an image read by the image reading unit 20 or an image received from the outside via the communication unit 60 may be the target of color conversion.

(6)上記実施形態では、色変換処理において、第1特徴量及び第2特徴量を特定するための処理を行う前に、お手本画像及び元画像の各構成画素をHSVパラメータに変換する処理を行うようにしているが、これに限定されるものではない。例えば、HSVパラメータに代えて、L***パラメータやRGBパラメータ等の他のパラメータに変換してもよい。 (6) In the above embodiment, in the color conversion process, before performing the process for specifying the first feature value and the second feature value, the process of converting the constituent pixels of the model image and the original image into HSV parameters. However, the present invention is not limited to this. For example, instead of the HSV parameter, it may be converted into another parameter such as an L * c * h * parameter or an RGB parameter.

(7)上記実施形態では、色変換処理において、第1特徴量を特定した後に第2特徴量を特定しているが、これに限定されるものではなく、第2特徴量を特定した後に第1特徴量を特定してもよい。   (7) In the above embodiment, in the color conversion process, the second feature value is specified after specifying the first feature value. However, the present invention is not limited to this, and the second feature value is specified after specifying the second feature value. One feature quantity may be specified.

(8)上記実施形態では、第1特徴量を特定するアルゴリズムと第2特徴量を特定するアルゴリズムとを同一のものとして説明したが、これに限定されるものではなく、異なるアルゴリズムによって特定してもよい。   (8) In the above embodiment, the algorithm for specifying the first feature quantity and the algorithm for specifying the second feature quantity have been described as being the same. However, the present invention is not limited to this. Also good.

(9)上記実施形態では、代表値再設定処理により、領域の大きさに応じて補正処理の一部を停止したり、変換量を小さくしたりする処理を例示したが、これに限定されるものではなく、代表値再設定処理を行わないようにしてもよい。   (9) In the above embodiment, the process of stopping a part of the correction process or reducing the conversion amount according to the size of the region by the representative value resetting process is exemplified, but the present invention is not limited to this. However, the representative value resetting process may not be performed.

(10)上記実施形態では、お手本画像に基づく色変換処理結果を表す補正イメージ画像を表示部32に表示するようにしているが、これに限定されるものではなく、例えば、表示に代えて、簡易的な印刷(低解像度での印刷)を行うようにしてもよい。   (10) In the above embodiment, the corrected image image representing the color conversion processing result based on the model image is displayed on the display unit 32. However, the present invention is not limited to this. For example, instead of display, Simple printing (printing at a low resolution) may be performed.

(11)上記実施形態では、画像補正処理として色変換処理を例示したが、これに限定されるものではなく、上記実施形態で例示した以外の画像補正処理を行うものであってもよい。   (11) In the above embodiment, the color conversion process is exemplified as the image correction process. However, the present invention is not limited to this, and an image correction process other than that exemplified in the above embodiment may be performed.

(12)上記実施形態においては、変換対象としない領域のH値は、変換量を減少させることはできるものの、変換量をゼロとすることはできない。図8に示すように、変換対象としない領域の代表値との間で線形補間されるため、他の領域の代表値の影響を受けるからである。   (12) In the above embodiment, the H value of the region that is not subject to conversion can reduce the conversion amount, but the conversion amount cannot be zero. This is because, as shown in FIG. 8, linear interpolation is performed between the representative values of the regions that are not to be converted, and therefore, it is affected by the representative values of other regions.

そこで、図16に示すような色相補正テーブルを採用することができる。図16は、B領域のみを変換対象とした場合の色相補正テーブルである。なお、この図においては、変換対象の領域の数を1つとしているが、複数の領域を補正対象とした場合にも同様に適用できる。   Therefore, a hue correction table as shown in FIG. 16 can be employed. FIG. 16 is a hue correction table in the case where only the B region is to be converted. In this figure, the number of areas to be converted is one, but the present invention can be similarly applied to cases where a plurality of areas are to be corrected.

図16においては、B領域以外のH値は、H’=Hであるから、色変換は行われない。B領域のH’値については、B領域中の最小値をHmin,B領域中の最大値をHmaxとすれば、以下の式で求めることができる。   In FIG. 16, since the H values other than the B region are H ′ = H, color conversion is not performed. The H ′ value in the B region can be obtained by the following equation, where the minimum value in the B region is Hmin and the maximum value in the B region is Hmax.

H<iHのときは、
H’=Hmin+(sHb−Hmin)×(H−Hmin)÷(iHb−Hmin)
H>iHのときは、
H’=sHb+(Hmax−sHb)×(H−iHb)÷(Hmax−iHb)
この式を用いることにより、変換対象の領域のみを変換することができる。
When H <iH,
H ′ = Hmin + (sHb−Hmin) × (H−Hmin) ÷ (iHb−Hmin)
When H> iH,
H ′ = sHb + (Hmax−sHb) × (H−iHb) ÷ (Hmax−iHb)
By using this equation, only the region to be converted can be converted.

このようにすれば、変換対象のH値のみを変換することができるから、色変換の効果を大きくすることができる。
(13)上記実施形態においては、S値及びV値に対し、領域ごとに補正カーブ(変換式)を独立して用いるため、擬似輪郭(階調とび)が生成されるおそれがある。すなわち、図17に示すように、領域ごとに、SとS’との関係を示すテーブルを有しており、隣接する領域におけるテーブルの性質を何ら考慮していない。
In this way, since only the H value to be converted can be converted, the effect of color conversion can be increased.
(13) In the above embodiment, since a correction curve (conversion formula) is independently used for each region with respect to the S value and the V value, a pseudo contour (tone jump) may be generated. That is, as shown in FIG. 17, each region has a table indicating the relationship between S and S ′, and no consideration is given to the nature of the table in the adjacent region.

これに対し、図18に示すように、各色領域における補正カーブを滑らかにすることで階調とびを防止できる。
ここで、具体的な処理について以下に説明する。なお、図19及び図20を参照しつつC領域の一部及びB領域の一部の色変換処理について説明を行うが、他の領域についても処理の内容は基本的には同じである。
On the other hand, as shown in FIG. 18, gradation skipping can be prevented by smoothing the correction curve in each color region.
Here, specific processing will be described below. The color conversion process for a part of the C area and a part of the B area will be described with reference to FIGS. 19 and 20, but the contents of the process are basically the same for the other areas.

補正されたS値(Sb’’)は、変換対象領域のH値(H)、変換対象とする領域のH値の中間値(Hbmid)、変換対象となる画素のH値の色相座標位置と、変換対象とする領域のH値の中間値の色相座標位置とを比較し、変換対象となる画素のH値の色相座標位置は近くに、かつ、変換対象とする領域のH値の中間値の色相座標位置からは遠くに隣接する領域のH値の代表値(Hcmid)、上記変換式(式2)に対応する変換式で変換された(すなわち、B領域の彩度補正テーブルを用いて算出された)変換対象領域のS値(Sb’)、上記変換式(式3)に対応する変換式で変換された(すなわち、C領域の彩度補正テーブルを用いて算出された)隣接する領域のS値(Sc’)を用いて、以下の式で求めることができる。   The corrected S value (Sb ″) includes the H value (H) of the conversion target area, the intermediate value (Hbmid) of the H value of the conversion target area, and the hue coordinate position of the H value of the pixel to be converted. The hue coordinate position of the intermediate value of the H value of the area to be converted is compared, the hue coordinate position of the H value of the pixel to be converted is close, and the intermediate value of the H value of the area to be converted The H value representative value (Hcmid) of the adjacent region far from the hue coordinate position is converted by a conversion formula corresponding to the conversion formula (Formula 2) (that is, using the saturation correction table of the B region). The S value (Sb ′) of the conversion target area (calculated) and adjacent converted by the conversion expression corresponding to the conversion expression (Expression 3) (that is, calculated using the saturation correction table of the C area) Using the S value (Sc ′) of the region, it can be obtained by the following equation.

Sb’’ = {(H−Hcmid)×Sb’+(Hbmid−H)×Sc’}
÷{(Hbmid−Hcmid)} ・・・(式7)
なお、上記Hbmid、Hcmidは、上記再設定された「代表値」である。
Sb ″ = {(H−Hcmid) × Sb ′ + (Hbmid−H) × Sc ′}
÷ {(Hbmid−Hcmid)} (Expression 7)
The Hbmid and Hcmid are the “representative values” that have been reset.

また、この例における補正されたV値(Vb’’)は、変換対象領域のH値(H)、変換対象領域のH値の代表値(Hbmid)、隣接する領域のH値の代表値(Hcmid)、上記変換式(式4)に対応する変換式で変換された(すなわち、B領域の明度補正テーブルを用いて算出された)変換対象領域のV値(Vb’)、上記変換式(式5)に対応する変換式で変換された(すなわち、C領域の明度補正テーブルを用いて算出された)隣接する領域のS値(Vc’)を用いて、以下の式で求めることができる。   Further, the corrected V value (Vb ″) in this example includes the H value (H) of the conversion target region, the representative value (Hbmid) of the H value of the conversion target region, and the representative value of the H value of the adjacent region (Hbmid). Hcmid), the V value (Vb ′) of the conversion target area converted by the conversion expression corresponding to the conversion expression (Expression 4) (that is, calculated using the brightness correction table of the B area), and the conversion expression ( Using the S value (Vc ′) of the adjacent region converted by the conversion equation corresponding to Equation 5 (that is, calculated using the brightness correction table of the C region), the following equation can be used. .

Vb’’ = {(H−Hcmid)×Vb’+(Hbmid−H)×Vc’}
÷{(Hbmid−Hcmid)} ・・・(式8)
前述した処理を、図21に示されるB領域の一部(H値の範囲:210<H≦240)及びC領域の一部(H値の範囲180<H≦210)に対して行う。これにより、入力の色相値(H)に応じた重み付け計算により、出力の彩度値(S'')及び明度値(V'')を求めることにより、各色相間の補正効果を滑らかにすることができる。
Vb ″ = {(H−Hcmid) × Vb ′ + (Hbmid−H) × Vc ′}
÷ {(Hbmid−Hcmid)} (Equation 8)
The above-described processing is performed on part of the B region (H value range: 210 <H ≦ 240) and part of the C region (H value range 180 <H ≦ 210) shown in FIG. As a result, the output saturation value (S ″) and lightness value (V ″) are obtained by weighting calculation according to the input hue value (H), thereby smoothing the correction effect between the hues. Can do.

(14)上記実施形態では、画像処理装置として複合機10を例示したが、これに限定されるものではなく、例えば、パーソナルコンピュータのような情報処理装置であってもよい。   (14) In the above embodiment, the multifunction machine 10 is exemplified as the image processing apparatus. However, the present invention is not limited to this, and may be an information processing apparatus such as a personal computer.

第1実施形態の複合機の外観を示す斜視図である。1 is a perspective view illustrating an appearance of a multifunction machine according to a first embodiment. 複合機の制御系の概略構成を示すブロック図である。FIG. 2 is a block diagram illustrating a schematic configuration of a control system of the multifunction machine. 色変換処理におけるユーザの動作及び複合機の処理の概略を示した説明図である。FIG. 6 is an explanatory diagram illustrating an outline of a user operation and a process of a multifunction peripheral in color conversion processing. 第1実施形態の色変換処理のフローチャートである。It is a flowchart of the color conversion process of 1st Embodiment. 補正イメージ画像の表示画面の説明図である。It is explanatory drawing of the display screen of a correction | amendment image image. 第1特徴量特定処理のフローチャートである。It is a flowchart of a 1st feature-value specific process. 第2特徴量特定処理のフローチャートである。It is a flowchart of the 2nd feature-value specific process. 色相補正テーブルの説明図である。It is explanatory drawing of a hue correction table. 代表値再設定処理のフローチャートである。It is a flowchart of a representative value reset process. B領域のみを変換対象とした場合に作成される色相補正テーブルの説明図である。It is explanatory drawing of the hue correction table produced when only B area | region is made into conversion object. 第1実施形態での総合特徴量の特定方法の説明図である。It is explanatory drawing of the identification method of the comprehensive feature-value in 1st Embodiment. 第2実施形態の色変換処理のフローチャートである。It is a flowchart of the color conversion process of 2nd Embodiment. 第2実施形態での総合特徴量の特定方法の説明図である。It is explanatory drawing of the identification method of the comprehensive feature-value in 2nd Embodiment. 第3実施形態の色変換処理のフローチャートである。It is a flowchart of the color conversion process of 3rd Embodiment. 複数のお手本画像の認識方法を説明するための説明図である。It is explanatory drawing for demonstrating the recognition method of several example images. 変形例における色相補正テーブルを示した図である。It is the figure which showed the hue correction table in a modification. 彩度補正テーブルを示した図である。It is the figure which showed the saturation correction table. 彩度補正のカーブの変化を示した図である。It is the figure which showed the change of the curve of saturation correction | amendment. B領域及びC領域における彩度補正テーブルを示した図である。It is the figure which showed the saturation correction table in B area | region and C area | region. B領域及びC領域における補正されたS値を示した図である。It is the figure which showed the corrected S value in B area | region and C area | region. B領域及びC領域の一部が変換対象となることを示した図である。It is the figure which showed that a part of B area | region and C area | region became conversion object.

符号の説明Explanation of symbols

10…複合機、11…本体ケーシング、12…開口、20…画像読取部、21…原稿カバー、30…操作パネル、31…操作部、32…表示部、40…画像印刷部、50…カードスロット、60…通信部、70…制御部、71…CPU、72…ROM、73…RAM、80…信号線   DESCRIPTION OF SYMBOLS 10 ... MFP, 11 ... Main body casing, 12 ... Opening, 20 ... Image reading part, 21 ... Document cover, 30 ... Operation panel, 31 ... Operation part, 32 ... Display part, 40 ... Image printing part, 50 ... Card slot , 60 ... communication section, 70 ... control section, 71 ... CPU, 72 ... ROM, 73 ... RAM, 80 ... signal line

Claims (10)

複数種類の第1画像を入力可能な第1画像入力手段と、
前記第1画像入力手段により入力された各第1画像の特徴を表す第1特徴量を特定する第1特徴量特定手段と、
前記第1特徴量特定手段により特定された各第1特徴量に基づいて、前記複数種類の第1画像全体の特徴を表す複数の代表値が含まれた総合第1特徴量を特定する総合第1特徴量特定手段と、
画像補正の対象とする画像である第2画像を入力する第2画像入力手段と、
前記第2画像入力手段により入力された第2画像の特徴を表す複数の代表値が含まれた第2特徴量を特定する第2特徴量特定手段と、
前記総合第1特徴量の複数の代表値と前記第2特徴量の複数の代表値との対応関係に基づいて前記第2画像に対する画像補正処理を行う画像補正手段と、
を備えることを特徴とする画像処理装置。
First image input means capable of inputting a plurality of types of first images;
First feature amount specifying means for specifying a first feature amount representing a feature of each first image input by the first image input means;
Based on each first feature amount specified by the first feature amount specifying means, a comprehensive first feature amount that includes a plurality of representative values representing features of the plurality of types of first images as a whole is specified. 1 feature quantity specifying means;
Second image input means for inputting a second image which is an image to be subjected to image correction;
Second feature amount specifying means for specifying a second feature amount including a plurality of representative values representing features of the second image input by the second image input means;
Image correction means for performing image correction processing on the second image based on a correspondence relationship between the plurality of representative values of the total first feature quantity and the plurality of representative values of the second feature quantity;
An image processing apparatus comprising:
前記第1特徴量特定手段は、前記第1画像入力手段により入力された各第1画像の構成画素の画素値に基づいて前記第1特徴量を特定し、
前記総合第1特徴量特定手段は、前記第1特徴量特定手段により特定された各第1特徴量に基づいて、その第1特徴量を特定するために用いた第1画像の構成画素の画素数に応じた重み付けで、前記総合第1特徴量を特定すること
を特徴とする請求項に記載の画像処理装置。
The first feature amount specifying unit specifies the first feature amount based on a pixel value of a constituent pixel of each first image input by the first image input unit,
The comprehensive first feature quantity specifying unit is a pixel of a constituent pixel of the first image used for specifying the first feature quantity based on each first feature quantity specified by the first feature quantity specifying unit. in weighting according to the number, the image processing apparatus according to claim 1, characterized in that identifying the overall first feature amount.
前記画像補正手段による画像補正処理結果を表す補正イメージ画像を出力する出力手段と、
前記画像補正手段により画像補正処理が行われた第2画像を印刷する印刷制御手段と、
を備えることを特徴とする請求項1又は請求項に記載の画像処理装置。
Output means for outputting a corrected image representing an image correction processing result by the image correction means;
Print control means for printing the second image on which image correction processing has been performed by the image correction means;
The image processing apparatus according to claim 1 or claim 2, characterized in that it comprises a.
前記出力手段により補正イメージ画像が出力されたことを条件として、前記第1画像入力手段により第1画像を入力し、前記画像補正手段は、その入力された第1画像及び前記出力手段により出力された補正イメージ画像の画像補正処理に用いた第1画像、における総合第1特徴量から、前記第2画像に対する画像補正処理を行うこと
を特徴とする請求項に記載の画像処理装置。
On condition that the corrected image is output by the output means, the first image is input by the first image input means, and the image correction means is output by the input first image and the output means. The image processing apparatus according to claim 3 , wherein an image correction process is performed on the second image based on an overall first feature amount in the first image used for the image correction process of the corrected image.
前記画像補正手段は、前記出力手段により補正イメージ画像が出力されたことを条件として、前記出力手段により出力された補正イメージ画像の画像補正処理に用いた複数種類の第1画像のうち、所定の第1画像以外の第1画像に基づく総合第1特徴量から、前記第2画像に対する画像補正処理を行うこと
を特徴とする請求項又は請求項に記載の画像処理装置。
The image correction means is a predetermined one of a plurality of types of first images used for image correction processing of the correction image image output by the output means, on condition that the correction image image is output by the output means. from General first feature data based on the first image other than the first image, the image processing apparatus according to claim 3 or claim 4, characterized in that performing the image correction process for the second image.
前記補正イメージ画像は、前記第2画像の縮小画像に対して前記画像補正処理を行ったものであること
を特徴とする請求項から請求項までのいずれか1項に記載の画像処理装置。
The correction images, the image processing apparatus according to any one of claims 3, characterized in that the reduced image of the second image is obtained performing the image correction process to claim 5 .
前記第1画像入力手段は、所定の読取位置にセットされた印刷媒体から光学的に読み取られる画像を入力するものであり、前記読取位置にセットされた印刷媒体から複数の画像が読み取られた場合に、各画像をそれぞれ独立した第1画像として入力可能であること
を特徴とする請求項1から請求項までのいずれか1項に記載の画像処理装置。
The first image input means inputs an image optically read from a print medium set at a predetermined reading position, and when a plurality of images are read from the print medium set at the reading position The image processing apparatus according to any one of claims 1 to 6 , wherein each image can be input as an independent first image.
前記第1画像入力手段は、前記読取位置を複数に分割した各読取領域で読み取られる画像を独立した第1画像として入力すること
を特徴とする請求項に記載の画像処理装置。
The image processing apparatus according to claim 7 , wherein the first image input unit inputs an image read in each reading area obtained by dividing the reading position into a plurality of parts as an independent first image.
前記第1画像入力手段は、前記読取領域で読み取られた画像の平均輝度値が所定値以上の場合には、その読取領域には画像が存在しないと判定すること
を特徴とする請求項に記載の画像処理装置。
The first image input unit, when the average luminance value of the image read by the reading area is above a predetermined value, to claim 8, wherein determining that the image is not present in the reading area The image processing apparatus described.
複数種類の第1画像を入力可能な第1画像入力手段と、
前記第1画像入力手段により入力された各第1画像の特徴を表す第1特徴量を特定する第1特徴量特定手段と、
前記第1特徴量特定手段により特定された各第1特徴量に基づいて、前記複数種類の第1画像全体の特徴を表す複数の代表値が含まれた総合第1特徴量を特定する総合第1特徴量特定手段と、
画像補正の対象とする画像である第2画像を入力する第2画像入力手段と、
前記第2画像入力手段により入力された第2画像の特徴を表す複数の代表値が含まれた第2特徴量を特定する第2特徴量特定手段と、
前記総合第1特徴量の複数の代表値と前記第2特徴量の複数の代表値との対応関係に基づいて前記第2画像に対する画像補正処理を行う画像補正手段としてコンピュータを機能させること
を特徴とする画像処理プログラム。
First image input means capable of inputting a plurality of types of first images;
First feature amount specifying means for specifying a first feature amount representing a feature of each first image input by the first image input means;
Based on each first feature amount specified by the first feature amount specifying means, a comprehensive first feature amount that includes a plurality of representative values representing features of the plurality of types of first images as a whole is specified. 1 feature quantity specifying means;
Second image input means for inputting a second image which is an image to be subjected to image correction;
Second feature amount specifying means for specifying a second feature amount including a plurality of representative values representing features of the second image input by the second image input means;
A computer is caused to function as image correction means for performing image correction processing on the second image based on a correspondence relationship between the plurality of representative values of the total first feature amount and the plurality of representative values of the second feature amount. An image processing program.
JP2007226091A 2007-08-31 2007-08-31 Image processing apparatus and image processing program Expired - Fee Related JP4840295B2 (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
JP2007226091A JP4840295B2 (en) 2007-08-31 2007-08-31 Image processing apparatus and image processing program
US12/194,680 US8159716B2 (en) 2007-08-31 2008-08-20 Image processing device performing image correction by using a plurality of sample images

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2007226091A JP4840295B2 (en) 2007-08-31 2007-08-31 Image processing apparatus and image processing program

Publications (2)

Publication Number Publication Date
JP2009059180A JP2009059180A (en) 2009-03-19
JP4840295B2 true JP4840295B2 (en) 2011-12-21

Family

ID=40554854

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2007226091A Expired - Fee Related JP4840295B2 (en) 2007-08-31 2007-08-31 Image processing apparatus and image processing program

Country Status (1)

Country Link
JP (1) JP4840295B2 (en)

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH09284583A (en) * 1996-04-17 1997-10-31 Toppan Printing Co Ltd Color correction device
JP4172122B2 (en) * 1999-12-02 2008-10-29 ノーリツ鋼機株式会社 Color density correction method, recording medium having recorded color density correction program, image processing apparatus, and photographic printing apparatus
JP2002171408A (en) * 2000-12-01 2002-06-14 Fuji Photo Film Co Ltd Image processing method and image processing apparatus
EP1648158A1 (en) * 2004-10-18 2006-04-19 Thomson Licensing Device and method for colour correction of an input image
JP2007208413A (en) * 2006-01-31 2007-08-16 Olympus Corp Color correction apparatus, color correction method, and color correction program

Also Published As

Publication number Publication date
JP2009059180A (en) 2009-03-19

Similar Documents

Publication Publication Date Title
JP4442664B2 (en) Image processing apparatus, image processing method, and image processing program
JP4063290B2 (en) Image processing apparatus, image processing program, and image processing method
US9967434B2 (en) Image processing apparatus, system, method, and program product for adjusting saturation of a skin area while maintaining converted hue
US8174731B2 (en) Image processing device outputting image for selecting sample image for image correction
JP7367159B2 (en) Image processing device, image processing method, and program
KR101756277B1 (en) Image forming apparatus and method for processing image thereof
JP4433017B2 (en) Image processing apparatus and image processing program
JP4985243B2 (en) Image processing apparatus and image processing program
JP2002112022A (en) Image formation device, image formation method, and recording medium capable of reading computer recording image formation program
JP4389977B2 (en) Image printing apparatus, image printing method, and image printing program
JP4793356B2 (en) Image processing apparatus and image processing program
US8159716B2 (en) Image processing device performing image correction by using a plurality of sample images
US8094343B2 (en) Image processor
JP4840295B2 (en) Image processing apparatus and image processing program
JP5045836B2 (en) Image processing apparatus and image processing program
JP4442665B2 (en) Image processing apparatus and image processing program
JP4442663B2 (en) Image processing apparatus and image processing program
JP4831020B2 (en) Image processing apparatus, image processing method, and image processing program
JP4826562B2 (en) Image processing apparatus, image processing method, and image processing program
JP4764889B2 (en) Image processing apparatus and image processing method
JP4831019B2 (en) Image processing apparatus, image processing method, and image processing printing program
JPH04160982A (en) Image processor for each image area of copying machine
JP2013109496A (en) Print condition selection device, print condition selection method, and program

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20100113

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20110531

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20110727

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

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

R150 Certificate of patent or registration of utility model

Ref document number: 4840295

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

Year of fee payment: 3

LAPS Cancellation because of no payment of annual fees