JP2007325134A - Image correction apparatus, image correction method, image correction program, image reading apparatus, image reading method, and printer - Google Patents

Image correction apparatus, image correction method, image correction program, image reading apparatus, image reading method, and printer Download PDF

Info

Publication number
JP2007325134A
JP2007325134A JP2006155434A JP2006155434A JP2007325134A JP 2007325134 A JP2007325134 A JP 2007325134A JP 2006155434 A JP2006155434 A JP 2006155434A JP 2006155434 A JP2006155434 A JP 2006155434A JP 2007325134 A JP2007325134 A JP 2007325134A
Authority
JP
Japan
Prior art keywords
image
color
small
value
attribute information
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
JP2006155434A
Other languages
Japanese (ja)
Other versions
JP4238881B2 (en
Inventor
Taira Obara
平 小原
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.)
Seiko Epson Corp
Original Assignee
Seiko Epson Corp
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 Seiko Epson Corp filed Critical Seiko Epson Corp
Priority to JP2006155434A priority Critical patent/JP4238881B2/en
Priority to US11/809,908 priority patent/US7916943B2/en
Publication of JP2007325134A publication Critical patent/JP2007325134A/en
Application granted granted Critical
Publication of JP4238881B2 publication Critical patent/JP4238881B2/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Abstract

<P>PROBLEM TO BE SOLVED: To provide a technology of applying proper correction processing to an image the color balance of a halftone of which is unbalanced. <P>SOLUTION: A correction apparatus includes: a data generating section that generates data for each of histograms by each color for expressing the distribution of the number of pixels with respect to a density value of each color of pixels configuring an image; an attribute information acquisition section that respectively demarcates a region expressed by each histogram by each color into three or more small regions by the magnitude of the respective density values on the basis of data of each histogram by each color, selects at least one small region among the three or more small regions, and acquires the attribute information associated with the small region by each color; a target value acquisition section that selects a small region whose density value is greater than that of a small region and smaller than that of the other small region among the three or more small regions as a selected small region by each color and acquires a target value shared in each color as to the attribute information associated with the selected small region on the basis of the acquired attribute information; and a correction processing section for applying correction processing to the image so that the attribute information of each color associated with the selected small region respectively reach the target value shared in each color. <P>COPYRIGHT: (C)2008,JPO&INPIT

Description

本発明は、画像補正装置、画像補正方法、画像補正プログラム、画像読み取り装置、画像読み取り方法および印刷装置に関する。   The present invention relates to an image correction apparatus, an image correction method, an image correction program, an image reading apparatus, an image reading method, and a printing apparatus.

イメージスキャナ等をはじめとする各種画像読み取り装置は、一般に、パーソナルコンピュータ等のいわゆるコンピュータ装置に有線または無線等により接続されて、原稿から読み取った画像を画像データとしてコンピュータ装置に送信する。コンピュータ装置は、画像読み取り装置から送信された画像データを受信して各種メモリやハードディスク装置等のデータ記憶装置に記憶する。この際に、コンピュータ装置では、画像読み取り装置から送られてきた画像データに対して各種調整処理が施される。   Various image reading apparatuses such as an image scanner are generally connected to a so-called computer apparatus such as a personal computer by wire or wireless, and transmit an image read from a document as image data to the computer apparatus. The computer device receives the image data transmitted from the image reading device and stores it in a data storage device such as various memories or a hard disk device. At this time, the computer apparatus performs various adjustment processes on the image data sent from the image reading apparatus.

ここで施される調整処理としては、例えば、画像の明暗を調整するヒストグラム調整や、画像の濃淡の表現を部分的に変更する濃度補正等がある。これらの調整は、コンピュータ装置にインストールされている画像読み取り装置のドライバプログラムやアプリケーションプログラム等の各種プログラムによって自動的に実行されたり、またユーザ等により実行されたりする。また、この他、逆光画像を補正する調整などがある。この逆光補正の方法としては、種々の方法が提案されている(特許文献1〜3参照)。
特開平10−79885号公報 特開2004−56416号公報 特開2000−134467号公報
Examples of the adjustment processing performed here include histogram adjustment for adjusting the brightness of an image, density correction for partially changing the expression of light and shade of an image, and the like. These adjustments are automatically executed by various programs such as a driver program and an application program of the image reading apparatus installed in the computer apparatus, or are executed by a user or the like. In addition, there is an adjustment for correcting a backlight image. Various methods have been proposed as the backlight correction method (see Patent Documents 1 to 3).
Japanese Patent Laid-Open No. 10-79885 JP 2004-56416 A JP 2000-134467 A

しかしながら、従来から行われている逆光画像を補正する方法では、例えば、中間調などの色バランスが崩れた画像については、十分な補正処理を実行することはできなかった。すなわち、従来から行われている補正方法では、このような中間調などの色バランスが崩れた画像に対しては、十分に画質改善を図ることができなかった。このようなことから、このような中間調などの色バランスが崩れた画像に対する適切な補正処理が望まれていた。   However, in the conventional method of correcting a backlight image, sufficient correction processing cannot be executed for an image whose color balance is lost, such as a halftone. That is, with the conventional correction methods, image quality cannot be improved sufficiently for such an image whose color balance is lost such as halftone. For this reason, an appropriate correction process for an image in which the color balance such as halftone is lost has been desired.

本発明は、このような事情に鑑みてなされたものであって、その目的は、例えば、中間調などの色バランスが崩れた画像に対して適切な補正処理を施すことにある。   The present invention has been made in view of such circumstances, and an object of the present invention is to perform an appropriate correction process on an image whose color balance is lost, such as a halftone.

前記目的を達成するための主たる発明は、
(A)画像を構成する画素のデータに基づき、前記画素の各色の濃度値に対する前記画素の数の分布を表わす各色別のヒストグラムのデータを生成するヒストグラムデータ生成部と、
(B)前記ヒストグラムデータ生成部により生成された前記各色別のヒストグラムのデータに基づき、前記各色別のヒストグラムにより表される領域をそれぞれ前記濃度値の大きさ別に3つ以上の小領域に区分して、これら3つ以上の小領域の中から少なくとも1つの小領域を選出して、当該小領域に関する属性情報を各色別に取得する属性情報取得部と、
(C)前記3つ以上の小領域の中から、ある小領域よりも前記濃度値が大きくかつ他の小領域よりも前記濃度値が小さい小領域を選出小領域として少なくとも1つ各色別に選出して、前記属性情報取得部により取得された前記属性情報に基づき、前記選出小領域に関する属性情報について各色共通の目標値を取得する目標値取得部と、
(D)前記選出小領域に関する各色の前記属性情報がそれぞれ、前記目標値取得部により取得された前記各色共通の目標値になるように前記画像に対して補正処理を施す補正処理部と、
(E)を備えたことを特徴とする画像補正装置である。
The main invention for achieving the object is as follows:
(A) a histogram data generation unit that generates histogram data for each color representing the distribution of the number of pixels with respect to the density value of each color of the pixels based on data of pixels constituting the image;
(B) Based on the histogram data for each color generated by the histogram data generation unit, the area represented by the histogram for each color is divided into three or more small areas for each density value. An attribute information acquisition unit that selects at least one small region from the three or more small regions and acquires attribute information about the small region for each color;
(C) Out of the three or more small areas, at least one small area having the density value larger than a certain small area and smaller than the other small areas is selected as a selected small area for each color. A target value acquisition unit that acquires a target value common to each color for the attribute information related to the selected small region, based on the attribute information acquired by the attribute information acquisition unit;
(D) a correction processing unit that performs correction processing on the image so that the attribute information of each color related to the selected small area becomes a target value common to the colors acquired by the target value acquisition unit;
An image correction apparatus including (E).

本発明の他の特徴は、本明細書及び添付図面の記載により明らかにする。   Other features of the present invention will become apparent from the description of the present specification and the accompanying drawings.

本明細書及び添付図面の記載により、少なくとも以下の事項が明らかとなる。   At least the following matters will become apparent from the description of the present specification and the accompanying drawings.

(A)画像を構成する画素のデータに基づき、前記画素の各色の濃度値に対する前記画素の数の分布を表わす各色別のヒストグラムのデータを生成するヒストグラムデータ生成部と、
(B)前記ヒストグラムデータ生成部により生成された前記各色別のヒストグラムのデータに基づき、前記各色別のヒストグラムにより表される領域をそれぞれ前記濃度値の大きさ別に3つ以上の小領域に区分して、これら3つ以上の小領域の中から少なくとも1つの小領域を選出して、当該小領域に関する属性情報を各色別に取得する属性情報取得部と、
(C)前記3つ以上の小領域の中から、ある小領域よりも前記濃度値が大きくかつ他の小領域よりも前記濃度値が小さい小領域を選出小領域として少なくとも1つ各色別に選出して、前記属性情報取得部により取得された前記属性情報に基づき、前記選出小領域に関する属性情報について各色共通の目標値を取得する目標値取得部と、
(D)前記選出小領域に関する各色の前記属性情報がそれぞれ、前記目標値取得部により取得された前記各色共通の目標値になるように前記画像に対して補正処理を施す補正処理部と、
(E)を備えたことを特徴とする画像補正装置。
(A) a histogram data generation unit that generates histogram data for each color representing the distribution of the number of pixels with respect to the density value of each color of the pixels based on data of pixels constituting the image;
(B) Based on the histogram data for each color generated by the histogram data generation unit, the area represented by the histogram for each color is divided into three or more small areas for each density value. An attribute information acquisition unit that selects at least one small region from the three or more small regions and acquires attribute information about the small region for each color;
(C) Out of the three or more small areas, at least one small area having the density value larger than a certain small area and smaller than the other small areas is selected as a selected small area for each color. A target value acquisition unit that acquires a target value common to each color for the attribute information related to the selected small region, based on the attribute information acquired by the attribute information acquisition unit;
(D) a correction processing unit that performs correction processing on the image so that the attribute information of each color related to the selected small area becomes a target value common to the colors acquired by the target value acquisition unit;
An image correction apparatus comprising (E).

このような画像補正装置にあっては、画像を構成する画素のデータに基づき生成された各色別のヒストグラムのデータに基づき、各色別のヒストグラムにより表される領域を濃度値の大きさ別に3つ以上の小領域に区分して、これら3つ以上の小領域の中から選出された少なくとも1つの小領域に関する属性情報を各色別に取得して、取得した各色別の属性情報に基づき、3つ以上の小領域の中から、ある小領域よりも前記濃度値が大きくかつ他の小領域よりも前記濃度値が小さい小領域を選出小領域として少なくとも1つ各色別に選出した選出小領域に関する属性情報について各色共通の目標値を取得し、選出小領域に関する各色の属性情報がそれぞれ、各色共通の目標値になるように画像に対して補正処理を施すことで、中間調などの色バランスが崩れた画像に対して適切な補正処理を施すことができる。   In such an image correction apparatus, based on the histogram data for each color generated based on the data of the pixels constituting the image, three regions represented by the histogram for each color are classified into three areas according to the size of the density value. The attribute information regarding at least one small area selected from these three or more small areas is obtained for each color by dividing into the above small areas, and three or more based on the acquired attribute information for each color. Attribute information on selected small areas selected from each small area by selecting at least one small area having a density value larger than a small area and smaller density value than other small areas as a selected small area By obtaining a target value common to each color and performing correction processing on the image so that the attribute information of each color related to the selected small area becomes the target value common to each color, colors such as halftones Can be subjected to appropriate correction processing on the image lance collapsed.

かかる画像補正装置にあっては、前記各色別のヒストグラムのデータとして、レッド、グリーンおよびブルーの各色のヒストグラムのデータが前記ヒストグラムデータ生成部により生成されても良い。このように各色別のヒストグラムデータとして、レッド、グリーンおよびブルーの各色のヒストグラムデータが生成されれば、画像を構成する画素のデータとして、レッド、グリーンおよびブルーの各色の濃度値のデータを有している場合に、中間調などの色バランスが崩れた画像に対して適切な補正処理を施すことができる。   In such an image correction apparatus, histogram data for each color of red, green, and blue may be generated by the histogram data generation unit as the histogram data for each color. As described above, if histogram data for each color of red, green and blue is generated as histogram data for each color, it has density value data for each color of red, green and blue as pixel data constituting the image. In this case, an appropriate correction process can be performed on an image in which the color balance such as halftone is lost.

また、かかる画像補正装置にあっては、前記3つ以上の小領域には、相互に面積の等しい2つ以上の小領域が含まれても良い。このように3つ以上の小領域には、相互に面積の等しい2つ以上の小領域が含まれていれば、中間調などの色バランスが崩れた画像に対してより適切な補正処理を施すことができる。   In such an image correction apparatus, the three or more small regions may include two or more small regions having the same area. In this way, if two or more small regions having the same area are included in three or more small regions, more appropriate correction processing is performed on an image in which the color balance such as halftone is lost. be able to.

また、かかる画像補正装置にあっては、前記3つ以上の小領域には、前記画素の数が相互に等しい2つ以上の小領域が含まれても良い。このように3つ以上の小領域に、画素の数が相互に等しい2つ以上の小領域が含まれていれば、中間調などの色バランスが崩れた画像に対してより適切な補正処理を施すことができる。   In such an image correction apparatus, the three or more small regions may include two or more small regions having the same number of pixels. As described above, if two or more small areas having the same number of pixels are included in three or more small areas, more appropriate correction processing is performed on an image in which the color balance such as halftone is lost. Can be applied.

また、かかる画像補正装置にあっては、前記3つ以上の小領域には、前記画素の数および面積のうちの少なくともいずれか一方が相互に等しい2つ以上の小領域が含まれ、前記属性情報取得部は、前記画素の数および面積のうちの少なくともいずれか一方が相互に等しい2つ以上の小領域から少なくとも1つの小領域を選出して、当該小領域に関する前記属性情報を取得し、前記目標値取得部は、前記画素の数および面積のうちの少なくともいずれか一方が相互に等しい2つ以上の小領域から前記選出小領域を選出しても良い。このように3つ以上の小領域に、画素の数および面積のうちの少なくともいずれか一方が相互に等しい2つ以上の小領域が含まれ、属性情報取得部が、画素の数および面積のうちの少なくともいずれか一方が相互に等しい2つ以上の小領域から少なくとも1つの小領域を選出して当該小領域に関する属性情報を取得し、また、目標値取得部が、画素の数および面積のうちの少なくともいずれか一方が相互に等しい2つ以上の小領域から選出小領域を選出すれば、中間調などの色バランスが崩れた画像に対してより適切な補正処理を施すことができる。   In the image correction apparatus, the three or more small regions include two or more small regions in which at least one of the number and area of the pixels is equal to each other, and the attribute The information acquisition unit selects at least one small region from two or more small regions in which at least one of the number and area of the pixels is equal to each other, and acquires the attribute information regarding the small region, The target value acquisition unit may select the selected small region from two or more small regions in which at least one of the number and area of the pixels is equal to each other. As described above, the three or more small regions include two or more small regions in which at least one of the number and area of the pixels is equal to each other, and the attribute information acquisition unit includes the number of pixels and the area. And selecting at least one small region from two or more small regions in which at least one of them is equal to each other to acquire attribute information related to the small region, and the target value acquisition unit includes the number of pixels and the area If a selected small region is selected from two or more small regions in which at least one of them is equal to each other, more appropriate correction processing can be performed on an image in which color balance such as halftone is lost.

また、かかる画像補正装置にあっては、前記選出小領域が、前記ヒストグラムの中間調の領域に位置していて良い。このように選出小領域がヒストグラムの中間調の領域に位置していることで、中間調などの色バランスが崩れた画像に対してより適切な補正処理を施すことができる。   In the image correction apparatus, the selected small area may be located in a halftone area of the histogram. Since the selected small area is located in the halftone area of the histogram in this way, more appropriate correction processing can be performed on an image in which the color balance such as halftone is lost.

また、かかる画像補正装置にあっては、前記属性情報取得部は、前記属性情報として、前記少なくとも1つの小領域についてそれぞれ前記濃度値の平均値を各色別に取得しても良い。このように属性情報取得部が、属性情報として、少なくとも1つの小領域についてそれぞれ濃度値の平均値を各色別に取得すれば、中間調などの色バランスが崩れた画像に対してより適切な補正処理を施すことができる。   In the image correction apparatus, the attribute information acquisition unit may acquire an average value of the density values for each of the at least one small region as the attribute information. In this way, if the attribute information acquisition unit acquires, as attribute information, an average value of density values for at least one small region for each color, more appropriate correction processing for an image in which the color balance is lost, such as a halftone Can be applied.

また、かかる画像補正装置にあっては、前記目標値取得部は、前記属性情報取得部により取得された各色別の前記濃度値の平均値に基づき、前記少なくとも1つの小領域についてそれぞれ輝度に関する情報を取得して、当該輝度に関する情報に基づき前記目標値を取得しても良い。このように目標値取得部が、属性情報取得部により取得された各色別の濃度値の平均値に基づき、少なくとも1つの小領域についてそれぞれ輝度に関する情報を取得して、当該輝度に関する情報に基づき目標値を取得すれば、中間調などの色バランスが崩れた画像に対してより適切な補正処理を施すことができる。   Further, in the image correction apparatus, the target value acquisition unit is information on luminance for each of the at least one small region based on an average value of the density values for each color acquired by the attribute information acquisition unit. And the target value may be acquired based on the information on the luminance. In this way, the target value acquisition unit acquires information on luminance for at least one small region based on the average value of the density values for each color acquired by the attribute information acquisition unit, and the target value is acquired based on the information on the luminance. If the value is acquired, more appropriate correction processing can be performed on an image in which the color balance such as halftone is lost.

また、かかる画像補正装置にあっては、前記目標値取得部は、前記輝度に関する情報として、前記少なくとも1つの小領域について画素の輝度の平均値を取得しても良い。このように目標値取得部が、輝度に関する情報として、少なくとも1つの小領域について画素の輝度の平均値を取得すれば、中間調などの色バランスが崩れた画像に対してより適切な補正処理を施すことができる。   In the image correction apparatus, the target value acquisition unit may acquire an average value of pixel luminances for the at least one small region as information on the luminance. In this way, if the target value acquisition unit acquires the average value of the luminance of the pixels for at least one small area as information relating to the luminance, more appropriate correction processing is performed on an image in which the color balance such as halftone is lost. Can be applied.

また、かかる画像補正装置にあっては、前記目標値取得部は、前記少なくとも1つの小領域について取得した前記輝度の平均値のうちの少なくともいずれか1つと、前記画像の全体の輝度の平均値とを加算して得られた値に基づき、前記目標値を取得しても良い。このように目標値取得部が、少なくとも1つの小領域について取得した輝度の平均値のうちの少なくともいずれか1つと、画像の全体の輝度の平均値とを加算して得られた値に基づき、目標値を取得すれば、中間調などの色バランスが崩れた画像に対してより適切な補正処理を施すことができる。   In the image correction apparatus, the target value acquisition unit includes at least one of the average luminance values acquired for the at least one small region and the average luminance value of the entire image. The target value may be acquired based on a value obtained by adding. In this way, the target value acquisition unit is based on a value obtained by adding at least one of the average luminance values acquired for at least one small region and the average luminance value of the entire image, If the target value is acquired, more appropriate correction processing can be performed on an image in which color balance such as halftone is lost.

また、かかる画像補正装置にあっては、前記補正処理部は、前記補正処理を前記画像に対して施す際に、前記画像を構成する各画素の濃度値を変換しても良い。このように補正処理部が、補正処理を画像に対して施す際に、画像を構成する各画素の濃度値を変換すれば、補正処理を簡単に施すことができる。   In the image correction apparatus, the correction processing unit may convert the density value of each pixel constituting the image when the correction process is performed on the image. As described above, when the correction processing unit performs the correction process on the image, the correction process can be easily performed by converting the density value of each pixel constituting the image.

また、かかる画像補正装置にあっては、前記補正処理部は、前記画像に対して前記補正処理を施すために、変換前の濃度値と、変換後の濃度値との対応関係に関する情報を取得しても良い。このような情報を補正処理部が取得すれば、補正処理を簡単に施すことができる。   Further, in such an image correction apparatus, the correction processing unit obtains information on a correspondence relationship between the density value before conversion and the density value after conversion in order to perform the correction process on the image. You may do it. If such information is acquired by the correction processing unit, the correction process can be easily performed.

また、かかる画像補正装置にあっては、前記画像について前記選出小領域における色バランスが崩れた画像であるか否かを判定する判定部を備えても良い。このような判定部を備えれば、前記画像について、選出小領域における色バランスが崩れた画像か否かを判定することができる。   The image correction apparatus may further include a determination unit that determines whether or not the image is an image in which color balance in the selected small area is lost. If such a determination unit is provided, it is possible to determine whether or not the image is an image in which the color balance in the selected small area is lost.

また、かかる画像補正装置にあっては、前記補正処理部は、前記判定部により前記画像について前記選出小領域における色バランスが崩れた画像であると判定された場合に、前記画像に対して前記補正処理を施しても良い。このように判定部により画像について選出小領域における色バランスが崩れた画像であると判定された場合に、画像に対して補正処理を施せば、選出小領域における色バランスが崩れた画像に対して適切な補正処理を施すことができる。   Further, in such an image correction apparatus, the correction processing unit, with respect to the image, when the determination unit determines that the image is an image in which color balance in the selected small area is lost. Correction processing may be performed. As described above, when the determination unit determines that the image is an image in which the color balance in the selected small area is lost, if the correction process is performed on the image, the image in which the color balance in the selected small area is lost is corrected. Appropriate correction processing can be performed.

(A)画像を構成する画素のデータに基づき、前記画素の各色の濃度値に対する前記画素の数の分布を表わす各色別のヒストグラムのデータを生成するヒストグラムデータ生成部と、
(B)前記ヒストグラムデータ生成部により生成された前記各色別のヒストグラムのデータに基づき、前記各色別のヒストグラムにより表される領域をそれぞれ前記濃度値の大きさ別に3つ以上の小領域に区分して、これら3つ以上の小領域の中から少なくとも1つの小領域を選出して、当該小領域に関する属性情報を各色別に取得する属性情報取得部と、
(C)前記3つ以上の小領域の中から、ある小領域よりも前記濃度値が大きくかつ他の小領域よりも前記濃度値が小さい小領域を選出小領域として少なくとも1つ各色別に選出して、前記属性情報取得部により取得された前記属性情報に基づき、前記選出小領域に関する属性情報について各色共通の目標値を取得する目標値取得部と、
(D)前記選出小領域に関する各色の前記属性情報がそれぞれ、前記目標値取得部により取得された前記各色共通の目標値になるように前記画像に対して補正処理を施す補正処理部と、
(E)を備え、
(F)前記各色別のヒストグラムのデータとして、レッド、グリーンおよびブルーの各色のヒストグラムのデータが前記ヒストグラムデータ生成部により生成され、
(G)前記3つ以上の小領域には、相互に面積の等しい2つ以上の小領域が含まれ、
(H)前記3つ以上の小領域には、前記画素の数が相互に等しい2つ以上の小領域が含まれ、
(I)前記3つ以上の小領域には、前記画素の数および面積のうちの少なくともいずれか一方が相互に等しい2つ以上の小領域が含まれ、前記属性情報取得部は、前記画素の数および面積のうちの少なくともいずれか一方が相互に等しい2つ以上の小領域から少なくとも1つの小領域を選出して、当該小領域に関する前記属性情報を取得し、前記目標値取得部は、前記画素の数および面積のうちの少なくともいずれか一方が相互に等しい2つ以上の小領域から前記選出小領域を選出し、
(J)前記属性情報取得部は、前記属性情報として、前記少なくとも1つの小領域についてそれぞれ前記濃度値の平均値を各色別に取得し、
(K)前記選出小領域が、前記ヒストグラムの中間調の領域に位置しており、
(L)前記属性情報取得部は、前記属性情報として、前記少なくとも1つの小領域についてそれぞれ前記濃度値の平均値を各色別に取得し、
(M)前記目標値取得部は、前記属性情報取得部により取得された各色別の前記濃度値の平均値に基づき、前記少なくとも1つの小領域についてそれぞれ輝度に関する情報を取得して、当該輝度に関する情報に基づき前記目標値を取得し、
(N)前記目標値取得部は、前記輝度に関する情報として、前記少なくとも1つの小領域について画素の輝度の平均値を取得し、
(O)前記目標値取得部は、前記少なくとも1つの小領域について取得した前記輝度の平均値のうちの少なくともいずれか1つと、前記画像の全体の輝度の平均値とを加算して得られた値に基づき、前記目標値を取得し、
(P)前記補正処理部は、前記補正処理を前記画像に対して施す際に、前記画像を構成する各画素の濃度値を変換し、
(Q)前記補正処理部は、前記画像に対して前記補正処理を施すために、変換前の濃度値と、変換後の濃度値との対応関係に関する情報を取得し、
(R)前記画像について前記選出小領域における色バランスが崩れた画像であるか否かを判定する判定部を備え、
(S)前記補正処理部は、前記判定部により前記画像について前記選出小領域における色バランスが崩れた画像であると判定された場合に、前記画像に対して前記補正処理を施すことを特徴とする画像補正装置。
(A) a histogram data generation unit that generates histogram data for each color representing the distribution of the number of pixels with respect to the density value of each color of the pixels based on data of pixels constituting the image;
(B) Based on the histogram data for each color generated by the histogram data generation unit, the area represented by the histogram for each color is divided into three or more small areas for each density value. An attribute information acquisition unit that selects at least one small region from the three or more small regions and acquires attribute information about the small region for each color;
(C) Out of the three or more small areas, at least one small area having the density value larger than a certain small area and smaller than the other small areas is selected as a selected small area for each color. A target value acquisition unit that acquires a target value common to each color for the attribute information related to the selected small region, based on the attribute information acquired by the attribute information acquisition unit;
(D) a correction processing unit that performs correction processing on the image so that the attribute information of each color related to the selected small area becomes a target value common to the colors acquired by the target value acquisition unit;
(E)
(F) As the histogram data for each color, histogram data for each color of red, green, and blue is generated by the histogram data generation unit,
(G) The three or more subregions include two or more subregions having the same area.
(H) The three or more subregions include two or more subregions having the same number of pixels.
(I) The three or more small regions include two or more small regions in which at least one of the number and area of the pixels is equal to each other, and the attribute information acquisition unit Selecting at least one small region from two or more small regions having at least one of a number and an area equal to each other, and acquiring the attribute information related to the small region; Selecting the selected subregion from two or more subregions in which at least one of the number and area of pixels is equal to each other;
(J) The attribute information acquisition unit acquires, as the attribute information, an average value of the density values for each color for each of the at least one small region,
(K) the selected small area is located in a halftone area of the histogram;
(L) The attribute information acquisition unit acquires, as the attribute information, an average value of the density values for each color for each of the at least one small region,
(M) The target value acquisition unit acquires information on luminance for each of the at least one small region based on an average value of the density values for each color acquired by the attribute information acquisition unit, and relates to the luminance Obtaining the target value based on the information,
(N) The target value acquisition unit acquires an average value of luminance of pixels for the at least one small region as information on the luminance,
(O) The target value acquisition unit is obtained by adding at least one of the average luminance values acquired for the at least one small region and the average luminance value of the entire image. Based on the value, obtain the target value,
(P) When performing the correction process on the image, the correction processing unit converts a density value of each pixel constituting the image,
(Q) In order to perform the correction process on the image, the correction processing unit obtains information regarding a correspondence relationship between a density value before conversion and a density value after conversion,
(R) a determination unit for determining whether or not the image is an image in which the color balance in the selected small area is lost,
(S) The correction processing unit performs the correction processing on the image when the determination unit determines that the color balance of the selected small region is lost for the image. An image correction device.

(A)画像を構成する画素のデータに基づき、前記画素の各色の濃度値に対する前記画素の数の分布を表わす各色別のヒストグラムのデータを生成するステップと、
(B)生成した前記各色別のヒストグラムのデータに基づき、前記各色別のヒストグラムにより表される領域をそれぞれ前記濃度値の大きさ別に3つ以上の小領域に区分するステップと、
(C)前記3つ以上の小領域の中から少なくとも1つの小領域を選出して、当該小領域に関する属性情報を各色別に取得するステップと、
(D)前記3つ以上の小領域の中から、ある小領域よりも前記濃度値が大きくかつ他の小領域よりも前記濃度値が小さい小領域を選出小領域として少なくとも1つ各色別に選出するステップと、
(E)取得した前記属性情報に基づき、前記選出小領域に関する属性情報について各色共通の目標値を取得するステップと、
(F)前記選出小領域に関する各色の前記属性情報がそれぞれ、取得した前記各色共通の目標値になるように前記画像に対して補正処理を施すステップと、
(G)を有することを特徴とする画像補正方法。
(A) generating histogram data for each color representing the distribution of the number of pixels with respect to the density value of each color of the pixel based on the data of the pixels constituting the image;
(B) Based on the generated histogram data for each color, dividing the region represented by the histogram for each color into three or more small regions for each density value;
(C) selecting at least one small area from among the three or more small areas and acquiring attribute information relating to the small area for each color;
(D) From among the three or more small areas, at least one small area having the density value larger than a certain small area and smaller than the other small areas is selected as a selected small area for each color. Steps,
(E) acquiring a common target value for each color for the attribute information related to the selected small area based on the acquired attribute information;
(F) performing a correction process on the image so that the attribute information of each color related to the selected small area becomes a target value common to the acquired colors;
An image correction method comprising (G).

(A)画像補正装置にて実行される画像補正プログラムであって、
(B)画像を構成する画素のデータに基づき、前記画素の各色の濃度値に対する前記画素の数の分布を表わす各色別のヒストグラムのデータを生成するステップと、
(C)生成した前記各色別のヒストグラムのデータに基づき、前記各色別のヒストグラムにより表される領域をそれぞれ前記濃度値の大きさ別に3つ以上の小領域に区分するステップと、
(D)前記3つ以上の小領域の中から少なくとも1つの小領域を選出して、当該小領域に関する属性情報を各色別に取得するステップと、
(E)前記3つ以上の小領域の中から、ある小領域よりも前記濃度値が大きくかつ他の小領域よりも前記濃度値が小さい小領域を選出小領域として少なくとも1つ各色別に選出するステップと、
(F)取得した前記属性情報に基づき、前記選出小領域に関する属性情報について各色共通の目標値を取得するステップと、
(G)前記選出小領域に関する各色の前記属性情報がそれぞれ、取得した前記各色共通の目標値になるように前記画像に対して補正処理を施すステップと、
(H)を実行することを特徴とする画像補正プログラム。
(A) An image correction program executed by the image correction apparatus,
(B) generating histogram data for each color representing the distribution of the number of pixels with respect to the density value of each color of the pixel based on the data of the pixels constituting the image;
(C) dividing the region represented by the histogram for each color into three or more small regions according to the density values based on the generated histogram data for each color;
(D) selecting at least one small area from the three or more small areas, and obtaining attribute information about the small area for each color;
(E) Out of the three or more small areas, at least one small area having the density value larger than a certain small area and smaller than the other small areas is selected as a selected small area for each color. Steps,
(F) acquiring a common target value for each color for the attribute information related to the selected small area based on the acquired attribute information;
(G) performing a correction process on the image so that the attribute information of each color relating to the selected small area becomes a target value common to the acquired colors;
An image correction program that executes (H).

(A)原稿から画像を読み取る画像読み取り部と、
(B)前記画像読み取り部により読み取られた前記画像を構成する画素のデータに基づき、前記画素の各色の濃度値に対する前記画素の数の分布を表わす各色別のヒストグラムのデータを生成するヒストグラムデータ生成部と、
(C)前記ヒストグラムデータ生成部により生成された前記各色別のヒストグラムのデータに基づき、前記各色別のヒストグラムにより表される領域をそれぞれ前記濃度値の大きさ別に3つ以上の小領域に区分して、これら3つ以上の小領域の中から少なくとも1つの小領域を選出して、当該小領域に関する属性情報を各色別に取得する属性情報取得部と、
(D)前記3つ以上の小領域の中から、ある小領域よりも前記濃度値が大きくかつ他の小領域よりも前記濃度値が小さい小領域を選出小領域として少なくとも1つ各色別に選出して、前記属性情報取得部により取得された前記属性情報に基づき、前記選出小領域に関する属性情報について各色共通の目標値を取得する目標値取得部と、
(E)前記選出小領域に関する各色の前記属性情報がそれぞれ、前記目標値取得部により取得された前記各色共通の目標値になるように前記画像に対して補正処理を施す補正処理部と、
(F)を備えたことを特徴とする画像読み取り装置。
(A) an image reading unit for reading an image from a document;
(B) Histogram data generation that generates histogram data for each color representing the distribution of the number of pixels with respect to the density value of each color of the pixel based on the data of the pixels constituting the image read by the image reading unit And
(C) Based on the histogram data for each color generated by the histogram data generation unit, the area represented by the histogram for each color is divided into three or more small areas for each density value. An attribute information acquisition unit that selects at least one small area from the three or more small areas and acquires attribute information about the small area for each color;
(D) From among the three or more small areas, at least one small area having a density value larger than a certain small area and smaller than the other small areas is selected as a selected small area for each color. A target value acquisition unit that acquires a target value common to each color for the attribute information related to the selected small area, based on the attribute information acquired by the attribute information acquisition unit;
(E) a correction processing unit that performs correction processing on the image so that the attribute information of each color related to the selected small region becomes a target value common to the colors acquired by the target value acquisition unit;
An image reading apparatus comprising (F).

(A)原稿から画像を読み取るステップと、
(B)読み取った前記画像を構成する画素のデータに基づき、前記画素の各色の濃度値に対する前記画素の数の分布を表わす各色別のヒストグラムのデータを生成するステップと、
(C)生成した前記各色別のヒストグラムのデータに基づき、前記各色別のヒストグラムにより表される領域をそれぞれ前記濃度値の大きさ別に3つ以上の小領域に区分するステップと、
(D)前記3つ以上の小領域の中から少なくとも1つの小領域を選出して、当該小領域に関する属性情報を各色別に取得するステップと、
(E)前記3つ以上の小領域の中から、ある小領域よりも前記濃度値が大きくかつ他の小領域よりも前記濃度値が小さい小領域を選出小領域として少なくとも1つ各色別に選出するステップと、
(F)取得した前記属性情報に基づき、前記選出小領域に関する属性情報について各色共通の目標値を取得するステップと、
(G)前記選出小領域に関する各色の前記属性情報がそれぞれ、取得した前記各色共通の目標値になるように前記画像に対して補正処理を施すステップと、
(H)を有することを特徴とする画像読み取り方法。
(A) a step of reading an image from a document;
(B) generating histogram data for each color representing the distribution of the number of pixels with respect to the density value of each color of the pixel based on the data of the pixels constituting the read image;
(C) dividing the region represented by the histogram for each color into three or more small regions according to the density values based on the generated histogram data for each color;
(D) selecting at least one small area from the three or more small areas, and obtaining attribute information about the small area for each color;
(E) Out of the three or more small areas, at least one small area having the density value larger than a certain small area and smaller than the other small areas is selected as a selected small area for each color. Steps,
(F) acquiring a common target value for each color for the attribute information related to the selected small area based on the acquired attribute information;
(G) performing a correction process on the image so that the attribute information of each color relating to the selected small area becomes a target value common to the acquired colors;
An image reading method comprising (H).

(A)媒体に画像を印刷する印刷部と、
(B)前記印刷部により前記画像が印刷される前に、前記画像を構成する画素のデータに基づき、前記画素の各色の濃度値に対する前記画素の数の分布を表わす各色別のヒストグラムのデータを生成するヒストグラムデータ生成部と、
(C)前記ヒストグラムデータ生成部により生成された前記各色別のヒストグラムのデータに基づき、前記各色別のヒストグラムにより表される領域をそれぞれ前記濃度値の大きさ別に3つ以上の小領域に区分して、これら3つ以上の小領域の中から少なくとも1つの小領域を選出して、当該小領域に関する属性情報を各色別に取得する属性情報取得部と、
(D)前記3つ以上の小領域の中から、ある小領域よりも前記濃度値が大きくかつ他の小領域よりも前記濃度値が小さい小領域を選出小領域として少なくとも1つ各色別に選出して、前記属性情報取得部により取得された前記属性情報に基づき、前記選出小領域に関する属性情報について各色共通の目標値を取得する目標値取得部と、
(E)前記選出小領域に関する各色の前記属性情報がそれぞれ、前記目標値取得部により取得された前記各色共通の目標値になるように前記画像に対して補正処理を施す補正処理部と、
(F)を備えたことを特徴とする印刷装置。
(A) a printing unit that prints an image on a medium;
(B) Before the image is printed by the printing unit, based on the data of the pixels constituting the image, histogram data for each color representing the distribution of the number of pixels with respect to the density value of each color of the pixel is obtained. A histogram data generation unit to generate,
(C) Based on the histogram data for each color generated by the histogram data generation unit, the area represented by the histogram for each color is divided into three or more small areas for each density value. An attribute information acquisition unit that selects at least one small area from the three or more small areas and acquires attribute information about the small area for each color;
(D) From among the three or more small areas, at least one small area having a density value larger than a certain small area and smaller than the other small areas is selected as a selected small area for each color. A target value acquisition unit that acquires a target value common to each color for the attribute information related to the selected small area, based on the attribute information acquired by the attribute information acquisition unit;
(E) a correction processing unit that performs correction processing on the image so that the attribute information of each color related to the selected small region becomes a target value common to the colors acquired by the target value acquisition unit;
A printing apparatus comprising (F).

===画像読み取りシステム等の概要===
以下に本発明に係る画像判定装置について画像読み取りシステムに適用した場合を例にして説明する。図1〜図4は、画像判定装置が適用された画像読み取りシステムの一実施形態について説明したものである。図1は、画像読み取りシステムの一実施形態を説明したものである。図2は、画像読み取り装置の内部構成の一例を説明する図である。図3は、画像読み取り装置のシステム構成の一例を説明する図である。図4は、コンピュータ装置のシステム構成を説明する図である。
=== Overview of Image Reading System etc. ===
The case where the image determination device according to the present invention is applied to an image reading system will be described below as an example. 1 to 4 illustrate an embodiment of an image reading system to which an image determination device is applied. FIG. 1 illustrates an embodiment of an image reading system. FIG. 2 is a diagram illustrating an example of the internal configuration of the image reading apparatus. FIG. 3 is a diagram illustrating an example of a system configuration of the image reading apparatus. FIG. 4 is a diagram illustrating the system configuration of the computer apparatus.

この画像読み取りシステム2は、図1に示すように、画像読み取り装置10と、この画像読み取り装置10に有線または無線等により通信可能に接続されたコンピュータ装置20とを有している。画像読み取り装置10は、図1に示すように、一般にイメージスキャナと呼ばれる装置であり、原稿台12と、この原稿台12の上面部を開閉する原稿台カバー14とを備えている。原稿台12には、画像が読み取られる原稿15がセットされる。また、原稿台カバー14は、原稿台12の後端部にヒンジ部18を介して開閉自在に設けられている。   As shown in FIG. 1, the image reading system 2 includes an image reading device 10 and a computer device 20 connected to the image reading device 10 so as to be communicable by wire or wireless. As shown in FIG. 1, the image reading device 10 is a device generally called an image scanner, and includes a document table 12 and a document table cover 14 that opens and closes the upper surface of the document table 12. A document 15 from which an image is read is set on the document table 12. The document table cover 14 is provided at the rear end portion of the document table 12 through a hinge portion 18 so as to be freely opened and closed.

一方、コンピュータ装置20は、例えば、図1に示すように、コンピュータ本体22と、表示装置24と、入力装置26とを備えている。コンピュータ本体22は、パーソナルコンピュータなどをはじめとする各種コンピュータにより構成されている。ここでは、コンピュータ本体22は、FDドライブ装置28やCD−ROMドライブ装置30などの読み取り装置32を内部に備えている。この他に、コンピュータ本体22は、例えば、MO(Magnet Optical)ディスクドライブ装置やDVDドライブ装置などを備えても良い。また、表示装置24は、CRTディスプレイやプラズマディスプレイ、液晶ディスプレイ等など、各種表示装置により構成される。入力装置26は、キーボード34やマウス36などにより構成される。   On the other hand, as shown in FIG. 1, for example, the computer device 20 includes a computer main body 22, a display device 24, and an input device 26. The computer main body 22 includes various computers such as a personal computer. Here, the computer main body 22 includes a reading device 32 such as an FD drive device 28 or a CD-ROM drive device 30 therein. In addition, the computer main body 22 may include, for example, an MO (Magnet Optical) disk drive device or a DVD drive device. The display device 24 includes various display devices such as a CRT display, a plasma display, and a liquid crystal display. The input device 26 includes a keyboard 34, a mouse 36, and the like.

<画像読み取り装置>
画像読み取り装置10の原稿台12の内部には、図2に示すように、キャリッジ40と、このキャリッジ40を原稿台12に対して所定の間隔を保ちつつ図中矢印A方向に沿って平行に移動させる駆動機構42と、このキャリッジ40を支持しつつその移動を案内するガイド44とが設けられている。
<Image reading device>
As shown in FIG. 2, inside the document table 12 of the image reading apparatus 10, a carriage 40 and the carriage 40 are parallel to each other along the direction of arrow A in FIG. A driving mechanism 42 for moving the guide 40 and a guide 44 for guiding the movement while supporting the carriage 40 are provided.

キャリッジ40には、原稿台12を介して原稿15に対し光を照射する光源としての露光ランプ46と、原稿15により反射された反射光が入射するレンズ48と、このレンズ48を通じてキャリッジ40の内部に取り込まれた反射光を受光するイメージセンサ50とが設けられている。イメージセンサ50は、光信号を電気信号に変換するフォトダイオード等の光電変換素子が列状に配置されたリニアCCDセンサ等により構成されている。イメージセンサ50により読み取られた画像のデータは、制御部52に出力される。   The carriage 40 has an exposure lamp 46 as a light source for irradiating light to the document 15 via the document table 12, a lens 48 on which reflected light reflected by the document 15 is incident, and the inside of the carriage 40 through the lens 48. And an image sensor 50 for receiving the reflected light taken in. The image sensor 50 includes a linear CCD sensor or the like in which photoelectric conversion elements such as photodiodes that convert optical signals into electric signals are arranged in a line. The image data read by the image sensor 50 is output to the control unit 52.

また、駆動機構42は、キャリッジ40に接続されたタイミングベルト54と、このタイミングベルト54が掛け渡された一対のプーリ55、56と、一方のプーリ55を回転駆動する駆動モータ58とを備えている。駆動モータ58は、制御部52からの制御信号によって駆動制御される。   The drive mechanism 42 includes a timing belt 54 connected to the carriage 40, a pair of pulleys 55, 56 around which the timing belt 54 is stretched, and a drive motor 58 that rotationally drives one pulley 55. Yes. The drive motor 58 is driven and controlled by a control signal from the control unit 52.

制御部52は、図3に示すように、コントローラ60と、モータ制御部62と、ランプ制御部64と、センサ制御部66と、AFE(Analog Front End)部68と、デジタル処理回路70と、インターフェイス回路72とを備えている。さらに、AFE(Analog Front End)部68は、アナログ信号処理回路74と、A/D変換回路76とを備えている。   As shown in FIG. 3, the control unit 52 includes a controller 60, a motor control unit 62, a lamp control unit 64, a sensor control unit 66, an AFE (Analog Front End) unit 68, a digital processing circuit 70, And an interface circuit 72. Further, the AFE (Analog Front End) unit 68 includes an analog signal processing circuit 74 and an A / D conversion circuit 76.

コントローラ60は、コンピュータ本体22からの命令等に基づき、モータ制御部62やランプ制御部64、センサ制御部66、AFE(Analog Front End)部68、デジタル処理回路70、インターフェイス回路72を制御する。モータ制御部62は、コントローラ60からの命令により、キャリッジ40を移動させるための駆動モータ58の駆動制御を行う。また、ランプ制御部64は、露光ランプ46の発光を制御する。また、センサ制御部66は、イメージセンサ50の制御を行う。   The controller 60 controls the motor control unit 62, the lamp control unit 64, the sensor control unit 66, the AFE (Analog Front End) unit 68, the digital processing circuit 70, and the interface circuit 72 based on commands from the computer main body 22. The motor control unit 62 performs drive control of the drive motor 58 for moving the carriage 40 according to a command from the controller 60. The lamp control unit 64 controls the light emission of the exposure lamp 46. The sensor control unit 66 controls the image sensor 50.

また、AFE(Analog Front End)部68のアナログ信号処理回路74は、イメージセンサ50により読み取られた画像のアナログ信号に対して信号処理を行う。また、AFE(Analog Front End)部68のA/D変換回路76は、アナログ信号処理回路74により信号処理された画像の信号をデジタル信号へとA/D変換する。   An analog signal processing circuit 74 of an AFE (Analog Front End) unit 68 performs signal processing on an analog signal of an image read by the image sensor 50. An A / D conversion circuit 76 of an AFE (Analog Front End) unit 68 performs A / D conversion on the image signal processed by the analog signal processing circuit 74 into a digital signal.

デジタル処理回路70は、AFE(Analog Front End)部68のA/D変換回路76から送られてきたデジタル信号に対してデジタル信号処理を施す。ここでは、具体的にシェーディング補正等の補正処理をはじめ、各種画像処理などが施される。デジタル信号処理が施されたデジタル信号は、原稿15から読み取られた画像のデータ(画像データ)としてインターフェイス回路72により外部、即ちここでは当該画像読み取り装置10が接続されたコンピュータ本体22へと出力される。インターフェイス回路72は、この他に、コンピュータ本体22から画像読み取り装置10への命令(コマンド)等を受信するようになっている。   The digital processing circuit 70 performs digital signal processing on the digital signal sent from the A / D conversion circuit 76 of the AFE (Analog Front End) unit 68. Here, specifically, various image processing and the like are performed, including correction processing such as shading correction. The digital signal subjected to the digital signal processing is output as image data (image data) read from the document 15 to the outside, that is, to the computer main body 22 to which the image reading apparatus 10 is connected in this case. The In addition to this, the interface circuit 72 receives commands (commands) and the like from the computer main body 22 to the image reading apparatus 10.

<コンピュータ本体>
コンピュータ本体22は、図4に示すように、CPU80と、メモリ82と、HDD(ハードディスクドライブ装置)84と、操作入力部86と、表示制御部88と、外部通信部90と、バス92とを備えている。この他に、コンピュータ本体22は、先に説明したCD−ROMドライブ装置30とFDドライブ装置28を備えている。CPU80と、メモリ82と、HDD(ハードディスクドライブ装置)84と、CD−ROMドライブ装置30と、FDドライブ装置28と、操作入力部86と、表示制御部88と、外部通信部90とは、バス92を介して相互に通信可能に接続されている。
<Computer body>
As shown in FIG. 4, the computer main body 22 includes a CPU 80, a memory 82, an HDD (Hard Disk Drive Device) 84, an operation input unit 86, a display control unit 88, an external communication unit 90, and a bus 92. I have. In addition, the computer main body 22 includes the CD-ROM drive device 30 and the FD drive device 28 described above. The CPU 80, the memory 82, the HDD (Hard Disk Drive Device) 84, the CD-ROM drive device 30, the FD drive device 28, the operation input unit 86, the display control unit 88, and the external communication unit 90 are buses. 92 to be communicable with each other.

CPU80は、コンピュータ本体22の全体の制御を行う。メモリ82は、CPU80により実行されるプログラムや、当該プログラムが使用する作業データ等の各種データを記憶するためのものである。HDD(ハードディスクドライブ装置)84は、CPU80にて実行されるオペーレーティングシステム(Operating System:OS)をはじめ、各種アプリケーションプログラムやドライバ等の各種プログラム、その他、画像データなどの各種データが格納されている。操作入力部86は、キーボード34やマウス36等の入力装置26に接続されて、これら入力装置26を通じてユーザにより入力された情報を取得する。また、表示制御部88は、CPU80からの命令に基づき、表示装置24の画面に表示される画像等を制御する。また、外部通信部90は、コンピュータ本体22の外部に接続された画像読み取り装置10をはじめとする各種周辺機器との間で通信を行う。   The CPU 80 performs overall control of the computer main body 22. The memory 82 is for storing various data such as a program executed by the CPU 80 and work data used by the program. An HDD (Hard Disk Drive Device) 84 stores an operating system (OS) executed by the CPU 80, various programs such as various application programs and drivers, and various other data such as image data. Yes. The operation input unit 86 is connected to the input device 26 such as the keyboard 34 and the mouse 36, and acquires information input by the user through the input device 26. Further, the display control unit 88 controls an image displayed on the screen of the display device 24 based on a command from the CPU 80. The external communication unit 90 communicates with various peripheral devices such as the image reading apparatus 10 connected to the outside of the computer main body 22.

CPU80は、HDD(ハードディスクドライブ装置)84からプログラムを読み出して、オペーレーティングシステム(Operating System:OS)の下にて各種プログラムを実行する。ここで実行されるプログラムには、各種アプリケーションプログラムをはじめ、画像読み取り装置10や操作入力部86、表示制御部88等を制御するための各種ドライバが含まれている。   The CPU 80 reads out a program from an HDD (Hard Disk Drive Device) 84 and executes various programs under an operating system (OS). The programs executed here include various applications programs and various drivers for controlling the image reading device 10, the operation input unit 86, the display control unit 88, and the like.

画像読み取り装置10を制御するためのドライバは、スキャナドライバと一般的に呼ばれている。このスキャナドライバは、インターネット等の各種通信回線をはじめ、CD−ROM、フロッピーディスク(FD)などの各種記憶媒体等を通じて、コンピュータ本体22にインストールされたプログラムである。このスキャナドライバがコンピュータ本体22にインストールされることによって、コンピュータ本体22は、画像読み取り装置10を制御する制御装置として機能する。   A driver for controlling the image reading apparatus 10 is generally called a scanner driver. The scanner driver is a program installed in the computer main body 22 through various communication lines such as the Internet and various storage media such as a CD-ROM and a floppy disk (FD). When the scanner driver is installed in the computer main body 22, the computer main body 22 functions as a control device that controls the image reading apparatus 10.

===スキャナドライバ===
次にスキャナドライバのユーザインターフェイスの一例について説明する。図5は、このユーザインターフェイスのメインのダイアログボックス100を示したものである。このユーザインターフェイスは、コンピュータ本体22のCPU80が表示制御部88を通じて表示装置24の表示画面に表示する。ユーザは、表示装置24の表示画面に表示されたユーザインターフェイスのダイアログボックス100を見ながら、キーボード34やマウス36等の入力装置26を通じて、スキャナドライバの各種の設定を行うことができる。
=== Scanner Driver ===
Next, an example of the user interface of the scanner driver will be described. FIG. 5 shows the main dialog box 100 of this user interface. This user interface is displayed on the display screen of the display device 24 by the CPU 80 of the computer main body 22 through the display control unit 88. The user can make various settings of the scanner driver through the input device 26 such as the keyboard 34 and the mouse 36 while looking at the dialog box 100 of the user interface displayed on the display screen of the display device 24.

このメインのダイアログボックス100には、『モード選択欄』102と、『設定保存欄』104と、『原稿設定欄』106と、『出力設定欄』108と、『調整欄』110とが設けられている。『モード選択欄』102では、ユーザは、複数種類のモードの中から1つのモードを選択することができるようになっている。ここでは、「プロフェッショナルモード」が選択されている。また、『設定保存欄』104では、ユーザは、「保存ボタン」または「削除ボタン」をクリックすることで、現在の設定を保存したり削除したりすることができる。   The main dialog box 100 is provided with a “mode selection field” 102, a “setting storage field” 104, an “original setting field” 106, an “output setting field” 108, and an “adjustment field” 110. ing. In the “mode selection field” 102, the user can select one mode from a plurality of modes. Here, “professional mode” is selected. In the “setting storage field” 104, the user can save or delete the current setting by clicking the “save button” or “delete button”.

また、『原稿設定欄』106では、ユーザは、「原稿種」112や「読み込み装置」114、「自動露出」116の各設定を行うことができる。「原稿種」112では、セットした原稿の種類を選択することができる。例えば、「反射原稿」や「フィルム」等の選択が可能である。また、「読込装置」114では、例えば、「原稿台」等の選択が可能である。また、「自動露出」116では、読み取る原稿の種類に適した露出設定を行うことができる。例えば、「写真向き」や「書類向き」等の選択が可能である。   Further, in the “original setting field” 106, the user can set each of “original type” 112, “reading device” 114, and “automatic exposure” 116. In the “original type” 112, the type of original set can be selected. For example, “reflection original”, “film”, or the like can be selected. In the “reading device” 114, for example, “original table” can be selected. In the “automatic exposure” 116, an exposure setting suitable for the type of document to be read can be performed. For example, “photo orientation”, “document orientation”, and the like can be selected.

また、『出力設定欄』108では、ユーザは、画像出力に関する種々の設定を行うことができる。具体的には、この『出力設定欄』108では、出力画像の「イメージタイプ」118や、読み込み時の「解像度」120、読み込み時の「原稿サイズ」122、「出力サイズ」124の各設定が可能である。「イメージタイプ」118では、読み込み画像の色数を、カラー、グレースケール、およびモノクロの3種類の中から選択することができる。「解像度」120では、読み込み画像の解像度を設定することができる。「原稿サイズ」122では、読み込み画像のサイズを設定することができる。   In the “output setting field” 108, the user can make various settings related to image output. Specifically, in the “output setting field” 108, the “image type” 118 of the output image, “resolution” 120 at the time of reading, “original size” 122 at the time of reading, and “output size” 124 are set. Is possible. In “image type” 118, the number of colors of the read image can be selected from three types of color, gray scale, and monochrome. In “Resolution” 120, the resolution of the read image can be set. In “Original Size” 122, the size of the read image can be set.

スキャナドライバは、このダイアログボックス100の下部の「スキャンボタン」126がユーザによりクリックされると、このダイアログボックス100を通じてユーザにより設定された情報に基づき、外部の画像読み取り装置10を制御して、画像読み取り装置10にセットされた原稿から画像を読み込む。これにより読み込まれた画像のデータは、コンピュータ本体へと送られてくる。そして、このダイアログボックス100の下部の「プレビューボタン」127がユーザによりクリックされると、スキャナドライバは、画像読み取り装置10により読み取った画像を表示するプレビューウィンドウを表示装置24の表示画面に表示する。   When the “scan button” 126 at the bottom of the dialog box 100 is clicked by the user, the scanner driver controls the external image reading device 10 based on information set by the user through the dialog box 100 to An image is read from a document set on the reading device 10. The image data thus read is sent to the computer main body. When the “preview button” 127 at the bottom of the dialog box 100 is clicked by the user, the scanner driver displays a preview window for displaying the image read by the image reading device 10 on the display screen of the display device 24.

この他に、このスキャナドライバには、画像読み取り装置10により読み取った画像を調整する機能を有している。読み取った画像の調整は、メインのダイアログボックス100の『調整欄』110を通じて行う。この『調整欄』110には、画像読み取り装置10により読み取った画像を調整するために、4つのボタンと、5つのチェックボックスとが設けられている。4つのボタン128A、128B、128C、128Dはそれぞれ、自動露出のボタン128Aと、ヒストグラム調整のボタン128Bと、濃度補正のボタン128Cと、イメージ調整のボタン128Dとである。また、5つのチェックボックス130A、130B、130C、130D、130Eはそれぞれ、アンシャープマスクフィルタのチェックボックス130Aと、モアレ除去フィルタのチェックボックス130Bと、退色復元のチェックボックス130Cと、ホコリ除去のチェックボックス130Dと、逆光補正のチェックボックス130Eとである。   In addition, this scanner driver has a function of adjusting an image read by the image reading device 10. The read image is adjusted through the “adjustment column” 110 of the main dialog box 100. The “adjustment column” 110 is provided with four buttons and five check boxes for adjusting an image read by the image reading apparatus 10. The four buttons 128A, 128B, 128C, and 128D are an automatic exposure button 128A, a histogram adjustment button 128B, a density correction button 128C, and an image adjustment button 128D, respectively. The five check boxes 130A, 130B, 130C, 130D, and 130E are an unsharp mask filter check box 130A, a moire removal filter check box 130B, a fading restoration check box 130C, and a dust removal check box, respectively. 130D and a backlight correction check box 130E.

自動露出のボタン128Aは、露出を自動調整したいときにクリックされるボタンである。また、ヒストグラム調整のボタン128Bは、画像の明暗を調整したりしたい場合にクリックされるボタンである。このヒストグラム調整のボタン128Bがクリックされると、ヒストグラム調整のダイアログボックスが呼び出される。また、濃度補正のボタン128Cは、画像の濃度のバランスを補正したい場合にクリックされるボタンである。この濃度補正のボタン128Cがクリックされると、濃度補正のダイアログボックスが呼び出される。また、イメージ調整のボタン128Dは、画像の明るさ・コントラスト・彩度や、カラーバランスを調整したい場合にクリックされるボタンである。このイメージ調整のボタン128Dがクリックされると、イメージ調整のダイアログボックスが呼び出される。   The automatic exposure button 128A is clicked when it is desired to automatically adjust the exposure. The histogram adjustment button 128B is a button that is clicked when it is desired to adjust the contrast of an image. When the histogram adjustment button 128B is clicked, a histogram adjustment dialog box is called up. The density correction button 128C is a button that is clicked when it is desired to correct the density balance of the image. When the density correction button 128C is clicked, a dialog box for density correction is called. The image adjustment button 128D is a button that is clicked when it is desired to adjust the brightness, contrast, saturation, and color balance of the image. When this image adjustment button 128D is clicked, an image adjustment dialog box is called up.

一方、アンシャープマスクフィルタのチェックボックス130Aは、アンシャープマスクフィルタの使用可否を指示するためのチェックボックスであり、画像をシャープにしたい場合にチェックする。また、モアレ除去フィルタのチェックボックス130Bは、印刷物のスキャンで発生するモアレ(網目状の陰影)を除去するフィルタの使用可否を指示するためのチェックボックスであり、モアレが目立つ場合にチェックする。また、退色復元のチェックボックス130Cは、色あせた写真の色を復元するときにチェックする。また、ホコリ除去のチェックボックス130Dは、フィルムスキャン時にフィルム上のホコリを軽減するときにチェックする。また、逆光補正のチェックボックス130Eは、読み取った画像に対して逆光補正を施したいときにチェックする。この逆光補正については後で詳しく説明する。   On the other hand, the unsharp mask filter check box 130A is a check box for instructing whether or not the unsharp mask filter can be used, and is checked when it is desired to sharpen the image. The moire removal filter check box 130B is a check box for instructing whether or not to use a filter that removes moire (mesh shading) generated in the scanning of a printed matter, and is checked when moire is conspicuous. The color fading restoration check box 130C is checked when restoring the color of the faded photograph. The dust removal check box 130D is checked to reduce dust on the film during film scanning. The backlight correction check box 130E is checked when it is desired to perform backlight correction on the read image. This backlight correction will be described in detail later.

===画像調整===
次に画像調整を行うヒストグラム調整、濃度補正、およびイメージ調整について説明する。図6〜図9は、ヒストグラム調整、濃度補正、およびイメージ調整についてそれぞれ説明したものである。図6は、ヒストグラム調整のダイアログボックスを示したものである。図7は、ヒストグラム調整の具体的な調整概要について説明したものである。図8は、濃度補正のダイアログボックスを示したものである。図9は、イメージ調整のダイアログボックスを示したものである。
=== Image adjustment ===
Next, histogram adjustment, density correction, and image adjustment for performing image adjustment will be described. 6 to 9 illustrate histogram adjustment, density correction, and image adjustment, respectively. FIG. 6 shows a histogram adjustment dialog box. FIG. 7 explains a specific adjustment outline of the histogram adjustment. FIG. 8 shows a density correction dialog box. FIG. 9 shows an image adjustment dialog box.

<ヒストグラム調整>
「ヒストグラム調整」では、画像の明暗等を調整することによって、読み取った画像の見栄えの向上を図る。ヒストグラム調整のダイアログボックス131には、図6に示すように、編集対象となる画像のヒストグラムが表示されるヒストグラム表示欄132と、ヒストグラムにより調整をした結果を表わすトーンカーブが表示されるトーンカーブ表示欄134と、色かぶりを取り除くためのグレーバランスを調整するためのグレーバランス調整欄136とが設けられている。ここで、「ヒストグラム」とは、画像全体の明るさと色の分布を示したものであり、画像の黒から白までのデータ分布(ピクセル数)をグラフで表したものである。
<Histogram adjustment>
In “histogram adjustment”, the brightness of the image is adjusted to improve the appearance of the read image. In the histogram adjustment dialog box 131, as shown in FIG. 6, a histogram display field 132 in which a histogram of an image to be edited is displayed, and a tone curve display in which a tone curve indicating the result of adjustment by the histogram is displayed. A column 134 and a gray balance adjustment column 136 for adjusting the gray balance for removing the color cast are provided. Here, the “histogram” represents the brightness and color distribution of the entire image, and is a graph representing the data distribution (number of pixels) from black to white of the image.

ヒストグラム表示欄132には、表示するヒストグラムの種類(チャンネル(色))を選択するためのチャンネル欄138が設けられている。このチャンネル欄138では、RGB(レッド、グリーン、ブルー)全色、R(レッド)のみ、G(グリーン)のみ、B(ブルー)のみの4種類から選択することができる。RGB(レッド、グリーン、ブルー)全色を調整したい場合には、このチャンネル欄138の1番上のスイッチを選択すると、右側にRGB(レッド、グリーン、ブルー)全色のヒストグラムが表示される。また、R(レッド)のみを調整したい場合には、このチャンネル欄138の上から2番目のスイッチを選択すると、右側にR(レッド)のみのヒストグラムが表示される。また、G(グリーン)のみを調整したい場合には、このチャンネル欄138の上から3番目のスイッチを選択すると、右側にG(グリーン)のみのヒストグラムが表示される。また、B(ブルー)のみを調整したい場合には、このチャンネル欄138の上から4番目のスイッチを選択すると、右側にB(ブルー)のみのヒストグラムが表示される。   The histogram display column 132 is provided with a channel column 138 for selecting the type (channel (color)) of the histogram to be displayed. In this channel column 138, it is possible to select from four types of RGB (red, green, blue) all colors, only R (red), only G (green), and only B (blue). If you want to adjust all RGB (red, green, blue) colors, select the top switch in this channel column 138, and a histogram of all RGB (red, green, blue) colors will be displayed on the right. If only the R (red) is to be adjusted, the second switch from the top of the channel field 138 is selected, and a histogram of only R (red) is displayed on the right side. When only G (green) is to be adjusted, when the third switch from the top of the channel field 138 is selected, a histogram of only G (green) is displayed on the right side. If it is desired to adjust only B (blue), selecting the fourth switch from the top of the channel field 138 displays a histogram of only B (blue) on the right side.

そして、表示されたヒストグラムを調整する場合には、表示されたヒストグラムの下側に設けられた3つのスライダー140A、140B、140Cを使って調整を行う。3つのスライダー140A、140B、140Cは、それぞれシャドウを調整するスライダー140Aと、ガンマを調整するスライダー140Bと、ハイライトを調整するスライダー140Cとである。シャドウを調整するスライダー140Aは、黒色の三角印『▲』で表されている。ガンマを調整するスライダー140Bは、灰色の三角印で表されている。ハイライトを調整するスライダー140Cは、白色の三角印『△』で表されている。これら3つのスライダー140A、140B、140Cを使って調整を行う場合には、これら3つのスライダー140A、140B、140Cをそれぞれ個別に左右方向に移動させる。具体的には、シャドウを調整するスライダー140Aについては、ヒストグラムの山の左端よりもやや右側に位置するように移動させる。また、ハイライトを調整するスライダー140Cについては、ヒストグラムの山の右端よりもやや左側に位置するように移動させる。ガンマを調整するスライダー140Bについては、シャドウを調整するスライダー140Aと、ハイライトを調整するスライダー140Cとの間にて左右に移動させて中間部分の明暗が適切になるように調整をする。すると、編集対象となる画像の全体の明暗のバランスが良くなり、画像の見栄えの向上を図ることができる。   When the displayed histogram is adjusted, the adjustment is performed using the three sliders 140A, 140B, and 140C provided below the displayed histogram. The three sliders 140A, 140B, and 140C are a slider 140A that adjusts shadows, a slider 140B that adjusts gamma, and a slider 140C that adjusts highlights. The slider 140A for adjusting the shadow is represented by a black triangle mark “▲”. The slider 140B for adjusting gamma is represented by a gray triangle mark. The slider 140C for adjusting the highlight is represented by a white triangle “Δ”. When adjustment is performed using these three sliders 140A, 140B, and 140C, the three sliders 140A, 140B, and 140C are individually moved in the left-right direction. Specifically, the slider 140A for adjusting the shadow is moved so as to be located slightly to the right of the left end of the histogram peak. Further, the slider 140C for adjusting the highlight is moved so as to be located slightly to the left of the right end of the histogram peak. The slider 140B for adjusting the gamma is adjusted so that the brightness of the intermediate portion is appropriate by moving it to the left and right between the slider 140A for adjusting the shadow and the slider 140C for adjusting the highlight. As a result, the overall light / dark balance of the image to be edited is improved, and the appearance of the image can be improved.

この他に、ヒストグラム表示欄132には、3つのスライダー140A、140B、140Cの位置をそれぞれ個別に直接、数値にて特定するための数値入力欄142A、142B、142Cが設けられている。数値入力欄142Aには、シャドウ入力値が入力される。また、数値入力欄142Bには、ガンマ値が入力される。また、数値入力欄142Cには、ハイライト入力値が入力される。これにより、各数値入力欄142A、142B、142Cに直接、数値を入力して、シャドウ入力値、ハイライト入力値およびガンマ値を簡単に特定することができる。   In addition, the histogram display field 132 is provided with numerical value input fields 142A, 142B, and 142C for directly and directly specifying the positions of the three sliders 140A, 140B, and 140C. A shadow input value is input to the numerical value input field 142A. In addition, the gamma value is input to the numerical value input field 142B. In addition, a highlight input value is input to the numerical value input field 142C. Thereby, it is possible to easily specify the shadow input value, the highlight input value, and the gamma value by directly inputting the numerical value into each numerical value input field 142A, 142B, 142C.

また、これら3つの数値入力欄142A、142B、142Cの右隣りには、それぞれスポイトボタン143A、143B、143Cが設けられている。これらスポイトボタン143A、143B、143Cは、当該ヒストグラム調整のダイアログボックスとは別に表示されるプレビュー画面にて表示された編集対象の画像上から直接ポイントを指示するためのボタンである。3つの数値入力欄142A、142B、142Cには、これらスポイトボタン143A、143B、143Cを利用してプレビュー画面の編集対象の画像上から指示されたポイント(画素)に対応する数値が直接入力される。   Further, dropper buttons 143A, 143B, and 143C are provided on the right of these three numerical value input fields 142A, 142B, and 142C, respectively. The dropper buttons 143A, 143B, and 143C are buttons for directly instructing points from the image to be edited displayed on the preview screen displayed separately from the dialog box for adjusting the histogram. In the three numerical value input fields 142A, 142B, and 142C, numerical values corresponding to points (pixels) designated from the image to be edited on the preview screen are directly input using the dropper buttons 143A, 143B, and 143C. .

さらに、これらシャドウ入力値およびハイライト入力値が入力される2つの数値入力欄142A、142Cの下には、それぞれ2つの数値入力欄142D、142Eが設けられている。左側の数値入力欄142Dには、シャドウ入力値に対応するシャドウ出力値が入力される。また、右側の数値入力欄142Eには、ハイライト入力値に対応するハイライト出力値が入力される。   Further, two numerical value input fields 142D and 142E are provided below the two numerical value input fields 142A and 142C to which the shadow input value and the highlight input value are input, respectively. A shadow output value corresponding to the shadow input value is input to the left numeric input field 142D. Further, a highlight output value corresponding to the highlight input value is input to the numerical value input field 142E on the right side.

なお、これらスライダー140A、140B、140Cや、数値入力欄142A、142B、142C、142D、142Eを用いた調整については、RGB(レッド、グリーン、ブルー)全色、R(レッド)のみ、G(グリーン)のみ、B(ブルー)のみの4種類についてそれぞれ可能である。   For adjustment using these sliders 140A, 140B, and 140C and numerical value input fields 142A, 142B, 142C, 142D, and 142E, RGB (red, green, blue) all colors, R (red) only, G (green) ) And B (blue) only.

図7は、このヒストグラム調整について詳しく説明したものである。このヒストグラム調整では、スライダー140A、140B、140Cまたは数値入力欄142A、142B、142C、142D、142Eを通じて設定されたシャドウ入力値α01、シャドウ出力値α03、ハイライト入力値α02、ハイライト出力値α04、およびガンマ値α05に基づき、同図に示すような入力データと出力データとの対応関係を表すトーンカーブが規定される。すなわち、ここで規定されるトーンカーブは、設定されたシャドウ入力値α01およびシャドウ出力値α03により規定するポイントT1(シャドウ点ともいう)と、設定されたハイライト入力値α02およびハイライト出力値α04により規定されるポイントT2(ハイライト点ともいう)とを通過するように形成される。さらに、トーンカーブは、設定されたガンマ値α05に応じて、これらポイントT1及びT2の間を結ぶ直線のどちらか一方の側に膨らむように形成される。このようにして設定されたシャドウ入力値α01、シャドウ出力値α03、ハイライト入力値α02、ハイライト出力値α04、およびガンマ値α05に基づき、入力データと出力データとの対応関係を表すトーンカーブが規定される。なお、トーンカーブは、R(レッド)、G(グリーン)およびB(ブルー)の各色についてそれぞれ規定される。   FIG. 7 explains this histogram adjustment in detail. In this histogram adjustment, the shadow input value α01, the shadow output value α03, the highlight input value α02, the highlight output value α04, which are set through the sliders 140A, 140B, 140C or the numerical value input fields 142A, 142B, 142C, 142D, 142E, Based on the gamma value α05, a tone curve representing the correspondence between input data and output data as shown in the figure is defined. That is, the tone curve defined here includes a point T1 (also referred to as a shadow point) defined by the set shadow input value α01 and shadow output value α03, and a set highlight input value α02 and highlight output value α04. It is formed so as to pass through a point T2 (also referred to as a highlight point) defined by. Further, the tone curve is formed so as to swell toward one of the straight lines connecting the points T1 and T2 in accordance with the set gamma value α05. Based on the shadow input value α01, the shadow output value α03, the highlight input value α02, the highlight output value α04, and the gamma value α05 set in this way, a tone curve representing the correspondence between the input data and the output data is obtained. It is prescribed. The tone curve is defined for each color of R (red), G (green), and B (blue).

このようにして規定されたトーンカーブは、図6に示すように、トーンカーブ表示欄134に表示される。トーンカーブ表示欄134には、ヒストグラム表示欄132にて行われた調整結果に応じたトーンカーブが表示される。さらに、このトーンカーブ表示欄134では、トーンカーブについてより細かな調整が行えるように、ポイントT1(シャドウ点)またはポイントT2(ハイライト点)よりも外側の階調を調整することができる。具体的には、トーンカーブの左側下部と右側上部とにそれぞれ設けられた端部カーブ形状変更ボタン144A、144Bをクリックして、表示されるプルダウンメニューから希望する端部カーブ形状を選択するようになっている。ここでは、例えば、「ブースト」、「ノーマル」および「ソフト」の3種類から端部カーブ形状を選択することができるようになっている。ここで、「ブースト」は、白地の部分を真っ白にしたり、黒地の部分を真っ黒にしたりしてムラを除去したい場合に選択する。また、「ノーマル」は、ハイライト部分やシャドウ部分をそのまま表現する場合に選択する。また、「ソフト」は、真っ白の部分を本来の白地に戻したり、真っ黒の部分を本来の黒地に戻したりする場合に選択する。   The tone curve thus defined is displayed in the tone curve display field 134 as shown in FIG. In the tone curve display field 134, a tone curve corresponding to the adjustment result performed in the histogram display field 132 is displayed. Further, in the tone curve display field 134, the gradation outside the point T1 (shadow point) or the point T2 (highlight point) can be adjusted so that the tone curve can be finely adjusted. Specifically, the end curve shape change buttons 144A and 144B provided on the lower left portion and the upper right portion of the tone curve are clicked, and the desired end curve shape is selected from the displayed pull-down menu. It has become. Here, for example, the end curve shape can be selected from three types of “boost”, “normal”, and “soft”. Here, “boost” is selected when it is desired to remove unevenness by making the white background part white or making the black part black. “Normal” is selected when the highlight part and the shadow part are expressed as they are. “Soft” is selected when returning a pure white part to an original white background or returning a pure black part to an original black background.

また、グレーバランス調整欄136においては、グレーバランスを調整するためのスライダー145が設けられている。このスライダー145を左右に移動させることによって、グレーバランスを調整して、色かぶりを除去することができる。   In the gray balance adjustment column 136, a slider 145 for adjusting the gray balance is provided. By moving the slider 145 left and right, the gray balance can be adjusted and the color cast can be removed.

<濃度補正>
「濃度補正」は、画像の濃淡の表現を部分的に変更する際に用いる調整である。具体的には、この「濃度補正」では、トーンカーブを調整することによって、読み取った画像の見栄えの向上を図る。つまり、シャドウ(最暗部)、ミッドトーン(中間調)、ハイライト(最明部)へと変化していく濃度の曲線(トーンカーブ)を調整することで、画像全体の明るさとコントラストをバランスよく仕上げることができる。このために、濃度補正のダイアログボックス150には、図8に示すように、トーンカーブ表示部152と、このトーンカーブ表示部152に表示するトーンカーブの種類(チャンネル(色))を選択するためのチャンネル欄154が設けられている。
<Density correction>
“Density correction” is an adjustment used when the expression of the shading of an image is partially changed. Specifically, in this “density correction”, the tone curve is adjusted to improve the appearance of the read image. In other words, by adjusting the density curve (tone curve) that changes to shadow (darkest part), midtone (halftone), and highlight (brightest part), the brightness and contrast of the entire image are balanced. Can be finished. For this purpose, in the density correction dialog box 150, as shown in FIG. 8, a tone curve display unit 152 and a type of tone curve (channel (color)) to be displayed on the tone curve display unit 152 are selected. Channel column 154 is provided.

このチャンネル欄154では、RGB(レッド、グリーン、ブルー)全色、R(レッド)のみ、G(グリーン)のみ、B(ブルー)のみの4種類から選択することができる。RGB(レッド、グリーン、ブルー)全色を調整したい場合には、このチャンネル欄154の1番上のスイッチを選択すると、右側にRGB(レッド、グリーン、ブルー)全色のトーンカーブが表示される。また、R(レッド)のみを調整したい場合には、このチャンネル欄154の上から2番目のスイッチを選択すると、右側にR(レッド)のみのトーンカーブが表示される。また、G(グリーン)のみを調整したい場合には、このチャンネル欄154の上から3番目のスイッチを選択すると、右側にG(グリーン)のみのトーンカーブが表示される。また、B(ブルー)のみを調整したい場合には、このチャンネル欄154の上から4番目のスイッチを選択すると、右側にB(ブルー)のみのトーンカーブが表示される。   In this channel column 154, it is possible to select from all four colors of RGB (red, green, blue), only R (red), only G (green), and only B (blue). If you want to adjust all RGB (red, green, blue) colors, select the top switch in this channel field 154, and the tone curves for all RGB (red, green, blue) colors will be displayed on the right. . If only the R (red) is to be adjusted, the tone curve of only the R (red) is displayed on the right side when the second switch from the top of the channel field 154 is selected. If it is desired to adjust only G (green), selecting the third switch from the top of this channel field 154 displays a tone curve of only G (green) on the right side. If it is desired to adjust only B (blue), when the fourth switch from the top of the channel field 154 is selected, a tone curve of only B (blue) is displayed on the right side.

トーンカーブ表示部152には、横軸を入力値とし、縦軸を出力値としたトーンカーブが表示される。入力値に対して出力値が変化しないように設定した場合には、トーンカーブは、図中、ラインL1として示すように直線となる。   The tone curve display unit 152 displays a tone curve having the horizontal axis as an input value and the vertical axis as an output value. When the output value is set so as not to change with respect to the input value, the tone curve becomes a straight line as indicated by a line L1 in the figure.

そして、トーンカーブを調整する場合には、トーンカーブ表示部152に表示されたトーンカーブ上に任意のポイントを設定し、このポイントを上下左右の各方向にずらしながら、トーンカーブを調整する。本実施形態では、トーンカーブ表示部152に表示されたトーンカーブ上に3つのポイントP1、P2、P3を任意に設定し、これら3つのポイントP1、P2、P3をそれぞれ基準線L1より上下左右の各方向に移動させてずらす。これによって、トーンカーブ表示部152上に、ユーザが所望するトーンカーブを形成するようになっている。なお、3つのポイントP1、P2、P3の各座標については、それぞれトーンカーブ表示部152の左側に設けられた2つの数値入力欄156A、156Bを通じて設定することもできる。ここでは、上方の数値入力欄156Aに入力値を入力し、下方の数値入力欄156Bに出力値を入力することで、各ポイントP1、P2、P3の各座標について設定することができる。   When adjusting the tone curve, an arbitrary point is set on the tone curve displayed on the tone curve display unit 152, and the tone curve is adjusted while shifting this point in the vertical and horizontal directions. In the present embodiment, three points P1, P2, and P3 are arbitrarily set on the tone curve displayed on the tone curve display unit 152, and these three points P1, P2, and P3 are respectively set up, down, left, and right from the reference line L1. Move and move in each direction. As a result, a tone curve desired by the user is formed on the tone curve display portion 152. The coordinates of the three points P1, P2, and P3 can also be set through two numerical value input fields 156A and 156B provided on the left side of the tone curve display unit 152, respectively. Here, by inputting an input value in the upper numerical value input field 156A and inputting an output value in the lower numerical value input field 156B, the coordinates of each point P1, P2, and P3 can be set.

このようなトーンカーブの調整については、RGB(レッド、グリーン、ブルー)全色、R(レッド)のみ、G(グリーン)のみ、B(ブルー)のみの4種類についてそれぞれ可能である。トーンカーブの設定については、濃度補正のダイアログボックス150の上部に設けられた濃度補正設定保存欄158を通じて保存しておくことができる。   Such adjustment of the tone curve is possible for each of four types of RGB (red, green, blue), R (red) only, G (green) only, and B (blue) only. The tone curve setting can be stored through a density correction setting storage field 158 provided at the top of the density correction dialog box 150.

<イメージ調整>
「イメージ調整」には、図9のイメージ調整のダイアログボックス160に示すように、(1)明るさの調整と、(2)コントラストの調整と、(3)彩度の調整と、(4)カラーバランスの調整との4種類の調整がある。さらに、『(4)カラーバランスの調整』には、「シアン(C)−レッド(R)」の間の調整と、「マゼンダ(M)−グリーン(G)」の間の調整と、「イエロー(Y)−ブルー(B)」の間の調整との3種類の調整がある。
<Image adjustment>
As shown in the image adjustment dialog box 160 in FIG. 9, the “image adjustment” includes (1) brightness adjustment, (2) contrast adjustment, (3) saturation adjustment, and (4). There are four types of adjustments: color balance adjustments. Further, “(4) Color balance adjustment” includes an adjustment between “cyan (C) -red (R)”, an adjustment between “magenta (M) -green (G)”, and “yellow”. There are three types of adjustments, with adjustments between (Y)-Blue (B) ".

(1)明るさの調整
『(1)明るさの調整』は、画像が明る過ぎたり暗すぎたりした場合に行う。『(1)明るさの調整』は、スライダー162Aを左右に移動させたり、また、スライダー162Aの右側に設けられた数値入力欄164Aに直接、数値を入力することにより行うことができる。
(1) Brightness adjustment “(1) Brightness adjustment” is performed when an image is too bright or too dark. “(1) Brightness adjustment” can be performed by moving the slider 162A to the left or right, or by directly inputting a numerical value into the numerical value input field 164A provided on the right side of the slider 162A.

(2)コントラストの調整
『(2)コントラストの調整』は、明暗をはっきりさせたり、逆に明暗の差を小さくする場合に行う。『(2)コントラストの調整』は、スライダー162Bを左右に移動させたり、また、スライダー162Bの右側に設けられた数値入力欄164Bに直接、数値を入力することにより行うことができる。
(2) Contrast adjustment “(2) Contrast adjustment” is performed when the contrast is made clear or, on the contrary, the difference between light and dark is reduced. "(2) Contrast adjustment" can be performed by moving the slider 162B to the left or right, or by directly inputting a numerical value into the numerical value input field 164B provided on the right side of the slider 162B.

(3)彩度の調整
『(3)彩度の調整』は、色味を鮮やかにしたい場合に行う。『(3)彩度の調整』は、スライダー162Cを左右に移動させたり、また、スライダー162Cの右側に設けられた数値入力欄164Cに直接、数値を入力することにより行うことができる。
(3) Saturation adjustment “(3) Saturation adjustment” is performed when it is desired to make the color vivid. “(3) Saturation adjustment” can be performed by moving the slider 162C to the left or right, or by directly inputting a numerical value into the numerical value input field 164C provided on the right side of the slider 162C.

(4)カラーバランスの調整
『(4)カラーバランスの調整』は、画像が赤みや青み等を帯びている場合に行う。『(4)カラーバランスの調整』は、各スライダー162D、162E、162Fを左右に移動させたり、また、各スライダー162D、162E、162Fの右側にそれぞれ設けられた数値入力欄164D、164E、164Fに直接、数値を入力することにより行うことができる。これによって、画像を適切な色合いに調整することができる。具体的には、「シアン(C)−レッド(R)」の間の調整用のスライダー162Dを左右に移動させることにより、シアンおよびレッド(R)の強弱を調整することができる。また、「マゼンダ(M)−グリーン(G)」の間の調整用のスライダー162Eを左右に移動させることにより、マゼンダ(M)およびグリーン(G)の強弱を調整することができる。また、「イエロー(Y)−ブルー(B)」の間の調整用のスライダー162Fを左右に移動させることにより、イエロー(Y)およびブルー(B)の強弱を調整することができる。
(4) Color balance adjustment “(4) Color balance adjustment” is performed when the image is reddish or bluish. “(4) Color balance adjustment” is performed by moving the sliders 162D, 162E, and 162F to the left and right, and in numerical value input fields 164D, 164E, and 164F provided on the right side of the sliders 162D, 162E, and 162F, respectively. This can be done by directly entering a numerical value. As a result, the image can be adjusted to an appropriate hue. Specifically, the strength of cyan and red (R) can be adjusted by moving the adjustment slider 162D between “cyan (C) and red (R)” to the left and right. Further, the strength of magenta (M) and green (G) can be adjusted by moving the adjustment slider 162E between “magenta (M) and green (G)” to the left and right. Further, the strength of yellow (Y) and blue (B) can be adjusted by moving the adjustment slider 162F between “yellow (Y) and blue (B)” to the left and right.

ここで、『(1)明るさの調整』および『(4)カラーバランスの調整』は、レッド(R)、グリーン(G)およびブルー(B)の3色全てまたは各色について濃淡を全体的にシフトさせる変換を行う処理である。また、『(2)コントラストの調整』は、レッド(R)、グリーン(G)およびブルー(B)の3色全てについて濃淡の変化を強めたり弱めたりする変換を行う処理である。   Here, “(1) Brightness adjustment” and “(4) Color balance adjustment” are all three colors of red (R), green (G), and blue (B) or shades of each color as a whole. This is a process of performing conversion to shift. In addition, “(2) Contrast adjustment” is a process for performing conversion to increase or decrease the change in shading for all three colors of red (R), green (G), and blue (B).

一方、『(3)彩度の調整』は、例えば、次のような変換式(1)〜(3)を利用して、レッド(R)、グリーン(G)およびブルー(B)の各色のデータをそれぞれ変換する処理である。ここでは、レッド(R)、グリーン(G)およびブルー(B)の各色の入力データをそれぞれ『R』、『G』、『B』にて示している。また、レッド(R)、グリーン(G)およびブルー(B)の各色の出力データをそれぞれ『R’』、『G’』、『B’』にて示している。
R’=S11×R+S12×G+S13×B ……………(1)
G’=S21×R+S22×G+S23×B ……………(2)
B’=S31×R+S32×G+S33×B ……………(3)
ここで、S11、S12、S13、S21、S22、S23、S31、S32、S33は、設定された彩度の値に応じて設定される係数である。そして、彩度を高める場合は、S11、S22、S33に『1』より大きな値が設定され、他方、S12、S13、S21、S23、S31、S32に負の値が設定される。このようにして『(3)彩度の調整』は、実行される。
On the other hand, “(3) Saturation adjustment” uses the following conversion formulas (1) to (3), for example, for each color of red (R), green (G), and blue (B). This is a process of converting data. Here, input data of each color of red (R), green (G), and blue (B) is indicated by “R”, “G”, and “B”, respectively. Further, output data of each color of red (R), green (G), and blue (B) are indicated by “R ′”, “G ′”, and “B ′”, respectively.
R ′ = S11 × R + S12 × G + S13 × B (1)
G ′ = S21 × R + S22 × G + S23 × B (2)
B ′ = S31 × R + S32 × G + S33 × B (3)
Here, S11, S12, S13, S21, S22, S23, S31, S32, and S33 are coefficients set according to the set saturation value. When increasing the saturation, values larger than “1” are set in S11, S22, and S33, and negative values are set in S12, S13, S21, S23, S31, and S32. In this way, “(3) Saturation adjustment” is executed.

<設定データ>
図10A〜図10Cは、これらヒストグラム調整、濃度補正、およびイメージ調整によりそれぞれ設定されたデータについて説明したものである。図10Aは、ヒストグラム調整により設定されるデータについて説明したものである。図10Bは、濃度補正により設定されるデータについて説明したものである。図10Cは、イメージ調整により設定されるデータについて説明したものである。
<Setting data>
FIG. 10A to FIG. 10C illustrate data set by the histogram adjustment, density correction, and image adjustment, respectively. FIG. 10A explains data set by histogram adjustment. FIG. 10B explains data set by density correction. FIG. 10C explains data set by image adjustment.

ヒストグラム調整の場合には、図10Aに示すように、R(レッド)、G(グリーン)およびB(ブルー)の各色のシャドウ入力値α11、α21、α31と、シャドウ出力値α13、α23、α33と、ハイライト入力値α12、α22、α32と、ハイライト出力値α14、α24、α34と、ガンマ値α15、α25、α35とがデータとして設定される。この他に、ここでは、トーンカーブの端部形状として「下端部形状」および「上端部形状」に関するデータα41、α42と、グレーバランス調整における調整値α51とがデータとして設定される。スキャナドライバは、これらのデータα11、α21、α31、α13、α12、α22、α32、α23、α33、α14、α24、α34、α15、α25、α35、α41、α42、α51を設定データとして記憶する。なお、これらの設定データα11、α21、α31、α13、α23、α33、α12、α22、α32、α14、α24、α34、α15、α25、α35、α41、α42、α51は、例えば、図6にて説明したヒストグラム調整のダイアログボックス131を通じてユーザにより設定される場合の他に、スキャナドライバによって演算等により自動的に設定される場合がある。スキャナドライバは、記憶した設定データα11、α21、α31、α13、α23、α33、α12、α22、α32、α14、α24、α34、α15、α25、α35、α41、α42、α51に基づき、入力画像に対して画像調整を施す。   In the case of histogram adjustment, as shown in FIG. 10A, the shadow input values α11, α21, and α31 and the shadow output values α13, α23, and α33 for each color of R (red), G (green), and B (blue) Highlight input values α12, α22, α32, highlight output values α14, α24, α34, and gamma values α15, α25, α35 are set as data. In addition to this, data α41, α42 relating to the “lower end shape” and “upper end shape” as the end shape of the tone curve, and the adjustment value α51 in gray balance adjustment are set as data. The scanner driver stores these data α11, α21, α31, α13, α12, α22, α32, α23, α33, α14, α24, α34, α15, α25, α35, α41, α42, α51 as setting data. These setting data α11, α21, α31, α13, α23, α33, α12, α22, α32, α14, α24, α34, α15, α25, α35, α41, α42, α51 will be described with reference to FIG. 6, for example. In addition to being set by the user through the histogram adjustment dialog box 131, the scanner driver may be automatically set by calculation or the like. The scanner driver uses the stored setting data α11, α21, α31, α13, α23, α33, α12, α22, α32, α14, α24, α34, α15, α25, α35, α41, α42, α51 based on the input image. To adjust the image.

また、濃度補正の場合には、図10Bに示すように、R(レッド)、G(グリーン)およびB(ブルー)の各色についてそれぞれトーンカーブ上に設定された複数のポイントP1、P2、P3…………の入力座標β11、β13、β21、β23、β31、β33…………および出力座標β12、β14、β22、β24、β32、β34…………がデータとして設定される。スキャナドライバは、これらポイントP1、P2、P3…………の入力座標β11、β13、β21、β23、β31、β33…………および出力座標β12、β14、β22、β24、β32、β34…………を設定データとして記憶する。なお、これらの設定データβ11、β13、β21、β23、β31、β33…………、β12、β14、β22、β24、β32、β34…………は、例えば、図8にて説明した濃度補正のダイアログボックス150を通じてユーザにより設定される場合の他に、スキャナドライバによって演算等により自動的に設定される場合がある。スキャナドライバは、記憶した設定データβ11、β13、β21、β23、β31、β33…………、β12、β14、β22、β24、β32、β34…………に基づき、濃度補正を実行する。   In the case of density correction, as shown in FIG. 10B, a plurality of points P1, P2, P3,... Set on the tone curve for each color of R (red), G (green), and B (blue). The input coordinates β11, β13, β21, β23, β31, β33,... And the output coordinates β12, β14, β22, β24, β32, β34,. The scanner driver inputs the input coordinates β11, β13, β21, β23, β31, β33... And the output coordinates β12, β14, β22, β24, β32, β34... Of these points P1, P2, P3. Is stored as setting data. These setting data β11, β13, β21, β23, β31, β33,..., Β12, β14, β22, β24, β32, β34,. In addition to being set by the user through the dialog box 150, it may be set automatically by calculation or the like by the scanner driver. The scanner driver executes density correction based on the stored setting data β11, β13, β21, β23, β31, β33..., Β12, β14, β22, β24, β32, β34.

また、イメージ調整の場合には、図10Cに示すように、『(1)明るさの調整』の設定値γ1と、『(2)コントラストの調整』の設定値γ2と、『(3)彩度の調整』の設定値γ3と、『(4)カラーバランスの調整』の設定値γ4、γ5、γ6とが設定される。『(4)カラーバランスの調整』の設定としては、「シアン(C)−レッド(R)」の間の設定値γ4と、「マゼンダ(M)−グリーン(G)」の間の設定値γ5と、「イエロー(Y)−ブルー(B)」の間の設定値γ6との3種類ある。スキャナドライバは、これらの設定値γ1、γ2、γ3、γ4、γ5、γ6を設定データとして記憶する。なお、これらの設定データγ1、γ2、γ3、γ4、γ5、γ6は、例えば、図9にて説明したイメージ調整のダイアログボックス160を通じてユーザにより設定される場合の他に、スキャナドライバによって演算等により自動的に設定される場合がある。スキャナドライバは、記憶した設定データγ1、γ2、γ3、γ4、γ5、γ6に基づき、イメージ調整を実行する。   In the case of image adjustment, as shown in FIG. 10C, the setting value γ1 of “(1) Brightness adjustment”, the setting value γ2 of “(2) Contrast adjustment”, and “(3) Color” Setting value γ3 of “degree adjustment” and setting values γ4, γ5, and γ6 of “(4) Color balance adjustment” are set. “(4) Color balance adjustment” includes a setting value γ4 between “cyan (C) -red (R)” and a setting value γ5 between “magenta (M) -green (G)”. And a set value γ6 between “yellow (Y) -blue (B)”. The scanner driver stores these setting values γ1, γ2, γ3, γ4, γ5, and γ6 as setting data. These setting data γ1, γ2, γ3, γ4, γ5, and γ6 are set by the user through the image adjustment dialog box 160 described with reference to FIG. May be set automatically. The scanner driver performs image adjustment based on the stored setting data γ1, γ2, γ3, γ4, γ5, and γ6.

===調整手順===
これらヒストグラム調整、濃度補正およびイメージ調整により設定されたデータに基づき、入力画像、即ちここでは、画像読み取り装置10により読み取られた画像を調整する手順の一例について説明する。図11は、この手順の一例について示したものである。
=== Adjustment procedure ===
An example of a procedure for adjusting an input image, that is, an image read by the image reading apparatus 10 based on data set by the histogram adjustment, density correction, and image adjustment will be described. FIG. 11 shows an example of this procedure.

スキャナドライバは、入力画像、即ちここでは、画像読み取り装置10により読み取られた画像に対して、ヒストグラム調整を施す(S002)。このヒストグラム調整では、スキャナドライバは、R(レッド)、G(グリーン)およびB(ブルー)の各色についてそれぞれ規定されたトーンカーブに基づき、R(レッド)、G(グリーン)およびB(ブルー)の各色についてそれぞれ入力画像の各画素のデータRin、Gin、Binを変換して出力する。ここで、スキャナドライバは、図6にて説明したヒストグラム調整のダイアログボックス131を通じてユーザにより設定されたり、また自ら自動的に設定したR(レッド)、G(グリーン)およびB(ブルー)の各色のシャドウ入力値α11、α21、α31やシャドウ出力値α13、α23、α33、ハイライト入力値α12、α22、α32、ハイライト出力値α14、α24、α34、ガンマ値α15、α25、α35、またこの他にトーンカーブの端部形状のデータα41、α42、グレーバランス調整の調整値α51などを参照してこれらのデータに基づきヒストグラム調整を実行する。これにより、スキャナドライバは、入力画像の各画素のデータRin、Gin、Bin(入力データ)を出力データRout1、Gout1、Bout1に変換して出力する。   The scanner driver performs histogram adjustment on the input image, that is, the image read by the image reading device 10 here (S002). In this histogram adjustment, the scanner driver adjusts R (red), G (green), and B (blue) based on tone curves defined for R (red), G (green), and B (blue), respectively. Data Rin, Gin, Bin of each pixel of the input image is converted and output for each color. Here, the scanner driver is set by the user through the histogram adjustment dialog box 131 described with reference to FIG. 6 or automatically set for each color of R (red), G (green), and B (blue). Shadow input values α11, α21, α31, shadow output values α13, α23, α33, highlight input values α12, α22, α32, highlight output values α14, α24, α34, gamma values α15, α25, α35, and others The histogram adjustment is executed based on these data with reference to the data α41 and α42 of the end shape of the tone curve and the adjustment value α51 of the gray balance adjustment. Thus, the scanner driver converts the data Rin, Gin, Bin (input data) of each pixel of the input image into output data Rout1, Gout1, Bout1, and outputs the converted data.

このようにしてヒストグラム調整を行った後、スキャナドライバは、次にステップS004へと進み、ヒストグラム調整が施された画像のデータに対してイメージ調整を施す(S004)。ここでは、スキャナドライバは、イメージ調整として、(1)明るさの調整と、(2)コントラストの調整と、(3)カラーバランスの調整とを施す。すなわち、スキャナドライバは、『(1)明るさの調整』の設定値γ1と、『(2)コントラストの調整』の設定値γ2と、『(4)カラーバランスの調整』の設定値γ4、γ5、γ6とに基づいて、それぞれ調整を施す。これにより、スキャナドライバは、ヒストグラム調整による出力データRout1、Gout1、Bout1を出力データRout2、Gout2、Bout2に変換して出力する。   After performing the histogram adjustment in this way, the scanner driver proceeds to step S004, and performs image adjustment on the image data on which the histogram adjustment has been performed (S004). Here, the scanner driver performs (1) brightness adjustment, (2) contrast adjustment, and (3) color balance adjustment as image adjustment. That is, the scanner driver sets the setting value γ1 of “(1) Brightness adjustment”, the setting value γ2 of “(2) Contrast adjustment”, and the setting values γ4, γ5 of “(4) Color balance adjustment”. , And γ6 are adjusted respectively. As a result, the scanner driver converts the output data Rout1, Gout1, and Bout1 resulting from the histogram adjustment into output data Rout2, Gout2, and Bout2, and outputs them.

そして、このようにイメージ調整((3)彩度の調整を除く)を行った後、次に、スキャナドライバは、ステップS006へと進み、イメージ調整が施された画像のデータに対して濃度補正を施す(S006)。この濃度補正では、スキャナドライバは、R(レッド)、G(グリーン)およびB(ブルー)の各色についてそれぞれ調整されたトーンカーブに基づき、R(レッド)、G(グリーン)およびB(ブルー)の各色についてそれぞれ入力画像の各画素のデータを変換して出力する。すなわち、ここでは、スキャナドライバは、R(レッド)、G(グリーン)およびB(ブルー)の各色についてトーンカーブ上に設定された複数のポイントP1、P2、P3…………の入力座標β11、β13、β21、β23、β31、β33…………および出力座標β12、β14、β22、β24、β32、β34…………の設定データを参照して、これらの設定データに基づき形成されるトーンカーブに基づき、濃度補正を実行する。これにより、スキャナドライバは、イメージ調整((3)彩度の調整を除く)による出力データRout2、Gout2、Bout2を出力データRout3、Gout3、Bout3に変換して出力する。   Then, after performing image adjustment (excluding (3) saturation adjustment) in this way, the scanner driver proceeds to step S006, and density correction is performed on the image data subjected to image adjustment. (S006). In this density correction, the scanner driver adjusts R (red), G (green), and B (blue) based on tone curves adjusted for the respective colors R (red), G (green), and B (blue). Data of each pixel of the input image is converted and output for each color. That is, here, the scanner driver inputs the input coordinates β11 of a plurality of points P1, P2, P3,... Set on the tone curve for each color of R (red), G (green), and B (blue). Referring to the setting data of β13, β21, β23, β31, β33 ………… and output coordinates β12, β14, β22, β24, β32, β34 …………, the tone curve formed based on these setting data Based on the above, density correction is executed. As a result, the scanner driver converts the output data Rout2, Gout2, and Bout2 resulting from image adjustment (excluding (3) saturation adjustment) into output data Rout3, Gout3, and Bout3 and outputs them.

このようにして濃度補正を行った後、スキャナドライバは、次にステップS008へと進み、濃度補正が施された画像のデータに対してイメージ調整として『(3)彩度の調整』を施す(S008)。ここで、スキャナドライバは、『(3)彩度の調整』の設定値γ3に基づき、調整を施す。これにより、スキャナドライバは、濃度補正による出力データRout3、Gout3、Bout3を出力データRout4、Gout4、Bout4に変換して出力する。   After performing the density correction in this manner, the scanner driver proceeds to step S008, and performs “(3) Saturation adjustment” as image adjustment on the image data subjected to density correction ( S008). Here, the scanner driver performs adjustment based on the set value γ3 of “(3) Saturation adjustment”. As a result, the scanner driver converts the output data Rout3, Gout3, and Bout3 resulting from the density correction into output data Rout4, Gout4, and Bout4 and outputs them.

このようにしてイメージ調整として『(3)彩度の調整』を行った後、次に、スキャナドライバは、『(3)彩度の調整』が施された画像のデータに対して、色変換処理を施す(S010)。この色変換処理とは、各種出力機器(ここでは、表示装置をはじめ、各種プリンタ等)で扱う上で適切なデータに変換するための処理である。具体的には、例えば、次のような変換式(4)〜(6)により実施する。
R’=A11×R+A12×G+A13×B ……………(4)
G’=A21×R+A22×G+A23×B ……………(5)
B’=A31×R+A32×G+A33×B ……………(6)
ここで、変換前のレッド(R)、グリーン(G)およびブルー(B)の各色の入力データをそれぞれ『R』、『G』、『B』により示している。また、変換後のレッド(R)、グリーン(G)およびブルー(B)の各色の出力データをそれぞれ『R’』、『G’』、『B’』により示している。また、A11、A12、A13、A21、A22、A23、A31、A32、A33は、各種出力機器(表示装置24やプリンタ等)の特性に応じて適宜設定される係数である。
After performing “(3) saturation adjustment” as image adjustment in this way, the scanner driver then performs color conversion on the image data that has been subjected to “(3) saturation adjustment”. Processing is performed (S010). The color conversion process is a process for converting data into data suitable for handling by various output devices (here, display devices, various printers, etc.). Specifically, for example, the following conversion formulas (4) to (6) are used.
R '= A11 * R + A12 * G + A13 * B (4)
G ′ = A21 × R + A22 × G + A23 × B (5)
B '= A31 * R + A32 * G + A33 * B (6)
Here, input data of red (R), green (G), and blue (B) before conversion are indicated by “R”, “G”, and “B”, respectively. Further, output data of each color of red (R), green (G), and blue (B) after conversion is indicated by “R ′”, “G ′”, and “B ′”, respectively. A11, A12, A13, A21, A22, A23, A31, A32, and A33 are coefficients that are appropriately set according to the characteristics of various output devices (display device 24, printer, etc.).

このようにしてスキャナドライバは、『(3)彩度の調整』が施された画像のデータに対して各種出力機器の特性に応じた色変換処理を施す。これにより、スキャナドライバは、イメージ調整((3)彩度の調整)による出力データRout4、Gout4、Bout4を出力データRout5、Gout5、Bout5に変換して出力する。そして、スキャナドライバは、このようにして色変換処理を実行した後、色変換処理が施された画像を出力画像として出力する。   In this way, the scanner driver performs color conversion processing according to the characteristics of various output devices on the image data on which “(3) saturation adjustment” has been performed. As a result, the scanner driver converts the output data Rout4, Gout4, and Bout4 by image adjustment ((3) saturation adjustment) into output data Rout5, Gout5, and Bout5 and outputs them. Then, after performing the color conversion process in this manner, the scanner driver outputs the image subjected to the color conversion process as an output image.

なお、ここでは、最終段階にて色変換処理を実行する場合を例にして説明したが、この色変換処理については必要に応じて実行するものとする。   Although the case where the color conversion process is executed at the final stage has been described as an example here, the color conversion process is executed as necessary.

===プレスキャン===
図12は、画像読み取り装置10による画像読み取り手順の一例について説明したものである。画像読み取り装置10により画像を読み取る際に、プレスキャンを実行する場合がある。このプレスキャンとは、例えば、高解像度にて画像を読み取る場合等において、最初から高解像度にて画像を読み取る動作を実行するのではなく、高解像度にて画像を読み取る動作(本スキャン)を実行する前、一度、例えば、低解像度にて画像を読み取ることをいう。
=== Pre-scan ===
FIG. 12 illustrates an example of an image reading procedure performed by the image reading apparatus 10. When an image is read by the image reading device 10, a pre-scan may be executed. For example, in the case of reading an image at a high resolution, this pre-scan does not execute an operation for reading an image at a high resolution from the beginning, but an operation for reading an image at a high resolution (main scan). For example, reading an image at a low resolution once.

プレスキャンは、同図に示すように、最初に実行される(S050)。スキャナドライバは、このプレスキャン動作によってプレスキャン画像(プレ画像)を取得する(S052)。次にスキャナドライバは、取得したプレスキャン画像(プレ画像)に対して自動調整等を施す。ここで、スキャナドライバは、取得したプレスキャン画像(プレ画像)に対して、ヒストグラム調整や濃度補正、イメージ調整等における適切な調整値等を求めて、自動的に補正する(S054)。ここで自動的に補正された画像は、例えば、表示装置24等に表示される。   As shown in the figure, the pre-scan is first executed (S050). The scanner driver acquires a pre-scan image (pre-image) by this pre-scan operation (S052). Next, the scanner driver performs automatic adjustment or the like on the acquired pre-scan image (pre-image). Here, the scanner driver obtains an appropriate adjustment value in histogram adjustment, density correction, image adjustment, and the like for the acquired pre-scan image (pre-image) and automatically corrects it (S054). The automatically corrected image is displayed on the display device 24, for example.

ユーザは、このようにして表示装置24等に表示されたプレスキャン画像(プレ画像)を見ながら、各種調整(補正)を実行する(S056)。ここでは、ユーザは、図6のヒストグラム調整のダイアログボックス131や、図8の濃度補正のダイアログボックス150、図9のイメージ調整のダイアログボックス160等を通じて各種調整(補正)を実行する。   The user performs various adjustments (corrections) while viewing the pre-scan image (pre-image) displayed on the display device 24 or the like in this way (S056). Here, the user performs various adjustments (corrections) through the histogram adjustment dialog box 131 in FIG. 6, the density correction dialog box 150 in FIG. 8, the image adjustment dialog box 160 in FIG.

このようにしてユーザにより各種調整(補正)が行われた後、本スキャンを実行する。この本スキャンでは、画像読み取り装置10によって原稿15から画像が高解像度にて読み取られる(S058)。そして、スキャナドライバは、このようにして本スキャンにより取得された高解像度の画像に対してユーザ等により設定されたデータに基づき、ヒストグラム調整や濃度補正、イメージ調整等の各種調整(補正)を実行する。これにより、各種調整(補正)が施された本画像を取得する(S060)。   After various adjustments (corrections) are made by the user in this way, the main scan is executed. In this main scan, the image is read from the document 15 with high resolution by the image reading device 10 (S058). The scanner driver performs various adjustments (corrections) such as histogram adjustment, density correction, and image adjustment based on the data set by the user or the like for the high-resolution image acquired by the main scan in this way. To do. Thereby, the main image subjected to various adjustments (corrections) is acquired (S060).

===従来の問題点及び解決方法===
<従来の問題点>
これらヒストグラム調整や濃度補正、イメージ調整等によって、画像読み取り装置により読み取った画像に対して各種調整(補正)が自動的に行われた場合であっても、例えば、中間調などの色バランスが崩れた画像については、十分な補正処理を実行することはできなかった。また、これらヒストグラム調整や濃度補正、イメージ調整等を通じてユーザが、例えば、中間調などの色バランスが崩れた画像に対して十分な調整(補正)を施すのはきわめて難しかった。
=== Conventional Problems and Solutions ===
<Conventional problems>
Even when various adjustments (corrections) are automatically performed on the image read by the image reading device by the histogram adjustment, density correction, image adjustment, etc., the color balance such as halftone is lost. However, sufficient correction processing could not be executed for the obtained image. Further, it has been extremely difficult for the user to perform sufficient adjustment (correction) on an image whose color balance has been lost, such as halftone, through the histogram adjustment, density correction, image adjustment, and the like.

そこで、このような中間調などの色バランスが崩れた画像に対しても、十分な調整(補正)を施すことができるようにするために、このような画像のための補正機能を備える必要があった。   Therefore, it is necessary to provide a correction function for such an image so that sufficient adjustment (correction) can be performed even on an image in which color balance such as halftone is lost. there were.

<解決方法>
このようなことから、本実施形態では、例えば、中間調などの色バランスが崩れた画像に対して適切な補正処理を実行するために、次のような補正方法を実施する。以下にここで行われる補正方法について詳しく説明する。
<Solution>
For this reason, in the present embodiment, for example, the following correction method is performed in order to execute an appropriate correction process on an image whose color balance is lost, such as a halftone. The correction method performed here will be described in detail below.

===画像の補正===
本実施形態で行われる、中間調などの色バランスが崩れた画像の補正方法について詳しく説明する。なお、本実施形態では、中間調などの色バランスが崩れた画像に対する補正処理は、スキャナドライバにより行われる。このことから、スキャナドライバは、「画像補正プログラム」に相当する。また、スキャナドライバが実行されるコンピュータ装置20は、「画像補正装置」に相当する。
=== Image Correction ===
A method for correcting an image in which the color balance such as halftone is lost, which is performed in the present embodiment, will be described in detail. In the present embodiment, correction processing for an image whose color balance is lost, such as halftone, is performed by a scanner driver. Therefore, the scanner driver corresponds to an “image correction program”. The computer device 20 on which the scanner driver is executed corresponds to an “image correction device”.

図13は、ここで実施される画像の補正方法について説明したものである。スキャナドライバは、まず、画像読み取り装置10により読み取った画像のデータに基づき、ヒストグラムのデータを生成する(S102)。なお、このことから、スキャナドライバは、「ヒストグラムデータ生成部」に相当する。ここで生成されるヒストグラムとは、画像読み取り装置10により読み取った画像を構成する各画素の濃度値に対する画素の数の分布を表したグラフである。ヒストグラムの横軸には、画素の濃度値が設定され、またヒストグラムの縦軸には、画素の数が設定される。このヒストグラムには、グラフの横軸の濃度値ごとにそれぞれ画素の数を表す長方形状の棒グラフ等が形成される。ここで形成される棒グラフ等が横方向に相互につなぎ合わされて、全体がある形状を持つ領域を有するグラフを形成している。   FIG. 13 illustrates an image correction method performed here. The scanner driver first generates histogram data based on the image data read by the image reading device 10 (S102). From this, the scanner driver corresponds to a “histogram data generation unit”. The histogram generated here is a graph representing the distribution of the number of pixels with respect to the density value of each pixel constituting the image read by the image reading device 10. On the horizontal axis of the histogram, the density value of the pixel is set, and on the vertical axis of the histogram, the number of pixels is set. In this histogram, a rectangular bar graph representing the number of pixels for each density value on the horizontal axis of the graph is formed. The bar graphs and the like formed here are connected to each other in the horizontal direction to form a graph having an area having a certain shape as a whole.

スキャナドライバは、このようにしてヒストグラムのデータを生成した後、次に、生成したヒストグラムのデータに基づき、ヒストグラムにより表される領域を画素の濃度値の大きさ別に3つ以上の小領域に区分する(S104)。ここで区分される小領域の個数は、4つであっても良く、もちろん5つ以上であっても構わない。また、区分される小領域の面積は、相互にほぼ等しくなるように設定されていても良く、また相互に等しくならないように設定されていても良い。もちろん、区分された小領域のうちの一部の2つ以上の小領域の面積が相互にほぼ等しくなるように設定されていても良い。また、区分される小領域における画素の数は、相互にほぼ等しくなるように設定されていても良く、また相互に等しくならないように設定されていても良い。もちろん、区分された2つ以上の小領域のうちの一部の2つ以上の小領域における画素の数が相互にほぼ等しくなるように設定されていても良い。   After generating the histogram data in this manner, the scanner driver then divides the area represented by the histogram into three or more small areas according to the density value of the pixel based on the generated histogram data. (S104). Here, the number of small areas to be divided may be four, or of course five or more. Further, the areas of the divided small regions may be set to be substantially equal to each other, or may be set to be not equal to each other. Of course, the areas of two or more of the partial small regions may be set to be substantially equal to each other. In addition, the number of pixels in the small area to be divided may be set to be substantially equal to each other, or may be set to be not equal to each other. Needless to say, the number of pixels in a part of two or more of the divided two or more small regions may be set to be substantially equal to each other.

スキャナドライバは、このようにしてヒストグラムにより表される領域を3つ以上の小領域に区分した後、次に、区分した3つ以上の小領域の中から少なくとも1つの小領域を選出する(S106)。ここでスキャナドライバが選出する小領域は、2つであってもよく、また3つ以上であっても構わない。もちろん、ここでスキャナドライバは、全ての小領域を選出しても構わない。なお、ここでスキャナドライバにより選出される小領域としては、画像読み取り装置10により読み取った画像に対してスキャナドライバが、中間調などの色バランスが崩れた画像のための補正処理を施すにあたって必要な情報を取り出すことができる小領域が望ましい。   The scanner driver thus divides the area represented by the histogram into three or more small areas, and then selects at least one small area from the three or more divided small areas (S106). ). Here, the small area selected by the scanner driver may be two, or may be three or more. Of course, the scanner driver may select all the small areas here. Here, the small area selected by the scanner driver is necessary for the scanner driver to perform correction processing on an image read by the image reading device 10 for an image whose color balance is lost, such as halftone. A small area from which information can be extracted is desirable.

このようにしてヒストグラムにより表される領域を区分して得られた2つ以上の小領域の中から少なくとも1つの小領域を選出した後、スキャナドライバは、次に、選出した小領域から属性情報を取得する(S108)。なお、ここでスキャナドライバは、「属性情報取得部」に相当する。   After selecting at least one small area from the two or more small areas obtained by dividing the area represented by the histogram in this way, the scanner driver then selects attribute information from the selected small area. Is acquired (S108). Here, the scanner driver corresponds to an “attribute information acquisition unit”.

ここでスキャナドライバが取得する属性情報とは、スキャナドライバが選出した小領域が持っている性質や特徴に関する情報のことである。ここでスキャナドライバが取得する属性情報としては、例えば、スキャナドライバが選出した小領域を占める画素の濃度値の平均値や、スキャナドライバが選出した小領域を占める画素の濃度値の上限値または下限値、さらに、スキャナドライバが選出した小領域に隣接する小領域との間の境界線に対応する濃度値、この他に、スキャナドライバが選出した小領域の面積の大きさ等、様々な属性情報がある。スキャナドライバは、これらの各種属性情報の中から少なくとも1種類の属性情報を取得する。すなわち、スキャナドライバは、これらの各種属性情報の中から1種類の属性情報を取得しても良く、また複数種類の属性情報を取得しても良い。   Here, the attribute information acquired by the scanner driver is information on the properties and characteristics of the small area selected by the scanner driver. Here, as the attribute information acquired by the scanner driver, for example, the average value of the density values of the pixels occupying the small area selected by the scanner driver, or the upper limit value or the lower limit of the density value of the pixels occupying the small area selected by the scanner driver. In addition, various attribute information such as the density value corresponding to the boundary line between the small area adjacent to the small area selected by the scanner driver and the area size of the small area selected by the scanner driver. There is. The scanner driver acquires at least one type of attribute information from these various attribute information. That is, the scanner driver may acquire one type of attribute information from these various types of attribute information, or may acquire a plurality of types of attribute information.

スキャナドライバは、ヒストグラムにより表される領域を区分して得られた3つ以上の小領域の中から選出した小領域についてそれぞれ個別に属性情報を取得してもよく、また選出した小領域の中の2つ以上の小領域に関する属性情報を取得してもよい。このようにしてスキャナドライバは、画像読み取り装置10により読み取った画像に対してスキャナドライバが、中間調などの色バランスが崩れた画像のための補正処理を施すために必要な情報を取得する。   The scanner driver may individually acquire attribute information for each of the small areas selected from three or more small areas obtained by dividing the area represented by the histogram. Attribute information regarding two or more small regions may be acquired. In this manner, the scanner driver acquires information necessary for the scanner driver to perform correction processing for an image read by the image reading apparatus 10 for an image in which color balance such as halftone is lost.

そして、スキャナドライバは、ヒストグラムにより表される領域を区分して得られた3つ以上の小領域の中から選出した小領域について属性情報を取得した後、次に、取得した属性情報に基づき、目標値を取得する(S110)。なお、ここでスキャナドライバは、「目標値取得部」に相当する。この目標値は、区分して得られた3つ以上の小領域の中から選出された選出小領域に関する属性情報についての目標値である。選出小領域は、ある小領域よりも濃度値が大きくかつ他の小領域よりも濃度値が小さい小領域が選出される。目標値は、このような選出小領域における色バランスが崩れた画像に対して適切な補正処理を施すための値となる。ここでスキャナドライバが取得する目標値は、各色共通の目標値である。   The scanner driver acquires the attribute information for the small area selected from the three or more small areas obtained by classifying the area represented by the histogram, and then, based on the acquired attribute information, A target value is acquired (S110). Here, the scanner driver corresponds to a “target value acquisition unit”. This target value is a target value for attribute information related to a selected small area selected from among three or more small areas obtained by classification. As the selected small region, a small region having a density value larger than a certain small region and a smaller density value than the other small regions is selected. The target value is a value for performing an appropriate correction process on an image in which the color balance in such a selected small area is lost. Here, the target value acquired by the scanner driver is a common target value for each color.

スキャナドライバが取得した属性情報に基づき目標値を取得する方法としては、様々な方法がある。具体的には、例えば、取得した属性情報から輝度に関する情報を取得して、その輝度に関する情報に基づき、目標値を取得する方法がある。このように輝度に関する情報を取得すれば、簡単に目標値を取得することができる。この輝度に関する情報を取得する方法としては、レッド(R)、グリーン(G)およびブルー(B)の各色の濃度値から簡単に取得することができる。   There are various methods for acquiring the target value based on the attribute information acquired by the scanner driver. Specifically, for example, there is a method of acquiring information regarding luminance from the acquired attribute information and acquiring a target value based on the information regarding luminance. Thus, if the information regarding luminance is acquired, the target value can be easily acquired. As a method for acquiring information on the luminance, it is possible to easily acquire from the density values of the colors of red (R), green (G), and blue (B).

このようにして目標値を取得した後、スキャナドライバは、次に、取得した各色共通の目標値に基づき、画像に対して補正処理を施す(S112)。なお、ここでスキャナドライバは、「補正処理部」に相当する。スキャナドライバは、選出小領域に関する各色の属性情報がそれぞれ、取得した各色共通の目標値になるように補正処理を施す。スキャナドライバが実行する補正処理としては、各種補正処理を採用することができる。具体的には、例えば、スキャナドライバが、前述した「濃度補正」により補正処理を施す場合には、選出小領域に関する各色の属性情報がそれぞれ、取得した各色共通の目標値になるように、「濃度補正」におけるトーンカーブを調整する。このために、スキャナドライバは、「濃度補正」におけるトーンカーブを調整するための任意のポイントを設定したりする。この他に、スキャナドライバは、画像読み取り装置10により読み取られた画像に対して既に実施されている各種調整(補正)のパラメータを変更することによって補正処理を行う。   After acquiring the target value in this way, the scanner driver next performs a correction process on the image based on the acquired target value common to each color (S112). Here, the scanner driver corresponds to a “correction processing unit”. The scanner driver performs correction processing so that the attribute information of each color related to the selected small area becomes the target value common to each acquired color. Various correction processes can be adopted as the correction process executed by the scanner driver. Specifically, for example, when the scanner driver performs correction processing by the above-described “density correction”, the attribute information of each color related to the selected small area is set to a target value common to each acquired color. Adjust the tone curve in “Density correction”. For this purpose, the scanner driver sets an arbitrary point for adjusting the tone curve in “density correction”. In addition, the scanner driver performs correction processing by changing parameters of various adjustments (corrections) that have already been performed on the image read by the image reading device 10.

ここでスキャナドライバが補正処理を施す画像にあっては、既にヒストグラム調整や濃度補正、イメージ調整等の各種調整(補正)が施された画像であっても良く、また、画像読み取り装置10により読み取られた画像であっても良い。このようにしてスキャナドライバは、画像読み取り装置10により読み取られた画像に対して、選出小領域における色バランスが崩れた画像のための補正処理を施す。これにより、中間調などの色バランスが崩れた画像について画質改善を図ることができる。その後、スキャナドライバは、処理を速やかに終了する。
なお、これらのことから、このスキャナドライバは、「画像補正プログラム」に相当する。
Here, the image on which the scanner driver performs correction processing may be an image that has been subjected to various adjustments (correction) such as histogram adjustment, density correction, and image adjustment, and is read by the image reading device 10. It may be an image obtained. In this manner, the scanner driver performs a correction process for an image whose color balance in the selected small area is lost on the image read by the image reading device 10. Thereby, it is possible to improve the image quality of an image whose color balance is broken, such as a halftone. Thereafter, the scanner driver immediately ends the process.
From these facts, this scanner driver corresponds to an “image correction program”.

===実際の処理への適用===
本実施形態では、このような中間調などの色バランスが崩れた画像の補正は、各種画像の判定処理や他の画像の補正処理とともに、図5にて説明したユーザインターフェイスのメインのダイアログボックス100において「逆光補正のチェックボックス130E」がユーザによりチェックされたときに実行される。
=== Application to actual processing ===
In the present embodiment, correction of an image whose color balance is lost, such as halftone, is performed along with various image determination processing and other image correction processing, as well as the main dialog box 100 of the user interface described with reference to FIG. This is executed when the “backlight correction check box 130E” is checked by the user.

スキャナドライバが処理の対象とするのは、前述したヒストグラム調整や濃度補正、イメージ調整等によって自動的にまたはユーザにより調整(補正)が行われた画像である。スキャナドライバは、画像読み取り装置10により読み取った画像に対して各種判定処理を行った後、その判定結果に応じて画像に対して補正処理を施すようになっている。   The scanner driver processes the image that has been adjusted (corrected) automatically or by the user by the above-described histogram adjustment, density correction, image adjustment, or the like. The scanner driver performs various determination processes on the image read by the image reading device 10, and then performs a correction process on the image according to the determination result.

ここでスキャナドライバが実行する判定処理としては、次のような処理である。
(1)逆光画像であるか否かの判定処理
(2)中間調の色バランスが崩れた画像であるか否かの判定処理
(3)夕焼けまたは朝焼けの画像であるか否かの判定処理
また、スキャナドライバが実行する補正処理としては、次のような処理である。
Here, the determination process executed by the scanner driver is as follows.
(1) Judgment process of whether or not it is a backlight image (2) Judgment process of whether or not it is an image whose halftone color balance has been lost (3) Judgment process of whether it is an image of sunset or sunrise The correction process executed by the scanner driver is as follows.

(4)通常の逆光画像に対する補正処理
(5)中間調の色バランスが崩れた逆光画像のための補正処理
(6)夕焼けまたは朝焼けの逆光画像のための補正処理
(4) Correction processing for normal backlight image (5) Correction processing for backlight image in which halftone color balance is lost (6) Correction processing for backlight image of sunset or sunrise

図14は、本実施形態においてスキャナドライバが実行する処理の手順を説明するフローチャートを示したものである。スキャナドライバは、まず、画像読み取り装置10により読み取った画像について、逆光画像か否かを判定する(S202)。ここで、画像読み取り装置10により読み取った画像が、逆光画像ではないと判定した場合には、スキャナドライバは、次にステップS210へと進み、画像読み取り装置10により読み取った画像に対して、「通常の逆光画像の補正処理」を実行する(S210)。なお、本実施形態では、ここで実行される「通常の逆光画像の補正処理」は、逆光画像ではない画像に対して実行しても大きな影響がないような補正処理となっている。つまり、画像読み取り装置10により読み取った画像が逆光画像ではない場合に、当該画像に対して「通常の逆光画像の補正処理」を実行しても、あまり大きな悪影響は生じないようになっている。スキャナドライバは、ステップS210にて画像読み取り装置10により読み取った画像に対して「通常の逆光画像の補正処理」を実行した後、処理を速やかに終了する。   FIG. 14 is a flowchart illustrating a procedure of processing executed by the scanner driver in the present embodiment. The scanner driver first determines whether the image read by the image reading device 10 is a backlight image (S202). Here, when it is determined that the image read by the image reading device 10 is not a backlight image, the scanner driver proceeds to step S210, and the image read by the image reading device 10 is “normal”. The backlight image correction process "is executed (S210). In the present embodiment, the “normal backlight image correction process” executed here is a correction process that does not have a significant effect even when executed on an image that is not a backlight image. In other words, when the image read by the image reading device 10 is not a backlight image, even if “normal backlight image correction processing” is performed on the image, no significant adverse effect is caused. After executing the “normal backlight image correction process” on the image read by the image reading apparatus 10 in step S210, the scanner driver immediately ends the process.

一方、ステップS202においてスキャナドライバが、画像読み取り装置10により読み取った画像について逆光画像であると判定した場合には、次にスキャナドライバは、ステップS204へと進む。ここで、スキャナドライバは、画像読み取り装置10により読み取った画像について、中間調の色バランスが崩れた画像であるか否かの判定を行う(S204)。なお、このことから、スキャナドライバは、「判定部」に相当する。ここで、スキャナドライバは、画像読み取り装置10により読み取った画像について、中間調の色バランスが崩れた画像であると判定した場合には、次にステップS212へと進み、画像読み取り装置10により読み取った画像に対して、「中間調の色バランスが崩れた逆光画像のための補正処理」を実行する(S212)。この「中間調の色バランスが崩れた逆光画像のための補正処理」は、前述した「通常の逆光画像の補正処理」とは異なる処理であり、中間調の色バランスが崩れた逆光画像の画質改善を図るべく実行される。このようにして画像読み取り装置10により読み取った画像に対して、「中間調の色バランスが崩れた逆光画像のための補正処理」を実行した後、スキャナドライバは、処理を速やかに終了する。   On the other hand, when the scanner driver determines in step S202 that the image read by the image reading device 10 is a backlight image, the scanner driver proceeds to step S204. Here, the scanner driver determines whether or not the image read by the image reading apparatus 10 is an image in which the halftone color balance is lost (S204). For this reason, the scanner driver corresponds to a “determination unit”. Here, when the scanner driver determines that the image read by the image reading device 10 is an image in which the halftone color balance is lost, the process proceeds to step S212, where the image reading device 10 reads the image. “Correction processing for a backlight image in which the halftone color balance is lost” is executed on the image (S212). This “correction processing for a backlight image in which the halftone color balance is lost” is different from the above-mentioned “normal backlight image correction processing”, and the image quality of the backlight image in which the halftone color balance is lost. It is executed to improve. After executing “correction processing for a backlight image in which the halftone color balance is lost” on the image read by the image reading apparatus 10 in this manner, the scanner driver immediately ends the processing.

他方、ステップS204においてスキャナドライバが、画像読み取り装置10により読み取った画像について、中間調の色バランスが崩れた画像ではないと判定した場合には、次にステップS206へと進む。そして、スキャナドライバは、ここで次に、画像読み取り装置10により読み取った画像について、夕焼けまたは朝焼けの画像であるか否かの判定処理を実行する(S206)。ここで、スキャナドライバは、画像読み取り装置10により読み取った画像について、夕焼けまたは朝焼けの画像であると判定した場合には、次にステップS208へと進み、画像読み取り装置10により読み取った画像に対して、「夕焼けまたは朝焼けの逆光画像のための補正処理」を実行する(S208)。この「夕焼けまたは朝焼けの逆光画像のための補正処理」は、前述した「通常の逆光画像の補正処理」や「中間調の色バランスが崩れた逆光画像のための補正処理」とは異なる処理である。この補正処理は、夕焼けまたは朝焼けの逆光画像の画質改善を図るべく実行される。このようにして画像読み取り装置10により読み取った画像に対して、「夕焼けまたは朝焼けの逆光画像のための補正処理」を実行した後、スキャナドライバは、処理を速やかに終了する。   On the other hand, if the scanner driver determines in step S204 that the image read by the image reading device 10 is not an image in which the halftone color balance is lost, the process proceeds to step S206. Then, the scanner driver next executes a process of determining whether or not the image read by the image reading device 10 is a sunset or sunrise image (S206). Here, if the scanner driver determines that the image read by the image reading device 10 is a sunset or sunrise image, the scanner driver proceeds to step S <b> 208, and the image read by the image reading device 10 is processed. , “Correction process for backlight image of sunset or sunrise” is executed (S208). This "correction processing for sunset or sunrise backlight images" is different from the above-mentioned "normal backlight image correction processing" and "correction processing for backlight images in which the halftone color balance is lost". is there. This correction process is executed to improve the image quality of the backlight image of the sunset or sunrise. After executing the “correction process for a sunset or sunrise backlight image” on the image read by the image reading apparatus 10 in this manner, the scanner driver immediately ends the process.

一方、ステップS206においてスキャナドライバが、画像読み取り装置10により読み取った画像について、夕焼けまたは朝焼けの画像ではないと判定した場合には、スキャナドライバは、次にステップS210へと進み、画像読み取り装置10により読み取った画像に対して、「通常の逆光画像の補正処理」を実行する(S210)。これは、画像読み取り装置10により読み取った画像について、中間調の色バランスが崩れた画像でも、夕焼けまたは朝焼けの画像でもないと判定したことにより、画像読み取り装置10により読み取った画像に対して、「通常の逆光画像」であると判断したためである。このため、スキャナドライバは、画像読み取り装置10により読み取った画像に対して、「通常の逆光画像の補正処理」を施す。このようにしてスキャナドライバは、画像読み取り装置10により読み取った画像に対して、「通常の逆光画像の補正処理」を実行した後、処理を速やかに終了する。   On the other hand, if the scanner driver determines in step S206 that the image read by the image reading device 10 is not a sunset or sunrise image, the scanner driver proceeds to step S210, and the image reading device 10 A “normal backlight image correction process” is executed on the read image (S210). This is because the image read by the image reading device 10 is determined to be neither an image whose halftone color balance is lost nor an image of sunset or sunrise, This is because it is determined that the image is a “normal backlight image”. For this reason, the scanner driver performs “normal backlight image correction processing” on the image read by the image reading device 10. In this way, the scanner driver performs the “normal backlight image correction process” on the image read by the image reading apparatus 10 and then immediately ends the process.

以上のような手順にて、本実施形態にかかるスキャナドライバは、画像読み取り装置10により読み取った画像に対して、各種画像判定処理と各種画像補正処理とを実行する。以下に、ここでスキャナドライバにより実行される各種画像判定処理と各種画像補正処理とについてそれぞれ個別に詳しく説明する。   The scanner driver according to the present embodiment performs various image determination processes and various image correction processes on the image read by the image reading apparatus 10 in the above procedure. Hereinafter, various image determination processes and various image correction processes executed by the scanner driver will be individually described in detail.

===逆光画像の判定===
スキャナドライバは、図5にて説明したユーザインターフェイスのメインのダイアログボックス100において「逆光補正のチェックボックス130E」がユーザによりチェックされると、図14にて説明したように、最初に、画像読み取り装置10により読み取った画像について、「逆光画像であるか否かの判定処理」を行う。以下に、ここで行われる「逆光画像であるか否かの判定処理」について詳しく説明する。
=== Determination of Backlight Image ===
When the “backlight correction check box 130E” is checked by the user in the main dialog box 100 of the user interface described with reference to FIG. For the image read in step 10, “determination processing for determining whether the image is a backlight image” is performed. The “determination process for determining whether or not the image is a backlight image” performed here will be described in detail below.

<判定手順>
図15は、ここでスキャナドライバにより行われる「逆光画像であるか否かの判定処理」の判定手順の一例について説明したものである。画像読み取り装置10により読み取った画像のデータに基づき、ヒストグラムのデータを生成する(S302)。ここで生成されるヒストグラムは、先に説明したヒストグラムと同じものである。つまり、このヒストグラムは、画像読み取り装置10により読み取った画像を構成する各画素の濃度値に対する画素の数の分布を表したグラフである。
<Judgment procedure>
FIG. 15 illustrates an example of a determination procedure of “determination process for determining whether the image is a backlight image” performed by the scanner driver. Based on the image data read by the image reading device 10, histogram data is generated (S302). The histogram generated here is the same as the histogram described above. That is, this histogram is a graph representing the distribution of the number of pixels with respect to the density value of each pixel constituting the image read by the image reading device 10.

スキャナドライバは、このようにしてヒストグラムのデータを生成した後、次に、生成したヒストグラムのデータに基づき、ヒストグラムにより表される領域を画素の濃度値の大きさ別に3つ以上の小領域に区分する(S304)。ここで区分される小領域の個数は、4つであっても良く、もちろん5つ以上であっても構わない。また、区分される小領域の面積は、相互にほぼ等しくなるように設定されていても良く、また相互に等しくならないように設定されていても良い。もちろん、区分された3つ以上の小領域のうちの一部の小領域、即ち2つ以上の小領域の面積が相互にほぼ等しくなるように設定されていても良い。また、区分される小領域における画素の数は、相互にほぼ等しくなるように設定されていても良く、また相互に等しくならないように設定されていても良い。もちろん、区分された3つ以上の小領域のうちの一部の小領域、即ち2つ以上の小領域における画素の数が相互にほぼ等しくなるように設定されていても良い。   After generating the histogram data in this manner, the scanner driver then divides the area represented by the histogram into three or more small areas according to the density value of the pixel based on the generated histogram data. (S304). Here, the number of small areas to be divided may be four, or of course five or more. Further, the areas of the divided small regions may be set to be substantially equal to each other, or may be set to be not equal to each other. Of course, some of the three or more divided small regions, that is, two or more small regions may be set to have substantially the same area. In addition, the number of pixels in the small area to be divided may be set to be substantially equal to each other, or may be set to be not equal to each other. Of course, it may be set such that the number of pixels in a part of three or more divided small regions, that is, two or more small regions, is substantially equal to each other.

スキャナドライバは、このようにしてヒストグラムにより表される領域を3つ以上の小領域に区分した後、次に、区分した3つ以上の小領域の中から第1小領域と第2小領域とを選出する(S306)。ここで、第1小領域とは、区分された3つ以上の小領域の中から選出される少なくとも1つの小領域のことである。この第1小領域は、画像読み取り装置10により読み取った画像から必要な情報を取得し、逆光画像か否かを判定するために選出する。第1小領域として選出される小領域の数は、1つであってもよく、また2つであってもよく、さらには3つ以上であっても良い。   After the scanner driver divides the area represented by the histogram into three or more small areas in this way, the first small area and the second small area are then selected from the divided three or more small areas. Is selected (S306). Here, the first small region is at least one small region selected from the three or more divided small regions. This first small region is selected in order to obtain necessary information from the image read by the image reading device 10 and determine whether or not it is a backlight image. The number of small regions selected as the first small region may be one, two, or even three or more.

また、第2小領域については、第1小領域の場合と同様に、区分された3つ以上の小領域の中から選出される少なくとも1つの小領域のことである。ただし、ここでは、第2小領域として、第1小領域よりも濃度値が大きくかつ第1小領域に隣接していない小領域が選出される。これは、第1小領域が2つ以上あった場合についても同様である。すなわち、第1小領域が2つ以上あった場合でも、これら2つ以上の第1小領域に対してそれぞれ第2小領域が相隣接しておらず、かつこれら2つ以上の第1小領域よりも第2小領域の濃度値が大きくなっている。なお、第2小領域が2つ以上あった場合についても同様である。すなわち、これら2以上の第2小領域が共に1つまたは2つ以上の第1小領域に対してそれぞれ個別に相隣接しておらず、かつこれら1つまたは2つ以上の第1小領域に対して各第2小領域の濃度値が大きくなっているのである。第2小領域として選出される小領域の個数は、1つであってもよく、また2つであってもよく、さらには3つ以上であっても良い。また、この第2小領域は、第1小領域の場合と同様に、画像読み取り装置10により読み取った画像から必要な情報を取得し、逆光画像か否かを判定するために選出する。   The second small area is at least one small area selected from the three or more divided small areas, as in the case of the first small area. However, here, a small region having a density value larger than that of the first small region and not adjacent to the first small region is selected as the second small region. The same applies to the case where there are two or more first small areas. That is, even when there are two or more first small areas, the second small areas are not adjacent to the two or more first small areas, respectively, and the two or more first small areas are not adjacent to each other. The density value of the second small region is larger than that. The same applies when there are two or more second small regions. That is, both of these two or more second small regions are not individually adjacent to one or two or more first small regions, and the one or two or more first small regions are not adjacent to each other. On the other hand, the density value of each second small region is large. The number of small regions selected as the second small region may be one, two, or even three or more. Further, as in the case of the first small area, this second small area is selected in order to obtain necessary information from the image read by the image reading device 10 and determine whether or not it is a backlight image.

このようにして第1小領域および第2小領域を、3つ以上の小領域の中から選出した後、スキャナドライバは、次に、これら第1小領域および第2小領域についてそれぞれ個別に属性情報を取得する(S308)。ここで属性情報とは、第1小領域または第2小領域が持っている性質や特徴のことである。ここでスキャナドライバが取得する属性情報としては、第1小領域または第2小領域を占める画素の濃度値の平均値や、第1小領域または第2小領域を占める画素の濃度値の上限値または下限値、さらに、隣接する小領域との間の境界線に対応する濃度値、この他に、第1小領域または第2小領域の面積の大きさ等、様々な属性情報がある。スキャナドライバは、これらの各種属性情報のうちの1種類の属性情報を取得してもよく、また複数種類の属性情報を取得しても良い。スキャナドライバは、画像読み取り装置10により読み取った画像が逆光画像か否かを判定するにあたって必要な情報を第1小領域および第2小領域からそれぞれ属性情報として取得する。   After selecting the first small area and the second small area from among the three or more small areas in this way, the scanner driver then individually sets the attribute for each of the first small area and the second small area. Information is acquired (S308). Here, the attribute information is a property or characteristic of the first small area or the second small area. Here, the attribute information acquired by the scanner driver includes an average value of density values of pixels occupying the first small area or the second small area, and an upper limit value of density values of pixels occupying the first small area or the second small area. Alternatively, there are various attribute information such as a lower limit value, a density value corresponding to a boundary line between adjacent small areas, and the size of the area of the first small area or the second small area. The scanner driver may acquire one type of attribute information among these various types of attribute information, or may acquire a plurality of types of attribute information. The scanner driver acquires information necessary for determining whether the image read by the image reading device 10 is a backlight image as attribute information from the first small area and the second small area.

そして、スキャナドライバは、このようにして第1小領域および第2小領域からそれぞれ取得した属性情報に基づき、画像読み取り装置10により読み取った画像が逆光画像か否かを判定する(S310)。ここで、スキャナドライバは、例えば、第1小領域から取得した属性情報と、第2小領域から取得した属性情報とを比較して、その比較結果に基づき、画像読み取り装置10により読み取った画像が逆光画像か否かを判定しても良い。具体的には、スキャナドライバは、第1小領域から属性情報として取得した値と、第2小領域から属性情報として取得した値との差分を求め、この差分に基づき、例えば、この差分が所定値を超えたか否かなどをチェックすることによって、画像読み取り装置10により読み取った画像が逆光画像か否かを判定する。これにより、スキャナドライバは、画像読み取り装置10により読み取った画像が逆光画像か否かの判定処理を終了する。   Then, the scanner driver determines whether or not the image read by the image reading device 10 is a backlight image based on the attribute information acquired from the first small area and the second small area in this way (S310). Here, for example, the scanner driver compares the attribute information acquired from the first small area with the attribute information acquired from the second small area, and based on the comparison result, the image read by the image reading device 10 It may be determined whether the image is a backlight image. Specifically, the scanner driver obtains a difference between a value acquired as attribute information from the first small area and a value acquired as attribute information from the second small area, and based on this difference, for example, the difference is predetermined. By checking whether or not the value is exceeded, it is determined whether or not the image read by the image reading device 10 is a backlight image. As a result, the scanner driver ends the process of determining whether the image read by the image reading device 10 is a backlight image.

<ヒストグラムの生成>
図16は、スキャナドライバにより生成されるヒストグラムの一例について説明したものである。本実施形態では、画像読み取り装置10により読み取られた画像を構成する各画素のデータが、レッド(R)、グリーン(G)およびブルー(B)の3色の濃度値のデータにより構成されている。このため、本実施形態では、ヒストグラムがレッド(R)、グリーン(G)およびブルー(B)の各色別に生成される。すなわち、画像を構成する各画素のレッド(R)の濃度値に基づき生成されたヒストグラムと、画像を構成する各画素のグリーン(G)の濃度値に基づき生成されたヒストグラムと、画像を構成する各画素のブルー(B)の濃度値に基づき生成されたヒストグラムとの3種類のヒストグラムが生成される。スキャナドライバは、このようにして生成したレッド(R)、グリーン(G)およびブルー(B)の3色のヒストグラムのデータに基づき、逆光画像か否かの判定を行う。
<Generation of histogram>
FIG. 16 illustrates an example of a histogram generated by the scanner driver. In the present embodiment, the data of each pixel constituting the image read by the image reading device 10 is constituted by data of density values of three colors of red (R), green (G), and blue (B). . For this reason, in this embodiment, a histogram is generated for each color of red (R), green (G), and blue (B). That is, an image is formed with a histogram generated based on the red (R) density value of each pixel constituting the image, and a histogram generated based on the green (G) density value of each pixel constituting the image. Three types of histograms are generated: a histogram generated based on the blue (B) density value of each pixel. The scanner driver determines whether or not the image is a backlight image based on the three-color histogram data of red (R), green (G), and blue (B) generated in this way.

<小領域への区分>
次にスキャナドライバは、このようにして生成したレッド(R)、グリーン(G)およびブルー(B)の3色のヒストグラムのデータに基づき、各色のヒストグラムにより表される領域をそれぞれ3つ以上の小領域に区分する処理を実行する。ここで、スキャナドライバは、各色のヒストグラムにより表される領域を濃度値の大きさ別に区分する。これにより、3つ以上の小領域は、図16に示すように、各色のヒストグラムの縦軸の方向に沿ってある濃度値に対応して設けられた境界ラインによって区分され、各色のヒストグラムの横軸の方向に沿って並んで配置される。
<Division into small areas>
Next, the scanner driver generates three or more regions represented by the histograms of the respective colors based on the three-color histogram data of red (R), green (G), and blue (B) generated in this way. Execute processing to divide into small areas. Here, the scanner driver classifies the region represented by the histogram of each color according to the density value. As a result, as shown in FIG. 16, the three or more small regions are divided by boundary lines provided corresponding to density values along the direction of the vertical axis of the histogram of each color. Arranged side by side along the direction of the axis.

本実施形態では、スキャナドライバは、レッド(R)、グリーン(G)およびブルー(B)の3色のヒストグラムにより表される領域を、図16に示すように、それぞれ4つの小領域Ry1、Ry2、Ry3、Ry4に区分する。ただし、ここで区分される4つの小領域Ry1、Ry2、Ry3、Ry4のうち、3つの小領域Ry1、Ry2、Ry3は、相互に面積がほぼ等しくなるように設定されている。つまり、これら3つの小領域Ry1、Ry2、Ry3は相互に画素の数がほぼ等しくなっている。   In this embodiment, the scanner driver divides an area represented by a histogram of three colors of red (R), green (G), and blue (B) into four small areas Ry1 and Ry2 as shown in FIG. , Ry3 and Ry4. However, of the four small regions Ry1, Ry2, Ry3, and Ry4 divided here, the three small regions Ry1, Ry2, and Ry3 are set so that their areas are substantially equal to each other. That is, these three small regions Ry1, Ry2, and Ry3 have substantially the same number of pixels.

ここでは、これら3つの小領域Ry1、Ry2、Ry3の面積がそれぞれ画像を構成する画素の総数に対してほぼ33%ずつ占めるようになっている。すなわち、小領域Ry1は、濃度値が最も小さい側に位置しているから、判定対象となる画像を構成する画素のうち、濃度値が小さい画素から順に、「0〜33%」分の画素により形成されている。また、小領域Ry2は、小領域Ry1に次いで2番目に濃度値が小さい側に位置しているから、判定対象となる画像を構成する画素のうち、小領域Ry1に含まれる画素の次の画素から順に、「34〜66%」分の画素により形成されている。また、小領域Ry3は、小領域Ry2に次いで3番目に濃度値が小さい側に位置しているから、判定対象となる画像を構成する画素のうち、小領域Ry2に含まれる画素の次の画素から順に、「67〜99%」分の画素により形成されている。これらのことから、小領域Ry1は、シャドウの領域に位置していることになる。また、小領域Ry2は、中間調の領域に位置している。また、小領域Ry3は、ハイライトの領域に位置している。   Here, the areas of these three small regions Ry1, Ry2, and Ry3 each occupy approximately 33% of the total number of pixels constituting the image. That is, since the small region Ry1 is located on the side where the density value is the smallest, among the pixels constituting the image to be determined, pixels from “0 to 33%” in order from the pixel having the smallest density value. Is formed. In addition, since the small area Ry2 is located on the side having the second smallest density value after the small area Ry1, the pixel next to the pixel included in the small area Ry1 among the pixels constituting the image to be determined. The pixels are formed in order of “34 to 66%” pixels. In addition, since the small area Ry3 is located on the side having the third smallest density value after the small area Ry2, the pixel next to the pixel included in the small area Ry2 among the pixels constituting the image to be determined. In this order, pixels are formed from “67 to 99%”. For these reasons, the small area Ry1 is located in the shadow area. The small area Ry2 is located in the halftone area. The small area Ry3 is located in the highlight area.

一方、小領域Ry4は、3つの小領域Ry1、Ry2、Ry3とは、占める面積(画素数)が異なるように設定されている。ここでは、小領域Ry4は、小領域Ry3に次いで4番目に濃度値が小さい側に位置し、かつ濃度値が最も大きい側に位置しているから、判定対象となる画像を構成する画素のうち、残り1%分の画素により形成されている。   On the other hand, the small region Ry4 is set to have a different area (number of pixels) from the three small regions Ry1, Ry2, and Ry3. Here, since the small area Ry4 is located on the side having the fourth lowest density value after the small area Ry3 and located on the side having the largest density value, among the pixels constituting the image to be determined. The remaining 1% of pixels are formed.

<小領域の選出>
このようにしてレッド(R)、グリーン(G)およびブルー(B)の3色のヒストグラムにより表される領域をそれぞれ4つの小領域Ry1、Ry2、Ry3、Ry4に区分した後、スキャナドライバは、次に、これら区分した4つの小領域Ry1、Ry2、Ry3、Ry4の中から、第1小領域および第2小領域を選出する処理を各色別に実行する。ここで、第1小領域は、区分した4つの小領域Ry1、Ry2、Ry3、Ry4の中から選出される少なくとも1つの小領域のことであって、第2小領域とは隣接しておらず、かつ第2小領域よりも濃度値が小さいという条件を満たす小領域である。また、第2小領域は、区分した4つの小領域Ry1、Ry2、Ry3、Ry4の中から選出される少なくとも1つの小領域のことであって、第1小領域とは隣接しておらず、かつ第1小領域よりも濃度値が大きいという条件を満たす小領域である。
<Selection of small areas>
After dividing the region represented by the histogram of three colors of red (R), green (G) and blue (B) in this way into four small regions Ry1, Ry2, Ry3 and Ry4, the scanner driver Next, a process of selecting the first small area and the second small area from the four divided small areas Ry1, Ry2, Ry3, and Ry4 is executed for each color. Here, the first small area is at least one small area selected from the four divided small areas Ry1, Ry2, Ry3, and Ry4, and is not adjacent to the second small area. And a small region that satisfies the condition that the density value is smaller than that of the second small region. The second small area is at least one small area selected from the four divided small areas Ry1, Ry2, Ry3, and Ry4, and is not adjacent to the first small area. In addition, the small area satisfies the condition that the density value is larger than that of the first small area.

本実施形態では、スキャナドライバは、第1小領域として、4つの小領域Ry1、Ry2、Ry3、Ry4の中から小領域Ry1を各色につき選出する(図16参照)。また、本実施形態では、スキャナドライバは、第2小領域として、4つの小領域Ry1、Ry2、Ry3、Ry4の中から小領域Ry3を各色につき選出する(図16参照)。このように第1小領域および第2小領域が選出されたのは、次の理由からである。すなわち、本実施形態では、4つの小領域Ry1、Ry2、Ry3、Ry4のうち、3つの小領域Ry1、Ry2、Ry3が相互に面積(画素数)がほぼ等しくなるようにそれぞれ画素総数に対して33%ずつに設定されている。つまり、3つの小領域Ry1、Ry2、Ry3は、レッド(R)、グリーン(G)およびブルー(B)の各色のヒストグラムにより表される領域に対してそれぞれほぼ1/3ずつ占有するように設定されている。これら3つの小領域Ry1、Ry2、Ry3の中から第1小領域および第2小領域を選出するとなると、相隣接しないという要件から第1小領域として小領域Ry1を選出し、かつ第2小領域として小領域Ry3を選出するという選択肢しかないことになる。   In this embodiment, the scanner driver selects a small area Ry1 for each color from the four small areas Ry1, Ry2, Ry3, and Ry4 as the first small area (see FIG. 16). In this embodiment, the scanner driver selects a small region Ry3 for each color from the four small regions Ry1, Ry2, Ry3, and Ry4 as the second small region (see FIG. 16). The reason why the first small area and the second small area are selected in this way is as follows. In other words, in the present embodiment, among the four small regions Ry1, Ry2, Ry3, and Ry4, the three small regions Ry1, Ry2, and Ry3 each have an area (number of pixels) that is substantially equal to the total number of pixels. It is set to 33%. That is, the three small areas Ry1, Ry2, and Ry3 are set so as to occupy approximately 1/3 of the area represented by the histogram of each color of red (R), green (G), and blue (B). Has been. When the first small region and the second small region are selected from these three small regions Ry1, Ry2, and Ry3, the small region Ry1 is selected as the first small region from the requirement that they are not adjacent to each other, and the second small region As a result, there is only an option of selecting the small region Ry3.

なお、レッド(R)、グリーン(G)およびブルー(B)の各色のヒストグラムにより表される領域がこのような方法以外の方法に区分された場合には、他の手法によって第1小領域および第2小領域を選出しても良い。   In addition, when the area | region represented by the histogram of each color of red (R), green (G), and blue (B) is divided into methods other than such a method, the first small area and The second small area may be selected.

<属性情報の取得>
このようにして4つの小領域Ry1、Ry2、Ry3、Ry4の中から第1小領域として小領域Ry1を各色別に選出し、かつ第2小領域として小領域Ry3を各色別に選出した後、スキャナドライバは、次に、これら第1小領域として選出した小領域Ry1および第2小領域として選出した小領域Ry3からそれぞれ属性情報を各色別に取得する。本実施形態では、属性情報として、小領域Ry1の上限値St1および小領域Ry3の上限値St3を各色につき取得する。なお、各色の小領域Ry1の上限値St1は、隣接する小領域Ry2との間の境界線に対応する濃度値でもある。また、各色の小領域Ry3の上限値St3についても同様に、隣接する小領域Ry4との間の境界線に対応する濃度値でもある。また、各色の小領域Ry1の上限値St1については、「33%基準点」とも呼ぶこととする。また、各色の小領域Ry3の上限値St3については、「99%基準点」とも呼ぶこととする。なお、各色の小領域Ry2の上限値St2については、「66%基準点」とも呼ぶこととする。
<Acquisition of attribute information>
After selecting the small area Ry1 as the first small area for each color from the four small areas Ry1, Ry2, Ry3, and Ry4 and selecting the small area Ry3 as the second small area for each color, the scanner driver Next, attribute information is acquired for each color from the small area Ry1 selected as the first small area and the small area Ry3 selected as the second small area. In the present embodiment, the upper limit value St1 of the small area Ry1 and the upper limit value St3 of the small area Ry3 are acquired as attribute information for each color. The upper limit value St1 of each color small area Ry1 is also a density value corresponding to the boundary line between the adjacent small areas Ry2. Similarly, the upper limit value St3 of the small area Ry3 of each color is also a density value corresponding to the boundary line between the adjacent small areas Ry4. Further, the upper limit value St1 of the small area Ry1 of each color is also referred to as “33% reference point”. Further, the upper limit value St3 of the small area Ry3 of each color is also referred to as “99% reference point”. The upper limit value St2 of the small area Ry2 of each color is also referred to as “66% reference point”.

ここで、小領域Ry1および小領域Ry3の属性情報として、各上限値St1、St3を取得したのは、次の理由からである。すなわち、これら小領域Ry1の上限値St1および小領域Ry3の上限値St3は、他の属性情報に比べて、画像が逆光画像か否かを判定する上で的確な判定を行うことができるからである。つまり、小領域Ry1および小領域Ry3の上限値St1、St3は、小領域Ry1および小領域Ry3の他の属性情報に比べて、画像が逆光画像か否かを判定する上で重要な判定要素となり得るのである。   Here, the reason why the upper limit values St1 and St3 are acquired as the attribute information of the small area Ry1 and the small area Ry3 is as follows. That is, the upper limit value St1 of the small region Ry1 and the upper limit value St3 of the small region Ry3 can be accurately determined in determining whether the image is a backlight image, as compared with other attribute information. is there. That is, the upper limit values St1 and St3 of the small area Ry1 and the small area Ry3 are important determination factors in determining whether the image is a backlight image or not, as compared with other attribute information of the small areas Ry1 and Ry3. To get.

例えば、第1小領域として選出した小領域Ry1および第2小領域として選出した小領域Ry3の属性情報として、小領域Ry1を占める画素の濃度値の平均値Av1と、小領域Ry3を占める画素の濃度値の平均値Av3を取得した場合、これらの平均値Av1、Av3の違いは、小領域Ry1および小領域Ry3の上限値St1、St3の違いに比べて非常に小さいものとなってしまう。このようなことから、画像読み取り装置10により読み取った画像が逆光画像か否かの判定にあたっては、小領域Ry1および小領域Ry3の属性情報として、これら小領域Ry1の上限値St1および小領域Ry3の上限値St3を各色につき取得するのが好ましいのである。   For example, as attribute information of the small region Ry1 selected as the first small region and the small region Ry3 selected as the second small region, the average value Av1 of the density values of the pixels occupying the small region Ry1 and the pixels occupying the small region Ry3 When the average value Av3 of the density values is acquired, the difference between the average values Av1 and Av3 is much smaller than the difference between the upper limit values St1 and St3 of the small region Ry1 and the small region Ry3. For this reason, in determining whether the image read by the image reading device 10 is a backlight image, as the attribute information of the small area Ry1 and the small area Ry3, the upper limit value St1 of the small area Ry1 and the small area Ry3 It is preferable to obtain the upper limit value St3 for each color.

<判定>
このようにしてレッド(R)、グリーン(G)およびブルー(B)の3色のヒストグラムにより表される領域をそれぞれ4つの小領域Ry1、Ry2、Ry3、Ry4に区分して、その中から第1小領域として選出した小領域Ry1と、その中から第2小領域として選出した小領域Ry3との各属性情報として、小領域Ry1の上限値St1および小領域Ry3の上限値St3を各色別に取得した後、スキャナドライバは、次に、ここで取得した各色別の小領域Ry1の上限値St1および各色別の小領域Ry3の上限値St3に基づき、画像読み取り装置10により読み取った画像が逆光画像か否かの判定処理を実行する。
<Judgment>
In this way, the region represented by the histogram of three colors of red (R), green (G) and blue (B) is divided into four small regions Ry1, Ry2, Ry3, and Ry4, respectively. The upper limit value St1 of the small area Ry1 and the upper limit value St3 of the small area Ry3 are acquired for each color as attribute information of the small area Ry1 selected as the first small area and the small area Ry3 selected as the second small area from among them. After that, the scanner driver then determines whether the image read by the image reading device 10 is a backlight image based on the acquired upper limit value St1 of the small area Ry1 for each color and the upper limit value St3 of the small area Ry3 for each color. A determination process of whether or not is executed.

ここで、本実施形態では、スキャナドライバは、まず、レッド(R)、グリーン(G)およびブルー(B)の3色のヒストグラムについてそれぞれ得られた小領域Ry1の上限値St1および小領域Ry3の上限値St3から、それぞれ輝度に換算した場合の値を求める演算を行う。この演算では、レッド(R)、グリーン(G)およびブルー(B)の各色の濃度値から実際の輝度値に変換するために利用されている式を利用する。この演算式の一例を次の式(7)に示す。
実際の輝度値=1/5×R+3/5×G+1/5×B …………(7)
なお、ここで、『R』は、画素のレッド(R)の成分の濃度値を示す。『G』は、画素のグリーン(G)の成分の濃度値を示す。『B』は、画素のブルー(B)の成分の濃度値を示す。また、この式(7)では、レッド(R)、グリーン(G)およびブルー(B)の各色の比率が、「1:3:1」の場合を例にして示したが、これ以外の比率に設定されても良い。
Here, in the present embodiment, the scanner driver first sets the upper limit value St1 and the small region Ry3 of the small region Ry1 obtained for the three color histograms of red (R), green (G), and blue (B), respectively. From the upper limit value St3, an operation for obtaining a value when converted into luminance is performed. In this calculation, an expression used for converting the density value of each color of red (R), green (G), and blue (B) into an actual luminance value is used. An example of this arithmetic expression is shown in the following expression (7).
Actual luminance value = 1/5 × R + 3/5 × G + 1/5 × B (7)
Here, “R” indicates the density value of the red (R) component of the pixel. “G” indicates the density value of the green (G) component of the pixel. “B” indicates the density value of the blue (B) component of the pixel. In the formula (7), the ratio of each color of red (R), green (G) and blue (B) is “1: 3: 1” as an example. May be set.

スキャナドライバは、このような式(7)を利用して、レッド(R)、グリーン(G)およびブルー(B)の3色のヒストグラムについてそれぞれ得られた小領域Ry1の上限値St1から、実際の輝度値に対応した値St10を取得する。なお、この値St10は、実際の輝度値に対応する「33%基準点」とする。また、スキャナドライバは、式(7)により、レッド(R)、グリーン(G)およびブルー(B)の3色のヒストグラムについてそれぞれ得られた小領域Ry3の上限値St3から、実際の輝度値に対応した値St30を取得する。なお、この値St30は、実際の輝度値に対応する「99%基準点」とする。   Using the equation (7), the scanner driver actually calculates from the upper limit value St1 of the small area Ry1 obtained for each of the three color histograms of red (R), green (G), and blue (B). A value St10 corresponding to the luminance value of is obtained. This value St10 is a “33% reference point” corresponding to the actual luminance value. Further, the scanner driver converts the upper luminance value St3 of the small area Ry3 obtained for each of the three color histograms of red (R), green (G), and blue (B) to the actual luminance value according to Expression (7). The corresponding value St30 is acquired. The value St30 is a “99% reference point” corresponding to the actual luminance value.

その後、スキャナドライバは、RGB各色のヒストグラムの小領域Ry1の上限値St1から求められた実際の輝度値St10(「33%基準点」)と、RGB各色のヒストグラムの小領域Ry3の上限値St3から求められた実際の輝度値St30(「99%基準点」)との差分ΔStを求める。ここでは、スキャナドライバは、RGB各色のヒストグラムの小領域Ry3の上限値St3から求められた実際の輝度値St30(「99%基準点」)から、RGB各色のヒストグラムの小領域Ry1の上限値St1から求められた実際の輝度値St10(「33%基準点」)を減算する演算を実行する。   Thereafter, the scanner driver calculates the actual luminance value St10 ("33% reference point") obtained from the upper limit value St1 of the RGB small color area Ry1 and the upper limit value St3 of the RGB small color area histogram Ry3. A difference ΔSt from the obtained actual luminance value St30 (“99% reference point”) is obtained. Here, the scanner driver determines the upper limit value St1 of the RGB small color region Ry1 from the actual luminance value St30 ("99% reference point") obtained from the upper limit value St3 of the RGB small color region Ry3. An operation for subtracting the actual luminance value St10 ("33% reference point") obtained from the above is executed.

そして、スキャナドライバは、このようにして求めた差分ΔStと、所定のしきい値ΔStkとを比較して、求めた差分ΔStが所定のしきい値ΔStk以上であった場合には、画像読み取り装置10により読み取った画像については逆光画像であると判定する。一方、スキャナドライバは、求めた差分ΔStと、所定のしきい値ΔStkとを比較して、求めた差分ΔStが所定のしきい値ΔStkに達していなかった場合には、画像読み取り装置10により読み取った画像については逆光画像ではないと判定する。なお、ここで所定のしきい値ΔStkは、逆光画像か否かを判定する上で適切に設定される値である。この所定のしきい値ΔStkは、予め実施されるシミュレーション等による解析結果や経験則などに基づき適宜設定される。   Then, the scanner driver compares the difference ΔSt obtained in this way with a predetermined threshold value ΔStk, and if the obtained difference ΔSt is equal to or larger than the predetermined threshold value ΔStk, the image reading device The image read by 10 is determined to be a backlight image. On the other hand, the scanner driver compares the obtained difference ΔSt with a predetermined threshold value ΔStk. If the obtained difference ΔSt has not reached the predetermined threshold value ΔStk, the scanner driver reads it. The determined image is not a backlight image. Here, the predetermined threshold value ΔStk is a value that is appropriately set for determining whether or not the image is a backlight image. This predetermined threshold value ΔStk is appropriately set based on an analysis result or a rule of thumb by a simulation or the like performed in advance.

図17Aおよび図17Bは、スキャナドライバによる逆光画像か否かを判定する方法について説明したものである。図17Aは、判定対象となる画像が逆光画像ではないとスキャナドライバが判定する場合について説明したものである。図17Bは、判定対象となる画像が逆光画像であるとスキャナドライバが判定する場合について説明したものである。   FIG. 17A and FIG. 17B describe a method for determining whether or not the image is a backlight image by a scanner driver. FIG. 17A illustrates a case where the scanner driver determines that the image to be determined is not a backlight image. FIG. 17B illustrates a case where the scanner driver determines that the image to be determined is a backlight image.

画像読み取り装置10により読み取った画像が逆光画像ではない場合には、レッド(R)、グリーン(G)およびブルー(B)の3色のヒストグラムにより表される濃度値に対する画素の分布状況がほぼ均一になる。このことから、画像読み取り装置10により読み取った画像が逆光画像ではない場合には、図17Aに示すように、「33%基準点」となる値St10と、「66%基準点」となる値St20と、「99%基準点」となる値St30とは、緩やかな傾斜にて小さな増加率にて順次増加することになる。なお、ここで、「66%基準点」となる値St20は、レッド(R)、グリーン(G)およびブルー(B)の3色のヒストグラムの小領域Ry2の上限値St2から、前述した式(7)を利用して実際の輝度値に換算したときの値である。このため、「33%基準点」となる値St10と、「99%基準点」となる値St30との差分ΔStaは、所定のしきい値ΔStkよりも小さな値となる。   When the image read by the image reading device 10 is not a backlight image, the pixel distribution state with respect to the density value represented by the histogram of three colors of red (R), green (G), and blue (B) is almost uniform. become. From this, when the image read by the image reading device 10 is not a backlight image, as shown in FIG. 17A, a value St10 that is “33% reference point” and a value St20 that is “66% reference point” Then, the value St30 which becomes the “99% reference point” is gradually increased at a small increase rate with a gentle slope. Here, the value St20 serving as the “66% reference point” is obtained from the upper limit value St2 of the small region Ry2 of the three-color histogram of red (R), green (G), and blue (B) by the above formula ( This is a value when converted to an actual luminance value using 7). For this reason, the difference ΔSta between the value St10 serving as the “33% reference point” and the value St30 serving as the “99% reference point” is smaller than the predetermined threshold value ΔStk.

一方、画像読み取り装置10により読み取った画像が逆光画像である場合には、レッド(R)、グリーン(G)およびブルー(B)の3色のヒストグラムにより表される濃度値に対する画素の分布状況に偏りがある。このことから、画像読み取り装置10により読み取った画像が逆光画像である場合には、図17Bに示すように、「33%基準点」となる値St10と、「66%基準点」となる値St20と、「99%基準点」となる値St30とは、アンバランスな関係となる。これによって、「33%基準点」となる値St10が小さすぎたり、また「99%基準点」となる値St30が大きすぎたりすることになる。このことから、「33%基準点」となる値St10から「99%基準点」となる値St30にかけて傾斜が急となり、増加率が大きくなる。このため、「33%基準点」となる値St10と、「99%基準点」となる値St30との差分ΔStbは、所定のしきい値ΔStkよりも大きな値となる。   On the other hand, when the image read by the image reading device 10 is a backlight image, the pixel distribution state with respect to the density value represented by the histogram of three colors of red (R), green (G), and blue (B). There is a bias. From this, when the image read by the image reading device 10 is a backlight image, as shown in FIG. 17B, the value St10 that becomes the “33% reference point” and the value St20 that becomes the “66% reference point”. And the value St30 which becomes the “99% reference point” has an unbalanced relationship. As a result, the value St10 serving as the “33% reference point” is too small, and the value St30 serving as the “99% reference point” is too large. From this, the slope becomes steep from the value St10 which becomes the “33% reference point” to the value St30 which becomes the “99% reference point”, and the increase rate becomes large. Therefore, the difference ΔStb between the value St10 that becomes the “33% reference point” and the value St30 that becomes the “99% reference point” is a value larger than the predetermined threshold value ΔStk.

このような方法によりスキャナドライバによって、判定対象となる画像、即ちここでは、画像読み取り装置10により読み取った画像が逆光画像であるか否かを判定することによって、逆光画像か否かをより的確に判定することができる。具体的には、例えば、一般的な逆光画像をはじめ、中間調等の色バランスが崩れた逆光画像や、夕焼けまたは朝焼けを背景とした逆光画像などについても、スムーズに逆光画像であると判定することができる。   By determining whether or not the image to be determined by the scanner driver in this way, that is, the image read by the image reading device 10 here is a backlight image, it is more accurately determined whether or not it is a backlight image. Can be determined. Specifically, for example, a general backlight image, a backlight image in which a color balance such as a halftone is lost, or a backlight image with a sunset or sunrise as a background is determined to be a smooth backlight image. be able to.

===中間調の色バランスが崩れた画像の判定===
次に、「中間調の色バランスが崩れた画像であるか否かの判定」について説明する。「中間調の色バランスが崩れた画像であるか否かの判定」については、先の「逆光画像の判定」にて生成したRGB各色のヒストグラムを用いて、これらRGB各色のヒストグラムにおいて区分されて得られた4つの小領域Ry1、Ry2、Ry3、Ry4の中から2つ以上の小領域を選出して、選出した小領域についてそれぞれ属性情報を取得し、その属性情報に基づき、「中間調の色バランスが崩れた画像であるか否かの判定」を行う。以下にその方法について詳しく説明する。
=== Judgment of an Image with Discolored Halftone Color Balance ===
Next, “determination of whether or not an image has a halftone color balance collapsed” will be described. The “determination of whether or not the image has a halftone color balance collapsed” is divided into the RGB color histograms using the RGB color histograms generated in the previous “backlight image determination”. Two or more subregions are selected from the obtained four subregions Ry1, Ry2, Ry3, and Ry4, and attribute information is acquired for each of the selected subregions. “Determining whether the image is out of color balance”. The method will be described in detail below.

<中間調の色バランスが崩れた画像の特性>
図18A〜図18Cは、中間調の色バランスが崩れた画像のRGB各色のヒストグラムの一例をそれぞれ示したものである。図18Aは、レッド(R)のヒストグラムを示したものである。図18Bは、グリーン(G)のヒストグラムを示したものである。図18Cは、ブルー(B)のヒストグラムを示したものである。
<Characteristics of an image with an unbalanced halftone color balance>
FIG. 18A to FIG. 18C show examples of histograms for each of the RGB colors of an image in which the halftone color balance is lost. FIG. 18A shows a red (R) histogram. FIG. 18B shows a green (G) histogram. FIG. 18C shows a histogram of blue (B).

中間調の色バランスが崩れた画像は、レッド(R)、グリーン(G)およびブルー(B)のうちのいずれか1色が、他の色とは異なる中間調の特性を有している。つまり、具体的には、例えば、ブルー(B)の中間調の特性が異なる場合には、図18A〜図18Cに示すように、ブルー(B)の中間調の領域が、他のレッド(R)やグリーン(G)の中間調の領域に比べて位置が異なっている。これによって、ブルー(B)の中間調の領域の属性、即ち、例えば、上限値や下限値、平均値などが、他のレッド(R)やグリーン(G)の中間調の領域の属性と異なることになる。このことから、RGB各色のヒストグラムの中間調の属性を調べることによって、中間調の色バランスが崩れた画像であるか否かを簡単に調べることができる。   In an image in which the halftone color balance is lost, any one of red (R), green (G), and blue (B) has halftone characteristics different from those of other colors. Specifically, for example, when the blue (B) halftone characteristics are different, as shown in FIGS. 18A to 18C, the blue (B) halftone region is replaced with another red (R). ) And green (G) halftone areas. Accordingly, the attributes of the blue (B) halftone area, that is, the upper limit value, the lower limit value, the average value, and the like are different from the attributes of the other red (R) and green (G) halftone areas. It will be. From this, it is possible to easily check whether or not an image has a halftone color balance broken by examining the halftone attributes of the histogram of each RGB color.

<小領域の選出>
図19は、「中間調の色バランスが崩れた画像であるか否かの判定」における小領域の選出について説明したものである。ここでは、同図に示すように、「逆光画像の判定」において生成したヒストグラムを区分して得られた4つの小領域Ry1、Ry2、Ry3、Ry4のうちの3つの小領域Ry1、Ry2、Ry3の中から、第1小領域および第2小領域を選出する。第1小領域は、これら3つの小領域Ry1、Ry2、Ry3の中の少なくとも1つの小領域よりも濃度値が大きく、かつこれら3つの小領域Ry1、Ry2、Ry3の中の他の少なくとも1つの小領域よりも濃度値が小さい小領域である。本実施形態では、第1小領域として小領域Ry2が選出される。
<Selection of small areas>
FIG. 19 illustrates the selection of a small area in “determination of whether or not an image has a halftone color balance collapsed”. Here, as shown in the figure, three subregions Ry1, Ry2, Ry3 out of four subregions Ry1, Ry2, Ry3, and Ry4 obtained by dividing the histogram generated in “backlight image determination” are shown. A first small area and a second small area are selected from the above. The first small region has a density value larger than at least one of the three small regions Ry1, Ry2, and Ry3, and at least one of the other three small regions Ry1, Ry2, and Ry3. This is a small area having a density value smaller than that of the small area. In the present embodiment, the small area Ry2 is selected as the first small area.

一方、第2小領域は、第1小領域を除く他の小領域から選出される小領域である。本実施形態では、第2小領域として小領域Ry3が選出される。ここで、第2小領域として、小領域Ry3を選出したのは、小領域Ry1よりも属性情報として信頼性が高い場合があるからである。例えば、ネガフィルム等から画像を読み取った場合には、シャドウの領域、即ち小領域Ry1の属性情報としての信頼性が低くなる場合があるからである。第2小領域として小領域Ry3を選出すれば、読み取った画像がどのようなタイプであっても、信頼性の高い属性情報を取得することができる。なお、第2小領域としては、小領域Ry3の他に、小領域Ry1が選出されても良い。   On the other hand, the second small area is a small area selected from other small areas excluding the first small area. In the present embodiment, the small area Ry3 is selected as the second small area. Here, the reason why the small area Ry3 is selected as the second small area is that the attribute information may be more reliable than the small area Ry1. For example, when an image is read from a negative film or the like, the reliability as attribute information of the shadow area, that is, the small area Ry1 may be lowered. If the small area Ry3 is selected as the second small area, highly reliable attribute information can be acquired regardless of the type of the read image. In addition to the small region Ry3, the small region Ry1 may be selected as the second small region.

このような第1小領域および第2小領域の選出は、レッド(R)、グリーン(G)およびブルー(B)の各色のヒストグラムにおいて各色別にそれぞれ行われる。   Such selection of the first small area and the second small area is performed for each color in the histogram of each color of red (R), green (G), and blue (B).

<属性情報の取得>
このようにしてスキャナドライバは、レッド(R)、グリーン(G)およびブルー(B)の各色のヒストグラムにおいてそれぞれ第1小領域および第2小領域の選出を行った後、次に、これら第1小領域および第2小領域についてそれぞれ各色別に属性情報を取得する。本実施形態では、スキャナドライバは、属性情報として、第1小領域(小領域Ry2)の上限値St2(「66%基準点」ともいう)と、第2小領域(小領域Ry3)の上限値St3(「99%基準点」ともいう)とを各色につきそれぞれ取得する。
<Acquisition of attribute information>
In this manner, the scanner driver selects the first small area and the second small area in the histogram of each color of red (R), green (G), and blue (B), and then selects the first small area. Attribute information is acquired for each color for the small area and the second small area. In this embodiment, the scanner driver uses the upper limit value St2 (also referred to as “66% reference point”) of the first small area (small area Ry2) and the upper limit value of the second small area (small area Ry3) as attribute information. St3 (also referred to as “99% reference point”) is acquired for each color.

ここで、第1小領域(小領域Ry2)および第2小領域(小領域Ry3)の上限値St2、St3を属性情報として取得したのは、これら第1小領域(小領域Ry2)の上限値St2および第2小領域(小領域Ry3)の上限値St3が、他の属性情報に比べて、中間調の色バランスが崩れた画像であるか否かの判定にあたって、的確な判定を行うことができるからである。   Here, the upper limit values St2 and St3 of the first small area (small area Ry2) and the second small area (small area Ry3) are acquired as attribute information, and the upper limit values of the first small area (small area Ry2) are acquired. When determining whether or not the upper limit value St3 of St2 and the second small area (small area Ry3) is an image in which the halftone color balance is lost compared to other attribute information, an accurate determination can be made. Because it can.

レッド(R)のヒストグラムの第1小領域(小領域Ry2)および第2小領域(小領域Ry3)の上限値をそれぞれ『Str2』、『Str3』とする。また、グリーン(G)のヒストグラムの第1小領域(小領域Ry2)および第2小領域(小領域Ry3)の上限値をそれぞれ『Stg2』、『Stg3』とする。また、ブルー(B)のヒストグラムの第1小領域(小領域Ry2)および第2小領域(小領域Ry3)の上限値をそれぞれ『Stb2』、『Stb3』とする。   The upper limit values of the first small area (small area Ry2) and the second small area (small area Ry3) in the red (R) histogram are “Str2” and “Str3”, respectively. Further, the upper limit values of the first small region (small region Ry2) and the second small region (small region Ry3) in the green (G) histogram are set to “Stg2” and “Stg3”, respectively. In addition, the upper limit values of the first small area (small area Ry2) and the second small area (small area Ry3) in the histogram of blue (B) are “Stb2” and “Stb3”, respectively.

<判定>
このようにしてスキャナドライバは、第1小領域(小領域Ry2)および第2小領域(小領域Ry3)からそれぞれ各色別に属性情報を取得した後、ここで取得した属性情報に基づき、画像読み取り装置10により読み取った画像が、中間調の色バランスが崩れた画像であるか否かの判定を行う。具体的には、次のようにして判定を実施する。
<Judgment>
In this manner, the scanner driver acquires attribute information for each color from the first small area (small area Ry2) and the second small area (small area Ry3), and then, based on the acquired attribute information, the image reading device. It is determined whether the image read in step 10 is an image in which the halftone color balance is lost. Specifically, the determination is performed as follows.

図20Aおよび図20Bは、スキャナドライバによる中間調の色バランスが崩れた画像であるか否かを判定する方法について説明したものである。図20Aは、中間調の色バランスが崩れた画像であると判定される場合について説明したものである。図20Bは、中間調の色バランスが崩れた画像ではないと判定される場合について説明したものである。   20A and 20B illustrate a method for determining whether or not an image has a halftone color balance that has been lost by the scanner driver. FIG. 20A illustrates a case where it is determined that the image has a halftone color balance collapsed. FIG. 20B illustrates a case where it is determined that the image is not an image whose halftone color balance is lost.

ここでは、第1小領域(小領域Ry2)の各色の上限値『Str2』、『Stg2』、『Stb2』の関係が、Str2>Stg2>Stb2の場合を例にして説明する。また、第2小領域(小領域Ry3)の各色の上限値『Str3』、『Stg3』、『Stb3』の関係が、Str3>Stg3>Stb3の場合を例にして説明する。   Here, the case where the relationship between the upper limit values “Str2”, “Stg2”, and “Stb2” of each color of the first small region (small region Ry2) is described as an example is Str2> Stg2> Stb2. The relationship between the upper limit values “Str3”, “Stg3”, and “Stb3” of each color in the second small area (small area Ry3) will be described by taking as an example the case where Str3> Stg3> Stb3.

中間調の色バランスが崩れた画像である場合には、図20Aに示すように、中間調、即ちここでは、第1小領域(小領域Ry2)の各色の上限値『Str2』、『Stg2』、『Stb2』のバラツキが、第2小領域(小領域Ry3)の各色の上限値『Str3』、『Stg3』、『Stb3』のバラツキに比べて非常に大きくなる。このことから、これら第1小領域(小領域Ry2)の各色の上限値『Str2』、『Stg2』、『Stb2』の間の最大の差分ΔHs1と、第2小領域(小領域Ry3)の各色の上限値『Str3』、『Stg3』、『Stb3』の間の最大の差分ΔHs2とをそれぞれ求め、これら2つの差分ΔHs1、ΔHs2を比較することで、中間調の色バランスが崩れた画像であるか否かを簡単に判定することができる。   In the case of an image in which the color balance of the halftone is lost, as shown in FIG. 20A, the upper limit values “Str2” and “Stg2” of each color of the halftone, that is, the first small area (small area Ry2) here. , The variation of “Stb2” is much larger than the variation of the upper limit values “Str3”, “Stg3”, and “Stb3” of each color of the second small region (small region Ry3). From this, the maximum difference ΔHs1 between the upper limit values “Str2”, “Stg2”, “Stb2” of each color of the first small area (small area Ry2) and each color of the second small area (small area Ry3) The maximum difference ΔHs2 between “Str3”, “Stg3”, and “Stb3” is obtained, and the two differences ΔHs1 and ΔHs2 are compared, whereby the halftone color balance is lost. It can be easily determined whether or not.

ここでは、第1小領域(小領域Ry2)の各色の上限値『Str2』、『Stg2』、『Stb2』の関係が、Str2>Stg2>Stb2であることから、第1小領域(小領域Ry2)の各色の上限値『Str2』、『Stg2』、『Stb2』の間の最大の差分ΔHs1は、レッド(R)の上限値『Str2』と、ブルー(B)の上限値『Stb2』との差分から求めることができる。また、第2小領域(小領域Ry3)の各色の上限値『Str3』、『Stg3』、『Stb3』の間の最大の差分ΔHs2についても同様に、第2小領域(小領域Ry3)の各色の上限値『Str3』、『Stg3』、『Stb3』の関係が、Str3>Stg3>Stb3であることから、レッド(R)の上限値『Str3』と、ブルー(B)の上限値『Stb3』との差分から求めることができる。   Here, since the relationship of the upper limit values “Str2”, “Stg2”, “Stb2” of each color of the first small region (small region Ry2) is Str2> Stg2> Stb2, the first small region (small region Ry2) ), The maximum difference ΔHs1 between the upper limit values “Str2”, “Stg2”, and “Stb2” of each color is between the upper limit value “Str2” of red (R) and the upper limit value “Stb2” of blue (B). It can be obtained from the difference. Similarly, the maximum difference ΔHs2 between the upper limit values “Str3”, “Stg3”, and “Stb3” of each color of the second small area (small area Ry3) is similarly set to each color of the second small area (small area Ry3). Since the relationship between the upper limit values “Str3”, “Stg3”, and “Stb3” of the table is Str3> Stg3> Stb3, the upper limit value “Str3” of red (R) and the upper limit value “Stb3” of blue (B) It can be obtained from the difference between.

一方、中間調の色バランスが崩れた画像ではない場合には、図20Bに示すように、中間調、即ちここでは、第1小領域(小領域Ry2)の各色の上限値『Str2』、『Stg2』、『Stb2』のバラツキが、第2小領域(小領域Ry3)の各色の上限値『Str3』、『Stg3』、『Stb3』のバラツキに比べて非常に大きくなるようなことはない。したがって、これら第1小領域(小領域Ry2)の各色の上限値『Str2』、『Stg2』、『Stb2』の間の最大の差分ΔHs1と、第2小領域(小領域Ry3)の各色の上限値『Str3』、『Stg3』、『Stb3』の間の最大の差分ΔHs2との差が、あまり大きくなることはない。このことから、中間調の色バランスが崩れた画像ではないと簡単に判定することができる。   On the other hand, if the image is not an image in which the color balance of the halftone is lost, as shown in FIG. The variation of “Stg2” and “Stb2” does not become very large compared to the variation of the upper limit values “Str3”, “Stg3”, and “Stb3” of each color of the second small region (small region Ry3). Therefore, the maximum difference ΔHs1 between the upper limit values “Str2”, “Stg2”, “Stb2” of each color in the first small area (small area Ry2) and the upper limit of each color in the second small area (small area Ry3) The difference from the maximum difference ΔHs2 between the values “Str3”, “Stg3”, and “Stb3” does not become so large. From this, it can be easily determined that the image is not an image in which the halftone color balance is lost.

第1小領域(小領域Ry2)の各色の上限値『Str2』、『Stg2』、『Stb2』の間の最大の差分ΔHs1と、第2小領域(小領域Ry3)の各色の上限値『Str3』、『Stg3』、『Stb3』の間の最大の差分ΔHs2との比較は、例えば、差分ΔHs1と差分ΔHs2との差分、即ち、差分ΔHs1から差分ΔHs2を減算して得られた値が、所定のしきい値「Ks」以上であるか否かを調べることで、簡単に行うことができる。すなわち、下記の関係式(8)を充足するか否かをチェックすることで、簡単に中間調の色バランスが崩れた画像であるか否かを判定することができる。
ΔHs1−ΔHs2≧Ks ……………(8)
このような方法によりスキャナドライバによって判定することによって、判定対象となる画像、即ちここでは、画像読み取り装置10により読み取った画像が、中間調の色バランスが崩れた画像であるか否かを的確に判定することができる。
The maximum difference ΔHs1 between the colors “Str2”, “Stg2”, “Stb2” of each color in the first small area (small area Ry2) and the upper limit value “Str3 of each color in the second small area (small area Ry3)” ”,“ Stg3 ”, and“ Stb3 ”are compared with the maximum difference ΔHs2, for example, a difference between the difference ΔHs1 and the difference ΔHs2, that is, a value obtained by subtracting the difference ΔHs2 from the difference ΔHs1 is predetermined. This can be easily done by checking whether or not the threshold value is “Ks” or more. That is, by checking whether or not the following relational expression (8) is satisfied, it is possible to easily determine whether or not the image has an intermediate color balance.
ΔHs1-ΔHs2 ≧ Ks (8)
By determining by the scanner driver by such a method, it is accurately determined whether or not the image to be determined, that is, the image read by the image reading apparatus 10 is an image in which the halftone color balance is lost. Can be determined.

<処理の流れ>
図21は、スキャナドライバによる判定処理の流れについて説明したものである。スキャナドライバは、同図に示すように、まず、第1小領域(小領域Ry2)および第2小領域(小領域Ry3)に関する属性情報として、第1小領域(小領域Ry2)の各色の上限値『Str2』、『Stg2』、『Stb2』と、第2小領域(小領域Ry3)の各色の上限値『Str3』、『Stg3』、『Stb3』とを取得する(S402)。次に、スキャナドライバは、得られた上限値『Str2』、『Stg2』、『Stb2』、『Str3』、『Stg3』、『Stb3』に基づき、第1小領域(小領域Ry2)の各色の上限値『Str2』、『Stg2』、『Stb2』の間の最大の差分ΔHs1と、第2小領域(小領域Ry3)の各色の上限値『Str3』、『Stg3』、『Stb3』の間の最大の差分ΔHs2とをそれぞれ求める(S404)。そして、次に、スキャナドライバは、得られた2つの差分ΔHs1、ΔHs2を比較する(S406)。そして、その比較の結果、これら2つの差分ΔHs1、ΔHs2の差、即ちΔHs1−ΔHs2が所定のしきい値「Ks」以上であるか否かをチェックする(S408)。ここで、ΔHs1−ΔHs2が所定のしきい値「Ks」以上であった場合には、スキャナドライバは、中間調の色バランスが崩れた画像であると判定する(S410)。一方、ΔHs1−ΔHs2が所定のしきい値「Ks」以上でなかった場合には、スキャナドライバは、中間調の色バランスが崩れた画像ではないと判定する(S412)。このようにして中間調の色バランスが崩れた画像であるか否かの判定を行った後、スキャナドライバは、速やかに処理を終了する。
<Process flow>
FIG. 21 explains the flow of determination processing by the scanner driver. As shown in the figure, the scanner driver first sets the upper limit of each color of the first small area (small area Ry2) as attribute information regarding the first small area (small area Ry2) and the second small area (small area Ry3). The values “Str2”, “Stg2”, “Stb2” and the upper limit values “Str3”, “Stg3”, “Stb3” of each color of the second small area (small area Ry3) are acquired (S402). Next, based on the obtained upper limit values “Str2”, “Stg2”, “Stb2”, “Str3”, “Stg3”, “Stb3”, the scanner driver determines each color of the first small area (small area Ry2). Between the maximum difference ΔHs1 between the upper limit values “Str2”, “Stg2”, “Stb2” and the upper limit values “Str3”, “Stg3”, “Stb3” of each color of the second small area (small area Ry3) The maximum difference ΔHs2 is obtained (S404). Next, the scanner driver compares the obtained two differences ΔHs1 and ΔHs2 (S406). Then, as a result of the comparison, it is checked whether or not the difference between these two differences ΔHs1 and ΔHs2, that is, ΔHs1−ΔHs2 is equal to or greater than a predetermined threshold “Ks” (S408). If ΔHs1−ΔHs2 is equal to or greater than the predetermined threshold value “Ks”, the scanner driver determines that the image is a halftone color balance disrupted (S410). On the other hand, if ΔHs1−ΔHs2 is not equal to or greater than the predetermined threshold “Ks”, the scanner driver determines that the image is not an image whose halftone color balance has been lost (S412). In this way, after determining whether or not the image has an intermediate color balance, the scanner driver immediately ends the process.

===夕焼け・朝焼けの画像の判定===
次に、「夕焼けまたは朝焼けの画像であるか否かの判定」について説明する。「夕焼けまたは朝焼けの画像であるか否かの判定」については、「中間調の色バランスが崩れた画像であるか否かの判定」の場合と同様に、先の「逆光画像の判定」にて生成したRGB各色のヒストグラムを用いて、これらRGB各色のヒストグラムにおいて区分されて得られた4つの小領域Ry1、Ry2、Ry3、Ry4の中から2つ以上の小領域を選出して、選出した小領域についてそれぞれ属性情報を取得し、その属性情報に基づき、「夕焼けまたは朝焼けの画像であるか否かの判定」を行う。以下にその方法について詳しく説明する。
=== Determination of sunset / morning image ===
Next, “determination of whether the image is a sunset or sunrise image” will be described. As for “determining whether an image is a sunset or sunrise image”, as in the case of “determining whether an image is out of halftone color balance” Using the generated RGB color histograms, two or more small regions were selected from the four small regions Ry1, Ry2, Ry3, and Ry4 obtained by segmentation in the RGB color histograms. Attribute information is acquired for each of the small areas, and “determination of whether the image is a sunset or sunrise image” is performed based on the attribute information. The method will be described in detail below.

<夕焼けまたは朝焼けの画像の特性>
図22A〜図22Cは、夕焼けまたは朝焼けの画像のRGB各色のヒストグラムの一例をそれぞれ示したものである。図22Aは、レッド(R)のヒストグラムの一例を示したものである。図22Bは、グリーン(G)のヒストグラムの一例を示したものである。図22Cは、ブルー(B)のヒストグラムの一例を示したものである。
<Characteristics of sunset or sunrise image>
FIG. 22A to FIG. 22C show examples of histograms of RGB colors of sunset or sunrise images, respectively. FIG. 22A shows an example of a red (R) histogram. FIG. 22B shows an example of a green (G) histogram. FIG. 22C shows an example of a blue (B) histogram.

夕焼けまたは朝焼けの画像は、レッド(R)、グリーン(G)およびブルー(B)のうちのいずれか1色のハイライトの特性が、他の色と異なっている。特に、例えば、夕焼けの画像の場合には、レッド(R)のハイライトの領域の特性が他の色と異なっていることが多い。また、朝焼けの画像の場合には、ブルー(B)のハイライトの特性が他の色と異なっていることが多い。具体的には、例えば、夕焼けの画像の場合には、図22A〜図22Cに示すように、レッド(R)のハイライトの領域の濃度値が、他のグリーン(G)やブルー(B)に比べて大幅に大きくなっている。これによって、レッド(R)のハイライトの領域の属性、即ち、例えば、上限値や下限値、平均値などが、他のブルー(B)やグリーン(G)のハイライトの領域の属性と異なることになる。また、朝焼けの画像についても同様に、例えば、ブルー(B)のハイライトの領域の属性が、他のレッド(R)やグリーン(G)のハイライトの領域の属性と異なることになる。このことから、RGB各色のヒストグラムのハイライトの領域の属性を調べることによって、夕焼けまたは朝焼けの画像であるか否かを簡単に調べることができる。   The image of sunset or sunrise is different from the other colors in highlight characteristics of any one of red (R), green (G), and blue (B). In particular, for example, in the case of a sunset image, the characteristics of the red (R) highlight region are often different from those of other colors. In the case of an image of sunrise, the characteristics of blue (B) highlight are often different from those of other colors. Specifically, for example, in the case of a sunset image, as shown in FIGS. 22A to 22C, the density value of the highlighted region of red (R) is other green (G) or blue (B). It is significantly larger than Accordingly, the attributes of the red (R) highlight area, that is, for example, the upper limit value, the lower limit value, and the average value are different from the attributes of the other blue (B) and green (G) highlight areas. It will be. Similarly, for the sunrise image, for example, the attribute of the highlight area of blue (B) is different from the attribute of the highlight area of other red (R) and green (G). From this, it is possible to easily check whether the image is a sunset or sunrise image by checking the attribute of the highlight area of the histogram of each RGB color.

<小領域の選出>
図23は、「夕焼けまたは朝焼けの画像であるか否かの判定」における小領域の選出について説明したものである。ここでは、同図に示すように、「逆光画像の判定」において生成したヒストグラムを区分して得られた4つの小領域Ry1、Ry2、Ry3、Ry4のうちの3つの小領域Ry1、Ry2、Ry3の中から、第1小領域および第2小領域を選出する。第1小領域は、先にも説明したように、他の少なくとも1つの小領域よりも濃度値が大きい小領域である。本実施形態では、第1小領域として小領域Ry3が選出される。一方、第2小領域は、先にも説明したように、第1小領域よりも濃度値が小さい小領域である。本実施形態では、第2小領域として小領域Ry2が選出される。なお、第2小領域としては、小領域Ry2の他に、小領域Ry1が選出されても良い。また、このような第1小領域および第2小領域の選出は、レッド(R)、グリーン(G)およびブルー(B)の各色のヒストグラムにおいて各色別にそれぞれ行われる。
<Selection of small areas>
FIG. 23 illustrates the selection of a small area in “determination of whether an image is sunset or sunrise”. Here, as shown in the figure, three subregions Ry1, Ry2, Ry3 out of four subregions Ry1, Ry2, Ry3, and Ry4 obtained by dividing the histogram generated in “backlight image determination” are shown. A first small area and a second small area are selected from the above. As described above, the first small area is a small area having a density value larger than that of at least one other small area. In the present embodiment, the small area Ry3 is selected as the first small area. On the other hand, the second small region is a small region having a density value smaller than that of the first small region, as described above. In the present embodiment, the small region Ry2 is selected as the second small region. In addition to the small region Ry2, the small region Ry1 may be selected as the second small region. Further, such selection of the first small region and the second small region is performed for each color in the histogram of each color of red (R), green (G), and blue (B).

<属性情報>
このようにしてスキャナドライバは、レッド(R)、グリーン(G)およびブルー(B)の各色のヒストグラムにおいてそれぞれ第1小領域および第2小領域の選出を行った後、次に、これら第1小領域および第2小領域についてそれぞれ各色別に属性情報を取得する。本実施形態では、スキャナドライバは、属性情報として、第1小領域(小領域Ry3)の上限値St3(「99%基準点」ともいう)と、第2小領域(小領域Ry2)の上限値St2(「66%基準点」ともいう)とを各色につきそれぞれ取得する。レッド(R)のヒストグラムの第1小領域(小領域Ry3)および第2小領域(小領域Ry2)の上限値をそれぞれ『Str3』、『Str2』とする。また、グリーン(G)のヒストグラムの第1小領域(小領域Ry3)および第2小領域(小領域Ry2)の上限値をそれぞれ『Stg3』、『Stg2』とする。また、ブルー(B)のヒストグラムの第1小領域(小領域Ry3)および第2小領域(小領域Ry2)の上限値をそれぞれ『Stb3』、『Stb2』とする。
<Attribute information>
In this manner, the scanner driver selects the first small area and the second small area in the histogram of each color of red (R), green (G), and blue (B), and then selects the first small area. Attribute information is acquired for each color for the small area and the second small area. In the present embodiment, the scanner driver uses the upper limit value St3 (also referred to as “99% reference point”) of the first small area (small area Ry3) and the upper limit value of the second small area (small area Ry2) as attribute information. St 2 (also referred to as “66% reference point”) is acquired for each color. The upper limit values of the first small area (small area Ry3) and the second small area (small area Ry2) in the red (R) histogram are “Str3” and “Str2”, respectively. Further, the upper limit values of the first small area (small area Ry3) and the second small area (small area Ry2) in the green (G) histogram are set to “Stg3” and “Stg2”, respectively. The upper limit values of the first small area (small area Ry3) and the second small area (small area Ry2) in the blue (B) histogram are set to “Stb3” and “Stb2”, respectively.

<判定>
このようにしてスキャナドライバは、第1小領域(小領域Ry3)および第2小領域(小領域Ry2)からそれぞれ各色別に属性情報を取得した後、ここで取得した属性情報に基づき、画像読み取り装置10により読み取った画像が、夕焼けまたは朝焼けの画像であるか否かの判定を行う。具体的には、次のようにして判定を実施する。
<Judgment>
In this way, the scanner driver obtains attribute information for each color from the first small area (small area Ry3) and the second small area (small area Ry2), and then based on the acquired attribute information, the image reading device It is determined whether or not the image read at 10 is an image of sunset or sunrise. Specifically, the determination is performed as follows.

図24Aおよび図24Bは、スキャナドライバによる夕焼けまたは朝焼けの画像であるか否かを判定する方法について説明したものである。図24Aは、夕焼けまたは朝焼けの画像であると判定される場合について説明したものである。図24Bは、夕焼けまたは朝焼けの画像ではないと判定される場合について説明したものである。   FIG. 24A and FIG. 24B explain a method for determining whether the image is a sunset or sunrise image by the scanner driver. FIG. 24A illustrates a case where it is determined that the image is sunset or sunrise. FIG. 24B illustrates the case where it is determined that the image is not a sunset or sunrise image.

ここでは、第1小領域(小領域Ry3)の各色の上限値『Str3』、『Stg3』、『Stb3』の関係が、Str3>Stb3>Stg3の場合を例にして説明する。また、第2小領域(小領域Ry2)の各色の上限値『Str2』、『Stg2』、『Stb2』の関係が、Str2>Stb2>Stg2の場合を例にして説明する。   Here, the case where the relationship between the upper limit values “Str3”, “Stg3”, and “Stb3” of each color of the first small region (small region Ry3) is described as an example is Str3> Stb3> Stg3. The relationship between the upper limit values “Str2”, “Stg2”, and “Stb2” of each color in the second small area (small area Ry2) will be described by taking as an example the case where Str2> Stb2> Stg2.

夕焼けまたは朝焼けの画像である場合には、図24Aに示すように、ハイライト、即ちここでは、第1小領域(小領域Ry3)の各色の上限値『Str3』、『Stg3』、『Stb3』のうち、特定の色の上限値が他の色の上限値に比べて非常に大きくなる。すなわち、夕焼けの画像の場合には、例えば、レッド(R)の第1小領域(小領域Ry3)の上限値『Str3』が、他の色の上限値、即ちここでは、ブルー(B)やグリーン(G)の上限値『Stg3』、『Stb3』に比べて非常に大きくなる。また、朝焼けの画像の場合には、例えば、ブルー(B)の第1小領域(小領域Ry3)の上限値『Stb3』が、他の色の上限値、即ちここでは、レッド(R)やグリーン(G)の上限値『Str3』、『Stg3』に比べて非常に大きくなる。一方、中間調、即ちここでは、第2小領域(小領域Ry2)の各色の上限値『Str2』、『Stg2』、『Stb2』には、特定の色に偏るような性質はみられない。   In the case of an image of sunset or sunrise, as shown in FIG. 24A, highlights, that is, here, upper limit values “Str3”, “Stg3”, “Stb3” of each color of the first small region (small region Ry3). Among these, the upper limit value of a specific color is much larger than the upper limit values of other colors. That is, in the case of a sunset image, for example, the upper limit value “Str3” of the first small area (small area Ry3) of red (R) is the upper limit value of other colors, that is, blue (B) or It is much larger than the upper limit values “Stg3” and “Stb3” of green (G). In the case of an image of sunrise, for example, the upper limit value “Stb3” of the first small area (small area Ry3) of blue (B) is the upper limit value of other colors, that is, red (R) or It is much larger than the upper limit values “Str3” and “Stg3” of green (G). On the other hand, in the middle tone, that is, here, the upper limit values “Str2”, “Stg2”, and “Stb2” of each color of the second small area (small area Ry2) do not have a property that is biased to a specific color.

このことから、これら第1小領域(小領域Ry3)の各色の上限値『Str3』、『Stg3』、『Stb3』の間の最大の差分ΔHt1と、第2小領域(小領域Ry2)の各色の上限値『Str2』、『Stg2』、『Stb2』の間の最大の差分ΔHt2とをそれぞれ求め、これら2つの差分ΔHt1、ΔHt2を比較することで、夕焼けまたは朝焼けの画像であるか否かを簡単に判定することができる。   From this, the maximum difference ΔHt1 between the upper limit values “Str3”, “Stg3”, “Stb3” of each color of the first small area (small area Ry3) and each color of the second small area (small area Ry2) The maximum difference ΔHt2 between “St2”, “Stg2”, and “Stb2” is obtained, and the two differences ΔHt1 and ΔHt2 are compared to determine whether the image is sunset or sunrise. It can be easily determined.

ここでは、第1小領域(小領域Ry3)の各色の上限値『Str3』、『Stg3』、『Stb3』の関係が、Str3>Stb3>Stg3であることから、第1小領域(小領域Ry3)の各色の上限値『Str3』、『Stg3』、『Stb3』の間の最大の差分ΔHt1は、レッド(R)の上限値『Str3』と、グリーン(G)の上限値『Stg3』との差分から求めることができる。また、第2小領域(小領域Ry2)の各色の上限値『Str2』、『Stg2』、『Stb2』の間の最大の差分ΔHt2は、第2小領域(小領域Ry2)の各色の上限値『Str2』、『Stg2』、『Stb2』の関係が、Str2>Stb2>Stg2であるから、レッド(R)の上限値『Str2』と、グリーン(G)の上限値『Stg2』との差分から求めることができる。   Here, since the relationship between the upper limit values “Str3”, “Stg3”, and “Stb3” of each color of the first small area (small area Ry3) is Str3> Stb3> Stg3, the first small area (small area Ry3) ), The maximum difference ΔHt1 between the upper limit values “Str3”, “Stg3” and “Stb3” of each color is the upper limit value “Str3” of red (R) and the upper limit value “Stg3” of green (G). It can be obtained from the difference. The maximum difference ΔHt2 between the upper limit values “Str2”, “Stg2”, and “Stb2” of each color in the second small area (small area Ry2) is the upper limit value of each color in the second small area (small area Ry2). Since the relationship of “Str2”, “Stg2”, and “Stb2” is Str2> Stb2> Stg2, the difference between the upper limit value “Str2” of red (R) and the upper limit value “Stg2” of green (G) Can be sought.

一方、夕焼けまたは朝焼けの画像ではない場合には、図24Bに示すように、ハイライト、即ちここでは、第1小領域(小領域Ry3)の各色の上限値『Str3』、『Stg3』、『Stb3』のうち、特定の色の上限値が他の色の上限値に比べて非常に大きくなるようなことはない。したがって、第1小領域(小領域Ry3)の各色の上限値『Str3』、『Stg3』、『Stb3』の間の最大の差分ΔHt1と、第2小領域(小領域Ry2)の各色の上限値『Str2』、『Stg2』、『Stb2』の間の最大の差分ΔHt2との差が、あまり大きくなることはない。このことから、夕焼けまたは朝焼けの画像ではないと簡単に判定することができる。   On the other hand, if it is not an image of sunset or sunrise, as shown in FIG. 24B, highlights, that is, here, upper limit values “Str3”, “Stg3”, “Stg3”, “1st small region (small region Ry3)”. In “Stb3”, the upper limit value of a specific color does not become much larger than the upper limit values of other colors. Therefore, the maximum difference ΔHt1 between the upper limit values “Str3”, “Stg3”, and “Stb3” of each color in the first small area (small area Ry3) and the upper limit value of each color in the second small area (small area Ry2) The difference from the maximum difference ΔHt2 among “Str2”, “Stg2”, and “Stb2” does not become so large. From this, it can be easily determined that the image is not a sunset or sunrise image.

第1小領域(小領域Ry3)の各色の上限値『Str3』、『Stg3』、『Stb3』の間の最大の差分ΔHt1と、第2小領域(小領域Ry2)の各色の上限値『Str2』、『Stg2』、『Stb2』の間の最大の差分ΔHt2との比較は、例えば、差分ΔHt1と差分ΔHt2との差分、即ち、差分ΔHt1から差分ΔHt2を減算して得られた値が、所定のしきい値「Kt」以上であるか否かを調べることで、簡単に行うことができる。すなわち、下記の関係式(9)を充足するか否かをチェックすることで、簡単に夕焼けまたは朝焼けの画像であるか否かを判定することができる。
ΔHt1−ΔHt2≧Kt ……………(9)
このような方法によりスキャナドライバによって判定することによって、判定対象となる画像、即ちここでは、画像読み取り装置10により読み取った画像が、夕焼けまたは朝焼けの画像であるか否かを的確に判定することができる。
The maximum difference ΔHt1 between the colors “Str3”, “Stg3”, “Stb3” of each color in the first small region (small region Ry3), and the upper limit value “Str2” of each color in the second small region (small region Ry2) ”,“ Stg2 ”and“ Stb2 ”are compared with the maximum difference ΔHt2, for example, a difference between the difference ΔHt1 and the difference ΔHt2, that is, a value obtained by subtracting the difference ΔHt2 from the difference ΔHt1 is predetermined. It can be easily performed by checking whether or not the threshold value is equal to or greater than the threshold value “Kt”. That is, by checking whether or not the following relational expression (9) is satisfied, it can be easily determined whether the image is a sunset or sunrise image.
ΔHt1−ΔHt2 ≧ Kt (9)
By determining by the scanner driver by such a method, it is possible to accurately determine whether the image to be determined, that is, the image read by the image reading device 10 here is an image of sunset or sunrise. it can.

<処理の流れ>
図25は、スキャナドライバによる判定処理の流れについて説明したものである。スキャナドライバは、同図に示すように、まず、第1小領域(小領域Ry3)および第2小領域(小領域Ry2)に関する属性情報として、第1小領域(小領域Ry3)の各色の上限値『Str3』、『Stg3』、『Stb3』と、第2小領域(小領域Ry2)の各色の上限値『Str2』、『Stg2』、『Stb2』とを取得する(S452)。次に、スキャナドライバは、得られた上限値『Str2』、『Stg2』、『Stb2』、『Str3』、『Stg3』、『Stb3』に基づき、第1小領域(小領域Ry3)の各色の上限値『Str3』、『Stg3』、『Stb3』の間の最大の差分ΔHt1と、第2小領域(小領域Ry2)の各色の上限値『Str2』、『Stg2』、『Stb2』の間の最大の差分ΔHt2とをそれぞれ求める(S454)。そして、次に、スキャナドライバは、得られた2つの差分ΔHt1、ΔHt2を比較する(S456)。そして、その比較の結果、これら2つの差分ΔHt1、ΔHt2の差、即ちΔHt1−ΔHt2が所定のしきい値「Kt」以上であるか否かをチェックする(S458)。ここで、ΔHt1−ΔHt2が所定のしきい値「Kt」以上であった場合には、スキャナドライバは、夕焼けまたは朝焼けの画像であると判定する(S460)。一方、ΔHt1−ΔHt2が所定のしきい値「Kt」以上でなかった場合には、スキャナドライバは、夕焼けまたは朝焼けの画像ではないと判定する(S462)。このようにして夕焼けまたは朝焼けの画像であるか否かの判定を行った後、スキャナドライバは、速やかに処理を終了する。
<Process flow>
FIG. 25 illustrates the flow of determination processing by the scanner driver. As shown in the figure, the scanner driver first sets the upper limit of each color of the first small area (small area Ry3) as attribute information regarding the first small area (small area Ry3) and the second small area (small area Ry2). The values “Str3”, “Stg3”, “Stb3” and the upper limit values “Str2”, “Stg2”, “Stb2” of each color of the second small area (small area Ry2) are acquired (S452). Next, based on the obtained upper limit values “Str2”, “Stg2”, “Stb2”, “Str3”, “Stg3”, “Stb3”, the scanner driver determines each color of the first small area (small area Ry3). Between the maximum difference ΔHt1 between the upper limit values “Str3”, “Stg3” and “Stb3” and the upper limit values “Str2”, “Stg2” and “Stb2” of each color in the second small area (small area Ry2) The maximum difference ΔHt2 is obtained (S454). Next, the scanner driver compares the obtained two differences ΔHt1 and ΔHt2 (S456). As a result of the comparison, it is checked whether or not the difference between these two differences ΔHt1 and ΔHt2, that is, ΔHt1−ΔHt2 is equal to or greater than a predetermined threshold value “Kt” (S458). If ΔHt1−ΔHt2 is equal to or greater than the predetermined threshold “Kt”, the scanner driver determines that the image is sunset or sunrise (S460). On the other hand, if ΔHt1−ΔHt2 is not equal to or greater than the predetermined threshold “Kt”, the scanner driver determines that the image is not a sunset or sunrise image (S462). After determining whether the image is a sunset or sunrise image in this way, the scanner driver immediately ends the process.

===通常の逆光画像の補正===
次に、「通常の逆光画像に対する補正処理」について説明する。この補正処理は、「逆光画像であるか否かの判定処理」において逆光画像ではないと判定された場合、および「夕焼けまたは朝焼けの画像であるか否かの判定処理」において夕焼けまたは朝焼けの画像ではないと判定された場合に実行される。
=== Normal Backlight Image Correction ===
Next, “normal correction processing for a backlight image” will be described. This correction process is performed when the image is determined not to be a backlight image in the “determination process for determining whether the image is a backlight image” and the image for sunset or sunrise is determined in the process for determining whether the image is a sunset or sunrise image. It is executed when it is determined that it is not.

この補正処理は、先の「逆光画像の判定」にて生成したRGB各色のヒストグラムを用いて実施される。すなわち、先の「逆光画像の判定」にて生成したRGB各色のヒストグラムにおいて区分して得られた4つの小領域Ry1、Ry2、Ry3、Ry4のうちの3つの小領域Ry1、Ry2、Ry3からそれぞれ属性情報を取得して、その取得した属性情報に基づき、画像に対して補正処理を施す。以下にその補正方法について詳しく説明する。   This correction processing is performed using the histograms for each of the RGB colors generated in the previous “backlight image determination”. That is, from each of the three small areas Ry1, Ry2, Ry3, Ry4 obtained by dividing in the histogram of each color of RGB generated in the previous “backlight image determination”, from the three small areas Ry1, Ry2, Ry3. Attribute information is acquired, and correction processing is performed on the image based on the acquired attribute information. The correction method will be described in detail below.

<属性情報の取得>
スキャナドライバは、まず、先の「逆光画像の判定」にて生成したRGB各色のヒストグラムにおいて区分して得られた4つの小領域Ry1、Ry2、Ry3、Ry4のうちの3つの小領域Ry1、Ry2、Ry3からそれぞれ属性情報を取得する。ここで、属性情報としては、RGB各色のヒストグラムから3つの小領域Ry1、Ry2、Ry3を占める画素の濃度値の平均値をそれぞれ取得する。ここで、レッド(R)のヒストグラムの小領域Ry1を占める画素の濃度値の平均値を『AVr1』とし、またその小領域Ry2を占める画素の濃度値の平均値を『AVr2』とし、またその小領域Ry3を占める画素の濃度値の平均値を『AVr3』とする。また、グリーン(G)のヒストグラムの小領域Ry1を占める画素の濃度値の平均値を『AVg1』とし、またその小領域Ry2を占める画素の濃度値の平均値を『AVg2』とし、またその小領域Ry3を占める画素の濃度値の平均値を『AVg3』とする。また、ブルー(B)のヒストグラムの小領域Ry1を占める画素の濃度値の平均値を『AVb1』とし、またその小領域Ry2を占める画素の濃度値の平均値を『AVb2』とし、またその小領域Ry3を占める画素の濃度値の平均値を『AVb3』とする。
<Acquisition of attribute information>
First, the scanner driver performs three small areas Ry1, Ry2, Ry1, Ry3, Ry4 out of the four small areas Ry1, Ry2, Ry3, Ry4 obtained by segmenting in the histogram for each of the RGB colors generated in the above-mentioned “backlight image determination”. , Ry3 respectively to obtain attribute information. Here, as the attribute information, the average values of the density values of the pixels occupying the three small regions Ry1, Ry2, and Ry3 are acquired from the RGB histograms. Here, the average value of the density values of the pixels occupying the small area Ry1 of the red (R) histogram is “AVr1,” and the average value of the density values of the pixels occupying the small area Ry2 is “AVr2.” The average value of the density values of the pixels occupying the small area Ry3 is “AVr3”. In addition, the average value of the density values of the pixels occupying the small area Ry1 of the green (G) histogram is “AVg1,” and the average value of the density values of the pixels occupying the small area Ry2 is “AVg2.” The average value of the density values of the pixels occupying the region Ry3 is “AVg3”. Further, the average value of the density values of the pixels occupying the small area Ry1 of the blue (B) histogram is “AVb1,” and the average value of the density values of the pixels occupying the small area Ry2 is “AVb2.” The average value of the density values of the pixels occupying the region Ry3 is “AVb3”.

<補正情報の生成>
その後、スキャナドライバは、ここで取得した平均値AVr1、AVr2、AVr3、AVg1、AVg2、AVg3、AVb1、AVb2、AVb3に基づき、画像読み取り装置10により読み取った画像に対して逆光補正処理を施すための補正情報を生成する。以下に本実施形態における補正情報の生成方法について説明する。
<Generation of correction information>
Thereafter, the scanner driver performs backlight correction processing on the image read by the image reading device 10 based on the average values AVr1, AVr2, AVr3, AVg1, AVg2, AVg3, AVb1, AVb2, and AVb3 acquired here. Generate correction information. Hereinafter, a correction information generation method according to the present embodiment will be described.

(1)輝度に関する情報の取得
本実施形態では、レッド(R)、グリーン(G)およびブルー(B)の3色のヒストグラムから得られた3つの小領域Ry1、Ry2、Ry3を占める画素の各色別の濃度値の平均値AVr1、AVr2、AVr3、AVg1、AVg2、AVg3、AVb1、AVb2、AVb3に基づき、スキャナドライバは、3つの小領域Ry1、Ry2、Ry3についてそれぞれ各領域Ry1、Ry2、Ry3を占める画素の輝度の平均値Yav1、Yav2、Yav3を取得する。ここで、スキャナドライバは、例えば、次の式(10)〜(12)等を用いることによって、小領域Ry1、Ry2、Ry3を占める画素の輝度の平均値Yav1、Yav2、Yav3を取得する。
Yav1=1/5×AVr1+3/5×AVg1+1/5×AVb1 ………(10)
Yav2=1/5×AVr2+3/5×AVg2+1/5×AVb2 ………(11)
Yav3=1/5×AVr3+3/5×AVg3+1/5×AVb3 ………(12)
なお、ここでは、式(10)〜(12)について、レッド(R)、グリーン(G)およびブルー(B)の各色の比率が、「1:3:1」の場合を例にして示したが、これ以外の比率に設定されても良い。
(1) Acquisition of information regarding luminance In this embodiment, each color of pixels occupying three small regions Ry1, Ry2, and Ry3 obtained from a histogram of three colors of red (R), green (G), and blue (B). Based on the average values AVr1, AVr2, AVr3, AVg1, AVg2, AVg3, AVb1, AVb2, and AVb3 of the different density values, the scanner driver assigns each of the small regions Ry1, Ry2, and Ry3 to the respective regions Ry1, Ry2, and Ry3. Average values Yav1, Yav2, and Yav3 of the luminance of the occupied pixels are acquired. Here, the scanner driver acquires the average values Yav1, Yav2, and Yav3 of the luminance of the pixels that occupy the small regions Ry1, Ry2, and Ry3 by using the following equations (10) to (12), for example.
Yav1 = 1/5 × AVr1 + 3/5 × AVg1 + 1/5 × AVb1 (10)
Yav2 = 1/5 × AVr 2 + 3/5 × AVg 2 + 1/5 × AVb 2 (11)
Yav3 = 1/5 × AVr3 + 3/5 × AVg3 + 1/5 × AVb3 (12)
Here, in the formulas (10) to (12), the case where the ratio of each color of red (R), green (G), and blue (B) is “1: 3: 1” is shown as an example. However, other ratios may be set.

スキャナドライバは、このようにして3つの小領域Ry1、Ry2、Ry3を占める画素の輝度の平均値Yav1、Yav2、Yav3を取得する。そして、スキャナドライバは、このようにして取得した3つの小領域Ry1、Ry2、Ry3を占める画素の輝度の平均値Yav1、Yav2、Yav3から、画像読み取り装置10により読み取った画像の全体の輝度の平均値Yav0を求める。本実施形態では、3つの小領域Ry1、Ry2、Ry3が、画像全体の99%を占めていることから、3つの小領域Ry1、Ry2、Ry3にそれぞれ対応する輝度の平均値Yav1、Yav2、Yav3の平均値を画像の全体の輝度の平均値Yav0とする。したがって、本実施形態では、画像読み取り装置10により読み取った画像の全体の輝度の平均値Yav0は、例えば、次の式(13)により求めることができる。
Yav0=(Yav1+Yav2+Yav3)/3 ……………(13)
このようにしてスキャナドライバは、画像読み取り装置10により読み取った画像の全体の輝度の平均値Yav0を取得する。
In this way, the scanner driver obtains the average luminance values Yav1, Yav2, and Yav3 of the pixels that occupy the three small regions Ry1, Ry2, and Ry3. The scanner driver then calculates the average luminance of the entire image read by the image reading device 10 from the average luminance values Yav1, Yav2, and Yav3 of the pixels occupying the three small regions Ry1, Ry2, and Ry3. The value Yav0 is obtained. In this embodiment, since the three small areas Ry1, Ry2, and Ry3 occupy 99% of the entire image, the average luminance values Yav1, Yav2, and Yav3 corresponding to the three small areas Ry1, Ry2, and Ry3, respectively. Is an average value Yav0 of the overall luminance of the image. Therefore, in the present embodiment, the average value Yav0 of the overall luminance of the image read by the image reading device 10 can be obtained by the following equation (13), for example.
Yav0 = (Yav1 + Yav2 + Yav3) / 3 (3)
In this way, the scanner driver obtains the average value Yav0 of the overall luminance of the image read by the image reading device 10.

(2)目標値の取得
スキャナドライバは、このように3つの小領域Ry1、Ry2、Ry3を占める画素の輝度の平均値Yav1、Yav2、Yav3を取得し、さらに画像読み取り装置10により読み取った画像の全体の輝度の平均値Yav0を取得した後、目標値を取得する。この目標値は、画像読み取り装置10により読み取られた画像に対して逆光補正処理を施すために取得される値であり、その逆光補正処理の概要を決定する上で指標となる値である。本実施形態では、この目標値として、2つの目標値Ym1、Ym2が取得される。1つの目標値Ym1は、小領域Ry1に対応して取得されるもので、小領域Ry1を占める画素の輝度の平均値の目標値を示す。また、もう1つの目標値Ym2は、小領域Ry2に対応して取得されるもので、小領域Ry2を占める画素の輝度の平均値の目標値を示す。
(2) Acquisition of Target Value The scanner driver acquires the average values Yav1, Yav2, and Yav3 of the pixels that occupy the three small regions Ry1, Ry2, and Ry3 in this way, and further acquires the image read by the image reading device 10 After obtaining the average value Yav0 of the overall luminance, the target value is obtained. This target value is a value acquired for performing the backlight correction process on the image read by the image reading device 10, and is a value that serves as an index in determining the outline of the backlight correction process. In the present embodiment, two target values Ym1 and Ym2 are acquired as the target values. One target value Ym1 is acquired corresponding to the small region Ry1, and indicates the target value of the average value of the luminance of the pixels occupying the small region Ry1. The other target value Ym2 is acquired corresponding to the small area Ry2, and indicates the target value of the average value of the luminance of the pixels occupying the small area Ry2.

次に、これら2つの目標値Ym1、Ym2を取得する方法について説明する。図26は、2つの目標値Ym1、Ym2を取得する方法の一例について説明したものである。   Next, a method for obtaining these two target values Ym1 and Ym2 will be described. FIG. 26 illustrates an example of a method for obtaining two target values Ym1 and Ym2.

本実施形態では、スキャナドライバは、これら2つの目標値Ym1、Ym2を、小領域Ry1を占める画素の輝度の平均値Yav1と、画像の全体の輝度の平均値Yav0とに基づき取得する。詳しくは、スキャナドライバは、小領域Ry1を占める画素の輝度の平均値Yav1と、画像の全体の輝度の平均値Yav0とを加算して、これにより得られた加算値Saddに基づき、2つの目標値Ym1、Ym2を取得する。加算値Saddから2つの目標値Ym1、Ym2を取得するにあたっては、同図に示すような2つの関係式(A)、(B)を用いる。   In the present embodiment, the scanner driver obtains these two target values Ym1 and Ym2 based on the average luminance value Yav1 of the pixels occupying the small region Ry1 and the average luminance value Yav0 of the entire image. Specifically, the scanner driver adds the average value Yav1 of the luminance of the pixels occupying the small area Ry1 and the average luminance Yav0 of the entire luminance of the image, and based on the addition value Sadd obtained thereby, The values Ym1 and Ym2 are acquired. In obtaining the two target values Ym1 and Ym2 from the added value Sadd, two relational expressions (A) and (B) as shown in the figure are used.

同図に示す2つの関係式(A)、(B)は、横軸を加算値とし、縦軸を目標値として形成されたグラフ上に表されている。関係式(A)は、小領域Ry1に対応する目標値Ym1を取得するためのものである。また、関係式(B)は、小領域Ry2に対応する目標値Ym2を取得するためのものである。   The two relational expressions (A) and (B) shown in the figure are represented on a graph formed with the horizontal axis as an addition value and the vertical axis as a target value. The relational expression (A) is for obtaining the target value Ym1 corresponding to the small region Ry1. The relational expression (B) is for obtaining the target value Ym2 corresponding to the small region Ry2.

スキャナドライバが、小領域Ry1を占める画素の輝度の平均値Yav1と、画像の全体の輝度の平均値Yav0とを加算して、加算値Saddを取得したとする。すると、スキャナドライバは、この加算値Saddに基づき、関係式(A)からこの加算値Saddに対応する目標値Ym1を取得する。また、スキャナドライバは、この加算値Saddに基づき、関係式(B)からこの加算値Saddに対応する目標値Ym2を取得する。このようにスキャナドライバは、小領域Ry1を占める画素の輝度の平均値Yav1と、画像の全体の輝度の平均値Yav0とを加算して得られた加算値Saddから、2つの目標値、即ち、小領域Ry1を占める画素の輝度の平均値の目標値Ym1と、小領域Ry2を占める画素の輝度の平均値の目標値Ym2とを簡単に取得することができる。   Assume that the scanner driver adds the average luminance value Yav1 of the pixels occupying the small area Ry1 and the average luminance value Yav0 of the entire luminance of the image to obtain the added value Sadd. Then, the scanner driver acquires the target value Ym1 corresponding to the addition value Sadd from the relational expression (A) based on the addition value Sadd. Also, the scanner driver obtains the target value Ym2 corresponding to the addition value Sadd from the relational expression (B) based on the addition value Sadd. As described above, the scanner driver can obtain two target values, that is, the addition value Sadd obtained by adding the average value Yav1 of the luminance of the pixels occupying the small region Ry1 and the average value Yav0 of the entire luminance of the image. It is possible to easily obtain the target value Ym1 of the average value of the luminance of the pixels occupying the small region Ry1 and the target value Ym2 of the average value of the luminance of the pixels occupying the small region Ry2.

なお、ここで、スキャナドライバが、加算値Saddに基づき、2つの目標値Ym1、Ym2を取得した理由について説明する。平均値Yav1が取得される小領域Ry1は、各色別に生成したヒストグラムを区分して得られた4つの小領域の中で最も濃度値が小さい小領域である。このため、この小領域Ry1から取得される平均値Yav1の大きさは、画像の逆光度合いに応じて大きく変化することになる。しかしながら、小領域Ry1から取得される平均値Yav1だけでは、逆光画像か否か判断することはできない。それは、画像全体が暗い画像であっても、小領域Ry1から取得される平均値Yav1が小さいからである。この場合には、画像全体の輝度を高める必要がある。逆光画像のように一部の画素の輝度だけを高めるだけでは十分な補正効果が得られないからである。   Here, the reason why the scanner driver has acquired the two target values Ym1 and Ym2 based on the addition value Sadd will be described. The small region Ry1 from which the average value Yav1 is acquired is the small region having the smallest density value among the four small regions obtained by dividing the histogram generated for each color. For this reason, the magnitude of the average value Yav1 acquired from the small region Ry1 varies greatly depending on the degree of backlight of the image. However, it is impossible to determine whether or not the image is a backlight image only by the average value Yav1 acquired from the small region Ry1. This is because even if the entire image is a dark image, the average value Yav1 acquired from the small region Ry1 is small. In this case, it is necessary to increase the brightness of the entire image. This is because a sufficient correction effect cannot be obtained only by increasing the luminance of some pixels as in a backlight image.

そこで、画像の全体の輝度の平均値Yav0も考慮すべく、小領域Ry1を占める画素の輝度の平均値Yav1に、画像の全体の輝度の平均値Yav0を加算して加算値Saddを取得するのである。この加算値Saddは、画像の逆光度合いを調べる上で、非常に適切な値となる。つまり、この加算値Saddが非常に小さい場合には、小領域Ry1を占める画素の輝度の平均値Yav1だけが小さいのではなく、画像の全体の輝度の平均値Yav0も小さく、全体が暗い画像であると判断することができる。これによって、画像全体の輝度を高めるように補正をすることができる。   Therefore, in order to consider the average value Yav0 of the entire luminance of the image, the average value Yav0 of the entire luminance of the image is added to the average value Yav1 of the pixels occupying the small area Ry1, so that the addition value Sadd is obtained. is there. This added value Sadd is a very appropriate value in examining the degree of backlighting of the image. That is, when the added value Sadd is very small, not only the average luminance value Yav1 of the pixels occupying the small region Ry1 but also the average luminance value Yav0 of the entire image is small and the entire image is dark. It can be judged that there is. As a result, correction can be performed to increase the brightness of the entire image.

一方、この加算値Saddがそれほど小さくない場合には、画像の全体の輝度の平均値Yav0はそれほど小さくなく、小領域Ry1を占める画素の輝度の平均値Yav1が小さいことから、逆光画像であると判断することができる。これによって、画像全体の輝度ではなく一部の画素の輝度を高めるように補正をすることができる。   On the other hand, when the added value Sadd is not so small, the average luminance value Yav0 of the entire image is not so small, and the average value Yav1 of the pixels occupying the small area Ry1 is small. Judgment can be made. Accordingly, it is possible to perform correction so as to increase the luminance of some pixels, not the luminance of the entire image.

前述した2つの関係式(A)、(B)は、このような加算値Saddの大きさに応じて2つの目標値Ym1、Ym2が規定されるように、それぞれ設定される。すなわち、2つの関係式(A)、(B)は、加算値Saddが非常に小さい場合、即ち画像全体の輝度が低く、暗い画像であると判断される場合には、画像全体の輝度を高めるように補正をすべく、小領域Ry1を占める画素の輝度の平均値の目標値Ym1と、小領域Ry2を占める画素の輝度の平均値の目標値Ym2とがそれぞれ非常に大きな値になるように設定される。また、加算値Saddがそれほど小さくない場合、即ち画像が逆光画像であると判断される場合には、2つの関係式(A)、(B)は、小領域Ry1を占める画素の輝度の平均値の目標値Ym1と、小領域Ry2を占める画素の輝度の平均値の目標値Ym2とがそれぞれあまり大きな値にならないように設定される。これによって、本実施形態の「通常の逆光画像に対する補正処理」は、画像読み取り装置10により読み取られた画像が逆光画像ではなく、全体的に輝度が低く暗い画像であった場合についても、適切な補正を実行することができる。   The two relational expressions (A) and (B) described above are set so that the two target values Ym1 and Ym2 are defined according to the magnitude of the added value Sadd. That is, the two relational expressions (A) and (B) increase the luminance of the entire image when the added value Sadd is very small, that is, when the luminance of the entire image is low and it is determined that the image is a dark image. In order to correct in this way, the target value Ym1 of the average value of the luminance of the pixels occupying the small region Ry1 and the target value Ym2 of the average value of the luminance of the pixels occupying the small region Ry2 are respectively very large values. Is set. When the addition value Sadd is not so small, that is, when it is determined that the image is a backlight image, the two relational expressions (A) and (B) are the average values of the luminances of the pixels occupying the small region Ry1. The target value Ym1 and the target value Ym2 of the average luminance of the pixels occupying the small area Ry2 are set so as not to be too large. Accordingly, the “correction processing for a normal backlight image” of the present embodiment is appropriate even when the image read by the image reading device 10 is not a backlight image but is a dark image with low overall brightness. Correction can be performed.

これら2つの関係式(A)、(B)は、例えば、次のように設定することができる。すなわち、加算値Saddが取り得る最小値を『Smin』とし、加算値Saddが取り得る最大値を『Smax』とすると、これら最小値『Smin』および最大値『Smax』にそれぞれ対応する最大目標値および最小目標値を設定する。ここで、関係式(A)に対応する最大目標値を『Ymax1』とし、最小目標値を『Ymin1』とする。また、関係式(B)に対応する最大目標値を『Ymax2』とし、最小目標値を『Ymin2』とする。なお、これら加算値Saddの最小値『Smin』および最大値『Smax』、関係式(A)の最大目標値『Ymax1』および最小目標値『Ymin1』、並びに関係式(B)の最大目標値『Ymax2』および最小目標値『Ymin2』は、経験則等により適宜設定される。   These two relational expressions (A) and (B) can be set as follows, for example. That is, assuming that the minimum value that the addition value Sadd can take is “Smin” and the maximum value that the addition value Sadd can take is “Smax”, the maximum target value corresponding to each of the minimum value “Smin” and the maximum value “Smax”. Set the minimum target value. Here, the maximum target value corresponding to the relational expression (A) is “Ymax1”, and the minimum target value is “Ymin1”. The maximum target value corresponding to the relational expression (B) is “Ymax2”, and the minimum target value is “Ymin2”. The minimum value “Smin” and the maximum value “Smax” of the added value Sadd, the maximum target value “Ymax1” and the minimum target value “Ymin1” of the relational expression (A), and the maximum target value “of the relational expression (B)” Ymax2 ”and the minimum target value“ Ymin2 ”are appropriately set based on empirical rules and the like.

このことから、関係式(A)は、例えば、同図に示すように、加算値Saddの最小値『Smin』と、関係式(A)の最大目標値『Ymax1』とにより規定されるポイントPm1と、加算値Saddの最大値『Smax』と、関係式(A)の最小目標値『Ymin1』とにより規定されるポイントPm3とを結ぶ直線として簡単に設定することができる。また、関係式(B)は、例えば、同図に示すように、加算値Saddの最小値『Smin』と、関係式(B)の最大目標値『Ymax2』とにより規定されるポイントPm2と、加算値Saddの最大値『Smax』と、関係式(B)の最小目標値『Ymin2』とにより規定されるポイントPm4とを結ぶ直線として簡単に設定することができる。   From this, the relational expression (A) is, for example, the point Pm1 defined by the minimum value “Smin” of the addition value Sadd and the maximum target value “Ymax1” of the relational expression (A) as shown in FIG. And a straight line connecting the maximum value “Smax” of the addition value Sadd and the point Pm3 defined by the minimum target value “Ymin1” of the relational expression (A). Further, the relational expression (B) is, for example, as shown in the figure, a point Pm2 defined by the minimum value “Smin” of the addition value Sadd and the maximum target value “Ymax2” of the relational expression (B), It can be easily set as a straight line connecting the maximum value “Smax” of the addition value Sadd and the point Pm4 defined by the minimum target value “Ymin2” of the relational expression (B).

ここで、加算値Saddの最大値『Smax』に対応する関係式(A)の最小目標値『Ymin1』および関係式(B)の最小目標値『Ymin2』がそれぞれ非常に小さい値に設定されている。このことから、加算値Saddが大きすぎる場合には、小領域Ry1を占める画素の輝度の平均値の目標値Ym1と、小領域Ry2を占める画素の輝度の平均値の目標値Ym2とを標準的な値よりも十分に小さい値に設定することができる。これによって、画像全体の輝度が高い場合、即ち画像全体が明るい場合などについても、その画像に対して補正を施すことができる。つまり、本実施形態では、画像が逆光画像か否かを判定しなくても、即ち画像が逆光画像か否かに関わらず、画像に対して適宜な逆光補正処理を実行することができる。このことから、本実施形態では、「逆光画像であるか否かの判定処理」において逆光画像ではないと判定された場合であっても、「通常の逆光画像に対する補正処理」を施すことができる。   Here, the minimum target value “Ymin1” of the relational expression (A) corresponding to the maximum value “Smax” of the addition value Sadd and the minimum target value “Ymin2” of the relational expression (B) are respectively set to very small values. Yes. Therefore, when the added value Sadd is too large, the target value Ym1 of the average value of the luminance of the pixels occupying the small region Ry1 and the target value Ym2 of the average value of the luminance of the pixels occupying the small region Ry2 are standard. It can be set to a value sufficiently smaller than the correct value. As a result, even when the brightness of the entire image is high, that is, when the entire image is bright, the image can be corrected. That is, in the present embodiment, an appropriate backlight correction process can be performed on an image without determining whether the image is a backlight image, that is, regardless of whether the image is a backlight image. Therefore, in the present embodiment, even if it is determined that the image is not a backlight image in the “determination process for determining whether the image is a backlight image”, the “correction process for a normal backlight image” can be performed. .

このようにしてスキャナドライバは、小領域Ry1を占める画素の輝度の平均値Yav1と、画像の全体の輝度の平均値Yav0とに基づき、関係式(A)、(B)から、小領域Ry1を占める画素の輝度の平均値の目標値Ym1と、小領域Ry2を占める画素の輝度の平均値の目標値Ym2とを簡単に取得することができる。   In this way, the scanner driver calculates the small region Ry1 from the relational expressions (A) and (B) based on the average luminance value Yav1 of the pixels occupying the small region Ry1 and the average luminance value Yav0 of the entire image. The target value Ym1 of the average value of the luminance of the occupied pixels and the target value Ym2 of the average value of the luminance of the pixels occupying the small region Ry2 can be easily obtained.

なお、本実施形態では、小領域Ry1を占める画素の輝度の平均値Yav1と、画像の全体の輝度の平均値Yav0とを加算して得られた加算値Saddに基づき、2つの目標値Ym1、Ym2を簡単に取得するために、関係式(A)および(B)には、直線、即ち線形関数が用いられていたが、ここで用いられる関係式(A)および(B)にあっては、必ずしもこのような線形関数が用いられる必要はない。すなわち、関係式(A)および(B)には、非線形関数が用いられても良い。   In the present embodiment, based on the added value Sadd obtained by adding the average luminance value Yav1 of the pixels occupying the small area Ry1 and the average luminance value Yav0 of the entire image, two target values Ym1, In order to easily obtain Ym2, a straight line, that is, a linear function is used in the relational expressions (A) and (B), but in the relational expressions (A) and (B) used here, However, such a linear function is not necessarily used. That is, a nonlinear function may be used in relational expressions (A) and (B).

また、本実施形態では、小領域Ry1を占める画素の輝度の平均値Yav1と、画像の全体の輝度の平均値Yav0とを加算して、これにより得られた加算値Saddに基づき、目標値Ym1、Ym2を取得していたが、目標値Ym1、Ym2を取得するのにあたっては、必ずしもこのような加算値Saddを求める必要はない。すなわち、小領域Ry1を占める画素の輝度の平均値Yav1のみに基づき、目標値を取得しても良く、また、小領域Ry2を占める画素の輝度の平均値Yav2に基づき、目標値を取得しても良い。   In the present embodiment, the average value Yav1 of the luminance of the pixels occupying the small region Ry1 and the average luminance Yav0 of the entire image are added, and the target value Ym1 is obtained based on the addition value Sadd obtained thereby. , Ym2 has been acquired. However, in order to acquire the target values Ym1, Ym2, it is not always necessary to obtain such an added value Sadd. That is, the target value may be acquired based only on the average luminance Yav1 of the pixels occupying the small region Ry1, or the target value may be acquired based on the average luminance Yav2 of the pixels occupying the small region Ry2. Also good.

また、本実施形態では、加算値Saddに基づき、2つの目標値Ym1、Ym2を取得していたが、必ずしもこのように2つの目標値Ym1、Ym2を取得する必要はなく、目標値の数は、1つであっても良く、また3つ以上であっても良い。   In this embodiment, the two target values Ym1 and Ym2 are acquired based on the addition value Sadd. However, it is not always necessary to acquire the two target values Ym1 and Ym2, and the number of target values is as follows. There may be one, or three or more.

(3)補正情報の生成
スキャナドライバは、このようにして取得した2つの目標値Ym1、Ym2に基づき、補正情報を生成する。この補正情報は、画像読み取り装置10により読み取られた画像に対してスキャナドライバが逆光補正処理を施すための情報である。本実施形態では、スキャナドライバが逆光補正処理として前述した「濃度補正」を実行する。このことから、本実施形態では、スキャナドライバが、補正情報として、「濃度補正」における設定情報を生成する。以下に「濃度補正」における設定情報の生成方法について詳しく説明する。
(3) Generation of correction information The scanner driver generates correction information based on the two target values Ym1 and Ym2 acquired in this way. This correction information is information for the scanner driver to perform backlight correction processing on the image read by the image reading device 10. In the present embodiment, the scanner driver executes the above-described “density correction” as the backlight correction process. Therefore, in this embodiment, the scanner driver generates setting information for “density correction” as correction information. A method for generating setting information in “density correction” will be described in detail below.

図27は、補正情報として、「濃度補正」における設定情報の生成方法について説明したものである。ここでは、「濃度補正」のトーンカーブTcを調整することによって、画像読み取り装置10により読み取られた画像に対してスキャナドライバが逆光補正処理を施す。
なお、本実施形態では、「濃度補正」のトーンカーブTcとして、図8にて説明した、RGB(レッド、グリーン、ブルー)全色に対応するトーンカーブTcを調整するものとする。
FIG. 27 illustrates a method for generating setting information in “density correction” as correction information. Here, the scanner driver performs a backlight correction process on the image read by the image reading device 10 by adjusting the tone curve Tc of “density correction”.
In this embodiment, the tone curve Tc corresponding to all the RGB (red, green, and blue) colors described with reference to FIG. 8 is adjusted as the tone curve Tc for “density correction”.

このため、スキャナドライバは、補正情報として、同図に示すように、2つの目標値Ym1、Ym2に基づき、そのトーンカーブTcが通過する任意の3つのポイントPs1、Ps2、Ps3を設定する。そして、スキャナドライバは、これら3つのポイントPs1、Ps2、Ps3を通過するようにトーンカーブTcを調整する。なお、本実施形態では、ポイントPs1は、小領域Ry1に対応して設定される。また、ポイントPs2は、小領域Ry2に対応して設定される。また、ポイントPs3は、小領域Ry3に対応して設定される。また、本実施形態では、ポイントPs1の入力値を『X1』とし、その出力値を『Y1』とする。また、ポイントPs2の入力値を『X2』とし、その出力値を『Y2』とする。また、ポイントPs3の入力値を『X3』とし、その出力値を『Y3』とする。   Therefore, the scanner driver sets arbitrary three points Ps1, Ps2, and Ps3 through which the tone curve Tc passes, based on the two target values Ym1 and Ym2, as correction information, as shown in FIG. Then, the scanner driver adjusts the tone curve Tc so as to pass through these three points Ps1, Ps2, and Ps3. In the present embodiment, the point Ps1 is set corresponding to the small region Ry1. The point Ps2 is set corresponding to the small area Ry2. The point Ps3 is set corresponding to the small area Ry3. In this embodiment, the input value of the point Ps1 is “X1”, and the output value is “Y1”. The input value of the point Ps2 is “X2”, and the output value is “Y2”. The input value of the point Ps3 is “X3”, and the output value is “Y3”.

ここで、3つのポイントPs1、Ps2、Ps3の入力値『X1』、『X2』、『X3』については、入力値が取り得る値、即ち本実施形態では、『0』〜『255』の範囲内の適宜な値に設定されれば良い。しかし、バランスが良いトーンカーブTcを形成するためには、次のように設定するのが好ましい。すなわち、これら3つのポイントPs1、Ps2、Ps3が均等にバランス良く配置されるために、入力値が取り得る値の範囲、即ち『0』〜『255』を3つに区分して各区分の内にそれぞれ、入力値『X1』、『X2』、『X3』が配置されるようにする。すなわち、入力値『X1』は、『0』〜『84』の範囲内に設定する。また、入力値『X2』は、『85』〜『169』の範囲内に設定する。また、入力値『X3』は、『170』〜『255』の範囲内に設定する。   Here, the input values “X1”, “X2”, and “X3” of the three points Ps1, Ps2, and Ps3 are values that the input value can take, that is, in the present embodiment, a range of “0” to “255”. Any suitable value may be set. However, in order to form a well-balanced tone curve Tc, it is preferable to set as follows. That is, since these three points Ps1, Ps2, and Ps3 are arranged equally in a balanced manner, the range of values that the input value can take, that is, “0” to “255” is divided into three, The input values “X1”, “X2”, and “X3” are arranged respectively. That is, the input value “X1” is set within the range of “0” to “84”. The input value “X2” is set within the range of “85” to “169”. Further, the input value “X3” is set within the range of “170” to “255”.

さらに、例えば、入力値『X1』、『X2』、『X3』を各区分内のほぼ中央に位置するように設定すると好ましい。具体的には、本実施形態では、ポイントPs1の入力値『X1』を『42』に設定する。また、ポイントPs2の入力値『X2』を『127』に設定する。また、ポイントPs3の入力値『X3』を『212』に設定する。   Furthermore, for example, it is preferable to set the input values “X1”, “X2”, and “X3” so as to be positioned at the approximate center in each section. Specifically, in this embodiment, the input value “X1” of the point Ps1 is set to “42”. Further, the input value “X2” of the point Ps2 is set to “127”. Further, the input value “X3” of the point Ps3 is set to “212”.

一方、これら3つのポイントPs1、Ps2、Ps3の出力値『Y1』、『Y2』、『Y3』については、本実施形態では、次にように設定する。すなわち、ポイントPs1の出力値『Y1』およびポイントPs2の出力値『Y2』は、2つの目標値Ym1、Ym2に基づき設定される。一方、ポイントPs3の出力値『Y3』は、ポイントPs2と、ポイントPs0とに基づき設定される。ここで、ポイントPs0は、入力値を『255』とし、出力値を『255』として設定されたポイントである。ポイントPs3は、これらポイントPs2と、ポイントPs0との間を結んで設定される直線のほぼ真上に位置するように設定される。すなわち、ポイントPs3の入力値として『X3』が得られると、この入力値『X3』からこれに対応するポイントを、ポイントPs2とポイントPs0とを結ぶ直線上から探し出してポイントPs3として設定することができる。ポイントPs3の出力値『Y3』は、入力値『X3』に対応する出力値として、ポイントPs2とポイントPs0とを結ぶ直線から求めることができる。   On the other hand, the output values “Y1”, “Y2”, and “Y3” of these three points Ps1, Ps2, and Ps3 are set as follows in this embodiment. That is, the output value “Y1” of the point Ps1 and the output value “Y2” of the point Ps2 are set based on the two target values Ym1 and Ym2. On the other hand, the output value “Y3” of the point Ps3 is set based on the point Ps2 and the point Ps0. Here, the point Ps0 is a point set with an input value “255” and an output value “255”. The point Ps3 is set so as to be positioned almost directly above the straight line set between the point Ps2 and the point Ps0. That is, when “X3” is obtained as the input value of the point Ps3, a point corresponding to the input value “X3” is searched for on the straight line connecting the point Ps2 and the point Ps0 and set as the point Ps3. it can. The output value “Y3” of the point Ps3 can be obtained from the straight line connecting the point Ps2 and the point Ps0 as the output value corresponding to the input value “X3”.

ここで、ポイントPs1およびポイントPs2の出力値『Y1』、『Y2』の求め方について説明する。まず、ポイントPs1の出力値『Y1』の求め方について説明する。ポイントPs1は、小領域Ry1に対応して設定されるものである。補正後のヒストグラムの小領域Ry1を占める画素の輝度の平均値Yav1が目標値Ym1になるように、ポイントPs1の出力値『Y1』を設定する。具体的には、次のようにして行う。すなわち、入力値『X1』に対して「濃度補正」を施さなかった場合に得られる出力値を『Yt1』とする。つまり、この出力値『Yt1』は、入力値『X1』と同じ値となる。なお、図27においては、入力値『X1』に対して「濃度補正」を施さなかった場合のポイントを「Pt1」として示している。この出力値『Yt1』に対するポイントPs1の出力値『Y1』の差分ΔYp1を求める。この差分ΔYp1は、次のようにして求めることができる。   Here, how to obtain the output values “Y1” and “Y2” of the points Ps1 and Ps2 will be described. First, how to obtain the output value “Y1” of the point Ps1 will be described. The point Ps1 is set corresponding to the small area Ry1. The output value “Y1” of the point Ps1 is set so that the average value Yav1 of the luminance of the pixels occupying the small area Ry1 of the corrected histogram becomes the target value Ym1. Specifically, this is performed as follows. That is, an output value obtained when “density correction” is not performed on the input value “X1” is “Yt1”. That is, the output value “Yt1” is the same value as the input value “X1”. In FIG. 27, the point when “density correction” is not performed on the input value “X1” is indicated as “Pt1”. A difference ΔYp1 between the output value “Y1” of the point Ps1 and the output value “Yt1” is obtained. This difference ΔYp1 can be obtained as follows.

図28Aは、本実施形態にかかる差分ΔYp1の求める方法について説明したものである。この差分ΔYp1は、本実施形態では、スキャナドライバが求める。スキャナドライバは、まず、同図に示すように、入力値『X1』からこれに対応する出力値『Yt1』を取得する(S502)。なお、この出力値『Yt1』は、ここでは、入力値『X1』と同じ値である。次に、スキャナドライバは、差分ΔYp1を初期値、ここでは『0』に設定する(S504)。そして、スキャナドライバは、差分ΔYp1に対して『1』だけ加算した値を、新たなΔYp1として設定する(S506)。すなわち、ΔYp1が『0』であった場合には、新たなΔYp1は、『1』だけ加算されて『1』となる。   FIG. 28A illustrates a method for obtaining the difference ΔYp1 according to the present embodiment. In the present embodiment, the difference ΔYp1 is obtained by the scanner driver. First, as shown in the figure, the scanner driver obtains an output value “Yt1” corresponding to the input value “X1” (S502). The output value “Yt1” is the same value as the input value “X1” here. Next, the scanner driver sets the difference ΔYp1 to an initial value, here “0” (S504). Then, the scanner driver sets a value obtained by adding “1” to the difference ΔYp1 as a new ΔYp1 (S506). That is, when ΔYp1 is “0”, the new ΔYp1 is added by “1” to become “1”.

そして次に、スキャナドライバは、先に取得した出力値『Yt1』にΔYp1を加算した値をポイントPs1の出力値『Y1』として設定する(S508)。そして、このポイントPs1により設定されるトーンカーブTcに基づき「濃度補正」を実行した場合の補正後の画像のデータを取得する(S510)。なお、ここでは、このときに、図11にて説明したように、「濃度補正」の他に、「ヒストグラム調整」や「イメージ調整」等の各種調整(補正)の内容についても反映されるものとする。   Next, the scanner driver sets a value obtained by adding ΔYp1 to the previously acquired output value “Yt1” as the output value “Y1” of the point Ps1 (S508). Then, image data after correction when “density correction” is executed based on the tone curve Tc set by the point Ps1 is acquired (S510). Here, as described with reference to FIG. 11, the contents of various adjustments (corrections) such as “histogram adjustment” and “image adjustment” are also reflected in addition to “density correction”. And

このようにして補正を行った後、スキャナドライバは、この補正によって得られた画像のデータに基づき、ヒストグラムを生成する(S512)。なお、ここでは、スキャナドライバは、レッド(R)、グリーン(G)およびブルー(B)の3色のヒストグラムの作成を行う。次に、スキャナドライバは、このようにして作成したヒストグラムについて小領域への区分を行う(S514)。すなわち、スキャナドライバは、ここでは、前述したように、ヒストグラムにより表される領域を4つの小領域Ry1、Ry2、Ry3、Ry4に区分する。   After performing the correction in this manner, the scanner driver generates a histogram based on the image data obtained by the correction (S512). Here, the scanner driver creates a histogram of three colors of red (R), green (G), and blue (B). Next, the scanner driver divides the histogram created in this way into small regions (S514). In other words, as described above, the scanner driver divides the region represented by the histogram into four small regions Ry1, Ry2, Ry3, and Ry4.

そして、スキャナドライバは、このようにして区分により得られた4つの領域Ry1、Ry2、Ry3、Ry4の中から、小領域Ry1に関する属性情報を取得する。なお、ここで、スキャナドライバは、小領域Ry1に関する属性情報として、レッド(R)、グリーン(G)及びブルー(B)の各色の濃度値の平均値AVr1、AVg1、AVb1を取得する。そして、スキャナドライバは、取得した各色の濃度値の平均値AVr1、AVg1、AVb1に基づき、小領域Ry1を占める画素の輝度の平均値Yav1を求める(S516)。ここで、スキャナドライバは、例えば、式(7)等により、平均値Yav1を求める。   Then, the scanner driver acquires attribute information related to the small region Ry1 from the four regions Ry1, Ry2, Ry3, and Ry4 obtained in this way. Here, the scanner driver obtains average values AVr1, AVg1, and AVb1 of the density values of each color of red (R), green (G), and blue (B) as attribute information related to the small region Ry1. Then, the scanner driver obtains the average value Yav1 of the luminance of the pixels occupying the small region Ry1 based on the acquired average values AVr1, AVg1, and AVb1 of the density values of the respective colors (S516). Here, the scanner driver obtains the average value Yav1 by, for example, Expression (7).

その後、スキャナドライバは、求めた平均値Yav1と、先に取得した目標値Ym1とを比較する(S518)。ここでは、スキャナドライバは、求めた平均値Yav1が、目標値Ym1以上となったか否かをチェックする。そして、求めた平均値Yav1が目標値Ym1以上となっていなかった場合には、スキャナドライバは、ステップS506へと戻り、再び、差分ΔYp1に対して『1』だけ加算して新たなΔYp1を取得する(S506)。そして、再度、ポイントPs1の出力値『Y1』を取得して(S508)、これに基づき画像の補正を行った後(S510)、ヒストグラムを生成して(S512)、小領域に区分し(S514)、小領域Ry1を占める画素の輝度の平均値Yav1を求める(S516)。その後、求めた平均値Yav1と、目標値Ym1とを比較し、再び、求めた平均値Yav1が目標値Ym1に達しているか否かをチェックする(S518)。スキャナドライバは、求めた平均値Yav1が目標値Ym1に達するまで、このような処理(S506〜S518)を繰り返し行う。すなわち、差分ΔYp1は、求めた平均値Yav1が目標値Ym1に達するまで、順次『1』ずつ加算されて増えることになる。   Thereafter, the scanner driver compares the obtained average value Yav1 with the previously acquired target value Ym1 (S518). Here, the scanner driver checks whether or not the obtained average value Yav1 is equal to or greater than the target value Ym1. If the calculated average value Yav1 is not equal to or greater than the target value Ym1, the scanner driver returns to step S506 and again adds “1” to the difference ΔYp1 to obtain a new ΔYp1. (S506). Then, the output value “Y1” of the point Ps1 is acquired again (S508), the image is corrected based on this (S510), a histogram is generated (S512), and the image is divided into small regions (S514). ), The average value Yav1 of the luminance of the pixels occupying the small region Ry1 is obtained (S516). Thereafter, the obtained average value Yav1 is compared with the target value Ym1, and it is checked again whether or not the obtained average value Yav1 has reached the target value Ym1 (S518). The scanner driver repeats such processing (S506 to S518) until the obtained average value Yav1 reaches the target value Ym1. That is, the difference ΔYp1 is incremented by “1” sequentially until the calculated average value Yav1 reaches the target value Ym1.

そして、求めた平均値Yav1が目標値Ym1に達した場合には、スキャナドライバは、ここで得られた差分ΔYp1に基づき、ポイントPs1の出力値『Y1』を設定する(S520)。すなわち、ここでスキャナドライバは、出力値『Yt1』に差分ΔYp1を加算して得られた値をポイントPs1の出力値『Y1』として設定する。   When the obtained average value Yav1 reaches the target value Ym1, the scanner driver sets the output value “Y1” of the point Ps1 based on the difference ΔYp1 obtained here (S520). In other words, the scanner driver sets the value obtained by adding the difference ΔYp1 to the output value “Yt1” as the output value “Y1” of the point Ps1.

このようにしてスキャナドライバは、補正後のヒストグラムの小領域Ry1を占める画素の輝度の平均値Yav1が目標値Ym1になるようなポイントPs1の出力値『Y1』を設定する。なお、ポイントPs1の出力値『Y1』が出力値『Yt1』よりも小さい値に設定される場合には、スキャナドライバは、ステップS518において、平均値Yav1が目標値Ym1よりも下回ったか否かをチェックすると良い。   In this way, the scanner driver sets the output value “Y1” of the point Ps1 such that the average value Yav1 of the luminance of the pixels occupying the small area Ry1 of the corrected histogram becomes the target value Ym1. When the output value “Y1” of the point Ps1 is set to a value smaller than the output value “Yt1”, the scanner driver determines in step S518 whether or not the average value Yav1 is lower than the target value Ym1. It is good to check.

一方、ポイントPs2の出力値『Y2』についても、ポイントPs1の出力値『Y1』の場合と同様に設定する。つまり、ポイントPs2は、小領域Ry2に対応して設定されるものである。ポイントPs1の場合と同様に、補正後のヒストグラムの小領域Ry2を占める画素の輝度の平均値Yav2が目標値Ym2になるように、ポイントPs2の出力値『Y2』を設定する。要するに、入力値『X2』に対して「濃度補正」を施さなかった場合に得られる出力値を『Yt2』とすると、この出力値『Yt2』に対するポイントPs2の出力値『Y2』の差分ΔYp2を求める。なお、図27においては、入力値『X2』に対して「濃度補正」を施さなかった場合のポイントを「Pt2」として示している。   On the other hand, the output value “Y2” of the point Ps2 is set similarly to the output value “Y1” of the point Ps1. That is, the point Ps2 is set corresponding to the small region Ry2. Similarly to the case of the point Ps1, the output value “Y2” of the point Ps2 is set so that the average value Yav2 of the luminance of the pixels occupying the small area Ry2 of the corrected histogram becomes the target value Ym2. In short, if the output value obtained when “density correction” is not applied to the input value “X2” is “Yt2”, the difference ΔYp2 of the output value “Y2” of the point Ps2 with respect to this output value “Yt2” is obtained. Ask. In FIG. 27, a point when “density correction” is not performed on the input value “X2” is indicated as “Pt2”.

図28Bは、本実施形態にかかる差分ΔYp2の求める方法について説明したものである。なお、この差分ΔYp2についても、ポイントPs1の場合と同様に、スキャナドライバが求める。スキャナドライバは、まず、同図に示すように、入力値『X2』からこれに対応する出力値『Yt2』を取得する(S552)。なお、この出力値『Yt2』は、ここでは、入力値『X2』と同じ値となる。次に、スキャナドライバは、差分ΔYp2を初期値、ここでは『0』に設定する(S554)。そして、スキャナドライバは、差分ΔYp2に対して『1』だけ加算した値を、新たなΔYp2として設定する(S556)。   FIG. 28B illustrates a method for obtaining the difference ΔYp2 according to the present embodiment. The difference ΔYp2 is also obtained by the scanner driver as in the case of the point Ps1. The scanner driver first obtains an output value “Yt2” corresponding to the input value “X2” as shown in FIG. The output value “Yt2” is the same value as the input value “X2” here. Next, the scanner driver sets the difference ΔYp2 to an initial value, here “0” (S554). Then, the scanner driver sets a value obtained by adding “1” to the difference ΔYp2 as a new ΔYp2 (S556).

そして次に、スキャナドライバは、先に取得した出力値『Yt2』にΔYp2を加算した値をポイントPs2の出力値『Y2』として設定する(S558)。そして、このポイントPs2により設定されるトーンカーブTcに基づき「濃度補正」を実行した場合の補正後の画像のデータを取得する(S560)。なお、ここでは、このときに、図11にて説明したように、「濃度補正」の他に、「ヒストグラム調整」や「イメージ調整」等の各種調整(補正)の内容についても反映されるものとする。また、ここでは、スキャナドライバは、ポイントPs1の設定内容を反映させても反映させなくてもどちらでも構わない。   Next, the scanner driver sets a value obtained by adding ΔYp2 to the previously acquired output value “Yt2” as the output value “Y2” of the point Ps2 (S558). Then, image data after correction when “density correction” is executed based on the tone curve Tc set by the point Ps2 is acquired (S560). Here, as described with reference to FIG. 11, the contents of various adjustments (corrections) such as “histogram adjustment” and “image adjustment” are also reflected in addition to “density correction”. And Here, the scanner driver may or may not reflect the setting content of the point Ps1.

このようにして補正を行った後、スキャナドライバは、この補正によって得られた画像のデータに基づき、ヒストグラムを生成する(S562)。なお、ここでスキャナドライバは、レッド(R)、グリーン(G)およびブルー(B)の3色のヒストグラムの作成を行う。次に、スキャナドライバは、このようにして作成したヒストグラムについて4つの小領域Ry1、Ry2、Ry3、Ry4に区分する(S564)。   After correcting in this way, the scanner driver generates a histogram based on the image data obtained by this correction (S562). Here, the scanner driver creates a histogram of three colors of red (R), green (G), and blue (B). Next, the scanner driver divides the histogram created in this way into four small regions Ry1, Ry2, Ry3, and Ry4 (S564).

そして、スキャナドライバは、このようにして区分により得られた4つの領域Ry1、Ry2、Ry3、Ry4の中から、小領域Ry2に関する属性情報を取得する。なお、ここで、スキャナドライバは、小領域Ry2に関する属性情報として、レッド(R)、グリーン(G)及びブルー(B)の各色の濃度値の平均値AVr2、AVg2、AVb2を取得する。そして、スキャナドライバは、取得した各色の濃度値の平均値AVr2、AVg2、AVb2に基づき、小領域Ry2を占める画素の輝度の平均値Yav2を求める(S566)。ここで、スキャナドライバは、例えば、式(8)等により、平均値Yav2を求める。   Then, the scanner driver acquires attribute information related to the small region Ry2 from the four regions Ry1, Ry2, Ry3, and Ry4 obtained in this way. Here, the scanner driver obtains the average values AVr2, AVg2, and AVb2 of the density values of each color of red (R), green (G), and blue (B) as attribute information related to the small region Ry2. Then, the scanner driver obtains the average value Yav2 of the luminance of the pixels occupying the small area Ry2 based on the acquired average values AVr2, AVg2, and AVb2 of the density values of the respective colors (S566). Here, the scanner driver obtains the average value Yav2 by, for example, Equation (8).

その後、スキャナドライバは、求めた平均値Yav2と、先に取得した目標値Ym2とを比較する(S568)。ここで、求めた平均値Yav2が目標値Ym2に達していなかった場合には、スキャナドライバは、ステップS556へと戻り、再び、『1』加算して新たなΔYp2を取得して(S556)、ポイントPs2の出力値『Y2』を取得して(S558)、これに基づき画像の補正を行う(S560)。そして、スキャナドライバは、補正後の画像のヒストグラムを生成して(S562)、4つの小領域に区分し(S564)、平均値Yav2を再び取得する(S566)。その後、取得した平均値Yav2と、目標値Ym2とを比較し、再び、求めた平均値Yav2が目標値Ym2に達しているか否かをチェックする(S568)。スキャナドライバは、求めた平均値Yav2が目標値Ym2に達するまで、このような処理(S556〜S568)を繰り返し行う。すなわち、差分ΔYp2は、求めた平均値Yav2が目標値Ym2に達するまで、順次『1』ずつ加算されて増えることになる。   Thereafter, the scanner driver compares the obtained average value Yav2 with the previously obtained target value Ym2 (S568). Here, if the obtained average value Yav2 has not reached the target value Ym2, the scanner driver returns to step S556, adds “1” again to obtain a new ΔYp2 (S556), and The output value “Y2” of the point Ps2 is acquired (S558), and based on this, the image is corrected (S560). Then, the scanner driver generates a histogram of the corrected image (S562), divides it into four small regions (S564), and obtains the average value Yav2 again (S566). Thereafter, the acquired average value Yav2 is compared with the target value Ym2, and it is checked again whether or not the obtained average value Yav2 has reached the target value Ym2 (S568). The scanner driver repeats such processing (S556 to S568) until the obtained average value Yav2 reaches the target value Ym2. That is, the difference ΔYp2 is incremented by “1” sequentially until the obtained average value Yav2 reaches the target value Ym2.

そして、スキャナドライバは、求めた平均値Yav2が目標値Ym2に達した場合には、ここで得られた差分ΔYp2に基づき、ポイントPs2の出力値『Y2』を設定する(S570)。すなわち、ここでスキャナドライバは、出力値『Yt2』に差分ΔYp2を加算して得られた値をポイントPs2の出力値『Y2』として設定する。   When the obtained average value Yav2 reaches the target value Ym2, the scanner driver sets the output value “Y2” of the point Ps2 based on the difference ΔYp2 obtained here (S570). In other words, the scanner driver sets the value obtained by adding the difference ΔYp2 to the output value “Yt2” as the output value “Y2” of the point Ps2.

このようにしてスキャナドライバは、補正後のヒストグラムの小領域Ry2を占める画素の輝度の平均値Yav2が目標値Ym2になるようなポイントPs2の出力値『Y2』を設定する。なお、ポイントPs2の出力値『Y2』が出力値『Yt2』よりも小さい値に設定される場合には、スキャナドライバは、ステップS568において、平均値Yav2が目標値Ym2以下となったか否かをチェックすると良い。   In this way, the scanner driver sets the output value “Y2” of the point Ps2 such that the average value Yav2 of the luminance of the pixels occupying the small area Ry2 of the corrected histogram becomes the target value Ym2. When the output value “Y2” of the point Ps2 is set to a value smaller than the output value “Yt2”, the scanner driver determines in step S568 whether or not the average value Yav2 is equal to or less than the target value Ym2. It is good to check.

なお、ポイントPs3の出力値『Y3』は、先に説明したように、入力値『X3』に対応する出力値として、ポイントPs2とポイントPs0とを結ぶ直線から求めることができる。   Note that the output value “Y3” of the point Ps3 can be obtained from the straight line connecting the point Ps2 and the point Ps0 as the output value corresponding to the input value “X3” as described above.

(4)入力値X1、X2、X3の他の設定方法
前述した3つのポイントPs1、Ps2、Ps3の各入力値『X1』、『X2』、『X3』の他の設定方法としては、次のような方法がある。すなわち、例えば、小領域Ry1、Ry2、Ry3を占める画素の輝度の平均値Yav1、Yav2、Yav3を考慮して設定しても良い。つまり、これら3つのポイントPs1、Ps2、Ps3の入力値『X1』、『X2』、『X3』を小領域Ry1、Ry2、Ry3を占める画素の輝度の平均値Yav1、Yav2、Yav3に反映させる。具体的には、次のような設定方法がある。
(4) Other setting methods of the input values X1, X2, and X3 Other setting methods of the input values “X1”, “X2”, and “X3” of the three points Ps1, Ps2, and Ps3 described above are as follows: There are methods. That is, for example, the average luminance values Yav1, Yav2, and Yav3 of the pixels that occupy the small areas Ry1, Ry2, and Ry3 may be set. That is, the input values “X1”, “X2”, and “X3” of these three points Ps1, Ps2, and Ps3 are reflected in the average luminance values Yav1, Yav2, and Yav3 of the pixels that occupy the small regions Ry1, Ry2, and Ry3. Specifically, there are the following setting methods.

図29A〜図29Cは、3つの小領域Ry1、Ry2、Ry3を占める画素の輝度の平均値Yav1、Yav2、Yav3を反映して、3つの入力値『X1』、『X2』、『X3』を設定する場合の一例を説明したものである。図29Aは、ポイントPs1の入力値『X1』の設定方法を説明したものである。図29Bは、ポイントPs2の入力値『X2』の設定方法を説明したものである。図29Cは、ポイントPs3の入力値『X3』の設定方法を説明したものである。   29A to 29C reflect three input values “X1”, “X2”, and “X3”, reflecting the average luminance values Yav1, Yav2, and Yav3 of the pixels that occupy the three small regions Ry1, Ry2, and Ry3. An example of setting is described. FIG. 29A illustrates a method for setting the input value “X1” of the point Ps1. FIG. 29B illustrates a method for setting the input value “X2” of the point Ps2. FIG. 29C illustrates a method of setting the input value “X3” of the point Ps3.

ポイントPs1の入力値『X1』を設定する場合には、図29Aに示すように、入力値『X1』が設定される『0』〜『84』の範囲内に、所定の対象範囲『a1』〜『b1』を設定する。この所定の対象範囲『a1』〜『b1』は、『0』〜『84』の間のほぼ中央に設定される。『a1』および『b1』は、それぞれ『0』〜『84』の間の適当な値に設定される。このようにして設定された所定の対象範囲『a1』〜『b1』を256等分して、『0』〜『255』の値を割り振り、小領域Ry1を占める画素の輝度の平均値Yav1が対応するポイントPk1を特定する。そして、このポイントPk1に対応する、『0』〜『84』の間の値を求める。この求めた値をポイントPs1の入力値『X1』として設定する。   When the input value “X1” of the point Ps1 is set, as shown in FIG. 29A, a predetermined target range “a1” within the range of “0” to “84” in which the input value “X1” is set. ~ “B1” is set. The predetermined target ranges “a1” to “b1” are set to approximately the center between “0” to “84”. “A1” and “b1” are set to appropriate values between “0” and “84”, respectively. The predetermined target ranges “a1” to “b1” set in this way are divided into 256 equal parts, and values “0” to “255” are allocated, and the average value Yav1 of the luminance of the pixels occupying the small region Ry1 is obtained. The corresponding point Pk1 is specified. Then, a value between “0” and “84” corresponding to the point Pk1 is obtained. The obtained value is set as the input value “X1” of the point Ps1.

また、ポイントPs2の入力値『X2』を設定する場合には、図29Bに示すように、入力値『X2』が設定される『85』〜『169』の範囲内に、所定の対象範囲『a2』〜『b2』を設定する。この所定の対象範囲『a2』〜『b2』は、『85』〜『169』の間のほぼ中央に設定される。『a2』および『b2』は、それぞれ『85』〜『169』の間の適当な値に設定される。このようにして設定された所定の対象範囲『a2』〜『b2』を256等分して、『0』〜『255』の値を割り振り、小領域Ry2を占める画素の輝度の平均値Yav2が対応するポイントPk2を特定する。そして、このポイントPk2に対応する、『85』〜『169』の間の値を求める。この求めた値をポイントPs2の入力値『X2』として設定する。   When the input value “X2” of the point Ps2 is set, as shown in FIG. 29B, the predetermined target range “8” is set within the range of “85” to “169” where the input value “X2” is set. “a2” to “b2” are set. The predetermined target ranges “a2” to “b2” are set to approximately the center between “85” to “169”. “A2” and “b2” are set to appropriate values between “85” and “169”, respectively. The predetermined target ranges “a2” to “b2” set in this way are divided into 256 equal parts, and values “0” to “255” are allocated, and the average value Yav2 of the luminance of the pixels occupying the small area Ry2 is obtained. The corresponding point Pk2 is specified. Then, a value between “85” and “169” corresponding to the point Pk2 is obtained. The obtained value is set as the input value “X2” of the point Ps2.

また、ポイントPs3の入力値『X3』を設定する場合には、図29Cに示すように、入力値『X3』が設定される『170』〜『255』の範囲内に、所定の対象範囲『a3』〜『b3』を設定する。この所定の対象範囲『a3』〜『b3』は、『170』〜『255』の間のほぼ中央に設定される。『a3』および『b3』は、それぞれ『170』〜『255』の間の適当な値に設定される。このようにして設定された所定の対象範囲『a3』〜『b3』を256等分して、『0』〜『255』の値を割り振り、小領域Ry3を占める画素の輝度の平均値Yav3が対応するポイントPk3を特定する。そして、このポイントPk3に対応する、『170』〜『255』の間の値を求める。この求めた値をポイントPs3の入力値『X3』として設定する。   When the input value “X3” of the point Ps3 is set, as shown in FIG. 29C, a predetermined target range “in the range of“ 170 ”to“ 255 ”where the input value“ X3 ”is set. “a3” to “b3” are set. The predetermined target ranges “a3” to “b3” are set to approximately the center between “170” to “255”. “A3” and “b3” are set to appropriate values between “170” and “255”, respectively. The predetermined target ranges “a3” to “b3” set in this way are divided into 256 equal parts, and values “0” to “255” are allocated, and the average value Yav3 of the luminance of the pixels occupying the small region Ry3 is obtained. The corresponding point Pk3 is specified. Then, a value between “170” and “255” corresponding to the point Pk3 is obtained. The obtained value is set as the input value “X3” of the point Ps3.

このように小領域Ry1、Ry2、Ry3を占める画素の輝度の平均値Yav1、Yav2、Yav3を反映して、3つのポイントPs1、Ps2、Ps3の各入力値『X1』、『X2』、『X3』を設定する際に、所定の対象範囲『a1』〜『b1』、『a2』〜『b2』、『a3』〜『b3』を設定するのは、次の理由からである。すなわち、小領域Ry1、Ry2、Ry3を占める画素の輝度の平均値Yav1、Yav2、Yav3をそのまま、入力値『X1』、『X2』、『X3』として設定した場合には、入力値『X1』、『X2』、『X3』が取り得る値の範囲が広くなり、このため、調整されるトーンカーブTcに大きな影響を与えてしまう虞があるからである。   In this way, the input values “X1”, “X2”, “X3” of the three points Ps1, Ps2, and Ps3 are reflected reflecting the average values Yav1, Yav2, and Yav3 of the luminance of the pixels that occupy the small regions Ry1, Ry2, and Ry3. ”Is set for predetermined reasons“ a1 ”to“ b1 ”,“ a2 ”to“ b2 ”, and“ a3 ”to“ b3 ”for the following reason. That is, when the average values Yav1, Yav2, and Yav3 of the pixels occupying the small regions Ry1, Ry2, and Ry3 are set as input values “X1”, “X2”, and “X3” as they are, the input value “X1” This is because the range of values that can be taken by “X2” and “X3” is widened, and thus there is a possibility that the tone curve Tc to be adjusted may be greatly affected.

つまり、例えば、小領域Ry1を占める画素の輝度の平均値Yav1が非常に小さかったとする。当該平均値Yav1をそのままポイントPs1の入力値『X1』として設定して、図27上のトーンカーブTcにおいてポイントPs1を設定した場合、ポイントPs1の位置が図中左側へと移動して縦軸に接近するため、トーンカーブTcの立上りが非常に急峻となってしまう。また、小領域Ry1を占める画素の輝度の平均値Yav1が非常に大きかった場合には、ポイントPs1の位置が図中右側へと移動してポイントPs2に接近するため、トーンカーブTcの形状が歪んでしまう虞がある。この点に関しては、ポイントPs2、Ps3の場合についても同様である。   In other words, for example, it is assumed that the average luminance value Yav1 of the pixels occupying the small region Ry1 is very small. When the average value Yav1 is set as the input value “X1” of the point Ps1 as it is and the point Ps1 is set in the tone curve Tc on FIG. 27, the position of the point Ps1 moves to the left side in the figure and moves to the vertical axis. Because of the approach, the rise of the tone curve Tc becomes very steep. When the average luminance value Yav1 of the pixels occupying the small region Ry1 is very large, the position of the point Ps1 moves to the right side in the drawing and approaches the point Ps2, so that the shape of the tone curve Tc is distorted. There is a risk of it. The same applies to points Ps2 and Ps3.

そこで、ポイントPs1、Ps2、Ps3の位置が相互に接近し過ぎないようにするために、所定の対象範囲を規定する各値、即ち『a1』、『b1』、『a2』、『b2』、『a3』、『b3』をそれぞれ適宜な値に設定することで、トーンカーブTcの形状が歪にならないようにすることができる。   Therefore, in order to prevent the positions of the points Ps1, Ps2, and Ps3 from being too close to each other, each value that defines a predetermined target range, that is, “a1”, “b1”, “a2”, “b2”, By setting “a3” and “b3” to appropriate values, the shape of the tone curve Tc can be prevented from being distorted.

このようにしてスキャナドライバは、取得した2つの目標値Ym1、Ym2に基づき、補正情報として、「濃度補正」におけるトーンカーブTcを調整するための3つのポイントPs1、Ps2、Ps3を設定するための情報を生成する。   In this way, the scanner driver sets three points Ps1, Ps2, and Ps3 for adjusting the tone curve Tc in “density correction” as correction information based on the two target values Ym1 and Ym2 acquired. Generate information.

なお、本実施形態では、補正情報として3つのポイントPs1、Ps2、Ps3が設定されていたが、必ずしもこのように補正情報として3つのポイントPs1、Ps2、Ps3が設定されなくても良い。すなわち、補正情報として設定されるポイントの数としては、1つまたは2つであってもよく、さらに、4つ以上であっても構わない。設定されるポイントの数としては、レッド(R)、グリーン(G)およびブルー(B)の3色のヒストグラムにより表される領域を区分して得られる小領域の数に応じて適宜設定しても良く、また、属性情報を取得するために選出される小領域の数に応じて適宜設定しても良い。   In the present embodiment, the three points Ps1, Ps2, and Ps3 are set as the correction information. However, the three points Ps1, Ps2, and Ps3 are not necessarily set as the correction information. That is, the number of points set as correction information may be one or two, and may be four or more. The number of points to be set is appropriately set according to the number of small regions obtained by dividing the region represented by the three-color histogram of red (R), green (G), and blue (B). Alternatively, it may be set as appropriate according to the number of small areas selected to acquire the attribute information.

また、補正情報として設定される3つのポイントPs1、Ps2、Ps3にあっては、入力値が取り得る値の範囲、即ち本実施形態では『0』〜『255』を3つに区分して各区分の内にそれぞれ配置されるようにしなくても良い。   In addition, for the three points Ps1, Ps2, and Ps3 set as correction information, ranges of values that can be taken by the input value, that is, “0” to “255” in this embodiment are divided into three. It does not have to be arranged in each section.

また、本実施形態では、逆光補正処理として「濃度補正」が実行される関係により、補正情報として、「濃度補正」におけるトーンカーブTcを調整する3つのポイントPs1、Ps2、Ps3の設定情報を生成していたが、必ずしもこのような設定情報を補正情報として生成する必要はない。すなわち、逆光補正処理として実行される処理に応じて適切な情報を補正情報として生成すれば良い。   In the present embodiment, setting information of three points Ps1, Ps2, and Ps3 for adjusting the tone curve Tc in “density correction” is generated as correction information because of the relationship in which “density correction” is executed as the backlight correction processing. However, it is not always necessary to generate such setting information as correction information. That is, appropriate information may be generated as correction information in accordance with processing executed as backlight correction processing.

<逆光補正処理>
そして、スキャナドライバは、このようにして補正情報として生成した、「濃度補正」におけるトーンカーブTcを調整するための3つのポイントPs1、Ps2、Ps3に関する情報に基づき、画像読み取り装置10により読み取られた画像に対して逆光補正処理を施す。具体的には、図11にて説明した調整手順における「濃度補正」において、補正情報として生成された3つのポイントPs1、Ps2、Ps3に関する情報に基づき調整されたトーンカーブTcに基づき、画像読み取り装置10により読み取られた画像を構成する各画素のデータの各色の濃度値を変換する。これによって、スキャナドライバは、画像読み取り装置10により読み取られた画像に対して逆光補正処理を施す。
<Backlight correction processing>
The scanner driver is read by the image reading device 10 based on the information regarding the three points Ps1, Ps2, and Ps3 for adjusting the tone curve Tc in the “density correction” generated as correction information in this way. Backlight correction processing is performed on the image. Specifically, in the “density correction” in the adjustment procedure described with reference to FIG. 11, the image reading device is based on the tone curve Tc adjusted based on the information about the three points Ps1, Ps2, and Ps3 generated as the correction information. The density value of each color of the data of each pixel constituting the image read by 10 is converted. As a result, the scanner driver performs backlight correction processing on the image read by the image reading device 10.

なお、ここで逆光補正処理が施される画像は、図11に示す調整手順に従って、既にヒストグラム調整やイメージ調整((3)彩度の調整を除く)等が施された画像である。スキャナドライバは、このようにして既にヒストグラム調整やイメージ調整((3)彩度の調整を除く)等が施された画像に対して「濃度補正」により逆光補正処理を施す。   Here, the image subjected to the backlight correction processing is an image that has already been subjected to histogram adjustment, image adjustment (excluding (3) saturation adjustment), and the like according to the adjustment procedure shown in FIG. The scanner driver performs backlight correction processing by “density correction” on an image that has already been subjected to histogram adjustment, image adjustment (excluding (3) saturation adjustment), and the like in this way.

===中間調の色バランスが崩れた逆光画像の補正===
次に、「中間調の色バランスが崩れた逆光画像のための補正処理」について説明する。この補正処理は、「中間調の色バランスが崩れた画像であるか否かの判定処理」において中間調の色バランスが崩れた画像であると判定された場合に実施される。
=== Correction of Backlight Image with Halftone Color Balance Loss ===
Next, “correction processing for a backlight image in which the halftone color balance is lost” will be described. This correction process is performed when it is determined in the “determination process whether or not the image has a halftone color balance collapsed” that the image has a halftone color balance collapsed.

この補正処理は、図13にて説明した手順にて実施される。ただし、ここでは、スキャナドライバは、先の「逆光画像の判定」にて生成したRGB各色のヒストグラムを用いて補正処理を実施する。すなわち、「通常の逆光画像に対する補正処理」の場合と同様に、先の「逆光画像の判定」にて生成したRGB各色のヒストグラムにおいて区分して得られた4つの小領域Ry1、Ry2、Ry3、Ry4のうちの3つの小領域Ry1、Ry2、Ry3からそれぞれ属性情報を取得して、その取得した属性情報に基づき、「中間調の色バランスが崩れた逆光画像のための補正処理」を実施するための補正情報を生成して、この補正情報に基づき画像に対して補正処理を施す。以下にその補正方法について詳しく説明する。   This correction process is performed according to the procedure described with reference to FIG. However, here, the scanner driver performs correction processing using the histogram of each color of RGB generated in the above-mentioned “backlight image determination”. That is, as in the case of “correction processing for a normal backlight image”, four small regions Ry1, Ry2, Ry3 obtained by segmentation in the histogram of each color of RGB generated in the previous “determination of backlight image”, Attribute information is acquired from each of the three small areas Ry1, Ry2, and Ry3 of Ry4, and “correction processing for a backlight image in which a halftone color balance is lost” is performed based on the acquired attribute information. Correction information is generated, and an image is corrected based on the correction information. The correction method will be described in detail below.

<属性情報の取得>
スキャナドライバは、まず、先の「逆光画像の判定」にて生成したRGB各色のヒストグラムにおいて区分して得られた4つの小領域Ry1、Ry2、Ry3、Ry4のうちの3つの小領域Ry1、Ry2、Ry3からそれぞれ属性情報を取得する。ここで、属性情報としては、「通常の逆光画像の補正」の場合と同様に、RGB各色のヒストグラムから3つの小領域Ry1、Ry2、Ry3を占める画素の濃度値の平均値AVr1、AVr2、AVr3、AVg1、AVg2、AVg3、AVb1、AVb2、AVb3をそれぞれ取得する。
<Acquisition of attribute information>
First, the scanner driver performs three small areas Ry1, Ry2, Ry1, Ry3, Ry4 out of the four small areas Ry1, Ry2, Ry3, Ry4 obtained by segmenting in the histogram for each of the RGB colors generated in the above-mentioned “backlight image determination”. , Ry3 respectively to obtain attribute information. Here, as the attribute information, the average values AVr1, AVr2, and AVr3 of the density values of the pixels that occupy the three small regions Ry1, Ry2, and Ry3 from the histogram of each color of RGB are the same as in the case of “normal backlight image correction”. , AVg1, AVg2, AVg3, AVb1, AVb2, and AVb3 are obtained.

<補正情報の生成>
その後、スキャナドライバは、取得した平均値AVr1、AVr2、AVr3、AVg1、AVg2、AVg3、AVb1、AVb2、AVb3に基づき、中間調の色バランスが崩れた逆光画像に対して補正処理を施すための補正情報を生成する。以下に本実施形態における補正情報の生成方法について説明する。
<Generation of correction information>
After that, the scanner driver performs correction for correcting the backlight image in which the halftone color balance is lost based on the acquired average values AVr1, AVr2, AVr3, AVg1, AVg2, AVg3, AVb1, AVb2, and AVb3. Generate information. Hereinafter, a correction information generation method according to the present embodiment will be described.

(1)輝度に関する情報の取得
ここで、スキャナドライバは、「通常の逆光画像の補正」の場合と同様に、取得した平均値AVr1、AVr2、AVr3、AVg1、AVg2、AVg3、AVb1、AVb2、AVb3に基づき、3つの小領域Ry1、Ry2、Ry3についてそれぞれ各領域Ry1、Ry2、Ry3を占める画素の輝度の平均値Yav1、Yav2、Yav3を取得する。このとき、スキャナドライバは、例えば、先の式(10)〜(12)等を用いる。また、スキャナドライバは、取得した輝度の平均値Yav1、Yav2、Yav3に基づき、画像読み取り装置10により読み取った画像の全体の輝度の平均値Yav0を求める。このとき、スキャナドライバは、例えば、先の式(13)等を用いる。
(1) Acquisition of Information on Luminance Here, the scanner driver obtains the average values AVr1, AVr2, AVr3, AVg1, AVg2, AVg3, AVb1, AVb2, AVb3 as in the case of “normal backlight image correction”. Based on the above, for the three small regions Ry1, Ry2, and Ry3, average values Yav1, Yav2, and Yav3 of the luminance of the pixels that occupy the regions Ry1, Ry2, and Ry3 are obtained. At this time, the scanner driver uses, for example, the above formulas (10) to (12). Further, the scanner driver obtains the average luminance value Yav0 of the entire image read by the image reading device 10 based on the acquired average luminance values Yav1, Yav2, and Yav3. At this time, the scanner driver uses the above equation (13), for example.

(2)目標値の取得
次に、スキャナドライバは、取得した3つの小領域Ry1、Ry2、Ry3を占める画素の輝度の平均値Yav1、Yav2、Yav3と、画像の全体の輝度の平均値Yav0とに基づき、目標値を取得する。この目標値は、中間調の色バランスが崩れた逆光画像に対して補正処理を実行するために取得される値であり、その補正処理の概要を決定する上で指標となる値である。本実施形態では、中間調の色バランスが崩れた逆光画像を補正するために、この目標値として、2つの目標値Ym1、Ym2が取得される。これらのうち、目標値Ym1は、小領域Ry1に対応して取得されたものである。また、目標値Ym2は、小領域Ry2に対応して取得されたものである。なお、ここで小領域Ry2は、「選出小領域」に相当する。
(2) Acquisition of Target Value Next, the scanner driver obtains the average luminance values Yav1, Yav2, and Yav3 of the pixels that occupy the three small regions Ry1, Ry2, and Ry3 and the average luminance value Yav0 of the entire image. Based on the above, the target value is obtained. This target value is a value acquired for executing the correction process on the backlight image in which the halftone color balance is lost, and is a value serving as an index in determining the outline of the correction process. In the present embodiment, two target values Ym1 and Ym2 are acquired as the target values in order to correct a backlight image whose halftone color balance has been lost. Among these, the target value Ym1 is acquired corresponding to the small region Ry1. Further, the target value Ym2 is acquired corresponding to the small region Ry2. Here, the small area Ry2 corresponds to a “selected small area”.

これら2つの目標値Ym1、Ym2は、「通常の逆光画像の補正」の場合と同様に、小領域Ry1を占める画素の輝度の平均値Yav1と、画像の全体の輝度の平均値Yav0とを加算して得られた加算値Saddに基づき、図26に示す関係式(A)、(B)により取得される。すなわち、目標値Ym1は、関係式(A)から加算値Saddに対応する値として取得される。また、目標値Ym2は、関係式(B)から加算値Saddに対応する値として取得される。   These two target values Ym1 and Ym2 are obtained by adding the average value Yav1 of the luminance of the pixels occupying the small region Ry1 and the average value Yav0 of the entire luminance of the image as in the case of “normal backlight image correction”. Based on the added value Sadd obtained in this way, the relational expressions (A) and (B) shown in FIG. That is, the target value Ym1 is acquired as a value corresponding to the added value Sadd from the relational expression (A). The target value Ym2 is acquired as a value corresponding to the added value Sadd from the relational expression (B).

(3)補正情報の生成
スキャナドライバは、このようにして取得した2つの目標値Ym1、Ym2に基づき、補正情報を生成する。この補正情報は、中間調の色バランスが崩れた逆光画像に対して適切な補正処理を施すための情報である。本実施形態では、スキャナドライバが、中間調の色バランスが崩れた逆光画像に対する補正処理として、「通常の逆光画像の補正」の場合と同様に、前述した「濃度補正」を実行する。このことから、本実施形態では、スキャナドライバが、補正情報として、「濃度補正」における設定情報を生成する。以下にこの設定情報の生成方法について詳しく説明する。
(3) Generation of correction information The scanner driver generates correction information based on the two target values Ym1 and Ym2 acquired in this way. This correction information is information for performing an appropriate correction process on the backlight image in which the halftone color balance is lost. In this embodiment, the scanner driver performs the above-described “density correction” as the correction process for the backlight image in which the halftone color balance is lost, as in the case of “normal backlight image correction”. Therefore, in this embodiment, the scanner driver generates setting information for “density correction” as correction information. A method for generating the setting information will be described in detail below.

スキャナドライバは、中間調の色バランスが崩れた逆光画像に対して「濃度補正」を実行するために、図8にて説明した、レッド(R)、グリーン(G)およびブルー(B)の各色のトーンカーブTcr、Tcg、Tcbをそれぞれ個別に調整する。ここで、スキャナドライバは、レッド(R)、グリーン(G)およびブルー(B)の各色のトーンカーブTcr、Tcg、Tcbをそれぞれ、取得した2つの目標値Ym1、Ym2に基づき調整する。2つの目標値Ym1、Ym2は、RGB各色のトーンカーブTcr、Tcg、Tcbを調整するにあたって、各色共通の目標値として用いられる。2つの目標値Ym1、Ym2に基づき、RGB各色のトーンカーブTcr、Tcg、Tcbを調整する方法としては、図27にて説明した「通常の逆光画像の補正」の場合と同様な方法を採用する。   The scanner driver performs each “red (R)”, “green (G)”, and “blue (B)” color described with reference to FIG. 8 in order to execute “density correction” on the backlight image whose halftone color balance is lost. Tone curves Tcr, Tcg, and Tcb are individually adjusted. Here, the scanner driver adjusts the tone curves Tcr, Tcg, and Tcb of each color of red (R), green (G), and blue (B) based on the acquired two target values Ym1 and Ym2. The two target values Ym1 and Ym2 are used as target values common to the respective colors when adjusting the tone curves Tcr, Tcg, and Tcb of the respective RGB colors. As a method for adjusting the tone curves Tcr, Tcg, and Tcb of each of the RGB colors based on the two target values Ym1 and Ym2, the same method as in the case of “normal backlight image correction” described in FIG. 27 is adopted. .

図30は、レッド(R)のトーンカーブTcrを2つの目標値Ym1、Ym2に基づき調整する方法について説明したものである。ここでは、レッド(R)のトーンカーブTcrの調整方法を例にして説明する。   FIG. 30 illustrates a method of adjusting the red (R) tone curve Tcr based on the two target values Ym1 and Ym2. Here, a method for adjusting the red (R) tone curve Tcr will be described as an example.

スキャナドライバは、補正情報として、同図に示すように、2つの目標値Ym1、Ym2に基づき、そのトーンカーブTcrが通過する3つのポイントPr1、Pr2、Pr3を設定する。ポイントPr1は、小領域Ry1に対応して設定され、ポイントPr2は、小領域Ry2に対応して設定され、ポイントPr3は、小領域Ry3に対応して設定される。ポイントPr1、Pr2、Pr3の入力値をそれぞれ『Xr1』、『Xr2』、『Xr3』とする。また、ポイントPr1、Pr2、Pr3の出力値をそれぞれ『Yr1』、『Yr2』、『Yr3』とする。ここで、ポイントPr1、Pr2、Pr3の入力値『Xr1』、『Xr2』、『Xr3』は、図27にて説明したポイントPs1、Ps2、Ps3の入力値『X1』、『X2』、『X3』と同じ方法により設定する。   As shown in the figure, the scanner driver sets three points Pr1, Pr2, and Pr3 through which the tone curve Tcr passes based on the two target values Ym1 and Ym2 as correction information. The point Pr1 is set corresponding to the small area Ry1, the point Pr2 is set corresponding to the small area Ry2, and the point Pr3 is set corresponding to the small area Ry3. The input values of the points Pr1, Pr2, and Pr3 are “Xr1”, “Xr2”, and “Xr3”, respectively. In addition, the output values of the points Pr1, Pr2, and Pr3 are “Yr1”, “Yr2”, and “Yr3”, respectively. Here, the input values “Xr1”, “Xr2”, and “Xr3” of the points Pr1, Pr2, and Pr3 are the input values “X1”, “X2”, and “X3” of the points Ps1, Ps2, and Ps3 described in FIG. Set in the same way as

一方、ポイントPr1、Pr2の出力値『Yr1』、『Yr2』は、2つの目標値Ym1、Ym2に基づき設定する。また、ポイントPr3の出力値『Yr3』は、ポイントPr2と、ポイントPr0とを結ぶ直線上に設定される。ポイントPr0は、入力値を『255』とし、出力値を『255』としたポイントである。ポイントPr0の入力値『Xr3』が決定されれば、出力値『Yr3』を求めることができる。   On the other hand, the output values “Yr1” and “Yr2” of the points Pr1 and Pr2 are set based on the two target values Ym1 and Ym2. The output value “Yr3” of the point Pr3 is set on a straight line connecting the point Pr2 and the point Pr0. The point Pr0 is a point where the input value is “255” and the output value is “255”. If the input value “Xr3” of the point Pr0 is determined, the output value “Yr3” can be obtained.

ポイントPr1、Pr2の出力値『Yr1』、『Yr2』は、「通常の逆光画像の補正」の場合と同様な方法により求める。すなわち、例えば、ポイントPr1の出力値『Yr1』の場合には、補正後のレッド(R)のヒストグラムの小領域Ry1を占める画素の濃度値の平均値AVr1が目標値Ym1になるように、ポイントPr1の出力値『Yr1』を設定する。具体的には、入力値『Xr1』に対して「濃度補正」を施さなかった場合に得られる出力値『Yrt1』(入力値『Xr1』と同じ値)として、この出力値『Yrt1』に対するポイントPr1の出力値『Yr1』の差分ΔYrp1を求める。   The output values “Yr1” and “Yr2” of the points Pr1 and Pr2 are obtained by the same method as in the case of “normal backlight image correction”. That is, for example, in the case of the output value “Yr1” of the point Pr1, the point value is set so that the average value AVr1 of the density values of the pixels occupying the small region Ry1 of the corrected red (R) histogram becomes the target value Ym1. The output value “Yr1” of Pr1 is set. Specifically, the output value “Yrt1” (the same value as the input value “Xr1”) obtained when the “density correction” is not performed on the input value “Xr1” is a point for the output value “Yrt1”. The difference ΔYrp1 of the output value “Yr1” of Pr1 is obtained.

図31Aは、この差分ΔYrp1を求める方法について説明したものである。スキャナドライバは、まず、同図に示すように、入力値『Xr1』から出力値『Yrt1』を取得する(S602)。次に、差分ΔYrp1を初期値『0』に設定する(S604)。そして、差分ΔYrp1に対して『1』だけ加算した値を、新たなΔYrp1として設定する(S606)。次に、先に取得した出力値『Yrt1』にΔYrp1を加算した値をポイントPr1の出力値『Yr1』として設定して(S608)、このポイントPr1により設定されるトーンカーブTcrに基づき「濃度補正」を実行した場合の補正後の画像のデータを取得する(S610)。なお、ここでは、このときに、図11にて説明したように、「濃度補正」の他に、「ヒストグラム調整」や「イメージ調整」等の各種調整(補正)の内容についても反映されるものとする。   FIG. 31A explains a method for obtaining this difference ΔYrp1. The scanner driver first obtains the output value “Yrt1” from the input value “Xr1” as shown in FIG. Next, the difference ΔYrp1 is set to an initial value “0” (S604). Then, a value obtained by adding “1” to the difference ΔYrp1 is set as a new ΔYrp1 (S606). Next, a value obtained by adding ΔYrp1 to the previously obtained output value “Yrt1” is set as the output value “Yr1” of the point Pr1 (S608), and “density correction” is performed based on the tone curve Tcr set by this point Pr1. "Is acquired (S610). Here, as described with reference to FIG. 11, the contents of various adjustments (corrections) such as “histogram adjustment” and “image adjustment” are also reflected in addition to “density correction”. And

このようにして補正を行った後、この補正によって得られた画像のデータに基づき、レッド(R)のヒストグラムを生成する(S612)。そして、作成したレッド(R)のヒストグラムについて小領域への区分を行う(S614)。ここでヒストグラムは、4つの小領域Ry1、Ry2、Ry3、Ry4に区分される。そして、小領域Ry1に関する属性情報として濃度値の平均値AVr1を取得する(S616)。その後、求めた平均値AVr1と、先に取得した目標値Ym1とを比較し(S618)、求めた平均値AVr1が、目標値Ym1以上となったか否かをチェックする。そして、求めた平均値AVr1が目標値Ym1以上となっていない場合には、ステップS606へと戻り、再び、差分ΔYrp1に対して『1』だけ加算して新たなΔYrp1を取得する(S606)。スキャナドライバは、求めた平均値AVr1が目標値Ym1に達するまで、このような処理(S606〜S618)を繰り返し行う。すなわち、差分ΔYrp1は、求めた平均値AVr1が目標値Ym1に達するまで、順次『1』ずつ加算されて増えることになる。   After correcting in this way, a histogram of red (R) is generated based on the image data obtained by this correction (S612). Then, the created red (R) histogram is divided into small regions (S614). Here, the histogram is divided into four small regions Ry1, Ry2, Ry3, and Ry4. Then, an average value AVr1 of density values is acquired as attribute information related to the small region Ry1 (S616). Thereafter, the obtained average value AVr1 is compared with the previously obtained target value Ym1 (S618), and it is checked whether or not the obtained average value AVr1 is equal to or greater than the target value Ym1. If the calculated average value AVr1 is not equal to or greater than the target value Ym1, the process returns to step S606, and again adds “1” to the difference ΔYrp1 to obtain a new ΔYrp1 (S606). The scanner driver repeatedly performs such processing (S606 to S618) until the obtained average value AVr1 reaches the target value Ym1. That is, the difference ΔYrp1 is incremented by “1” sequentially until the obtained average value AVr1 reaches the target value Ym1.

そして、求めた平均値AVr1が目標値Ym1に達した場合には、スキャナドライバは、ここで得られた差分ΔYrp1に基づき、ポイントPr1の出力値『Yr1』を設定する(S620)。このようにして補正後のレッド(R)のヒストグラムの小領域Ry1を占める画素の濃度値の平均値AVr1が目標値Ym1になるように、ポイントPr1の出力値『Yr1』を設定する。なお、ポイントPr1の出力値『Yr1』が出力値『Yrt1』よりも小さい値に設定される場合には、ステップS618において、平均値AVr1が目標値Ym1よりも下回ったか否かをチェックすると良い。   When the calculated average value AVr1 reaches the target value Ym1, the scanner driver sets the output value “Yr1” of the point Pr1 based on the difference ΔYrp1 obtained here (S620). In this way, the output value “Yr1” of the point Pr1 is set so that the average value AVr1 of the density values of the pixels occupying the small area Ry1 of the corrected red (R) histogram becomes the target value Ym1. When the output value “Yr1” of the point Pr1 is set to a value smaller than the output value “Yrt1”, it is preferable to check in step S618 whether or not the average value AVr1 is lower than the target value Ym1.

一方、ポイントPr2の出力値『Yr2』についても同様な方法により、補正後のレッド(R)のヒストグラムの小領域Ry2を占める画素の濃度値の平均値AVr2が目標値Ym2になるように、ポイントPr2の出力値『Yr2』を設定する。なお、ポイントPr2の出力値『Yr2』の設定手順を図31Bに示す。   On the other hand, for the output value “Yr2” of the point Pr2, the same method is used so that the average value AVr2 of the density values of the pixels occupying the small area Ry2 of the corrected red (R) histogram becomes the target value Ym2. The output value “Yr2” of Pr2 is set. A procedure for setting the output value “Yr2” of the point Pr2 is shown in FIG. 31B.

スキャナドライバは、このような方法により、レッド(R)を除く他のグリーン(G)、ブルー(B)のトーンカーブTcg、Tcbについても、2つの目標値Ym1、Ym2に基づき調整をする。   The scanner driver adjusts tone curves Tcg and Tcb of green (G) and blue (B) other than red (R) based on the two target values Ym1 and Ym2 by such a method.

<補正処理>
そして、スキャナドライバは、このようにして補正情報に基づき調整された、「濃度補正」における各色別のトーンカーブTcr、Tcg、Tcbに基づき、画像読み取り装置10により読み取られた画像に対して、中間調の色バランスが崩れた逆光画像のための補正処理を施す。具体的には、図11にて説明した調整手順における「濃度補正」において、補正情報に基づき調整された「濃度補正」における各色別のトーンカーブTcr、Tcg、Tcbに基づき、画像読み取り装置10により読み取られた画像を構成する各画素のデータの各色の濃度値を変換する。これによって、スキャナドライバは、画像読み取り装置10により読み取られた画像に対して中間調の色バランスが崩れた逆光画像のための補正処理を施す。
<Correction process>
The scanner driver then applies an intermediate to the image read by the image reading device 10 based on the tone curves Tcr, Tcg, Tcb for each color in the “density correction” adjusted based on the correction information. A correction process is performed for a backlight image in which the color balance of the tone is lost. Specifically, in the “density correction” in the adjustment procedure described in FIG. 11, the image reading device 10 uses the tone curves Tcr, Tcg, Tcb for each color in the “density correction” adjusted based on the correction information. The density value of each color of the data of each pixel constituting the read image is converted. As a result, the scanner driver performs correction processing for the backlight image in which the halftone color balance is lost with respect to the image read by the image reading device 10.

なお、ここで中間調の色バランスが崩れた逆光画像のための補正処理が施される画像は、図11に示す調整手順に従って、既にヒストグラム調整やイメージ調整((3)彩度の調整を除く)等が施された画像である。スキャナドライバは、このようにして既にヒストグラム調整やイメージ調整((3)彩度の調整を除く)等が施された画像に対して「濃度補正」により中間調の色バランスが崩れた逆光画像のための補正処理を施す。   Here, the image subjected to the correction process for the backlight image in which the halftone color balance is lost has already been adjusted in accordance with the adjustment procedure shown in FIG. 11 and the histogram adjustment and image adjustment (excluding (3) saturation adjustment). ) Etc. In this way, the scanner driver can process an image of a backlight image whose halftone color balance has been lost by “density correction” on an image that has already undergone histogram adjustment or image adjustment (excluding (3) saturation adjustment). Correction processing is performed.

図32Aおよび図32Bは、中間調の色バランスが崩れた逆光画像の補正処理前と補正処理後のRGB各色の平均値を示したものである。図32Aは、補正処理前のRGB各色の平均値を示している。図32Bは、補正処理後のRGB各色の平均値を示している。   32A and 32B show average values of RGB colors before and after correction processing of a backlight image in which the halftone color balance is lost. FIG. 32A shows an average value of each color of RGB before correction processing. FIG. 32B shows an average value of each color of RGB after the correction processing.

補正処理前には、図32Aに示すように、3つの小領域Ry1、Ry2、Ry3を占める画素のRGB各色の濃度値の平均値は、小領域Ry2、即ち中間調の領域において、他の小領域Ry1、Ry3に比べてバラツキが大きくなっている。   Prior to the correction process, as shown in FIG. 32A, the average value of the density values of the RGB colors of the pixels occupying the three small areas Ry1, Ry2, and Ry3 is the other small areas in the small area Ry2, that is, the halftone area. The variation is larger than that of the regions Ry1 and Ry3.

一方、補正処理後には、図32Bに示すように、RGB各色の小領域Ry1の平均値AVr1、AVg1、AVb1が、各色共通の目標値Ym1になるように、それぞれ設定される。このことから、RGB各色の小領域Ry1の平均値AVr1、AVg1、AVb1は、共にほぼ同じ値に設定される。また、RGB各色の小領域Ry2についても同様に、RGB各色の小領域Ry2の平均値AVr2、AVg2、AVb2が、各色共通の目標値Ym2になるようにそれぞれ設定される。このことから、RGB各色の小領域Ry2の平均値AVr2、AVg2、AVb2は、共にほぼ同じ値に設定される。   On the other hand, after the correction process, as shown in FIG. 32B, the average values AVr1, AVg1, and AVb1 of the RGB small color regions Ry1 are set to be the target values Ym1 common to the respective colors. For this reason, the average values AVr1, AVg1, and AVb1 of the RGB sub-regions Ry1 are all set to substantially the same value. Similarly, the average values AVr2, AVg2, and AVb2 of the RGB small regions Ry2 are set so as to be the target values Ym2 common to the respective colors. For this reason, the average values AVr2, AVg2, and AVb2 of the small areas Ry2 of the RGB colors are all set to substantially the same value.

図33は、この補正処理において生成されるRGB各色のトーンカーブTcr、Tcg、Tcbの一例を説明したものである。RGB各色のトーンカーブTcr、Tcg、Tcbは、同図に示すように、それぞれ異なる形状に形成される。これは、RGB各色のトーンカーブTcr、Tcg、Tcbを形成するために設定される任意のポイント(例えば、レッド(R)のトーンカーブTcrの場合、ポイントPr1、Pr2、Pr3など)が、RGB各色毎にそれぞれ個別に設定されるからである。このようにRGB各色のトーンカーブTcr、Tcg、Tcbがそれぞれ個別に形成されることで、中間調の色バランスが崩れた逆光画像に対して適切な補正処理を施すことができる。   FIG. 33 illustrates an example of tone curves Tcr, Tcg, and Tcb for each of the RGB colors generated in this correction process. The tone curves Tcr, Tcg, and Tcb for each color of RGB are formed in different shapes as shown in FIG. This is because arbitrary points set to form tone curves Tcr, Tcg, and Tcb for each color of RGB (for example, points Pr1, Pr2, and Pr3 in the case of the tone curve Tcr of red (R)) This is because each is set individually. In this way, the tone curves Tcr, Tcg, and Tcb for each of the RGB colors are individually formed, so that an appropriate correction process can be performed on the backlight image in which the halftone color balance is lost.

図34Aおよび図34Bは、補正処理前と補正処理後のRGB各色のヒストグラムの一例を示したものである。図34Aは、補正処理前のRGB各色のヒストグラムを示したものである。図34Bは、補正処理後のRGB各色のヒストグラムを示したものである。   FIG. 34A and FIG. 34B show an example of a histogram for each color of RGB before and after the correction process. FIG. 34A shows a histogram of each color of RGB before correction processing. FIG. 34B shows a histogram of each color of RGB after the correction process.

補正処理前は、図34Aに示すように、レッド(R)およびグリーン(G)のヒストグラムは、大幅な相違はなく、ほぼ等しい特性を有しているのに対して、ブルー(B)のヒストグラムは、レッド(R)およびグリーン(G)のヒストグラムに対して形状が大幅に相違し、異なる特性を有している。一方、補正処理後は、図34Bに示すように、ブルー(B)のヒストグラムは改善されて、レッド(R)やグリーン(G)のヒストグラムとほぼ同じ特性を有するようになる。   Prior to the correction process, as shown in FIG. 34A, the histograms of red (R) and green (G) are not significantly different and have substantially the same characteristics, whereas the histogram of blue (B) Are significantly different in shape from the red (R) and green (G) histograms and have different characteristics. On the other hand, after the correction process, as shown in FIG. 34B, the blue (B) histogram is improved to have substantially the same characteristics as the red (R) and green (G) histograms.

===夕焼け・朝焼けの逆光画像の補正===
次に、「夕焼けまたは朝焼けの逆光画像のための補正処理」について説明する。この補正処理は、「夕焼けまたは朝焼けの画像であるか否かの判定処理」において、夕焼けまたは朝焼けの画像であると判定された場合に実施される。
この補正処理は、先の「逆光画像の判定」にて生成したRGB各色のヒストグラムを用いて実施される。すなわち、「通常の逆光画像に対する補正処理」や「中間調の色バランスが崩れた逆光画像のための補正処理」の場合と同様に、先の「逆光画像の判定」にて生成したRGB各色のヒストグラムにおいて区分して得られた4つの小領域Ry1、Ry2、Ry3、Ry4のうちの3つの小領域Ry1、Ry2、Ry3からそれぞれ属性情報を取得して、その取得した属性情報に基づき、画像に対して補正処理を施す。以下にその補正方法について詳しく説明する。
=== Correction of backlight image of sunset and sunrise ===
Next, “correction processing for a backlight image of sunset or sunrise” will be described. This correction process is performed when it is determined that the image is a sunset or sunrise image in the “determination process for determining whether the image is a sunset or sunrise image”.
This correction process is performed using the histograms for each of the RGB colors generated in the previous “backlight image determination”. That is, as in the case of “correction processing for a normal backlight image” and “correction processing for a backlight image in which the halftone color balance is lost”, each of the RGB colors generated in the previous “backlight image determination” is determined. Attribute information is obtained from each of the three small areas Ry1, Ry2, Ry3 out of the four small areas Ry1, Ry2, Ry3, Ry4 obtained by dividing in the histogram, and an image is obtained based on the obtained attribute information. Correction processing is performed on the image. The correction method will be described in detail below.

<属性情報の取得>
スキャナドライバは、まず、先の「逆光画像の判定」にて生成したRGB各色のヒストグラムにおいて区分して得られた4つの小領域Ry1、Ry2、Ry3、Ry4のうちの3つの小領域Ry1、Ry2、Ry3からそれぞれ属性情報を取得する。ここで、属性情報としては、「通常の逆光画像の補正」の場合と同様に、RGB各色のヒストグラムから3つの小領域Ry1、Ry2、Ry3を占める画素の濃度値の平均値AVr1、AVr2、AVr3、AVg1、AVg2、AVg3、AVb1、AVb2、AVb3をそれぞれ取得する。
<Acquisition of attribute information>
First, the scanner driver performs three small areas Ry1, Ry2, Ry1, Ry3, Ry4 out of the four small areas Ry1, Ry2, Ry3, Ry4 obtained by segmenting in the histogram for each of the RGB colors generated in the above-mentioned “backlight image determination”. , Ry3 respectively to obtain attribute information. Here, as the attribute information, the average values AVr1, AVr2, and AVr3 of the density values of the pixels that occupy the three small regions Ry1, Ry2, and Ry3 from the histogram of each color of RGB are the same as in the case of “normal backlight image correction”. , AVg1, AVg2, AVg3, AVb1, AVb2, and AVb3 are obtained.

<補正情報の生成>
その後、スキャナドライバは、取得した平均値AVr1、AVr2、AVr3、AVg1、AVg2、AVg3、AVb1、AVb2、AVb3に基づき、夕焼けまたは朝焼けの逆光画像に対して補正処理を施すための補正情報を生成する。以下に本実施形態における補正情報の生成方法について説明する。
<Generation of correction information>
Thereafter, the scanner driver generates correction information for performing correction processing on the backlight image of the sunset or sunrise based on the acquired average values AVr1, AVr2, AVr3, AVg1, AVg2, AVg3, AVb1, AVb2, and AVb3. . Hereinafter, a correction information generation method according to the present embodiment will be described.

(1)輝度に関する情報の取得
ここで、スキャナドライバは、「通常の逆光画像の補正」の場合および「中間調の色バランスが崩れた逆光画像の補正処理」の場合と同様に、取得した平均値AVr1、AVr2、AVr3、AVg1、AVg2、AVg3、AVb1、AVb2、AVb3に基づき、3つの小領域Ry1、Ry2、Ry3についてそれぞれ各領域Ry1、Ry2、Ry3を占める画素の輝度の平均値Yav1、Yav2、Yav3を取得する。このとき、スキャナドライバは、例えば、先の式(10)〜(12)等を用いる。また、スキャナドライバは、取得した輝度の平均値Yav1、Yav2、Yav3に基づき、画像読み取り装置10により読み取った画像の全体の輝度の平均値Yav0を求める。このとき、スキャナドライバは、例えば、先の式(13)等を用いる。
(1) Acquisition of information related to luminance Here, the scanner driver obtains the average obtained in the same manner as in the case of “normal backlight image correction” and “backlight image correction processing in which halftone color balance is lost”. Based on the values AVr1, AVr2, AVr3, AVg1, AVg2, AVg3, AVb1, AVb2, AVb3, the average values Yav1, Yav2 of the luminances of the pixels occupying the respective regions Ry1, Ry2, Ry3 for the three small regions Ry1, Ry2, Ry3, respectively. , Yav3 is acquired. At this time, the scanner driver uses, for example, the above formulas (10) to (12). Further, the scanner driver obtains the average luminance value Yav0 of the entire image read by the image reading device 10 based on the acquired average luminance values Yav1, Yav2, and Yav3. At this time, the scanner driver uses the above equation (13), for example.

(2)目標値の取得
次に、スキャナドライバは、取得した3つの小領域Ry1、Ry2、Ry3を占める画素の輝度の平均値Yav1、Yav2、Yav3と、画像の全体の輝度の平均値Yav0とに基づき、目標値を取得する。この目標値は、夕焼けまたは夕焼けの逆光画像に対して補正処理を実行するために取得される値であり、その補正処理の概要を決定する上で指標となる値である。本実施形態では、夕焼けまたは朝焼けの逆光画像を補正するために、この目標値として、2つの目標値Ym1、Ym2が取得される。これらのうち、目標値Ym1は、小領域Ry1に対応して取得されたものである。また、目標値Ym2は、小領域Ry2に対応して取得されたものである。
(2) Acquisition of Target Value Next, the scanner driver obtains the average luminance values Yav1, Yav2, and Yav3 of the pixels that occupy the three small regions Ry1, Ry2, and Ry3 and the average luminance value Yav0 of the entire image. Based on the above, the target value is obtained. This target value is a value acquired for executing the correction process on the sunset or the backlight image of the sunset, and is a value serving as an index for determining the outline of the correction process. In the present embodiment, two target values Ym1 and Ym2 are acquired as the target values in order to correct a backlight image of sunset or sunrise. Among these, the target value Ym1 is acquired corresponding to the small region Ry1. Further, the target value Ym2 is acquired corresponding to the small region Ry2.

これら2つの目標値Ym1、Ym2は、「通常の逆光画像の補正」の場合や「中間調の色バランスが崩れた逆光画像の補正処理」の場合と同様に、小領域Ry1を占める画素の輝度の平均値Yav1と、画像の全体の輝度の平均値Yav0とを加算して得られた加算値Saddに基づき、図26に示す関係式(A)、(B)により取得される。すなわち、目標値Ym1は、関係式(A)から加算値Saddに対応する値として取得される。また、目標値Ym2は、関係式(B)から加算値Saddに対応する値として取得される。   These two target values Ym1 and Ym2 are the luminance values of the pixels occupying the small region Ry1 as in the case of “normal backlight image correction” or “backlight image correction processing in which the halftone color balance is lost”. Are obtained by the relational expressions (A) and (B) shown in FIG. That is, the target value Ym1 is acquired as a value corresponding to the added value Sadd from the relational expression (A). The target value Ym2 is acquired as a value corresponding to the added value Sadd from the relational expression (B).

(3)補正情報の生成
スキャナドライバは、このようにして取得した2つの目標値Ym1、Ym2に基づき、補正情報を生成する。この補正情報は、夕焼けまたは朝焼けの逆光画像に対して適切な補正処理を施すための情報である。本実施形態では、スキャナドライバが、夕焼けまたは朝焼けの逆光画像に対する補正処理として、「通常の逆光画像の補正」の場合や「中間調の色バランスが崩れた逆光画像の補正処理」の場合と同様に、前述した「濃度補正」を実行する。このことから、本実施形態では、スキャナドライバが、補正情報として、「濃度補正」における設定情報を生成する。以下にこの設定情報の生成方法について詳しく説明する。
(3) Generation of correction information The scanner driver generates correction information based on the two target values Ym1 and Ym2 acquired in this way. This correction information is information for performing an appropriate correction process on a sunset or sunrise backlight image. In the present embodiment, the scanner driver performs the same correction process for a sunset or sunrise backlight image as in the case of “normal backlight image correction” or “backlight image correction process in which halftone color balance is lost”. In addition, the above-described “density correction” is executed. Therefore, in this embodiment, the scanner driver generates setting information for “density correction” as correction information. A method for generating the setting information will be described in detail below.

スキャナドライバは、夕焼けまたは朝焼けの逆光画像に対して「濃度補正」を実行するために、「中間調の色バランスが崩れた逆光画像の補正処理」の場合と同様に、図8にて説明した、レッド(R)、グリーン(G)およびブルー(B)の各色のトーンカーブTcr、Tcg、Tcbをそれぞれ個別に調整する。ここで、スキャナドライバは、レッド(R)、グリーン(G)およびブルー(B)の各色のトーンカーブTcr、Tcg、Tcbをそれぞれ、取得した2つの目標値Ym1、Ym2に基づき調整する。2つの目標値Ym1、Ym2に基づき、RGB各色のトーンカーブTcr、Tcg、Tcbを調整する方法としては、図30にて説明した「中間調の色バランスが崩れた逆光画像の補正処理」の場合と同様な方法を採用する。   The scanner driver performs the “density correction” on the backlight image of the sunset or sunrise, as described in FIG. 8, as in the case of the “correction process of the backlight image in which the halftone color balance is lost”. , Red (R), green (G) and blue (B) tone curves Tcr, Tcg and Tcb are individually adjusted. Here, the scanner driver adjusts the tone curves Tcr, Tcg, and Tcb of each color of red (R), green (G), and blue (B) based on the acquired two target values Ym1 and Ym2. As a method of adjusting the tone curves Tcr, Tcg, and Tcb of each of the RGB colors based on the two target values Ym1 and Ym2, the “correction processing of a backlight image in which the halftone color balance is lost” described in FIG. The same method is adopted.

ただし、ここで行われるRGB各色のトーンカーブTcr、Tcg、Tcbの調整方法にあっては、前述した「中間調の色バランスが崩れた逆光画像の補正処理」の場合とは、一部調整方法が異なる。すなわち、前述した「中間調の色バランスが崩れた逆光画像の補正処理」の場合では、2つの目標値Ym1、Ym2が、RGB各色のトーンカーブTcr、Tcg、Tcbを調整するにあたって、各色共通の目標値として用いられていた。しかし、ここで行われる補正処理では、2つの目標値Ym1、Ym2のうち、目標値Ym1については、各色共通の目標値として用いられるものの、目標値Ym2については、レッド(R)、グリーン(G)およびブルー(B)の各色共通の目標値としてではなく、いずれか1色のみの目標値として用いる。他の色の目標値は、この目標値Ym2に基づきそれぞれ個別に求めた別の目標値を用いる。すなわち、各色別の目標値が用いられる。ここで、目標値Ym2がそのまま用いられる色は、小領域Ry2を占める画素の濃度値の平均値が最も大きい色に設定される。その他の色については、小領域Ry2を占める画素の濃度値の平均値に応じて、目標値Ym2に基づきそれぞれ個別に目標値が設定される。   However, in the adjustment method of the tone curves Tcr, Tcg, and Tcb for each of the RGB colors performed here, a partial adjustment method is different from the above-described “correction processing of a backlight image in which the halftone color balance is lost”. Is different. That is, in the case of the above-described “correction processing of a backlight image in which the halftone color balance is lost”, the two target values Ym1 and Ym2 are common to each color when adjusting the tone curves Tcr, Tcg, and Tcb of the RGB colors. It was used as a target value. However, in the correction process performed here, among the two target values Ym1 and Ym2, the target value Ym1 is used as a common target value for each color, but the target value Ym2 is red (R), green (G ) And blue (B), not as a common target value for each color, but as a target value for only one of the colors. As the target values for the other colors, different target values obtained individually based on the target value Ym2 are used. That is, a target value for each color is used. Here, the color for which the target value Ym2 is used as it is is set to the color having the largest average value of the density values of the pixels occupying the small region Ry2. For the other colors, target values are individually set based on the target value Ym2 according to the average value of the density values of the pixels occupying the small region Ry2.

具体的に、レッド(R)のトーンカーブTcrの調整方法を例にして説明する。スキャナドライバは、補正情報として、図30に示すように、2つの目標値Ym1、Ym2に基づき、そのトーンカーブTcrが通過する3つのポイントPr1、Pr2、Pr3を設定する。ポイントPr1は、小領域Ry1に対応して設定され、ポイントPr2は、小領域Ry2に対応して設定され、ポイントPr3は、小領域Ry3に対応して設定される。ポイントPr1、Pr2、Pr3の入力値をそれぞれ『Xr1』、『Xr2』、『Xr3』とし、ポイントPr1、Pr2、Pr3の出力値をそれぞれ『Yr1』、『Yr2』、『Yr3』とする。ここで、ポイントPr1、Pr2、Pr3の入力値『Xr1』、『Xr2』、『Xr3』は、図27にて説明したポイントPs1、Ps2、Ps3の入力値『X1』、『X2』、『X3』と同じ方法により設定する。   Specifically, a method of adjusting the red (R) tone curve Tcr will be described as an example. As shown in FIG. 30, the scanner driver sets three points Pr1, Pr2, and Pr3 through which the tone curve Tcr passes based on the two target values Ym1 and Ym2 as correction information. The point Pr1 is set corresponding to the small area Ry1, the point Pr2 is set corresponding to the small area Ry2, and the point Pr3 is set corresponding to the small area Ry3. The input values of the points Pr1, Pr2, and Pr3 are “Xr1”, “Xr2”, and “Xr3”, respectively, and the output values of the points Pr1, Pr2, and Pr3 are “Yr1”, “Yr2”, and “Yr3”, respectively. Here, the input values “Xr1”, “Xr2”, and “Xr3” of the points Pr1, Pr2, and Pr3 are the input values “X1”, “X2”, and “X3” of the points Ps1, Ps2, and Ps3 described in FIG. Set in the same way as

一方、ポイントPr1、Pr2の出力値『Yr1』、『Yr2』は、2つの目標値Ym1、Ym2に基づき設定する。また、ポイントPr3の出力値『Yr3』は、ポイントPr2と、ポイントPr0とを結ぶ直線上に設定される。ポイントPr0は、入力値を『255』とし、出力値を『255』としたポイントである。ポイントPr0の入力値『Xr3』が決定されれば、出力値『Yr3』を求めることができる。   On the other hand, the output values “Yr1” and “Yr2” of the points Pr1 and Pr2 are set based on the two target values Ym1 and Ym2. The output value “Yr3” of the point Pr3 is set on a straight line connecting the point Pr2 and the point Pr0. The point Pr0 is a point where the input value is “255” and the output value is “255”. If the input value “Xr3” of the point Pr0 is determined, the output value “Yr3” can be obtained.

ポイントPr1、Pr2の出力値『Yr1』、『Yr2』は、「中間調の色バランスが崩れた逆光画像の補正」の場合と同様な方法により求める。ただし、ここでポイントPr2の出力値『Yr2』については、レッド(R)、グリーン(G)およびブルー(B)の各色に応じてそれぞれ設定方法が異なる。つまり、レッド(R)、グリーン(G)およびブルー(B)のいずれか1色については、目標値Ym2がそのまま用いられるものの、その他の色については、この目標値Ym2に基づきそれぞれ個別に得られた別の目標値が用いられる。   The output values “Yr1” and “Yr2” of the points Pr1 and Pr2 are obtained by the same method as in the case of “correction of a backlight image in which the halftone color balance is lost”. However, the setting method for the output value “Yr2” of the point Pr2 is different depending on each color of red (R), green (G), and blue (B). That is, for any one of red (R), green (G), and blue (B), the target value Ym2 is used as it is, but the other colors are individually obtained based on the target value Ym2. Different target values are used.

ここで、補正対象となる画像が、図22A〜図22Cに示すようなヒストグラムの特性を有する夕焼けの画像であったとする。この場合、小領域Ry2を占める画素の濃度値の平均値が最も高い色は、レッド(R)となる。このことから、目標値Ym2がそのまま用いられる色は、レッド(R)に設定される。一方、その他の色、即ち、グリーン(G)やブルー(B)については、目標値Ym2に基づき、小領域Ry2を占める画素の濃度値の平均値に応じて、それぞれ個別に目標値が設定される。ここで設定されるグリーン(G)の目標値を『Mg2』とし、ブルー(B)の目標値を『Mb2』とすると、これらの目標値『Mg2』、『Mb2』は、次のような関係式(14)、(15)により求めることができる。
Mg2=Ym2×AVg2/AVr2 ……………(14)
Mb2=Ym2×AVb2/AVr2 ……………(15)
これらの関係式(14)、(15)は、補正後のRGB各色の小領域Ry2を占める画素の濃度値の平均値の比率が、補正前の比率とほぼ同じになるように設定するためのものである。このような関係式(14)、(15)を用いて目標値『Mg2』、『Mb2』を取得すれば、補正後の中間調領域において補正前の色バランスの保持を図ることができる。
Here, it is assumed that the image to be corrected is a sunset image having histogram characteristics as shown in FIGS. 22A to 22C. In this case, the color having the highest average density value of the pixels occupying the small area Ry2 is red (R). Therefore, the color for which the target value Ym2 is used as it is is set to red (R). On the other hand, for other colors, that is, green (G) and blue (B), target values are individually set based on the average value of the density values of the pixels occupying the small region Ry2 based on the target value Ym2. The If the target value of green (G) set here is “Mg2” and the target value of blue (B) is “Mb2”, these target values “Mg2” and “Mb2” have the following relationship: It can obtain | require by Formula (14) and (15).
Mg2 = Ym2 × AVg2 / AVr2 (14)
Mb2 = Ym2 × AVb2 / AVr2 (15)
These relational expressions (14) and (15) are for setting the ratio of the average value of the density values of the pixels occupying the small area Ry2 of each RGB color after correction to be substantially the same as the ratio before correction. Is. If the target values “Mg2” and “Mb2” are obtained using the relational expressions (14) and (15), the color balance before correction can be maintained in the corrected halftone area.

これによって、レッド(R)については、補正後のレッド(R)のヒストグラムの小領域Ry2を占める画素の濃度値の平均値AVr2が目標値Ym2になるように、ポイントPr2の出力値『Yr2』が設定される。   Thereby, for red (R), the output value “Yr2” of the point Pr2 is set so that the average value AVr2 of the density values of the pixels occupying the small region Ry2 of the corrected red (R) histogram becomes the target value Ym2. Is set.

一方、グリーン(G)およびブルー(B)については、次のように設定される。図35は、グリーン(G)のトーンカーブTcgの調整方法について説明したものである。図36は、ブルー(B)のトーンカーブTcbの調整方法について説明したものである。グリーン(G)のトーンカーブTcgを調整するためのポイントを、図35に示すように、Pg1、Pg2、Pg3とし、ブルー(B)のトーンカーブTcbを調整するためのポイントを、図36に示すように、Pb1、Pb2、Pb3とする。グリーン(G)のポイントPg1の出力値を『Yg1』とし、ポイントPg2の出力値を『Yg2』とし、ポイントPg3の出力値を『Yg3』とする。また、ブルー(B)のポイントPb1の出力値を『Yb1』とし、ポイントPb2の出力値を『Yb2』とし、ポイントPb3の出力値を『Yb3』とする。   On the other hand, green (G) and blue (B) are set as follows. FIG. 35 illustrates a method for adjusting the green (G) tone curve Tcg. FIG. 36 illustrates a method for adjusting the blue (B) tone curve Tcb. The points for adjusting the green (G) tone curve Tcg are Pg1, Pg2, and Pg3 as shown in FIG. 35, and the points for adjusting the blue (B) tone curve Tcb are shown in FIG. Thus, Pb1, Pb2, and Pb3 are used. The output value of the green (G) point Pg1 is “Yg1”, the output value of the point Pg2 is “Yg2”, and the output value of the point Pg3 is “Yg3”. Further, the output value of the point Pb1 of blue (B) is “Yb1”, the output value of the point Pb2 is “Yb2”, and the output value of the point Pb3 is “Yb3”.

グリーン(G)のポイントPg2については、補正後のグリーン(G)のヒストグラムの小領域Ry2を占める画素の濃度値の平均値AVg2が目標値Mg2になるように、ポイントPg2の出力値『Yg2』が設定される。また、ブルー(B)のポイントPb2については、補正後のブルー(B)のヒストグラムの小領域Ry2を占める画素の濃度値の平均値AVb2が目標値Mb2になるように、ポイントPb2の出力値『Yb2』が設定される。   For the green (G) point Pg2, the output value “Yg2” of the point Pg2 is set so that the average value AVg2 of the density values of the pixels occupying the small region Ry2 of the corrected green (G) histogram becomes the target value Mg2. Is set. For the blue (B) point Pb2, the output value “Pb2” is set so that the average value AVb2 of the density values of the pixels occupying the small region Ry2 of the corrected blue (B) histogram becomes the target value Mb2. Yb2 ”is set.

なお、ポイントPr1、Pg1、Pb1の出力値『Yr1』、『Yg1』、『Yb1』については、目標値Ym1がRGB各色共通の目標値として用いられる。すなわち、補正後のレッド(R)、グリーン(G)およびブルー(B)の各色のヒストグラムの小領域Ry1を占める画素の濃度値の平均値AVr1、AVg1、AVb1がそれぞれ目標値Ym1になるように、RGB各色のポイントPr1、Pg1、Pb1の出力値『Yr1』、『Yg1』、『Yb1』は設定される。   For the output values “Yr1”, “Yg1”, and “Yb1” of the points Pr1, Pg1, and Pb1, the target value Ym1 is used as a common target value for each color of RGB. That is, the average values AVr1, AVg1, and AVb1 of the density values of the pixels that occupy the small area Ry1 of the histogram of each color of red (R), green (G), and blue (B) after correction become the target value Ym1. , RGB output values “Yr1”, “Yg1”, “Yb1” of the points Pr1, Pg1, and Pb1 are set.

レッド(R)、グリーン(G)およびブルー(B)の各色のトーンカーブTcr、Tcg、TcbのポイントPr1、Pg1、Pb1の出力値『Yr1』、『Yg1』、『Yb1』を求める方法としては、図31Aにて説明した方法を用いることができる。また、レッド(R)のトーンカーブTcrのポイントPr2の出力値『Yr2』を求める方法としては、図31Bにて説明した方法を用いることができる。   As a method for obtaining the output values “Yr1”, “Yg1”, “Yb1” of the points Pr1, Pg1, and Pb1 of the tone curves Tcr, Tcg, and Tcb of each color of red (R), green (G), and blue (B) The method described in FIG. 31A can be used. Further, as a method of obtaining the output value “Yr2” of the point Pr2 of the red (R) tone curve Tcr, the method described in FIG. 31B can be used.

一方、グリーン(G)およびブルー(B)のトーンカーブTcg、TcbのポイントPg2、Pb2の出力値『Yg2』、『Yb2』を求める方法としては、次のような方法となる。図37Aは、グリーン(G)のトーンカーブTcgのポイントPg2の出力値『Yg2』を取得する方法の一例を示したものである。図37Bは、ブルー(B)のトーンカーブTcbのポイントPb2の出力値『Yb2』を取得する方法の一例を示したものである。これら図37Aおよび図37Bに示す方法にあっては、前述した図31Aおよび図31Bに示す方法と同様な方法により、ポイントPg2の出力値『Yg2』と、ポイントPb2の出力値『Yb2』とを取得する。ただし、ここでは、グリーン(G)のポイントPg2の出力値『Yg2』は、図37Aの中のステップS718に示すように、目標値Mg2に基づき設定される。また、ブルー(B)のポイントPb2の出力値『Yb2』は、図37Bの中のステップS768に示すように、目標値Mb2に基づき設定される。   On the other hand, the following methods are used to obtain the output values “Yg2” and “Yb2” of the points Pg2 and Pb2 of the tone curves Tcg and Tcb of green (G) and blue (B). FIG. 37A shows an example of a method for acquiring the output value “Yg2” of the point Pg2 of the tone curve Tcg of green (G). FIG. 37B shows an example of a method for acquiring the output value “Yb2” of the point Pb2 of the blue (B) tone curve Tcb. In the methods shown in FIGS. 37A and 37B, the output value “Yg2” of the point Pg2 and the output value “Yb2” of the point Pb2 are obtained by the same method as the method shown in FIGS. 31A and 31B described above. get. However, the output value “Yg2” of the green (G) point Pg2 is set based on the target value Mg2, as shown in step S718 in FIG. 37A. Further, the output value “Yb2” of the blue (B) point Pb2 is set based on the target value Mb2, as shown in step S768 in FIG. 37B.

<補正処理>
そして、スキャナドライバは、このようにして補正情報として生成した、「濃度補正」における各色のトーンカーブTcr、Tcg、Tcbを調整するための各色3つのポイントPr1、Pr2、Pr3、Pg1、Pg2、Pg3、Pb1、Pb2、Pb3に関する情報に基づき、画像読み取り装置10により読み取られた画像に対して、夕焼けまたは朝焼けの逆光画像のための補正処理を施す。具体的には、図11にて説明した調整手順における「濃度補正」において、補正情報として生成された各色3つのポイントPr1、Pr2、Pr3、Pg1、Pg2、Pg3、Pb1、Pb2、Pb3に関する情報に基づき調整されたトーンカーブTcr、Tcg、Tcbに基づき、画像読み取り装置10により読み取られた画像を構成する各画素のデータの各色の濃度値を変換する。これによって、スキャナドライバは、画像読み取り装置10により読み取られた画像に対して夕焼けまたは朝焼けの逆光画像のための補正処理を施す。
<Correction process>
Then, the scanner driver generates three points Pr1, Pr2, Pr3, Pg1, Pg2, Pg3 for each color for adjusting the tone curves Tcr, Tcg, Tcb of each color in “density correction” generated as correction information in this way. Based on the information on Pb1, Pb2, and Pb3, the image read by the image reading device 10 is subjected to correction processing for a backlight image of sunset or sunrise. Specifically, in the “density correction” in the adjustment procedure described with reference to FIG. 11, information regarding three points Pr1, Pr2, Pr3, Pg1, Pg2, Pg3, Pb1, Pb2, and Pb3 generated as correction information is included. Based on the tone curves Tcr, Tcg, and Tcb adjusted based on the above, the density value of each color of the data of each pixel constituting the image read by the image reading device 10 is converted. As a result, the scanner driver performs a correction process for the backlight image of sunset or sunrise on the image read by the image reading device 10.

なお、ここで夕焼けまたは朝焼けの逆光画像のための補正処理が施される画像は、図11に示す調整手順に従って、既にヒストグラム調整やイメージ調整((3)彩度の調整を除く)等が施された画像である。スキャナドライバは、このようにして既にヒストグラム調整やイメージ調整((3)彩度の調整を除く)等が施された画像に対して「濃度補正」により夕焼けまたは朝焼けの逆光画像のための補正処理を施す。   Here, the image subjected to the correction process for the sunset or sunrise backlight image has already been subjected to histogram adjustment, image adjustment (excluding (3) saturation adjustment) and the like according to the adjustment procedure shown in FIG. It is an image that was made. The scanner driver performs correction processing for a backlight image at sunset or sunrise by “density correction” on an image that has already been subjected to histogram adjustment or image adjustment (excluding (3) saturation adjustment). Apply.

図38Aおよび図38Bは、夕焼けまたは朝焼けの逆光画像の補正処理前と補正処理後のRGB各色の平均値を示したものである。図38Aは、補正処理前のRGB各色の平均値を示している。図38Bは、補正処理後のRGB各色の平均値を示している。   FIG. 38A and FIG. 38B show average values of RGB colors before and after correction processing of a sunset or morning backlight image. FIG. 38A shows an average value of each color of RGB before the correction process. FIG. 38B shows the average value of each RGB color after the correction processing.

補正処理前には、図38Aに示すように、3つの小領域Ry1、Ry2、Ry3を占める画素のRGB各色の濃度値の平均値は、小領域Ry3、即ちハイライトの領域において、特定の色(レッド(R))が大きくなっている。一方、小領域Ry1、Ry2、即ちシャドウの領域および中間調の領域では、RGB各色の濃度値の平均値が非常に小さくなっている。   Before the correction processing, as shown in FIG. 38A, the average value of the density values of the RGB colors of the pixels occupying the three small areas Ry1, Ry2, and Ry3 is the specific color in the small area Ry3, that is, the highlight area. (Red (R)) is larger. On the other hand, in the small areas Ry1, Ry2, that is, in the shadow area and the halftone area, the average value of the density values of the RGB colors is very small.

一方、補正処理後には、図38Bに示すように、RGB各色の小領域Ry1の平均値AVr1、AVg1、AVb1が、各色共通の目標値Ym1になるように、それぞれ設定される。このことから、RGB各色の小領域Ry1の平均値AVr1、AVg1、AVb1は、共にほぼ同じ値に設定されて、シャドウの領域の画質が改善される。   On the other hand, after the correction processing, as shown in FIG. 38B, the average values AVr1, AVg1, and AVb1 of the RGB small color regions Ry1 are set to be the target values Ym1 common to the respective colors. For this reason, the average values AVr1, AVg1, and AVb1 of the RGB small color regions Ry1 are all set to substantially the same value, and the image quality of the shadow region is improved.

また、RGB各色の小領域Ry2については、補正前のRGB各色の平均値の比率が保持されるように、RGB各色の小領域Ry2の平均値AVr2、AVg2、AVb2が、各色個別の目標値Ym2、Mg2、Mb2になるようにそれぞれ設定される。このことから、RGB各色の小領域Ry2の平均値AVr2、AVg2、AVb2は、補正前の比率を保持されたまま、中間調の領域の画質が改善される。   In addition, for the RGB small area Ry2, the average values AVr2, AVg2, and AVb2 of the RGB small areas Ry2 are set to individual target values Ym2 so that the ratio of the average values of the RGB colors before correction is maintained. , Mg2, and Mb2. Therefore, the average values AVr2, AVg2, and AVb2 of the RGB small color regions Ry2 improve the image quality of the halftone region while maintaining the ratio before correction.

図39は、この補正処理において生成されるRGB各色のトーンカーブTcr、Tcg、Tcbの一例を説明したものである。RGB各色のトーンカーブTcr、Tcg、Tcbは、同図に示すように、それぞれ異なる形状に形成される。これは、RGB各色のトーンカーブTcr、Tcg、Tcbを形成するために設定される任意のポイント(例えば、レッド(R)のトーンカーブTcrの場合、ポイントPr1、Pr2、Pr3など)が、RGB各色毎にそれぞれ個別に設定されるからである。そして、ここでは、同図に示すように、シャドウの領域の他に、中間調の領域やハイライトの領域にも十分に補正が施されるように、RGB各色のトーンカーブTcr、Tcg、Tcbが形成されている。このようにRGB各色のトーンカーブTcr、Tcg、Tcbが形成されていることで、夕焼けまたは朝焼けの逆光画像に対して適切な補正処理を施すことができる。   FIG. 39 illustrates an example of tone curves Tcr, Tcg, and Tcb for each color of RGB generated in this correction process. The tone curves Tcr, Tcg, and Tcb for each color of RGB are formed in different shapes as shown in FIG. This is because arbitrary points set to form tone curves Tcr, Tcg, and Tcb for each color of RGB (for example, points Pr1, Pr2, and Pr3 in the case of the tone curve Tcr of red (R)) This is because each is set individually. In this case, as shown in the figure, the tone curves Tcr, Tcg, Tcb for each of the RGB colors are applied so that the halftone area and the highlight area are sufficiently corrected in addition to the shadow area. Is formed. As described above, the tone curves Tcr, Tcg, and Tcb for each color of RGB are formed, so that an appropriate correction process can be performed on the backlight image of sunset or sunrise.

図40Aおよび図40Bは、補正処理前と補正処理後のRGB各色のヒストグラムの一例を示したものである。図40Aは、補正処理前のRGB各色のヒストグラムを示したものである。図40Bは、補正処理後のRGB各色のヒストグラムを示したものである。   FIG. 40A and FIG. 40B show an example of a histogram for each color of RGB before and after the correction process. FIG. 40A shows a histogram of each color of RGB before correction processing. FIG. 40B shows a histogram of each color of RGB after the correction process.

補正処理前は、図40Aに示すように、シャドウの領域と、ハイライトの領域とに画素が偏った典型的な逆光画像の特性を有している。一方、補正処理後は、図40Bに示すように、レッド(R)、グリーン(G)およびブルー(B)の各色のヒストグラムは、シャドウの領域から、中間調の領域、ハイライトの領域にかけて全体的に明るくなるように改善されている。   Before the correction processing, as shown in FIG. 40A, the image has a typical backlight image characteristic in which pixels are biased between a shadow area and a highlight area. On the other hand, after the correction processing, as shown in FIG. 40B, the histogram of each color of red (R), green (G), and blue (B) is entirely from the shadow region to the halftone region and the highlight region. It has been improved to become brighter.

===その他応用例===
ここでは、レッド(R)、グリーン(G)およびブルー(B)の3色のヒストグラムにより表される領域をそれぞれ4つの小領域Ry1、Ry2、Ry3、Ry4に区分していたが、必ずしもこのように4つの小領域Ry1、Ry2、Ry3、Ry4に区分する必要はない。つまり、レッド(R)、グリーン(G)およびブルー(B)の3色のヒストグラムにより表される領域は、少なくとも3つ以上の小領域に区分されれば良く、3つの小領域に区分されても良く、また5つ以上の小領域に区分されても良い。
=== Other application examples ===
Here, the regions represented by the histograms of three colors of red (R), green (G), and blue (B) are divided into four small regions Ry1, Ry2, Ry3, and Ry4. It is not necessary to divide into four small regions Ry1, Ry2, Ry3, Ry4. That is, the area represented by the histogram of three colors of red (R), green (G) and blue (B) may be divided into at least three or more small areas. It may also be divided into five or more small areas.

また、ここでは、レッド(R)、グリーン(G)およびブルー(B)の3色のヒストグラムにより表される領域を区分して得られた4つの小領域Ry1、Ry2、Ry3、Ry4に、相互に面積がほぼ等しく、また相互に画素数がほぼ等しい3つの小領域Ry1、Ry2、Ry3が含まれていたが、必ずしもこのように面積や画素数が相互にほぼ等しい小領域が設けられる必要はない。また、必ずしもこのように面積または画素数が相互にほぼ等しい小領域が3つ設けられる場合には限られず、2つであっても良く、また4つ以上であっても良い。   In addition, here, four small regions Ry1, Ry2, Ry3, and Ry4 obtained by dividing the region represented by the histogram of three colors of red (R), green (G), and blue (B) Included three small regions Ry1, Ry2, and Ry3 having almost the same area and the same number of pixels. However, it is necessary to provide a small region having substantially the same area and the same number of pixels. Absent. In addition, the present invention is not necessarily limited to the case where three small regions having substantially the same area or number of pixels are provided as described above, and may be two or four or more.

また、ここでは、「中間調の色バランスが崩れた逆光画像の補正処理」において、レッド(R)、グリーン(G)およびブルー(B)の3色のヒストグラムにより表される領域を区分して得られた4つの小領域Ry1、Ry2、Ry3、Ry4の中から、属性情報を取得するために、3つの小領域Ry1、Ry2、Ry3が選出されていたが、必ずしもこのように選出される場合には限られない。つまり、レッド(R)、グリーン(G)およびブルー(B)の3色のヒストグラムにより表される領域を区分して得られた2つ以上の小領域の中からは、少なくとも1つの小領域を選出すれば良く、3つの小領域Ry1、Ry2、Ry3のうちのいずれか1つのみを選出しても良い。また、ここで説明した方法以外の方法により小領域が区分された場合には、他の手法により小領域を選出しても良い。   Further, here, in the “correction processing of a backlight image in which the halftone color balance is lost”, the regions represented by the histograms of three colors of red (R), green (G), and blue (B) are classified. In order to acquire attribute information from the obtained four small areas Ry1, Ry2, Ry3, and Ry4, three small areas Ry1, Ry2, and Ry3 have been selected. It is not limited to. That is, at least one small region is selected from two or more small regions obtained by dividing the region represented by the histogram of three colors of red (R), green (G), and blue (B). It suffices to select one of the three small regions Ry1, Ry2, and Ry3. In addition, when the small area is divided by a method other than the method described here, the small area may be selected by another method.

また、ここでは、「中間調の色バランスが崩れた逆光画像の補正処理」において、3つの小領域Ry1、Ry2、Ry3からそれぞれ属性情報として、各色別に3つの小領域Ry1、Ry2、Ry3を占める画素の濃度値の平均値AVr1、AVr2、AVr3、AVg1、AVg2、AVg3、AVb1、AVb2、AVb3を取得していたが、必ずしもこのような属性情報を取得しなくても良い。すなわち、選出した小領域から取得する属性情報としては、どのような属性情報であっても良く、例えば、選出した小領域Ry1、Ry2、Ry3を占める画素の濃度値の上限値または下限値や、選出された小領域Ry1、Ry2、Ry3の面積の大きさ等であっても良い。なお、選出した小領域から取得する属性情報としては、「中間調の色バランスが崩れた逆光画像の補正処理」を行う上で有力となる情報が望ましい。   Further, here, in the “correction processing of a backlight image in which the halftone color balance is lost”, three small regions Ry1, Ry2, and Ry3 are occupied for each color as attribute information from the three small regions Ry1, Ry2, and Ry3. Although the average values AVr1, AVr2, AVr3, AVg1, AVg2, AVg3, AVb1, AVb2, and AVb3 of the density values of the pixels are acquired, such attribute information is not necessarily acquired. In other words, the attribute information acquired from the selected small area may be any attribute information, for example, the upper limit value or lower limit value of the density value of the pixels occupying the selected small areas Ry1, Ry2, Ry3, It may be the size of the area of the selected small regions Ry1, Ry2, and Ry3. Note that the attribute information acquired from the selected small area is preferably information that is useful in performing “correction processing of a backlight image in which the halftone color balance is lost”.

また、ここでは、「中間調の色バランスが崩れた逆光画像の補正処理」において、小領域Ry1、Ry2、Ry3からそれぞれ属性情報として取得した、各色別に小領域Ry1、Ry2、Ry3を占める画素の濃度値の平均値AVr1、AVr2、AVr3、AVg1、AVg2、AVg3、AVb1、AVb2、AVb3に基づき、輝度に関する情報を取得し、さらにその輝度に関する情報に基づき2つの目標値Ym1、Ym2を取得して、それらの目標値Ym1、Ym2に基づき補正処理を実行していたが、ここで行われる補正処理にあっては、必ずしもこのような方法により実行されなくても構わない。つまり、3つの小領域Ry1、Ry2、Ry3から取得した属性情報に基づき目標値を取得して、他の方法により補正処理が実行されても良い。   In addition, here, in the “correction process for a backlight image in which the halftone color balance is lost”, the pixels occupying the small regions Ry1, Ry2, and Ry3 for each color obtained as attribute information from the small regions Ry1, Ry2, and Ry3, respectively. Based on the average values AVr1, AVr2, AVr3, AVg1, AVg2, AVg3, AVb1, AVb2, and AVb3 of the density value, information on luminance is obtained, and two target values Ym1 and Ym2 are obtained based on the information on the luminance. Although the correction processing is executed based on the target values Ym1 and Ym2, the correction processing performed here does not necessarily have to be executed by such a method. That is, the target value may be acquired based on the attribute information acquired from the three small areas Ry1, Ry2, and Ry3, and the correction process may be executed by another method.

また、ここでは、「中間調の色バランスが崩れた逆光画像の補正処理」として、「濃度補正」においてトーンカーブTcr、Tcg、Tcbを調整することにより実施していたが、必ずしもこのような方法により補正処理が施される必要はない。すなわち、中間調の色バランスが崩れた逆光画像に対する補正処理であれば、どのような補正処理が実行されても構わない。   Further, here, the “correction processing of the backlight image in which the halftone color balance is lost” is performed by adjusting the tone curves Tcr, Tcg, Tcb in “density correction”, but such a method is not necessarily performed. Therefore, the correction process need not be performed. That is, any correction process may be executed as long as it is a correction process for a backlight image whose halftone color balance is lost.

===まとめ===
以上、本実施形態にあっては、画像読み取り装置10により読み取られた画像を構成する各画素のデータに基づき、レッド(R)、グリーン(G)およびブルー(B)の3色のヒストグラムを生成して、これらのヒストグラムにより表される領域をそれぞれ4つの小領域Ry1、Ry2、Ry3、Ry4に区分して、これら4つの小領域Ry1、Ry2、Ry3、Ry4の中から3つの小領域Ry1、Ry2、Ry3を各色別に選出して、これら3つの小領域Ry1、Ry2、Ry3からそれぞれ属性情報を取得して、これらの属性情報に基づき、目標値Ym1、Ym2を取得して、その目標値Ym1、Ym2に基づき、画像読み取り装置10により読み取られた画像に対して「中間調の色バランスが崩れた逆光画像の補正処理」を施すから、画像読み取り装置10により読み取られた画像が、中間調の色バランスが崩れた画像である場合に、適切な補正処理を施すことができる。
=== Summary ===
As described above, in the present embodiment, a histogram of three colors of red (R), green (G), and blue (B) is generated based on the data of each pixel constituting the image read by the image reading device 10. Then, the regions represented by these histograms are divided into four small regions Ry1, Ry2, Ry3, Ry4, respectively, and three small regions Ry1, Ry2, Ry3, Ry4 are selected from these four small regions Ry1, Ry2, Ry3, Ry4. Ry2 and Ry3 are selected for each color, attribute information is acquired from each of these three small regions Ry1, Ry2, and Ry3, and target values Ym1 and Ym2 are acquired based on these attribute information, and the target value Ym1 , Ym2 is applied to the image read by the image reading device 10 so that “a correction process for a backlight image in which the halftone color balance is lost” is performed. Image read by 0, if the color balance of intermediate tones is an image destroyed, it can be subjected to appropriate correction processing.

また、「中間調の色バランスが崩れた逆光画像の補正処理」において、レッド(R)、グリーン(G)およびブルー(B)の各色のヒストグラムにより表される領域をそれぞれ区分して得られた4つの小領域Ry1、Ry2、Ry3、Ry4の中に、相互に面積および画素数がほぼ等しい3つの小領域Ry1、Ry2、Ry3が設けられ、これら3つの小領域Ry1、Ry2、Ry3からそれぞれ属性情報を取得することで、画像読み取り装置10により読み取られた画像が、中間調の色バランスが崩れた画像である場合に、適切な補正処理を施すことができる。   In addition, in “correction processing of backlight image in which halftone color balance is lost”, the regions represented by the histograms of the colors of red (R), green (G), and blue (B) were obtained respectively. In the four small regions Ry1, Ry2, Ry3, Ry4, there are provided three small regions Ry1, Ry2, Ry3 having substantially the same area and the same number of pixels, and attributes from these three small regions Ry1, Ry2, Ry3, respectively. By acquiring the information, when the image read by the image reading device 10 is an image in which the halftone color balance is lost, an appropriate correction process can be performed.

また、「中間調の色バランスが崩れた逆光画像の補正処理」において、属性情報として、選出された3つの小領域Ry1、Ry2、Ry3を占める画素の各色の濃度値の平均値AVr1、AVr2、AVr3、AVg1、AVg2、AVg3、AVb1、AVb2、AVb3を取得することで、画像読み取り装置10により読み取られた画像が、中間調の色バランスが崩れた画像である場合に、より適切な補正処理を施すことができる。   Further, in the “correction processing of a backlight image in which the halftone color balance is lost”, as the attribute information, the average values AVr1, AVr2, and the average values AVr1, AVr2, of the color values of the pixels occupying the three selected small regions Ry1, Ry2, Ry3, By acquiring AVr3, AVg1, AVg2, AVg3, AVb1, AVb2, and AVb3, a more appropriate correction process is performed when the image read by the image reading device 10 is an image in which the halftone color balance is lost. Can be applied.

また、「中間調の色バランスが崩れた逆光画像の補正処理」において、選出された3つの小領域Ry1、Ry2、Ry3を占める画素の各色の濃度値の平均値AVr1、AVr2、AVr3、AVg1、AVg2、AVg3、AVb1、AVb2、AVb3に基づき、3つの小領域Ry1、Ry2、Ry3を占める画素の輝度の平均値Yav1、Yav2、Yav3を取得することで、画像読み取り装置10により読み取られた画像が、中間調の色バランスが崩れた画像である場合に、より適切な補正処理を施すことができる。   In the “correction process for a backlight image in which the halftone color balance is lost”, the average values AVr1, AVr2, AVr3, AVg1, and the average density values of the colors of the pixels occupying the three selected small regions Ry1, Ry2, Ry3, Based on AVg2, AVg3, AVb1, AVb2, and AVb3, the average luminance values Yav1, Yav2, and Yav3 of the pixels that occupy the three small regions Ry1, Ry2, and Ry3 are obtained, so that the image read by the image reading device 10 can be obtained. In the case of an image in which the halftone color balance is lost, more appropriate correction processing can be performed.

また、「中間調の色バランスが崩れた逆光画像の補正処理」において、取得した小領域Ry1を占める画素の輝度の平均値Yav1と、画像の全体の輝度の平均値Yav0とを加算して加算値Saddを取得することで、より適切な目標値を取得することができる。これによって、像読み取り装置10により読み取られた画像が、中間調の色バランスが崩れた画像である場合に、より適切な補正処理を施すことができる。   In addition, in the “correction processing of a backlight image in which a halftone color balance is lost”, the average luminance value Yav1 of the pixels occupying the acquired small region Ry1 and the average luminance value Yav0 of the entire image are added and added. By acquiring the value Sadd, a more appropriate target value can be acquired. Accordingly, when the image read by the image reading device 10 is an image in which the halftone color balance is lost, more appropriate correction processing can be performed.

また、「中間調の色バランスが崩れた逆光画像の補正処理」として、「濃度補正」を実行することで、画像読み取り装置10により読み取られた画像に対して簡単に「中間調の色バランスが崩れた逆光画像の補正処理」を施すことができる。   In addition, by executing “density correction” as “backlight image correction processing in which the halftone color balance is lost”, an image read by the image reading apparatus 10 can be easily displayed. A correction process for a broken backlight image ”can be performed.

===印刷装置への適用===
このような画像読み取り装置10にあっては、印刷装置に搭載されても良い。図41は、このような画像読み取り装置10を備えた印刷装置220の構成例を説明したものである。この印刷装置220は、原稿から画像を読み取って画像データを生成するスキャナ機能と、ホストコンピュータ248から送られてきた印刷データに基づき印刷用紙等の各種媒体に印刷を施すプリンタ機能と、原稿から読み取った画像を媒体に印刷して複写するローカルコピー機能とを備えた複合装置である。この印刷装置220は、原稿から画像を読み取るスキャナ部222(スキャナ制御部238を含め、ここでいう「画像読み取り装置10」に相当する)と、印刷用紙等の媒体Sに印刷を施すプリンタ部224とを備えている。
=== Application to printing apparatus ===
Such an image reading apparatus 10 may be mounted on a printing apparatus. FIG. 41 illustrates a configuration example of the printing apparatus 220 including such an image reading apparatus 10. The printing apparatus 220 includes a scanner function for reading an image from a document and generating image data, a printer function for printing on various media such as printing paper based on print data sent from the host computer 248, and a reading function from the document. And a local copy function for copying a printed image on a medium. The printing apparatus 220 includes a scanner unit 222 that reads an image from a document (including the scanner control unit 238 and corresponds to the “image reading apparatus 10” herein), and a printer unit 224 that performs printing on a medium S such as printing paper. And.

さらにこの印刷装置220の制御部226には、同図に示すように、CPU228と、メモリ230と、外部通信インターフェイス232と、操作入力インターフェイス234と、表示制御部236と、スキャナ制御部238と、画像処理部240と、プリンタ制御部242と、カードインターフェイス244と、これらを相互に接続するバス246とを備えている。   Further, the control unit 226 of the printing apparatus 220 includes a CPU 228, a memory 230, an external communication interface 232, an operation input interface 234, a display control unit 236, a scanner control unit 238, as shown in FIG. An image processing unit 240, a printer control unit 242, a card interface 244, and a bus 246 for connecting them to each other are provided.

CPU228は、この印刷装置220全体の制御を司る。メモリ230は、CPU228により実行されるプログラムやそのプログラムで使用されるデータ等が格納される。外部通信インターフェイス232は、ホストコンピュータ248との間で有線または無線等により通信を行う。操作入力インターフェイス234は、操作ボタン250等を通じてユーザから操作入力を受け付ける。表示制御部236は、液晶ディスプレイ252等の表示部を制御する。   The CPU 228 controls the entire printing apparatus 220. The memory 230 stores a program executed by the CPU 228, data used in the program, and the like. The external communication interface 232 communicates with the host computer 248 by wire or wireless. The operation input interface 234 receives an operation input from the user through the operation button 250 or the like. The display control unit 236 controls a display unit such as the liquid crystal display 252.

一方、スキャナ制御部238は、スキャナ部222を制御して原稿から画像を読み取る読み取り動作を実行する。画像処理部240は、スキャナ部222により原稿から読み取られた画像をプリンタ部224にて媒体に印刷するために、スキャナ部222から出力された画像のデータをプリンタ部224にて印刷処理を実行するためのデータに変換する役割を果たす。プリンタ制御部242は、プリンタ部224を制御する。また、カードインターフェイス244は、カードリーダー部254にセットされた各種メモリカードから、当該メモリカードに格納された画像データを読み込む処理等を行う。   On the other hand, the scanner control unit 238 controls the scanner unit 222 to execute a reading operation for reading an image from a document. The image processing unit 240 executes print processing on the image data output from the scanner unit 222 by using the printer unit 224 in order to print an image read from the document by the scanner unit 222 on a medium by the printer unit 224. To play a role in converting data. The printer control unit 242 controls the printer unit 224. The card interface 244 performs processing for reading image data stored in the memory card from various memory cards set in the card reader unit 254.

そして、この印刷装置220は、スキャナ機能時には、スキャナ部222により原稿から読み取った画像のデータをホストコンピュータ248に出力する。また、プリンタ機能時には、この印刷装置220は、ホストコンピュータ248から送られてきた印刷データに基づき、プリンタ部224によって各種媒体に印刷を施す。また、ローカルコピー機能時には、この印刷装置220は、スキャナ部222により原稿から読み取った画像をプリンタ部224によって各種媒体に印刷して複写する。   In the scanner function, the printing apparatus 220 outputs image data read from the document by the scanner unit 222 to the host computer 248. In the printer function, the printing apparatus 220 performs printing on various media by the printer unit 224 based on the print data sent from the host computer 248. In the local copy function, the printing apparatus 220 prints an image read from a document by the scanner unit 222 on various media by the printer unit 224 and copies it.

===その他の実施の形態===
以上、本発明について画像読み取りシステムの一実施形態を例にして説明したが、上記の実施の形態は、本発明の理解を容易にするためのものであり、本発明を限定して解釈するためのものではない。本発明は、その趣旨を逸脱することなく、変更または改良され得るとともに、本発明には、その等価物が含まれることは言うまでもない。特に、以下に述べる実施形態であっても、本発明に含まれるものである。
=== Other Embodiments ===
The present invention has been described above by taking an embodiment of an image reading system as an example. However, the above embodiment is for facilitating the understanding of the present invention, and is intended to limit the present invention. Is not. The present invention can be changed or improved without departing from the gist thereof, and needless to say, the present invention includes equivalents thereof. In particular, the embodiments described below are also included in the present invention.

<画像について>
前述した実施の形態では、画像として、画像読み取り装置10により読み取られた画像を例にして説明したが、ここでいう「画像」としては、どのような画像であっても良い。例えば、具体的には、デジタルカメラ等により撮影された画像などであっても良い。また、画像の形式としては、どのようなタイプであっても良く、例えば、JPEG形式やビットマップ形式、YUV形式等の各種形式により表現される画像であっても良い。
<About images>
In the above-described embodiment, the image read by the image reading apparatus 10 has been described as an example. However, the “image” referred to here may be any image. For example, specifically, an image taken by a digital camera or the like may be used. The image format may be any type, for example, an image expressed in various formats such as a JPEG format, a bitmap format, and a YUV format.

<濃度値について>
前述した実施の形態では、「濃度値」として、256階調にて表現される濃度値、即ち例えば「0」〜「255」の値を取り得る濃度値を例にして説明したが、ここでいう「濃度値」にあっては、このような濃度値には限らない。すなわち、ここでいう「濃度値」にあっては、画像を構成する各画素の濃淡を表現するためのデータであればどのような濃度値であっても良い。なお、この「濃度値」には、YUV形式等により表される輝度の濃度値も含まれる。
<About concentration values>
In the above-described embodiment, the density value expressed in 256 gradations, that is, the density value that can take values of “0” to “255”, for example, has been described as an example. The “density value” is not limited to such a density value. In other words, the “density value” here may be any density value as long as it is data for expressing the density of each pixel constituting the image. The “density value” includes a brightness density value expressed in a YUV format or the like.

<ヒストグラムについて>
前述した実施の形態では、「ヒストグラムのデータ」として、レッド(R)、グリーン(G)およびブルー(B)の3色のヒストグラムのデータが生成されていたが、ここでいう「ヒストグラムのデータ」にあっては、必ずしもこれらレッド(R)、グリーン(G)およびブルー(B)の3色のヒストグラムのデータが生成される場合には限られない。つまり、少なくとも2種類以上の異なる色のヒストグラムのデータが「ヒストグラムのデータ」として生成されても良い。
<About the histogram>
In the embodiment described above, histogram data of three colors of red (R), green (G), and blue (B) is generated as “histogram data”. In this case, it is not always the case that the histogram data of these three colors of red (R), green (G) and blue (B) is generated. That is, at least two types of histogram data of different colors may be generated as “histogram data”.

<ヒストグラムデータ生成部について>
前述した実施の形態では、「ヒストグラムデータ生成部」として、スキャナドライバが、画像、即ちここでは画像読み取り装置10により読み取られた画像を構成する画素のデータに基づき、ヒストグラムのデータを生成していたが、ここでいう「ヒストグラムデータ生成部」にあっては、必ずしもこのようなスキャナドライバである必要はない。つまり、ここでいう「ヒストグラムデータ生成部」にあっては、判定対象となる画像を構成する画素のデータに基づき、ヒストグラムのデータを生成するのであれば、どのようなタイプの「ヒストグラムデータ生成部」であっても構わない。
<About the histogram data generator>
In the above-described embodiment, as the “histogram data generation unit”, the scanner driver generates histogram data based on the data of the pixels constituting the image, that is, the image read by the image reading device 10 here. However, the “histogram data generation unit” here does not necessarily need to be such a scanner driver. In other words, in the “histogram data generation unit” here, any type of “histogram data generation unit” can be used as long as histogram data is generated based on the data of the pixels constituting the image to be determined. It does not matter.

<属性情報取得部について>
前述した実施の形態では、「属性情報取得部」として、スキャナドライバが、レッド(R)、グリーン(G)およびブルー(B)の各色のヒストグラムにより表される領域を濃度値の大きさ別に3つ以上の小領域に区分して、これら3つ以上の小領域の中から少なくとも1つの小領域を選出して、この選出した小領域から属性情報を取得していたが、ここでいう「属性情報取得部」にあっては、必ずしもこのようなスキャナドライバである必要はない。つまり、ここでいう「属性情報取得部」にあっては、前述したような手法により属性情報を取得するのであれば、どのようなタイプの「属性情報取得部」であっても構わない。
<About the attribute information acquisition unit>
In the above-described embodiment, as the “attribute information acquisition unit”, the scanner driver determines that the region represented by the histogram of each color of red (R), green (G), and blue (B) is divided into three by density value size. It was divided into two or more small areas, and at least one small area was selected from these three or more small areas, and attribute information was acquired from the selected small areas. The “information acquisition unit” does not necessarily need to be such a scanner driver. In other words, the “attribute information acquisition unit” here may be any type of “attribute information acquisition unit” as long as the attribute information is acquired by the method described above.

<目標値取得部について>
前述した実施の形態では、「目標値取得部」として、スキャナドライバが、レッド(R)、グリーン(G)およびブルー(B)の各色のヒストグラムにより表される領域を濃度値の大きさ別に区分して得られた3つ以上の小領域から、ある小領域よりも濃度値が大きくかつ他の小領域よりも濃度値が小さい小領域を選出小領域として少なくとも1つ各色別に選出して、取得した属性情報に基づき、選出小領域に関する属性情報について各色共通の目標値を取得していたが、ここでいう「目標値取得部」にあっては、必ずしもこのようなスキャナドライバである必要はない。つまり、ここでいう「目標値取得部」にあっては、前述したスキャナドライバに限られず、どのようなタイプのものであっても構わない。
<About the target value acquisition unit>
In the above-described embodiment, as the “target value acquisition unit”, the scanner driver classifies the region represented by the histogram of each color of red (R), green (G), and blue (B) according to the size of the density value. Acquired by selecting at least one small area with a density value larger than a small area and smaller density value than other small areas for each color. Based on the attribute information, the target value common to each color was acquired for the attribute information related to the selected small area, but the “target value acquisition unit” here does not necessarily need to be such a scanner driver. . In other words, the “target value acquisition unit” here is not limited to the scanner driver described above, and may be of any type.

<画像補正装置について>
前述した実施の形態では、「画像補正装置」として、画像読み取り装置10に読み取られた画像について中間調などの色バランスが崩れた逆光画像に対して補正処理をする装置を例にして説明したが、ここでいう「画像補正装置」にあっては、このような画像読み取り装置10に読み取られた画像に対して補正処理をする装置には限られない。すなわち、画像の種類は問われず、各種画像について補正処理をする装置であれば、どのようなタイプの装置も、ここでいう「画像補正装置」に含まれる。
<Image correction device>
In the above-described embodiment, the “image correction apparatus” has been described by taking an example of an apparatus that performs correction processing on a backlight image in which color balance such as halftone is lost for an image read by the image reading apparatus 10. The “image correction apparatus” here is not limited to an apparatus that performs correction processing on an image read by the image reading apparatus 10. That is, the type of image is not limited, and any type of device is included in the “image correction device” as long as the device performs correction processing on various images.

<画像補正プログラムについて>
前述した実施の形態では、「画像補正プログラム」として、スキャナドライバが画像読み取り装置10に有線または無線等により通信可能に接続されたコンピュータ装置20において実行されていたが、ここでいう「画像補正プログラム」にあっては、このようなスキャナドライバには限られない。すなわち、ここでいう「画像補正プログラム」にあっては、中間調などの色バランスが崩れた逆光画像に対して補正処理を施すプログラムであれば、どのようなプログラムであっても良い。
<About image correction program>
In the above-described embodiment, the scanner driver is executed as the “image correction program” in the computer device 20 that is communicably connected to the image reading device 10 by wired or wireless communication. Is not limited to such a scanner driver. In other words, the “image correction program” here may be any program as long as it is a program that performs correction processing on a backlight image in which the color balance such as halftone is lost.

<画像読み取り装置について>
前述した実施の形態では、「画像読み取り装置」として、画像を読み取るイメージセンサ50が、原稿台12にセットされた原稿15に対して相対的に移動するキャリッジ40に設けられた画像読み取り装置を例にして説明したが、ここでいう「画像読み取り装置」にあっては、必ずしもこのようなタイプの「画像読み取り装置」には限られない。つまり、原稿から画像を読み取る装置であれば、どのようなタイプの装置もここでいう「画像読み取り装置」に含まれる。すなわち、ここでいう「画像読み取り装置」にあっては、原稿15が画像を読み取るイメージセンサ50に対して相対的に移動して原稿15から画像を読み取るような画像読み取り装置も含まれる。
<About image reader>
In the above-described embodiment, the “image reading device” is an image reading device in which the image sensor 50 that reads an image is provided on the carriage 40 that moves relative to the document 15 set on the document table 12. As described above, the “image reading apparatus” here is not necessarily limited to this type of “image reading apparatus”. In other words, any type of apparatus is included in the “image reading apparatus” as long as the apparatus reads an image from a document. That is, the “image reading device” here includes an image reading device in which the document 15 moves relative to the image sensor 50 that reads an image and reads an image from the document 15.

<印刷装置について>
前述した実施の形態では、「印刷装置」として、原稿15から画像を読み取って画像データを生成する画像読み取り部(スキャナ部222)と、媒体に対して印刷を施す印刷部(プリンタ部224)とを備えた「複合装置」の場合を例にして説明したが、ここでいう「印刷装置」にあっては、必ずしもこのように画像読み取り部(スキャナ部222(スキャナ制御部238や画像処理部240等も含む))を備えている必要はない。すなわち、ここでいう「印刷装置」としては、媒体に対して印刷を施す印刷部を少なくとも備えていれば良い。
<About printing devices>
In the above-described embodiment, as the “printing device”, an image reading unit (scanner unit 222) that reads an image from the document 15 and generates image data, and a printing unit (printer unit 224) that performs printing on a medium. However, the “printing apparatus” described here is not necessarily limited to the image reading unit (scanner unit 222 (scanner control unit 238 or image processing unit 240). Etc.))) is not necessary. In other words, the “printing apparatus” here may include at least a printing unit that performs printing on a medium.

画像読み取りシステムの一実施形態の説明図。1 is an explanatory diagram of an embodiment of an image reading system. FIG. 画像読み取り装置の内部構成の一例の説明図。FIG. 3 is an explanatory diagram illustrating an example of an internal configuration of an image reading apparatus. 画像読み取り装置のシステム構成の一例の説明図。1 is an explanatory diagram illustrating an example of a system configuration of an image reading apparatus. FIG. コンピュータ本体のシステム構成の一例の説明図。Explanatory drawing of an example of the system configuration | structure of a computer main body. スキャナドライバのメインのダイアログボックスの一例の説明図。FIG. 3 is an explanatory diagram illustrating an example of a main dialog box of a scanner driver. ヒストグラム調整のダイアログボックスの一例の説明図。FIG. 6 is an explanatory diagram illustrating an example of a dialog box for adjusting a histogram. トーンカーブの規定方法についての説明図。Explanatory drawing about the definition method of a tone curve. 濃度補正のダイアログボックスの一例の説明図。FIG. 4 is an explanatory diagram of an example of a density correction dialog box. イメージ調整のダイアログボックスの一例の説明図。Explanatory drawing of an example of the dialog box of an image adjustment. ヒストグラム調整により設定されるデータの説明図。Explanatory drawing of the data set by histogram adjustment. 濃度補正により設定されるデータの説明図。Explanatory drawing of the data set by density correction. イメージ調整により設定されるデータの説明図。Explanatory drawing of the data set by image adjustment. 画像の調整手順の一例の説明図。Explanatory drawing of an example of the adjustment procedure of an image. 画像読み取り手順の一例の説明図。Explanatory drawing of an example of an image reading procedure. 本実施形態の画像補正方法を説明するフローチャート。6 is a flowchart illustrating an image correction method according to the present embodiment. スキャナドライバの逆光補正の処理手順の一例を説明するフローチャート。6 is a flowchart for explaining an example of a processing procedure for backlight correction of a scanner driver. 逆光画像の判定方法を説明するフローチャート。The flowchart explaining the determination method of a backlight image. ヒストグラムの一例の説明図。An explanatory view of an example of a histogram. 逆光画像ではないと判定する場合の説明図。Explanatory drawing in the case of determining not to be a backlight image. 逆光画像であると判定する場合の説明図。Explanatory drawing in the case of determining with it being a backlight image. 中間調の色バランスが崩れた画像のレッド(R)のヒストグラムの一例の説明図。FIG. 6 is an explanatory diagram illustrating an example of a red (R) histogram of an image in which a halftone color balance is lost. 中間調の色バランスが崩れた画像のグリーン(G)のヒストグラムの一例の説明図。FIG. 5 is an explanatory diagram illustrating an example of a green (G) histogram of an image in which a halftone color balance is lost. 中間調の色バランスが崩れた画像のブルー(B)のヒストグラムの一例の説明図。Explanatory drawing of an example of the histogram of the blue (B) of the image where the color balance of the halftone was broken. 中間調の色バランスが崩れた画像の判定における小領域の選出方法の説明図。Explanatory drawing of the selection method of the small area | region in the determination of the image in which the color balance of halftone collapsed. 中間調の色バランスが崩れた画像であると判定される場合の説明図。Explanatory drawing when it determines with it being an image in which the color balance of the halftone collapsed. 中間調の色バランスが崩れた画像ではないと判定される場合の説明図。Explanatory drawing in the case of determining that it is not an image in which the halftone color balance is lost. 中間調の色バランスが崩れた画像の判定処理の一例を示すフローチャート。6 is a flowchart illustrating an example of an image determination process in which a halftone color balance is lost. 夕焼けまたは朝焼けの画像のレッド(R)のヒストグラムの一例の説明図。Explanatory drawing of an example of the histogram of red (R) of the image of sunset or sunrise. 夕焼けまたは朝焼けの画像のグリーン(G)のヒストグラムの一例の説明図。Explanatory drawing of an example of the histogram of green (G) of the image of sunset or sunrise. 夕焼けまたは朝焼けの画像のブルー(B)のヒストグラムの一例の説明図。Explanatory drawing of an example of the histogram of blue (B) of the image of sunset or sunrise. 夕焼け・朝焼けの画像の判定における小領域の選出方法の説明図。Explanatory drawing of the selection method of the small area | region in the determination of the image of sunset / sunrise. 夕焼けまたは朝焼けの画像であると判定される場合の説明図。Explanatory drawing in the case of determining with it being an image of sunset or sunrise. 夕焼けまたは朝焼けの画像ではないと判定される場合の説明図。Explanatory drawing when it determines with it not being an image of a sunset or a morning glow. 夕焼けまたは朝焼けの画像の判定処理の一例を示すフローチャート。The flowchart which shows an example of the determination process of the image of sunset or sunrise. 目標値の取得方法の一例の説明図。Explanatory drawing of an example of the acquisition method of target value. 補正情報の生成方法の一例の説明図。Explanatory drawing of an example of the production | generation method of correction information. ポイントPs1の設定方法の一例の説明図。Explanatory drawing of an example of the setting method of point Ps1. ポイントPs2の設定方法の一例の説明図。Explanatory drawing of an example of the setting method of point Ps2. ポイントPs1の入力値『X1』の他の設定方法の一例の説明図。Explanatory drawing of an example of the other setting method of input value "X1" of point Ps1. ポイントPs2の入力値『X2』の他の設定方法の一例の説明図。Explanatory drawing of an example of the other setting method of input value "X2" of point Ps2. ポイントPs3の入力値『X3』の他の設定方法の一例の説明図。Explanatory drawing of an example of the other setting method of input value "X3" of point Ps3. レッド(R)のトーンカーブの調整方法の一例の説明図。Explanatory drawing of an example of the adjustment method of the tone curve of red (R). ポイントPr1の設定手順の一例を説明するフローチャート。The flowchart explaining an example of the setting procedure of point Pr1. ポイントPr2の設定手順の一例を説明するフローチャート。The flowchart explaining an example of the setting procedure of point Pr2. 中間調の色バランスが崩れた逆光画像への補正処理前のRGB各色の平均値の説明図。Explanatory drawing of the average value of each RGB color before the correction process to the backlight image where the halftone color balance collapsed. 中間調の色バランスが崩れた逆光画像への補正処理後のRGB各色の平均値の説明図。Explanatory drawing of the average value of each RGB color after the correction process to the backlight image in which the color balance of the halftone collapsed. RGB各色のトーンカーブの一例の説明図。Explanatory drawing of an example of the tone curve of each color of RGB. 補正処理前のRGB各色のヒストグラムの一例の説明図。Explanatory drawing of an example of the histogram of each RGB color before a correction process. 補正処理後のRGB各色のヒストグラムの一例の説明図。Explanatory drawing of an example of the histogram of each RGB color after a correction process. グリーン(G)のトーンカーブの調整方法の一例の説明図。Explanatory drawing of an example of the adjustment method of the tone curve of green (G). ブルー(B)のトーンカーブの調整方法の一例の説明図。Explanatory drawing of an example of the adjustment method of the tone curve of blue (B). ポイントPg2の設定手順の一例を説明するフローチャート。The flowchart explaining an example of the setting procedure of point Pg2. ポイントPb2の設定手順の一例を説明するフローチャート。The flowchart explaining an example of the setting procedure of the point Pb2. 夕焼けまたは朝焼けの逆光画像への補正処理前のRGB各色の平均値の説明図。Explanatory drawing of the average value of each RGB color before the correction process to the backlight image of sunset or morning glow. 夕焼けまたは朝焼けの逆光画像への補正処理後のRGB各色の平均値の説明図。Explanatory drawing of the average value of each RGB color after the correction process to the backlight image of sunset or morning glow. RGB各色のトーンカーブの一例の説明図。Explanatory drawing of an example of the tone curve of each color of RGB. 補正処理前のRGB各色のヒストグラムの一例の説明図。Explanatory drawing of an example of the histogram of each RGB color before a correction process. 補正処理後のRGB各色のヒストグラムの一例の説明図。Explanatory drawing of an example of the histogram of each RGB color after a correction process. 印刷装置の一実施形態を示した説明図。FIG. 3 is an explanatory diagram illustrating an embodiment of a printing apparatus.

符号の説明Explanation of symbols

2 画像読み取りシステム、10 画像読み取り装置、12 原稿台、
14 原稿台カバー、15 原稿、18 ヒンジ部、20 コンピュータ装置、
22 コンピュータ本体、24 表示装置、26 入力装置、
28 FDドライブ装置、30 CD−ROMドライブ装置、
32 読み取り装置、34 キーボード、36 マウス、40 キャリッジ、
42 駆動機構、44 ガイド、46 露光ランプ、48 レンズ、
50 イメージセンサ、52 制御部、54 タイミングベルト、
55 プーリ、56 プーリ、58 駆動モータ、60 コントローラ、
62 モータ制御部、64 ランプ制御部、66 センサ制御部、
68 AFE(Analog Front End)部、70 デジタル処理回路、
72 インターフェイス回路、74 アナログ信号処理回路、
76 A/D変換回路、80 CPU、82 メモリ、
84 HDD(ハードディスクドライブ装置)、86 操作入力部、
88 表示制御部、90 外部通信部、92 バス、
100 ダイアログボックス、102 『モード選択欄』、
104 『設定保存』、106 『原稿設定欄』、108 『出力設定欄』、
110 『調整欄』、112 「原稿種」、114 「読み込み装置」、
116 「自動露出」、118 「イメージタイプ」、120 「解像度」、
122 「原稿サイズ」、124 「出力サイズ」、
126 「スキャンボタン」、127 「プレビューボタン」、
128A ボタン、128B ボタン、128C ボタン、128D ボタン、
130A チェックボックス、130B チェックボックス、
130C チェックボックス、130D チェックボックス、
130E チェックボックス、131 ダイアログボックス、
132 ヒストグラム表示欄、134 トーンカーブ表示欄、
136 グレーバランス調整欄、138 チャンネル欄、
140A スライダー、140B スライダー、
140C スライダー、142A 数値入力欄、142B 数値入力欄、
142C 数値入力欄、142D 数値入力欄、142E 数値入力欄、
143A スポイトボタン、143B スポイトボタン、
143C スポイトボタン、144A 端部カーブ形状変更ボタン、
144B 端部カーブ形状変更ボタン、145 スライダー、
150 ダイアログボックス、152 トーンカーブ表示部、
154 チャンネル欄、156A 数値入力欄、156B 数値入力欄、
158 濃度補正設定保存欄、160 ダイアログボックス、
162A スライダー、162B スライダー、162C スライダー、
162D スライダー、162E スライダー、162F スライダー、
164A 数値入力欄、164B 数値入力欄、164C 数値入力欄、
164D 数値入力欄、164E 数値入力欄、164F 数値入力欄、
220 印刷装置、222 スキャナ部、224 プリンタ部、
226 制御部、228 CPU、230 メモリ、
232 外部通信インターフェイス、234 操作入力インターフェイス、
236 表示制御部、238 スキャナ制御部、240 画像処理部、
242 プリンタ制御部、244 カードインターフェイス、
246 バス、248 ホストコンピュータ、250 操作ボタン、
252 液晶ディスプレイ、254 カードリーダー部
2 image reading system, 10 image reading device, 12 document table,
14 Document cover, 15 Document, 18 Hinge, 20 Computer device,
22 computer body, 24 display device, 26 input device,
28 FD drive device, 30 CD-ROM drive device,
32 readers, 34 keyboards, 36 mice, 40 carriages,
42 Drive mechanism, 44 guide, 46 exposure lamp, 48 lens,
50 image sensor, 52 control unit, 54 timing belt,
55 pulley, 56 pulley, 58 drive motor, 60 controller,
62 motor control unit, 64 lamp control unit, 66 sensor control unit,
68 AFE (Analog Front End) part, 70 Digital processing circuit,
72 interface circuit, 74 analog signal processing circuit,
76 A / D conversion circuit, 80 CPU, 82 memory,
84 HDD (Hard Disk Drive Device), 86 Operation Input Unit,
88 display control unit, 90 external communication unit, 92 bus,
100 dialog box, 102 “mode selection field”,
104 “Save settings”, 106 “Original setting field”, 108 “Output setting field”,
110 “Adjustment field”, 112 “Document type”, 114 “Scanning device”,
116 “Auto Exposure”, 118 “Image Type”, 120 “Resolution”,
122 “Original Size”, 124 “Output Size”,
126 “Scan Button”, 127 “Preview Button”,
128A button, 128B button, 128C button, 128D button,
130A check box, 130B check box,
130C check box, 130D check box,
130E check box, 131 dialog box,
132 Histogram display field, 134 Tone curve display field,
136 Gray balance adjustment field, 138 channel field,
140A slider, 140B slider,
140C slider, 142A numeric input field, 142B numeric input field,
142C Numerical input field, 142D Numerical input field, 142E Numerical input field,
143A syringe button, 143B syringe button,
143C dropper button, 144A end curve shape change button,
144B End curve shape change button, 145 slider,
150 dialog box, 152 tone curve display area,
154 Channel field, 156A Numerical value input field, 156B Numerical value input field,
158 Density correction setting save field, 160 dialog box,
162A slider, 162B slider, 162C slider,
162D slider, 162E slider, 162F slider,
164A Numerical input field, 164B Numerical input field, 164C Numerical input field,
164D numeric input field, 164E numeric input field, 164F numeric input field,
220 printing device, 222 scanner unit, 224 printer unit,
226 control unit, 228 CPU, 230 memory,
232 External communication interface, 234 operation input interface,
236 Display control unit, 238 Scanner control unit, 240 Image processing unit,
242 Printer control unit, 244 card interface,
246 bus, 248 host computer, 250 operation buttons,
252 LCD display, 254 card reader

Claims (20)

(A)画像を構成する画素のデータに基づき、前記画素の各色の濃度値に対する前記画素の数の分布を表わす各色別のヒストグラムのデータを生成するヒストグラムデータ生成部と、
(B)前記ヒストグラムデータ生成部により生成された前記各色別のヒストグラムのデータに基づき、前記各色別のヒストグラムにより表される領域をそれぞれ前記濃度値の大きさ別に3つ以上の小領域に区分して、これら3つ以上の小領域の中から少なくとも1つの小領域を選出して、当該小領域に関する属性情報を各色別に取得する属性情報取得部と、
(C)前記3つ以上の小領域の中から、ある小領域よりも前記濃度値が大きくかつ他の小領域よりも前記濃度値が小さい小領域を選出小領域として少なくとも1つ各色別に選出して、前記属性情報取得部により取得された前記属性情報に基づき、前記選出小領域に関する属性情報について各色共通の目標値を取得する目標値取得部と、
(D)前記選出小領域に関する各色の前記属性情報がそれぞれ、前記目標値取得部により取得された前記各色共通の目標値になるように前記画像に対して補正処理を施す補正処理部と、
(E)を備えたことを特徴とする画像補正装置。
(A) a histogram data generation unit that generates histogram data for each color representing the distribution of the number of pixels with respect to the density value of each color of the pixels based on data of pixels constituting the image;
(B) Based on the histogram data for each color generated by the histogram data generation unit, the area represented by the histogram for each color is divided into three or more small areas for each density value. An attribute information acquisition unit that selects at least one small region from the three or more small regions and acquires attribute information about the small region for each color;
(C) Out of the three or more small areas, at least one small area having the density value larger than a certain small area and smaller than the other small areas is selected as a selected small area for each color. A target value acquisition unit that acquires a target value common to each color for the attribute information related to the selected small region, based on the attribute information acquired by the attribute information acquisition unit;
(D) a correction processing unit that performs correction processing on the image so that the attribute information of each color related to the selected small area becomes a target value common to the colors acquired by the target value acquisition unit;
An image correction apparatus comprising (E).
前記各色別のヒストグラムのデータとして、レッド、グリーンおよびブルーの各色のヒストグラムのデータが前記ヒストグラムデータ生成部により生成されることを特徴とする請求項1に記載の画像補正装置。   The image correction apparatus according to claim 1, wherein the histogram data generation unit generates histogram data for each color of red, green, and blue as the histogram data for each color. 前記3つ以上の小領域には、相互に面積の等しい2つ以上の小領域が含まれることを特徴とする請求項1または2に記載の画像補正装置。   The image correction apparatus according to claim 1, wherein the three or more small regions include two or more small regions having the same area. 前記3つ以上の小領域には、前記画素の数が相互に等しい2つ以上の小領域が含まれることを特徴とする請求項1〜3のいずれか1項に記載の画像補正装置。   The image correction apparatus according to claim 1, wherein the three or more small regions include two or more small regions having the same number of pixels. 前記3つ以上の小領域には、前記画素の数および面積のうちの少なくともいずれか一方が相互に等しい2つ以上の小領域が含まれ、
前記属性情報取得部は、前記画素の数および面積のうちの少なくともいずれか一方が相互に等しい2つ以上の小領域から少なくとも1つの小領域を選出して、当該小領域に関する前記属性情報を取得し、
前記目標値取得部は、前記画素の数および面積のうちの少なくともいずれか一方が相互に等しい2つ以上の小領域から前記選出小領域を選出することを特徴とする請求項1〜4のいずれか1項に記載の画像補正装置。
The three or more small regions include two or more small regions in which at least one of the number and area of the pixels is equal to each other,
The attribute information acquisition unit selects at least one small region from two or more small regions in which at least one of the number and area of the pixels is equal to each other, and acquires the attribute information regarding the small region And
The said target value acquisition part selects the said selection small area | region from two or more small area | regions in which at least any one of the number and the area of the said pixel is mutually equal. The image correction apparatus according to claim 1.
前記選出小領域が、前記ヒストグラムの中間調の領域に位置していることを特徴とする請求項1〜5のいずれか1項に記載の画像補正装置。   The image correction apparatus according to claim 1, wherein the selected small area is located in a halftone area of the histogram. 前記属性情報取得部は、前記属性情報として、前記少なくとも1つの小領域についてそれぞれ前記濃度値の平均値を各色別に取得することを特徴とする請求項1〜6のいずれか1項に記載の画像補正装置。   The image according to any one of claims 1 to 6, wherein the attribute information acquisition unit acquires, as the attribute information, an average value of the density values for each of the at least one small region for each color. Correction device. 前記目標値取得部は、前記属性情報取得部により取得された各色別の前記濃度値の平均値に基づき、前記少なくとも1つの小領域についてそれぞれ輝度に関する情報を取得して、当該輝度に関する情報に基づき前記目標値を取得することを特徴とする請求項7に記載の画像補正装置。   The target value acquisition unit acquires information on luminance for each of the at least one small region based on the average value of the density values for each color acquired by the attribute information acquisition unit, and based on the information on the luminance The image correction apparatus according to claim 7, wherein the target value is acquired. 前記目標値取得部は、前記輝度に関する情報として、前記少なくとも1つの小領域について画素の輝度の平均値を取得することを特徴とする請求項8に記載の画像補正装置。   The image correction apparatus according to claim 8, wherein the target value acquisition unit acquires an average value of luminance of pixels for the at least one small region as the information related to the luminance. 前記目標値取得部は、前記少なくとも1つの小領域について取得した前記輝度の平均値のうちの少なくともいずれか1つと、前記画像の全体の輝度の平均値とを加算して得られた値に基づき、前記目標値を取得することを特徴とする請求項9に記載の画像補正装置。   The target value acquisition unit is based on a value obtained by adding at least one of the average brightness values acquired for the at least one small region and the average brightness value of the entire image. The image correction apparatus according to claim 9, wherein the target value is acquired. 前記補正処理部は、前記補正処理を前記画像に対して施す際に、前記画像を構成する各画素の濃度値を変換することを特徴とする請求項1〜10のいずれか1項に記載の画像補正装置。   The said correction process part converts the density value of each pixel which comprises the said image, when performing the said correction process with respect to the said image, The any one of Claims 1-10 characterized by the above-mentioned. Image correction device. 前記補正処理部は、前記画像に対して前記補正処理を施すために、変換前の濃度値と、変換後の濃度値との対応関係に関する情報を取得することを特徴とする請求項11に記載の画像補正装置。   12. The information processing apparatus according to claim 11, wherein the correction processing unit acquires information about a correspondence relationship between a density value before conversion and a density value after conversion in order to perform the correction process on the image. Image correction device. 前記画像について前記選出小領域における色バランスが崩れた画像であるか否かを判定する判定部を備えたことを特徴とする請求項1〜12のいずれか1項に記載の画像補正装置。   The image correction apparatus according to claim 1, further comprising: a determination unit that determines whether or not the image is an image in which a color balance in the selected small area is lost. 前記補正処理部は、前記判定部により前記画像について前記選出小領域における色バランスが崩れた画像であると判定された場合に、前記画像に対して前記補正処理を施すことを特徴とする請求項13に記載の画像補正装置。   The said correction process part performs the said correction process with respect to the said image, when it determines with the color balance in the said selection small area | region having collapsed about the said image by the said determination part. 14. The image correction apparatus according to 13. (A)画像を構成する画素のデータに基づき、前記画素の各色の濃度値に対する前記画素の数の分布を表わす各色別のヒストグラムのデータを生成するヒストグラムデータ生成部と、
(B)前記ヒストグラムデータ生成部により生成された前記各色別のヒストグラムのデータに基づき、前記各色別のヒストグラムにより表される領域をそれぞれ前記濃度値の大きさ別に3つ以上の小領域に区分して、これら3つ以上の小領域の中から少なくとも1つの小領域を選出して、当該小領域に関する属性情報を各色別に取得する属性情報取得部と、
(C)前記3つ以上の小領域の中から、ある小領域よりも前記濃度値が大きくかつ他の小領域よりも前記濃度値が小さい小領域を選出小領域として少なくとも1つ各色別に選出して、前記属性情報取得部により取得された前記属性情報に基づき、前記選出小領域に関する属性情報について各色共通の目標値を取得する目標値取得部と、
(D)前記選出小領域に関する各色の前記属性情報がそれぞれ、前記目標値取得部により取得された前記各色共通の目標値になるように前記画像に対して補正処理を施す補正処理部と、
(E)を備え、
(F)前記各色別のヒストグラムのデータとして、レッド、グリーンおよびブルーの各色のヒストグラムのデータが前記ヒストグラムデータ生成部により生成され、
(G)前記3つ以上の小領域には、相互に面積の等しい2つ以上の小領域が含まれ、
(H)前記3つ以上の小領域には、前記画素の数が相互に等しい2つ以上の小領域が含まれ、
(I)前記3つ以上の小領域には、前記画素の数および面積のうちの少なくともいずれか一方が相互に等しい2つ以上の小領域が含まれ、前記属性情報取得部は、前記画素の数および面積のうちの少なくともいずれか一方が相互に等しい2つ以上の小領域から少なくとも1つの小領域を選出して、当該小領域に関する前記属性情報を取得し、前記目標値取得部は、前記画素の数および面積のうちの少なくともいずれか一方が相互に等しい2つ以上の小領域から前記選出小領域を選出し、
(J)前記属性情報取得部は、前記属性情報として、前記少なくとも1つの小領域についてそれぞれ前記濃度値の平均値を各色別に取得し、
(K)前記選出小領域が、前記ヒストグラムの中間調の領域に位置しており、
(L)前記属性情報取得部は、前記属性情報として、前記少なくとも1つの小領域についてそれぞれ前記濃度値の平均値を各色別に取得し、
(M)前記目標値取得部は、前記属性情報取得部により取得された各色別の前記濃度値の平均値に基づき、前記少なくとも1つの小領域についてそれぞれ輝度に関する情報を取得して、当該輝度に関する情報に基づき前記目標値を取得し、
(N)前記目標値取得部は、前記輝度に関する情報として、前記少なくとも1つの小領域について画素の輝度の平均値を取得し、
(O)前記目標値取得部は、前記少なくとも1つの小領域について取得した前記輝度の平均値のうちの少なくともいずれか1つと、前記画像の全体の輝度の平均値とを加算して得られた値に基づき、前記目標値を取得し、
(P)前記補正処理部は、前記補正処理を前記画像に対して施す際に、前記画像を構成する各画素の濃度値を変換し、
(Q)前記補正処理部は、前記画像に対して前記補正処理を施すために、変換前の濃度値と、変換後の濃度値との対応関係に関する情報を取得し、
(R)前記画像について前記選出小領域における色バランスが崩れた画像であるか否かを判定する判定部を備え、
(S)前記補正処理部は、前記判定部により前記画像について前記選出小領域における色バランスが崩れた画像であると判定された場合に、前記画像に対して前記補正処理を施すことを特徴とする画像補正装置。
(A) a histogram data generation unit that generates histogram data for each color representing the distribution of the number of pixels with respect to the density value of each color of the pixels based on data of pixels constituting the image;
(B) Based on the histogram data for each color generated by the histogram data generation unit, the area represented by the histogram for each color is divided into three or more small areas for each density value. An attribute information acquisition unit that selects at least one small region from the three or more small regions and acquires attribute information about the small region for each color;
(C) Out of the three or more small areas, at least one small area having the density value larger than a certain small area and smaller than the other small areas is selected as a selected small area for each color. A target value acquisition unit that acquires a target value common to each color for the attribute information related to the selected small region, based on the attribute information acquired by the attribute information acquisition unit;
(D) a correction processing unit that performs correction processing on the image so that the attribute information of each color related to the selected small area becomes a target value common to the colors acquired by the target value acquisition unit;
(E)
(F) As the histogram data for each color, histogram data for each color of red, green, and blue is generated by the histogram data generation unit,
(G) The three or more subregions include two or more subregions having the same area.
(H) The three or more subregions include two or more subregions having the same number of pixels.
(I) The three or more small regions include two or more small regions in which at least one of the number and area of the pixels is equal to each other, and the attribute information acquisition unit Selecting at least one small region from two or more small regions having at least one of a number and an area equal to each other, and acquiring the attribute information related to the small region; Selecting the selected subregion from two or more subregions in which at least one of the number and area of pixels is equal to each other;
(J) The attribute information acquisition unit acquires, as the attribute information, an average value of the density values for each color for each of the at least one small region,
(K) the selected small area is located in a halftone area of the histogram;
(L) The attribute information acquisition unit acquires, as the attribute information, an average value of the density values for each color for each of the at least one small region,
(M) The target value acquisition unit acquires information on luminance for each of the at least one small region based on an average value of the density values for each color acquired by the attribute information acquisition unit, and relates to the luminance Obtaining the target value based on the information,
(N) The target value acquisition unit acquires an average value of luminance of pixels for the at least one small region as information on the luminance,
(O) The target value acquisition unit is obtained by adding at least one of the average luminance values acquired for the at least one small region and the average luminance value of the entire image. Based on the value, obtain the target value,
(P) When performing the correction process on the image, the correction processing unit converts a density value of each pixel constituting the image,
(Q) In order to perform the correction process on the image, the correction processing unit obtains information regarding a correspondence relationship between a density value before conversion and a density value after conversion,
(R) a determination unit for determining whether or not the image is an image in which the color balance in the selected small area is lost,
(S) The correction processing unit performs the correction processing on the image when the determination unit determines that the color balance of the selected small region is lost for the image. An image correction device.
(A)画像を構成する画素のデータに基づき、前記画素の各色の濃度値に対する前記画素の数の分布を表わす各色別のヒストグラムのデータを生成するステップと、
(B)生成した前記各色別のヒストグラムのデータに基づき、前記各色別のヒストグラムにより表される領域をそれぞれ前記濃度値の大きさ別に3つ以上の小領域に区分するステップと、
(C)前記3つ以上の小領域の中から少なくとも1つの小領域を選出して、当該小領域に関する属性情報を各色別に取得するステップと、
(D)前記3つ以上の小領域の中から、ある小領域よりも前記濃度値が大きくかつ他の小領域よりも前記濃度値が小さい小領域を選出小領域として少なくとも1つ各色別に選出するステップと、
(E)取得した前記属性情報に基づき、前記選出小領域に関する属性情報について各色共通の目標値を取得するステップと、
(F)前記選出小領域に関する各色の前記属性情報がそれぞれ、取得した前記各色共通の目標値になるように前記画像に対して補正処理を施すステップと、
(G)を有することを特徴とする画像補正方法。
(A) generating histogram data for each color representing the distribution of the number of pixels with respect to the density value of each color of the pixel based on the data of the pixels constituting the image;
(B) Based on the generated histogram data for each color, dividing the region represented by the histogram for each color into three or more small regions for each density value;
(C) selecting at least one small area from among the three or more small areas and acquiring attribute information relating to the small area for each color;
(D) From among the three or more small areas, at least one small area having the density value larger than a certain small area and smaller than the other small areas is selected as a selected small area for each color. Steps,
(E) acquiring a common target value for each color for the attribute information related to the selected small area based on the acquired attribute information;
(F) performing a correction process on the image so that the attribute information of each color related to the selected small area becomes a target value common to the acquired colors;
An image correction method comprising (G).
(A)画像補正装置にて実行される画像補正プログラムであって、
(B)画像を構成する画素のデータに基づき、前記画素の各色の濃度値に対する前記画素の数の分布を表わす各色別のヒストグラムのデータを生成するステップと、
(C)生成した前記各色別のヒストグラムのデータに基づき、前記各色別のヒストグラムにより表される領域をそれぞれ前記濃度値の大きさ別に3つ以上の小領域に区分するステップと、
(D)前記3つ以上の小領域の中から少なくとも1つの小領域を選出して、当該小領域に関する属性情報を各色別に取得するステップと、
(E)前記3つ以上の小領域の中から、ある小領域よりも前記濃度値が大きくかつ他の小領域よりも前記濃度値が小さい小領域を選出小領域として少なくとも1つ各色別に選出するステップと、
(F)取得した前記属性情報に基づき、前記選出小領域に関する属性情報について各色共通の目標値を取得するステップと、
(G)前記選出小領域に関する各色の前記属性情報がそれぞれ、取得した前記各色共通の目標値になるように前記画像に対して補正処理を施すステップと、
(H)を実行することを特徴とする画像補正プログラム。
(A) An image correction program executed by the image correction apparatus,
(B) generating histogram data for each color representing the distribution of the number of pixels with respect to the density value of each color of the pixel based on the data of the pixels constituting the image;
(C) dividing the region represented by the histogram for each color into three or more small regions according to the density values based on the generated histogram data for each color;
(D) selecting at least one small area from the three or more small areas, and obtaining attribute information about the small area for each color;
(E) Out of the three or more small areas, at least one small area having the density value larger than a certain small area and smaller than the other small areas is selected as a selected small area for each color. Steps,
(F) acquiring a common target value for each color for the attribute information related to the selected small area based on the acquired attribute information;
(G) performing a correction process on the image so that the attribute information of each color relating to the selected small area becomes a target value common to the acquired colors;
An image correction program that executes (H).
(A)原稿から画像を読み取る画像読み取り部と、
(B)前記画像読み取り部により読み取られた前記画像を構成する画素のデータに基づき、前記画素の各色の濃度値に対する前記画素の数の分布を表わす各色別のヒストグラムのデータを生成するヒストグラムデータ生成部と、
(C)前記ヒストグラムデータ生成部により生成された前記各色別のヒストグラムのデータに基づき、前記各色別のヒストグラムにより表される領域をそれぞれ前記濃度値の大きさ別に3つ以上の小領域に区分して、これら3つ以上の小領域の中から少なくとも1つの小領域を選出して、当該小領域に関する属性情報を各色別に取得する属性情報取得部と、
(D)前記3つ以上の小領域の中から、ある小領域よりも前記濃度値が大きくかつ他の小領域よりも前記濃度値が小さい小領域を選出小領域として少なくとも1つ各色別に選出して、前記属性情報取得部により取得された前記属性情報に基づき、前記選出小領域に関する属性情報について各色共通の目標値を取得する目標値取得部と、
(E)前記選出小領域に関する各色の前記属性情報がそれぞれ、前記目標値取得部により取得された前記各色共通の目標値になるように前記画像に対して補正処理を施す補正処理部と、
(F)を備えたことを特徴とする画像読み取り装置。
(A) an image reading unit for reading an image from a document;
(B) Histogram data generation that generates histogram data for each color representing the distribution of the number of pixels with respect to the density value of each color of the pixel based on the data of the pixels constituting the image read by the image reading unit And
(C) Based on the histogram data for each color generated by the histogram data generation unit, the area represented by the histogram for each color is divided into three or more small areas for each density value. An attribute information acquisition unit that selects at least one small area from the three or more small areas and acquires attribute information about the small area for each color;
(D) From among the three or more small areas, at least one small area having a density value larger than a certain small area and smaller than the other small areas is selected as a selected small area for each color. A target value acquisition unit that acquires a target value common to each color for the attribute information related to the selected small area, based on the attribute information acquired by the attribute information acquisition unit;
(E) a correction processing unit that performs correction processing on the image so that the attribute information of each color related to the selected small region becomes a target value common to the colors acquired by the target value acquisition unit;
An image reading apparatus comprising (F).
(A)原稿から画像を読み取るステップと、
(B)読み取った前記画像を構成する画素のデータに基づき、前記画素の各色の濃度値に対する前記画素の数の分布を表わす各色別のヒストグラムのデータを生成するステップと、
(C)生成した前記各色別のヒストグラムのデータに基づき、前記各色別のヒストグラムにより表される領域をそれぞれ前記濃度値の大きさ別に3つ以上の小領域に区分するステップと、
(D)前記3つ以上の小領域の中から少なくとも1つの小領域を選出して、当該小領域に関する属性情報を各色別に取得するステップと、
(E)前記3つ以上の小領域の中から、ある小領域よりも前記濃度値が大きくかつ他の小領域よりも前記濃度値が小さい小領域を選出小領域として少なくとも1つ各色別に選出するステップと、
(F)取得した前記属性情報に基づき、前記選出小領域に関する属性情報について各色共通の目標値を取得するステップと、
(G)前記選出小領域に関する各色の前記属性情報がそれぞれ、取得した前記各色共通の目標値になるように前記画像に対して補正処理を施すステップと、
(H)を有することを特徴とする画像読み取り方法。
(A) a step of reading an image from a document;
(B) generating histogram data for each color representing the distribution of the number of pixels with respect to the density value of each color of the pixel based on the data of the pixels constituting the read image;
(C) dividing the region represented by the histogram for each color into three or more small regions according to the density values based on the generated histogram data for each color;
(D) selecting at least one small area from the three or more small areas, and obtaining attribute information about the small area for each color;
(E) Out of the three or more small areas, at least one small area having the density value larger than a certain small area and smaller than the other small areas is selected as a selected small area for each color. Steps,
(F) acquiring a common target value for each color for the attribute information related to the selected small area based on the acquired attribute information;
(G) performing a correction process on the image so that the attribute information of each color relating to the selected small area becomes a target value common to the acquired colors;
An image reading method comprising (H).
(A)媒体に画像を印刷する印刷部と、
(B)前記印刷部により前記画像が印刷される前に、前記画像を構成する画素のデータに基づき、前記画素の各色の濃度値に対する前記画素の数の分布を表わす各色別のヒストグラムのデータを生成するヒストグラムデータ生成部と、
(C)前記ヒストグラムデータ生成部により生成された前記各色別のヒストグラムのデータに基づき、前記各色別のヒストグラムにより表される領域をそれぞれ前記濃度値の大きさ別に3つ以上の小領域に区分して、これら3つ以上の小領域の中から少なくとも1つの小領域を選出して、当該小領域に関する属性情報を各色別に取得する属性情報取得部と、
(D)前記3つ以上の小領域の中から、ある小領域よりも前記濃度値が大きくかつ他の小領域よりも前記濃度値が小さい小領域を選出小領域として少なくとも1つ各色別に選出して、前記属性情報取得部により取得された前記属性情報に基づき、前記選出小領域に関する属性情報について各色共通の目標値を取得する目標値取得部と、
(E)前記選出小領域に関する各色の前記属性情報がそれぞれ、前記目標値取得部により取得された前記各色共通の目標値になるように前記画像に対して補正処理を施す補正処理部と、
(F)を備えたことを特徴とする印刷装置。
(A) a printing unit that prints an image on a medium;
(B) Before the image is printed by the printing unit, based on the data of the pixels constituting the image, histogram data for each color representing the distribution of the number of pixels with respect to the density value of each color of the pixel is obtained. A histogram data generation unit to generate,
(C) Based on the histogram data for each color generated by the histogram data generation unit, the area represented by the histogram for each color is divided into three or more small areas for each density value. An attribute information acquisition unit that selects at least one small area from the three or more small areas and acquires attribute information about the small area for each color;
(D) From among the three or more small areas, at least one small area having a density value larger than a certain small area and smaller than the other small areas is selected as a selected small area for each color. A target value acquisition unit that acquires a target value common to each color for the attribute information related to the selected small area, based on the attribute information acquired by the attribute information acquisition unit;
(E) a correction processing unit that performs correction processing on the image so that the attribute information of each color related to the selected small region becomes a target value common to the colors acquired by the target value acquisition unit;
A printing apparatus comprising (F).
JP2006155434A 2006-06-02 2006-06-02 Image correction apparatus, image correction method, image correction program, image reading apparatus, image reading method, and printing apparatus Expired - Fee Related JP4238881B2 (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
JP2006155434A JP4238881B2 (en) 2006-06-02 2006-06-02 Image correction apparatus, image correction method, image correction program, image reading apparatus, image reading method, and printing apparatus
US11/809,908 US7916943B2 (en) 2006-06-02 2007-06-01 Image determining apparatus, image determining method, image enhancement apparatus, and image enhancement method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2006155434A JP4238881B2 (en) 2006-06-02 2006-06-02 Image correction apparatus, image correction method, image correction program, image reading apparatus, image reading method, and printing apparatus

Publications (2)

Publication Number Publication Date
JP2007325134A true JP2007325134A (en) 2007-12-13
JP4238881B2 JP4238881B2 (en) 2009-03-18

Family

ID=38857515

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2006155434A Expired - Fee Related JP4238881B2 (en) 2006-06-02 2006-06-02 Image correction apparatus, image correction method, image correction program, image reading apparatus, image reading method, and printing apparatus

Country Status (1)

Country Link
JP (1) JP4238881B2 (en)

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7916942B1 (en) 2006-06-02 2011-03-29 Seiko Epson Corporation Image determining apparatus, image enhancement apparatus, backlight image enhancement apparatus, and backlight image enhancement method
US8014602B2 (en) 2006-03-29 2011-09-06 Seiko Epson Corporation Backlight image determining apparatus, backlight image determining method, backlight image correction apparatus, and backlight image correction method
JP2014512740A (en) * 2011-03-15 2014-05-22 ドルビー ラボラトリーズ ライセンシング コーポレイション Method and apparatus for image data conversion
US9024961B2 (en) 2011-12-19 2015-05-05 Dolby Laboratories Licensing Corporation Color grading apparatus and methods
US9111330B2 (en) 2011-05-27 2015-08-18 Dolby Laboratories Licensing Corporation Scalable systems for controlling color management comprising varying levels of metadata

Cited By (14)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8014602B2 (en) 2006-03-29 2011-09-06 Seiko Epson Corporation Backlight image determining apparatus, backlight image determining method, backlight image correction apparatus, and backlight image correction method
US7916942B1 (en) 2006-06-02 2011-03-29 Seiko Epson Corporation Image determining apparatus, image enhancement apparatus, backlight image enhancement apparatus, and backlight image enhancement method
US9916809B2 (en) 2011-03-15 2018-03-13 Dolby Laboratories Licensing Corporation Method and apparatus for image data transformation
JP2015233323A (en) * 2011-03-15 2015-12-24 ドルビー ラボラトリーズ ライセンシング コーポレイション Method and apparatus for image data transformation
JP2015233286A (en) * 2011-03-15 2015-12-24 ドルビー ラボラトリーズ ライセンシング コーポレイション Method and apparatus for image data transformation
US9224363B2 (en) 2011-03-15 2015-12-29 Dolby Laboratories Licensing Corporation Method and apparatus for image data transformation
JP2014512740A (en) * 2011-03-15 2014-05-22 ドルビー ラボラトリーズ ライセンシング コーポレイション Method and apparatus for image data conversion
US10255879B2 (en) 2011-03-15 2019-04-09 Dolby Laboratories Licensing Corporation Method and apparatus for image data transformation
US9111330B2 (en) 2011-05-27 2015-08-18 Dolby Laboratories Licensing Corporation Scalable systems for controlling color management comprising varying levels of metadata
US11218709B2 (en) 2011-05-27 2022-01-04 Dolby Laboratories Licensing Corporation Scalable systems for controlling color management comprising varying levels of metadata
US11736703B2 (en) 2011-05-27 2023-08-22 Dolby Laboratories Licensing Corporation Scalable systems for controlling color management comprising varying levels of metadata
US11917171B2 (en) 2011-05-27 2024-02-27 Dolby Laboratories Licensing Corporation Scalable systems for controlling color management comprising varying levels of metadata
US9024961B2 (en) 2011-12-19 2015-05-05 Dolby Laboratories Licensing Corporation Color grading apparatus and methods
US9532022B2 (en) 2011-12-19 2016-12-27 Dolby Laboratories Licensing Corporation Color grading apparatus and methods

Also Published As

Publication number Publication date
JP4238881B2 (en) 2009-03-18

Similar Documents

Publication Publication Date Title
US7916943B2 (en) Image determining apparatus, image determining method, image enhancement apparatus, and image enhancement method
JP4926568B2 (en) Image processing apparatus, image processing method, and image processing program
US7715047B2 (en) Image editing device
US8014602B2 (en) Backlight image determining apparatus, backlight image determining method, backlight image correction apparatus, and backlight image correction method
JP6031286B2 (en) Image processing apparatus and image processing method
JP2008252700A (en) Image processing apparatus and image processing method
US7916942B1 (en) Image determining apparatus, image enhancement apparatus, backlight image enhancement apparatus, and backlight image enhancement method
JP4238881B2 (en) Image correction apparatus, image correction method, image correction program, image reading apparatus, image reading method, and printing apparatus
JPH04336870A (en) Color picture recorder
JP4788393B2 (en) Image processing apparatus, image processing method, and image processing program
US11503188B2 (en) Image processing apparatus, control method for controlling image processing apparatus, and storage medium
JP4222385B2 (en) Backlight image determination apparatus, backlight image determination method, backlight image determination program, image reading apparatus, image reading method, and printing apparatus
JP2011045052A (en) Image processing apparatus
JP4277866B2 (en) Backlight image determination apparatus, backlight image determination method, backlight image determination program, backlight image correction apparatus, backlight image correction method, image reading apparatus, image reading method, and printing apparatus
JP4179342B2 (en) Image determination apparatus, image determination method, image determination program, image correction apparatus, image correction method, image reading apparatus, image reading method, and printing apparatus
JP4254813B2 (en) Image correction apparatus, image correction method, image correction program, image reading apparatus, image reading method, and printing apparatus
JP4345759B2 (en) Image editing apparatus, image editing method, image editing program, image reading system, and image reading method
JP4179343B2 (en) Image determination apparatus, image determination method, image determination program, image correction apparatus, image correction method, image reading apparatus, image reading method, and printing apparatus
JP4345756B2 (en) Image editing apparatus, image editing method, image editing program, image reading system, and image reading method
JP4158811B2 (en) Backlight image correction apparatus, backlight image correction method, backlight image correction program, image reading apparatus, image reading method, and printing apparatus
JP2007221591A (en) Image editing apparatus, image editing method, image editing program, image reading system and image reading method
JP2019103093A (en) Information processing device, information processing method, and program
JP4176656B2 (en) Image processing apparatus, image processing method, image forming apparatus, image processing program, and recording medium recording the program
JP4101741B2 (en) Image processing apparatus, image forming apparatus, image processing method, image processing program, and recording medium
JP2008271131A (en) Method and device for image processing, and image forming apparatus

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20070920

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20080515

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20080520

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20080718

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20080812

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20081006

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

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

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

Free format text: PAYMENT UNTIL: 20120109

Year of fee payment: 3

R150 Certificate of patent or registration of utility model

Free format text: JAPANESE INTERMEDIATE CODE: R150

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

Free format text: PAYMENT UNTIL: 20120109

Year of fee payment: 3

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

Free format text: PAYMENT UNTIL: 20130109

Year of fee payment: 4

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

Free format text: PAYMENT UNTIL: 20130109

Year of fee payment: 4

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

Free format text: PAYMENT UNTIL: 20140109

Year of fee payment: 5

LAPS Cancellation because of no payment of annual fees