JP2006121138A - Image processor, image processing method and computer program - Google Patents

Image processor, image processing method and computer program Download PDF

Info

Publication number
JP2006121138A
JP2006121138A JP2004303794A JP2004303794A JP2006121138A JP 2006121138 A JP2006121138 A JP 2006121138A JP 2004303794 A JP2004303794 A JP 2004303794A JP 2004303794 A JP2004303794 A JP 2004303794A JP 2006121138 A JP2006121138 A JP 2006121138A
Authority
JP
Japan
Prior art keywords
image
pixel
processing
correction
false color
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
JP2004303794A
Other languages
Japanese (ja)
Other versions
JP4539280B2 (en
Inventor
Rui Yamada
類 山田
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.)
Sony Corp
Original Assignee
Sony 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 Sony Corp filed Critical Sony Corp
Priority to JP2004303794A priority Critical patent/JP4539280B2/en
Publication of JP2006121138A publication Critical patent/JP2006121138A/en
Application granted granted Critical
Publication of JP4539280B2 publication Critical patent/JP4539280B2/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T3/00Geometric image transformations in the plane of the image
    • G06T3/40Scaling of whole images or parts thereof, e.g. expanding or contracting
    • G06T3/4007Scaling of whole images or parts thereof, e.g. expanding or contracting based on interpolation, e.g. bilinear interpolation

Landscapes

  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Image Processing (AREA)
  • Color Television Image Signal Generators (AREA)
  • Facsimile Image Signal Circuits (AREA)
  • Color Image Communication Systems (AREA)

Abstract

<P>PROBLEM TO BE SOLVED: To provide a method and a processor for realizing efficient image processing by applying a reduced image to perform false color correction such as purple fringe to reduce a calculation cost. <P>SOLUTION: Reducing processing of image data to be correction-processed is executed, image processing including pixel value correction of false pixels around halation for a reduced image by stopgap interpolation processing and each correction processing to which the degree p of a false color (PF) is applied to generate two correction images; and these different result images are enlarged and blended, thereby generating a final correction image. This configuration enables correction for the reduced image, and image correction can be performed with less calculation cost. Also, correction processing in which image corrections are merged in different processing modes can be realized, and harmonized pixel value correction in which advantage of each of the processing modes are merged can be realized. <P>COPYRIGHT: (C)2006,JPO&NCIPI

Description

本発明は、画像処理装置、および画像処理方法、並びにコンピュータ・プログラムに関する。さらに詳細には、例えばレンズの収差による偽色の発生した画像データを補正し、高品質な画像データを生成する画像処理装置、および画像処理方法、並びにコンピュータ・プログラムに関する。   The present invention relates to an image processing apparatus, an image processing method, and a computer program. More specifically, the present invention relates to an image processing apparatus, an image processing method, and a computer program that correct image data in which false color due to lens aberration occurs and generate high-quality image data.

カメラで画像撮影を行なう際には、レンズの収差によりさまざまな問題が引き起こされる。典型的な収差の例として、単色収差であるザイデルの五収差が挙げられる。これはドイツのザイデルによって分析されたレンズの球面に基づく5つの収差であり、球面収差、コマ収差、非点収差、歪曲収差、像面歪曲の各収差の総称である。さらに、これらの収差とは別に、色収差も重要な問題を引き起こすことが知られている。色収差は、レンズ素材に対する光の屈折率がその波長により異なることに起因し、撮像面にて偽色を生ずる。   When photographing images with a camera, various problems are caused by the aberration of the lens. Examples of typical aberrations include Seidel's five aberrations, which are monochromatic aberrations. This is five aberrations based on the spherical surface of the lens analyzed by Seidel in Germany, and is a collective term for each aberration of spherical aberration, coma aberration, astigmatism, distortion aberration, and field distortion. In addition to these aberrations, chromatic aberration is also known to cause significant problems. Chromatic aberration is caused by the fact that the refractive index of light with respect to the lens material differs depending on the wavelength, and a false color is generated on the imaging surface.

色収差の代表的な例として、光軸上の焦点位置が波長によって異なるため色のにじみが起こる軸上色収差や、波長により像倍率が異なるため色ずれが起こる倍率色収差などがよく知られているが、英語で一般的にPurple Fringe(パープルフリンジ)と呼ばれる現象も画像の劣化を引き起こす重要な原因となる。これは、光の波長により点像分布が異なっているために、画像中のエッジ部分に偽色が発生する現象である。通常の画素ではそれほど目立たない場合でも、輝度レベルにおける飽和状態としての白とびが起こっているハイコントラストのエッジ部分があれば、その周辺に紫色の偽色が発生し、不自然な像が結像されてしまう。一般に、白とびの近傍に発生する偽色は紫系の色が多く発生するためパープルフリンジと呼ばれる。ただし、レンズ、撮影条件などに応じて、偽色の色は緑がかった色となる場合など様々である。以下、パープルフリンジとは、発生する色に関わらず白とびが起こっているハイコントラストのエッジ部分における偽色発生現象を指すものとする。   As typical examples of chromatic aberration, axial chromatic aberration in which color blur occurs because the focal position on the optical axis differs depending on wavelength, and lateral chromatic aberration in which color shift occurs because image magnification varies depending on wavelength are well known. A phenomenon generally called “Purple Fringe” in English is also an important cause of image deterioration. This is a phenomenon in which a false color is generated at an edge portion in an image because the point image distribution differs depending on the wavelength of light. Even if it is not so conspicuous with normal pixels, if there is a high-contrast edge part where whiteout occurs as a saturated state at the luminance level, a purple false color occurs around it and an unnatural image is formed Will be. In general, false colors that occur in the vicinity of whiteout are called purple fringes because many purple colors are generated. However, the false color varies depending on the lens, shooting conditions, and the like, such as when the color becomes greenish. Hereinafter, the purple fringe refers to a false color generation phenomenon at an edge portion of high contrast where whiteout occurs regardless of the generated color.

色収差を軽減するための技術としては、蛍石など特殊な素材で出来たガラスを用いたレンズがある。しかし、このようなレンズを製造するのはコストがかるため価格も高く、レンズ交換式のカメラ用など一部の高級なカメラで用いられているが、一般に広く普及しているとは言えない。   As a technique for reducing chromatic aberration, there is a lens using glass made of a special material such as fluorite. However, manufacturing such a lens is expensive and expensive, and is used in some high-end cameras such as interchangeable lens cameras. However, it cannot be said that it is generally widely used.

また、特許文献1には、色収差によって発生する偽色を画像処理により軽減する方法が示されている。これは、緑チャンネルの高周波成分が高い部分に関して、色を抑制、つまり彩度を低下させる処理を行うものである。また、白とびが起こっている場合の対策として、露出を変えて2枚の画像を撮像し白とび部分の本来の輝度を推定し、彩度を低下させる処理を行う構成を開示している。   Patent Document 1 discloses a method for reducing false colors caused by chromatic aberration by image processing. This is a process for suppressing the color, that is, reducing the saturation, in a portion where the high frequency component of the green channel is high. Also, as a countermeasure against overexposure, a configuration is disclosed in which two images are captured with different exposures, the original brightness of the overexposed portion is estimated, and the saturation is reduced.

しかし、特許文献1に記載の処理は、彩度の低下により偽色の軽減を行っているため、本来の被写体の色についての彩度も低下し、被写体本来の忠実な色の再現ができなくなりその結果、不自然な画像が出力されるという問題がある。また、白とび部分の輝度推定のために、2回撮影を行う必要があり、この2回の撮影の間に手ぶれや被写体ぶれなどが起こった場合、正しい結果を得ることが困難になるという問題がある。
特開2003−60983号公報
However, since the processing described in Patent Document 1 reduces false colors due to a decrease in saturation, the saturation of the original subject color also decreases, making it impossible to reproduce the original true color of the subject. As a result, there is a problem that an unnatural image is output. In addition, it is necessary to shoot twice in order to estimate the brightness of the overexposed part. If camera shake or subject shake occurs between these two shoots, it is difficult to obtain a correct result. There is.
JP 2003-60983 A

本発明は、上述の問題点に鑑みてなされたものであり、白とび周辺に発生するパープルフリンジ等の偽色に注目し、この偽色領域を効率的に検出し、部分的な補正を実行することにより、画像全体に対する影響を発生させることなく高品質な画像データを生成、出力することを可能とした画像処理装置、および画像処理方法、並びにコンピュータ・プログラムを提供することを目的とする。   The present invention has been made in view of the above-described problems, and pays attention to false colors such as purple fringes that occur in the vicinity of overexposure, efficiently detects this false color area, and performs partial correction. Accordingly, an object of the present invention is to provide an image processing apparatus, an image processing method, and a computer program that can generate and output high-quality image data without causing an influence on the entire image.

本発明は、特に、偽色の補正を実行する前に、特殊な態様での画像データの縮小処理を実行する。具体的には、輝度データの縮小においては、白とび画素データを消失しないように縮小し、また色情報の縮小においてはパープルフリンジ等の偽色データが消失しないように縮小を行なう。この縮小処理によって得られた縮小データに対する画像処理によって偽色画素等の補正を実行することで、補正における画像処理の計算コストの削減を実現し、高品質な画素補正を可能とした画像処理装置、および画像処理方法、並びにコンピュータ・プログラムを提供することを目的とする。   In particular, the present invention executes a reduction process of image data in a special manner before executing false color correction. Specifically, in the reduction of the luminance data, the reduction is performed so that the overexposed pixel data is not lost, and in the reduction of the color information, the reduction is performed so that the false color data such as purple fringe is not lost. Image processing apparatus that realizes reduction in calculation cost of image processing in correction and enables high-quality pixel correction by executing correction of false color pixels or the like by image processing on the reduced data obtained by the reduction processing And an image processing method and a computer program.

また、本発明は、画像データの構成画素から選択された注目画素について、偽色である可能性を示すパラメータとしての偽色度合いを算出し、偽色度合いに応じて注目画素の元画素値と、周囲画素の画素値に基づいて生成する補間値との寄与率を変更して注目画素の補正画素値を算出し、さらに、この補正値と穴埋め補間処理の結果として取得される補正画素値とのブレンド処理により、最適な画素値を算出して出力する構成とすることで、より自由度の高い補正処理の実現、高品質な画像データの生成を可能とした像処理装置、および画像処理方法、並びにコンピュータ・プログラムを提供することを目的とする。   Further, the present invention calculates a false color degree as a parameter indicating the possibility of a false color for a target pixel selected from the constituent pixels of the image data, and determines the original pixel value of the target pixel according to the false color degree. The correction pixel value of the target pixel is calculated by changing the contribution ratio with the interpolation value generated based on the pixel values of the surrounding pixels, and the correction pixel value acquired as a result of the interpolation processing for filling the hole Image processing apparatus and image processing method capable of realizing a correction process with a higher degree of freedom and generating high-quality image data by calculating and outputting an optimum pixel value by blending processing of And a computer program.

本発明の第1の側面は、
画像処理装置であり、
補正処理対象画像データの縮小処理を実行する縮小処理部と、
前記縮小処理部において生成された縮小画像に対して、白とび周囲の偽色画素の画素値補正を含む画像処理を実行する画像補正処理部と、
前記画像補正処理部において生成した補正画像の拡大処理を実行する拡大処理部と、
を有することを特徴とする画像処理装置にある。
The first aspect of the present invention is:
An image processing device,
A reduction processing unit that executes a reduction process of the correction target image data;
An image correction processing unit that performs image processing including pixel value correction of a false color pixel around a whiteout on the reduced image generated in the reduction processing unit;
An enlargement processing unit for executing an enlargement process of the corrected image generated in the image correction processing unit;
An image processing apparatus characterized by comprising:

さらに、本発明の画像処理装置の一実施態様において、前記縮小処理部は、オリジナルの補正処理対象画像データについて輝度情報の縮小処理と、色情報の縮小処理とを個別に実行する構成であり、輝度情報の縮小処理においては、前記補正処理対象画像データに含まれる白とび画素情報を消失させない縮小処理を実行し、色情報の縮小処理においては、前記補正処理対象画像データに含まれる偽色の色情報を消失させない縮小処理を実行する構成であることを特徴とする。   Furthermore, in an embodiment of the image processing apparatus of the present invention, the reduction processing unit is configured to individually execute luminance information reduction processing and color information reduction processing on the original correction processing target image data. In the reduction process of luminance information, a reduction process that does not erase overexposed pixel information included in the correction process target image data is performed. In the reduction process of color information, the false color included in the correction process target image data is processed. The present invention is characterized in that a reduction process that does not lose color information is executed.

さらに、本発明の画像処理装置の一実施態様において、前記縮小処理部は、前記補正処理対象画像データについての輝度情報の縮小処理において、縮小画像の構成画素に対応する輝度を、前記補正処理対象画像データの対応画像領域に含まれる最大輝度として設定する処理を実行する構成であることを特徴とする。   Furthermore, in an embodiment of the image processing apparatus of the present invention, the reduction processing unit is configured to reduce the luminance corresponding to the constituent pixels of the reduced image in the luminance information reduction processing for the correction processing target image data. The present invention is characterized in that a process for setting the maximum luminance included in the corresponding image area of the image data is executed.

さらに、本発明の画像処理装置の一実施態様において、前記縮小処理部は、前記補正処理対象画像データについての色情報の縮小処理において、縮小画像の構成画素に対応する色情報を、前記補正処理対象画像データの対応画像領域に偽色画素が含まれる場合は、前記対応画像領域に含まれる偽色画素の平均値として設定し、前記補正処理対象画像データの対応画像領域に偽色画素が含まれない場合は、前記対応画像領域に含まれる全画素の平均値として設定する処理を実行する構成であることを特徴とする。   Furthermore, in one embodiment of the image processing apparatus of the present invention, the reduction processing unit converts the color information corresponding to the constituent pixels of the reduced image into the correction process in the color information reduction process for the correction processing target image data. When a false color pixel is included in the corresponding image area of the target image data, it is set as an average value of the false color pixels included in the corresponding image area, and the false color pixel is included in the corresponding image area of the correction processing target image data If not, the processing is performed to set the average value of all the pixels included in the corresponding image area.

さらに、本発明の画像処理装置の一実施態様において、前記画像補正処理部は、前記縮小処理部において生成された縮小画像の構成画素の偽色度合いpを算出し、算出した偽色度合いpに応じた画素値補正を実行する平均法に基づく補正処理を実行する構成であり、
前記縮小画像の構成画素から選択された注目画素について、偽色である可能性を示すパラメータとしての偽色度合いpを算出する偽色度合い算出部と、注目画素近傍領域の画素値に基づいて、注目画素に対応する補間値を算出する補間値算出部と、注目画素の元画素値と前記補間値とを適用し、注目画素の偽色度合いpに応じて前記元画素値と前記補間値との寄与率を変更して前記注目画素の補正画素値を算出する補正画素値算出部と、を有する構成であることを特徴とする。
Furthermore, in an embodiment of the image processing apparatus of the present invention, the image correction processing unit calculates a false color degree p of the constituent pixels of the reduced image generated by the reduction processing unit, and sets the calculated false color degree p to It is a configuration that executes correction processing based on an averaging method that executes pixel value correction according to
For a target pixel selected from the constituent pixels of the reduced image, based on a false color degree calculation unit that calculates a false color degree p as a parameter indicating the possibility of a false color, and a pixel value in a region near the target pixel, An interpolation value calculation unit that calculates an interpolation value corresponding to the pixel of interest; an original pixel value of the pixel of interest and the interpolation value; and the original pixel value and the interpolation value according to the false color degree p of the pixel of interest And a correction pixel value calculation unit that calculates a correction pixel value of the target pixel by changing the contribution ratio of the target pixel.

さらに、本発明の画像処理装置の一実施態様において、前記偽色度合い算出部は、注目画素についての、
(a)白とび(高輝度画素)への近さを示す白とび距離評価値P
(b)彩度の大きさを示す彩度評価値P
(c)偽色に対応する特定色相への近さを示す色相評価値Pθ
の少なくともいずれかを適用して注目画素の偽色度合いpを算出する構成であることを特徴とする。
Furthermore, in one embodiment of the image processing apparatus of the present invention, the false color degree calculation unit is configured to obtain a pixel of interest
(A) White jump distance evaluation value P d indicating the proximity to white jump (high luminance pixel),
(B) a saturation evaluation value P s indicating the magnitude of saturation;
(C) Hue evaluation value P θ indicating the proximity to the specific hue corresponding to the false color,
The false color degree p of the target pixel is calculated by applying at least one of the above.

さらに、本発明の画像処理装置の一実施態様において、前記画像補正処理部は、前記縮小処理部において生成された縮小画像の構成画素から白とび画素を検出し、白とび画素周囲の偽色画素の画素値を周囲画素の画素値に基づいて補正する穴埋め法に基づく補正処理を実行する構成であり、画像データから白とび画素を検出する白とび検出部と、前記白とび検出部の検出した白とび画素の周囲に偽色画素検出領域を設定する偽色画素検出領域設定部と、前記偽色画素検出領域設定部の設定した領域内において、偽色に対応する色を有する画素を偽色画素として特定する偽色検出部と、前記偽色検出部の検出した偽色画素について、周囲画素値に基づく画素値補正処理を実行する画素値補正部と、を有する構成であることを特徴とする。   Furthermore, in an embodiment of the image processing apparatus of the present invention, the image correction processing unit detects a skipped pixel from constituent pixels of the reduced image generated by the reduction processing unit, and false color pixels around the skipped pixel Correction processing based on the hole filling method for correcting the pixel value of the pixel based on the pixel values of the surrounding pixels, the overexposure detection unit that detects overexposed pixels from the image data, and the overexposure detection unit detects A false color pixel detection region setting unit that sets a false color pixel detection region around a whiteout pixel, and a pixel having a color corresponding to the false color within the region set by the false color pixel detection region setting unit is false color A false color detection unit that is specified as a pixel, and a pixel value correction unit that performs pixel value correction processing based on surrounding pixel values for the false color pixel detected by the false color detection unit, To do.

さらに、本発明の画像処理装置の一実施態様において、前記画素値補正部は、偽色画素について、周囲画素値に基づく穴埋め補間処理を実行する穴埋め補間部と、偽色画素について、色ぼかし処理を実行する色ぼかし処理部とを有する構成であることを特徴とする。   Furthermore, in one embodiment of the image processing device of the present invention, the pixel value correction unit includes a hole-filling interpolation unit that performs hole-filling interpolation processing based on surrounding pixel values for false color pixels, and color blurring processing for false color pixels. And a color blur processing unit for executing the above.

さらに、本発明の画像処理装置の一実施態様において、前記画素値補正部は、偽色画素の周囲に存在する画素から偽色画素および白とび画素を除くその他の画素を選択し、選択画素に基づく穴埋め補間処理を実行する構成であることを特徴とする。   Furthermore, in an embodiment of the image processing apparatus of the present invention, the pixel value correction unit selects other pixels excluding the false color pixel and the overexposed pixel from the pixels existing around the false color pixel, and sets the selected pixel as the selected pixel. It is the structure which performs the hole-filling interpolation process based on.

さらに、本発明の画像処理装置の一実施態様において、前記拡大処理部は、前記画像補正処理部において生成した補正画像の拡大データとオリジナルの補正処理対象画像データとのブレンド処理により拡大済み補正画像を生成する構成であることを特徴とする。   Furthermore, in one embodiment of the image processing apparatus of the present invention, the enlargement processing unit is configured to enlarge the corrected image by blending the enlarged data of the correction image generated by the image correction processing unit and the original correction target image data. It is the structure which produces | generates.

さらに、本発明の画像処理装置の一実施態様において、前記画像補正処理部は、前記縮小処理部において生成された縮小画像に対して、第1の画像補正処理態様で、白とび周囲の偽色画素の画素値補正を含む画像処理を実行する第1画像補正処理部と、前記縮小処理部において生成された縮小画像に対して、前記第1の画像補正処理態様と異なる第2の画像補正処理態様で、白とび周囲の偽色画素の画素値補正を含む画像処理を実行する第2画像補正処理部とを有し、前記拡大処理部は、前記第1画像補正処理部において生成した第1補正画像と、前記第2画像補正処理部において生成した第2補正画像との拡大処理を実行する構成であり、さらに、前記拡大処理部において拡大した拡大済み第1補正画像と拡大済み第2補正画像とのブレンド処理により最終補正画像を生成するブレンド処理部を有することを特徴とする。   Furthermore, in one embodiment of the image processing device of the present invention, the image correction processing unit applies a false color around a whiteout in a first image correction processing mode with respect to the reduced image generated in the reduction processing unit. A first image correction processing unit that performs image processing including pixel value correction of a pixel, and a second image correction process different from the first image correction processing mode for the reduced image generated in the reduction processing unit And a second image correction processing unit that performs image processing including pixel value correction of the surrounding false color pixels, and the enlargement processing unit generates the first image generated in the first image correction processing unit. It is the structure which performs the expansion process of a correction image and the 2nd correction image produced | generated in the said 2nd image correction process part, Furthermore, the enlarged 1st correction image and the enlarged 2nd correction which were expanded in the said expansion process part Bren with images It characterized by having a blend processing unit for generating the final corrected image by processing.

さらに、本発明の画像処理装置の一実施態様において、前記拡大処理部は、前記第1画像補正処理部において生成した第1補正画像の拡大データとオリジナルの補正処理対象画像データとのブレンド処理により拡大済み第1補正画像を生成し、前記第2画像補正処理部において生成した第2補正画像の拡大データとオリジナルの補正処理対象画像データとのブレンド処理により拡大済み第2補正画像を生成する構成であることを特徴とする。   Furthermore, in an embodiment of the image processing apparatus of the present invention, the enlargement processing unit performs a blending process of the enlarged data of the first correction image generated in the first image correction processing unit and the original correction processing target image data. A configuration for generating an enlarged first corrected image and generating an enlarged second corrected image by blending the enlarged data of the second corrected image generated by the second image correction processing unit and the original correction processing target image data It is characterized by being.

さらに、本発明の画像処理装置の一実施態様において、前記ブレンド処理部は、前記拡大処理部において拡大した拡大済み第1補正画像と拡大済み第2補正画像とのブレンド処理により最終補正画像を生成する構成であり、前記拡大済み第1補正画像の構成画素(x,y)の画素値をCavgnew(x,y)とし、前記拡大済み第2補正画像の構成画素(x,y)の画素値をCholenew(x,y)としたとき、最終補正画像の構成画素(x,y)の画素値Cfinal(x,y)を、下式、
final(x,y)=k×Cavgnew(x,y)+(1−k)×Cholenew(x,y)
ただしk=0〜1
に従って算出する処理を実行する構成であることを特徴とする。
Furthermore, in an embodiment of the image processing apparatus of the present invention, the blend processing unit generates a final corrected image by blending the enlarged first corrected image and the enlarged second corrected image enlarged in the enlargement processing unit. The pixel value of the constituent pixel (x, y) of the enlarged first corrected image is C avgnew (x, y), and the pixel of the constituent pixel (x, y) of the enlarged second corrected image When the value is C holenew (x, y), the pixel value C final (x, y) of the constituent pixel (x, y) of the final corrected image is expressed by the following equation:
C final (x, y) = k × C avgnew (x, y) + (1−k) × C holenew (x, y)
However, k = 0-1
It is the structure which performs the process calculated according to this.

さらに、本発明の画像処理装置の一実施態様において、前記偽色はパープルフリンジであり、前記画像補正処理部は、前記縮小処理部において生成された縮小画像に対して、白とび周囲のパープルフリンジ画素の画素値補正を含む画像処理を実行する構成であることを特徴とする。   Furthermore, in an embodiment of the image processing apparatus of the present invention, the false color is a purple fringe, and the image correction processing unit performs overexpanded purple fringe on the reduced image generated by the reduction processing unit. The present invention is characterized in that image processing including pixel value correction of pixels is executed.

さらに、本発明の第2の側面は、
画像処理方法であり、
補正処理対象画像データの縮小処理を実行する縮小処理ステップと、
前記縮小処理ステップにおいて生成された縮小画像に対して、白とび周囲の偽色画素の画素値補正を含む画像処理を実行する画像補正処理ステップと、
前記画像補正処理ステップにおいて生成した補正画像の拡大処理を実行する拡大処理ステップと、
を有することを特徴とする画像処理方法にある。
Furthermore, the second aspect of the present invention provides
An image processing method,
A reduction processing step for executing the reduction processing of the correction target image data;
An image correction processing step for performing image processing including pixel value correction of a false color pixel around the image on the reduced image generated in the reduction processing step;
An enlargement process step for executing an enlargement process of the corrected image generated in the image correction process step;
An image processing method characterized by comprising:

さらに、本発明の画像処理方法の一実施態様において、前記縮小処理ステップは、オリジナルの補正処理対象画像データについて輝度情報の縮小処理と、色情報の縮小処理とを個別に実行し、輝度情報の縮小処理においては、前記補正処理対象画像データに含まれる白とび画素情報を消失させない縮小処理を実行し、色情報の縮小処理においては、前記補正処理対象画像データに含まれる偽色の色情報を消失させない縮小処理を実行することを特徴とする。   Further, in one embodiment of the image processing method of the present invention, the reduction processing step separately executes luminance information reduction processing and color information reduction processing on the original correction processing target image data, In the reduction process, a reduction process is performed so as not to lose overexposed pixel information included in the correction process target image data. In the color information reduction process, false color color information included in the correction process target image data is processed. A reduction process that does not disappear is executed.

さらに、本発明の画像処理方法の一実施態様において、前記縮小処理ステップは、前記補正処理対象画像データについての輝度情報の縮小処理において、縮小画像の構成画素に対応する輝度を、前記補正処理対象画像データの対応画像領域に含まれる最大輝度として設定する処理を実行することを特徴とする。   Furthermore, in one embodiment of the image processing method of the present invention, the reduction processing step is configured to reduce the luminance corresponding to the constituent pixels of the reduced image in the luminance information reduction processing for the correction processing target image data. A process for setting the maximum luminance included in the corresponding image area of the image data is executed.

さらに、本発明の画像処理方法の一実施態様において、前記縮小処理ステップは、前記補正処理対象画像データについての色情報の縮小処理において、縮小画像の構成画素に対応する色情報を、前記補正処理対象画像データの対応画像領域に偽色画素が含まれる場合は、前記対応画像領域に含まれる偽色画素の平均値として設定し、前記補正処理対象画像データの対応画像領域に偽色画素が含まれない場合は、前記対応画像領域に含まれる全画素の平均値として設定する処理を実行することを特徴とする。   Furthermore, in one embodiment of the image processing method of the present invention, the reduction processing step is configured to reduce the color information corresponding to the constituent pixels of the reduced image in the color information reduction processing for the correction processing target image data. When a false color pixel is included in the corresponding image area of the target image data, it is set as an average value of the false color pixels included in the corresponding image area, and the false color pixel is included in the corresponding image area of the correction processing target image data If not, a process of setting as an average value of all the pixels included in the corresponding image area is executed.

さらに、本発明の画像処理方法の一実施態様において、前記画像補正処理ステップは、前記縮小処理ステップにおいて生成された縮小画像の構成画素の偽色度合いpを算出し、算出した偽色度合いpに応じた画素値補正を実行する平均法に基づく補正処理を実行するステップであり、前記縮小画像の構成画素から選択された注目画素について、偽色である可能性を示すパラメータとしての偽色度合いpを算出する偽色度合い算出ステップと、注目画素近傍領域の画素値に基づいて、注目画素に対応する補間値を算出する補間値算出ステップと、注目画素の元画素値と前記補間値とを適用し、注目画素の偽色度合いpに応じて前記元画素値と前記補間値との寄与率を変更して前記注目画素の補正画素値を算出する補正画素値算出ステップと、を含むことを特徴とする。   Furthermore, in an embodiment of the image processing method of the present invention, the image correction processing step calculates a false color degree p of the constituent pixels of the reduced image generated in the reduction processing step, and sets the calculated false color degree p to A false color degree p as a parameter indicating a possibility of false color for a target pixel selected from the constituent pixels of the reduced image. Applying a false color degree calculating step for calculating the interpolation value, an interpolation value calculating step for calculating an interpolation value corresponding to the pixel of interest based on a pixel value in the vicinity region of the pixel of interest, and the original pixel value of the pixel of interest and the interpolation value And a correction pixel value calculation step of calculating a correction pixel value of the target pixel by changing a contribution ratio between the original pixel value and the interpolation value according to the false color degree p of the target pixel. And wherein the Mukoto.

さらに、本発明の画像処理方法の一実施態様において、前記偽色度合い算出ステップは、注目画素についての、
(a)白とび(高輝度画素)への近さを示す白とび距離評価値P
(b)彩度の大きさを示す彩度評価値P
(c)偽色に対応する特定色相への近さを示す色相評価値Pθ
の少なくともいずれかを適用して注目画素の偽色度合いpを算出するステップであることを特徴とする。
Furthermore, in one embodiment of the image processing method of the present invention, the false color degree calculation step includes:
(A) White jump distance evaluation value P d indicating the proximity to white jump (high luminance pixel),
(B) a saturation evaluation value P s indicating the magnitude of saturation;
(C) Hue evaluation value P θ indicating the proximity to the specific hue corresponding to the false color,
This is a step of calculating the false color degree p of the target pixel by applying at least one of the above.

さらに、本発明の画像処理方法の一実施態様において、前記画像補正処理ステップは、前記縮小処理ステップにおいて生成された縮小画像の構成画素から白とび画素を検出し、白とび画素周囲の偽色画素の画素値を周囲画素の画素値に基づいて補正する穴埋め法に基づく補正処理を実行するステップであり、画像データから白とび画素を検出する白とび検出ステップと、前記白とび検出ステップの検出した白とび画素の周囲に偽色画素検出領域を設定する偽色画素検出領域設定ステップと、前記偽色画素検出領域設定ステップの設定した領域内において、偽色に対応する色を有する画素を偽色画素として特定する偽色検出ステップと、前記偽色検出ステップの検出した偽色画素について、周囲画素値に基づく画素値補正処理を実行する画素値補正ステップとを含むことを特徴とする。   Furthermore, in one embodiment of the image processing method of the present invention, the image correction processing step detects a whiteout pixel from constituent pixels of the reduced image generated in the reduction processing step, and a false color pixel around the whiteout pixel. Is a step of executing correction processing based on a hole-filling method for correcting the pixel value of the pixel based on the pixel values of surrounding pixels, the step of detecting overexposure from image data, and the detection of the overexposure detection step A false color pixel detection area setting step for setting a false color pixel detection area around a whiteout pixel, and a pixel having a color corresponding to the false color within the area set by the false color pixel detection area setting step A pixel value for executing a pixel value correction process based on the surrounding pixel value for the false color detection step specified as a pixel and the false color pixel detected by the false color detection step Characterized in that it comprises a positive step.

さらに、本発明の画像処理方法の一実施態様において、前記画素値補正ステップは、偽色画素について、周囲画素値に基づく穴埋め補間処理を実行する穴埋め補間ステップと、偽色画素について、色ぼかし処理を実行する色ぼかし処理ステップとを含むことを特徴とする。   Furthermore, in an embodiment of the image processing method of the present invention, the pixel value correcting step includes a hole filling interpolation step for performing hole filling interpolation processing based on surrounding pixel values for false color pixels, and a color blurring process for false color pixels. And a color blur processing step for executing the above.

さらに、本発明の画像処理方法の一実施態様において、前記画素値補正ステップは、偽色画素の周囲に存在する画素から偽色画素および白とび画素を除くその他の画素を選択し、選択画素に基づく穴埋め補間処理を実行するステップを含むことを特徴とする。   Furthermore, in an embodiment of the image processing method of the present invention, the pixel value correcting step selects other pixels excluding the false color pixel and the overexposed pixel from the pixels existing around the false color pixel, and sets the selected pixel as the selected pixel. The method includes a step of executing a hole filling interpolation process based on the above.

さらに、本発明の画像処理方法の一実施態様において、前記拡大処理ステップは、前記画像補正処理ステップにおいて生成した補正画像の拡大データとオリジナルの補正処理対象画像データとのブレンド処理により拡大済み補正画像を生成するステップであることを特徴とする。   Furthermore, in an embodiment of the image processing method of the present invention, the enlargement processing step includes an enlarged corrected image obtained by blending the enlarged data of the correction image generated in the image correction processing step and the original correction target image data. It is the step which produces | generates.

さらに、本発明の画像処理方法の一実施態様において、前記画像補正処理ステップは、前記縮小処理ステップにおいて生成された縮小画像に対して、第1の画像補正処理態様で、白とび周囲の偽色画素の画素値補正を含む画像処理を実行する第1画像補正処理ステップと、前記縮小処理ステップにおいて生成された縮小画像に対して、前記第1の画像補正処理態様と異なる第2の画像補正処理態様で、白とび周囲の偽色画素の画素値補正を含む画像処理を実行する第2画像補正処理ステップとを有し、前記拡大処理ステップは、前記第1画像補正処理ステップにおいて生成した第1補正画像と、前記第2画像補正処理ステップにおいて生成した第2補正画像との拡大処理を実行するステップであり、さらに、前記拡大処理ステップにおいて拡大した拡大済み第1補正画像と拡大済み第2補正画像とのブレンド処理により最終補正画像を生成するブレンド処理ステップを有することを特徴とする。   Furthermore, in an embodiment of the image processing method of the present invention, the image correction processing step is a first image correction processing mode for the reduced image generated in the reduction processing step, and the false color surrounding the overexposure is obtained. A first image correction processing step for performing image processing including pixel value correction of a pixel, and a second image correction processing different from the first image correction processing mode for the reduced image generated in the reduction processing step. And a second image correction processing step for executing image processing including pixel value correction of the surrounding false color pixels, wherein the enlargement processing step is a first image generated in the first image correction processing step. A step of enlarging the corrected image and the second corrected image generated in the second image correction processing step; It characterized by having a blend processing step of generating a final corrected image and the enlarged been first corrected image by blending processing of the enlargement already second corrected image.

さらに、本発明の画像処理方法の一実施態様において、前記拡大処理ステップは、前記第1画像補正処理ステップにおいて生成した第1補正画像の拡大データとオリジナルの補正処理対象画像データとのブレンド処理により拡大済み第1補正画像を生成するステップと、前記第2画像補正処理ステップにおいて生成した第2補正画像の拡大データとオリジナルの補正処理対象画像データとのブレンド処理により拡大済み第2補正画像を生成するステップと、を含むことを特徴とする。   Furthermore, in an embodiment of the image processing method of the present invention, the enlargement processing step is performed by blending the enlarged data of the first correction image generated in the first image correction processing step and the original correction processing target image data. An enlarged second corrected image is generated by blending the enlarged data of the second corrected image generated in the step of generating the enlarged first corrected image and the second corrected image generated in the second image correction processing step and the original correction processing target image data. And a step of performing.

さらに、本発明の画像処理方法の一実施態様において、前記ブレンド処理ステップは、前記拡大処理ステップにおいて拡大した拡大済み第1補正画像と拡大済み第2補正画像とのブレンド処理により最終補正画像を生成するステップであり、前記拡大済み第1補正画像の構成画素(x,y)の画素値をCavgnew(x,y)とし、前記拡大済み第2補正画像の構成画素(x,y)の画素値をCholenew(x,y)としたとき、最終補正画像の構成画素(x,y)の画素値Cfinal(x,y)を、下式、
final(x,y)=k×Cavgnew(x,y)+(1−k)×Cholenew(x,y)
ただしk=0〜1
に従って算出する処理を実行することを特徴とする。
Furthermore, in one embodiment of the image processing method of the present invention, the blending step generates a final corrected image by blending the enlarged first corrected image and the enlarged second corrected image enlarged in the enlarging step. The pixel value of the constituent pixel (x, y) of the enlarged first corrected image is C avgnew (x, y), and the pixel of the constituent pixel (x, y) of the enlarged second corrected image When the value is C holenew (x, y), the pixel value C final (x, y) of the constituent pixel (x, y) of the final corrected image is expressed by the following equation:
C final (x, y) = k × C avgnew (x, y) + (1−k) × C holenew (x, y)
However, k = 0-1
The process of calculating according to is performed.

さらに、本発明の画像処理方法の一実施態様において、前記偽色はパープルフリンジであり、前記画像補正処理ステップは、前記縮小処理ステップにおいて生成された縮小画像に対して、白とび周囲のパープルフリンジ画素の画素値補正を含む画像処理を実行することを特徴とする。   Furthermore, in an embodiment of the image processing method of the present invention, the false color is a purple fringe, and the image correction processing step is performed by using a purple fringe surrounding the reduced image generated in the reduction processing step. Image processing including pixel value correction of pixels is executed.

さらに、本発明の第3の側面は、
画像処理をコンピュータ上で実行させるコンピュータ・プログラムであり、
補正処理対象画像データの縮小処理を実行する縮小処理ステップと、
前記縮小処理ステップにおいて生成された縮小画像に対して、白とび周囲の偽色画素の画素値補正を含む画像処理を実行する画像補正処理ステップと、
前記画像補正処理ステップにおいて生成した補正画像の拡大処理を実行する拡大処理ステップと、
を有することを特徴とするコンピュータ・プログラムにある。
Furthermore, the third aspect of the present invention provides
A computer program for executing image processing on a computer;
A reduction processing step for executing the reduction processing of the correction target image data;
An image correction processing step for performing image processing including pixel value correction of a false color pixel around the image on the reduced image generated in the reduction processing step;
An enlargement process step for executing an enlargement process of the corrected image generated in the image correction process step;
There is a computer program characterized by comprising:

なお、本発明のコンピュータ・プログラムは、例えば、様々なプログラム・コードを実行可能な汎用コンピュータ・システムに対して、コンピュータ可読な形式で提供する記憶媒体、通信媒体、例えば、CDやFD、MOなどの記憶媒体、あるいは、ネットワークなどの通信媒体によって提供可能なコンピュータ・プログラムである。このようなプログラムをコンピュータ可読な形式で提供することにより、コンピュータ・システム上でプログラムに応じた処理が実現される。   The computer program of the present invention is, for example, a storage medium or communication medium provided in a computer-readable format to a general-purpose computer system capable of executing various program codes, such as a CD, FD, MO, etc. Or a computer program that can be provided by a communication medium such as a network. By providing such a program in a computer-readable format, processing corresponding to the program is realized on the computer system.

本発明のさらに他の目的、特徴や利点は、後述する本発明の実施例や添付する図面に基づく、より詳細な説明によって明らかになるであろう。なお、本明細書においてシステムとは、複数の装置の論理的集合構成であり、各構成の装置が同一筐体内にあるものには限らない。   Other objects, features, and advantages of the present invention will become apparent from a more detailed description based on embodiments of the present invention described later and the accompanying drawings. In this specification, the system is a logical set configuration of a plurality of devices, and is not limited to one in which the devices of each configuration are in the same casing.

本発明の構成によれば、補正処理対象画像データの縮小処理を実行し、縮小画像に対して、第1の画像補正処理態様で、白とび周囲の偽色画素の画素値補正を含む画像処理を実行して第1補正画像を生成し、さらに、縮小画像に対して、第1の画像補正処理態様と異なる第2の画像補正処理態様で、白とび周囲の偽色画素の画素値補正を含む画像処理を実行して第2補正画像を生成し、これらの異なる処理結果画像を拡大してブレンドすることにより、最終補正画像を生成する構成としたので、それぞれの画像補正処理が縮小画像に対して実行可能となり、少ない計算コストで画像の補正を行うことができる。また、異なる処理態様での画像補正を融合した補正処理が実現され、それぞれの利点を融合した調和された画素値補正が可能となる。   According to the configuration of the present invention, the reduction processing of the correction processing target image data is executed, and the reduced image is processed in the first image correction processing mode and includes the pixel value correction of the surrounding false color pixels. To generate a first corrected image, and further, for the reduced image, perform pixel value correction of the surrounding false color pixels in a second image correction processing mode different from the first image correction processing mode. In this configuration, the second corrected image is generated by executing the image processing, and the final corrected image is generated by magnifying and blending these different processed result images. Therefore, the image can be corrected at a low calculation cost. In addition, a correction process that combines image corrections in different processing modes is realized, and harmonized pixel value correction that combines the respective advantages is possible.

また、本発明の構成によれば、穴埋め補間処理と、偽色(PF)度合いpを適用した補正処理とのそれぞれの利点を融合した調和された画素値補正が可能となり、パープルフリンジ等の偽色が軽減されるとともに破綻することのない補正画像を取得することが可能となる。具体的には、カメラで撮影した画像に起こる色収差によるパープルフリンジ等の偽色に対する適正な補正が可能となり、高品質な画像データの生成、出力を実現することができる。   Further, according to the configuration of the present invention, it is possible to perform harmonized pixel value correction that combines the advantages of the hole-filling interpolation processing and the correction processing to which the false color (PF) degree p is applied. It is possible to obtain a corrected image that reduces the color and does not fail. Specifically, it is possible to appropriately correct false colors such as purple fringes due to chromatic aberration occurring in an image photographed by a camera, and it is possible to realize generation and output of high-quality image data.

さらに、本発明の構成によれば、すべての画像補正処理を自動処理として行なった場合でも、破綻の無い画像を生成することが可能となる。本発明の画像処理を適用することにより、撮影画像を、より自然に見えるように補正をすることが可能である。従って、撮影時にパープルフリンジが起こらないようにレンズの絞りや焦点距離などに注意を払う必要がなく、より高い自由度で撮影を行なうことが可能となる。   Furthermore, according to the configuration of the present invention, it is possible to generate an image without failure even when all image correction processing is performed as automatic processing. By applying the image processing of the present invention, it is possible to correct the captured image so that it looks more natural. Therefore, it is not necessary to pay attention to the lens aperture and focal length so that purple fringing does not occur during shooting, and shooting can be performed with a higher degree of freedom.

さらに、本発明の構成によれば、縮小処理をした上で、偽色補正処理を行い、それを拡大処理している。しかし、オリジナル画像で画素値が更新される部分は、偽色が発生している部分のみであり、かつ色情報だけが補正される。したがって、偽色以外の部分は全く劣化することが無い。偽色が発生している部分に関しても、特別な縮小処理を施しているので、確実に偽色画素を認識することが出来る。このように、縮小処理により計算コストが減少するにもかかわらす、偽色の補正品質が劣化することはほとんど無い。   Furthermore, according to the configuration of the present invention, the false color correction process is performed after the reduction process, and the enlargement process is performed. However, the part where the pixel value is updated in the original image is only the part where the false color is generated, and only the color information is corrected. Therefore, the portion other than the false color is not deteriorated at all. Since a special reduction process is performed on the portion where the false color is generated, the false color pixel can be reliably recognized. As described above, although the calculation cost is reduced by the reduction process, the false color correction quality is hardly deteriorated.

以下、図面を参照しながら、本発明の画像処理装置、および画像処理方法、並びにコンピュータ・プログラムの詳細について説明する。   Hereinafter, an image processing apparatus, an image processing method, and a computer program according to the present invention will be described in detail with reference to the drawings.

まず、画像処理装置の構成例について図1を参照して説明する。なお、図1に示す画像処理装置は、撮像部を備え、撮像部において撮影した画像データの補正処理を実行する装置例として示してあるが、本発明の画像処理装置は、たとえばハードディスクなどの記憶部に格納された画像データを入力して入力画像の補正を実行することも可能であり、補正処理対象の画像データは、撮像部を介して入力されるデータのみならず、記憶手段、あるいはネットワークを介して入力する画像データなどあらゆる入力画像データに対応可能である。図1は本発明の画像処理装置の一構成例を示すものである。   First, a configuration example of the image processing apparatus will be described with reference to FIG. The image processing apparatus illustrated in FIG. 1 includes an imaging unit and is illustrated as an example of an apparatus that performs correction processing on image data captured by the imaging unit. However, the image processing apparatus of the present invention is a storage device such as a hard disk. It is also possible to execute correction of the input image by inputting the image data stored in the unit, and the image data to be corrected is not only data input via the imaging unit, but also storage means or network It is possible to cope with any input image data such as image data input via the. FIG. 1 shows a configuration example of an image processing apparatus according to the present invention.

図1に示す画像処理装置の詳細構成について説明する。図1に示すように、画像処理装置は、レンズ101、絞り102、固体撮像素子103、相関2重サンプリング回路104、A/Dコンバータ105、DSPブロック106、タイミングジェネレータ107、D/Aコンバータ108、ビデオエンコーダ109、ビデオモニタ110、コーデック(CODEC)111、メモリ112、CPU113、入力デバイス114、フラッシュ制御装置115、フラッシュ発光装置116から構成される。   A detailed configuration of the image processing apparatus shown in FIG. 1 will be described. As shown in FIG. 1, the image processing apparatus includes a lens 101, a diaphragm 102, a solid-state image sensor 103, a correlated double sampling circuit 104, an A / D converter 105, a DSP block 106, a timing generator 107, a D / A converter 108, A video encoder 109, a video monitor 110, a codec (CODEC) 111, a memory 112, a CPU 113, an input device 114, a flash control device 115, and a flash light emitting device 116 are included.

ここで、入力デバイス114はカメラ本体にある録画ボタンなどの操作ボタン類をさす。また、DSPブロック106は信号処理用プロセッサと画像用RAMを持つブロックで、信号処理用プロセッサが画像用RAMに格納された画像データに対してあらかじめプログラムされた画像処理をおこなうことができるようになっている。以下DSPブロックを単にDSPと呼ぶ。   Here, the input device 114 refers to operation buttons such as a recording button on the camera body. The DSP block 106 is a block having a signal processing processor and an image RAM. The signal processing processor can perform pre-programmed image processing on image data stored in the image RAM. ing. Hereinafter, the DSP block is simply referred to as a DSP.

本実施例の全体的な動作を以下に説明する。
光学系を通過して固体撮像素子103に到達した入射光は、まず撮像面上の各受光素子に到達し、受光素子での光電変換によって電気信号に変換され、相関2重サンプリング回路104によってノイズ除去され、A/Dコンバータ105によってデジタ。信号に変換された後、デジタル信号処理部(DSP)106中の画像メモリに一時格納される。なお、必要があれば、撮影の際に、フラッシュ制御装置115を介して、フラッシュ発光装置116を発光させることができる。
The overall operation of this embodiment will be described below.
Incident light that has passed through the optical system and reached the solid-state image sensor 103 first reaches each light receiving element on the imaging surface, is converted into an electrical signal by photoelectric conversion at the light receiving element, and is subjected to noise by the correlated double sampling circuit 104. Removed and digitized by A / D converter 105. After being converted into a signal, it is temporarily stored in an image memory in the digital signal processing unit (DSP) 106. If necessary, the flash light emitting device 116 can be caused to emit light via the flash control device 115 during photographing.

撮像中の状態においては、一定のフレームレートによる画像取り込みを維持するようにタイミングジェネレータ107が信号処理系を制御する。デジタル信号処理部(DSP)106へも一定のレートで画素のストリームが送られ、そこで適切な画像処理がおこなわれた後、画像データはD/Aコンバータ108もしくはコーデック(CODEC)111あるいはその両方に送られる。D/Aコンバータ108はデジタル信号処理部(DSP)106から送られる画像データをアナログ信号に変換し、それをビデオエンコーダ109がビデオ信号に変換し、そのビデオ信号をビデオモニタ110でモニタできるようになっていて、このビデオモニタ110は本実施例においてカメラのファインダの役割を担っている。また、コーデック(CODEC)111はデジタル信号処理部(DSP)106から送られる画像データに対する符号化をおこない、符号化された画像データはメモリ112に記録される。ここで、メモリ112は半導体、磁気記録媒体、光磁気記録媒体、光記録媒体などを用いた記録装置などであってよい。   In the state during imaging, the timing generator 107 controls the signal processing system so as to maintain image capture at a constant frame rate. A stream of pixels is also sent to the digital signal processing unit (DSP) 106 at a constant rate, and after appropriate image processing is performed there, the image data is sent to the D / A converter 108 and / or the codec (CODEC) 111 or both. Sent. The D / A converter 108 converts the image data sent from the digital signal processing unit (DSP) 106 into an analog signal, which is converted into a video signal by the video encoder 109 so that the video signal can be monitored by the video monitor 110. In this embodiment, the video monitor 110 serves as a camera finder. The codec (CODEC) 111 encodes image data sent from the digital signal processing unit (DSP) 106, and the encoded image data is recorded in the memory 112. Here, the memory 112 may be a recording device using a semiconductor, a magnetic recording medium, a magneto-optical recording medium, an optical recording medium, or the like.

以上が本実施例の画像処理装置の一例としてのデジタルビデオカメラのシステム全体の説明であるが、本発明に係る画像処理、すなわち画像データの補正処理はデジタル信号処理部(DSP)106において実行される。以下、この画像処理の詳細について説明する。なお、本実施例で扱う画像の色空間としては、輝度情報と色情報が独立に定義されているものを用いる。例えば、YCbCr空間やCIEL*a*b*空間などが挙げられる。   The above is the description of the entire system of the digital video camera as an example of the image processing apparatus of the present embodiment. Image processing according to the present invention, that is, image data correction processing is executed by the digital signal processing unit (DSP) 106. The Details of the image processing will be described below. Note that, as the color space of the image handled in the present embodiment, one in which luminance information and color information are defined independently is used. For example, a YCbCr space or a CIEL * a * b * space may be used.

以下、本発明の画像処理装置では、輝度レベルがほぼ飽和レベル以上の画素として現れる白とび周辺に発生するパープルフリンジ等の偽色に注目し、この偽色画素を効率的に補正して、高品質な画像データを生成、出力することを可能とした構成を持つ。偽色(パープルフリンジ)は、白とび部分周辺で目立って現れる現象で、色収差による色ずれにより例えば紫色の偽色を生ずることを特徴とする。偽色が発生する白とびの周り範囲大きさは、光学系の絞り、焦点距離に連動しており、また、光学中心からの距離にも依存し、大きさが変わる。また、偽色が出る方向も、光学中心から白とび画素の外側に向かう方向、白とび画素から光学中心に向かう方向それぞれに発生し、その傾向は、撮像する光学系により異なる。   Hereinafter, in the image processing apparatus according to the present invention, attention is paid to false colors such as purple fringes that appear in the vicinity of the overexposure that appear as pixels whose luminance level is substantially equal to or higher than the saturation level. It has a configuration that makes it possible to generate and output quality image data. The false color (purple fringe) is a phenomenon that appears conspicuously around the overexposed portion, and is characterized in that, for example, a purple false color is generated due to a color shift due to chromatic aberration. The size of the area around the whiteout where false color occurs is linked to the aperture and focal length of the optical system, and also changes depending on the distance from the optical center. In addition, the direction in which the false color is generated also occurs in the direction from the optical center toward the outside of the pixel and from the highlight pixel to the optical center, and the tendency varies depending on the optical system to be imaged.

以下、デジタル信号処理部(DSP)106において実行する画像データ補正処理の詳細について説明する。図2は、本発明に従った画像処理の全体シーケンスを示すフローチャートとしての総合処理フローである。まず、本フローに従って本発明の画像処理の概要を説明し、その後、各ステップにおける処理の詳細について、順次、説明する。   Hereinafter, details of the image data correction processing executed in the digital signal processing unit (DSP) 106 will be described. FIG. 2 is an overall processing flow as a flowchart showing the entire sequence of image processing according to the present invention. First, the outline of the image processing of the present invention will be described according to this flow, and then the details of the processing in each step will be described sequentially.

まず、ステップS11において、補正処理を実行する画像データである入力画像の縮小処理を行う。次にステップS12において、縮小処理により生成された縮小画像データに対して平均法に基づく画像補正処理を実行する。平均法については、後段で詳細を説明するが、画像データの構成画素から選択された注目画素について、偽色である可能性を示すパラメータとしての偽色度合いpを算出し、注目画素近傍領域の画素値に基づいて、注目画素に対応する補間値を算出し、注目画素の偽色度合いpに応じて元画素値と前記補間値との寄与率を変更して注目画素の補正画素値を算出する処理である。次にステップS13において、ステップS12の平均法による補正画像の拡大処理を実行する。   First, in step S11, a reduction process is performed on an input image that is image data on which correction processing is executed. In step S12, an image correction process based on an average method is executed on the reduced image data generated by the reduction process. The details of the averaging method will be described later. For the target pixel selected from the constituent pixels of the image data, a false color degree p as a parameter indicating the possibility of false color is calculated, and Based on the pixel value, an interpolation value corresponding to the target pixel is calculated, and a correction pixel value of the target pixel is calculated by changing a contribution ratio between the original pixel value and the interpolation value according to the false color degree p of the target pixel. It is processing to do. Next, in step S13, a correction image enlargement process is executed by the averaging method in step S12.

ステップS14では、ステップS11の縮小処理により生成された縮小画像に対して、穴埋め法に基づく画像補正処理を実行する。穴埋め法については、後段で詳細に説明するが、画像データの構成画素に含まれる白とび画素の近傍からパープルフリンジ等の偽色であると判定される画素を抽出し、偽色と判定される画素についての画素値を周囲の画素の画素値に基づいて算出することにより、画像データの補正を行なう処理である。次にステップS15において、ステップS14の穴埋め法による補正画像の拡大処理を実行する。最後にステップS16において、ステップS12とステップS13の処理において生成した平均法に基づく画像処理を実行して得られた画像データと、ステップS14とステップS15の処理において生成した穴埋め法に基づく画像処理を実行して得られた画像データとのブレンド処理を行い、最終的な補正画素値から構成される補正画像データがせいせいされ、すべての処理が完了する。各処理の詳細については、後段で説明する。   In step S14, image correction processing based on the hole filling method is executed on the reduced image generated by the reduction processing in step S11. The hole filling method will be described in detail later, but pixels that are determined to be false colors such as purple fringe are extracted from the vicinity of overexposed pixels included in the constituent pixels of the image data, and are determined to be false colors. This is a process of correcting image data by calculating pixel values for pixels based on pixel values of surrounding pixels. In step S15, a correction image enlargement process is executed by the hole filling method in step S14. Finally, in step S16, image data obtained by executing image processing based on the average method generated in the processing in steps S12 and S13, and image processing based on the hole filling method generated in the processing in steps S14 and S15. A blend process with the image data obtained by execution is performed, and the corrected image data composed of the final corrected pixel values is assigned, and all the processes are completed. Details of each process will be described later.

本発明の画像処理においては、最初に入力画像に対して、ステップS11で特殊な縮小処理を施すことにより、パープルフリンジ(PF)等の偽色画素の補正を確実に実行する構成として、補正の効果を損なうことなく、かつ計算コストを削減している。本実施例の縮小処理では、輝度情報と色情報を別々の方法で縮小する。輝度情報の縮小処理においては白とびが失われないように、色情報の縮小処理においてはパープルフリンジ(PF)等の偽色の色データが失われないように考慮して入力画像に対し縮小処理を施す。   In the image processing according to the present invention, first, a special reduction process is performed on the input image in step S11, so that correction of false color pixels such as purple fringe (PF) is reliably executed. The calculation cost is reduced without impairing the effect. In the reduction process of this embodiment, the luminance information and the color information are reduced by different methods. In order to prevent overexposure in the reduction processing of luminance information, in the reduction processing of color information, reduction processing is performed on the input image in consideration of not losing false color data such as purple fringe (PF). Apply.

このような特殊な縮小処理を実行することにより、縮小によるオリジナル画像での白とびが欠落せず、オリジナル画像データにパープルフリンジ(PF)等の偽色に対応する色の画素が存在する場合に、縮小画像データにもその偽色画素を欠落させずに残し、縮小しても見逃さないようにすることができる。また、パープルフリンジ(PF)が発生している部分の画像は収差による影響でボケており、ある程度入力画像を縮小したものに対しても、効果的にパープルフリンジ(PF)を補正することができる。このように、本発明の処理では、入力画像に対しそのまま補正処理を施す方法と比較して、偽色補正効果を損なうことなく、かつ計算コストを大幅に削減することができる。   By performing such a special reduction process, when the original image due to the reduction is not lost, and pixels of a color corresponding to a false color such as purple fringe (PF) exist in the original image data. Further, the false color pixels are not lost in the reduced image data, and can be prevented from being overlooked even when reduced. Further, the image of the part where the purple fringe (PF) is generated is blurred due to the influence of the aberration, and the purple fringe (PF) can be effectively corrected even when the input image is reduced to some extent. . As described above, in the process of the present invention, the calculation cost can be greatly reduced without impairing the false color correction effect as compared with the method of performing the correction process on the input image as it is.

なお、以下、説明する処理において、補正対象とするオリジナルの入力画像は、幅をWL、高さをHLの画像データとし、図2に示すフローのステップS11における縮小処理によって生成する縮小画像は、幅をw、高さをhとした画像データとする。ステップS11では、WL×HLの画像データを1/nに縮小し、w×hの縮小画像を生成する。なお、wはWLをnで割った答えの小数点以下を切り上げた値、hはHLをnで割った答えの小数点以下を切り上げた値となる。   In the process described below, the original input image to be corrected is image data having a width of WL and a height of HL, and the reduced image generated by the reduction process in step S11 of the flow shown in FIG. It is assumed that the image data has a width w and a height h. In step S11, the WL × HL image data is reduced to 1 / n to generate a w × h reduced image. Note that w is a value obtained by rounding up the decimal point of the answer obtained by dividing WL by n, and h is a value obtained by rounding up the decimal point of the answer obtained by dividing HL by n.

図2に示すフローのステップS11における縮小処理の詳細について、図3および図4を参照して説明する。図3、図4は、図2に示すフローのステップS11における縮小処理の手順を示すフローチャートである。各ステップの処理について説明する。なお、本フローおよび以下の説明において、縮小量は自然数nで表わす。例えばnが2の時は、WL×HLのオリジナル画像データを1/2に縮小し、w×hの縮小画像を生成する。nが4の時には4分の1に縮小することを意味する。   Details of the reduction processing in step S11 of the flow shown in FIG. 2 will be described with reference to FIGS. 3 and 4 are flowcharts showing the procedure of the reduction process in step S11 of the flow shown in FIG. The process of each step will be described. In the present flow and the following description, the reduction amount is represented by a natural number n. For example, when n is 2, the original image data of WL × HL is reduced to ½, and a reduced image of w × h is generated. When n is 4, it means to reduce to 1/4.

オリジナル画像と縮小画像の対応について図5を参照して説明する。図5には、縮小処理を施すオリジナル画像150と、縮小処理によって生成される縮小画像160を示している。オリジナル画像150はWL×HLであり、これを1/nに縮小してw×hの縮小画像160を生成する。オリジナル画像150に基づいて縮小画像160を生成する場合、縮小画像160の画素の値を個別に設定することが必要となる。例えば、縮小画像160における座標(x,y)の画素161について輝度情報と色情報とを決定することが必要となる。このために、縮小画像160における座標(x,y)の画素161の対応領域をオリジナル画像150から選択し、対応領域の構成画素の輝度情報と色情報とに基づいて、縮小画像160の画素(x,y)の輝度L(x,y)と色情報C(x,y)を求めることになる。この処理手順を示しているのが、図3、図4に示すフローチャートである。 The correspondence between the original image and the reduced image will be described with reference to FIG. FIG. 5 shows an original image 150 to be reduced and a reduced image 160 generated by the reduction process. The original image 150 is WL × HL, which is reduced to 1 / n to generate a reduced image 160 of w × h. When the reduced image 160 is generated based on the original image 150, it is necessary to individually set the pixel values of the reduced image 160. For example, it is necessary to determine the luminance information and the color information for the pixel 161 at the coordinates (x, y) in the reduced image 160. For this purpose, the corresponding region of the pixel 161 at the coordinate (x, y) in the reduced image 160 is selected from the original image 150, and the pixel (in the reduced image 160) (based on the luminance information and the color information of the constituent pixels of the corresponding region). The luminance L S (x, y) and color information C S (x, y) of x, y) are obtained. This processing procedure is shown in the flowcharts shown in FIGS.

縮小画像160における座標(x,y)の画素161の対応領域は、オリジナル画像150の対応画像領域151である。この対応画像領域151は、オリジナル画像150の画素範囲として、u=(n×x)〜(n×x+n−1)、v=(n×y)〜(n×y+n−1)である。すなわち、図5に示すように、
(u,v)=(n×x,n×y)、
(u,v)=(n×x+n−1,n×y)
(u,v)=(n×x+n−1,n×y+n−1)
(u,v)=(n×x,n×y+n−1)
の4点を頂点とする矩形領域として設定される画像領域151である。
The corresponding area of the pixel 161 at the coordinate (x, y) in the reduced image 160 is the corresponding image area 151 of the original image 150. The corresponding image area 151 has u = (n × x) to (n × x + n−1) and v = (n × y) to (n × y + n−1) as pixel ranges of the original image 150. That is, as shown in FIG.
(U, v) = (n × x, n × y),
(U, v) = (n × x + n−1, n × y)
(U, v) = (n × x + n−1, n × y + n−1)
(U, v) = (n × x, n × y + n−1)
This is an image area 151 set as a rectangular area with the four points as vertices.

縮小画像160における座標(x,y)の画素161の輝度L(x,y)と色情報C(x,y)は、オリジナル画像150の対応画像領域151に含まれる画素の輝度情報と色情報とに基づいて決定される。 The luminance L S (x, y) and the color information C S (x, y) of the pixel 161 at the coordinates (x, y) in the reduced image 160 are the luminance information of the pixel included in the corresponding image area 151 of the original image 150, and It is determined based on the color information.

図3、図4に示すフローチャートの各ステップの処理について説明する。まず、ステップS101、S102において、縮小画像での座標(x,y)を表わす変数x,yの初期化を行なう。ステップS101でy=0、ステップS102でx=0とする。次にステップS103において、座標(x,y)の位置の画素を求める際に用いる変数Lmax,CPF,NPF,CNPF,NNPFを、すべて0に初期化する。各変数は、以下の意味を有する。 Processing of each step in the flowcharts shown in FIGS. 3 and 4 will be described. First, in steps S101 and S102, variables x and y representing coordinates (x, y) in the reduced image are initialized. In step S101, y = 0, and in step S102, x = 0. Next, in step S103, variables L max , C PF , N PF , C NPF , and N NPF used when obtaining the pixel at the coordinates (x, y) are all initialized to zero. Each variable has the following meaning.

max:オリジナル画像の対応画像領域における最大輝度
PF:オリジナル画像の対応画像領域におけるパープルフリンジ(PF)画素の色情報
PF:オリジナル画像の対応画像領域におけるパープルフリンジ(PF)画素の画素数
NPF:オリジナル画像の対応画像領域におけるパープルフリンジ(PF)ではない画素の色情報
NPF:オリジナル画像の対応画像領域におけるパープルフリンジ(PF)ではない画素の画素数
L max : Maximum luminance in the corresponding image area of the original image C PF : Color information of purple fringe (PF) pixels in the corresponding image area of the original image N PF : Number of pixels of purple fringe (PF) pixels in the corresponding image area of the original image C NPF : Color information of pixels that are not purple fringe (PF) in the corresponding image area of the original image N NPF : Number of pixels that are not purple fringe (PF) in the corresponding image area of the original image

ステップS103における変数の初期化の後、ステップS104、S105において、オリジナルの入力画像の座標(u,v)を表わす変数u、vを初期化する。ステップS104でv=n×y、ステップS105でu=n×xとする。図5を参照して説明したように、縮小画像の座標(x,y)の画素は、オリジナル画像の対応画像領域、すなわち、u座標が(n×x)〜(n×x+n−1)、v座標が(n×y)〜(n×y+n−1)に相当する対応画像領域内に含まれる画素を用いて算出される。   After initialization of variables in step S103, variables u and v representing coordinates (u, v) of the original input image are initialized in steps S104 and S105. In step S104, v = n × y, and in step S105, u = n × x. As described with reference to FIG. 5, the pixel at the coordinate (x, y) of the reduced image is a corresponding image area of the original image, that is, the u coordinate is (n × x) to (n × x + n−1), The v coordinate is calculated using pixels included in the corresponding image area corresponding to (n × y) to (n × y + n−1).

縮小画像の注目画素(x,y)の輝度L(x,y)は、オリジナル画像の対応画像領域の中で最大値のものを選択し、これを縮小画像の注目画素(x,y)の輝度L(x,y)とする。 For the luminance L S (x, y) of the target pixel (x, y) of the reduced image, the luminance L S (x, y) of the corresponding image area of the original image is selected, and this is selected as the target pixel (x, y) of the reduced image. The luminance L S (x, y) of

また、縮小画像の注目画素(x,y)の色情報C(x,y)は、オリジナル画像の対応画像領域に含まれる画素に、パープルフリンジ(PF)に相当する色相を持つ画素があればそれらの平均値を求めこの平均値を縮小画像の注目画素(x,y)の色情報C(x,y)とする。オリジナル画像の対応画像領域に含まれる画素に、パープルフリンジ(PF)に相当する色相を持つ画素が含まれない場合は、対応画像領域に含まれる全画素の平均値を算出し、これを縮小画像の注目画素(x,y)の色情報C(x,y)とする。 The color information C S (x, y) of the target pixel (x, y) of the reduced image includes pixels having a hue corresponding to purple fringe (PF) among the pixels included in the corresponding image area of the original image. For example, the average value is obtained, and this average value is used as the color information C S (x, y) of the target pixel (x, y) of the reduced image. If the pixel included in the corresponding image area of the original image does not include a pixel having a hue corresponding to purple fringe (PF), an average value of all the pixels included in the corresponding image area is calculated, and this is reduced. Is the color information C S (x, y) of the target pixel (x, y).

ステップS106においては、オリジナル画像の対応画像領域から選択された画素(u,v)の輝度L(u,v)が、Lmaxより大きいかを判定する。
L(u,v)>Lmax
が成立する場合は、ステップS107においてLmax=L(u,v)とする変数更新処理を実行してからステップS108へ進み、
L(u,v)>Lmax
が成立しない場合は、直接S108へ進む。
In step S106, it is determined whether the luminance L (u, v) of the pixel (u, v) selected from the corresponding image area of the original image is greater than L max .
L (u, v)> L max
Is satisfied, in step S107, variable update processing is performed to set L max = L (u, v), and then the process proceeds to step S108.
L (u, v)> L max
If is not established, the process proceeds directly to S108.

ステップS108においては、オリジナル画像の座標(u,v)の色C(u,v)が、予め指定された色相範囲、すなわちパープルフリンジ(PF)等の偽色に相当する色相範囲に入る色相であるか否かを判定する。ステップS108における色相判定処理について、図6を参照して説明する。   In step S108, the color C (u, v) of the coordinates (u, v) of the original image is a hue that falls within a hue range designated in advance, that is, a hue range corresponding to a false color such as purple fringe (PF). It is determined whether or not there is. The hue determination process in step S108 will be described with reference to FIG.

図6は、色空間におけるパープルフリンジ(PF)の色相範囲をあらわした図である。色空間の一例としてYCbCr空間を用いる場合、色情報に相当するCbCrを2次元にプロットしたのが図6である。横軸がCb、縦軸がCrの値を示し、原点180はCb=128,Cr=128に相当する色である。   FIG. 6 is a diagram showing the hue range of purple fringe (PF) in the color space. When the YCbCr space is used as an example of the color space, FIG. 6 is a two-dimensional plot of CbCr corresponding to the color information. The horizontal axis indicates the value of Cb, the vertical axis indicates the value of Cr, and the origin 180 is a color corresponding to Cb = 128 and Cr = 128.

パープルフリンジ(PF)に相当する色相範囲を指定する方法として、2つの色相の間に入っているか否かを判定する方法を用いる。パープルフリンジ(PF)は紫色を有し、この特定の色相範囲を図6に示すCbCr2次元座標空間で設定する。図に示す色相ライン181と、色相ライン182とによって挟まれる領域が、パープルフリンジ(PF)に相当する色相範囲183を示す領域として設定される。   As a method for designating a hue range corresponding to purple fringe (PF), a method for determining whether or not the hue range is between two hues is used. The purple fringe (PF) has a purple color, and this specific hue range is set in the CbCr two-dimensional coordinate space shown in FIG. A region sandwiched between the hue line 181 and the hue line 182 shown in the drawing is set as a region indicating a hue range 183 corresponding to purple fringe (PF).

ステップS108では、オリジナル画像の対応画像領域から選択された選択画素(u,v)の色C(u,v)が、図6に示す色相範囲183に含まれるか否かによって、C(u,v)が、偽色(PF)色相であるか否かを判定する。C(u,v)が偽色(PF)色相であると判定された場合はステップS109へ、C(u,v)が偽色(PF)色相でないと判定された場合はステップS110へ進む。   In step S108, depending on whether or not the color C (u, v) of the selected pixel (u, v) selected from the corresponding image area of the original image is included in the hue range 183 shown in FIG. It is determined whether v) is a false color (PF) hue. If it is determined that C (u, v) is a false color (PF) hue, the process proceeds to step S109. If C (u, v) is determined not to be a false color (PF) hue, the process proceeds to step S110.

ステップS109では、偽色(PF)色相と判定された画素の色を平均するための変数、すなわち、
PF:オリジナル画像の対応画像領域におけるパープルフリンジ(PF)画素の色情報
PF:オリジナル画像の対応画像領域におけるパープルフリンジ(PF)画素の画素数
これらの変数CPFとNPFを更新する。具体的には、
PF=CPF+C(u,v),
PF=NPF+1
として、変数CPFとNPFを更新する。
PFは、オリジナル画像の対応画像領域から抽出されたパープルフリンジ(PF)画素の色情報の積算値、NPFは、オリジナル画像の対応画像領域から抽出されたパープルフリンジ(PF)画素の画素総数を意味する値となる。
In step S109, a variable for averaging the colors of pixels determined to have a false color (PF) hue, that is,
C PF : Color information of purple fringe (PF) pixels in the corresponding image area of the original image N PF : Number of pixels of purple fringe (PF) pixels in the corresponding image area of the original image These variables C PF and N PF are updated. In particular,
C PF = C PF + C (u, v),
N PF = N PF +1
As a result, the variables CPF and NPF are updated.
CPF is an integrated value of color information of purple fringe (PF) pixels extracted from the corresponding image area of the original image, and NPF is the total number of purple fringe (PF) pixels extracted from the corresponding image area of the original image. It means a value.

一方、C(u,v)が偽色(PF)色相でないと判定された場合、ステップS110において、偽色(PF)色相ではないと判定された画素の色を平均するための変数、すなわち、
NPF:オリジナル画像の対応画像領域におけるパープルフリンジ(PF)ではない画素の色情報
NPF:オリジナル画像の対応画像領域におけるパープルフリンジ(PF)ではない画素の画素数
これらの変数CNPFとNNPFを更新する。具体的には、
NPF=CNPF+C(u,v),
NPF=NNPF+1
として、変数CNPFとNNPFを更新する。
NPFは、オリジナル画像の対応画像領域から抽出されたパープルフリンジ(PF)ではない画素の色情報の積算値、NNPFは、オリジナル画像の対応画像領域から抽出されたパープルフリンジ(PF)ではない画素の画素総数を意味する値となる。
On the other hand, if it is determined that C (u, v) is not a false color (PF) hue, in step S110, a variable for averaging the colors of pixels determined not to be a false color (PF) hue, that is,
C NPF : Color information of pixels that are not purple fringe (PF) in the corresponding image area of the original image N NPF : Number of pixels of pixels that are not purple fringe (PF) in the corresponding image area of the original image These variables C NPF and N NPF Update. In particular,
C NPF = C NPF + C (u, v),
N NPF = N NPF +1
As a result, the variables C NPF and N NPF are updated.
C NPF is an integrated value of color information of pixels other than the purple fringe (PF) extracted from the corresponding image area of the original image, and N NPF is not a purple fringe (PF) extracted from the corresponding image area of the original image. The value means the total number of pixels.

ステップS109またはステップS110の処理の終了後、ステップS111に進む。ステップS111では、オリジナル画像の対応画像領域の座標(u,v)のu成分値を1増加させ、ステップS112においてuが、u<n×x+nであり、u<Wが成立するか否かを判定する。すなわち、座標(u,v)のu成分値が、図5を参照して説明したオリジナル画像150の対応画像領域151の右端に達しておらず(u<n×x+n)、かつ、オリジナル画像150の右端領域にも達していない(u<W)場合は、ステップS106に戻り、更新された座標(u,v)に対応する画素についてステップS106以下の処理を実行する。 After the process of step S109 or step S110 ends, the process proceeds to step S111. In step S111, the u component value is increased by one in the coordinates of the corresponding image area of the original image (u, v), u in step S112 is a u <n × x + n, whether u <W L is established Determine. That is, the u component value of the coordinates (u, v) does not reach the right end of the corresponding image area 151 of the original image 150 described with reference to FIG. 5 (u <n × x + n), and the original image 150 Is not reached (u <W L ), the process returns to step S106, and the processing from step S106 onward is executed for the pixel corresponding to the updated coordinates (u, v).

ステップS112においてuが、u<n×x+nであり、u<Wが成立すると判定した場合は、ステップS113において、対応画像領域の座標(u,v)のv成分値を1増加させ、ステップS114においてvがv<n×y+nであり、v<Hが成立するか否かを判定する。すなわち、座標(u,v)のv成分値が、図5を参照して説明したオリジナル画像150の対応画像領域151の下端に達しておらず(v<n×y+n)、かつ、オリジナル画像150の下端領域にも達していない(v<H)場合は、ステップS105に戻り、更新された座標(u,v)に対応する画素についてステップS105以下の処理を実行する。ステップS114がNoと判定されると、縮小画像の1つの画素(x,y)に対応するオリジナル画像の対応画像領域に含まれる全画素についての処理が終了したことになる。 U in step S112 is a u <n × x + n, if it is determined that u <W L is established, in step S113, the coordinates (u, v) of the corresponding image region v component values is increased by one in step In S114, it is determined whether v is v <n × y + n and v <H L is satisfied. That is, the v component value of the coordinates (u, v) does not reach the lower end of the corresponding image area 151 of the original image 150 described with reference to FIG. 5 (v <n × y + n), and the original image 150 Is not reached (v <H L ), the process returns to step S105, and the processing from step S105 is executed on the pixel corresponding to the updated coordinates (u, v). If step S114 is determined to be No, processing for all the pixels included in the corresponding image area of the original image corresponding to one pixel (x, y) of the reduced image is completed.

次に、図4に示すステップS115に進む。ステップS115〜S117では、縮小画像の画素(x,y)の輝度L(x,y)と色の値C(x,y)を設定する処理を行う。ステップS115では、縮小画像の画素(x,y)の輝度値L(x,y)として、ステップS107で順次更新処理を実行して得られたLmaxを設定する。すなわち、縮小画像の注目画素(x,y)の輝度L(x,y)は、オリジナル画像の対応画像領域の中で最大値のものを選択し、これを縮小画像の注目画素(x,y)の輝度L(x,y)とする。 Next, the process proceeds to step S115 shown in FIG. In steps S115 to S117, a process of setting the luminance L S (x, y) and the color value C S (x, y) of the pixel (x, y) of the reduced image is performed. In step S115, L max obtained by sequentially executing the update process in step S107 is set as the luminance value L S (x, y) of the pixel (x, y) of the reduced image. That is, the luminance L S (x, y) of the target pixel (x, y) of the reduced image is selected from the corresponding image areas of the original image, and this is selected as the target pixel (x, y) of the reduced image. Let y) be the luminance L S (x, y).

次に、ステップS116において、オリジナル画像の対応画像領域においてカウントされたNPF、すなわち、オリジナル画像の対応画像領域におけるパープルフリンジ(PF)画素の画素数が0より大であるか否かを判定する。
PF>0
が成立する場合はステップS117へ、成立しない場合はステップS118へ進む。
Next, in step S116, it is determined whether N PF counted in the corresponding image area of the original image, that is, whether the number of purple fringe (PF) pixels in the corresponding image area of the original image is greater than zero. .
N PF > 0
If is established, the process proceeds to step S117, and if not, the process proceeds to step S118.

ステップS117では、縮小画像の注目画素(x,y)の色の値C(x,y)を下式によって算出する。すなわち、
(x,y)=CPF/NPF
上記式によって算出する。これは、オリジナル画像の対応画像領域におけるパープルフリンジ(PF)画素の色情報の積算値をパープルフリンジ(PF)画素の画素数で除算したものである。すなわち、オリジナル画像の対応画像領域にパープルフリンジ(PF)画素が1つ以上含まれる場合は、オリジナル画像の対応画像領域におけるパープルフリンジ(PF)画素の平均的な色情報を縮小画像の注目画素(x,y)の色の値C(x,y)として設定する。
In step S117, the color value C S (x, y) of the target pixel (x, y) of the reduced image is calculated by the following equation. That is,
C S (x, y) = C PF / N PF
Calculated by the above formula. This is obtained by dividing the integrated value of the color information of purple fringe (PF) pixels in the corresponding image area of the original image by the number of purple fringe (PF) pixels. In other words, when one or more purple fringe (PF) pixels are included in the corresponding image area of the original image, the average color information of the purple fringe (PF) pixels in the corresponding image area of the original image is changed to the target pixel ( x, y) is set as a color value C S (x, y).

ステップS116において、
PF>0
が成立しない場合、すなわち、オリジナル画像の対応画像領域におけるパープルフリンジ(PF)画素の画素数が0である場合は、ステップS118に進み、縮小画像の注目画素(x,y)の色の値C(x,y)を下式によって算出する。すなわち、
(x,y)=CNPF/NNPF
上記式によって算出する。これは、オリジナル画像の対応画像領域におけるパープルフリンジ(PF)画素ではない全画素の色情報の積算値を全画素数で除算したものである。すなわち、オリジナル画像の対応画像領域にパープルフリンジ(PF)画素が全く含まれない場合は、オリジナル画像の対応画像領域における全画素の平均的な色情報を縮小画像の注目画素(x,y)の色の値C(x,y)として設定する。
In step S116,
N PF > 0
Is not satisfied, that is, when the number of purple fringe (PF) pixels in the corresponding image area of the original image is 0, the process proceeds to step S118, and the color value C of the target pixel (x, y) of the reduced image is obtained. S (x, y) is calculated by the following equation. That is,
C S (x, y) = C NPF / N NPF
Calculated by the above formula. This is obtained by dividing the integrated value of the color information of all pixels that are not purple fringe (PF) pixels in the corresponding image area of the original image by the total number of pixels. That is, when the corresponding image area of the original image does not include any purple fringe (PF) pixels, the average color information of all the pixels in the corresponding image area of the original image is obtained from the target pixel (x, y) of the reduced image. Set as color value C S (x, y).

以上の処理によって、縮小画像の1つの画素、すなわち、縮小画像の注目画素(x,y)の輝度L(x,y)と、色情報C(x,y)が決定されることになる。ステップS119〜S122は、縮小画像の注目画素(x,y)の座標位置の更新処理である。 With the above processing, the luminance L S (x, y) and the color information C S (x, y) of one pixel of the reduced image, that is, the target pixel (x, y) of the reduced image are determined. Become. Steps S119 to S122 are processing for updating the coordinate position of the target pixel (x, y) of the reduced image.

ステップS119において、注目画素の座標(x,y)のx成分値を1増加させ、ステップS120においてxが、x<w、すなわち、縮小画像の画像サイズの幅wに未達か否かを判定しYesならS103に戻りNoならS121に進む。ステップS121では、注目画素(x,y)のy成分値を1増加させ、ステップS122においてyが、y<h、すなわち、縮小画像の画像サイズの高さhに未達か否かを判定し、YesならS102に戻り、Noなら処理を終了する。   In step S119, the x component value of the coordinate (x, y) of the target pixel is incremented by 1, and in step S120, it is determined whether x is less than x <w, that is, the width w of the image size of the reduced image. If Yes, the process returns to S103. If No, the process proceeds to S121. In step S121, the y component value of the pixel of interest (x, y) is increased by 1. In step S122, it is determined whether y is less than y <h, that is, the height h of the image size of the reduced image. If Yes, the process returns to S102, and if No, the process ends.

これらの処理は、縮小画像(幅w画素、高さh画素)の画像データにおいて、注目画素(x,y)を1つずつ移動させる処理であり、ステップS122がNoと判定されると、縮小画像(幅w画素、高さh画素)の全画素についての処理が終了し、すべての画素を注目画素として設定した画素値決定処理が完了する。すなわち、縮小画像のすべての構成画素の画素情報、すなわち、輝度L(x,y)と、色情報C(x,y)が決定されたことになる。 These processes are processes for moving the target pixel (x, y) one by one in the image data of the reduced image (width w pixels, height h pixels). If it is determined No in step S122, the reduction is performed. The processing for all the pixels of the image (width w pixels, height h pixels) is completed, and the pixel value determination processing in which all the pixels are set as the target pixel is completed. That is, the pixel information of all the constituent pixels of the reduced image, that is, the luminance L S (x, y) and the color information C S (x, y) are determined.

以上の処理が、図2に示す総合処理フローのステップS11の画像データ縮小処理である。次に、図2に示す総合処理フローのステップS12の平均法に基づく画像補正処理の詳細について説明する。ステップS12の平均法に基づく画像補正処理は、上述の縮小処理の結果生成された縮小画像データに対する処理として実行する。   The above processing is the image data reduction processing in step S11 of the comprehensive processing flow shown in FIG. Next, details of the image correction processing based on the averaging method in step S12 of the overall processing flow shown in FIG. 2 will be described. The image correction process based on the averaging method in step S12 is executed as a process for the reduced image data generated as a result of the above reduction process.

平均法に基づく画像補正処理の詳細について、図7以下を参照して説明する。図7、図8は、本発明の画像処理の手順を示すフローチャートである。図7、図8に示すフローチートの各ステップの処理の詳細を順次説明する。   Details of the image correction processing based on the averaging method will be described with reference to FIG. 7 and 8 are flowcharts showing the procedure of image processing according to the present invention. Details of the processing of each step of the flow cheat shown in FIGS. 7 and 8 will be sequentially described.

ステップS201、S202において、補正対象画像データの検査対象画素位置の初期設定を実行する。初期設定として注目画素の画素位置を(0,0)、すなわちx=0、y=0として設定する。本発明の処理では、上述のように、補正対象として入力される画像データの構成画素について1つずつ、偽色度合い(PF度合い)を算出し、算出した各画素対応の偽色度合い(PF度合い)に基づく補正処理を行なう。ステップS201、S202にあるように座標(0,0)から始めて、画像中の各画素を順番に注目画素として色情報の補正を行う。   In steps S201 and S202, initial setting of the inspection target pixel position of the correction target image data is executed. As an initial setting, the pixel position of the target pixel is set as (0, 0), that is, x = 0 and y = 0. In the processing of the present invention, as described above, the false color degree (PF degree) is calculated for each of the constituent pixels of the image data input as the correction target, and the false color degree (PF degree) corresponding to each calculated pixel is calculated. ) Based on (). As in steps S201 and S202, starting from the coordinates (0, 0), the color information is corrected with each pixel in the image as a target pixel in order.

注目画素が決定されたあとは、偽色度合い、すなわちパープルフリンジ度合い(PF度合い)を算出する。本実施例においては、偽色度合い(PF度合い)の算出に、以下の各尺度、すなわち、
(a)白とび(高輝度画素)への近さ、
(b)彩度の大きさ、
(c)偽色に相当する特定色相への近さ
の3種類の尺度を考慮する。
After the target pixel is determined, a false color degree, that is, a purple fringe degree (PF degree) is calculated. In this embodiment, the following scales are used for calculating the false color degree (PF degree):
(A) proximity to whiteout (high brightness pixels),
(B) magnitude of saturation;
(C) Consider three types of measures: closeness to a specific hue corresponding to false color.

まず、上記尺度(a)〜(c)中の、「(a)白とび(高輝度画素)への近さ」に関して説明する。パープルフリンジは、主に白とびの周囲に発生する。逆に、注目画素がパープルフリンジであるときには、注目画素の周囲に、白とびが存在する。注目画素が白とびに近ければ近いほど、その画素はパープルフリンジである可能性が高いといえる。   First, “(a) proximity to whiteout (high luminance pixel)” in the scales (a) to (c) will be described. Purple fringes occur mainly around whiteout. Conversely, when the target pixel is a purple fringe, there is a whiteout around the target pixel. It can be said that the closer the target pixel is to whiteout, the higher the possibility that the pixel is purple fringe.

ところで、パープルフリンジは白とびが発生している部分を中心として発生するが、白とびの画像上での位置によりパープルフリンジが発生する範囲は異なる。例えば、光学中心に当たる画像中心部から画像端に向かう方向に、パープルフリンジが発生しやすい場合がある。これは、光学系の種類や、絞り・焦点距離などの設定、注目画素の位置によっても、パープルフリンジが発生する範囲の特徴は異なる。   By the way, the purple fringe is generated centering on the portion where the whiteout occurs, but the range in which the purple fringe occurs differs depending on the position on the whiteout image. For example, purple fringes are likely to occur in the direction from the center of the image that hits the optical center toward the image edge. This is because the characteristics of the range in which purple fringes occur vary depending on the type of optical system, the setting of the aperture / focal length, and the position of the pixel of interest.

本実施例では、ステップS203において、注目画素がパープルフリンジであるとしたときに白とびが起こっている可能性のある範囲、白とび探索範囲(x,y,x,y)を算出する。白とび探索範囲の算出方法としては、例えば、注目画素が白とびであった場合に、注目画素から画像中心に向かう方向とその180度反対側の方向またそれらと直行する方向に、どの程度の大きさのパープルフリンジが発生するかを算出すればよい。そのためには、あらかじめ本実施例に用いる光学系に関して、パープルフリンジの発生する可能性のある範囲を調べておき、ルックアップテーブルなどにそのデータを保存し、注目画素の画素位置に基づいてルックアップテーブルを検索して、画素位置対応の白とび探索範囲(x,y,x,y)のデータを抽出する。あるいは、ルックアップテーブルには、白とび探索範囲(x,y,x,y)を算出するために必用なデータを格納し、これを抽出して演算によって白とび探索範囲(x,y,x,y)を算出する構成としてもよい。あるいは、ルックアップテーブルを適用せずに、予め設定された関数に従った演算処理を実行して、白とび探索範囲(x,y,x,y)を算出する構成としてもよい。 In the present embodiment, in step S203, when the target pixel is a purple fringe, the range in which overexposure may occur, the overexposure search range (x 0 , y 0 , x 1 , y 1 ) is set. calculate. As a method for calculating the overexposure search range, for example, when the target pixel is overexposed, how large is the direction from the target pixel toward the center of the image and the direction opposite to 180 degrees or the direction orthogonal thereto? What is necessary is just to calculate whether the purple fringe will occur. For this purpose, the range in which purple fringes are likely to occur is examined in advance with respect to the optical system used in this embodiment, the data is stored in a lookup table or the like, and the lookup is performed based on the pixel position of the target pixel. The table is searched to extract data of the overexposure search range (x 0 , y 0 , x 1 , y 1 ) corresponding to the pixel position. Alternatively, in the lookup table, data necessary for calculating the overexposure search range (x 0 , y 0 , x 1 , y 1 ) is stored, extracted, and the overexposure search range (x 0, y 0, x 1, y 1) may be configured to calculate a. Alternatively, without applying the look-up table, by performing arithmetic processing in accordance with a preset function, overexposure search range (x 0, y 0, x 1, y 1) may be configured to calculate the .

ステップS203においては、定義済みのルックアップテーブルの参照、演算処理の少なくともいずれかの処理によって、光学系の設定、注目画素位置等の各種情報に基づいて、探索範囲(x,y,x,y)を算出する。探索範囲(x,y,x,y)は、注目画素がパープルフリンジである場合に白とび存在する可能性のある範囲として算出される範囲である。 In step S203, the search range (x 0 , y 0 , x, etc.) is determined based on various information such as the setting of the optical system and the target pixel position by at least one of reference to a predefined lookup table and calculation processing. 1 , y 1 ). The search range (x 0 , y 0 , x 1 , y 1 ) is a range that is calculated as a range that may be overexposed when the pixel of interest is purple fringe.

図9を参照して、光学系にあわせた白とび探索範囲(x,y,x,y)の設定の一例を述べる。図9に示す補正対象となる画像データ210において、ある画素211が白とびを起こしていると仮定する。画素が白とび画素であるか否かは、予め定めた閾値以上の輝度値を持つ画素であるかの判定処理によって行われ、閾値以上の輝度値を持つ画素であれば、白とび画素として判定する。 With reference to FIG. 9, an example of setting of the overexposure search range (x 0 , y 0 , x 1 , y 1 ) according to the optical system will be described. Assume that a certain pixel 211 is overexposed in the image data 210 to be corrected shown in FIG. Whether or not a pixel is a whiteout pixel is determined by a process for determining whether the pixel has a luminance value equal to or higher than a predetermined threshold. If a pixel has a luminance value equal to or higher than a threshold, it is determined as a whiteout pixel. To do.

画素211が白とび画素である場合、画素211の周囲において、パープルフリンジが発生する可能性のある範囲は、撮像手段における使用レンズの特性と、撮影時のF値と焦点距離に基づいて算出することができる。これらの各データは、画像データの撮影時に撮影画像に対応する属性情報として、画像データとともに画像処理実行部としてのデジタル図信号処理部(DSP)106(図1参照)に入力され、デジタル信号処理部(DSP)106は、これらの入力データと注目画素の画素位置に基づいてルックアップテーブルを検索して、画素位置対応の白とび探索範囲を算出するために必用なデータを抽出して、白とび探索範囲(x,y,x,y)の算出を実行する。 When the pixel 211 is an overexposed pixel, the range in which purple fringe may occur around the pixel 211 is calculated based on the characteristics of the lens used in the imaging unit, the F value at the time of shooting, and the focal length. be able to. Each of these data is input to a digital diagram signal processing unit (DSP) 106 (see FIG. 1) as an image processing execution unit together with the image data as attribute information corresponding to the photographed image at the time of photographing the image data. The section (DSP) 106 searches the lookup table based on the input data and the pixel position of the target pixel, extracts data necessary for calculating the overexposure range corresponding to the pixel position, The jump search range (x 0 , y 0 , x 1 , y 1 ) is calculated.

図9を参照して、白とび探索範囲(x,y,x,y)の詳細について説明する。図9に示す画像データ210は、図2に示す総合処理フロー中のステップS11においてオリジナル画像に基づいて生成した縮小画像を示す。 The details of the overexposure search range (x 0 , y 0 , x 1 , y 1 ) will be described with reference to FIG. Image data 210 shown in FIG. 9 indicates a reduced image generated based on the original image in step S11 in the overall processing flow shown in FIG.

図9に示す画像データ210の画素211が白とび画素であるとき、白とび画素211の右下側に幅:Wa、高さ:Ha、左上側に幅:Wb、高さ:Hbでパープルフリンジが発生するとする。図9に示す画素領域212と画素領域213によって規定される領域である。   When the pixel 211 of the image data 210 shown in FIG. 9 is a whiteout pixel, a purple fringe has a whitening width: Wa, a height: Ha, a left upper side width: Wb, and a height: Hb. Suppose that occurs. This is an area defined by the pixel area 212 and the pixel area 213 shown in FIG.

一方、逆に、画素211がパープルフリンジ画素であると仮定すると、パープルフリンジ画素は、白とび画素の近傍に発生するという前提から、パープルフリンジ画素211の近傍には、必ず白とびの画素があるはずである。パープルフリンジ画素211の周囲において、白とびの発生している可能性のある領域は、上述した画素領域212と画素領域213とを、画素211と画像データ中心画素250を結ぶ直線に沿って画素211を中心として折り返して設定される領域、すなわち、図9に示す画素領域222、画素領域223である。   On the other hand, assuming that the pixel 211 is a purple fringe pixel, on the other hand, since the purple fringe pixel is generated in the vicinity of the whiteout pixel, there is always a whiteout pixel in the vicinity of the purple fringe pixel 211. It should be. In the periphery of the purple fringe pixel 211, there is a possibility that overexposure occurs in the pixel 211 along the straight line connecting the pixel 211 and the pixel region 213 to the pixel 211 and the image data center pixel 250. These are regions that are set by being folded around the center, that is, the pixel region 222 and the pixel region 223 shown in FIG.

このように、図9に示す画素211がパープルフリンジ画素である場合、図9に示す画素領域222、画素領域223に白とび画素が発生していると推定できる。従って、画素211がパープルフリンジ画素の場合、図9に示す画素領域222、画素領域223を含む矩形領域として設定される画素領域230を探索領域として探索処理を実行すれば、白とび画素が発見できるはずである。   As described above, when the pixel 211 illustrated in FIG. 9 is a purple fringe pixel, it can be estimated that overexposed pixels are generated in the pixel region 222 and the pixel region 223 illustrated in FIG. 9. Therefore, when the pixel 211 is a purple fringe pixel, an overexposed pixel can be found by performing a search process using the pixel area 230 set as a rectangular area including the pixel area 222 and the pixel area 223 shown in FIG. 9 as a search area. It should be.

図7に示すフローのステップS203では、注目画素(x,y)がパープルフリンジ画素である場合に、その画素の周囲に存在すると判断される白とび画素を検出することを目的として、白とび探索範囲(x,y,x,y)を設定するものである。上述した説明から理解されるように、図9において画素211が注目画素である場合、画素領域230を白とび探索範囲(x,y,x,y)として設定すれば、画素211がパープルフリンジ画素である場合に、白とび画素をこの探索範囲において検出できることになる。 In step S203 of the flow shown in FIG. 7, when the target pixel (x, y) is a purple fringe pixel, an overexposure search is performed for the purpose of detecting an overexposed pixel that is determined to exist around the pixel. A range (x 0 , y 0 , x 1 , y 1 ) is set. As understood from the above description, when the pixel 211 is the target pixel in FIG. 9, if the pixel region 230 is set as the overexposure search range (x 0 , y 0 , x 1 , y 1 ), the pixel 211 Is a purple fringe pixel, it is possible to detect overexposed pixels in this search range.

このように、撮影手段の特性、撮影条件によって決定される白とび画素周囲のハープルフリンジ発生領域に基づいて、パープルフリンジ画素周囲の白とび画素探索領域が設定される。図7に示すフローのステップS203では、処理対象の画素、すなわち注目画素毎に白とび探索範囲(x,y,x,y)を算出する。 In this manner, the whiteout pixel search region around the purple fringe pixel is set based on the harpling fringe generation region around the whiteout pixel determined by the characteristics of the photographing means and the photographing conditions. In step S203 of the flow shown in FIG. 7, the overexposure search range (x 0 , y 0 , x 1 , y 1 ) is calculated for each pixel to be processed, that is, the target pixel.

図10を参照して、白とび探索範囲(x,y,x,y)の領域について説明する。図10は、注目画素(x,y)300の周囲に設定される白とび探索範囲(x,y,x,y)301を示している。白とび探索範囲(x,y,x,y)301は、左上端が座標(x,y)の画素302であり、右下端が座標(x,y)の画素303である矩形領域からなる白とび探索範囲(x,y,x,y)である。 With reference to FIG. 10, the region of the overexposure search range (x 0 , y 0 , x 1 , y 1 ) will be described. FIG. 10 shows an overexposure search range (x 0 , y 0 , x 1 , y 1 ) 301 set around the pixel of interest (x, y) 300. The overexposure search range (x 0 , y 0 , x 1 , y 1 ) 301 is a pixel 302 whose upper left corner is a coordinate (x 0 , y 0 ) and whose lower right corner is a pixel of coordinates (x 1 , y 1 ). This is an overexposure search range (x 0 , y 0 , x 1 , y 1 ) composed of a rectangular area 303.

図10に示す白とび探索範囲(x,y,x,y)301は、図9に示す矩形領域230に相当する領域であり、図9に示す画素領域223は、図10に示す注目画素(x,y)300の左上部の高さH1、幅W1からなる画素領域311に相当し、図9に示す画素領域222は、図10に示す注目画素(x,y)300の右下部の高さH2、幅W2からなる画素領域312に相当する。画素321は座標(x,y)の画素、画素322は座標(x,y)の画素、画素323は座標(x,y)の画素、画素324は座標(x,y)の画素である。 An overexposure search range (x 0 , y 0 , x 1 , y 1 ) 301 shown in FIG. 10 is an area corresponding to the rectangular area 230 shown in FIG. 9, and a pixel area 223 shown in FIG. 9 corresponds to a pixel region 311 having a height H1 and a width W1 at the upper left of the target pixel (x, y) 300 shown. The pixel region 222 shown in FIG. 9 is the same as the target pixel (x, y) 300 shown in FIG. This corresponds to a pixel region 312 having a height H2 and a width W2 at the lower right. The pixel 321 is a pixel having coordinates (x 0 , y 1 ), the pixel 322 is a pixel having coordinates (x 1 , y), the pixel 323 is a pixel having coordinates (x, y 0 ), and the pixel 324 is a coordinate (x, y 1 ). Pixels.

図7に示すフローのステップS203では、例えば、図10に示す画素(x,y)300を注目画素とした場合、注目画素(x,y)300の左にW1、右にW2、上にH1、下にH2の領域からなる探索範囲(x,y,x,y)301を設定する。この設定によって、注目画素(x,y)300がパープルフリンジ画素である場合に、探索範囲(x,y,x,y)301内から白とび画素を、ほぼ間違いなく検出することができる。 In step S203 of the flow shown in FIG. 7, for example, when the pixel (x, y) 300 shown in FIG. 10 is the target pixel, W1 is on the left of the target pixel (x, y) 300, W2 is on the right, and H1 is on the top. A search range (x 0 , y 0 , x 1 , y 1 ) 301 consisting of the H2 region is set below. With this setting, when the target pixel (x, y) 300 is a purple fringe pixel, an overexposed pixel is almost certainly detected from within the search range (x 0 , y 0 , x 1 , y 1 ) 301. Can do.

このように、図7のステップS203では、注目画素(x,y)がパープルフリンジ画素である場合に、その画素の周囲に存在すると判断される白とび画素を検出することを目的として、白とび探索範囲(x,y,x,y)を設定するものである。なお、前述したように、白とび探索範囲(x,y,x,y)の算出にはルックアップテーブルの参照、演算処理の少なくともいずれかの処理が実行される。撮像手段における使用レンズの特性、撮影時のF値、焦点距離等の各データを撮影画像に対応する属性情報として、画像データとともに画像処理実行部としてのデジタル図信号処理部(DSP)106(図1参照)に入力し、デジタル信号処理部(DSP)106において、これらの入力データ、注目画素位置情報等に基づいてルックアップテーブルの参照、演算処理の少なくともいずれかの処理を実行して、白とび探索範囲(x,y,x,y)を算出する。 As described above, in step S203 in FIG. 7, when the target pixel (x, y) is a purple fringe pixel, the whiteout pixel is detected for the purpose of detecting a whiteout pixel that is determined to exist around the pixel. The search range (x 0 , y 0 , x 1 , y 1 ) is set. Note that, as described above, at least one of lookup table reference and calculation processing is performed to calculate the overexposure search range (x 0 , y 0 , x 1 , y 1 ). The digital diagram signal processing unit (DSP) 106 (image processing unit) as an image processing execution unit together with the image data, using each data such as the characteristics of the lens used in the imaging means, the F value at the time of shooting, and the focal length as attribute information corresponding to the shot image 1), and the digital signal processing unit (DSP) 106 executes at least one of lookup table reference and calculation processing based on the input data, target pixel position information, and the like. The jump search range (x 0 , y 0 , x 1 , y 1 ) is calculated.

図7のステップS203において、注目画素(x,y)に対応する白とび探索範囲(x,y,x,y)が算出されると、算出した白とび探索範囲(x,y,x,y)において、白とび画素の検索を行い、注目画素(x,y)と最も近接した白とび画素との距離としての最小距離:dminを算出する。この処理が、図7、図8のフローに示すステップS204〜S214の処理である。 When the overexposure search range (x 0 , y 0 , x 1 , y 1 ) corresponding to the target pixel (x, y) is calculated in step S203 of FIG. 7, the calculated overexposure search range (x 0 , In y 0 , x 1 , y 1 ), an overexposed pixel is searched to calculate a minimum distance: d min as a distance between the target pixel (x, y) and the adjacent overexposed pixel. This process is the process of steps S204 to S214 shown in the flow of FIGS.

ここで算出する注目画素(x,y)と白とび画素との距離:dは、注目画素(x,y)を中心点として白とび探索範囲(x,y,x,y)の領域を正規化して算出した距離データを用いる。正規化された距離データを比較して、最小距離:dminを算出する。正規化した距離データを用いる理由について説明する。注目画素から白とびへの距離を算出する際には、パープルフリンジの発生する方向を考慮する必要がある。すなわち、注目画素の周囲に白とび画素があり、その白とび画素を原因として注目画素にパープルフリンジが発生する可能性を算出するためには、白とび画素の位置と注目画素の距離ならびにその位置関係を考慮する必要がある。 The distance d between the pixel of interest (x, y) calculated here and the overexposure pixel: d is the overexposure search range (x 0 , y 0 , x 1 , y 1 ) with the attention pixel (x, y) as the center point. The distance data calculated by normalizing the area is used. The normalized distance data is compared, and the minimum distance: d min is calculated. The reason for using the normalized distance data will be described. When calculating the distance from the target pixel to overexposure, it is necessary to consider the direction in which purple fringes occur. That is, in order to calculate the possibility that purple fringes occur in the target pixel due to the whiteout pixels around the target pixel, the position of the whiteout pixel and the distance between the target pixel and the position thereof are calculated. It is necessary to consider the relationship.

図9、図10を参照して説明したように、白とび画素探索領域は、注目画素の周囲に均等に設定されない。例えば図10に示す白とび画素探索領域301は、注目画素300(x,y)の左上部の小さな画素領域311と、右下の大きな画素領域312を含む領域として設定され、注目画素300(x,y)は白とび画素探索領域301の中心に設定されておらず、左上部にかたよって設定された状態となっている。注目画素(x,y)と白とび画素との最小距離:dminを算出する際、実際の距離データとして算出すると、左上部の小さな画素領域311にも白とびがあり、右下の大きな画素領域312にも白とびがある場合、ほとんどの最小距離データは、左上部の小さな画素領域311との距離として算出される可能性が高くなる。 As described with reference to FIGS. 9 and 10, the overexposed pixel search area is not set evenly around the target pixel. For example, the overexposure pixel search area 301 shown in FIG. 10 is set as an area including a small pixel area 311 at the upper left of the target pixel 300 (x, y) and a large pixel area 312 at the lower right. , Y) is not set at the center of the overexposure pixel search area 301 but is set according to the upper left portion. When calculating the minimum distance: d min between the target pixel (x, y) and the overexposure pixel, when calculating as actual distance data, the small pixel region 311 in the upper left also has overexposure, and the lower right large pixel When the region 312 has a whiteout, most of the minimum distance data is likely to be calculated as a distance from the small pixel region 311 at the upper left.

しかし、注目画素300(x,y)のパープルフリンジを引き起こしている原因としての白とび画素は、注目画素との実際の距離がより大きな右下の画素領域312内の白とび画素である場合がある。このような誤認を防止するため、すなわち、注目画素(x,y)のパープルフリンジを引き起こしている要因としての白とび画素との距離を最小距離:dminとして正確に算出するため、白とび探索範囲(x,y,x,y)の中心に注目画素(x,y)が設定された状態とするため、正規化距離データを用いる。 However, the overexposed pixel as the cause of the purple fringe of the target pixel 300 (x, y) may be the overexposed pixel in the lower right pixel region 312 where the actual distance from the target pixel is larger. is there. In order to prevent such misidentification, that is, to accurately calculate the distance from the overexposed pixel as the factor causing the purple fringe of the pixel of interest (x, y) as the minimum distance: dmin , the overexposed search is performed. Normalized distance data is used to set the target pixel (x, y) at the center of the range (x 0 , y 0 , x 1 , y 1 ).

正規化距離データを用いることで、例えば図10に示す注目画素300(x,y)と、白とび探索範囲(x,y,x,y)の端点の画素321(x,y)との距離:W1、注目画素300(x,y)と画素322(x,y)との距離:W2、注目画素300(x,y)と画素323(x,y)との距離:H1、注目画素300(x,y)と画素324(x,y)との距離:H2は全て等しいものとして処理される。この正規化距離データを用いることで、注目画素300(x,y)と正規化最小距離:dminを持つ白とび画素が、注目画素300(x,y)のパープルフリンジを引き起こしている要因となった白とび画素であるとの推定が正しい確率を向上させることができる。 By using the normalized distance data, for example, the pixel of interest 300 (x, y) illustrated in FIG. 10 and the pixel 321 (x 0 , x 1 , y 1 ) at the end point of the overexposure search range (x 0 , y 0 , x 1 , y 1 ) Y 1 ) distance: W 1, the target pixel 300 (x, y) and the pixel 322 (x 1 , y): W 2, the target pixel 300 (x, y) and the pixel 323 (x, y 0 ) The distance: H1 and the distance H2 between the target pixel 300 (x, y) and the pixel 324 (x, y 1 ) are all processed as equal. By using this normalized distance data, the overexposed pixel having the pixel of interest 300 (x, y) and the normalized minimum distance: d min causes a purple fringe of the pixel of interest 300 (x, y). It is possible to improve the probability that the estimation of the overexposed pixel is correct.

本実施例においては、例えば図10に示す白とび探索範囲(x,y,x,y)の設定において、白とび画素位置と注目画素それぞれのx座標の差の絶対値を、注目画素300(x,y)と白とび探索範囲(x,y,x,y)の端点の画素321(x,y)との距離:W1、または注目画素300(x,y)と画素322(x,y)との距離:W2を用いて正規化し、さらに、注目画素300(x,y)と画素323(x,y)との距離:H1、注目画素300(x,y)と画素324(x,y)との距離:H2を用いて正規化して距離:dを算出する。 In the present embodiment, for example, in the setting of the overexposure search range (x 0 , y 0 , x 1 , y 1 ) shown in FIG. 10, the absolute value of the difference between the overexposed pixel position and the x coordinate of each pixel of interest is Distance between the pixel of interest 300 (x, y) and the pixel 321 (x 0 , y 1 ) at the end point of the overexposure search range (x 0 , y 0 , x 1 , y 1 ): W1, or the pixel of interest 300 (x , Y) and the pixel 322 (x 1 , y) distance: normalized using W2, and further, the distance between the target pixel 300 (x, y) and the pixel 323 (x, y 0 ): H1, the target pixel 300: (x, y) and pixel 324 (x, y 1 ) The distance: H is normalized to calculate the distance: d.

具体的な距離算出式について説明する。白とび探索範囲で見つかった白とび画素の位置が(a,b)であるとする。注目画素から白とび位置(a,b)への距離:dは以下の式(式1)に従って算出する。

Figure 2006121138
A specific distance calculation formula will be described. Assume that the position of a whiteout pixel found in the whiteout search range is (a, b). The distance from the target pixel to the overexposed position (a, b): d is calculated according to the following equation (Equation 1).
Figure 2006121138

上記式(式1)を用いれば、注目画素から300(x,y)から、白とび探索範囲(x,y,x,y)の端点の画素321(x,y)との距離:W1、画素322(x,y)との距離:W2、画素323(x,y)との距離:H1、画素324(x,y)との距離:H2は全て等距離とされる。この正規化距離データを適用して最小距離:dminを持つ白とび画素を選択することで、注目画素300(x,y)のパープルフリンジを引き起こしている要因となった白とび画素を正しい確立で抽出することができる。 Using the above expression (Expression 1), the pixel 321 (x 0 , y 1 ) at the end point of the overexposure search range (x 0 , y 0 , x 1 , y 1 ) from 300 (x, y) from the target pixel. Distance to: W1, distance to pixel 322 (x 1 , y): W2, distance to pixel 323 (x, y 0 ): H1, distance to pixel 324 (x, y 1 ): all H2 etc. It is taken as a distance. By applying the normalized distance data and selecting a whiteout pixel having the minimum distance: dmin , the whiteout pixel that has caused the purple fringe of the pixel of interest 300 (x, y) is correctly established. Can be extracted.

図7のフローの説明を続ける。ステップS203において白とび探索範囲(x,y,x,y)を算出した後、まず、ステップS204で、最小距離:dminを初期化、例えばdmin=∞あるいは注目画素と白とび探索範囲(x,y,x,y)の最大距離より十分大きい値に設定する。次に、ステップS205,S206において、白とび探索範囲(x,y,x,y)の構成画素を1つ選択し、ステップS207において、選択画素(s,t)が白とび画素であるか否かを判定する。白とび画素であるか否かの判定処理は、例えば予め定めた輝度以上の画素を白とび画素として判定する処理として実行される。 The description of the flow in FIG. 7 will be continued. After calculating the overexposure search range (x 0 , y 0 , x 1 , y 1 ) in step S203, first, in step S204, the minimum distance: d min is initialized, for example, d min = ∞ or the target pixel and white The value is set to a value sufficiently larger than the maximum distance of the jump search range (x 0 , y 0 , x 1 , y 1 ). Next, in steps S205 and S206, one of the constituent pixels in the overexposure search range (x 0 , y 0 , x 1 , y 1 ) is selected, and in step S207, the selected pixel (s, t) is an overexposed pixel. It is determined whether or not. The process for determining whether or not a pixel is a whiteout pixel is executed as a process for determining, for example, a pixel having a predetermined luminance or higher as a whiteout pixel.

選択画素(s,t)が白とび画素で無い場合は、ステップS211〜S214の処理によって選択画素の更新、すなわち白とび探索範囲(x,y,x,y)内において次の画素を選択画素として設定し、ステップS207以下の処理を繰り返し実行する。 If the selected pixel (s, t) is not an overexposed pixel, the process of steps S211 to S214 updates the selected pixel, that is, the next within the overexposed search range (x 0 , y 0 , x 1 , y 1 ). The pixel is set as the selected pixel, and the processing from step S207 is repeated.

選択画素(s,t)が白とび画素であると判定すると、ステップS208において、注目画素(x,y)と白とび画素(s,t)との距離dが算出する。この距離dは、前述の式(式1)を適用した演算によって、正規化距離データとして算出する。ステップS209では、算出距離データ:dと初期化されたあるいはその後更新された最小距離:dminとの比較が実行され、算出距離データ:dが、最小距離:dminより小さい値を持つ場合は、ステップS210において、算出距離データ:dを、最小距離:dminとする最小距離:dminの更新処理を実行する。 If it is determined that the selected pixel (s, t) is a whiteout pixel, the distance d between the target pixel (x, y) and the whiteout pixel (s, t) is calculated in step S208. The distance d is calculated as normalized distance data by a calculation applying the above-described equation (Equation 1). In step S209, a comparison is made between the calculated distance data: d and the initialized or updated minimum distance: d min . If the calculated distance data: d has a value smaller than the minimum distance: d min. In step S210, update processing of the minimum distance: d min is performed with the calculated distance data: d as the minimum distance: d min .

以上の処理を、注目画素(x,y)の周囲に設定した白とび探索範囲(x,y,x,y)内の全画素について実行し、注目画素に対応する1つの最小距離:dminを決定する。白とび探索範囲(x,y,x,y)内に白とび画素が検出されなかった場合は、最小距離:dminは、初期値のままとなる。 The above processing is executed for all pixels in the overexposure range (x 0 , y 0 , x 1 , y 1 ) set around the pixel of interest (x, y), and one minimum corresponding to the pixel of interest Distance: Determine d min . When the overexposure pixel is not detected in the overexposure search range (x 0 , y 0 , x 1 , y 1 ), the minimum distance: d min remains the initial value.

次に、図8に示すフローチャートのステップS215に進む。ステップS215では、注目画素(x,y)の偽色度合い、すなわち、PF(パープルフリンジ)度合いを算出するためのパラメータを注目画素(x,y)の色情報c(x,y)に基づいて算出する。これは、注目画素(x,y)がパープルフリンジに近い彩度と色相を持つか否かを判定する尺度としての偽色(PF)度合いp、すなわちパープルフリンジ等の偽色(PF)である可能性を示すパラメータとしての偽色(PF)度合いpの算出に適用するパラメータを求める処理である。   Next, the process proceeds to step S215 in the flowchart shown in FIG. In step S215, a parameter for calculating the false color degree of the target pixel (x, y), that is, the PF (purple fringe) degree is determined based on the color information c (x, y) of the target pixel (x, y). calculate. This is a false color (PF) degree p as a scale for determining whether the pixel of interest (x, y) has saturation and hue close to purple fringe, that is, a false color (PF) such as purple fringe. This is a process for obtaining a parameter to be applied to the calculation of the false color (PF) degree p as a parameter indicating possibility.

ステップS215における注目画素(x,y)の色情報c(x,y)に基づくパラメータ算出処理について、図11を参照して説明する。図11は、2次元の色情報空間の一例を表わしている。ここでは、色情報としてYCbCr空間の、CbCrを用いる。図11では、横軸にCb、縦軸にCr、原点400はCb=128,Cr=128となる色値を持つ。パープルフリンジ色相ライン401は、パープルフリンジの色であるとしてあらかじめ指定された色相を表わすラインである。注目画素色相402は、注目画素(x,y)の色相(Cb,Cr)をプロットしたものである。   A parameter calculation process based on the color information c (x, y) of the target pixel (x, y) in step S215 will be described with reference to FIG. FIG. 11 shows an example of a two-dimensional color information space. Here, CbCr in the YCbCr space is used as color information. In FIG. 11, the horizontal axis represents Cb, the vertical axis represents Cr, and the origin 400 has color values such that Cb = 128 and Cr = 128. A purple fringe hue line 401 is a line representing a hue designated in advance as a purple fringe color. The target pixel hue 402 is obtained by plotting the hue (Cb, Cr) of the target pixel (x, y).

図8に示すフローにおけるステップS215においては、注目画素の彩度sならびに、パープルフリンジの色相への近さθをパラメータとして求める。図11で示す例においては、彩度sは原点400から注目画素色相402への距離として算出される値であり、パープルフリンジの色相への近さθはパープルフリンジ色相ライン401と、原点と注目画素色相402を結ぶラインとのなす角度として算出される値である。なお、本実施例では、注目画素(x,y)の偽色度合い、すなわち、PF(パープルフリンジ)度合いを算出するためのパラメータとして彩度sならびに、パープルフリンジの色相への近さθを、上記処理によってパラメータとして算出する処理を適用しているが、これらは、彩度、色相への近さの尺度としての一例であり、他の方法を適用してもよい。なお、ここで述べるθは、2つの色相のなす角度であり、必ず0以上の値となる。   In step S215 in the flow shown in FIG. 8, the saturation s of the target pixel and the proximity θ to the hue of the purple fringe are obtained as parameters. In the example shown in FIG. 11, the saturation s is a value calculated as the distance from the origin 400 to the target pixel hue 402, and the purple fringe proximity to the hue θ is the purple fringe hue line 401, the origin, and the attention. This is a value calculated as an angle formed by a line connecting the pixel hue 402. In the present embodiment, the saturation s as a parameter for calculating the false color degree of the target pixel (x, y), that is, the PF (purple fringe) degree, and the proximity θ to the hue of the purple fringe, Although the process which calculates as a parameter by the said process is applied, these are an example as a scale of saturation and the proximity to a hue, and you may apply another method. Note that θ described here is an angle formed by two hues, and is always a value of 0 or more.

次にステップS216において、ステップS215で求めた注目画素(x,y)の色情報c(x,y)に基づくパラメータs,θを適用して、注目画素の偽色度合いp、すなわち、PF(パープルフリンジ)度合いを表わす値pを算出する。前述したようにパープルフリンジ度合いpとして、本実施例の処理では以下の各尺度、すなわち、
(a)白とび(高輝度画素)への近さ、
(b)彩度の大きさ、
(c)偽色に相当する特定色相への近さ
の3種類の尺度を考慮すると説明した。最終的な偽色(PF)度合いpの算出には、上記(a)〜(c)の尺度が適用される。
Next, in step S216, parameters s and θ based on the color information c (x, y) of the target pixel (x, y) obtained in step S215 are applied, and the false color degree p of the target pixel, that is, PF ( A value p representing the degree of purple fringe is calculated. As described above, as the purple fringe degree p, in the processing of this embodiment, the following scales, that is,
(A) proximity to whiteout (high brightness pixels),
(B) magnitude of saturation;
(C) It was explained considering three kinds of scales: closeness to a specific hue corresponding to false color. The scales (a) to (c) are applied to the calculation of the final false color (PF) degree p.

上述の(a)〜(c)の各尺度を、
(a)白とび(高輝度画素)への近さ=白とび距離評価値P
(b)彩度の大きさ=彩度評価値P
(c)偽色に相当する特定色相への近さ=色相評価値Pθ
とする。
Each scale of the above (a)-(c)
(A) Closeness to whiteout (high luminance pixel) = whiteout distance evaluation value P d ,
(B) Saturation magnitude = saturation evaluation value P s ,
(C) proximity to a specific hue corresponding to a false color = hue evaluation value P θ ,
And

以下、各評価値の算出処理の詳細について説明する。
(a)白とび(高輝度画素)への近さ=白とび距離評価値P
白とび距離評価値Pは、下式(式2)によって算出する。

Figure 2006121138
Hereinafter, details of the calculation process of each evaluation value will be described.
(A) Closeness to whiteout (high luminance pixel) = whiteout distance evaluation value P d ,
The overexposure distance evaluation value Pd is calculated by the following formula (Formula 2).
Figure 2006121138

上記式において、dには、先にステップS204〜S214の処理において求められたデータ、すなわち、注目画素(x,y)に対応する最小距離:dminを代入する。dmaxは、あらかじめ設定された距離データであり、dのとり得る範囲において最大値に近い値、あるいは最大値以上の値に設定する。ただし、dmaxをdのとり得る範囲において最大値に近い値として設定した場合においてd>dmaxとなった場合は、dmax=dであると仮定して、d−dmax=0として処理する。例えば、前述の式(式1)によると、dは、0から√2までの値を取る。したがって、dmaxとしては、例えば、√2を設定すればよい。 In the above equation, d is substituted with the data previously obtained in the processing of steps S204 to S214, that is, the minimum distance dmin corresponding to the target pixel (x, y). d max is distance data set in advance, and is set to a value close to the maximum value or a value equal to or greater than the maximum value in the range that d can take. However, when d max is set as a value close to the maximum value in the range that d can take, if d> d max is satisfied, it is assumed that d max = d, and processing is performed with d−d max = 0. To do. For example, according to the above formula (Formula 1), d takes a value from 0 to √2. Therefore, for example, √2 may be set as dmax.

このようにして、注目画素(x,y)から白とび画素までの距離dが小さいほど、距離評価値Pは1に近づき、一方、注目画素(x,y)から白とび画素までの距離dが大きいほど、距離評価値Pは0に近づく値に設定される。すなわち、距離評価値Pは0〜1の範囲で、注目画素(x,y)から白とび画素までの距離に応じた値に設定されることになる。 In this way, as the pixel of interest (x, y) is a distance d from up overexposed pixel smaller, the distance evaluation value P d approaches 1, whereas the distance from the pixel of interest (x, y) to overexposed pixels The distance evaluation value Pd is set to a value that approaches 0 as d increases. That is, in the range of the distance evaluation value P d is 0-1, the pixel of interest (x, y) will be set to a value corresponding to the distance from to the overexposed pixels.

また、(c)偽色に相当する特定色相への近さ=色相評価値Pθ、すなわち、パープルフリンジ色相への近さを表わす値としての色相評価値pθは以下の式(式3)により算出される。

Figure 2006121138
Further, (c) proximity to a specific hue corresponding to a false color = hue evaluation value P θ , that is, a hue evaluation value p θ as a value indicating proximity to a purple fringe hue is expressed by the following equation (Equation 3): Is calculated by
Figure 2006121138

上記式(式3)のθは、ステップS215において求めた注目画素のパープルフリンジの色相への近さθを代入する。図11を参照して説明したように、パープルフリンジの色相への近さθはパープルフリンジ色相ライン401と、原点と注目画素色相402を結ぶラインとのなす角度として算出される値である。上記式(式3)のθmaxは、あらかじめ指定された値であり、θのとり得る範囲において最大値に近い値、あるいは最大値以上の値に設定する。ただし、θmaxをθのとり得る範囲において最大値に近い値として設定した場合においてθ>θmaxとなった場合は、θmax=θであると仮定して、θ−θmax=0として処理する。撮影に用いたレンズによりあらかじめどのような色相の偽色が発生するかはあらかじめ予想することができる。発生する可能性のある偽色の色相をすべてカバーできるように、最適な値をθmaxとして設定すればよい。 For θ in the above formula (formula 3), the closeness θ to the hue of the purple fringe of the target pixel obtained in step S215 is substituted. As described with reference to FIG. 11, the purple fringe closeness θ is a value calculated as an angle between the purple fringe hue line 401 and a line connecting the origin and the target pixel hue 402. Θ max in the above equation (Equation 3) is a value designated in advance, and is set to a value close to the maximum value or a value equal to or greater than the maximum value in a possible range of θ. However, when θ max is set as a value close to the maximum value in the range that θ can take, if θ> θ max , it is assumed that θ max = θ, and processing is performed as θ−θ max = 0. To do. Advance what false color hue is generated by a lens used for imaging can be expected in advance. What is necessary is just to set an optimal value as (theta) max so that all the hues of the false color which may generate | occur | produce can be covered.

このようにして、注目画素(x,y)の色相が偽色としてのパープルフリンジの色相に近いほど、色相評価値pθは1に近づき、一方、注目画素(x,y)の色相が偽色としてのパープルフリンジの色相から遠いほど、色相評価値pθは0に近づく値に設定される。すなわち、色相評価値pθは0〜1の範囲で、注目画素(x,y)の色相とパープルフリンジの色相との差異に応じた値に設定されることになる。 In this way, the pixel of interest (x, y) closer to the hue of purple fringing as hue false color, the hue evaluation value p theta approaches 1, whereas the hue of the pixel of interest (x, y) is false The hue evaluation value is set to a value that approaches 0 as it is farther from the hue of the purple fringe as the color. That is, in the range of hue evaluation value p theta is 0-1, the pixel of interest (x, y) will be set to a value corresponding to the difference between the hue of the hue and purple fringing.

また、(b)彩度の大きさ=彩度評価値Pは以下の式(式4)により算出される。

Figure 2006121138
The size = chroma evaluation value P s (b), saturation is calculated by the following equation (Equation 4).
Figure 2006121138

上記式(式4)のsは、ステップS215において求めた注目画素の彩度sを代入する。図11を参照して説明したように、彩度sは原点400から注目画素色相402への距離として算出される値である。上記式(式4)のsmaxは、あらかじめ指定された値であり、sのとり得る範囲において最大値に近い値、あるいは最大値以上の値に設定する。ただし、smaxをsのとり得る範囲において最大値に近い値として設定した場合においてs>smaxとなった場合は、smax=sであると仮定して、s−smax=0として処理する。 For the s in the above formula (formula 4), the saturation s of the target pixel obtained in step S215 is substituted. As described with reference to FIG. 11, the saturation s is a value calculated as the distance from the origin 400 to the target pixel hue 402. In the above equation (equation 4), s max is a value designated in advance, and is set to a value close to the maximum value or a value equal to or greater than the maximum value in the range that s can take. However, when s max is set as a value close to the maximum value in a range that s can take, if s> s max is satisfied, it is assumed that s max = s and s−s max = 0 is processed. To do.

このようにして、注目画素(x,y)の彩度が大きいほど、彩度評価値Pは1に近づき、一方、注目画素(x,y)の彩度が小さいほど、彩度評価値Pは0に近づく値に設定される。すなわち、彩度評価値Pは0〜1の範囲で、注目画素(x,y)の彩度に応じた値に設定されることになる。 In this way, the greater the saturation of the pixel of interest (x, y), the chroma evaluation value P s approaches 1, whereas, as the saturation of the pixel of interest (x, y) is small, the saturation evaluation value P s is set to a value approaching zero. That is, in the range of chroma evaluation value P s is 0-1, the pixel of interest (x, y) will be set to a value corresponding to saturation of the.

図12は、パープルフリンジの発生した画像データの画像領域と彩度の対応を示した図である。図12の縦軸は彩度を表わし、横軸は画像上での位置を表わす。図12では、画像位置の画像範囲451に白とび画素があり、画像範囲452と画像範囲453に渡ってパープルフリンジが発生し、画像範囲454には被写体の本来の色が撮像されているとする。画像範囲452のパープルフリンジは彩度が大きくとても目立つため、なるべく強く補正をかけるのが望ましい。一方、画像範囲453では、パープルフリンジから被写体本来の色への遷移部分となっているため、補正度合いとしては、強い補正度合いからだんだん弱めて補正しないレベルまで、連続的に変化させるのが望ましい。上記式(式4)で算出される彩度評価値Pは、このような彩度に応じた最適な補正のレベルに対応させることが好ましい。この設定とするためには、上記式(式4)で適用する固定値としてのsmaxを、図12に示すように、例えば、画像範囲453の最大彩度付近の彩度として設定すればよい。 FIG. 12 is a diagram showing the correspondence between the image area of the image data where the purple fringe occurs and the saturation. The vertical axis in FIG. 12 represents the saturation, and the horizontal axis represents the position on the image. In FIG. 12, it is assumed that there are overexposed pixels in the image range 451 of the image position, purple fringes occur over the image range 452 and the image range 453, and the original color of the subject is captured in the image range 454. . The purple fringe in the image range 452 has a high saturation and is very conspicuous, so it is desirable to correct as strongly as possible. On the other hand, since the image range 453 is a transition portion from the purple fringe to the original color of the subject, it is desirable that the correction level is continuously changed from a strong correction level to a level that is gradually weakened and not corrected. It is preferable that the saturation evaluation value P s calculated by the above expression (Expression 4) corresponds to an optimum correction level according to such saturation. In order to achieve this setting, s max as a fixed value applied in the above equation (equation 4) may be set as, for example, saturation near the maximum saturation of the image range 453 as shown in FIG. .

この設定とすることで、図12に示す画像領域452では、上記式(式4)によって算出される彩度評価値Pは1となり、画像領域453では、上記式(式4)によって算出される彩度評価値Pは、画像領域452の接点では1となり、画像領域454に近づくに従って、彩度評価値Pが減少し、徐々に0に近づく値に設定されることになる。 With this setting, in the image area 452 shown in FIG. 12, the saturation evaluation value P s calculated by the above expression (expression 4) becomes 1, and in the image area 453, it is calculated by the above expression (expression 4). The saturation evaluation value P s becomes 1 at the contact point of the image area 452, and the saturation evaluation value P s decreases as the image area 454 approaches, and is set to a value that gradually approaches 0.

図8のフローチャートに戻り画像処理シーケンスの説明を続ける。ステップS216においては、上述した3つの評価値、すなわち、
(a)白とび(高輝度画素)への近さ=白とび距離評価値P
(b)彩度の大きさ=彩度評価値P
(c)偽色に相当する特定色相への近さ=色相評価値Pθ
に基づいて、下式(式5)に従って、偽色(PF)度合いpを算出する。

Figure 2006121138
Returning to the flowchart of FIG. 8, the description of the image processing sequence will be continued. In step S216, the above three evaluation values, that is,
(A) Closeness to whiteout (high luminance pixel) = whiteout distance evaluation value P d ,
(B) Saturation magnitude = saturation evaluation value P s ,
(C) proximity to a specific hue corresponding to a false color = hue evaluation value P θ ,
Based on the above, the false color (PF) degree p is calculated according to the following equation (equation 5).
Figure 2006121138

上記式(式5)は、3つの評価値、すなわち、白とび距離評価値Pと、色相評価値Pθと、彩度評価値Pとの乗算値に基づいて偽色(PF)度合いp、すなわち、偽色である可能性を示すパラメータである偽色(PF)度合いpを算出する式である。 The equation (Equation 5), the three evaluation values, i.e., the overexposure distance evaluation value P d, the hue evaluation value P theta, false color (PF) degree based on the multiplication value of the chroma evaluation value P s p is an expression for calculating a false color (PF) degree p which is a parameter indicating the possibility of false color.

次にステップS217において、注目画素の色情報を補正する処理を行う。ステップS217の詳細処理について、図13のフローチャートを参照して説明する。本実施例においては、注目画素の周囲の画素の色情報から求めた色情報補間値を、偽色(PF)度合いpに応じてオリジナルの色情報C(x,y)と案分することにより、補正を行う。また、補間値としては、注目画素とその周辺画素の重み付き平均を用いる。補間値算出範囲の色情報の重み付き平均を補間値とすることにより、パープルフリンジ等の偽色を完全に除去することはできないが、特に彩度が高く非常に目立つ部分などを、目立たなくさせることにより、パープルフリンジ等の偽色を軽減する処理を施すことができる。   Next, in step S217, a process for correcting the color information of the target pixel is performed. The detailed processing in step S217 will be described with reference to the flowchart in FIG. In this embodiment, the color information interpolation value obtained from the color information of the pixels around the target pixel is divided into the original color information C (x, y) according to the false color (PF) degree p. , Make corrections. As the interpolation value, a weighted average of the target pixel and its surrounding pixels is used. By using the weighted average of the color information in the interpolation value calculation range as the interpolation value, false colors such as purple fringes cannot be completely removed, but particularly high-saturation and highly conspicuous parts are made inconspicuous. As a result, processing for reducing false colors such as purple fringing can be performed.

図13に示すフローの各ステップの処理について説明する。最初にステップS301において、補間値算出範囲(x,y,x,y)を算出する。補間値算出範囲は、前述の白とび探索範囲と同様に、光学系の種類や設定、注目画素の位置基づいたデータを元に、注目画素が白とびである場合にどの範囲にパープルフリンジが発生するかを表わした範囲を補間値算出範囲として算出する。ここでは、注目画素がパープルフリンジである場合の補正を行うが、その場合本来の被写体の色が残っている可能性のある範囲として、補間値算出範囲(x,y,x,y)を用い、その範囲の画素の色情報の重み付き平均を求める。 Processing of each step in the flow shown in FIG. 13 will be described. First, in step S301, an interpolation value calculation range (x 2 , y 2 , x 3 , y 3 ) is calculated. The interpolation value calculation range is the same as the above-described whiteout search range, based on the data based on the type and setting of the optical system and the position of the target pixel, in which range the purple fringe occurs when the target pixel is whiteout A range representing this is calculated as an interpolation value calculation range. Here, correction is performed when the pixel of interest is a purple fringe. In this case, an interpolation value calculation range (x 2 , y 2 , x 3 , y is assumed as a range in which the original subject color may remain. 3 ) is used to obtain a weighted average of the color information of the pixels in the range.

補間値算出範囲(x,y,x,y)の具体的な設定処理について、図14を参照して説明する。図14は、先に説明した図9に対応する図であり、補正対象となる画像データ510において注目画素が画素511であるとする。仮に画素511がパープルフリンジ等の偽色画素である場合、この偽色画素を周囲の画素の画素値に基づいて補正することになる。画素511がパープルフリンジ等の偽色画素である場合、図9を参照して説明したように、白とび探索範囲520の中に白とび画素が存在する。白とび探索範囲520は、図9における画素領域230に対応し、画素領域521と、画素領域522を含む矩形領域として設定される白とび探索範囲520である。 A specific setting process of the interpolation value calculation range (x 2 , y 2 , x 3 , y 3 ) will be described with reference to FIG. FIG. 14 is a diagram corresponding to FIG. 9 described above, and it is assumed that the target pixel is the pixel 511 in the image data 510 to be corrected. If the pixel 511 is a false color pixel such as purple fringe, the false color pixel is corrected based on the pixel values of surrounding pixels. When the pixel 511 is a false color pixel such as a purple fringe, there is a whiteout pixel in the whiteout search range 520 as described with reference to FIG. The overexposure search range 520 corresponds to the pixel area 230 in FIG. 9 and is an overexposure search area 520 set as a rectangular area including the pixel area 521 and the pixel area 522.

画素511がパープルフリンジであった場合は、画素511の周囲の画素を用いて補間処理、すなわち、画素511の周囲の画素の画素値を適用して画素511の画素値を決定する処理を行なう。その際、補間処理に適用する対象となる画素、すなわち参照する画素は、なるべく偽色(パープルフリンジ)画素ではない方が望ましい。画素511がパープルフリンジであった場合、例えば、白とび探索範囲520内に検出された白とび画素531と、注目画素511との間に存在する画素はすべてパープルフリンジになるはずである。ここで白とび画素531は、図7のフローにおけるステップS204〜S214の処理において注目画素511からの最小距離dminを持つ白とび画素531であるとする。この場合、パーブルフリンジである画素511は、白とび画素531の直接的影響によってパープルフリンジとなっており、より白とび画素531に近い画素は、すべてパープルフリンジになるはずである。 When the pixel 511 is a purple fringe, interpolation processing using the pixels around the pixel 511, that is, processing for determining the pixel value of the pixel 511 by applying the pixel values of the pixels around the pixel 511 is performed. At that time, it is desirable that the pixel to be applied to the interpolation process, that is, the pixel to be referenced is not a false color (purple fringe) pixel as much as possible. When the pixel 511 is purple fringe, for example, all the pixels existing between the whiteout pixel 531 detected in the whiteout search range 520 and the target pixel 511 should be purple fringe. Here, it is assumed that the overexposed pixel 531 is an overexposed pixel 531 having a minimum distance d min from the target pixel 511 in the processing of steps S204 to S214 in the flow of FIG. In this case, the pixel 511 that is a purple fringe is a purple fringe due to the direct influence of the whiteout pixel 531, and all pixels that are closer to the whiteout pixel 531 should be a purple fringe.

この様な場合、注目画素511から白とび画素531がある方向の反対側に進むにつれて被写体本来の色に近づくといえる。したがって、補間値算出範囲としては、例えば画素511から白とび画素531へ向かう方向の反対側の領域を設定することで、より正常な画素値を多く含む領域を設定することができると判断される。このような場合は、例えば図14に示すように補間値算出範囲541を設定すればよい。   In such a case, it can be said that the original color of the subject approaches as the whiteout pixel 531 progresses from the target pixel 511 to the opposite side of the certain direction. Therefore, as the interpolation value calculation range, for example, by setting a region on the opposite side in the direction from the pixel 511 to the overexposed pixel 531, it is determined that a region including more normal pixel values can be set. . In such a case, for example, an interpolation value calculation range 541 may be set as shown in FIG.

図14に示す例では、注目画素511の画素値は、補間値算出範囲541の構成画素の画素値に基づいて算出される値によって決定されることになる。このように、補間値算出範囲(x,y,x,y)の設定の際には、注目画素511からの最小距離dminを持つ白とび画素の方向から遠い方向の画素を多く含む領域設定を行うことで、より効果的な補間処理が可能となる。 In the example illustrated in FIG. 14, the pixel value of the target pixel 511 is determined by a value calculated based on the pixel values of the constituent pixels in the interpolation value calculation range 541. In this way, when setting the interpolation value calculation range (x 2 , y 2 , x 3 , y 3 ), pixels in a direction far from the direction of the overexposed pixel having the minimum distance d min from the target pixel 511 are selected. By setting a region including many, more effective interpolation processing can be performed.

図13のフローに戻り、補間処理シーケンスについての説明を続ける。ステップS302において、初期設定として、色情報の補間値を保存する変数(ベクトル値)Ctmpをゼロベクトルに、重みの総和を保存する変数(スカラー値)Wtotalを0にする。ステップS303,S304においては、補間値算出範囲(x,y,x,y)から選択する各画素の座標(s,t)を表わす変数s,tの初期設定処理を行なう。初期的には、補間値算出範囲(x,y,x,y)の1つの頂点に対応する画素座標(s,t)を選択し、それぞれs=x、t=yに設定する。 Returning to the flow of FIG. 13, the description of the interpolation processing sequence will be continued. In step S302, as an initial setting, a variable (vector value) C tmp that stores an interpolation value of color information is set to a zero vector, and a variable (scalar value) W total that stores a sum of weights is set to 0. In steps S303 and S304, initial setting processing of variables s and t representing the coordinates (s, t) of each pixel selected from the interpolation value calculation range (x 2 , y 2 , x 3 , y 3 ) is performed. Initially, pixel coordinates (s, t) corresponding to one vertex of the interpolation value calculation range (x 2 , y 2 , x 3 , y 3 ) are selected, and s = x 2 , t = y 2 , respectively. Set to.

次にステップS305において、選択画素(s,t)に対して適用する重みw(x,y,s,t)を算出し、算出した重みw(x,y,s,t)を、重み総和保存変数(スカラー値)Wtotalに加算し、重み総和保存変数(スカラー値)Wtotalを更新し、さらに、選択画素(s,t)の色情報C(s,t)に、重みw(x,y,s,t)を乗じて、色情報補間値保存変数Ctmpに加算して、色情報補間値保存変数Ctmpを更新する処理を行う。すなわち、
total=Wtotal+w(x,y,s,t)
tmp=Ctmp+w(x,y,s,t)×C(s,t)
これらの算出式により、処理対象画素(s,t)に対する重みw(x,y,s,t)を適用して、色情報補間値保存変数(ベクトル値)Ctmpと、重み総和保存変数(スカラー値)Wtotalとの更新を行なう。
Next, in step S305, a weight w (x, y, s, t) to be applied to the selected pixel (s, t) is calculated, and the calculated weight w (x, y, s, t) is calculated as a sum of weights. Save variable is added to the (scalar value) W total, then update the weight sum stored variables (scalar value) W total, further color information C (s, t) of the selected pixel (s, t) to the weight w (x , it is multiplied by y, s, t) and adds the color information interpolating values stored variable C tmp, performs processing to update the color information interpolating values stored variable C tmp. That is,
Wtotal = Wtotal + w (x, y, s, t)
C tmp = C tmp + w (x, y, s, t) × C (s, t)
By applying the weight w (x, y, s, t) to the processing target pixel (s, t) by these calculation formulas, the color information interpolation value storage variable (vector value) C tmp and the weight sum storage storage variable ( updating of the scalar value) W total.

なお、最も単純な処理例では、すべての選択画素(s,t)の重みw(x,y,s,t)を1とする設定が適用できる。すべての画素(s,t)において重みw(x,y,s,t)=1とする設定では、補間値算出範囲(x,y,x,y)から選択されるすべての参照画素の平均値を、注目画素(x,y)の画素値決定に適用する補間処理となる。 In the simplest processing example, a setting in which the weight w (x, y, s, t) of all the selected pixels (s, t) is 1 can be applied. In the setting of weight w (x, y, s, t) = 1 for all pixels (s, t), all the values selected from the interpolation value calculation range (x 2 , y 2 , x 3 , y 3 ) The interpolation processing applies the average value of the reference pixels to determine the pixel value of the target pixel (x, y).

この他、重みw(x,y,s,t)の設定態様としては、パープルフリンジ画素を最適に補間するための重みwの設定例として、注目画素(x,y)と座標(s,t)の距離に応じた値を重みwとして用いる構成としてもよい。さらに、画素(s,t)の色情報C(s,t)の色相がパープルフリンジ色相から離れているほど重みを大きな値にする設定とするなど、入力画像の色情報を考慮する方法を採用してもよい。   In addition, as a setting mode of the weight w (x, y, s, t), as a setting example of the weight w for optimally interpolating the purple fringe pixel, the pixel of interest (x, y) and the coordinates (s, t) ) May be used as the weight w. Further, a method that takes into account the color information of the input image is adopted, such as setting the weight to be larger as the hue of the color information C (s, t) of the pixel (s, t) is farther from the purple fringe hue. May be.

ステップS305における色情報補間値保存変数(ベクトル値)Ctmpと、重み総和保存変数(スカラー値)Wtotalとの更新処理の後、ステップS306において、選択画素の座標(s,t)のx成分値:sを1増加させ、ステップS307においてsが、s>x、すなわち、補間値算出範囲(x,y,x,y)を超えるか否かを判定しYesならS308へ進みNoならS305へ戻る。ステップS308では、選択座標(s,t)のy成分値:tを1増加させ、ステップS309においてtが、t>y、すなわち、補間値算出範囲(x,y,x,y)を超えるか否かを判定しYesならS310へ進みNoならS304へ戻る。これらの処理は、補間値算出範囲(x,y,x,y)において、選択画素(s,t)を1つずつ移動させる処理であり、ステップS309がYesと判定されると、補間値算出範囲(x,y,x,y)の全画素についての処理が終了し、補間値算出範囲(x,y,x,y)の全画素に基づいて算出された最終的な色情報補間値保存変数Ctmpと、重み総和保存変数Wtotalとが決定する。 After update processing of the color information interpolation value storage variable (vector value) C tmp and the weight sum storage storage variable (scalar value) W total in step S305, in step S306, the x component of the coordinates (s, t) of the selected pixel Value: s is incremented by 1. In step S307, it is determined whether s exceeds s> x 3 , that is, whether it exceeds the interpolation value calculation range (x 2 , y 2 , x 3 , y 3 ). If it is No, the process returns to S305. In step S308, the y component value: t of the selected coordinates (s, t) is increased by 1. In step S309, t is t> y 3 , that is, the interpolation value calculation range (x 2 , y 2 , x 3 , y 3 ) It is determined whether or not the value exceeds 3. If Yes, the process proceeds to S310. These processes are processes for moving the selected pixel (s, t) one by one in the interpolation value calculation range (x 2 , y 2 , x 3 , y 3 ), and when step S309 is determined to be Yes. , based on all the pixels of the interpolation value calculation range (x 2, y 2, x 3, y 3) processing for all the pixels are finished, interpolation value calculation range (x 2, y 2, x 3, y 3) The final color information interpolation value storage variable C tmp calculated in this way and the weight sum storage variable W total are determined.

最後に、ステップS310において、これらの補間値算出範囲(x,y,x,y)の全画素に基づいて算出された最終的な色情報補間値保存変数Ctmpと、重み総和保存変数Wtotalとに基づいて、注目画素(x,y)の補正色としての補正色情報C'(x,y)を、下式(式6)、すなわち、

Figure 2006121138
上記式(式6)に基づいて決定する。 Finally, in step S310, the final color information interpolation value storage variable C tmp calculated based on all the pixels in the interpolation value calculation range (x 2 , y 2 , x 3 , y 3 ), and the weight sum Based on the storage variable W total , the correction color information C ′ (x, y) as the correction color of the target pixel (x, y) is expressed by the following equation (Equation 6), that is,
Figure 2006121138
It determines based on the said Formula (Formula 6).

上記式(式6)において、pは、先に説明した図8のステップS216において算出した偽色(PF)度合いpである。すなわち、
(a)白とび(高輝度画素)への近さ=白とび距離評価値P
(b)彩度の大きさ=彩度評価値P
(c)偽色に相当する特定色相への近さ=色相評価値Pθ
(a)〜(c)の乗算値として、前述の式(式5)に基づいて算出された注目画素(x,y)の偽色(PF)度合いpである。
In the above formula (formula 6), p is the false color (PF) degree p calculated in step S216 of FIG. 8 described above. That is,
(A) Closeness to whiteout (high luminance pixel) = whiteout distance evaluation value P d ,
(B) Saturation magnitude = saturation evaluation value P s ,
(C) proximity to a specific hue corresponding to a false color = hue evaluation value P θ ,
As the multiplication value of (a) to (c), the false color (PF) degree p of the target pixel (x, y) calculated based on the above-described expression (Expression 5).

tmp、Wtotalは、前述のステップS309までの処理において求めた補間値算出範囲(x,y,x,y)の全画素に基づいて算出された最終的な色情報補間値保存変数Ctmpと、重み総和保存変数Wtotalであり、C(x,y)は、補間処理前の注目画素(x,y)の色情報であり、(Ctmp/Wtotal)は、注目画素(x,y)の近傍領域に設定された補間値算出範囲(x,y,x,y)の全画素に基づいて算出された補間値に相当する。 C tmp and W total are final color information interpolation values calculated based on all pixels in the interpolation value calculation range (x 2 , y 2 , x 3 , y 3 ) obtained in the processing up to step S 309 described above. A storage variable C tmp and a weight sum storage variable W total , C (x, y) is color information of a pixel of interest (x, y) before interpolation processing, and (C tmp / W total ) is a target This corresponds to an interpolation value calculated based on all the pixels in the interpolation value calculation range (x 2 , y 2 , x 3 , y 3 ) set in the vicinity region of the pixel (x, y).

上記式は、注目画素(x,y)の偽色(PF)度合いpの値が高い(1に近い)ほど、注目画素(x,y)の補間処理前の元画素の画素値に相当する色情報C(x,y)の影響が小さく、補間値算出範囲(x,y,x,y)の構成画素の色情報から算出される補間値の影響度が高くなる調整処理によって、注目画素(x,y)の補正画素値としての補正色情報C'(x,y)が設定されることを示す。上記式において、[p×Ctmp/Wtotal]は、補間値算出範囲(x,y,x,y)の構成画素の色情報に基づいて決定される値である。 The above expression corresponds to the pixel value of the original pixel before interpolation processing of the target pixel (x, y) as the value of the false color (PF) degree p of the target pixel (x, y) is higher (closer to 1). Adjustment processing in which the influence of the color information C (x, y) is small and the influence of the interpolation value calculated from the color information of the constituent pixels in the interpolation value calculation range (x 2 , y 2 , x 3 , y 3 ) is high Indicates that the correction color information C ′ (x, y) as the correction pixel value of the target pixel (x, y) is set. In the above equation, [p × C tmp / W total ] is a value determined based on the color information of the constituent pixels in the interpolation value calculation range (x 2 , y 2 , x 3 , y 3 ).

一方、注目画素(x,y)の偽色(PF)度合いpの値が小さい(0に近い)ほど、注目画素(x,y)の補間処理前の元画素値に対応する色情報C(x,y)の影響が大きく、補間値算出範囲(x,y,x,y)の構成画素の色情報に基づく補間値の影響度が小さくなる調整処理によって注目画素(x,y)の補正色情報C'(x,y)が設定される。 On the other hand, as the value of the false color (PF) degree p of the target pixel (x, y) is smaller (closer to 0), the color information C () corresponding to the original pixel value before the interpolation process of the target pixel (x, y) is performed. The pixel of interest (x, y) is adjusted by an adjustment process in which the influence of the interpolation value based on the color information of the constituent pixels in the interpolation value calculation range (x 2 , y 2 , x 3 , y 3 ) is small. Correction color information C ′ (x, y) of y) is set.

以上の処理が、図8のステップS217の処理であり、この処理によって1つの注目画素に対する画素値補間処理、すなわち、注目画素の元画素値と、補間値算出範囲(x,y,x,y)の構成画素の色情報に基づく補間値とを適用し、注目画素の偽色度合いpに応じて元画素値と補間値との寄与率を変更して注目画素の補正画素値を算出する処理が終了する。 The above processing is the processing of step S217 in FIG. 8, and by this processing, pixel value interpolation processing for one target pixel, that is, the original pixel value of the target pixel and the interpolation value calculation range (x 2 , y 2 , x 3 , y 3 ), and the interpolation value based on the color information of the constituent pixel is applied, and the contribution ratio between the original pixel value and the interpolation value is changed according to the false color degree p of the target pixel, and the corrected pixel value of the target pixel The process of calculating is finished.

上述したように、本発明処理の画像処理では、偽色である可能性を示すパラメータとしての注目画素の偽色度合いpを、(a)白とび(高輝度画素)への近さを示す白とび距離評価値P、(b)彩度の大きさを示す彩度評価値P、(c)偽色に対応する特定色相への近さを示す色相評価値Pθを適用して算出し、上記式(式6)によって偽色度合いpを適用して補正画素値を算出する構成としたことにより、パープルフリンジ等の偽色の可能性の高い画素については周囲画素に基づく補間値の寄与率を高め、偽色の可能性の低い画素については、元画素値の寄与率を高くした補正が実行されることになり、破綻の無い高品質な画像を取得することが可能となる。 As described above, in the image processing according to the present invention, the false color degree p of the pixel of interest as a parameter indicating the possibility of false color is set to (a) white indicating closeness to whiteout (high luminance pixel). Calculation is performed by applying the jump distance evaluation value P d , (b) the saturation evaluation value P s indicating the magnitude of the saturation, and (c) the hue evaluation value P θ indicating the proximity to the specific hue corresponding to the false color. Since the corrected pixel value is calculated by applying the false color degree p according to the above equation (Equation 6), the interpolation value based on the surrounding pixels is used for a pixel having a high possibility of false color such as purple fringe. For pixels with a high contribution rate and a low possibility of false color, correction with a high contribution rate of the original pixel value is executed, and a high-quality image without failure can be acquired.

なお、本処理例では、パープルフリンジ等の偽色画素を補正する方法の一例として、図13のフローチャートに従った処理例を挙げたが、本方法に限らず、他にも、パープルフリンジ度合いpを用いて彩度を削減する方法もある。色空間として例えばYCbCrを用いる場合、この方法は、以下の式(式7)で示す算出処理によって実現される。
Cb'=(1.0−p)*(Cb−128)+128
Cr'=(1.0−p)*(Cr−128)+128
・・・(式7)
In this processing example, the processing example according to the flowchart of FIG. 13 is given as an example of a method for correcting false color pixels such as purple fringe. There is also a method of reducing the saturation using. For example, when YCbCr is used as the color space, this method is realized by a calculation process represented by the following equation (Equation 7).
Cb ′ = (1.0−p) * (Cb−128) +128
Cr ′ = (1.0−p) * (Cr−128) +128
... (Formula 7)

上記式(式7)において、Cb,Crは、補正対象となる注目画素の元の色を示し、YCbCr色空間における値(Cb,Cr)である。これらの値は0〜128の値を持つ。これらの値に、注目画素(x,y)の偽色(PF)度合いpを適用して、補正後の注目画素の色情報Cb',Cr'を決定する。上記式においても、注目画素(x,y)の偽色(PF)度合いpが高いほど、注目画素の元の色データとしての(Cb,Cr)の影響の少ない補正がなされることになる。   In the above formula (formula 7), Cb and Cr indicate the original color of the target pixel to be corrected, and are values (Cb, Cr) in the YCbCr color space. These values have values from 0 to 128. By applying the false color (PF) degree p of the target pixel (x, y) to these values, the color information Cb ′, Cr ′ of the target pixel after correction is determined. Also in the above equation, the correction with less influence of (Cb, Cr) as the original color data of the target pixel is performed as the false color (PF) degree p of the target pixel (x, y) is higher.

また、上述の式(式7)で算出される彩度を削減した画素に対して、図13のフローに示すステップS302〜S309の処理を実行して、補間値算出範囲(x,y,x,y)の全画素に基づく色情報補間値保存変数Ctmpと、重み総和保存変数Wtotalを算出し、この値を用いて、ステップS310の処理、すなわち、前述の式(式6)を適用して、注目画素の補正色情報C'(x,y)を算出する構成としてもよい。この補正処理によっても、効果的な偽色(パープルフリンジ)軽減が実現される。 Further, with respect to pixels with reduced color saturation calculated by the above equation (Equation 7), and executes the processing of steps S302~S309 shown in the flowchart of FIG. 13, the interpolation value calculation range (x 2, y 2 , X 3 , y 3 ), a color information interpolation value storage variable C tmp and a weight sum storage variable W total based on all the pixels are calculated, and using these values, the process of step S310, that is, the above-described formula (formula 6) may be applied to calculate the correction color information C ′ (x, y) of the target pixel. This correction process also realizes effective false color (purple fringe) reduction.

ほかにも、パープルフリンジ等の偽色を補正する方法として、前述の式(式5)で算出した偽色(PF)度合いpを基にして、そのカーネルサイズを設定したローパスフィルタを施す方法も適用可能である。例えば、注目画素(x,y)の偽色(PF)度合いpが低い場合は、注目画素(x,y)の比較的近くにある画素の画素値のみを選択して、これらの画素値を適用した補間処理を実行し、注目画素(x,y)の偽色(PF)度合いpが高い場合は、注目画素(x,y)の近傍のみではなく、より広い範囲の周辺画素を参照画素として選択して、これらの広範囲の画素の画素値を適用した補間処理を実行する構成としてもよい。   In addition, as a method of correcting false colors such as purple fringe, there is a method of applying a low-pass filter in which the kernel size is set based on the false color (PF) degree p calculated by the above equation (Equation 5). Applicable. For example, when the false color (PF) degree p of the target pixel (x, y) is low, only pixel values of pixels relatively close to the target pixel (x, y) are selected, and these pixel values are set. When the applied interpolation processing is executed and the false color (PF) degree p of the target pixel (x, y) is high, not only the vicinity of the target pixel (x, y) but also a wider range of peripheral pixels is referred to as the reference pixel. It is good also as a structure which selects as and performs the interpolation process which applied the pixel value of these wide range pixels.

すなわち、前述の式(式5)で算出した偽色(PF)度合いpに基づいて、フィルタリング態様を変更したローパスフィルタを適用して修正された補間値、すなわち注目画素近傍の画素値に基づいて生成される補間値を修正して修正補間値を適用して注目画素の補正画素値を算出する構成としてもよい。   That is, based on the false color (PF) degree p calculated by the above formula (Formula 5), based on the interpolation value corrected by applying the low-pass filter whose filtering mode is changed, that is, the pixel value near the target pixel. The generated interpolation value may be corrected and the corrected interpolation value may be applied to calculate the corrected pixel value of the target pixel.

また、前述の式(式5)で算出した偽色(PF)度合いpをそのまま使うと補正結果が安定しない場合は、偽色(PF)度合いp、または、白とび距離評価値P、彩度評価値P、色相評価値Pθ、それぞれを入力として、各値に対応する最適な補正態様を設定したルックアップテーブルを用意し、ルックアップテーブルに基づく補正処理を実行することで、効果的にパープルフリンジが削減されるようパープルフリンジ度合いを修正する構成としてもよい。 In addition, if the correction result is not stable if the false color (PF) degree p calculated by the above-described expression (Expression 5) is used as it is, the false color (PF) degree p or the overexposure distance evaluation value P d , saturation By using a degree evaluation value P s and a hue evaluation value P θ as inputs, a lookup table in which an optimum correction mode corresponding to each value is set is prepared, and a correction process based on the lookup table is executed. For example, the purple fringing degree may be corrected so that purple fringing is reduced.

図8のフローに戻り画像処理のシーケンスについての説明を続ける。ステップS217において、図13を参照して説明した処理に従って、1つの注目画素(x,y)の補正された色情報C'(x,y)、すなわち、上述の処理によって注目画素の周囲画素の画素値を適用した補間画素値が決定される。1つの注目画素(x,y)の補正画素値が決定すると、次にステップS218において、注目画素の座標(x,y)のx成分値を1増加させ、ステップS219においてxが、x>w−1、すなわち、画像サイズの幅wに達したか否かを判定しYesならS220へ進みNoならS203へ戻る。ステップS220では、注目画素(x,y)のy成分値を1増加させ、ステップS221においてyが、y>h−1、すなわち、画像サイズの高さhに達したか否かを判定しYesなら処理を終了し、NoならS202へ戻る。これらの処理は、処理対象画像(幅w画素、高さh画素)の画像データにおいて、注目画素(x,y)を1つずつ移動させる処理であり、ステップS221がYesと判定されると、処理対象画像(幅w画素、高さh画素)の全画素についての処理が終了し、すべての画素を注目画素として設定した上で補正した画素値が決定される。   Returning to the flow of FIG. 8, the description of the image processing sequence will be continued. In step S217, according to the process described with reference to FIG. 13, the corrected color information C ′ (x, y) of one target pixel (x, y), that is, the surrounding pixels of the target pixel by the above process. An interpolated pixel value to which the pixel value is applied is determined. When the corrected pixel value of one pixel of interest (x, y) is determined, next, in step S218, the x component value of the coordinate (x, y) of the pixel of interest is increased by 1, and in step S219, x is x> w −1, that is, whether or not the image size width w has been reached is determined. If Yes, the process proceeds to S220. If No, the process returns to S203. In step S220, the y component value of the target pixel (x, y) is increased by 1. In step S221, it is determined whether y has reached y> h−1, that is, the image size height h. If not, the process ends. If No, the process returns to S202. These processes are processes in which the target pixel (x, y) is moved one by one in the image data of the processing target image (width w pixel, height h pixel). When step S221 is determined to be Yes, The processing for all the pixels of the processing target image (width w pixel, height h pixel) is completed, and the corrected pixel value is determined after setting all the pixels as the target pixel.

以上の処理が、図2の総合処理フローにおけるステップS12の平均法に基づく画像補正処理の詳細である。本処理の特徴は、ユーザのアシスト、すなわち画像に応じた最適なパラメータの設定などの処理を行なうことなく、すべてを自動処理として行なった場合でも、破綻の無い画像を生成することが可能となる点である。   The above processing is the details of the image correction processing based on the averaging method in step S12 in the overall processing flow of FIG. The feature of this processing is that it is possible to generate an image without failure even when all processing is performed automatically without performing user assistance, that is, processing such as setting an optimum parameter according to the image. Is a point.

前述したように、図2の総合処理フローにおけるステップS12の平均法に基づく画像補正処理は、ステップS11において生成した縮小画像に対して実行される。ステップS13では、ステップS12において実行した平均法に基づく画像補正結果データの拡大処理を実行する。   As described above, the image correction processing based on the averaging method in step S12 in the overall processing flow of FIG. 2 is performed on the reduced image generated in step S11. In step S13, enlargement processing of image correction result data based on the averaging method executed in step S12 is executed.

ステップS13では、ステップS12での補正結果を、オリジナルの入力画像に反映させる処理を行う。具体的には、ステップS12において縮小画像上で色が補正された部分に対応する、オリジナル画像の部分の色情報だけを更新する処理を行う。そのための第1段階として、縮小画像を拡大し、オリジナル画像と同じ解像度にする必要がある。小さい画像を拡大する方法は、一般にさまざまな方法が知られている。その一例が、bilinear補間による拡大処理である。これは、拡大後画像の画素値を求めるときに、拡大前の画像を基準としたときの座標を求め、その位置の4隅に対応する近傍の4画素から線形に補間を行う方法である。   In step S13, processing for reflecting the correction result in step S12 on the original input image is performed. Specifically, a process of updating only the color information of the part of the original image corresponding to the part whose color is corrected on the reduced image in step S12 is performed. As a first step for that purpose, it is necessary to enlarge the reduced image to have the same resolution as the original image. Various methods for enlarging a small image are generally known. One example is enlargement processing by bilinear interpolation. In this method, when obtaining the pixel value of the image after enlargement, the coordinates when the image before enlargement is used as a reference are obtained, and linear interpolation is performed from four neighboring pixels corresponding to the four corners of the position.

図15を参照して、ステップS13の拡大処理の詳細について説明する。図15の処理フローでは、ステップS12で生成した補正画像に対する拡大処理を実行して得られる画像データと、撮影画像データとしてのオリジナル画像データとをブレンドして、拡大画像データを生成する。
平均法に基づく補正画像の拡大画像の色情報をC(x,y)、
オリジナル画像の色情報をCorg(x,y)、
拡大処理の結果画像データの色情報をCnew(x,y)、
として、拡大処理の結果画像データの色情報:Cnew(x,y)を、C(x,y)と、Corg(x,y)とのブレンドによって求める。
Details of the enlargement process in step S13 will be described with reference to FIG. In the processing flow of FIG. 15, the image data obtained by executing the enlargement process on the corrected image generated in step S12 and the original image data as the photographed image data are blended to generate enlarged image data.
The color information of the enlarged image of the corrected image based on the averaging method is represented by C L (x, y),
The color information of the original image is represented by C org (x, y),
As a result of the enlargement process, the color information of the image data is changed to C new (x, y),
As a result of the enlargement processing, color information C new (x, y) of the image data is obtained by blending C L (x, y) and C org (x, y).

まず、ステップS401において、ブレンド比画像B(x,y)を設定する。ブレンド比画像B(x,y)は、オリジナル画像と同様の画素数(H×W)からなり、各画素に対応して0〜1のブレンド比が設定された画像である。ブレンド比画像B(x,y)は、ステップS12で算出された偽色(PF)度合いpを基準にして生成される。偽色(PF)度合いpは、縮小画像上で各画素ごとに算出される。まずは、これを上述のbilinear補間などにより拡大処理を行い、オリジナル画像と同様の画素数(H×W)にする。次に、この拡大した偽色(PF)度合い画像の各画素値に対し0から1の定数を乗算することにより、最終結果に対する平均法補正結果の寄与率を変更することができる。すなわち、弱めに補正をかけたいときなど、小さめの値の定数を各画素に乗算することにより、最終結果画像における平均法補正結果の寄与率を下げることができる。この0から1の定数は、ユーザによる設定、あるいは予め定められた値を用いる。このようにして偽色(PF)度合いを拡大したものを基に算出された画像をブレンド比画像B(x,y)とする。 First, in step S401, a blend ratio image B L (x, y) is set. The blend ratio image B L (x, y) is an image having the same number of pixels (H L × W L ) as the original image, and a blend ratio of 0 to 1 is set corresponding to each pixel. The blend ratio image B L (x, y) is generated based on the false color (PF) degree p calculated in step S12. The false color (PF) degree p is calculated for each pixel on the reduced image. First, this is enlarged by the above-described bilinear interpolation or the like, so that the number of pixels (H L × W L ) is the same as that of the original image. Next, by multiplying each pixel value of the enlarged false color (PF) degree image by a constant from 0 to 1, the contribution ratio of the average method correction result to the final result can be changed. That is, when the correction is made weakly, the contribution ratio of the average method correction result in the final result image can be reduced by multiplying each pixel by a constant having a smaller value. The constant from 0 to 1 is set by the user or a predetermined value is used. An image calculated based on an image obtained by expanding the false color (PF) degree in this way is defined as a blend ratio image B L (x, y).

ステップS402では、ステップS12で生成した平均法による補正画像を拡大し、色情報C(x,y)を持つ拡大画像を得る。拡大手法は、前述したbilinear補間による拡大処理などが適用される。この処理により、平均法による補正処理を施した縮小画像データ、すなわち、低解像度画像データを、オリジナルの入力画像と同等の解像度(幅W、高さH)に拡大し、拡大画像C(x,y)を得る。 In step S402, the corrected image generated by the averaging method generated in step S12 is enlarged to obtain an enlarged image having color information C L (x, y). As the enlargement method, the above-described enlargement process by bilinear interpolation is applied. By this processing, the reduced image data subjected to the correction process by the average method, that is, the low resolution image data is enlarged to the same resolution (width W L , height H L ) as the original input image, and the enlarged image C L (X, y) is obtained.

次に、ステップS403以下において、拡大処理の結果画像データの構成画素毎の色情報Cnew(x,y)を決定する。まず、ステップS403、S404において、画素数(H×W)からなる拡大画像の処理画素(x,y)の初期設定としてy=0,x=0の設定を行う。 Next, in step S403 and subsequent steps, color information C new (x, y) is determined for each constituent pixel of the image data as a result of the enlargement process. First, in steps S403 and S404, y = 0 and x = 0 are set as initial settings of the processing pixel (x, y) of the enlarged image having the number of pixels (H L × W L ).

次にステップS405において、拡大画像の処理画素(x,y)の色情報Cnew(x,y)を決定する。色情報の決定処理は、下記式(式8)、すなわち、
new(x,y)=B(x,y)×C(x,y)+(1−B(x,y))×Corg(x,y) ・・・(式8)
に従って求める。
In step S405, the color information C new (x, y) of the processing pixel (x, y) of the enlarged image is determined. The color information determination process is the following formula (formula 8), that is,
C new (x, y) = B L (x, y) × C L (x, y) + (1−B L (x, y)) × C org (x, y) (Equation 8)
Ask according to.

上記式(式8)は、各画素毎に0〜1の範囲の値が設定されたブレンド比画像B(x,y)に基づいて決定されるブレンド比に応じて、オリジナルの入力画像とステップS12で生成した平均法による補正画像とをブレンドして、拡大画像の処理画素(x,y)の色情報Cnew(x,y)を決定するものである。ブレンド比画像B(x,y)は、平均法による補正の補正度合いを基に算出された画像である。これを用いて、オリジナル画像と平均法の結果をブレンドすると、オリジナル画像において補正がなされた部分のみ、すなわち偽色が発生していた部分だけ、の色情報を更新することが出来る。このため、ステップS12において補正がなされなかった部分は、オリジナルの画像がそのまま結果として使われるため、画像が劣化することは無い。 The above equation (Equation 8) is obtained by changing the original input image and the original input image according to the blend ratio determined based on the blend ratio image B L (x, y) in which a value in the range of 0 to 1 is set for each pixel. The color information C new (x, y) of the processing pixel (x, y) of the enlarged image is determined by blending with the corrected image generated by the averaging method generated in step S12. The blend ratio image B L (x, y) is an image calculated based on the correction degree of correction by the average method. By using this and blending the original image and the result of the averaging method, it is possible to update the color information of only the corrected part of the original image, that is, only the part where the false color has occurred. For this reason, since the original image is used as it is for the portion that has not been corrected in step S12, the image does not deteriorate.

上記式(式8)に従った算出処理に従って、1つの注目画素(x,y)の色情報Cnew(x,y)が決定される。1つの注目画素(x,y)の画素値が決定すると、次にステップS406において、処理画素の座標(x,y)のx成分値を1増加させ、ステップS407においてxが、x>W−1、すなわち、オリジナルの入力画像と同等の解像度(幅W、高さH)を持つ画像データの画像幅Wに達したか否かを判定しYesならS408へ進みNoならS405へ戻る。ステップS408では、処理画素(x,y)のy成分値を1増加させ、ステップS409においてyが、y>H−1、すなわち、画像サイズの高さHに達したか否かを判定しYesなら処理を終了し、NoならS404へ戻る。これらの処理は、処理対象画像(幅W画素、高さH画素)の画像データにおいて、注目画素(x,y)を1つずつ移動させる処理であり、ステップS409がYesと判定されると、処理対象画像(幅W画素、高さH画素)の全画素についての処理が終了し、オリジナル入力画像と同等の解像度(幅W、高さH)の全画素の画素値が決定される。 The color information C new (x, y) of one pixel of interest (x, y) is determined according to the calculation process according to the above equation (Equation 8). When the pixel value of one pixel of interest (x, y) is determined, next, in step S406, the x component value of the coordinate (x, y) of the processing pixel is increased by 1, and in step S407, x is x> W L −1, that is, whether or not the image width W L of the image data having the same resolution (width W L , height H L ) as the original input image has been reached is determined. If Yes, the process proceeds to S408. If No, the process proceeds to S405. Return. In step S408, the y component value of the processing pixel (x, y) is increased by 1. In step S409, it is determined whether y has reached y> H L -1, that is, the image size height H L. If Yes, the process ends. If No, the process returns to S404. These processes are processes for moving the pixel of interest (x, y) one by one in the image data of the processing target image (width W L pixel, height H L pixel), and step S409 is determined as Yes. Then, the processing for all the pixels of the processing target image (width W L pixel, height H L pixel) is completed, and the pixel values of all pixels having the same resolution (width W L , height H L ) as the original input image Is determined.

なお、オリジナルの入力画像とステップS12で生成した平均法による補正画像とをブレンドして生成した拡大画像、すなわち図2に示す総合処理フローのステップS13において生成する拡大画像をステップS15の拡大処理によって生成する拡大画像と区別するため、[Cavgnew(x,y)]とする。 Note that the enlarged image generated by blending the original input image and the correction image by the averaging method generated in step S12, that is, the enlarged image generated in step S13 of the overall processing flow shown in FIG. In order to distinguish from the enlarged image to be generated, [C avgnew (x, y)] is used.

次に、図2に示す総合処理フローのステップS14において、穴埋め法に基づく画像補正処理を実行する。ステップS14における穴埋め法に基づく画像補正処理は、ステップS11において生成した縮小画像に対して実行される。縮小画像に対する画像処理として実行することにより効率的な処理、すなわち計算コストを低減した処理として実行することができる。   Next, in step S14 of the comprehensive processing flow shown in FIG. 2, image correction processing based on the hole filling method is executed. The image correction process based on the hole filling method in step S14 is executed on the reduced image generated in step S11. By executing as an image process for a reduced image, it can be executed as an efficient process, that is, a process with reduced calculation cost.

ステップS14における穴埋め法に基づく画像補正処理の詳細について、図16以下を参照して説明する。図16は、穴埋め法に基づく画像補正処理の全体処理を表すフローチャートである。図16以下を参照して穴埋め法の処理の詳細について説明する。なお、図16に示す穴埋め法に基づく画像補正処理は、図2の総合処理フローのステップS11において生成した縮小画像に対して実行される処理である。各ステップの処理について説明する。   Details of the image correction processing based on the hole filling method in step S14 will be described with reference to FIG. FIG. 16 is a flowchart showing the entire image correction processing based on the hole filling method. Details of the hole filling process will be described with reference to FIG. Note that the image correction process based on the hole filling method shown in FIG. 16 is a process executed on the reduced image generated in step S11 of the overall processing flow of FIG. The process of each step will be described.

ステップS501は、白とび領域検出処理であり、補正対象の入力画像データ中から白とび部分を検出する。ステップS502は、偽色画素検出領域設定処理であり、白とびの周囲の偽色発生画素である紫画素の検索領域を設定する。さらに、ステップS503は、偽色画素検出処理であり、検索領域内にある紫色画素を検出する。ステップS504は、偽色画素補正処理であり、検出された紫色の画素の色成分を補正する。さらに、ステップS505は、色ぼかし処理(フィルタリング処理)であり、自然な結果を得るためのフィルタリング処理を施す。   Step S501 is an overexposure area detection process in which an overexposed portion is detected from the input image data to be corrected. Step S502 is a false color pixel detection area setting process, in which a search area for purple pixels, which are false color generation pixels around whiteout, is set. Further, step S503 is a false color pixel detection process, in which purple pixels in the search area are detected. Step S504 is a false color pixel correction process, in which the color component of the detected purple pixel is corrected. Further, step S505 is a color blurring process (filtering process), and a filtering process for obtaining a natural result is performed.

なお、前述したように、処理対象となる画像は、図2に示す総合処理フローのステップS11において生成した縮小画像に対して実行される。各処理ステップの詳細について説明する。まず、ステップS501の白とび領域検出処理において、変換された画像データに基づく白とび領域検出処理(白とびマスク算出)を実行する。すなわち画像データから白とび画素を検出し、2値画像である白とびマスクSを生成する。図17を参照して、ステップS501において実行する白とび画素検出処理の詳細について説明する。   As described above, the image to be processed is executed on the reduced image generated in step S11 of the overall processing flow shown in FIG. Details of each processing step will be described. First, in the overexposure area detection process in step S501, an overexposure area detection process (excessive mask calculation) based on the converted image data is executed. That is, an overexposed pixel is detected from the image data, and an overexposed mask S that is a binary image is generated. With reference to FIG. 17, the details of the overexposed pixel detection process executed in step S501 will be described.

ステップS601、S602において、補正対象画像データである縮小画像の検査対象画素位置の初期設定を実行する。初期設定として、処理対象画像である縮小画像の検査対象画素位置をx=0、y=0として設定する。ステップS603において、輝度成分画像Linの各画素(x,y)について、輝度があらかじめ定められた閾値以上かどうか判別し、閾値以上ならばステップS604に進み、白とびマスクS(x,y)をtrueとし、閾値以下であれば、ステップS605に進み、白とびマスクS(x,y)をfalseとする。 In steps S601 and S602, the initial setting of the inspection target pixel position of the reduced image that is the correction target image data is executed. As an initial setting, the inspection target pixel position of the reduced image that is the processing target image is set as x = 0 and y = 0. In step S603, for each pixel in the luminance component image L in (x, y), the luminance is determined whether a predetermined threshold value or more, the process proceeds to step S604 if more than a threshold value, overexposure mask S (x, y) Is true and if it is equal to or less than the threshold value, the process proceeds to step S605, and the overexposure mask S (x, y) is set to false.

ステップS606では、画素位置:xの更新を実行し、ステップS607においてxが最大値(x=w)に達しているか否かを判定し、達していない場合は、ステップS603以下を繰り返し実行する。ステップS607においてxが最大値(x=w)に達している場合は、ステップS608に進み、画素位置:yの更新を実行し、ステップS609においてyが最大値(y=h)に達しているか否かを判定し、達していない場合は、ステップS602以下を繰り返し実行する。全ての画素(x=0〜w,y=0〜h)に対する処理が終了すると、白とびマスクの生成が終了する。   In step S606, the pixel position: x is updated. In step S607, it is determined whether x has reached the maximum value (x = w). If not, step S603 and subsequent steps are repeatedly executed. If x reaches the maximum value (x = w) in step S607, the process proceeds to step S608 to update the pixel position: y, and whether y reaches the maximum value (y = h) in step S609. If it has not been reached, step S602 and subsequent steps are repeatedly executed. When the processing for all the pixels (x = 0 to w, y = 0 to h) is finished, the generation of the whiteout mask is finished.

この結果、各画素位置において、閾値より大きい輝度レベルを持つ画素領域と、閾値以下の輝度領域を持つ画素領域とを区分した白とびマスクが生成される。(暗)0〜255(明)の輝度レベルが設定されている場合、閾値は、例えば250程度に設定され、250以上の輝度レベルを持つ画素を白とび発生画素として抽出し、これらの画素のみを区別可能とした白とびマスクが生成される。   As a result, at each pixel position, a whiteout mask is generated in which a pixel region having a luminance level greater than the threshold value and a pixel region having a luminance region less than the threshold value are separated. When a luminance level of (dark) 0 to 255 (bright) is set, the threshold is set to about 250, for example, pixels having a luminance level of 250 or higher are extracted as overexposed pixels, and only these pixels are extracted. A whiteout mask is generated which makes it possible to distinguish between the two.

上述の処理によって図16のステップS501が終了し、次に、ステップS502の偽色画素検出領域設定処理を実行する。この処理において、白とび部分周囲の偽色発生部検索領域設定(Dilate)処理を実行する。ここでは、白とび部分周囲の偽色発生部検索領域を区別するためのマスクP、すなわち、白とび部分周囲における紫画素検索領域を表すマスクPを生成する。なお、Pは2値のマスク画像である。   Step S501 in FIG. 16 is completed by the above processing, and then the false color pixel detection area setting processing in step S502 is executed. In this process, a false color generation part search area setting (Dilate) process around the overexposed portion is executed. Here, a mask P for distinguishing the false color generation portion search region around the overexposed portion, that is, a mask P representing the purple pixel search region around the overexposed portion is generated. P is a binary mask image.

図18を参照して、ステップS502の偽色発生部検索領域設定処理の詳細について説明する。まずステップS651において、偽色領域マスクPの全画素をfalseに初期化する。次に、ステップS652,S653において、画素位置の初期設定を実行する。初期設定として画素位置をx=0、y=0として設定する。   With reference to FIG. 18, the details of the false color generation part search area setting process in step S502 will be described. First, in step S651, all the pixels of the false color area mask P are initialized to false. Next, in steps S652 and S653, initial setting of the pixel position is executed. As an initial setting, the pixel position is set as x = 0 and y = 0.

画素位置設定の後、ステップS654において、設定画素位置における白とびマスクSの画素値を判別する。設定画素位置(x,y)において、白とびマスクS(x,y)=falseであれば、ステップS664へ進み、次の画素に対する処理に移る。もし、S(x,y)=trueであれば、ステップS655へ進む。画素位置(x,y)において、白とびマスクS(x,y)=falseであるとは、画素位置(x,y)の画素値が白とび画素ではないことを意味し、画素位置(x,y)において、白とびマスクS(x,y)=trueであるとは、画素位置(x,y)の画素値が白とび画素であることを意味する。   After the pixel position is set, in step S654, the pixel value of the overexposure mask S at the set pixel position is determined. If the overexposed mask S (x, y) = false at the set pixel position (x, y), the process proceeds to step S664, and the process for the next pixel is performed. If S (x, y) = true, the process proceeds to step S655. The overexposure mask S (x, y) = false at the pixel position (x, y) means that the pixel value at the pixel position (x, y) is not an overexposure pixel. , Y), the overexposure mask S (x, y) = true means that the pixel value at the pixel position (x, y) is an overexposure pixel.

画素位置(x,y)において、白とびマスクS(x,y)=trueである場合、ステップS655において、白とび画素(x,y)の周囲において偽色を発生する可能性がある範囲を算出する。前述の通り、パープルフリンジは、白とび部分の周囲に発生し、光学系の絞り、焦点距離によって発生する可能性のある範囲が変わる。また、画像上での光学中心からの距離によっても、発生する範囲が変化する。本実施例では、例えば撮像システムの光学系の特性を踏まえ、画像領域に対応した偽色画素検出領域を設定した例えばルックアップテーブル(LUT)など、あらかじめ設定された偽色画素検出領域算定情報を適用する。例えば、ルックアップテーブル(LUT)は、画像上での光学中心から白とび画素(x,y)までの距離と、画像データの撮影時の絞り、焦点距離情報とを入力パラメータとして、偽色画素検出領域情報を出力可能な構成を持つ。   If the overexposure mask S (x, y) = true at the pixel position (x, y), a range in which a false color may be generated around the overexposure pixel (x, y) in step S655. calculate. As described above, the purple fringe occurs around the overexposed portion, and the range in which the purple fringe may occur varies depending on the aperture and focal length of the optical system. Further, the generated range varies depending on the distance from the optical center on the image. In the present embodiment, for example, pre-set false color pixel detection area calculation information such as a look-up table (LUT) in which a false color pixel detection area corresponding to an image area is set based on the characteristics of the optical system of the imaging system is used. Apply. For example, the look-up table (LUT) is a false color pixel using, as input parameters, the distance from the optical center on the image to the overexposed pixel (x, y), the aperture at the time of image data capture, and focal length information. It has a configuration capable of outputting detection area information.

画像データの撮影時の絞り、焦点距離情報は画像データの属性情報から取得し、画像上での光学中心から白とび画素(x,y)までの距離は、本フローにおいて検査対象として設定された画素位置情報が適用される。   The aperture and focal length information at the time of photographing image data is acquired from the attribute information of the image data, and the distance from the optical center on the image to the overexposed pixel (x, y) is set as the inspection object in this flow. Pixel position information is applied.

なお、画像データの撮影時の絞り、焦点距離情報等の属性情報が取得できない場合は、画像上での光学中心から白とび画素(x,y)までの距離のみに基づいて偽色画素検出領域を決定する構成としてもよく、また、光学中心から白とび画素(x,y)までの距離等の情報についても適用することなく、白とび画素(x,y)の周囲の一定領域を偽色画素検出領域として一律に設定する構成としてもよい。   If attribute information such as aperture and focal length information at the time of photographing image data cannot be acquired, a false color pixel detection region is based only on the distance from the optical center on the image to the overexposed pixel (x, y). In addition, a certain area around the overexposed pixel (x, y) is false color without applying information such as the distance from the optical center to the overexposed pixel (x, y). The pixel detection area may be set uniformly.

ステップS655では、白とび画素(x,y)の周囲の偽色画素検出領域の範囲を、(x,x,y,y)の4個のスカラー値として算出する。これは、図19に示すように、白とび画素(x,y)601の周囲においてx〜x,y〜yによって規定される矩形領域を、白とび画素(x,y)の周囲に存在する偽色画素検出領域602とするものである。なお、図19において点線の画素603は、注目白とび画素(x,y)601以外の白とび画素603である。 In step S655, the range of the false color pixel detection area around the overexposed pixel (x, y) is calculated as four scalar values (x 0 , x 1 , y 0 , y 1 ). This is because, as shown in FIG. 19, overexposed pixel (x, y) of the rectangular region defined by x 0 ~x 1, y 0 ~y 1 around the 601, overexposed pixel (x, y) of A false color pixel detection area 602 exists in the surrounding area. In FIG. 19, a dotted line pixel 603 is a whiteout pixel 603 other than the target whiteout pixel (x, y) 601.

次に、算出した偽色画素検出領域(x,x,y,y)について、i=x,j=yを起点として設定(S656,S657)し、ステップS658〜S662において、偽色画素検出領域(x,x,y,y)内の各画素について白とびマスクS(i,j)の値がtrueかfalseかの判別を行う。図19に示す偽色画素検出領域602内の構成画素について、順次、白とびマスクの値がtrueかfalseかの判別を行う。図19において、注目白とび画素(x,y)601と白とび画素603については、白とびマスクS(i,j)=trueとなる。 Next, the calculated false color pixel detection region (x 0 , x 1 , y 0 , y 1 ) is set starting from i = x 0 , j = y 0 (S 656, S 657), and in steps S 658 to S 662. Then, for each pixel in the false color pixel detection area (x 0 , x 1 , y 0 , y 1 ), it is determined whether the value of the overexposure mask S (i, j) is true or false. For the constituent pixels in the false color pixel detection area 602 shown in FIG. 19, it is sequentially determined whether the overexposure mask value is true or false. In FIG. 19, with respect to the target white skip pixel (x, y) 601 and the white skip pixel 603, the white skip mask S (i, j) = true.

ステップS658において、白とびマスクS(i,j)=trueと判定した場合は、ステップS660に進み、次の画素の処理を行う。白とびマスクS(i,j)=falseの場合は、ステップS659に進み、偽色領域マスクP(i,j)の値をtrueに設定する。その後、ステップS660に進み、次の画素に対する処理を行う。ステップS660〜S663は、iおよびjの値の更新処理および最大値i=x、j=yであるか否かの判定処理である。順次iおよびjの値の更新を行いながら、特定画素(x,y)の周囲に設定した偽色領域マスクP(i,j)の値を決定する。 If it is determined in step S658 that the overexposed mask S (i, j) = true, the process proceeds to step S660, and the next pixel is processed. If the whiteout mask S (i, j) = false, the process proceeds to step S659, and the value of the false color area mask P (i, j) is set to true. Thereafter, the process proceeds to step S660, and processing for the next pixel is performed. Steps S660 to S663 are a process for updating the values of i and j and a process for determining whether or not the maximum values i = x 1 and j = y 1 are satisfied. While sequentially updating the values of i and j, the value of the false color region mask P (i, j) set around the specific pixel (x, y) is determined.

偽色領域マスクP(i,j)=trueは、偽色画素検出領域に属し、白とび画素ではない画素であり、偽色領域マスクP(i,j)=falseは、偽色画素検出領域に属さないか、または白とび画素である画素に対応する。   The false color area mask P (i, j) = true is a pixel that belongs to the false color pixel detection area and is not a whiteout pixel, and the false color area mask P (i, j) = false is a false color pixel detection area. Corresponds to a pixel that does not belong to the pixel or is a whiteout pixel.

ステップS663において、偽色画素検出領域(x,x,y,y)のすべての画素(i,j)に対して処理が完了したと判別されたら、ステップS664に進む。ステップS664〜S667は、xおよびyの値の更新処理および最大値x=w、y=hであるか否かの判定処理である。順次xおよびyの値の更新を行いながら、処理対象画像(x=0〜w,y=0〜h)の全画素について偽色領域マスクP(i,j)の値を決定し、偽色領域マスクP(i,j)を生成する。画像中のすべての画素(x,y)が処理されたと判別されると、図16のステップS502の偽色画素検出領域設定処理は終了する。 If it is determined in step S663 that the processing has been completed for all the pixels (i, j) in the false color pixel detection region (x 0 , x 1 , y 0 , y 1 ), the process proceeds to step S664. Steps S664 to S667 are a process of updating the values of x and y and a process of determining whether or not the maximum values x = w and y = h. While sequentially updating the values of x and y, the values of the false color region mask P (i, j) are determined for all the pixels of the processing target image (x = 0 to w, y = 0 to h), and the false color is determined. A region mask P (i, j) is generated. When it is determined that all the pixels (x, y) in the image have been processed, the false color pixel detection area setting process in step S502 of FIG. 16 ends.

次の処理は、図16のステップS503の偽色画素検出処理である。ステップS502では、白とび周囲の偽色、すなわちパープルフリンジが存在する可能性のある画像中の領域を偽色領域マスクPとして算出したが、次のステップS503においては、実際にパープルフリンジであると思われる画素を検出する処理を行う。すなわち、偽色領域マスクP=trueの領域の画素を対象として、実際にパープルフリンジであると思われる画素を検出する。   The next processing is the false color pixel detection processing in step S503 in FIG. In step S502, an over-the-counter false color, that is, an area in the image where a purple fringe may exist is calculated as a false color area mask P. In the next step S503, it is actually a purple fringe. A process of detecting a possible pixel is performed. That is, pixels that are actually considered to be purple fringes are detected for pixels in the area of the false color area mask P = true.

ステップS503では、ステップS502で計算された偽色領域マスクPを上書きする形で偽色領域マスクPを更新し、最終的に偽色と判定される画素のみを特定可能な偽色領域マスクPを生成する。ステップS503の偽色画素検出処理の詳細について、図20を参照して説明する。   In step S503, the false color area mask P is updated by overwriting the false color area mask P calculated in step S502, and a false color area mask P that can specify only pixels that are finally determined to be false color is obtained. Generate. Details of the false color pixel detection processing in step S503 will be described with reference to FIG.

ステップS701、S702において、画像データの画素位置の初期設定を実行する。初期設定として画素位置をx=0、y=0として設定する。ステップS703では、画素位置(x,y)における偽色領域マスクPの値を判別する。P(x,y)=falseであった場合は、ステップS706に進む。P(x,y)=trueであった場合は、ステップS704へ進む。   In steps S701 and S702, initial setting of the pixel position of the image data is executed. As an initial setting, the pixel position is set as x = 0 and y = 0. In step S703, the value of the false color area mask P at the pixel position (x, y) is determined. If P (x, y) = false, the process proceeds to step S706. If P (x, y) = true, the process proceeds to step S704.

前述したように、偽色領域マスクP(i,j)=trueは、偽色画素検出領域に
属し、白とび画素ではない画素であり、偽色領域マスクP(i,j)=false
は、偽色画素検出領域に属さないか、または白とび画素である画素に対応する。
As described above, the false color region mask P (i, j) = true is a pixel that belongs to the false color pixel detection region and is not a whiteout pixel, and the false color region mask P (i, j) = false.
Corresponds to a pixel that does not belong to the false color pixel detection region or is a whiteout pixel.

画素位置(x,y)が、偽色領域マスクP(i,j)=true、すなわち、偽色画素検出領域に属し、白とび画素ではない画素である場合は、ステップS704において、位置(x,y)における色成分画像Cinの色が、偽色対応色であるか否かを判定する。例えばパープルフリンジの紫色であるかどうかを判別する。 If the pixel position (x, y) is a false color area mask P (i, j) = true, that is, a pixel that belongs to the false color pixel detection area and is not an overexposed pixel, in step S704, the position (x , Y) determines whether the color of the color component image C in is a false color-corresponding color. For example, it is determined whether the purple fringe is purple.

色成分画像Cin(x,y)が偽色対応色、例えば紫色かどうかの判別方法は、この処理において適用している色空間によって異なる。例えば色空間としてCIE Lを用いた場合の判別方法の一例を図21を参照して説明する。色成分は、a成分,b成分を用いて判別される。a成分の値が、増えれば赤(Red)、減れば緑色(Green)に近づき、b成分の値が増えれば黄色(Yellow)、減れば青色(Blue)に近づくような特徴を持っている。したがって、(a,b)が第4象限に存在する場合、紫色(Purple)に近い色を持つ。紫色かどうか判別するには、ベクトル(a,b)がa軸となす角度αなどを使って判別する。 A method for determining whether the color component image C in (x, y) is a false color-corresponding color, for example, purple, differs depending on the color space applied in this process. For example, an example of a determination method when CIE L * a * b * is used as the color space will be described with reference to FIG. The color component is determined using the a * component and the b * component. The value of a * component, red (Red) The more approaches the green (Green) Invite Helle, b * yellow The more the value of the component (Yellow), with characteristics closer to blue (Blue) Invite Hereford Yes. Therefore, when (a * , b * ) exists in the fourth quadrant, it has a color close to purple. To determine whether the color is purple, the vector (a * , b * ) is determined using an angle α formed with the a * axis.

偽色として判定する紫色の対象となる角度の範囲などはパラメータとして適宜設定する。あるいは予め設定された値を適用する。なお、偽色(パープルフリンジ)部分画素の彩度は大きい傾向がある。したがって、前記の条件を満たしかつ、色成分Cinの彩度があらかじめ設定した閾値以上である場合だけを、偽色(パープルフリンジ)であると判定する設定としてもよい。このようにして、Cin(x,y)が偽色(パープルフリンジ)画素と判定された場合はステップS706へ、偽色(パープルフリンジ)ではないと判定された場合はステップS705へ進む。 The range of the angle to be purple that is determined as the false color is set as a parameter as appropriate. Alternatively, a preset value is applied. Note that the saturation of the false color (purple fringe) partial pixels tends to be large. Therefore, only when the above condition is satisfied and the saturation of the color component C in is equal to or greater than a preset threshold value may be determined to be a false color (purple fringe). In this way, if C in (x, y) is determined to be a false color (purple fringe) pixel, the process proceeds to step S706, and if it is determined not to be a false color (purple fringe), the process proceeds to step S705.

ステップS705においては、偽色領域マスクP(x,y)をfalseに設定し、ステップS706に進む。すなわち、先のステップS502(図16)の処理においては、偽色の可能性があるとして偽色領域マスクP(x,y)=trueであったものを、偽色でないとの最終判断に基づいて、偽色領域マスクP(x,y)=falseに変更(更新)するものである。   In step S705, the false color area mask P (x, y) is set to false, and the process proceeds to step S706. That is, in the process of the previous step S502 (FIG. 16), the false color area mask P (x, y) = true is assumed to be a false color, based on the final determination that it is not a false color. Thus, the false color area mask P (x, y) is changed (updated) to false.

すなわち、図20において説明している処理では、先のステップS502(図16)の処理において偽色の可能性のある画素から、色判定によって最終的に偽色であると判定される画素のみを選別し、偽色領域マスクP(x,y)を更新する。   That is, in the processing described in FIG. 20, only pixels that are finally determined to be false color by color determination from pixels that may be false color in the processing of the previous step S502 (FIG. 16). The false color area mask P (x, y) is updated by sorting.

ステップS706〜S709は、xおよびyの値の更新処理および最大値x=w、y=hであるか否かの判定処理である。順次xおよびyの値の更新を行いながら、処理対象画像(x=0〜w,y=0〜h)の全画素について偽色領域マスクP(i,j)の値を決定し、偽色領域マスクP(i,j)を生成する。画像中のすべての画素(x,y)が処理されたと判別されると、図16のステップS503の偽色画素検出処理は終了する。   Steps S <b> 706 to S <b> 709 are a process for updating the values of x and y and a process for determining whether or not the maximum values x = w and y = h. While sequentially updating the values of x and y, the values of the false color region mask P (i, j) are determined for all the pixels of the processing target image (x = 0 to w, y = 0 to h), and the false color is determined. A region mask P (i, j) is generated. When it is determined that all the pixels (x, y) in the image have been processed, the false color pixel detection process in step S503 in FIG. 16 ends.

次に、図16に示すステップS504の偽色画素補正処理について説明する。ステップS503では、上述したように偽色(パープルフリンジ)であると判別された画素を識別する偽色領域マスクPが生成された。次のステップS504では、偽色(パープルフリンジ)であると判別された画素の色を、その周囲の画素の画素値に基づく穴埋め繰り返し処理によって補間する処理を実行する。   Next, the false color pixel correction process in step S504 shown in FIG. 16 will be described. In step S503, a false color area mask P for identifying pixels determined to be false colors (purple fringes) as described above is generated. In the next step S504, a process of interpolating the color of the pixel determined to be a false color (purple fringe) by the hole filling repetition process based on the pixel values of the surrounding pixels is executed.

図22(A),図22(B)は、図16に示すステップS504の偽色画素補正処理を説明するための模式図である。図22(A)に示されるように、ステップS503までの処理ですべての画素は、「白とび画素651」、「偽色(パープルフリンジ)画素652」、「白とびでもパープルフリンジでもないその他の画素653」のいずれかに分類される。   22A and 22B are schematic diagrams for explaining the false color pixel correction processing in step S504 shown in FIG. As shown in FIG. 22A, in the processing up to step S503, all the pixels are “whiteout pixels 651”, “false color (purple fringe) pixels 652”, “others that are neither whiteout nor purple fringe”. The pixel is classified into one of “pixels 653”.

穴埋め繰り返し処理の最初のステップでは、画像中の各画素をスキャンし、もし、偽色(パープルフリンジ)画素652(位置(x,y))が、白とびでもパープルフリンジでもないその他の画素653に隣接する場合、例えば周囲の8近傍画素にその他の画素653が存在する場合、隣接するその他の画素653の画素の色成分Cの平均値を新たな画素の色成分C(x,y)として設定する。   In the first step of the hole filling iterative process, each pixel in the image is scanned, and if the false color (purple fringe) pixel 652 (position (x, y)) is not another white or purple fringe pixel 653 When adjacent, for example, when there are other pixels 653 in the surrounding eight neighboring pixels, the average value of the color components C of the other adjacent pixels 653 is set as the color component C (x, y) of the new pixel. To do.

このように、偽色(パープルフリンジ)画素652をその他の画素653によって画素値を設定する処理を、すべての画素に対して一回行うと、図22(B)のように、その他の画素653に隣接する偽色(パープルフリンジ)画素652の色成分が補間され、補間済み偽色(パープルフリンジ)画素654として設定される。   In this way, when the process of setting the pixel value of the false color (purple fringe) pixel 652 by the other pixels 653 is performed once for all the pixels, the other pixels 653 are obtained as shown in FIG. The color component of the false color (purple fringe) pixel 652 adjacent to is interpolated and set as an interpolated false color (purple fringe) pixel 654.

さらに、次の穴埋め繰り返し処理では、その他の画素653または補間済み偽色(パープルフリンジ)画素654に隣接する偽色(パープルフリンジ)画素652の色成分を、その他の画素653と補間済み偽色(パープルフリンジ)画素654に基づいて同様に補間する。このような繰り返し処理を、固定の回数繰り返す。この処理によって、偽色(パープルフリンジ)画素652は、図22(B)の矢印670の方向に、順次補間済み偽色(パープルフリンジ)画素654として設定されることになる。このような繰り返し処理を、固定の回数繰り返した後でも、色成分が補間されない偽色(パープルフリンジ)画素652が存在する場合は、周りの画素からの色補間は不可能と判断し、それらの画素の色の彩度を一律に落とす処理を施す。   Further, in the next iterative filling process, the color component of the false color (purple fringe) pixel 652 adjacent to the other pixel 653 or the interpolated false color (purple fringe) pixel 654 is replaced with the other pixel 653 and the interpolated false color ( Purple fringing) Interpolate in the same manner based on pixel 654. Such repeated processing is repeated a fixed number of times. By this processing, the false color (purple fringe) pixel 652 is sequentially set as an interpolated false color (purple fringe) pixel 654 in the direction of the arrow 670 in FIG. If there is a false color (purple fringe) pixel 652 in which the color component is not interpolated even after repeating such a repetition process a fixed number of times, it is determined that color interpolation from surrounding pixels is impossible. A process is performed to uniformly reduce the saturation of the pixel color.

このように、図16に示すステップS504の偽色画素補正処理は、ステップS503において、偽色(パープルフリンジ)と判定された画素の画素値を、周囲の白とび以外の画素に基づいて設定する処理、すなわち、穴埋め繰り返し処理である。この処理によって補間されない残存する偽色(パープルフリンジ)画素652については彩度低下処理を施す。   As described above, the false color pixel correction processing in step S504 shown in FIG. 16 sets the pixel value of the pixel determined to be false color (purple fringe) in step S503 based on the surrounding pixels other than overexposure. This is a process, that is, a hole filling repeated process. The remaining false color (purple fringe) pixels 652 that are not interpolated by this processing are subjected to saturation reduction processing.

ステップS504の偽色画素補正処理の詳細について、図23および図24の処理フローを参照して説明する。図23および図24の処理フローにおいて、図23に示すステップS751からS765までは、偽色(パープルフリンジ)画素の色成分の穴埋め処理であり、図24に示すステップS766からS773までの処理は、穴埋めできなかった画素の彩度を低下させる処理である。   Details of the false color pixel correction processing in step S504 will be described with reference to the processing flows in FIGS. In the processing flow of FIGS. 23 and 24, steps S751 to S765 shown in FIG. 23 are hole filling processing of color components of false color (purple fringe) pixels, and the processing from steps S766 to S773 shown in FIG. This is a process for reducing the saturation of pixels that could not be filled.

図23のフローから順に説明する。まず、ステップS751において、図16のステップS503の偽色画素検出処理において生成した偽色領域マスクPの内容を、同等の大きさの2値マスクP"にコピーする。例えば、
偽色領域マスクP=true→2値マスクP"=true(1)
偽色領域マスクP=false→2値マスクP"=false(0)
である。
Description will be made sequentially from the flow of FIG. First, in step S751, the content of the false color area mask P generated in the false color pixel detection process in step S503 of FIG. 16 is copied to a binary mask P ″ having an equivalent size.
False color area mask P = true → binary mask P ″ = true (1)
False color area mask P = false → binary mask P ″ = false (0)
It is.

ステップS752においては、穴埋め処理の繰り返し回数を示す変数tの値を0にセットする。ステップS753においては、2値マスクP"の値を、また別の同等の大きさの2値マスクP'にコピーする。なお、これらのマスクP"、P'は、繰り返し処理により減ってゆく偽色(パープルフリンジ)画素652の位置を保存するために用いる一時的なマスク画像である。   In step S752, the value of variable t indicating the number of repetitions of the hole filling process is set to zero. In step S753, the value of the binary mask P ″ is copied to another equivalent size binary mask P ′. These masks P ″ and P ′ are false values that are reduced by the iterative process. This is a temporary mask image used to store the position of the color (purple fringe) pixel 652.

次に、ステップS754、S755において、処理対象画素位置座標を表す変数x,yの初期化を行い、x=0,y=0とする。次のステップS756では、2値マスクP'(x,y)の値を判別する。2値マスクP'(x,y)=falseである場合、すなわち、処理対象画素が偽色画素でない場合、ステップS760に進む。2値マスクP'(x,y)=trueである場合、すなわち、処理対象画素が偽色画素である場合、ステップS757へ進む。   Next, in steps S754 and S755, variables x and y representing the processing target pixel position coordinates are initialized, and x = 0 and y = 0. In the next step S756, the value of the binary mask P ′ (x, y) is determined. If the binary mask P ′ (x, y) = false, that is, if the pixel to be processed is not a false color pixel, the process proceeds to step S760. If the binary mask P ′ (x, y) = true, that is, if the processing target pixel is a false color pixel, the process proceeds to step S757.

ステップS757においては、画素(x,y)に隣接する画素に、2値マスクP'=falseかつ、白とびマスクS=falseの画素があるかどうか判別する。すなわち、偽色画素でも白とび画素でもない画素があるかどうか判別する。このような条件を満足する画素が画素(x,y)に隣接する画素に存在しないと判別された場合は、ステップS760に進む。   In step S757, it is determined whether or not a pixel adjacent to the pixel (x, y) has a binary mask P ′ = false and a whiteout mask S = false. That is, it is determined whether there is a pixel that is neither a false color pixel nor a whiteout pixel. If it is determined that no pixel satisfying such a condition exists in a pixel adjacent to the pixel (x, y), the process proceeds to step S760.

偽色画素でも白とび画素でもない画素が、画素(x,y)に隣接する画素として存在すると判別された場合は、ステップS758へ進む。ステップS758では、2値マスクP'=falseかつ、白とびマスクS=false、すなわち偽色画素でも白とび画素でもない画素であり、かつ画素(x,y)に隣接している1以上の画素の色成分Cの平均値を算出し、座標(x,y)の色成分C(x,y)に設定する。すなわち、画素(x,y)の画素値として設定する。この補間処理によっては、図22(b)の補間済み偽色(パープルフリンジ)画素654が設定される。   If it is determined that a pixel that is neither a false color pixel nor a whiteout pixel exists as a pixel adjacent to the pixel (x, y), the process proceeds to step S758. In step S758, the binary mask P ′ = false and the whiteout mask S = false, that is, one or more pixels that are neither false-color pixels nor whiteout pixels and are adjacent to the pixel (x, y). The average value of the color component C is calculated and set to the color component C (x, y) at the coordinates (x, y). That is, it is set as the pixel value of the pixel (x, y). By this interpolation processing, the interpolated false color (purple fringe) pixel 654 shown in FIG. 22B is set.

この処理の後、ステップS759へ進む。ステップS759においては、2値マスクP"(x,y)の値をfalseとする。すなわち、偽色画素から、補間済み偽色画素へ変更された画素を2値マスクP"(x,y)において、偽色画素でない画素として識別可能な設定とする。   After this process, the process proceeds to step S759. In step S759, the value of the binary mask P ″ (x, y) is set to false. That is, the pixel changed from the false color pixel to the interpolated false color pixel is represented by the binary mask P ″ (x, y). In FIG. 5, the setting is such that it can be identified as a pixel that is not a false color pixel.

ステップS760〜S763は、処理画素の座標更新および最大値判定処理であり、ステップS760においては、x座標の値を1増やす。次のステップS761において、x>w−1(wは入力画像の幅)であるかどうかの判別をする。x>w−1であると判定された場合はステップS762へ進み、x>w−1でないと判定された場合は、ステップS756へ進む。   Steps S760 to S763 are processing pixel coordinate update and maximum value determination processing. In step S760, the value of the x coordinate is incremented by one. In the next step S761, it is determined whether or not x> w−1 (w is the width of the input image). If it is determined that x> w−1, the process proceeds to step S762. If it is determined that x> w−1 is not satisfied, the process proceeds to step S756.

ステップS762では、y座標を1増やし、次のステップS763で、y座標の最大値であるh−1(hは入力画像の高さ)との比較を行う。y>h−1である場合は、ステップS764へ進み、y>h−1でないと判定した場合はステップS755へ進む。   In step S762, the y coordinate is incremented by 1, and in the next step S763, a comparison is made with h-1 (h is the height of the input image) which is the maximum value of the y coordinate. If y> h-1, the process proceeds to step S764, and if it is determined that y> h-1, the process proceeds to step S755.

ステップS764では、繰り返し処理の回数を表すtを1増やす。ステップS765においては、繰り返し回数tが、あらかじめ定めた値tmax以上かどうかを判別する。また同時にマスク画像P"の内trueの値を持つ画素の個数が0かどうかを判別する。すなわち、穴埋め補間処理によって補間が終了していない偽色画素の個数が0になったか否かを判定する。以上の2つの条件のいずれかが真であると判別された場合は、ステップS766に進む。またいずれも偽と判断された場合は、ステップS753に戻り、再び穴埋め処理を行う。   In step S764, t representing the number of repetition processes is incremented by one. In step S765, it is determined whether the number of repetitions t is equal to or greater than a predetermined value tmax. At the same time, it is determined whether or not the number of pixels having a true value in the mask image P ″ is 0. That is, it is determined whether or not the number of false color pixels that have not been interpolated by the hole-filling interpolation processing has become 0. If it is determined that either of the above two conditions is true, the process proceeds to step S766, and if both are determined to be false, the process returns to step S753 to perform the filling process again.

ステップS765において、繰り返し回数tが、あらかじめ定めた値tmax以上となったか、あるいは、穴埋め補間処理によって補間が終了していない偽色画素の個数が0になったか、いずれかが真と判定されると、図24のステップS766に進む。   In step S765, it is determined that either the number of repetitions t is equal to or greater than a predetermined value tmax, or the number of false color pixels that have not been interpolated by the hole-filling interpolation processing has become zero. Then, the process proceeds to step S766 in FIG.

ステップS766、S767においては、処理対象画素の座標を表す変数x,yの初期化を行い、x=0,y=0とする。次のステップS768では、2値マスクP"の(x,y)における値がtrueかどうかを判別する。すなわち、処理対象画素が偽色画素であるかどうかを判別する。2値マスクP"(x,y)=trueである場合、すなわち偽色画素である場合は、ステップS769に進み、2値マスクP"(x,y)=falseである場合、すなわち偽色画素でない場合は、ステップS770に進む。   In steps S766 and S767, variables x and y representing the coordinates of the pixel to be processed are initialized so that x = 0 and y = 0. In the next step S768, it is determined whether or not the value at (x, y) of the binary mask P ″ is true. That is, it is determined whether or not the pixel to be processed is a false color pixel. The binary mask P ″ ( If x, y) = true, that is, if it is a false color pixel, the process proceeds to step S769. If the binary mask P ″ (x, y) = false, that is, if it is not a false color pixel, step S770. Proceed to

処理対象画素が偽色画素である場合は、ステップS769において、画素(x,y)の色成分C(x,y)の彩度を低下させる彩度低下処理を施す。例えばL表色系を用いている場合は、a,bの各成分の値に対して、1.0以下0.0以上の定数を掛け合わせることにより、一律に彩度を減少させることが出来る。ステップS769の彩度低下処理を終了すると、ステップS770に進む。ステップS770においては、x座標の値を1増やす。次のステップS771において、x>w−1であるかどうかの判別をする。x>w−1であると判別されればステップS772へ、x>w−1でないと判別されればステップS768へ進み、x座標を更新した隣接画素について同様の処理を繰り返す。 If the pixel to be processed is a false color pixel, a saturation reduction process is performed in step S769 to reduce the saturation of the color component C (x, y) of the pixel (x, y). For example, when the L * a * b * color system is used, the values of each component of a * and b * are uniformly colored by multiplying a constant of 1.0 or less and 0.0 or more. The degree can be reduced. When the saturation reduction process in step S769 ends, the process proceeds to step S770. In step S770, the value of the x coordinate is increased by one. In the next step S771, it is determined whether or not x> w-1. If it is determined that x> w−1, the process proceeds to step S772, and if it is not determined that x> w−1, the process proceeds to step S768, and the same processing is repeated for the adjacent pixel whose x coordinate is updated.

ステップS771において、x>w−1であると判定された場合は、x座標の最大値に達しており、ステップS772へ進み、y座標を1増やし、次のステップS773で、y座標の最大値であるh−1との比較を行う。y>h−1でない場合はステップS767へ進み、更新したy座標を持つ画素について同様の処理を繰り返す。ステップS773において、y>h−1であると判定すると、偽色画素補正処理を終了する。以上の処理によって図16に示すステップS504の偽色画素補正処理を終了する。   If it is determined in step S771 that x> w−1, the maximum value of the x coordinate has been reached, the process proceeds to step S772, the y coordinate is incremented by 1, and the maximum value of the y coordinate is determined in the next step S773. Comparison with h-1 is performed. If not y> h−1, the process proceeds to step S767, and the same processing is repeated for the pixel having the updated y coordinate. If it is determined in step S773 that y> h-1, the false color pixel correction process is terminated. The false color pixel correction process in step S504 shown in FIG.

ステップS504の偽色画素補正処理を終了すると、次に、ステップS505の色ぼかし処理(フィルタリング)を実行する。ステップS504では、穴埋め処理の繰り返しにより、偽色(パープルフリンジ)画素の色を補間し、穴埋めし切れなかった偽色(パープルフリンジ)画素については、彩度を低下させる処理を行った。しかし、ステップS504の処理を施した偽色(パープルフリンジ)部分には、色が比較的急に変化する部分が発生してしまう可能性がある。ステップS505の色ぼかし処理(フィルタリング)では、この急な色変化を緩和するために、ぼかしフィルタをかける処理を行う。   When the false color pixel correction process in step S504 is completed, the color blurring process (filtering) in step S505 is performed. In step S504, the color of the false color (purple fringe) pixel is interpolated by repeating the hole filling process, and the process of reducing the saturation is performed on the false color (purple fringe) pixel that is not completely filled. However, in the false color (purple fringe) portion subjected to the processing in step S504, there is a possibility that a portion where the color changes relatively abruptly occurs. In the color blurring process (filtering) in step S505, a blurring filter is applied to alleviate this sudden color change.

ステップS505の色ぼかし処理(フィルタリング)の詳細について、図25の処理フローを参照して説明する。まず、ステップS801において、色ぼかし処理(フィルタリング)の繰り返し回数を示す変数tの値を0にセットする。次に、ステップS802では、先のステップS504の偽色画素補正処理で更新された色成分画像Cを、同等の大きさの色成分画像C'にコピーする。   Details of the color blurring process (filtering) in step S505 will be described with reference to the process flow of FIG. First, in step S801, the value of a variable t indicating the number of repetitions of color blurring processing (filtering) is set to zero. Next, in step S802, the color component image C updated by the false color pixel correction process in the previous step S504 is copied to the color component image C ′ having the same size.

次に、ステップS803、S804において、処理対象画素の座標を表す変数x,yの初期化を行い、x=0,y=0とする。次のステップS805では、偽色領域マスクP(x,y)の値を判別する。偽色領域マスクP(x,y)=falseである場合、すなわち、偽色画素ではない場合は、ステップS807に進む。偽色領域マスクP(x,y)=true、すなわち偽色画素である場合は、ステップS806へ進む。   Next, in steps S803 and S804, variables x and y representing the coordinates of the processing target pixel are initialized, and x = 0 and y = 0. In the next step S805, the value of the false color area mask P (x, y) is determined. If the false color area mask P (x, y) = false, that is, if it is not a false color pixel, the process proceeds to step S807. If the false color area mask P (x, y) = true, that is, if it is a false color pixel, the process proceeds to step S806.

なお、偽色領域マスクP(x,y)は、先のステップS503の偽色画素検出処理(図20の処理フローに対応)によって色(画素値)判定に基づいて偽色と判定された画素をtrueとして設定したマスクであり、先のステップS504の偽色画素補正処理によって補正された偽色画素領域についても、trueの値を維持しているマスクデータである。この色ぼかし処理(フィルタリング)処理に偽色領域マスクP(x,y)を適用するため、ステップS504の偽色画素補正処理においては、偽色領域マスクP(x,y)のコピーマスクP"を適用した。   The false color area mask P (x, y) is a pixel determined to be a false color based on the color (pixel value) determination by the false color pixel detection process (corresponding to the process flow of FIG. 20) in the previous step S503. Is set as true, and the false color pixel region corrected by the false color pixel correction processing in the previous step S504 is also mask data maintaining the value of true. In order to apply the false color area mask P (x, y) to this color blurring process (filtering) process, in the false color pixel correction process in step S504, a copy mask P "of the false color area mask P (x, y) is used. Applied.

図25の色ぼかし処理(フィルタリング)の処理についての説明を続ける。ステップS805において、偽色領域マスクP(x,y)=true、すなわち偽色画素である場合は、ステップS806へ進み、ステップS806では、色成分にぼかしフィルタを適用する。これは、色成分画像C'における画素(x,y)の色成分を示す画素値C(x,y)の値を周囲の画素の色成分を示す画素値C'に基づいて更新する処理である。例えば、処理対象画素(x,y)と、その周囲の8画素を合わせた9画素の色成分C'の平均値を求め、これを処理対象画素(x,y)の更新画素値C(x,y)として設定する移動平均フィルタを施す。   The description of the color blurring process (filtering) in FIG. 25 will be continued. If it is determined in step S805 that the false color area mask P (x, y) = true, that is, a false color pixel, the process proceeds to step S806, and in step S806, a blur filter is applied to the color component. This is a process of updating the value of the pixel value C (x, y) indicating the color component of the pixel (x, y) in the color component image C ′ based on the pixel value C ′ indicating the color component of the surrounding pixels. is there. For example, an average value of nine color components C ′ including the processing target pixel (x, y) and the surrounding eight pixels is obtained, and this is used as the updated pixel value C (x of the processing target pixel (x, y). , Y) apply a moving average filter set.

ステップS806のぼかしフィルタ適用処理を終了すると、ステップS807〜S810において処理対象画素の座標更新および最大値確認を行なう。ステップS807においては、x座標の値を1増やす。次のステップS808において、x>w−1であるかどうかの判別をする。x>w−1であると判定された場合はステップS808へ、x>w−1でないと判定された場合はステップS804へ戻り、x座標を更新した画素について同様の処理を実行し必要に応じたぼかし処理を実行する。   When the blur filter application process in step S806 ends, the coordinates of the processing target pixel are updated and the maximum value is confirmed in steps S807 to S810. In step S807, the value of the x coordinate is increased by one. In the next step S808, it is determined whether or not x> w-1. If it is determined that x> w−1, the process returns to step S808. If it is determined that x> w−1 is not satisfied, the process returns to step S804, and the same processing is performed on the pixel whose x coordinate has been updated. Execute blur processing.

ステップS808において、x>w−1であると判定された場合はステップS809に進み、y座標を1増やし、次のステップS810で、y座標の最大値であるh−1との比較を行う。y>h−1でないと判定された場合はステップS804へ進み、更新したy座標を持つ画素について同様の処理を実行し必要に応じたぼかし処理を実行する。   If it is determined in step S808 that x> w−1, the process proceeds to step S809, where the y coordinate is incremented by 1, and in the next step S810, comparison is made with h−1 which is the maximum value of the y coordinate. If it is determined that y> h−1 is not satisfied, the process proceeds to step S804, and the same process is performed on the pixel having the updated y coordinate, and the blurring process is performed as necessary.

ステップS810において、y>h−1であると判定されると、ステップS811へ進む。ステップS811では、色ぼかし処理(フィルタリング)の繰り返し回数tを1増やす処理をし、次のステップS812で、繰り返し回数tがあらかじめ定めた閾値t'max以上かどうかを判別する。t<t'maxである場合は、ステップS802へ戻り、t≧t'maxである場合は、色ぼかし処理(フィルタリング)を終了する。   If it is determined in step S810 that y> h-1, the process proceeds to step S811. In step S811, a process of increasing the number of repetitions t of the color blurring process (filtering) by 1 is performed, and in the next step S812, it is determined whether or not the number of repetitions t is equal to or greater than a predetermined threshold value t′max. If t <t′max, the process returns to step S802. If t ≧ t′max, the color blurring process (filtering) ends.

以上の処理によって、図2の総合処理フローにおけるステップS14の穴埋め法に基づく画像補正処理が終了する。   With the above processing, the image correction processing based on the hole filling method in step S14 in the overall processing flow of FIG.

次に、図2の総合処理フローにおけるステップS15では、ステップS14において縮小画像に対する穴埋め法で補正した部分を、オリジナルの入力画像に反映させる処理を行うこの処理は、前述した平均法に基づく補正画像に対する拡大処理、すなわち、図2に示すステップS13の拡大処理と同様の手法が適用される。具体的には、図15を参照して説明した手法とほぼ同様の手法となる。   Next, in step S15 in the overall processing flow of FIG. 2, this process of performing the process of reflecting the portion corrected by the hole filling method for the reduced image in step S14 in the original input image is performed by the correction image based on the above-described averaging method. A method similar to the enlargement process for step S13, that is, the enlargement process in step S13 shown in FIG. Specifically, the method is almost the same as the method described with reference to FIG.

ただし、図15のステップS401、S402が穴埋め法の結果と置き換えることになる。全体の流れとしては、ブレンド比画像を生成し、ステップS14で生成した補正画像に対する拡大処理を実行して得られる画像データと、撮影画像データとしてのオリジナル画像データとをブレンドして、拡大画像データを生成する。   However, steps S401 and S402 in FIG. 15 are replaced with the result of the hole filling method. As an overall flow, image data obtained by generating a blend ratio image and executing enlargement processing on the corrected image generated in step S14 and original image data as captured image data are blended to obtain enlarged image data. Is generated.

図15を参照して各ステップの処理について説明する。まず、ステップS401において、ブレンド比画像B(x,y)を設定する。ブレンド比画像B(x,y)は、オリジナル画像と同様の画素数(H×W)からなり、各画素に対応して0〜1のブレンド比が設定された画像である。ブレンド比画像B(x,y)は、ステップS14で算出された偽色領域マスクPを基準にして生成される。偽色領域マスクPは、縮小画像上で各画素毎に偽色であるか否かを表わす2値のマスクである。ここで、偽色領域マスクPがtrueの画素は1.0、falseの画素は0.0の値をとる画像を作成し、この画像を拡大する処理を行う。すなわち前述のbilinear補間などにより拡大処理を行い、オリジナル画像と同様の画素数(H×W)にする。この拡大画像の画素値は、偽色領域マスクPがtrueだった部分は1.0、falseだった部分は0.0、trueとfalseが遷移する部分では、0.0から1.0の間の値を取るような画像となる。次に、この拡大した画像の各画素値に対し0から1の定数を乗算することにより、最終結果に対する穴埋め法補正結果の寄与率を変更することができる。すなわち、弱めに補正をかけたいときなど、小さめの値の定数を各画素に乗算することにより、最終結果画像における穴埋め法補正結果の寄与率を下げることができる。この0から1の定数は、ユーザによる設定、あるいは予め定められた値を用いる。このようにして偽色(PF)度合いを拡大したものを基に算出された画像をブレンド比画像B(x,y)とする。 Processing of each step will be described with reference to FIG. First, in step S401, a blend ratio image B L (x, y) is set. The blend ratio image B L (x, y) is an image having the same number of pixels (H L × W L ) as the original image, and a blend ratio of 0 to 1 is set corresponding to each pixel. The blend ratio image B L (x, y) is generated with reference to the false color area mask P calculated in step S14. The false color area mask P is a binary mask indicating whether or not each pixel has a false color on the reduced image. Here, an image having a value of 1.0 for a pixel with a false color area mask P of true and a value of 0.0 for a false pixel is created, and the image is enlarged. In other words, enlargement processing is performed by the above-described bilinear interpolation or the like, so that the number of pixels (H L × W L ) is the same as that of the original image. The pixel value of this enlarged image is 1.0 when the false color area mask P is true, 0.0 when false, and between 0.0 and 1.0 when true and false transition. It becomes an image that takes the value of. Next, by multiplying each pixel value of the enlarged image by a constant from 0 to 1, it is possible to change the contribution ratio of the hole filling method correction result to the final result. That is, when the correction is made weakly, by multiplying each pixel by a constant having a smaller value, the contribution ratio of the filling method correction result in the final result image can be lowered. As the constants from 0 to 1, a value set by the user or a predetermined value is used. An image calculated based on an image obtained by expanding the degree of false color (PF) in this way is defined as a blend ratio image B L (x, y).

ステップS402では、ステップS14で生成した穴埋め法による補正画像を拡大し、色情報C(x,y)を持つ拡大画像を得る。拡大手法は、前述したbilinear補間による拡大処理などが適用される。この処理により、穴埋め法による補正処理を施した縮小画像データ、すなわち、低解像度画像データを、オリジナルの入力画像と同等の解像度(幅W、高さH)に拡大し、拡大画像C(x,y)を得る。 In step S402, the corrected image generated by the hole filling method generated in step S14 is enlarged to obtain an enlarged image having color information C L (x, y). As the enlargement method, the above-described enlargement process using bilinear interpolation is applied. By this processing, the reduced image data subjected to the correction processing by the hole filling method, that is, the low resolution image data is enlarged to the same resolution (width W L , height H L ) as the original input image, and the enlarged image C L (X, y) is obtained.

次に、ステップS403以下において、拡大処理の結果画像データの構成画素毎の色情報Cnew(x,y)を決定する。まず、ステップS403、S404において、画素数(H×W)からなる拡大画像の処理画素(x,y)の初期設定としてy=0,x=0の設定を行う。 Next, in step S403 and subsequent steps, color information C new (x, y) is determined for each constituent pixel of the image data as a result of the enlargement process. First, in steps S403 and S404, y = 0 and x = 0 are set as initial settings of the processing pixel (x, y) of the enlarged image having the number of pixels (H L × W L ).

次にステップS405において、拡大画像の処理画素(x,y)の色情報Cnew(x,y)を決定する。色情報の決定処理は、下記式(式9)、すなわち、
new(x,y)=B(x,y)×C(x,y)+(1−B(x,y))×Corg(x,y) ・・・(式9)
に従って求める。
In step S405, the color information C new (x, y) of the processing pixel (x, y) of the enlarged image is determined. The color information determination process is the following formula (formula 9), that is,
C new (x, y) = B L (x, y) × C L (x, y) + (1−B L (x, y)) × C org (x, y) (Equation 9)
Ask according to.

上記式(式9)は、前述した式(式8)と同様の式であり、各画素毎に0〜1の範囲の値が設定されたブレンド比画像B(x,y)に基づいて決定されるブレンド比に応じて、オリジナルの入力画像とステップS14で生成した穴埋め法による補正画像とをブレンドして、拡大画像の処理画素(x,y)の色情報Cnew(x,y)を決定するものである。ブレンド比画像B(x,y)は、穴埋め法による補正の偽色領域マスクPを基に算出された画像である。これを用いて、オリジナル画像と穴埋め法の結果をブレンドすると、オリジナル画像において補正がなされた部分のみ、すなわち偽色が発生していた部分だけ、の色情報を更新することが出来る。このため、ステップS14において補正がなされなかった部分は、オリジナルの画像がそのまま結果として使われるため、画像が劣化することは無い。 The above formula (formula 9) is the same formula as the formula (formula 8) described above, and is based on the blend ratio image B L (x, y) in which a value in the range of 0 to 1 is set for each pixel. According to the determined blend ratio, the original input image and the correction image generated by the hole filling method generated in step S14 are blended, and the color information C new (x, y) of the processing pixel (x, y) of the enlarged image. Is to determine. The blend ratio image B L (x, y) is an image calculated based on the false color region mask P corrected by the hole filling method. By using this to blend the original image and the result of the hole filling method, it is possible to update the color information of only the corrected part of the original image, that is, only the part where the false color has occurred. For this reason, since the original image is used as it is for the portion that has not been corrected in step S14, the image does not deteriorate.

上記式(式9)に従った算出処理に従って、1つの注目画素(x,y)の色情報Cnew(x,y)が決定される。1つの注目画素(x,y)の画素値が決定すると、ステップS406〜S409において、処理対象画像(幅W画素、高さH画素)の範囲における座標更新を実行して、ステップS405に示す算出式、すなわち上記式(式9)に従ってすべての画素、すなわちオリジナル入力画像と同等の解像度(幅W、高さH)の全画素の画素値決定処理を繰り返し実行する。 The color information C new (x, y) of one target pixel (x, y) is determined according to the calculation process according to the above formula (formula 9). When the pixel value of one target pixel (x, y) is determined, in steps S406 to S409, coordinate update in the range of the processing target image (width W L pixel, height H L pixel) is executed, and step S405 is performed. The pixel value determination process for all pixels, that is, all pixels having the same resolution (width W L , height H L ) as the original input image is repeatedly executed according to the calculation formula shown, that is, the above formula (formula 9).

この処理によって、縮小画像に対して実行した穴埋め法に基づく補正画像データの拡大処理が終了する。なお、オリジナルの入力画像とステップS14で生成した穴埋め法による補正画像とをブレンドして生成した拡大画像、すなわち図2に示す総合処理フローのステップS15において生成した拡大画像は、先のステップS13の拡大処理によって生成する拡大画像[Cavgnew(x,y)]と区別して[Cholenew(x,y)]とする。 With this process, the enlargement process of the corrected image data based on the hole filling method performed on the reduced image is completed. The enlarged image generated by blending the original input image and the correction image generated by the hole filling method generated in step S14, that is, the enlarged image generated in step S15 of the overall processing flow shown in FIG. This is distinguished from the enlarged image [C avgnew (x, y)] generated by the enlargement process, and is defined as [C holenew (x, y)].

ここまでで図2に示す総合処理フローのステップS15までの処理が完了し、縮小画像に対する平均法に基づく画像補正処理を施した結果を拡大した第1の補正画像データと、縮小画像に対する穴埋め法に基づく画像補正処理を施した結果を拡大した第2の補正画像データとが得られたことになる。図2に示す総合処理フローのステップS16では、これら2つの補正画像データのブレンド処理を実行して、最終的な補正画像を生成する。   The processing up to step S15 in the overall processing flow shown in FIG. 2 is completed so far, and the first corrected image data obtained by enlarging the result of performing the image correction processing based on the average method for the reduced image, and the hole filling method for the reduced image Thus, the second corrected image data obtained by enlarging the result of the image correction processing based on the above is obtained. In step S16 of the overall processing flow shown in FIG. 2, a blend process of these two corrected image data is executed to generate a final corrected image.

穴埋め法、平均法それぞれによる補正結果画像データは、それぞれ特徴がある。穴埋め法による補正結果画像は、穴埋めによる補間により、ほとんどのパープルフリンジ等の偽色は軽減され、パープルフリンジ等の偽色は、周囲のパープルフリンジでない画素の色で補間されるので大きな効果がある。しかし、どの画素がパープルフリンジと判定されるかにより、結果の画像が大きく変わる可能性がある。自動で処理を行う場合、たいていの画像に対しては有効に働くが、ごく一部の画像に対して結果が不自然なものになる可能性がある。   Each of the correction result image data by the hole filling method and the average method has a characteristic. The correction result image by the hole filling method has a large effect because the false color such as purple fringe is reduced by interpolation by the hole filling, and the false color such as purple fringe is interpolated by the color of the surrounding non-purple fringe pixel. . However, the resulting image may vary greatly depending on which pixel is determined to be purple fringe. When processing automatically, it works well for most images, but the result may be unnatural for a small portion of the image.

一方、平均法によるパープルフリンジ等の偽色の補正は、ローパスフィルタをかけた色情報を偽色(PF)度合いに応じて、オリジナル画像の色情報とブレンドする方法であり、結果画像に大きな破綻が起こりにくいという特長がある。しかし、穴埋め法に比べると偽色の補正される効果が低いと言える。   On the other hand, correction of false colors such as purple fringe by the average method is a method of blending color information with low-pass filter with the color information of the original image according to the false color (PF) degree, resulting in a large breakdown in the resulting image It is difficult to occur. However, it can be said that the effect of correcting false colors is low compared to the hole filling method.

図2に示す総合処理フローのステップS15では、これらのそれぞれの特徴を持つ2つの補正画像データをブレンドして最終的な補正画像データを生成する。偽色(PF)度合いpを適用した補正処理によって取得した第1の補正画像Cavgnew(x,y)と、穴埋め補間処理によって算出した第2の補正画像Cholenew(x,y)とのブレンド処理によって、最終的な補正画像データCfinal(x,y)を算出する処理を実行する。 In step S15 of the overall processing flow shown in FIG. 2, the two corrected image data having the respective characteristics are blended to generate final corrected image data. Blend of the first corrected image C Avgnew (x, y) obtained by the correction process using the false color (PF) degree p and, second corrected image C Holenew calculated by filling interpolation and (x, y) By the processing, processing for calculating final corrected image data C final (x, y) is executed.

このブレンド処理は、所定のブレンド比率kを適用して、例えば、以下に示す式、すなわち、
final(x,y)=k×Cavgnew(x,y)+(1−k)×Cholenew(x,y)
に従って算出する。ブレンド比率kは0〜1の範囲で決定する。ブレンド比率をどのような値に設定するかは、それぞれの処理の特徴を踏まえて決定する。例えばより大きな補正を望む場合は、穴埋め法の処理結果の反映比率を大きくする設定とし、また、なるべく破綻のない結果画像を取得したい場合は、偽色(PF)度合いpを適用した補正結果データをより反映するようなブレンド比率kの設定とする。
This blending process is performed by applying a predetermined blending ratio k, for example, the following formula:
C final (x, y) = k × C avgnew (x, y) + (1−k) × C holenew (x, y)
Calculate according to The blend ratio k is determined in the range of 0-1. The value for setting the blend ratio is determined based on the characteristics of each process. For example, when a larger correction is desired, the reflection ratio of the processing result of the hole filling method is set to be large, and when it is desired to obtain a result image with no failure as much as possible, correction result data applying a false color (PF) degree p is applied. The blend ratio k is set so as to reflect more.

以上の処理が、図2に示す総合処理フローの最終ステップであるステップS16の処理として実行される処理である。   The above process is a process executed as the process of step S16 which is the final step of the comprehensive process flow shown in FIG.

このように、本発明の処理においては、ブレンド処理を適用することにより、穴埋め補間処理と、偽色(PF)度合いpを適用した補正処理とのそれぞれの利点を融合した調和された画素値補正が可能となり、パープルフリンジ等の偽色が軽減されるとともに破綻することのない補正画像を取得することが可能となる。結果として、カメラで撮影した画像に起こる色収差によるパープルフリンジ等の偽色に対する適正な補正が可能となり、高品質な画像データの生成、出力を実現することができる。   Thus, in the processing of the present invention, by applying blend processing, harmonized pixel value correction that combines the advantages of hole filling interpolation processing and correction processing using a false color (PF) degree p is achieved. This makes it possible to reduce a false color such as purple fringe and obtain a corrected image that does not fail. As a result, it is possible to appropriately correct false colors such as purple fringes due to chromatic aberration occurring in an image photographed by a camera, and it is possible to generate and output high-quality image data.

次に、図26、図27を参照して、上述した処理を実行する本発明の画像処理装置におけるデジタル信号処理部(DSP)(図1のDSP106に相当)の機能構成について説明する。デジタル信号処理部(DSP)106は、機能的には、図26に示すように、縮小処理部700、偽色(PF)度合いpに基づく画素値補正を実行する平均法処理部710と、穴埋め法に基づく画素値補正処理を実行する穴埋め法処理部720、平均法処理部710の補正結果の拡大処理を実行する第1拡大処理部717、穴埋め法処理部720の補正結果の拡大処理を実行する第2拡大処理部727、両補正結果のブレンド処理を実行するブレンド処理部740とを有する。   Next, a functional configuration of a digital signal processing unit (DSP) (corresponding to the DSP 106 in FIG. 1) in the image processing apparatus of the present invention that executes the above-described processing will be described with reference to FIGS. As shown in FIG. 26, the digital signal processing unit (DSP) 106 functionally includes a reduction processing unit 700, an average method processing unit 710 that performs pixel value correction based on the false color (PF) degree p, and a hole filling process. The hole filling method processing unit 720 that executes pixel value correction processing based on the method, the first enlargement processing unit 717 that executes enlargement processing of the correction result of the average method processing unit 710, and the enlargement processing of the correction result of the hole filling method processing unit 720 are executed. A second enlargement processing unit 727, and a blend processing unit 740 that executes blend processing of both correction results.

平均法処理部710は、白とび距離評価値P算出部711、彩度評価値P算出部712、色相評価値Pθ算出部713、偽色(PF)度合いp算出部714、補間値[Ctmp/Wtotal]算出部715、第1補正画素値[Cavgnew(x,y)]算出部716を有する。 Average method processing unit 710, overexposure distance evaluation value P d calculator 711, a saturation evaluation value P s calculator 712, the hue evaluation value P theta calculator 713, a false color (PF) degree p calculator 714, the interpolation value [C tmp / W total ] calculation unit 715 and first correction pixel value [C avgnew (x, y)] calculation unit 716.

一方、穴埋め法処理部720は、図27に詳細を示すように、白とび検出部721、偽色画素検出領域設定部722、偽色(パープルフリンジ)検出部723、画素値補正部724を有する。画素値補正部724は、偽色(パープルフリンジ)穴埋め補間部725、偽色(パープルフリンジ)ぼかし処理部726から構成される。   On the other hand, the hole filling method processing unit 720 includes a whiteout detection unit 721, a false color pixel detection region setting unit 722, a false color (purple fringe) detection unit 723, and a pixel value correction unit 724, as shown in detail in FIG. . The pixel value correction unit 724 includes a false color (purple fringe) hole filling interpolation unit 725 and a false color (purple fringe) blurring processing unit 726.

まず、図26を参照して平均法処理部710の各構成部の処理について説明する。図26に示すように、デジタル信号処理部(DSP)106は、入力画像フレームメモリ751から処理対象画像フレームを入力する。なお、入力画像は、ここでは、フレームメモリ751からの入力として示すが、フレームメモリを介さず、撮影画像データをデジタル信号処理部(DSP)106に直接入力して処理する構成としてもよい。   First, processing of each component of the averaging method processing unit 710 will be described with reference to FIG. As shown in FIG. 26, the digital signal processing unit (DSP) 106 inputs a processing target image frame from an input image frame memory 751. Here, the input image is shown as an input from the frame memory 751, but the captured image data may be directly input to the digital signal processing unit (DSP) 106 and processed without going through the frame memory.

デジタル信号処理部(DSP)106は、まず、縮小処理部700において、入力画像の縮小処理を実行する。この縮小処理は、図3、図4のフローを参照して説明した処理に従って実行される処理であり、輝度情報と色情報を別々の方法で縮小する。輝度情報の縮小処理においては白とびが失われないように、色情報の縮小処理においてはパープルフリンジ(PF)等の偽色の色データが失われないように考慮して入力画像に対し縮小処理を施す。   First, the digital signal processing unit (DSP) 106 executes a reduction process of the input image in the reduction processing unit 700. This reduction process is a process executed according to the process described with reference to the flowcharts of FIGS. 3 and 4 and reduces the luminance information and the color information by different methods. In order to prevent overexposure in the reduction processing of luminance information, in the reduction processing of color information, reduction processing is performed on the input image in consideration of not losing false color data such as purple fringe (PF). Apply.

次に縮小画像データが、平均法処理部710と、穴埋め法処理部720に入力される。先に図2を参照して説明した処理フローでは、先のステップで平均法に基づく画像補正処理を実行し、その後に穴埋め法に基づく画像補正処理を実行するシーケンスとして説明したが、平均法に基づく画像補正処理と、穴埋め法に基づく画像補正処理とは全く独立した処理であり、並列に処理することが可能である。   Next, the reduced image data is input to the average method processing unit 710 and the hole filling method processing unit 720. In the processing flow described above with reference to FIG. 2, the image correction processing based on the average method is executed in the previous step and then the image correction processing based on the hole filling method is executed. The image correction process based on this and the image correction process based on the hole filling method are completely independent processes, and can be performed in parallel.

まず、平均法処理部710における処理について説明する。平均法処理部710では、縮小処理部700において生成した縮小画像を構成する各画素を1つずつ注目画素(x,y)として選択し、先に図7、図8のフローチャートを参照して説明した処理に従って、注目画素(x,y)に対応する以下の評価値、すなわち、
(a)白とび(高輝度画素)への近さ=白とび距離評価値P
(b)彩度の大きさ=彩度評価値P
(c)偽色に相当する特定色相への近さ=色相評価値Pθ
をそれぞれ白とび距離評価値P算出部711、彩度評価値P算出部712、色相評価値Pθ算出部713において算出する。白とび距離評価値P算出部711における白とび距離評価値P算出処理は、図7、図8のフローにおけるステップS204〜S214の処理によって実行される処理であり、前述の式(式2)によって算出される。
First, the processing in the averaging method processing unit 710 will be described. The averaging method processing unit 710 selects each pixel constituting the reduced image generated by the reduction processing unit 700 as a target pixel (x, y) one by one, and will be described with reference to the flowcharts of FIGS. According to the above processing, the following evaluation value corresponding to the target pixel (x, y), that is,
(A) Closeness to whiteout (high luminance pixel) = whiteout distance evaluation value P d ,
(B) Saturation magnitude = saturation evaluation value P s ,
(C) proximity to a specific hue corresponding to a false color = hue evaluation value P θ ,
Overexposure distance evaluation value P d calculator 711 respectively, chroma evaluation value P s calculation unit 712 calculates the hue evaluation value P theta calculator 713. Overexposure distance evaluation value P d calculation processing in overexposure distance evaluation value P d calculator 711, FIG. 7 is a process to be executed by the processing of steps S204~S214 in the flow of FIG. 8, the above-mentioned formula (Formula 2 ).

彩度評価値P算出部712、色相評価値Pθ算出部713における彩度評価値Pと、色相評価値Pθの算出はステップS215の処理、すなわち、図11を参照して説明したsおよびθの値に基づいて算出され、前述の式(式3)によって色相評価値Pθが算出され、前述の式(式4)によって彩度評価値Pが算出される。 Chroma evaluation value P s calculator 712, a saturation evaluation value P s in hue evaluation value P theta calculator 713, the processing of the calculation step S215 of hue evaluation value P theta, i.e., has been described with reference to FIG. 11 Calculated based on the values of s and θ, the hue evaluation value P θ is calculated by the above-described equation (Equation 3), and the saturation evaluation value P s is calculated by the aforementioned equation (Equation 4).

偽色(PF)度合いp算出部714は、白とび距離評価値P算出部711、彩度評価値P算出部712、色相評価値Pθ算出部713において算出された各評価値に基づいて、注目画素(x,y)の偽色(PF)度合いpを算出する。偽色(PF)度合いpは、前述の式(式5)に従って算出される。 False color (PF) degree p calculating unit 714, based on the evaluation values calculated overexposed distance evaluation value P d calculator 711, a saturation evaluation value P s calculator 712, the hue evaluation value P theta calculator 713 Thus, the false color (PF) degree p of the target pixel (x, y) is calculated. The false color (PF) degree p is calculated according to the above formula (Formula 5).

補間値[Ctmp/Wtotal]算出部715と、第1補正画素値算出部716の処理は、図8のフローにおけるステップS217の処理、すなわち、図13のフローに従った処理を実行する。補間値[Ctmp/Wtotal]算出部715では、注目画素(x,y)の周囲に、補間値算出範囲(x,y,x,y)を設定し、この範囲の構成画素の色情報に基づいて補間処理パラメータとしての重み総和保存変数Wtotalと、色情報補間値保存変数Ctmpとを算出し、補間値[Ctmp/Wtotal]を算出する。この処理は、図13のフローにおけるステップS301〜S309の処理に相当する。 The processes of the interpolation value [C tmp / W total ] calculation unit 715 and the first correction pixel value calculation unit 716 execute the process of step S217 in the flow of FIG. 8, that is, the process according to the flow of FIG. The interpolation value [C tmp / W total ] calculation unit 715 sets an interpolation value calculation range (x 2 , y 2 , x 3 , y 3 ) around the target pixel (x, y), and the configuration of this range Based on the pixel color information, a weight sum storage variable W total and a color information interpolation value storage variable C tmp are calculated as interpolation processing parameters, and an interpolation value [C tmp / W total ] is calculated. This process corresponds to the processes of steps S301 to S309 in the flow of FIG.

第1補正画素値算出部716は、図13のフローにおけるステップS310の処理を実行して、注目画素の平均法に基づく第1補正画素値情報としての色情報C(x,y)を算出する。色情報C(x,y)の算出は、前述の式(式6)に従って実行される。縮小画像を構成する画素に対する第1補正画素値が決定された縮小画像データは、第1拡大処理部717に入力され、拡大処理が実行される。   The first correction pixel value calculation unit 716 executes the process of step S310 in the flow of FIG. 13 to calculate color information C (x, y) as first correction pixel value information based on the average method of the target pixel. . The calculation of the color information C (x, y) is executed according to the above-described equation (Equation 6). The reduced image data for which the first correction pixel value for the pixels constituting the reduced image is determined is input to the first enlargement processing unit 717, and the enlargement process is executed.

第1拡大処理部717では、先に図15を参照して説明した処理フローに従った画像の拡大処理が実行される。すなわち縮小画像上で各画素毎に偽色であるか否かを表わす2値のマスクとして構成される偽色領域マスクPを基準にして0〜1のブレンド比の設定されたブレンド比画像B(x,y)を生成し、生成したブレンド比画像B(x,y)を適用して、平均法による補正画像の拡大画像とオリジナルの入力画像をブレンドして第1の補正画像の拡大画像を生成する。平均法に基づいて画素値の補正された第1の補正拡大画像はブレンド処理部740に出力され、穴埋め法処理部720における補正データに基づく第2の補正拡大画像とのブレンド処理が実行されることになる。 The first enlargement processing unit 717 executes image enlargement processing according to the processing flow described above with reference to FIG. That is, the blend ratio image B L in which a blend ratio of 0 to 1 is set on the basis of the false color area mask P configured as a binary mask indicating whether or not each pixel is a false color on the reduced image. (X, y) is generated, the generated blend ratio image B L (x, y) is applied, and the enlarged image of the corrected image by the average method and the original input image are blended to enlarge the first corrected image. Generate an image. The first corrected enlarged image whose pixel value is corrected based on the averaging method is output to the blend processing unit 740, and the blending process with the second corrected enlarged image based on the correction data in the hole filling method processing unit 720 is executed. It will be.

図27を参照して、穴埋め法処理部720の各構成部の処理について説明する。穴埋め法処理部720は、縮小処理部700において生成された縮小画像データを入力し、縮小画像データに対して穴埋め法に基づく補正処理を実行する。   With reference to FIG. 27, the process of each component of the hole filling method processing unit 720 will be described. The hole filling method processing unit 720 receives the reduced image data generated by the reduction processing unit 700, and executes correction processing based on the hole filling method on the reduced image data.

白とび検出部721は、縮小画像データに基づいて、白とびを起こしている画素部分の検出を実行する。この処理は、図16に示すフローチャートのステップS501に相当する処理であり、その詳細は、図17のフローチャートを参照して説明したように予め定めた輝度閾値以上の輝度を有する画素を白とび画素として検出し、白とび画素を識別する白とびマスクS(x,y)を生成する処理を実行する。   The overexposure detection unit 721 detects a pixel portion causing overexposure based on the reduced image data. This process is a process corresponding to step S501 of the flowchart shown in FIG. 16, and details thereof are described by referring to the flowchart of FIG. And a process of generating a whiteout mask S (x, y) for identifying a whiteout pixel is executed.

偽色画素検出領域設定部722は、白とび検出部721において検出された白とび画素の周囲部分に偽色画素の検出領域を設定する処理を行う。この領域設定処理は、白とびマスクS(x,y)=trueである白とび画素(x,y)の周囲において偽色を発生する可能性がある範囲を算出する処理であり、あらかじめ設定された偽色画素検出領域算定情報を適用する。この処理は、図16に示すフローチャートのステップS502に相当する処理であり、図18に示す処理フローに従って実行される処理である。   The false color pixel detection area setting unit 722 performs a process of setting a false color pixel detection area in the peripheral part of the whiteout pixel detected by the whiteout detection unit 721. This area setting process is a process for calculating a range in which a false color may occur around a whiteout pixel (x, y) where whiteout mask S (x, y) = true. The false color pixel detection area calculation information is applied. This process corresponds to step S502 of the flowchart shown in FIG. 16, and is executed according to the process flow shown in FIG.

偽色画素検出領域設定部722は、例えば、画像上での光学中心から白とび画素(x,y)までの距離と、画像データの撮影時の絞り、焦点距離情報に対応付けられた偽色画素検出領域情報を持つルックアップテーブル(LUT)を適用して、各白とび画素(x,y)の周囲に偽色画素検出領域を設定する。なお、画像データの撮影時の絞り、焦点距離情報等が存在しない場合は、画像上での光学中心から白とび画素(x,y)までの距離のみに基づいて、偽色画素検出領域を決定する構成としてもよく、また、光学中心から白とび画素(x,y)までの距離等の情報についても適用することなく、白とび画素(x,y)の周囲の一定領域を偽色画素検出領域として一律に設定する構成としてもよい。   The false color pixel detection area setting unit 722, for example, the false color associated with the distance from the optical center on the image to the overexposed pixel (x, y), the aperture when photographing the image data, and the focal length information. By applying a look-up table (LUT) having pixel detection area information, a false color pixel detection area is set around each overexposed pixel (x, y). If there is no aperture, focal length information, or the like when photographing image data, the false color pixel detection region is determined based only on the distance from the optical center on the image to the overexposed pixel (x, y). It is also possible to adopt a configuration in which false-color pixel detection is performed on a certain area around a whiteout pixel (x, y) without applying information such as the distance from the optical center to the whiteout pixel (x, y). It is good also as a structure set uniformly as an area | region.

偽色画素検出領域設定部722は、先に図19を参照して説明したように、白とび画素(x,y)601の周囲の偽色画素検出領域の範囲を、(x,x,y,y)の4個のスカラー値として算出し、さらに、この領域において白とび画素を除去した偽色領域マスクPを生成する。 As described above with reference to FIG. 19, the false color pixel detection region setting unit 722 determines the range of the false color pixel detection region around the overexposed pixel (x, y) 601 as (x 0 , x 1). , Y 0 , y 1 ), and a false color area mask P is generated in which whiteout pixels are removed in this area.

偽色(パープルフリンジ)検出部723は、偽色画素検出領域設定部722の設定した偽色領域マスクPを適用し、さらに、各画素の色判定処理によって偽色(パープルフリンジ)と判断される画素を検出する処理を実行する。すなわち、偽色領域マスクPを更新し、補正対象となる偽色画素のみを識別可能な偽色領域マスクPを生成する。この処理は、図16に示すフローチャートのステップS503に相当する処理であり、図20に示す処理フローに従って実行される処理である。前述したように、偽色として認定すべき色の設定は任意であり、特定の色値を持つ紫のみを偽色として設定する構成や、緑、紫など複数の色を偽色として設定する構成などが可能である。   The false color (purple fringe) detection unit 723 applies the false color region mask P set by the false color pixel detection region setting unit 722, and is further determined to be a false color (purple fringe) by the color determination processing of each pixel. A process for detecting a pixel is executed. That is, the false color area mask P is updated to generate a false color area mask P that can identify only the false color pixels to be corrected. This process is a process corresponding to step S503 in the flowchart shown in FIG. 16, and is executed according to the process flow shown in FIG. As described above, the setting of the color to be recognized as a false color is arbitrary, and a configuration in which only purple having a specific color value is set as a false color, or a configuration in which multiple colors such as green and purple are set as false colors Etc. are possible.

偽色(パープルフリンジ)穴埋め補間部725は、偽色(パープルフリンジ)検出部723において偽色と認定された画素についての補正処理であり、図16に示すフローチャートのステップS504に相当する処理であり、図23、図24に示す処理フローに従って実行される処理である。なお、この画素値補正処理には、偽色(パープルフリンジ)と認定された画素について、周囲にある偽色および白とび画素以外の画素値に基づいて実行する穴埋め補間処理(図22、図23参照)と、所定回数の穴埋め補間処理によって補正できなかった偽色(パープルフリンジ)画素の彩度低下処理(図24参照)とが含まれる。   The false color (purple fringe) hole-filling interpolation unit 725 is a correction process for a pixel that is recognized as a false color by the false color (purple fringe) detection unit 723, and is a process corresponding to step S504 of the flowchart shown in FIG. FIG. 23 is a process executed according to the process flow shown in FIG. In this pixel value correction process, a hole filling interpolation process (FIGS. 22 and 23) is executed for a pixel that is recognized as a false color (purple fringe) based on pixel values other than the surrounding false color and overexposed pixels. Reference) and saturation reduction processing (see FIG. 24) of false color (purple fringe) pixels that could not be corrected by a predetermined number of hole-filling interpolation processing.

偽色(パープルフリンジ)ぼかし処理部726は、偽色(パープルフリンジ)穴埋め補間部725の処理によって補正されたデータについてぼかし処理を実行する。図16に示すフローチャートのステップS505に相当する処理であり、図25に示す処理フローに従って実行される処理である。   The false color (purple fringe) blurring processing unit 726 executes blurring processing on the data corrected by the processing of the false color (purple fringe) hole filling interpolation unit 725. This process corresponds to step S505 in the flowchart shown in FIG. 16, and is executed according to the process flow shown in FIG.

偽色(パープルフリンジ)ぼかし処理部726は、偽色(パープルフリンジ)検出部723において偽色と認定された画素を抽出し、色成分にぼかしフィルタを適用し、例えば、処理対象画素(x,y)と、その周囲の8画素を合わせた9画素の色成分の平均値を求め、これを処理対象画素(x,y)の更新画素値として設定する移動平均フィルタ処理を施す。   The false color (purple fringe) blurring processing unit 726 extracts pixels recognized as the false color by the false color (purple fringe) detection unit 723, applies a blurring filter to the color components, and, for example, processes target pixels (x, The average value of the color components of 9 pixels including y) and the surrounding 8 pixels is obtained, and moving average filter processing is performed to set this as the updated pixel value of the processing target pixel (x, y).

偽色(パープルフリンジ)ぼかし処理部726におけるぼかし処理が終了した画像データは、第2拡大処理部727に入力され、拡大処理が実行される。第2拡大処理部727では、先に図15を参照して説明した処理フローに従った画像の拡大処理が実行される。すなわち縮小画像上で各画素毎に偽色であるか否かを表わす2値のマスクとして構成される偽色領域マスクPを基準にして0〜1のブレンド比の設定されたブレンド比画像B(x,y)を生成し、生成したブレンド比画像B(x,y)を適用して、穴埋め法による補正画像の拡大画像とオリジナルの入力画像をブレンドして第2の補正画像の拡大画像を生成する。穴埋め法に基づいて画素値の補正された第2の補正拡大画像はブレンド処理部740に出力され、平均法処理部710における補正データに基づく第1の補正拡大画像とのブレンド処理が実行されることになる。 The image data that has been subjected to the blur processing in the false color (purple fringe) blur processing unit 726 is input to the second enlargement processing unit 727, and the enlargement process is executed. The second enlargement processing unit 727 executes image enlargement processing according to the processing flow described above with reference to FIG. That is, the blend ratio image B L in which a blend ratio of 0 to 1 is set on the basis of the false color area mask P configured as a binary mask indicating whether or not each pixel is a false color on the reduced image. (X, y) is generated, the generated blend ratio image B L (x, y) is applied, and the enlarged image of the corrected image by the hole filling method and the original input image are blended to enlarge the second corrected image. Generate an image. The second corrected enlarged image whose pixel value is corrected based on the hole filling method is output to the blend processing unit 740, and the blending process with the first corrected enlarged image based on the correction data in the averaging method processing unit 710 is executed. It will be.

穴埋め法に基づいて画素値の補正された第2の補正拡大画像は、図26に示すブレンド処理部740に出力され、平均法処理部710における補正データに基づく第1の補正拡大画像データと、穴埋め法処理部720における補正データに基づく第2の補正拡大画像とのブレンド処理が実行されることになる。ブレンド処理は、前述したように、偽色(PF)度合いpを適用した補正処理によって取得した第1の補正画像Cavgnew(x,y)と、穴埋め補間処理によって算出した第2の補正画像Cholenew(x,y)とのブレンド処理によって、最終的な補正画像データCfinal(x,y)を算出する処理を実行するものであり、所定のブレンド比率kを適用して、例えば、以下に示す式、すなわち、
final(x,y)=k×Cavgnew(x,y)+(1−k)×Cholenew(x,y)
に従って、最終的な補正画素値を持つ補正画像Cfinal(x,y)が生成され、この画像データが出力画像フレームメモリ752に格納されることになる。なお、前十したように、ブレンド比率kは0〜1の範囲で決定する。ブレンド比率をどのような値に設定するかは、それぞれの処理の特徴を踏まえて決定する。例えばより大きな補正を望む場合は、穴埋め法の処理結果の反映比率を大きくする設定とし、また、なるべく破綻のない結果画像を取得したい場合は、偽色(PF)度合いpを適用した補正結果データをより反映するようなブレンド比率kの設定とする。
The second corrected enlarged image in which the pixel value is corrected based on the hole filling method is output to the blend processing unit 740 shown in FIG. 26, and the first corrected enlarged image data based on the correction data in the average method processing unit 710; The blending process with the second corrected enlarged image based on the correction data in the hole filling processing unit 720 is executed. As described above, the blend process includes the first corrected image C avgnew (x, y) acquired by the correction process using the false color (PF) degree p and the second corrected image C calculated by the hole filling interpolation process. The final corrected image data C final (x, y) is calculated by blending with holenew (x, y), and a predetermined blend ratio k is applied. The formula shown, ie
C final (x, y) = k × C avgnew (x, y) + (1−k) × C holenew (x, y)
Accordingly, a corrected image C final (x, y) having a final corrected pixel value is generated, and this image data is stored in the output image frame memory 752. Note that, as described above, the blend ratio k is determined in the range of 0-1. The value for setting the blend ratio is determined based on the characteristics of each process. For example, when a larger correction is desired, the reflection ratio of the processing result of the hole filling method is set to be large, and when it is desired to obtain a result image with no failure as much as possible, correction result data applying a false color (PF) degree p is applied. The blend ratio k is set so as to reflect more.

上述した本発明の画素値補正処理を適用することにより、穴埋め補間処理と、偽色(PF)度合いpを適用した補正処理とのそれぞれの利点を融合した調和された画素値補正が可能となり、パープルフリンジ等の偽色が軽減されるとともに破綻することのない補正画像を取得することが可能となる。結果として、カメラで撮影した画像に起こる色収差によるパープルフリンジ等の偽色に対する適正な補正が可能となり、高品質な画像データの生成、出力を実現することができる。   By applying the pixel value correction process of the present invention described above, harmonized pixel value correction that combines the advantages of the hole-filling interpolation process and the correction process using the false color (PF) degree p is possible, A false image such as purple fringe is reduced, and a corrected image that does not fail can be acquired. As a result, it is possible to appropriately correct false colors such as purple fringes due to chromatic aberration occurring in an image photographed by a camera, and it is possible to generate and output high-quality image data.

本発明の構成によれば、白とび画素近傍に発生するパープルフリンジ等の偽色領域の効率的検出、部分的な画素値補正が可能となり、画像全体に対する影響を発生させることなく高品質な画像データの生成、出力が可能となる。   According to the configuration of the present invention, it is possible to efficiently detect a false color region such as purple fringe generated in the vicinity of an overexposed pixel and to correct a partial pixel value, and to produce a high quality image without causing an influence on the entire image. Data can be generated and output.

特に、本発明の処理では、入力画像を縮小したものに対する画像処理を施す構成であるので、少ない計算コストで画像の補正を行うことができる。また、平均法と穴埋め法の2種類の結果をブレンドする構成としたので、より自由度の高い補正が可能となる。なお、上述した実施例においては、縮小処理、ブレンド処理が共に施される例を述べたが、これらは独立しており、どちらか片方だけを実施する構成としてもよい。すなわち、縮小を実行せず、平均法と穴埋め法の2種類の画像補正を実行してこれらの結果をブレンドする処理構成としてもよい。特に計算コストが問題とならない場合は、このような処理を実行する構成としてもよい。   In particular, since the processing of the present invention is configured to perform image processing on a reduced input image, the image can be corrected with a low calculation cost. In addition, since two types of results, the average method and the hole filling method, are blended, correction with a higher degree of freedom is possible. In the above-described embodiment, the example in which the reduction process and the blend process are performed is described. However, these are independent, and only one of them may be configured. That is, it is possible to adopt a processing configuration in which two types of image corrections of the average method and the hole filling method are executed and the results are blended without performing reduction. In particular, when the calculation cost is not a problem, such a process may be executed.

以上、特定の実施例を参照しながら、本発明について詳解してきた。しかしながら、本発明の要旨を逸脱しない範囲で当業者が該実施例の修正や代用を成し得ることは自明である。すなわち、例示という形態で本発明を開示してきたのであり、限定的に解釈されるべきではない。本発明の要旨を判断するためには、特許請求の範囲の欄を参酌すべきである。   The present invention has been described in detail above with reference to specific embodiments. However, it is obvious that those skilled in the art can make modifications and substitutions of the embodiments without departing from the gist of the present invention. In other words, the present invention has been disclosed in the form of exemplification, and should not be interpreted in a limited manner. In order to determine the gist of the present invention, the claims should be taken into consideration.

また、明細書中において説明した一連の処理はハードウェア、またはソフトウェア、あるいは両者の複合構成によって実行することが可能である。ソフトウェアによる処理を実行する場合は、処理シーケンスを記録したプログラムを、専用のハードウェアに組み込まれたコンピュータ内のメモリにインストールして実行させるか、あるいは、各種処理が実行可能な汎用コンピュータにプログラムをインストールして実行させることが可能である。   The series of processes described in the specification can be executed by hardware, software, or a combined configuration of both. When executing processing by software, the program recording the processing sequence is installed in a memory in a computer incorporated in dedicated hardware and executed, or the program is executed on a general-purpose computer capable of executing various processing. It can be installed and executed.

例えば、プログラムは記録媒体としてのハードディスクやROM(Read Only Memory)に予め記録しておくことができる。あるいは、プログラムはフレキシブルディスク、CD−ROM(Compact Disc Read Only Memory),MO(Magneto optical)ディスク,DVD(Digital Versatile Disc)、磁気ディスク、半導体メモリなどのリムーバブル記録媒体に、一時的あるいは永続的に格納(記録)しておくことができる。このようなリムーバブル記録媒体は、いわゆるパッケージソフトウエアとして提供することができる。   For example, the program can be recorded in advance on a hard disk or ROM (Read Only Memory) as a recording medium. Alternatively, the program is temporarily or permanently stored on a removable recording medium such as a flexible disk, a CD-ROM (Compact Disc Read Only Memory), an MO (Magneto optical) disk, a DVD (Digital Versatile Disc), a magnetic disk, or a semiconductor memory. It can be stored (recorded). Such a removable recording medium can be provided as so-called package software.

なお、プログラムは、上述したようなリムーバブル記録媒体からコンピュータにインストールする他、ダウンロードサイトから、コンピュータに無線転送したり、LAN(Local Area Network)、インターネットといったネットワークを介して、コンピュータに有線で転送し、コンピュータでは、そのようにして転送されてくるプログラムを受信し、内蔵するハードディスク等の記録媒体にインストールすることができる。   The program is installed on the computer from the removable recording medium as described above, or is wirelessly transferred from the download site to the computer, or is wired to the computer via a network such as a LAN (Local Area Network) or the Internet. The computer can receive the program transferred in this manner and install it on a recording medium such as a built-in hard disk.

なお、明細書に記載された各種の処理は、記載に従って時系列に実行されるのみならず、処理を実行する装置の処理能力あるいは必要に応じて並列的にあるいは個別に実行されてもよい。また、本明細書においてシステムとは、複数の装置の論理的集合構成であり、各構成の装置が同一筐体内にあるものには限らない。   The various processes described in the specification are not only executed in time series according to the description, but may be executed in parallel or individually as required by the processing capability of the apparatus that executes the processes. Further, in this specification, the system is a logical set configuration of a plurality of devices, and the devices of each configuration are not limited to being in the same casing.

以上、説明したように、本発明の構成によれば、補正処理対象画像データの縮小処理を実行し、縮小画像に対して、第1の画像補正処理態様で、白とび周囲の偽色画素の画素値補正を含む画像処理を実行して第1補正画像を生成し、さらに、縮小画像に対して、第1の画像補正処理態様と異なる第2の画像補正処理態様で、白とび周囲の偽色画素の画素値補正を含む画像処理を実行して第2補正画像を生成し、これらの異なる処理結果画像を拡大してブレンドすることにより、最終補正画像を生成する構成としたので、それぞれの画像補正処理が縮小画像に対して実行可能となり、少ない計算コストで画像の補正を行うことができる。また、異なる処理態様での画像補正を融合した補正処理が実現され、それぞれの利点を融合した調和された画素値補正が可能となる。   As described above, according to the configuration of the present invention, the reduction processing of the correction target image data is executed, and the reduced image is subjected to the overexposure of the surrounding false color pixels in the first image correction processing mode. Image processing including pixel value correction is executed to generate a first corrected image, and further, the second image correction processing mode that is different from the first image correction processing mode is applied to the reduced image, and the false surroundings are overlooked. Since the second corrected image is generated by executing image processing including pixel value correction of the color pixels, and the different processed result images are enlarged and blended, the final corrected image is generated. Image correction processing can be performed on a reduced image, and the image can be corrected at a low calculation cost. In addition, a correction process that combines image corrections in different processing modes is realized, and harmonized pixel value correction that combines the respective advantages is possible.

また、本発明の構成によれば、穴埋め補間処理と、偽色(PF)度合いpを適用した補正処理とのそれぞれの利点を融合した調和された画素値補正が可能となり、パープルフリンジ等の偽色が軽減されるとともに破綻することのない補正画像を取得することが可能となる。具体的には、カメラで撮影した画像に起こる色収差によるパープルフリンジ等の偽色に対する適正な補正が可能となり、高品質な画像データの生成、出力を実現することができる。   Further, according to the configuration of the present invention, it is possible to perform harmonized pixel value correction that combines the advantages of the hole-filling interpolation processing and the correction processing to which the false color (PF) degree p is applied. It is possible to obtain a corrected image that reduces the color and does not fail. Specifically, it is possible to appropriately correct false colors such as purple fringes due to chromatic aberration occurring in an image photographed by a camera, and it is possible to realize generation and output of high-quality image data.

さらに、本発明の構成によれば、すべての画像補正処理を自動処理として行なった場合でも、破綻の無い画像を生成することが可能となる。本発明の画像処理を適用することにより、撮影画像を、より自然に見えるように補正をすることが可能である。従って、撮影時にパープルフリンジが起こらないようにレンズの絞りや焦点距離などに注意を払う必要がなく、より高い自由度で撮影を行なうことが可能となる。   Furthermore, according to the configuration of the present invention, it is possible to generate an image without failure even when all image correction processing is performed as automatic processing. By applying the image processing of the present invention, it is possible to correct the captured image so that it looks more natural. Therefore, it is not necessary to pay attention to the lens aperture and focal length so that purple fringing does not occur during shooting, and shooting can be performed with a higher degree of freedom.

さらに、本発明の構成によれば、縮小処理をした上で、偽色補正処理を行い、それを拡大処理している。しかし、オリジナル画像で画素値が更新される部分は、偽色が発生している部分のみであり、かつ色情報だけが補正される。したがって、偽色以外の部分は全く劣化することが無い。偽色が発生している部分に関しても、特別な縮小処理を施しているので、確実に偽色画素を認識することが出来る。このように、縮小処理により計算コストが減少するにもかかわらす、偽色の補正品質が劣化することはほとんど無い。   Furthermore, according to the configuration of the present invention, the false color correction process is performed after the reduction process, and the enlargement process is performed. However, the part where the pixel value is updated in the original image is only the part where the false color is generated, and only the color information is corrected. Therefore, the portion other than the false color is not deteriorated at all. Since a special reduction process is performed on the portion where the false color is generated, the false color pixel can be reliably recognized. As described above, although the calculation cost is reduced by the reduction process, the false color correction quality is hardly deteriorated.

本発明の画像処理装置の構成を示す図である。It is a figure which shows the structure of the image processing apparatus of this invention. 本発明の画像処理の総合的処理を示すフローチャート図である。It is a flowchart figure which shows the comprehensive process of the image processing of this invention. 本発明の画像処理において実行する縮小処理の手順を説明するフローチャート(その1)を示す図である。It is a figure which shows the flowchart (the 1) explaining the procedure of the reduction process performed in the image processing of this invention. 本発明の画像処理において実行する縮小処理の手順を説明するフローチャート(その2)を示す図である。It is a figure which shows the flowchart (the 2) explaining the procedure of the reduction process performed in the image processing of this invention. 本発明の画像処理において実行する縮小処理の詳細を説明する図である。It is a figure explaining the detail of the reduction process performed in the image processing of this invention. 本発明の画像処理において実行する縮小処理において実行する色相判定処理について説明する図である。It is a figure explaining the hue determination process performed in the reduction process performed in the image processing of this invention. 本発明の画像処理としての偽色度合いを適用した平均法に基づく画像補正処理のシーケンスを説明するフロー図(その1)である。It is the flowchart (the 1) explaining the sequence of the image correction process based on the average method to which the false color degree as an image process of this invention is applied. 本発明の画像処理としての偽色度合いを適用した平均法に基づく画像補正処理のシーケンスを説明するフロー図(その2)である。It is a flowchart (the 2) explaining the sequence of the image correction process based on the average method to which the false color degree as image processing of this invention is applied. 白とび画素の探索領域の設定構成について説明する図である。It is a figure explaining the setting structure of the search area | region of a white-out pixel. 白とび画素の探索領域の設定構成および白とび距離評価値P算出に適用する距離の算出処理について説明する図である。It is a figure explaining the calculation process of the distance applied to the setting structure of the search area | region of a whiteout pixel, and whiteout distance evaluation value Pd calculation. 注目画素の彩度評価値P、色相評価値Pθ、の算出に必用なパラメータの求め方の例について説明する図である。Chroma evaluation value P s of the target pixel, the hue evaluation value P theta, is a diagram illustrating an example of how to determine the necessity parameters for the calculation of the. 彩度評価値Pの算出に適用する最大彩度Smaxの適切な設定例について説明する図である。Is a diagram illustrating a suitable example of setting up saturation S max to be applied to the calculation of the chroma evaluation value P s. 本発明の画像処理において実行する偽色度合いを適用した補正画素値の算出処理手順を説明するフロー図である。It is a flowchart explaining the calculation process procedure of the correction | amendment pixel value which applied the false color degree performed in the image processing of this invention. 偽色度合いを適用した補正画素値の算出処理の際に適用する補間値算出範囲の設定処理例について説明する図である。It is a figure explaining the example of a setting process of the interpolation value calculation range applied in the case of the calculation process of the correction pixel value to which the false color degree is applied. 拡大処理の手順を説明するフローチャートを示す図である。It is a figure which shows the flowchart explaining the procedure of an expansion process. 本発明の画像処理としての穴埋め法に基づく画像補正処理のシーケンスを説明するフロー図である。It is a flowchart explaining the sequence of the image correction process based on the hole-filling method as an image process of this invention. 穴埋め法に基づく画像処理において実行する白とび領域検出処理の詳細シーケンスを説明するフロー図である。It is a flowchart explaining the detailed sequence of the overexposure area | region detection process performed in the image processing based on a hole-filling method. 穴埋め法に基づく画像処理において実行する偽色画素検出領域設定処理の詳細シーケンスを説明するフロー図である。It is a flowchart explaining the detailed sequence of the false color pixel detection area | region setting process performed in the image processing based on a hole-filling method. 穴埋め法に基づく画像処理において実行する偽色画素検出領域設定処理の処理例について説明する図である。It is a figure explaining the process example of the false color pixel detection area | region setting process performed in the image process based on a hole-filling method. 穴埋め法に基づく画像処理において実行する偽色画素検出処理の詳細シーケンスを説明するフロー図である。It is a flowchart explaining the detailed sequence of the false color pixel detection process performed in the image processing based on a hole-filling method. 穴埋め法に基づく画像処理において実行する偽色画素検出処理の処理例について説明する図である。It is a figure explaining the process example of the false color pixel detection process performed in the image process based on a hole-filling method. 穴埋め法に基づく画像処理において実行する偽色画素補正処理の処理例について説明する図である。It is a figure explaining the process example of the false color pixel correction process performed in the image process based on a hole-filling method. 穴埋め法に基づく画像処理において実行する偽色画素補正処理の詳細シーケンスを説明するフロー図である。It is a flowchart explaining the detailed sequence of the false color pixel correction process performed in the image processing based on a hole-filling method. 穴埋め法に基づく画像処理において実行する偽色画素補正処理の詳細シーケンスを説明するフロー図である。It is a flowchart explaining the detailed sequence of the false color pixel correction process performed in the image processing based on a hole-filling method. 穴埋め法に基づく画像処理において実行する色ぼかし処理の詳細シーケンスを説明するフロー図である。It is a flowchart explaining the detailed sequence of the color blurring process performed in the image processing based on a hole-filling method. 本発明の画像処理装置において偽色補正を実行するデジタル信号処理部の機能構成を説明するブロック図である。It is a block diagram explaining the functional structure of the digital signal processing part which performs false color correction in the image processing apparatus of this invention. 本発明の画像処理装置において偽色補正を実行するデジタル信号処理部の穴埋め法処理部の機能構成を説明するブロック図である。It is a block diagram explaining the functional structure of the hole-filling method process part of the digital signal process part which performs false color correction in the image processing apparatus of this invention.

符号の説明Explanation of symbols

101 レンズ
102 絞り
103 固体撮像素子
104 相関2重サンプリング回路
105 A/Dコンバータ
106 DSPブロック
107 タイミングジェネレータ
108 D/Aコンバータ
109 ビデオエンコーダ
110 ビデオモニタ
111 コーデック(CODEC)
112 メモリ
113 CPU
114 入力デバイス
115 フラッシュ制御装置
116 フラッシュ発光装置
150 オリジナル画像
151 対応画像領域
160 縮小画像
161 画素
180 原点
181,182 色相ライン
183 色相範囲
210 画像データ
211 画素
212,213 画素領域
222,223 画素領域
230 画素領域
250 画像データ中心画素
300 注目画素
301 白とび探索範囲
302,303 画素
311,312 画素領域
321〜324 画素
400 原点
401 パープルフリンジ色相ライン
402 注目画素色相
451〜454 画像範囲
510 画像データ
511 画素
520 白とび探索範囲
521,522 画素領域
531 白とび画素
601 白とび画素
602 偽色画素検出領域
603 白とび画素
651 白とび画素
652 偽色(パープルフリンジ)画素
653 その他の画素
654 補間済み偽色(パープルフリンジ)画素
700 縮小処理部
710 平均法処理部
711 白とび距離評価値P算出部
712 彩度評価値P算出部
713 色相評価値Pθ算出部
714 偽色(PF)度合いp算出部
715 補間値[Ctmp/Wtotal]算出部
716 第1補正画素値算出部
717 第1拡大処理部
720 穴埋め法処理部
721 白とび検出部
722 偽色画素検出領域設定部
723 偽色(パープルフリンジ)検出部
724 画素値補正部
725 偽色(パープルフリンジ)穴埋め補間部
726 偽色(パープルフリンジ)ぼかし処理部
727 第2拡大処理部
740 ブレンド処理部
751 入力画像フレームメモリ
752 出力画像フレームメモリ
DESCRIPTION OF SYMBOLS 101 Lens 102 Diaphragm 103 Solid-state image sensor 104 Correlated double sampling circuit 105 A / D converter 106 DSP block 107 Timing generator 108 D / A converter 109 Video encoder 110 Video monitor 111 Codec (CODEC)
112 memory 113 CPU
114 Input Device 115 Flash Controller 116 Flash Light Emitting Device 150 Original Image 151 Corresponding Image Area 160 Reduced Image 161 Pixel 180 Origin 181 and 182 Hue Line 183 Hue Range 210 Image Data 211 Pixel 212 and 213 Pixel Area 222 and 223 Pixel Area 230 Pixel Region 250 Image data center pixel 300 Pixel of interest 301 White search range 302,303 Pixels 311, 312 Pixel region 321-324 Pixel 400 Origin 401 Purple fringe hue line 402 Pixel of interest hue 451-454 Image range 510 Image data 511 Pixel 520 White Skip search range 521, 522 Pixel area 531 White skip pixel 601 White skip pixel 602 False color pixel detection area 603 White skip pixel 651 White skip pixel 652 False (Purple fringe) pixels 653 other pixels 654 interpolated false color (purple fringe) pixels 700 reduction processing unit 710 average method processing unit 711 overexposure distance evaluation value P d calculator 712 chroma evaluation value P s calculator 713 hue evaluation Value P θ calculation unit 714 False color (PF) degree p calculation unit 715 Interpolated value [C tmp / W total ] calculation unit 716 First correction pixel value calculation unit 717 First enlargement processing unit 720 Filling method processing unit 721 White spot detection Unit 722 false color pixel detection region setting unit 723 false color (purple fringe) detection unit 724 pixel value correction unit 725 false color (purple fringe) filling interpolation unit 726 false color (purple fringe) blurring processing unit 727 second enlargement processing unit 740 Blend processing unit 751 Input image frame memory 752 Output image frame memory

Claims (29)

画像処理装置であり、
補正処理対象画像データの縮小処理を実行する縮小処理部と、
前記縮小処理部において生成された縮小画像に対して、白とび周囲の偽色画素の画素値補正を含む画像処理を実行する画像補正処理部と、
前記画像補正処理部において生成した補正画像の拡大処理を実行する拡大処理部と、
を有することを特徴とする画像処理装置。
An image processing device,
A reduction processing unit that executes a reduction process of the correction target image data;
An image correction processing unit that performs image processing including pixel value correction of a false color pixel around a whiteout on the reduced image generated in the reduction processing unit;
An enlargement processing unit for executing an enlargement process of the corrected image generated in the image correction processing unit;
An image processing apparatus comprising:
前記縮小処理部は、
オリジナルの補正処理対象画像データについて輝度情報の縮小処理と、色情報の縮小処理とを個別に実行する構成であり、輝度情報の縮小処理においては、前記補正処理対象画像データに含まれる白とび画素情報を消失させない縮小処理を実行し、色情報の縮小処理においては、前記補正処理対象画像データに含まれる偽色の色情報を消失させない縮小処理を実行する構成であることを特徴とする請求項1に記載の画像処理装置。
The reduction processing unit
The luminance information reduction process and the color information reduction process are separately performed on the original correction process target image data. In the luminance information reduction process, the overexposed pixels included in the correction process target image data are processed. The reduction processing that does not lose information is executed, and in the reduction processing of color information, the reduction processing that does not lose the false color color information included in the correction processing target image data is executed. The image processing apparatus according to 1.
前記縮小処理部は、
前記補正処理対象画像データについての輝度情報の縮小処理において、縮小画像の構成画素に対応する輝度を、前記補正処理対象画像データの対応画像領域に含まれる最大輝度として設定する処理を実行する構成であることを特徴とする請求項2に記載の画像処理装置。
The reduction processing unit
In the reduction process of the luminance information for the correction process target image data, a process for executing the process of setting the brightness corresponding to the constituent pixels of the reduced image as the maximum brightness included in the corresponding image area of the correction process target image data. The image processing apparatus according to claim 2, wherein the image processing apparatus is provided.
前記縮小処理部は、
前記補正処理対象画像データについての色情報の縮小処理において、縮小画像の構成画素に対応する色情報を、前記補正処理対象画像データの対応画像領域に偽色画素が含まれる場合は、前記対応画像領域に含まれる偽色画素の平均値として設定し、前記補正処理対象画像データの対応画像領域に偽色画素が含まれない場合は、前記対応画像領域に含まれる全画素の平均値として設定する処理を実行する構成であることを特徴とする請求項2に記載の画像処理装置。
The reduction processing unit
In the color information reduction processing for the correction processing target image data, when the color information corresponding to the constituent pixels of the reduced image is included in the corresponding image area of the correction processing target image data, the corresponding image Set as an average value of false color pixels included in the area, and if the corresponding image area of the correction processing target image data does not include false color pixels, set as an average value of all pixels included in the corresponding image area The image processing apparatus according to claim 2, wherein the image processing apparatus is configured to execute processing.
前記画像補正処理部は、
前記縮小処理部において生成された縮小画像の構成画素の偽色度合いpを算出し、算出した偽色度合いpに応じた画素値補正を実行する平均法に基づく補正処理を実行する構成であり、
前記縮小画像の構成画素から選択された注目画素について、偽色である可能性を示すパラメータとしての偽色度合いpを算出する偽色度合い算出部と、
注目画素近傍領域の画素値に基づいて、注目画素に対応する補間値を算出する補間値算出部と、
注目画素の元画素値と前記補間値とを適用し、注目画素の偽色度合いpに応じて前記元画素値と前記補間値との寄与率を変更して前記注目画素の補正画素値を算出する補正画素値算出部と、
を有する構成であることを特徴とする請求項1に記載の画像処理装置。
The image correction processing unit
A configuration for executing a correction process based on an average method of calculating a false color degree p of a constituent pixel of a reduced image generated in the reduction processing unit and executing a pixel value correction according to the calculated false color degree p;
A false color degree calculation unit for calculating a false color degree p as a parameter indicating the possibility of being a false color for a target pixel selected from the constituent pixels of the reduced image;
An interpolation value calculation unit that calculates an interpolation value corresponding to the target pixel based on the pixel value of the target pixel neighboring region;
Applying the original pixel value of the target pixel and the interpolation value, and calculating the corrected pixel value of the target pixel by changing the contribution ratio between the original pixel value and the interpolation value according to the false color degree p of the target pixel A correction pixel value calculation unit to perform,
The image processing apparatus according to claim 1, wherein the image processing apparatus includes:
前記偽色度合い算出部は、
注目画素についての、
(a)白とび(高輝度画素)への近さを示す白とび距離評価値P
(b)彩度の大きさを示す彩度評価値P
(c)偽色に対応する特定色相への近さを示す色相評価値Pθ
の少なくともいずれかを適用して注目画素の偽色度合いpを算出する構成であることを特徴とする請求項5に記載の画像処理装置。
The false color degree calculation unit
About the pixel of interest
(A) White jump distance evaluation value P d indicating the proximity to white jump (high luminance pixel),
(B) a saturation evaluation value P s indicating the magnitude of saturation;
(C) Hue evaluation value P θ indicating the proximity to the specific hue corresponding to the false color,
The image processing apparatus according to claim 5, wherein the image processing apparatus is configured to calculate a false color degree p of the target pixel by applying at least one of the following.
前記画像補正処理部は、
前記縮小処理部において生成された縮小画像の構成画素から白とび画素を検出し、白とび画素周囲の偽色画素の画素値を周囲画素の画素値に基づいて補正する穴埋め法に基づく補正処理を実行する構成であり、
画像データから白とび画素を検出する白とび検出部と、
前記白とび検出部の検出した白とび画素の周囲に偽色画素検出領域を設定する偽色画素検出領域設定部と、
前記偽色画素検出領域設定部の設定した領域内において、偽色に対応する色を有する画素を偽色画素として特定する偽色検出部と、
前記偽色検出部の検出した偽色画素について、周囲画素値に基づく画素値補正処理を実行する画素値補正部と、
を有する構成であることを特徴とする請求項1に記載の画像処理装置。
The image correction processing unit
Correction processing based on a hole filling method that detects overexposed pixels from the constituent pixels of the reduced image generated in the reduction processing unit and corrects the pixel values of false color pixels around the overexposed pixels based on the pixel values of the surrounding pixels. Configuration to run,
A whiteout detector for detecting whiteout pixels from image data;
A false color pixel detection region setting unit that sets a false color pixel detection region around the whiteout pixels detected by the whiteout detection unit;
In the region set by the false color pixel detection region setting unit, a false color detection unit that identifies a pixel having a color corresponding to the false color as a false color pixel;
A pixel value correction unit that performs pixel value correction processing based on surrounding pixel values for the false color pixels detected by the false color detection unit;
The image processing apparatus according to claim 1, wherein the image processing apparatus includes:
前記画素値補正部は、
偽色画素について、周囲画素値に基づく穴埋め補間処理を実行する穴埋め補間部と、
偽色画素について、色ぼかし処理を実行する色ぼかし処理部とを有する構成であることを特徴とする請求項7に記載の画像処理装置。
The pixel value correction unit
For a false color pixel, a hole-filling interpolation unit that performs hole-filling interpolation processing based on surrounding pixel values;
The image processing apparatus according to claim 7, further comprising: a color blur processing unit that performs color blur processing on the false color pixel.
前記画素値補正部は、
偽色画素の周囲に存在する画素から偽色画素および白とび画素を除くその他の画素を選択し、選択画素に基づく穴埋め補間処理を実行する構成であることを特徴とする請求項7に記載の画像処理装置。
The pixel value correction unit
8. The configuration according to claim 7, wherein a pixel other than the false color pixel and the skipped pixel is selected from pixels existing around the false color pixel, and the filling interpolation processing based on the selected pixel is executed. Image processing device.
前記拡大処理部は、
前記画像補正処理部において生成した補正画像の拡大データとオリジナルの補正処理対象画像データとのブレンド処理により拡大済み補正画像を生成する構成であることを特徴とする請求項1に記載の画像処理装置。
The enlargement processing unit
The image processing apparatus according to claim 1, wherein the enlarged corrected image is generated by blending the enlarged data of the corrected image generated in the image correction processing unit and the original correction target image data. .
前記画像補正処理部は、
前記縮小処理部において生成された縮小画像に対して、第1の画像補正処理態様で、白とび周囲の偽色画素の画素値補正を含む画像処理を実行する第1画像補正処理部と、
前記縮小処理部において生成された縮小画像に対して、前記第1の画像補正処理態様と異なる第2の画像補正処理態様で、白とび周囲の偽色画素の画素値補正を含む画像処理を実行する第2画像補正処理部とを有し、
前記拡大処理部は、前記第1画像補正処理部において生成した第1補正画像と、前記第2画像補正処理部において生成した第2補正画像との拡大処理を実行する構成であり、
さらに、前記拡大処理部において拡大した拡大済み第1補正画像と拡大済み第2補正画像とのブレンド処理により最終補正画像を生成するブレンド処理部を有することを特徴とする請求項1に記載の画像処理装置。
The image correction processing unit
A first image correction processing unit that performs image processing including pixel value correction of overexposed false color pixels in a first image correction processing mode on the reduced image generated in the reduction processing unit;
The reduced image generated in the reduction processing unit is subjected to image processing including pixel value correction of a surrounding false color pixel in a second image correction processing mode different from the first image correction processing mode. A second image correction processing unit
The enlargement processing unit is configured to execute enlargement processing of the first correction image generated in the first image correction processing unit and the second correction image generated in the second image correction processing unit,
2. The image according to claim 1, further comprising a blend processing unit that generates a final corrected image by blending the enlarged first corrected image and the enlarged second corrected image enlarged in the enlargement processing unit. Processing equipment.
前記拡大処理部は、
前記第1画像補正処理部において生成した第1補正画像の拡大データとオリジナルの補正処理対象画像データとのブレンド処理により拡大済み第1補正画像を生成し、
前記第2画像補正処理部において生成した第2補正画像の拡大データとオリジナルの補正処理対象画像データとのブレンド処理により拡大済み第2補正画像を生成する構成であることを特徴とする請求項11に記載の画像処理装置。
The enlargement processing unit
Generating an enlarged first corrected image by blending the enlarged data of the first corrected image generated in the first image correction processing unit and the original correction target image data;
12. The configuration of generating an enlarged second corrected image by blending the enlarged data of the second correction image generated in the second image correction processing unit and the original correction processing target image data. An image processing apparatus according to 1.
前記ブレンド処理部は、
前記拡大処理部において拡大した拡大済み第1補正画像と拡大済み第2補正画像とのブレンド処理により最終補正画像を生成する構成であり、
前記拡大済み第1補正画像の構成画素(x,y)の画素値をCavgnew(x,y)とし、
前記拡大済み第2補正画像の構成画素(x,y)の画素値をCholenew(x,y)としたとき、最終補正画像の構成画素(x,y)の画素値Cfinal(x,y)を、下式、
final(x,y)=k×Cavgnew(x,y)+(1−k)×Cholenew(x,y)
ただしk=0〜1
に従って算出する処理を実行する構成であることを特徴とする請求項11に記載の画像処理装置。
The blend processing unit
The final correction image is generated by blending the enlarged first corrected image and the enlarged second corrected image enlarged in the enlargement processing unit,
The pixel value of the constituent pixel (x, y) of the enlarged first corrected image is C avgnew (x, y),
When the pixel value of the constituent pixel (x, y) of the enlarged second corrected image is C holenew (x, y), the pixel value C final (x, y) of the constituent pixel (x, y) of the final corrected image. ),
C final (x, y) = k × C avgnew (x, y) + (1−k) × C holenew (x, y)
However, k = 0-1
The image processing apparatus according to claim 11, wherein the image processing apparatus is configured to execute a process to be calculated according to the above.
前記偽色はパープルフリンジであり、
前記画像補正処理部は、前記縮小処理部において生成された縮小画像に対して、白とび周囲のパープルフリンジ画素の画素値補正を含む画像処理を実行する構成であることを特徴とする請求項1乃至13いずれかに記載の画像処理装置。
The false color is purple fringe,
2. The image correction processing unit is configured to perform image processing including pixel value correction of overexposed purple fringe pixels on the reduced image generated by the reduction processing unit. 14. The image processing device according to any one of 13 to 13.
画像処理方法であり、
補正処理対象画像データの縮小処理を実行する縮小処理ステップと、
前記縮小処理ステップにおいて生成された縮小画像に対して、白とび周囲の偽色画素の画素値補正を含む画像処理を実行する画像補正処理ステップと、
前記画像補正処理ステップにおいて生成した補正画像の拡大処理を実行する拡大処理ステップと、
を有することを特徴とする画像処理方法。
An image processing method,
A reduction processing step for executing the reduction processing of the correction target image data;
An image correction processing step for performing image processing including pixel value correction of a false color pixel around the image on the reduced image generated in the reduction processing step;
An enlargement process step for executing an enlargement process of the corrected image generated in the image correction process step;
An image processing method comprising:
前記縮小処理ステップは、
オリジナルの補正処理対象画像データについて輝度情報の縮小処理と、色情報の縮小処理とを個別に実行し、輝度情報の縮小処理においては、前記補正処理対象画像データに含まれる白とび画素情報を消失させない縮小処理を実行し、色情報の縮小処理においては、前記補正処理対象画像データに含まれる偽色の色情報を消失させない縮小処理を実行することを特徴とする請求項15に記載の画像処理方法。
The reduction processing step includes
Luminance information reduction processing and color information reduction processing are separately performed on original correction processing target image data. In the luminance information reduction processing, overexposed pixel information included in the correction processing target image data is lost. 16. The image processing according to claim 15, wherein a reduction process that does not cause the false color information included in the correction processing target image data is performed in the color information reduction process. Method.
前記縮小処理ステップは、
前記補正処理対象画像データについての輝度情報の縮小処理において、縮小画像の構成画素に対応する輝度を、前記補正処理対象画像データの対応画像領域に含まれる最大輝度として設定する処理を実行することを特徴とする請求項16に記載の画像処理方法。
The reduction processing step includes
In the luminance information reduction processing for the correction processing target image data, executing processing for setting the luminance corresponding to the constituent pixels of the reduced image as the maximum luminance included in the corresponding image area of the correction processing target image data. The image processing method according to claim 16.
前記縮小処理ステップは、
前記補正処理対象画像データについての色情報の縮小処理において、縮小画像の構成画素に対応する色情報を、前記補正処理対象画像データの対応画像領域に偽色画素が含まれる場合は、前記対応画像領域に含まれる偽色画素の平均値として設定し、前記補正処理対象画像データの対応画像領域に偽色画素が含まれない場合は、前記対応画像領域に含まれる全画素の平均値として設定する処理を実行することを特徴とする請求項16に記載の画像処理方法。
The reduction processing step includes
In the color information reduction processing for the correction processing target image data, when the color information corresponding to the constituent pixels of the reduced image is included in the corresponding image area of the correction processing target image data, the corresponding image Set as an average value of false color pixels included in the area, and if the corresponding image area of the correction processing target image data does not include false color pixels, set as an average value of all pixels included in the corresponding image area The image processing method according to claim 16, wherein the process is executed.
前記画像補正処理ステップは、
前記縮小処理ステップにおいて生成された縮小画像の構成画素の偽色度合いpを算出し、算出した偽色度合いpに応じた画素値補正を実行する平均法に基づく補正処理を実行するステップであり、
前記縮小画像の構成画素から選択された注目画素について、偽色である可能性を示すパラメータとしての偽色度合いpを算出する偽色度合い算出ステップと、
注目画素近傍領域の画素値に基づいて、注目画素に対応する補間値を算出する補間値算出ステップと、
注目画素の元画素値と前記補間値とを適用し、注目画素の偽色度合いpに応じて前記元画素値と前記補間値との寄与率を変更して前記注目画素の補正画素値を算出する補正画素値算出ステップと、
を含むことを特徴とする請求項15に記載の画像処理方法。
The image correction processing step includes
Calculating a false color degree p of the constituent pixels of the reduced image generated in the reduction process step, and executing a correction process based on an average method for executing a pixel value correction according to the calculated false color degree p;
A false color degree calculating step for calculating a false color degree p as a parameter indicating the possibility of a false color for a target pixel selected from the constituent pixels of the reduced image;
An interpolation value calculating step for calculating an interpolation value corresponding to the target pixel based on the pixel value of the target pixel neighboring area;
Applying the original pixel value of the target pixel and the interpolation value, and calculating the corrected pixel value of the target pixel by changing the contribution ratio between the original pixel value and the interpolation value according to the false color degree p of the target pixel A correction pixel value calculating step,
The image processing method according to claim 15, further comprising:
前記偽色度合い算出ステップは、
注目画素についての、
(a)白とび(高輝度画素)への近さを示す白とび距離評価値P
(b)彩度の大きさを示す彩度評価値P
(c)偽色に対応する特定色相への近さを示す色相評価値Pθ
の少なくともいずれかを適用して注目画素の偽色度合いpを算出するステップであることを特徴とする請求項19に記載の画像処理方法。
The false color degree calculating step includes:
About the pixel of interest
(A) White jump distance evaluation value P d indicating the proximity to white jump (high luminance pixel),
(B) a saturation evaluation value P s indicating the magnitude of saturation;
(C) Hue evaluation value P θ indicating the proximity to the specific hue corresponding to the false color,
The image processing method according to claim 19, wherein the method is a step of calculating a false color degree p of the target pixel by applying at least one of the following.
前記画像補正処理ステップは、
前記縮小処理ステップにおいて生成された縮小画像の構成画素から白とび画素を検出し、白とび画素周囲の偽色画素の画素値を周囲画素の画素値に基づいて補正する穴埋め法に基づく補正処理を実行するステップであり、
画像データから白とび画素を検出する白とび検出ステップと、
前記白とび検出ステップの検出した白とび画素の周囲に偽色画素検出領域を設定する偽色画素検出領域設定ステップと、
前記偽色画素検出領域設定ステップの設定した領域内において、偽色に対応する色を有する画素を偽色画素として特定する偽色検出ステップと、
前記偽色検出ステップの検出した偽色画素について、周囲画素値に基づく画素値補正処理を実行する画素値補正ステップと、
を含むことを特徴とする請求項15に記載の画像処理方法。
The image correction processing step includes
Correction processing based on a hole filling method that detects overexposed pixels from the constituent pixels of the reduced image generated in the reduction processing step and corrects the pixel values of false color pixels around the overexposed pixels based on the pixel values of the surrounding pixels. The steps to perform,
A whiteout detection step for detecting whiteout pixels from the image data;
A false color pixel detection area setting step for setting a false color pixel detection area around a white spot pixel detected by the white spot detection step;
In the region set by the false color pixel detection region setting step, a false color detection step for specifying a pixel having a color corresponding to the false color as a false color pixel;
A pixel value correction step for executing a pixel value correction process based on surrounding pixel values for the false color pixels detected by the false color detection step;
The image processing method according to claim 15, further comprising:
前記画素値補正ステップは、
偽色画素について、周囲画素値に基づく穴埋め補間処理を実行する穴埋め補間ステップと、
偽色画素について、色ぼかし処理を実行する色ぼかし処理ステップとを含むことを特徴とする請求項21に記載の画像処理方法。
The pixel value correcting step includes:
For false color pixels, a filling interpolation step for performing filling interpolation processing based on surrounding pixel values;
The image processing method according to claim 21, further comprising: a color blur processing step of executing a color blur process for a false color pixel.
前記画素値補正ステップは、
偽色画素の周囲に存在する画素から偽色画素および白とび画素を除くその他の画素を選択し、選択画素に基づく穴埋め補間処理を実行するステップを含むことを特徴とする請求項21に記載の画像処理方法。
The pixel value correcting step includes:
The method according to claim 21, further comprising: selecting other pixels excluding the false color pixel and the skipped pixel from the pixels existing around the false color pixel, and executing a filling interpolation process based on the selected pixel. Image processing method.
前記拡大処理ステップは、
前記画像補正処理ステップにおいて生成した補正画像の拡大データとオリジナルの補正処理対象画像データとのブレンド処理により拡大済み補正画像を生成するステップであることを特徴とする請求項15に記載の画像処理方法。
The enlargement processing step includes
16. The image processing method according to claim 15, wherein the enlarged corrected image is generated by blending the enlarged data of the corrected image generated in the image correction processing step and the original correction target image data. .
前記画像補正処理ステップは、
前記縮小処理ステップにおいて生成された縮小画像に対して、第1の画像補正処理態様で、白とび周囲の偽色画素の画素値補正を含む画像処理を実行する第1画像補正処理ステップと、
前記縮小処理ステップにおいて生成された縮小画像に対して、前記第1の画像補正処理態様と異なる第2の画像補正処理態様で、白とび周囲の偽色画素の画素値補正を含む画像処理を実行する第2画像補正処理ステップとを有し、
前記拡大処理ステップは、前記第1画像補正処理ステップにおいて生成した第1補正画像と、前記第2画像補正処理ステップにおいて生成した第2補正画像との拡大処理を実行するステップであり、
さらに、前記拡大処理ステップにおいて拡大した拡大済み第1補正画像と拡大済み第2補正画像とのブレンド処理により最終補正画像を生成するブレンド処理ステップを有することを特徴とする請求項15に記載の画像処理方法。
The image correction processing step includes
A first image correction processing step of executing image processing including pixel value correction of a false color pixel in a surrounding area in a first image correction processing mode on the reduced image generated in the reduction processing step;
The reduced image generated in the reduction processing step is subjected to image processing including pixel value correction of the surrounding false color pixels in a second image correction processing mode different from the first image correction processing mode. A second image correction processing step,
The enlargement processing step is a step of executing enlargement processing of the first correction image generated in the first image correction processing step and the second correction image generated in the second image correction processing step,
16. The image according to claim 15, further comprising a blending step for generating a final corrected image by blending the enlarged first corrected image and the enlarged second corrected image enlarged in the enlarging step. Processing method.
前記拡大処理ステップは、
前記第1画像補正処理ステップにおいて生成した第1補正画像の拡大データとオリジナルの補正処理対象画像データとのブレンド処理により拡大済み第1補正画像を生成するステップと、
前記第2画像補正処理ステップにおいて生成した第2補正画像の拡大データとオリジナルの補正処理対象画像データとのブレンド処理により拡大済み第2補正画像を生成するステップと、
を含むことを特徴とする請求項25に記載の画像処理方法。
The enlargement processing step includes
Generating an enlarged first corrected image by blending the enlarged data of the first corrected image generated in the first image correction processing step and the original correction target image data;
Generating an enlarged second corrected image by blending the enlarged data of the second correction image generated in the second image correction processing step and the original correction processing target image data;
The image processing method according to claim 25, further comprising:
前記ブレンド処理ステップは、
前記拡大処理ステップにおいて拡大した拡大済み第1補正画像と拡大済み第2補正画像とのブレンド処理により最終補正画像を生成するステップであり、
前記拡大済み第1補正画像の構成画素(x,y)の画素値をCavgnew(x,y)とし、
前記拡大済み第2補正画像の構成画素(x,y)の画素値をCholenew(x,y)としたとき、最終補正画像の構成画素(x,y)の画素値Cfinal(x,y)を、下式、
final(x,y)=k×Cavgnew(x,y)+(1−k)×Cholenew(x,y)
ただしk=0〜1
に従って算出する処理を実行することを特徴とする請求項25に記載の画像処理方法。
The blending step includes
A step of generating a final correction image by blending the enlarged first correction image and the enlarged second correction image enlarged in the enlargement processing step;
The pixel value of the constituent pixel (x, y) of the enlarged first corrected image is C avgnew (x, y),
When the pixel value of the constituent pixel (x, y) of the enlarged second corrected image is C holenew (x, y), the pixel value C final (x, y) of the constituent pixel (x, y) of the final corrected image. ),
C final (x, y) = k × C avgnew (x, y) + (1−k) × C holenew (x, y)
However, k = 0-1
26. The image processing method according to claim 25, wherein a process of calculating according to the above is executed.
前記偽色はパープルフリンジであり、
前記画像補正処理ステップは、前記縮小処理ステップにおいて生成された縮小画像に対して、白とび周囲のパープルフリンジ画素の画素値補正を含む画像処理を実行することを特徴とする請求項15乃至27いずれかに記載の画像処理方法。
The false color is purple fringe,
28. The image correction processing step according to any one of claims 15 to 27, wherein the image processing including pixel value correction of an overlying purple fringe pixel is performed on the reduced image generated in the reduction processing step. An image processing method according to claim 1.
画像処理をコンピュータ上で実行させるコンピュータ・プログラムであり、
補正処理対象画像データの縮小処理を実行する縮小処理ステップと、
前記縮小処理ステップにおいて生成された縮小画像に対して、白とび周囲の偽色画素の画素値補正を含む画像処理を実行する画像補正処理ステップと、
前記画像補正処理ステップにおいて生成した補正画像の拡大処理を実行する拡大処理ステップと、
を有することを特徴とするコンピュータ・プログラム。
A computer program for executing image processing on a computer;
A reduction processing step for executing the reduction processing of the correction target image data;
An image correction processing step for performing image processing including pixel value correction of a false color pixel around the image on the reduced image generated in the reduction processing step;
An enlargement process step for executing an enlargement process of the corrected image generated in the image correction process step;
A computer program characterized by comprising:
JP2004303794A 2004-10-19 2004-10-19 Image processing apparatus, image processing method, and computer program Expired - Fee Related JP4539280B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2004303794A JP4539280B2 (en) 2004-10-19 2004-10-19 Image processing apparatus, image processing method, and computer program

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2004303794A JP4539280B2 (en) 2004-10-19 2004-10-19 Image processing apparatus, image processing method, and computer program

Publications (2)

Publication Number Publication Date
JP2006121138A true JP2006121138A (en) 2006-05-11
JP4539280B2 JP4539280B2 (en) 2010-09-08

Family

ID=36538653

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2004303794A Expired - Fee Related JP4539280B2 (en) 2004-10-19 2004-10-19 Image processing apparatus, image processing method, and computer program

Country Status (1)

Country Link
JP (1) JP4539280B2 (en)

Cited By (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2006135744A (en) * 2004-11-08 2006-05-25 Sony Corp Image processing apparatus, image processing method, and computer program
JP2006135745A (en) * 2004-11-08 2006-05-25 Sony Corp Image processing apparatus and image processing method, and computer program
WO2008084670A1 (en) * 2006-12-26 2008-07-17 Nittoh Kogaku K.K Signal processing device
JP2009124598A (en) * 2007-11-16 2009-06-04 Canon Inc Image processor, and image processing method
JP2013046380A (en) * 2011-08-26 2013-03-04 Canon Inc Image processor, image processing method and program
JP2015204489A (en) * 2014-04-11 2015-11-16 ハンファテクウィン株式会社Hanwha Techwin Co.,Ltd. Image processing apparatus and image processing method
JP2016525840A (en) * 2013-07-26 2016-08-25 クゥアルコム・インコーポレイテッドQualcomm Incorporated System and method for correcting image artifacts
US9538076B2 (en) 2014-12-16 2017-01-03 Samsung Electronics Co., Ltd. Image processing devices for suppressing color fringe, and image sensor modules and electronic devices including the same
US9672599B2 (en) 2014-12-18 2017-06-06 Samsung Electronics Co., Ltd. Image processing devices for suppressing color fringe, and image sensor modules and electronic devices including the same
CN113905183A (en) * 2021-08-25 2022-01-07 珠海全志科技股份有限公司 Chromatic aberration correction method and device for wide dynamic range image
CN117522760A (en) * 2023-11-13 2024-02-06 书行科技(北京)有限公司 Image processing method, device, electronic equipment, medium and product

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH11313338A (en) * 1998-04-24 1999-11-09 Canon Inc Signal processor and photographing signal processing method
JP2000032482A (en) * 1998-07-14 2000-01-28 Canon Inc Signal processing unit, signal processing method and storage medium thereof
JP2000244939A (en) * 1999-02-19 2000-09-08 Canon Inc Image processing unit, its method and computer-readable storage medium
JP2002095009A (en) * 2000-09-14 2002-03-29 Olympus Optical Co Ltd Electronic camera and printer
JP2002262299A (en) * 2001-02-28 2002-09-13 Seiko Epson Corp False color elimination device, false color elimination program, false color elimination method and digital camera
JP2004272578A (en) * 2003-03-07 2004-09-30 Minolta Co Ltd Image pickup unit and distortion correction method
JP2006115039A (en) * 2004-10-13 2006-04-27 Sony Corp Image processor, image processing method and computer program

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH11313338A (en) * 1998-04-24 1999-11-09 Canon Inc Signal processor and photographing signal processing method
JP2000032482A (en) * 1998-07-14 2000-01-28 Canon Inc Signal processing unit, signal processing method and storage medium thereof
JP2000244939A (en) * 1999-02-19 2000-09-08 Canon Inc Image processing unit, its method and computer-readable storage medium
JP2002095009A (en) * 2000-09-14 2002-03-29 Olympus Optical Co Ltd Electronic camera and printer
JP2002262299A (en) * 2001-02-28 2002-09-13 Seiko Epson Corp False color elimination device, false color elimination program, false color elimination method and digital camera
JP2004272578A (en) * 2003-03-07 2004-09-30 Minolta Co Ltd Image pickup unit and distortion correction method
JP2006115039A (en) * 2004-10-13 2006-04-27 Sony Corp Image processor, image processing method and computer program

Cited By (16)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2006135745A (en) * 2004-11-08 2006-05-25 Sony Corp Image processing apparatus and image processing method, and computer program
JP2006135744A (en) * 2004-11-08 2006-05-25 Sony Corp Image processing apparatus, image processing method, and computer program
JP4539299B2 (en) * 2004-11-08 2010-09-08 ソニー株式会社 Image processing apparatus, image processing method, and computer program
JP4718618B2 (en) * 2006-12-26 2011-07-06 日東光学株式会社 Signal processing device
WO2008084670A1 (en) * 2006-12-26 2008-07-17 Nittoh Kogaku K.K Signal processing device
JPWO2008084670A1 (en) * 2006-12-26 2010-04-30 日東光学株式会社 Signal processing device
US8437539B2 (en) 2007-11-16 2013-05-07 Canon Kabushiki Kaisha Image processing apparatus and image processing method
JP2009124598A (en) * 2007-11-16 2009-06-04 Canon Inc Image processor, and image processing method
JP2013046380A (en) * 2011-08-26 2013-03-04 Canon Inc Image processor, image processing method and program
JP2016525840A (en) * 2013-07-26 2016-08-25 クゥアルコム・インコーポレイテッドQualcomm Incorporated System and method for correcting image artifacts
JP2015204489A (en) * 2014-04-11 2015-11-16 ハンファテクウィン株式会社Hanwha Techwin Co.,Ltd. Image processing apparatus and image processing method
US9538076B2 (en) 2014-12-16 2017-01-03 Samsung Electronics Co., Ltd. Image processing devices for suppressing color fringe, and image sensor modules and electronic devices including the same
US9672599B2 (en) 2014-12-18 2017-06-06 Samsung Electronics Co., Ltd. Image processing devices for suppressing color fringe, and image sensor modules and electronic devices including the same
CN113905183A (en) * 2021-08-25 2022-01-07 珠海全志科技股份有限公司 Chromatic aberration correction method and device for wide dynamic range image
CN113905183B (en) * 2021-08-25 2024-04-16 珠海全志科技股份有限公司 Color difference correction method and device for wide dynamic range image
CN117522760A (en) * 2023-11-13 2024-02-06 书行科技(北京)有限公司 Image processing method, device, electronic equipment, medium and product

Also Published As

Publication number Publication date
JP4539280B2 (en) 2010-09-08

Similar Documents

Publication Publication Date Title
JP4479457B2 (en) Image processing apparatus, image processing method, and computer program
JP4770154B2 (en) Image processing apparatus, image processing method, and computer program
KR102175164B1 (en) Apparatus and method for improving image quality
US7672541B2 (en) Registration of separations
JP4706635B2 (en) Image processing apparatus having color misregistration correction function, image processing program, and electronic camera
US8385641B2 (en) Method and apparatus for eliminating chromatic aberration
JP4539278B2 (en) Image processing apparatus, image processing method, and computer program
JP2009268033A (en) Image processing device, imaging device, control method, program, and memory medium
JP4539280B2 (en) Image processing apparatus, image processing method, and computer program
JP2008147980A (en) Image processor, image sensing device, method for processing image, program and recording medium
US8145014B2 (en) Apparatus and method of removing color noise of digital image
KR101257946B1 (en) Device for removing chromatic aberration in image and method thereof
JP4934839B2 (en) Image processing apparatus, method thereof, and program
JP7423033B2 (en) Image signal processing method
JP4539299B2 (en) Image processing apparatus, image processing method, and computer program
JP2006279162A (en) Method for inputting image and device for inputting image using the same
JP3899144B2 (en) Image processing device
JP6238673B2 (en) Image processing apparatus, imaging apparatus, imaging system, image processing method, image processing program, and storage medium
KR101517407B1 (en) Method and apparatus for canceling an chromatic aberration
JP6604737B2 (en) Image processing apparatus, imaging apparatus, image processing method, image processing program, and storage medium
JP6627422B2 (en) Image processing device, imaging device, control program
JP2017092800A (en) Image processing apparatus, imaging apparatus, image processing method, image processing program, and storage medium
JP2004289606A (en) Signal processing apparatus and method, recording medium, and program

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20071009

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20100122

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20100216

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20100414

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

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

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

Free format text: PAYMENT UNTIL: 20130702

Year of fee payment: 3

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

LAPS Cancellation because of no payment of annual fees