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

Image processing apparatus and image processing program Download PDF

Info

Publication number
JP4466015B2
JP4466015B2 JP2003307355A JP2003307355A JP4466015B2 JP 4466015 B2 JP4466015 B2 JP 4466015B2 JP 2003307355 A JP2003307355 A JP 2003307355A JP 2003307355 A JP2003307355 A JP 2003307355A JP 4466015 B2 JP4466015 B2 JP 4466015B2
Authority
JP
Japan
Prior art keywords
image
value
defect information
image processing
processing apparatus
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Expired - Lifetime
Application number
JP2003307355A
Other languages
Japanese (ja)
Other versions
JP2004222231A (en
Inventor
健一 石賀
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Nikon Corp
Original Assignee
Nikon 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
Priority to JP2003307355A priority Critical patent/JP4466015B2/en
Application filed by Nikon Corp filed Critical Nikon Corp
Priority to US10/540,972 priority patent/US7853097B2/en
Priority to EP03768277.0A priority patent/EP1583356B1/en
Priority to EP12157353.9A priority patent/EP2461576B1/en
Priority to CN200380107791.8A priority patent/CN1732682B/en
Priority to PCT/JP2003/016797 priority patent/WO2004062275A1/en
Priority to CN2010101265533A priority patent/CN101778222B/en
Priority to CN2010101265675A priority patent/CN101778203B/en
Publication of JP2004222231A publication Critical patent/JP2004222231A/en
Priority to US12/640,603 priority patent/US8031968B2/en
Application granted granted Critical
Publication of JP4466015B2 publication Critical patent/JP4466015B2/en
Priority to US13/222,842 priority patent/US8369651B2/en
Anticipated expiration legal-status Critical
Expired - Lifetime legal-status Critical Current

Links

Images

Landscapes

  • Image Input (AREA)
  • Image Processing (AREA)
  • Transforming Light Signals Into Electric Signals (AREA)
  • Studio Devices (AREA)

Description

本発明は、電子カメラ等で撮影した画像データにおいて、ゴミ等の影響を除去する画像処理装置に関する。   The present invention relates to an image processing apparatus that removes the influence of dust or the like in image data taken with an electronic camera or the like.

従来、ビデオカメラの製造時に光学系に混入したゴミの影響を補正するため、事前に各絞り値毎の白パターンを撮影して補正情報を記録しておく技術が、特開平9−51459号公報に開示されている。また、コピー機の分野では常に変化する可能性のあるゴミ対策として、原稿読み取り前に均一な反射面を有する白基準データを取り込んで、ゴミ検出する技術が、特開平10−294870号公報や特開平11−27475号公報に開示されている。さらに、スキャナー分野では、この白基準データの代わりの役割を果たすものとして、赤外光センサーを備え、可視光データと同時に透過率データを得て、フィルム欠陥による透過率の減衰信号を得る方法が、USP6,195,161号に開示されている。   Conventionally, in order to correct the influence of dust mixed in an optical system during the manufacture of a video camera, a technique for photographing a white pattern for each aperture value and recording correction information in advance is disclosed in Japanese Patent Laid-Open No. 9-51459. Is disclosed. Further, as a countermeasure against dust that may change constantly in the field of copying machines, a technique for detecting dust by taking in white reference data having a uniform reflecting surface before reading a document is disclosed in Japanese Patent Laid-Open No. 10-294870 and other special techniques. This is disclosed in Japanese Utility Model Publication No. 11-27475. Furthermore, in the scanner field, as a substitute for this white reference data, there is a method of providing an infrared light sensor, obtaining transmittance data simultaneously with visible light data, and obtaining a transmittance attenuation signal due to film defects. U.S. Pat. No. 6,195,161.

特開平9−51459号公報JP-A-9-51459 特開平10−294870号公報Japanese Patent Laid-Open No. 10-294870 特開平11−27475号公報Japanese Patent Laid-Open No. 11-27475 USP6,195,161号USP 6,195,161

しかし、従来のカメラでは、製造時に光学部品に付着した固定ゴミを対象としていたに過ぎず、使用頻度や時間の経過に伴って変化するゴミは考慮されてこなっかった。今日普及し始めた交換レンズ方式の一眼レフカメラでは、特に撮像素子前部の光学部品がむき出しのため、時間的に変化するゴミの写り込みが大きな問題となりやすい。   However, the conventional camera is only intended for fixed dust adhered to optical components at the time of manufacture, and dust that changes with the frequency of use or the passage of time has not been taken into account. In an interchangeable lens type single-lens reflex camera that has begun to spread today, the reflection of dust that changes with time tends to be a big problem, especially because the optical components at the front of the image sensor are exposed.

他方、コピー機やスキャナーでは本スキャンの前あるいは同時にゴミデータを取得して時間的に変化のあるゴミに対応している。しかし、カメラとは構造が異なって、固定距離にある原稿やフィルム面に対して一様な照明手段を有しており、更に完全に均一な反射面を備えたり、新たに赤外線照明手段を設けたりすることによって透過率データを得るのは比較的容易にできる。しかしながら、電子カメラでは製造時検査以外はそのような完全な一様面の透過率データを得にくいのが普通である。   On the other hand, in a copier or a scanner, dust data is acquired before or at the same time as the main scan to deal with dust having a temporal change. However, the structure is different from the camera, and it has a uniform illumination means for the original or film surface at a fixed distance, and it has a completely uniform reflection surface or a new infrared illumination means. By doing so, it is relatively easy to obtain transmittance data. However, it is usually difficult for electronic cameras to obtain such complete uniform surface transmittance data except for inspection during manufacturing.

また、コピー機、スキャナーは基本的に固定光学系であり、光学系の変化によりゴミが変化することを考慮する必要性がない。一方、従来のビデオカメラでは絞り値以外の光学的条件が変化することには対応していない。   Further, the copying machine and the scanner are basically fixed optical systems, and there is no need to consider that dust changes due to changes in the optical system. On the other hand, conventional video cameras do not cope with changes in optical conditions other than the aperture value.

本発明は、電子カメラ等で撮影された画像データから、ゴミの影響等を適切に除去することが可能な画像処理装置および画像処理プログラムを提供する。   The present invention provides an image processing apparatus and an image processing program that can appropriately remove the influence of dust and the like from image data captured by an electronic camera or the like.

請求項1の発明は、画像処理装置に適用され、撮像素子により撮影された画像を取得する画像取得手段と、取得した画像内において、着目画素の値と該着目画素を含む所定範囲内の複数の画素の値の平均値との相対比を算出する相対比算出手段と、算出した相対比に基づいて、画像内の欠陥情報を作成する欠陥情報作成手段と、欠陥情報に基づいて、画像内の欠陥を補正する補正手段とを備え、補正手段は、相対比の逆数値を、対応する画素の値に掛け算して補正することを特徴とするものである。
請求項2の発明は、請求項1に記載の画像処理装置において、画像取得手段は、撮像素子により撮影された複数の画像を取得し、欠陥情報作成手段は、取得した複数の画像を使用して、複数の画像のいずれかの画像内の欠陥情報を作成することを特徴とするものである。
請求項3の発明は、請求項1に記載の画像処理装置において、画像取得手段は、撮像素子により撮影された複数の画像を取得し、欠陥情報作成手段は、取得した複数の画像を使用して、複数の画像の画像全体に対応する欠陥情報を作成することを特徴とするものである。
請求項4の発明は、画像処理装置に適用され、光学系を通して撮影された基準画像を取得する画像取得手段と、取得した基準画像内において、着目画素の値と該着目画素を含む所定範囲内の複数の画素の値の平均値との相対比を算出する相対比算出手段と、算出した相対比に基づいて、基準画像内の欠陥情報を作成する欠陥情報作成手段とを備え、画像取得手段は、光学系を通して撮影された補正対象画像を取得し、基準画像内の欠陥情報に基づいて、補正対象画像内の欠陥を補正する補正手段を更に備え、補正手段は、基準画像の相対比の逆数値を、補正対象画像の対応する画素の値に掛け算して補正することを特徴とするものである。
請求項5の発明は、請求項4に記載の画像処理装置において、補正手段は、基準画像と補正対象画像とが、絞り値および瞳位置が実質的に同じ光学的条件の光学系を通して撮影されている場合、生成された欠陥情報をそのまま使用して、補正対象画像を構成する画素の値を補正することを特徴とするものである。
請求項6の発明は、請求項4に記載の画像処理装置において、光学系の光学的条件である絞り値および瞳位置の少なくとも1つに応じて、欠陥情報を変換する欠陥情報変換手段をさらに備え、補正手段は、基準画像と補正対象画像とが、絞り値および瞳位置の少なくとも1つが異なる光学的条件の光学系を通して撮影されている場合、変換された欠陥情報を使用して、補正対象画像を構成する画素の値を補正することを特徴とするものである。
請求項7の発明は、請求項1または4に記載の画像処理装置において、相対比算出手段は、算出した相対比が1を挟んだ所定範囲に含まれるとき、算出した相対比を1に設定することを特徴とするものである。
請求項8の発明は、請求項7に記載の画像処理装置において、相対比算出手段は、算出した相対比を1に設定する所定範囲を、算出した相対比の標準偏差値と関連づけることを特徴とするものである。
請求項9の発明は、請求項4に記載の画像処理装置において、画像取得手段は、補正対象画像の撮影前後の所定時間内に撮影された基準画像を取得することを特徴とするものである。
請求項10の発明は、請求項9に記載の画像処理装置において、画像取得手段は、補正対象画像の撮影時間に2番目以内に近い時間に撮影された基準画像を取得することを特徴とするものである。
請求項11の発明は、画像処理装置に適用され、複数色に分光可能な撮像素子を使用して撮影された画像を取得する画像取得手段と、画像の複数色の信号から輝度信号を生成する輝度信号生成手段と、取得した画像内において、着目画素の生成した輝度信号の値と該着目画素を含む所定範囲内の複数の画素の生成した輝度信号の平均値との相対比を算出する相対比算出手段と、算出した相対比に基づいて、画像内の欠陥情報を作成する欠陥情報作成手段と、欠陥情報に基づいて、画像内の欠陥画素の各色成分の値を補正する補正手段とを備え、補正手段は、相対比の逆数値を、対応する画素の各色成分の値毎に掛け算して補正することを特徴とするものである。
請求項12の発明は、請求項11に記載の画像処理装置において、画像取得手段は、撮像素子により撮影された複数の画像を取得し、輝度信号生成手段は、取得した複数の画像について輝度信号を生成し、欠陥情報作成手段は、生成された複数の画像の輝度信号を使用して、複数の画像のいずれかの画像内の欠陥情報を作成することを特徴とするものである。
請求項13の発明は、請求項11に記載の画像処理装置において、画像取得手段は、撮像素子により撮影された複数の画像を取得し、輝度信号生成手段は、取得した複数の画像について輝度信号を生成し、欠陥情報作成手段は、取得した複数の画像を使用して、複数の画像の画像全体に対応する欠陥情報を作成することを特徴とするものである。
請求項14の発明は、画像処理プログラムに適用され、請求項1〜13のいずれかに記載の画像処理装置の機能をコンピュータに実行させるものである。
The invention of claim 1 is applied to an image processing apparatus, and an image acquisition means for acquiring an image photographed by an image sensor, and a value of a pixel of interest and a plurality of pixels within a predetermined range including the pixel of interest in the acquired image. A relative ratio calculating means for calculating a relative ratio with the average value of the pixel values, a defect information generating means for generating defect information in the image based on the calculated relative ratio, and an in-image based on the defect information. The correction means corrects the defect by multiplying the value of the corresponding pixel by the inverse value of the relative ratio.
According to a second aspect of the present invention, in the image processing apparatus according to the first aspect, the image acquisition means acquires a plurality of images photographed by the image sensor, and the defect information creation means uses the acquired plurality of images. Thus, defect information in any one of a plurality of images is created.
According to a third aspect of the present invention, in the image processing apparatus according to the first aspect, the image acquisition means acquires a plurality of images taken by the image sensor, and the defect information creation means uses the acquired plurality of images. Thus, defect information corresponding to the entire image of a plurality of images is created.
The invention of claim 4 is applied to an image processing apparatus, and obtains a reference image taken through an optical system, and within the acquired reference image, a value of a pixel of interest and a predetermined range including the pixel of interest. An image acquisition means comprising: a relative ratio calculation means for calculating a relative ratio of the average value of the plurality of pixels; and a defect information creation means for creating defect information in the reference image based on the calculated relative ratio. Further includes a correction unit that acquires a correction target image captured through the optical system and corrects a defect in the correction target image based on defect information in the reference image, and the correction unit has a relative ratio of the reference image. The reciprocal value is corrected by multiplying the value of the corresponding pixel of the image to be corrected.
According to a fifth aspect of the present invention, in the image processing apparatus according to the fourth aspect, the correction means captures the reference image and the correction target image through an optical system having substantially the same aperture condition and pupil position. In this case, the generated defect information is used as it is, and the values of the pixels constituting the correction target image are corrected.
A sixth aspect of the present invention is the image processing apparatus according to the fourth aspect, further comprising defect information converting means for converting defect information according to at least one of an aperture value and a pupil position, which are optical conditions of the optical system. And the correction means uses the converted defect information to correct the correction target when the reference image and the correction target image are photographed through optical systems having different optical conditions at least one of the aperture value and the pupil position. It is characterized by correcting the values of the pixels constituting the image.
According to a seventh aspect of the present invention, in the image processing apparatus according to the first or fourth aspect, the relative ratio calculating means sets the calculated relative ratio to 1 when the calculated relative ratio is included in a predetermined range with 1 therebetween. It is characterized by doing.
According to an eighth aspect of the present invention, in the image processing apparatus according to the seventh aspect, the relative ratio calculating means associates a predetermined range in which the calculated relative ratio is set to 1 with a standard deviation value of the calculated relative ratio. It is what.
According to a ninth aspect of the present invention, in the image processing apparatus according to the fourth aspect, the image acquisition means acquires a reference image captured within a predetermined time before and after the correction target image is captured. .
According to a tenth aspect of the present invention, in the image processing apparatus according to the ninth aspect, the image acquisition means acquires a reference image captured at a time that is close to a second time within the imaging time of the correction target image. Is.
The invention of claim 11 is applied to an image processing apparatus, and an image acquisition means for acquiring an image photographed using an imaging device capable of splitting into a plurality of colors, and a luminance signal is generated from the signals of the plurality of colors of the image. Relative for calculating a relative ratio between the luminance signal value generated by the pixel of interest and the average value of the luminance signal generated by a plurality of pixels within a predetermined range including the pixel of interest in the acquired image in the acquired image A ratio calculating unit; a defect information generating unit that generates defect information in the image based on the calculated relative ratio; and a correcting unit that corrects the value of each color component of the defective pixel in the image based on the defect information. The correction means is characterized in that the reciprocal value of the relative ratio is multiplied and corrected for each value of each color component of the corresponding pixel.
According to a twelfth aspect of the present invention, in the image processing device according to the eleventh aspect, the image acquisition means acquires a plurality of images taken by the image sensor, and the luminance signal generation means determines the luminance signal for the acquired plurality of images. And the defect information creating means creates defect information in any one of the plurality of images using the luminance signals of the plurality of images generated.
According to a thirteenth aspect of the present invention, in the image processing apparatus according to the eleventh aspect, the image acquisition means acquires a plurality of images taken by the image sensor, and the luminance signal generation means determines the luminance signal for the acquired plurality of images. The defect information creating means creates defect information corresponding to the entire images of the plurality of images using the plurality of acquired images.
The invention of claim 14 is applied to an image processing program, and causes a computer to execute the function of the image processing apparatus according to any one of claims 1 to 13 .

本発明は、以上説明したように構成するので、次のような効果を奏する。電子カメラ等で撮影された画像内に含まれるゴミの影響等の欠陥情報を手軽な方法で適切に取得することができる。特に、基準画像にグラデーション等の完璧に一様でない要因が含まれていても、適切に排除して欠陥情報に変換することができる。また、この欠陥情報を利用して、ゴミの影響等を適切に除去することができる。   Since the present invention is configured as described above, the following effects can be obtained. It is possible to appropriately acquire defect information such as the influence of dust contained in an image photographed by an electronic camera or the like by an easy method. In particular, even if the reference image includes factors such as gradation that are not perfectly uniform, it can be appropriately eliminated and converted into defect information. Moreover, the influence of dust etc. can be appropriately removed using this defect information.

−第1の実施の形態−
(電子カメラおよびパーソナルコンピュータの構成)
図1は、交換レンズ方式の一眼レフ電子スチルカメラ(以下、電子カメラと言う)の構成を示す図である。電子カメラ1は、カメラ本体2とマウント式交換レンズからなる可変光学系3を有する。可変光学系3は、内部にレンズ4と絞り5を有する。レンズ4は複数の光学レンズ群から構成されるが、図では代表して1枚のレンズで表し、そのレンズ4の位置を主瞳位置と言う(以下、単に瞳位置と言う)。可変光学系3は、ズームレンズであってもよい。瞳位置は、レンズ種やズームレンズのズーム位置によって決まる値である。焦点距離によって変わることもある。
-First embodiment-
(Configuration of electronic camera and personal computer)
FIG. 1 is a diagram illustrating a configuration of an interchangeable lens type single-lens reflex electronic still camera (hereinafter referred to as an electronic camera). The electronic camera 1 has a variable optical system 3 including a camera body 2 and a mount type interchangeable lens. The variable optical system 3 has a lens 4 and a diaphragm 5 inside. Although the lens 4 is composed of a plurality of optical lens groups, in the figure, it is represented by a single lens, and the position of the lens 4 is referred to as a main pupil position (hereinafter simply referred to as the pupil position). The variable optical system 3 may be a zoom lens. The pupil position is a value determined by the lens type and the zoom position of the zoom lens. May vary depending on focal length.

カメラ本体2は、シャッター6、光学フィルターやカバーガラスなどの光学部品7、撮像素子8を有する。可変光学系3は、カメラ本体2のマウント部9に対して着脱可能である。また、可変光学系3は、マウント部9を介して、瞳位置に関する情報、絞り値に関する情報等の光学的パラメータを電子カメラ1の制御部17(図2)に送信する。絞り値は、例えばF2.8〜F22まで変化する。   The camera body 2 includes a shutter 6, an optical component 7 such as an optical filter or a cover glass, and an image sensor 8. The variable optical system 3 can be attached to and detached from the mount portion 9 of the camera body 2. Further, the variable optical system 3 transmits optical parameters such as information on the pupil position and information on the aperture value to the control unit 17 (FIG. 2) of the electronic camera 1 via the mount unit 9. The aperture value changes from F2.8 to F22, for example.

符号10は、撮像素子8前部の光学部品7の表面に付着したゴミを示す。可変光学系3の絞り値や瞳位置を変化させて、撮影画像に写り込んだゴミ影の変化を評価する実験を行った結果、以下の2つの事実が判った。
(1)絞り値によってゴミ影の大きさと光の透過率が変わる。
(2)レンズの瞳位置によってゴミ位置がずれる。
この2つの実験事実から固定位置に付着したゴミであっても、レンズの撮影条件(絞り値と瞳位置)が変化する度にゴミの写り込み方が変化していることがわかる。このような可変な光学系に対して、ゴミの影響を除去する手法を以下に示す。
Reference numeral 10 denotes dust adhering to the surface of the optical component 7 in front of the image sensor 8. As a result of an experiment for changing the aperture value and pupil position of the variable optical system 3 and evaluating the change of dust shadows reflected in the photographed image, the following two facts were found.
(1) The size of dust shadow and the light transmittance change depending on the aperture value.
(2) The dust position shifts depending on the pupil position of the lens.
From these two experimental facts, it can be seen that even if the dust is attached to the fixed position, the way the dust is reflected changes every time the photographing condition (aperture value and pupil position) of the lens changes. A technique for removing the influence of dust on such a variable optical system will be described below.

図2は、電子カメラ1のブロック図とPC(パーソナルコンピュータ)31および周辺装置を示す図である。PC31は、画像処理装置として機能し、電子カメラ1から画像データを取得し後述するゴミの影響除去処理をする。   FIG. 2 is a block diagram of the electronic camera 1, a PC (personal computer) 31, and a peripheral device. The PC 31 functions as an image processing apparatus, acquires image data from the electronic camera 1, and performs dust influence removal processing described later.

電子カメラ1は、可変光学系3、光学部品7、シャッター6(図2では図示省略)、撮像素子8、アナログ信号処理部12、A/D変換部13、タイミング制御部14、画像処理部15、操作部16、制御部17、メモリ18、圧縮/伸長部19、表示画像生成部20、モニタ21、メモリカード用インタフェース部22、外部インタフェース部23を備える。   The electronic camera 1 includes a variable optical system 3, an optical component 7, a shutter 6 (not shown in FIG. 2), an image sensor 8, an analog signal processing unit 12, an A / D conversion unit 13, a timing control unit 14, and an image processing unit 15. , An operation unit 16, a control unit 17, a memory 18, a compression / decompression unit 19, a display image generation unit 20, a monitor 21, a memory card interface unit 22, and an external interface unit 23.

撮像素子8は、可変光学系3を通して被写体を撮像し、撮像された被写体像に対応する画像信号(撮像信号)を出力する。撮像素子8は、複数の画素から構成される矩形形状の撮像領域を有し、各画素に蓄積された電荷に対応するアナログ信号である画像信号を、画素単位で順次、アナログ信号処理部12に出力する。撮像素子8は、例えば単板式カラーCCDなどで構成される。アナログ信号処理部12は、内部にCDS(相関2重サンプリング)回路や、AGC(オートゲインコントロール)回路などを有し、入力された画像信号に対して所定のアナログ処理を行う。A/D変換部13は、アナログ信号処理部12で処理されたアナログ信号をデジタル信号に変換する。タイミング制御部14は、制御部17により制御され、撮像素子8、アナログ信号処理部12、A/D変換部13、画像処理部15の各動作のタイミングを制御する。   The imaging element 8 images a subject through the variable optical system 3 and outputs an image signal (imaging signal) corresponding to the captured subject image. The imaging element 8 has a rectangular imaging region composed of a plurality of pixels, and sequentially outputs image signals, which are analog signals corresponding to the charges accumulated in the pixels, to the analog signal processing unit 12 in units of pixels. Output. The image sensor 8 is composed of, for example, a single-plate color CCD. The analog signal processing unit 12 includes a CDS (correlated double sampling) circuit, an AGC (auto gain control) circuit, and the like, and performs predetermined analog processing on the input image signal. The A / D conversion unit 13 converts the analog signal processed by the analog signal processing unit 12 into a digital signal. The timing control unit 14 is controlled by the control unit 17 and controls the timing of each operation of the image sensor 8, the analog signal processing unit 12, the A / D conversion unit 13, and the image processing unit 15.

メモリカード用インタフェース部22は、メモリカード(カード状のリムーバブルメモリ)30とのインタフェースをとる。外部インタフェース部23は、所定のケーブルや無線伝送路を介してPC31等の外部装置とのインタフェースをとる。操作部16は、レリーズボタンやモード切り換え用の選択ボタン等に相当する。モニタ21は、各種メニューを表示したり、撮像素子8で撮像した被写体像やメモリカードに格納された画像データに基づく再生画像を表示したりする。操作部16の出力は制御部17に接続され、モニタ21には表示画像生成部20の出力が接続される。画像処理部15は、例えば、画像処理専用の1チップ・マイクロプロセッサで構成される。   The memory card interface unit 22 interfaces with a memory card (card-like removable memory) 30. The external interface unit 23 interfaces with an external device such as the PC 31 via a predetermined cable or wireless transmission path. The operation unit 16 corresponds to a release button, a mode switching selection button, or the like. The monitor 21 displays various menus and displays a subject image captured by the image sensor 8 and a reproduced image based on image data stored in a memory card. The output of the operation unit 16 is connected to the control unit 17, and the output of the display image generation unit 20 is connected to the monitor 21. The image processing unit 15 is composed of, for example, a one-chip microprocessor dedicated to image processing.

A/D変換部13、画像処理部15、制御部17、メモリ18、圧縮/伸長部19、表示画像生成部20、メモリカード用インタフェース部22、外部インタフェース部23は、バス24を介して相互に接続されている。   The A / D conversion unit 13, the image processing unit 15, the control unit 17, the memory 18, the compression / decompression unit 19, the display image generation unit 20, the memory card interface unit 22, and the external interface unit 23 are mutually connected via a bus 24. It is connected to the.

PC31には、モニタ32やプリンタ33等が接続されており、CD−ROM34に記録されたアプリケーションプログラムが予めインストールされている。また、PC31は、不図示のCPU、メモリ、ハードディスクの他に、メモリカード30とのインタフェースをとるメモリカード用インタフェース部(不図示)や所定のケーブルや無線伝送路を介して電子カメラ1等の外部装置とのインタフェースをとる外部インタフェース部(不図示)を備える。   A monitor 32, a printer 33, and the like are connected to the PC 31, and an application program recorded on the CD-ROM 34 is installed in advance. In addition to a CPU, a memory, and a hard disk (not shown), the PC 31 includes a memory card interface unit (not shown) that interfaces with the memory card 30, an electronic camera 1, etc. via a predetermined cable or wireless transmission path. An external interface unit (not shown) that interfaces with an external device is provided.

図1のような構成の電子カメラ1において、操作部16を介し、操作者によって撮影モードが選択されてレリーズボタンが押されると、制御部17は、タイミング制御部14を介して、撮像素子8、アナログ信号処理部12、A/D変換部13に対するタイミング制御を行う。撮像素子8は、可変光学系3により撮像領域に結像された光学像に対応する画像信号を生成する。その画像信号は、アナログ信号処理部12で所定のアナログ信号処理が行われ、アナログ処理後画像信号としてA/D変換部13へ出力される。A/D変換部13では、アナログ処理後の画像信号をディジタル化し、画像データとして、画像処理部15に供給する。   In the electronic camera 1 configured as shown in FIG. 1, when the shooting mode is selected by the operator via the operation unit 16 and the release button is pressed, the control unit 17 causes the image sensor 8 to operate via the timing control unit 14. The timing control is performed on the analog signal processing unit 12 and the A / D conversion unit 13. The imaging element 8 generates an image signal corresponding to the optical image formed in the imaging area by the variable optical system 3. The image signal is subjected to predetermined analog signal processing in the analog signal processing unit 12, and is output to the A / D conversion unit 13 as an image signal after analog processing. The A / D conversion unit 13 digitizes the analog-processed image signal and supplies it to the image processing unit 15 as image data.

本実施の形態の電子カメラ1では、撮像素子8において、単板式カラー撮像素子の最も代表的なR(赤)、G(緑)、B(青)のカラーフィルタがベイア配列されている場合を例にとり、画像処理部15に供給される画像データはRGB表色系で示されるものとする。画像データを構成する各々の画素には、RGBの何れか1つの色成分の色情報が存在する。ここで、撮像素子8を構成する1つの光電変換素子を画素と言うが、この画素に対応した画像データの1単位も画素と言う。また、画像も複数の画素から構成される概念である。   In the electronic camera 1 of the present embodiment, the image sensor 8 has a case where the most representative R (red), G (green), and B (blue) color filters of a single-plate color image sensor are arranged in a Bayer array. For example, it is assumed that the image data supplied to the image processing unit 15 is represented in the RGB color system. Each pixel constituting the image data has color information of any one of RGB color components. Here, one photoelectric conversion element constituting the image sensor 8 is referred to as a pixel, and one unit of image data corresponding to this pixel is also referred to as a pixel. An image is also a concept composed of a plurality of pixels.

画像処理部15は、このような画像データに対し、補間、階調変換や輪郭強調などの画像処理を行う。このような画像処理が完了した画像データは、必要に応じて、圧縮/伸長部19で所定の圧縮処理が施され、メモリカード用インタフェース部22を介してメモリカード30に記録される。画像処理が完了した画像データは、圧縮処理を施さずにメモリカード30に記録してもよい。   The image processing unit 15 performs image processing such as interpolation, gradation conversion, and contour enhancement on such image data. The image data that has undergone such image processing is subjected to predetermined compression processing by the compression / decompression unit 19 as necessary, and is recorded in the memory card 30 via the memory card interface unit 22. Image data for which image processing has been completed may be recorded on the memory card 30 without being subjected to compression processing.

画像処理が完了した画像データは、メモリカード30を介してPC31に提供される。外部インターフェース23および所定のケーブルや無線伝送路を介してPC31に提供してもよい。画像処理が完了した画像データは、補間処理が完了し、各画素にはRGBのすべての色成分の色情報が存在するものとする。   The image data for which image processing has been completed is provided to the PC 31 via the memory card 30. It may be provided to the PC 31 via the external interface 23 and a predetermined cable or wireless transmission path. It is assumed that the image data for which image processing has been completed has undergone interpolation processing, and color information of all RGB color components is present in each pixel.

(ゴミの影響除去処理)
次に、撮影した各画像データにおいて、ゴミの影響を除去する処理について説明する。第1の実施の形態では、各光学的撮影条件毎にゴミ情報を得るための基準画像を、毎回、電子カメラ1で撮影する場合を想定する。ただし、基準画像は、完全に一様な白基準データではなく、青空、一様に近い壁面、グレーチャート、無地の紙面などを撮影して代用するものとする。この場合の基準データは、レンズの周辺減光や被写体のグラデーション、撮像素子のシェーディングなどが含まれていてもよい。基準データは、実際に身近な場所で容易に撮影できる状況で取得できる場合を想定しており、厳密な一様性は要求せず、画像処理側のアルゴリズムで一様なものに変換する。
(Dust removal process)
Next, processing for removing the influence of dust in each captured image data will be described. In the first embodiment, it is assumed that a reference image for obtaining dust information for each optical shooting condition is shot with the electronic camera 1 every time. However, the reference image is not a completely uniform white reference data, but a blue sky, a nearly uniform wall surface, a gray chart, a plain paper surface, or the like is photographed and used instead. The reference data in this case may include lens peripheral light reduction, subject gradation, image sensor shading, and the like. It is assumed that the reference data can be acquired in a situation where it can be easily photographed at a location that is actually familiar, and does not require strict uniformity, and is converted into a uniform one by an algorithm on the image processing side.

(電子カメラ側の動作)
図3は、第1の実施の形態における、電子カメラ1側の撮影手順について説明する図である。1)瞳位置P1絞り値A1で通常撮影101を行い、補正対象画像データ1を出力する。2)引き続き、同じ瞳位置P1絞り値A1で一様面撮影102を行い、基準画像データ1を出力する。3)次に、異なる瞳位置P2、絞り値A2で通常撮影103を行い、補正対象画像データ2を出力する。4)引き続き、通常撮影103と同じ瞳位置P2絞り値A2で一様面撮影104を行い、基準画像データ2を出力する。すなわち、まず、電子カメラ1を撮影したい被写体に向けた撮影を行い(通常撮影)、直後に電子カメラ1を空や壁面に向けて一様な面の撮影を行う(一様面撮影)。あるいは、カメラは通常撮影のときと同じ状態で、レンズの前数cm〜10cm程度のところに白い紙あるいは一様な色の紙をかざすだけでもよい。このようにして、通常撮影と一様面撮影とを一対とした撮影動作を行う。ここで、画像データを出力するとは、メモリカード30に記録したり、外部インターフェース23を介してPC31に直接出力したりすることを言う。
(Operation on the electronic camera side)
FIG. 3 is a diagram for describing a photographing procedure on the electronic camera 1 side in the first embodiment. 1) Normal photographing 101 is performed at the pupil position P1 aperture value A1, and the correction target image data 1 is output. 2) Subsequently, uniform plane imaging 102 is performed at the same pupil position P1 aperture value A1, and the reference image data 1 is output. 3) Next, normal imaging 103 is performed at a different pupil position P2 and aperture value A2, and correction target image data 2 is output. 4) Subsequently, the uniform plane imaging 104 is performed at the same pupil position P2 aperture value A2 as in the normal imaging 103, and the reference image data 2 is output. That is, first, the electronic camera 1 is photographed toward a subject to be photographed (normal photographing), and immediately after that, the electronic camera 1 is photographed toward the sky or a wall surface (uniform surface photographing). Alternatively, the camera may be in the same state as in normal shooting, and a white paper or uniform color paper may be held over a few cm to 10 cm in front of the lens. In this way, a shooting operation is performed in which normal shooting and uniform plane shooting are paired. Here, outputting image data means recording on the memory card 30 or directly outputting to the PC 31 via the external interface 23.

電子カメラではゴミの状態が変化する可能性があるので、本実施の形態では、一様面の撮影を補正対象画像の撮影の直後の同一光学的条件のままで行っている。しかし、実際にはこれほど厳密に時間的に直後でなくてもよい。光学的に瞳位置と絞り値について同じ撮影条件が再現できる場合は、一日程度経って撮影した一様面データでも、かなりのゴミは大きく変化せずに使えることが多い。したがって、一様面データは、同一の光学的条件を再現し、通常撮影時のゴミ情報を十分反映できる程度の時間差内に撮影したものであれば、代用することは可能である。なお、通常撮影と一様面撮影の順序を入れ換えて、先に一様面撮影をし引き続き通常撮影をするようにしてもよい。   Since there is a possibility that the state of dust is changed in the electronic camera, in this embodiment, photographing of a uniform surface is performed with the same optical condition immediately after photographing of the correction target image. However, actually, it does not have to be so strictly in time. If the same shooting conditions can be reproduced optically for the pupil position and aperture value, a lot of dust can be used without much change even with uniform plane data shot after about a day. Therefore, the uniform surface data can be substituted if it is taken within a time difference that reproduces the same optical conditions and sufficiently reflects dust information during normal photography. Note that the order of normal imaging and uniform plane imaging may be interchanged so that uniform plane imaging is performed first and normal imaging is continued.

(画像処理装置側動作)
電子カメラ1で撮影された画像データは、所定の画像処理がなされた後PC31に提供される。PC31では、一対の補正対象画像データと基準画像データとを使用して、ゴミの影響除去処理を行う。PC31は、ゴミの影響除去処理を行う画像処理装置と言ってもよい。基準画像データ、補正対象画像データともにベイヤ配列のRGB補間処理は済んだ状態でPC31に入力される。以下で説明する基準画像データと補正対象画像データは、同一の瞳位置と絞り値の光学的条件下で撮影されたデータである。図6は、PC31で行う処理の流れを示すフローチャートである。
(Image processing device side operation)
Image data captured by the electronic camera 1 is provided to the PC 31 after predetermined image processing. The PC 31 performs dust removal processing using a pair of correction target image data and reference image data. The PC 31 may be said to be an image processing apparatus that performs dust removal processing. Both the reference image data and the correction target image data are input to the PC 31 in a state where the RGB interpolation processing of the Bayer array is completed. The reference image data and the correction target image data described below are data captured under optical conditions of the same pupil position and aperture value. FIG. 6 is a flowchart showing the flow of processing performed by the PC 31.

<基準画像データに対する処理>
1)輝度面の生成
図6のステップS11では、輝度面の生成を行う。基準画像データの各画素[i,j]について、次の式(1)を使用して、RGB信号から輝度信号を生成する。[i,j]は画素の位置を示す。
Y[i,j]=(R[i,j]+2*G[i,j]+B[i,j])/4 ...(1)
RGB各面で個別に解析することも可能であるが、基本的にゴミ影の影響は信号の減衰を生じるのみで、色成分に関係ない。従って、ここでは全ての情報を有効に使いつつ、ランダムノイズの影響を低減させることが可能な輝度成分への変換を行っている。また、そうすることにより、RGB3面から輝度成分単面だけの解析で済み、高速化が図れる。輝度成分生成比率は上記に限らず、R:G:B=0.3:0.6:0.1等であってもよい。
<Processing for reference image data>
1) Generation of Luminance Surface In step S11 in FIG. 6, a luminance surface is generated. For each pixel [i, j] of the reference image data, a luminance signal is generated from the RGB signal using the following equation (1). [i, j] indicates the position of the pixel.
Y [i, j] = (R [i, j] + 2 * G [i, j] + B [i, j]) / 4 ... (1)
Although it is possible to individually analyze each of the R, G, and B surfaces, basically, the influence of dust shadows only causes signal attenuation and is not related to color components. Therefore, here, conversion to a luminance component that can reduce the influence of random noise while effectively using all information is performed. In addition, by doing so, it is only necessary to analyze the luminance component single surface from the RGB3 surface, and the speed can be increased. The luminance component generation ratio is not limited to the above, and may be R: G: B = 0.3: 0.6: 0.1 or the like.

2)透過率マップの生成(ゲインマップ抽出)
ステップS12では、以下の処理からなる透過率マップの生成(ゲインマップ抽出)を行う。
2−1)局所的規格化処理(ゲイン抽出処理)
基準画像データは、上述したように必ずしも完全に一様なものでない。従って、生成した輝度面も完全に一様ではない。このような輝度面に対して、局所的な画素値の規格化(正規化)処理を行って、各画素の透過率信号T[i,j]を、次式(2)を使用して算出する。すなわち、着目画素[i,j]の値とこの画素を含む局所範囲の画素平均値との相対比を各々の画素についてとる。これにより一様面データに含まれるグラデーション、シェーディング等の不均一性はアルゴリズム的に問題なく排除され、肝心のゴミ影による透過率の低下のみを抽出することができる。このようにして求めた画像全面の透過率を透過率マップ(ゲインマップ)と言う。透過率マップは、基準画像の欠陥情報を示すものである。なお、画素値とは、各画素における色成分の色信号(色情報)や輝度信号(輝度情報)の値である。例えば、1バイトで表される場合、0〜255の値を取る。

Figure 0004466015
2) Transmission map generation (Gain map extraction)
In step S12, a transmission map (gain map extraction) including the following processing is performed.
2-1) Local normalization processing (gain extraction processing)
As described above, the reference image data is not necessarily completely uniform. Therefore, the generated luminance surface is not completely uniform. A local pixel value normalization process is performed on such a luminance plane, and the transmittance signal T [i, j] of each pixel is calculated using the following equation (2). To do. That is, the relative ratio between the value of the pixel of interest [i, j] and the average pixel value in the local range including this pixel is determined for each pixel. As a result, nonuniformities such as gradation and shading included in the uniform surface data are eliminated without problems in terms of algorithm, and only a decrease in transmittance due to dust shadows can be extracted. The transmittance of the entire image obtained in this way is called a transmittance map (gain map). The transmittance map indicates defect information of the reference image. The pixel value is a value of a color signal (color information) or a luminance signal (luminance information) of a color component in each pixel. For example, when represented by 1 byte, it takes a value from 0 to 255.
Figure 0004466015

ここで、局所平均を取る範囲(2a+1)x(2b+1)画素は、ゴミ径より大きめにとる。理想的には面積的にゴミ影よりも3倍程度以上の広さを取れば、正確な透過率データが得れらる。aは着目画素[i,j]を中心に左右に広がる画素数、bは着目画素[i,j]を中心に上下に広がる画素数を示す。例えば、撮像素子8の画素ピッチを12umとし、撮像面とゴミ付着面との距離を1.5mmとすると、絞り値F22のとき、巨大なゴミの直径は15画素程度、絞り値F4のとき、巨大なゴミの直径は40画素程度となる。従って、a=40、b=40とし、局所平均を取る範囲は81×81画素範囲のように設定するとよい。これは、一例であり、他の画素数による画素範囲であってもよい。   Here, the range (2a + 1) × (2b + 1) pixels for which the local average is taken is larger than the dust diameter. Ideally, if the area is about 3 times larger than the dust shadow, accurate transmittance data can be obtained. a represents the number of pixels extending left and right around the pixel of interest [i, j], and b represents the number of pixels extending up and down around the pixel of interest [i, j]. For example, if the pixel pitch of the image sensor 8 is 12 um and the distance between the imaging surface and the dust adhesion surface is 1.5 mm, when the aperture value is F22, the diameter of the huge dust is about 15 pixels and the aperture value is F4. The diameter of huge garbage is about 40 pixels. Therefore, it is preferable to set a = 40, b = 40, and set the local average range as an 81 × 81 pixel range. This is an example, and may be a pixel range based on other numbers of pixels.

ゴミ影は絞り値に大きく依存し、小さなゴミは絞りを開けるとすぐに消滅するが、大きなゴミは絞りを開放側にしても影は薄くなりながらも大きな面積を占めることがある。撮像素子の画素ピッチ幅にもよるが、開放側で数十画素に渡って丸いゴミ影ができる場合があり、そのときは非常に広い範囲で局所平均をとる必要性が出る。そのため、処理を高速化する場合は、間引いた画素で代表して処理しても問題ない。   The dust shadow greatly depends on the aperture value, and the small dust disappears as soon as the aperture is opened. However, the large dust may occupy a large area even though the shadow is thin even when the aperture is opened. Depending on the pixel pitch width of the image sensor, there may be a case where a round dust shadow is formed over several tens of pixels on the open side, and in that case, it becomes necessary to take a local average over a very wide range. Therefore, in order to increase the processing speed, there is no problem even if the processing is representatively performed with thinned pixels.

この(2a+1)x(2b+1)画素の範囲で相対比を演算する処理を、局所的規格化処理(ゲイン抽出処理)と呼ぶ。(2a+1)x(2b+1)画素の範囲で相対化演算するフィルタのことを、ゲイン抽出カーネルと呼んでもよい。図4は、輝度面に対して局所的規格化処理を施した様子を示す図である。図4(a)は、輝度面内のある横方向に並ぶ画素の輝度信号を示す図である。符号41と符号42は、ゴミにより輝度信号が低下していることを示す。図4(b)は、図4(a)の輝度信号に対して、上述した局所的規格化処理を施して得られた図である。すなわち、局所的な範囲で画素値の規格化処理を行ったものである。符号43、44は、図4(a)の符号41、42に対応し、ゴミが存在する個所の透過率を示す。このように、一様面データに含まれるグラデーション、シェーディング等の不均一性は排除され、ゴミ影による透過率の低下のみを抽出することができる。これにより、ゴミの位置と透過率の程度が同時に分かる。   The process of calculating the relative ratio in the range of (2a + 1) x (2b + 1) pixels is referred to as a local normalization process (gain extraction process). A filter that performs a relativization operation in the range of (2a + 1) x (2b + 1) pixels may be called a gain extraction kernel. FIG. 4 is a diagram illustrating a state in which the local normalization process is performed on the luminance surface. FIG. 4A is a diagram illustrating luminance signals of pixels arranged in a certain horizontal direction in the luminance plane. Reference numerals 41 and 42 indicate that the luminance signal is reduced due to dust. FIG. 4B is a diagram obtained by performing the above-described local normalization processing on the luminance signal of FIG. That is, pixel value normalization processing is performed in a local range. Reference numerals 43 and 44 correspond to the reference numerals 41 and 42 in FIG. 4A, and indicate the transmittance of the places where dust exists. In this way, nonuniformities such as gradation and shading included in the uniform surface data are eliminated, and only a decrease in transmittance due to dust shadows can be extracted. Thereby, the position of the dust and the degree of transmittance can be known at the same time.

2−2)透過率マップのローパス処理
透過率マップのローパス処理は選択可能としてもよいが、大部分で効果があるのでこの処理を入れておくのが好ましい。透過率信号T[i,j]には、輝度信号の量子論的揺らぎに伴うランダムノイズが含まれているため、透過率が1に近いレベルで微妙にゴミ影の影響が残っている領域は、そのランダム性のため以下に続く2−4)の閾値判定を行うと、斑にゴミ影を抽出することがある。それを防ぐため、次式(3)によるローパスフィルタによりゴミ影の集団化を行うとやや見栄えがよくなる。
T[i,j]={4*T[i,j]
+2*(T[i-1,j]+T[i+1,j]+T[i,j-1]+T[i,j+1])
+1*(T[i-1,j-1]+T[i-1,j+1]+T[i+1,j-1]+T[i+1,j+1])}/16 ...(3)
2-2) Low-pass processing of transmittance map The low-pass processing of the transmittance map may be selectable, but it is preferable to include this processing because it is effective for the most part. Since the transmittance signal T [i, j] includes random noise associated with the quantum fluctuation of the luminance signal, there is a region where the influence of dust shadows remains slightly at a level where the transmittance is close to 1. Because of the randomness, when the threshold determination in 2-4) following is performed, dust shadows may be extracted from the spots. In order to prevent this, if the dust shadows are grouped by the low-pass filter according to the following equation (3), the appearance will be slightly improved.
T [i, j] = {4 * T [i, j]
+ 2 * (T [i-1, j] + T [i + 1, j] + T [i, j-1] + T [i, j + 1])
+ 1 * (T [i-1, j-1] + T [i-1, j + 1] + T [i + 1, j-1] + T [i + 1, j + 1])} / 16 ... (3)

2−3)透過率マップの統計解析
前述の局所的規格化処理により得られた透過率マップの画像全面について、平均値Mを次式(4)により求め、標準偏差σを次式(5)により求める統計解析を行う。なお、Nx,Nyは、x方向、y方向の総画素数を表す。

Figure 0004466015
Figure 0004466015
2-3) Statistical analysis of transmittance map For the entire image of the transmittance map obtained by the above-described local normalization processing, the average value M is obtained by the following equation (4), and the standard deviation σ is obtained by the following equation (5). The statistical analysis obtained by Nx and Ny represent the total number of pixels in the x and y directions.
Figure 0004466015
Figure 0004466015

2−4)閾値判定
基本的に透過率マップに占めるゴミ信号の面積的な割合は非常に小さく、2−3)で統計解析した結果は、透過率信号の量子論的揺らぎに伴うランダムノイズ(ショットノイズ)を評価していることになる。図4における符号45部分を拡大した符号46は、この細かいランダムノイズがある様子を示している。透過率マップのヒストグラムをとると、平均値M(Mはほぼ1に近い値)を中心に標準偏差σの正規分布した形となる。図5は、透過率マップのヒストグラムを示す図である。この揺らぎの範囲はゴミ影による透過率の変化を受けていないと考えられるため、強制的に透過率を1に設定してよい。すなわち、次の条件(6)(7)により閾値判定を行う。
if |T[i,j]-M|≦3σ then T[i,j]=1 ...(6)
else T[i,j]=T[i,j] ...(7)
2-4) Threshold judgment Basically, the area ratio of dust signals in the transmittance map is very small, and the statistical analysis result in 2-3) shows that random noise (quantum fluctuations in the transmittance signal) (Shot noise) is being evaluated. Reference numeral 46 obtained by enlarging the reference numeral 45 in FIG. 4 shows a state in which there is this fine random noise. When a histogram of the transmittance map is taken, a normal distribution with a standard deviation σ centering on an average value M (M is a value close to 1) is obtained. FIG. 5 is a diagram showing a histogram of the transmittance map. Since it is considered that the fluctuation range is not subjected to a change in transmittance due to dust shadows, the transmittance may be forcibly set to 1. That is, threshold determination is performed under the following conditions (6) and (7).
if | T [i, j] -M | ≦ 3σ then T [i, j] = 1 ... (6)
else T [i, j] = T [i, j] ... (7)

正規分布するランダムデータは、±3σの範囲を集めれば99.7%になるので、ほぼ正確にランダムノイズの影響を除外することができる。±3σから外れる透過率は、ほとんど統計的な誤差では説明できない異常な信号であり、ゴミ影による透過率の低下による現象を表していると考えられる。この異常部分は、ゴミ影の場合、通常1より小さな値となる。   Since the normally distributed random data is 99.7% if the range of ± 3σ is collected, the influence of random noise can be excluded almost accurately. The transmittance deviating from ± 3σ is an abnormal signal that can hardly be explained by statistical errors, and is considered to represent a phenomenon caused by a decrease in transmittance due to dust shadows. This abnormal portion is usually a value smaller than 1 in the case of dust shadows.

しかし、割合は少ないが1より大きな値を示すものもある。これはゴミ影の影響ではなく、オプティカルローパスフィルタ等の脈理(屈折率の不均一)で生じた欠陥が入射光を強めあったり弱めあったりする干渉縞を起こした場合などに見られる現象である。これにより、光路途中に含まれるゴミ以外の光学部材の欠陥検出にもこの方法は利用することができる。また、撮像素子内の画素欠陥の影響もこの手法で判別可能である。ゴミは、撮像素子8に近い方がボケずに残りやすいが、撮影レンズ上のゴミが相当ボケて写り込んだ場合でも精度よく判別可能である。   However, there are some which show a value larger than 1 although the ratio is small. This is not the effect of dust shadows, but is a phenomenon seen when defects caused by striae (non-uniform refractive index) of optical low-pass filters cause interference fringes that make incident light stronger or weaker. is there. Thereby, this method can also be used for detecting defects of optical members other than dust contained in the optical path. Further, the influence of pixel defects in the image sensor can also be determined by this method. Although dust is more likely to remain near the image sensor 8 without being blurred, it can be accurately determined even when dust on the photographing lens is reflected with considerable blur.

なお、ゴミ影の影響のみを取り除く場合は、以下の条件(8)(9)(10)により閾値判定するとよい。
if |T[i,j]-M|≦3σ then T[i,j]=1 ...(8)
else if T[i,j]>1 T[i,j]=1 ...(9)
else T[i,j]=T[i,j] ...(10)
判定に使う平均値Mは常に1に近い値をとるため、1に置き換えてもよい。
In order to remove only the influence of dust shadows, the threshold value may be determined according to the following conditions (8), (9), and (10).
if | T [i, j] -M | ≦ 3σ then T [i, j] = 1 ... (8)
else if T [i, j]> 1 T [i, j] = 1 ... (9)
else T [i, j] = T [i, j] ... (10)
Since the average value M used for determination always takes a value close to 1, it may be replaced with 1.

このようにして、欠陥の画素位置を表すマップ情報(T=1か否かで判断)と、欠陥の度合いを表す透過率情報の2種類の欠陥情報が同時に得られることになる。なお、上述の透過率マップは局所的な相対ゲインを表していることからゲインマップと呼んでもよい。   In this way, two types of defect information, map information (determined based on whether T = 1) or not, and transmittance information representing the degree of defect, can be obtained at the same time. Note that the transmittance map described above may be referred to as a gain map because it represents a local relative gain.

通常、ゴミ等の欠陥検出は、エッジ検出用の微分フィルタで行う。しかし、光路途中のゴミを対象とする場合、光学的にぼけるため非常に周辺とのコントラストが低いゴミ影となって現れる。このような場合、微分フィルタでは非常に感度が悪くほとんど検知できないことが多い。しかし、上記説明したように、透過率の統計的性質を用いた判定法を用いると、非常に高感度のゴミ検出が可能となり、目的の光路途中の異物による影響補正が可能となる。   Usually, a defect such as dust is detected by a differential filter for edge detection. However, when dust in the middle of the optical path is targeted, it appears as a dust shadow with very low contrast with the surroundings due to optical blurring. In such a case, the differential filter is very insensitive and can hardly be detected. However, as described above, when a determination method using the statistical property of transmittance is used, it is possible to detect dust with very high sensitivity, and it is possible to correct the influence of foreign matter in the target optical path.

<補正対象画像に対する処理>
3)ゲイン補正
ステップS13では、ゲイン補正を行う。上記のように求めた透過率マップを使用して補正対象画像データの補正を行う。補正対象画像データのR,G,B値各々に対して、式(11)(12)(13)で示すように、透過率信号の逆数を掛け算してゲイン補正を行う。
R[i,j]=R[i.j]/T[i,j] ...(11)
G[i,j]=G[i.j]/T[i,j] ...(12)
B[i,j]=B[i.j]/T[i,j] ...(13)
<Processing for correction target image>
3) Gain correction In step S13, gain correction is performed. The correction target image data is corrected using the transmittance map obtained as described above. As shown in equations (11), (12), and (13), gain correction is performed by multiplying the R, G, and B values of the correction target image data by the reciprocal of the transmittance signal.
R [i, j] = R [ij] / T [i, j] ... (11)
G [i, j] = G [ij] / T [i, j] ... (12)
B [i, j] = B [ij] / T [i, j] ... (13)

これにより、ゴミ影による輝度の低下をきれいに補正できる。加えて、補正の必要性のない所は透過率マップが閾値判定されているため、余計な補正を行わないようにできる。すなわち、ゴミのない箇所の透過率Tにはランダムノイズの影響が取り除かれているので、RGB信号のノイズが増幅される心配がない。   As a result, a decrease in luminance due to dust shadows can be neatly corrected. In addition, it is possible to prevent unnecessary correction since the transmittance map is subjected to threshold determination in places where there is no need for correction. That is, since the influence of random noise is removed from the transmittance T of the dust-free portion, there is no concern that the noise of the RGB signal is amplified.

以上のように、第1の実施の形態では、ゴミ対策用の特別な機構を備えていない普通の電子カメラでも、任意の時刻に撮影した画像を適切に補正することができる。基準画像の一様面の撮影には厳密な均一性が要求しないので、比較的手軽に実現することが可能となる。更に、従来のゴミ検出法に比べ、格段に感度のよい検出及び補正が可能となる。   As described above, in the first embodiment, an image captured at an arbitrary time can be corrected appropriately even with an ordinary electronic camera that does not include a special mechanism for preventing dust. Since photographing of the uniform surface of the reference image does not require strict uniformity, it can be realized relatively easily. In addition, detection and correction can be performed with much higher sensitivity than conventional dust detection methods.

−第2の実施の形態−
第2の実施の形態では、ゴミ情報を得るための基準画像を一度だけ撮影し、光学的撮影条件の異なる複数の画像に対してもこの基準画像を利用してゴミ除去する方法を示す。電子カメラ1および画像処理装置としてのPC31の構成は、第1の実施の形態と同様であるので、その説明を省略する。
-Second Embodiment-
In the second embodiment, a reference image for obtaining dust information is photographed only once, and a dust removal method using a plurality of images having different optical photographing conditions is also shown using this reference image. Since the configuration of the electronic camera 1 and the PC 31 as the image processing apparatus is the same as that of the first embodiment, description thereof is omitted.

(電子カメラ側の動作)
図7は、第2の実施の形態における、電子カメラ1側の撮影手順について説明する図である。1)瞳位置P0、絞り値A0で一様面撮影201を行い、基準画像データ0を出力する。2)瞳位置P1、絞り値A1で通常撮影202を行い、補正対象画像データ1を出力する。3)瞳位置P2、絞り値A2で通常撮影203を行い、補正対象画像データ2を出力する。4)瞳位置P3、絞り値A3で通常撮影204を行い、補正対象画像データ3を出力する。すなわち、まず、電子カメラ1を空や壁面に向けて一様な面の撮影を行い(一様面撮影)、その後、電子カメラ1を撮影したい被写体に向けて随時撮影する(通常撮影)。
(Operation on the electronic camera side)
FIG. 7 is a diagram for describing a shooting procedure on the electronic camera 1 side in the second embodiment. 1) Uniform plane photography 201 is performed at the pupil position P0 and the aperture value A0, and the reference image data 0 is output. 2) The normal photographing 202 is performed at the pupil position P1 and the aperture value A1, and the correction target image data 1 is output. 3) The normal photographing 203 is performed at the pupil position P2 and the aperture value A2, and the correction target image data 2 is output. 4) The normal photographing 204 is performed at the pupil position P3 and the aperture value A3, and the correction target image data 3 is output. That is, first, the electronic camera 1 is photographed with a uniform surface facing the sky or a wall surface (uniform surface photographing), and then the electronic camera 1 is photographed as needed toward the subject to be photographed (normal photographing).

ここで、基準画像の絞り値A0は、可変光学系3に用意された可変な範囲の中で最も絞り込んだ状態で撮影するものとする。最も絞り込んだ絞り値は、標準的なレンズでは例えばF22程度である。一方、補正対象画像の絞り値は、基準画像と同じか、それより開放側であるものとする。   Here, it is assumed that the aperture value A0 of the reference image is taken in a state in which the aperture is most narrowed in a variable range prepared in the variable optical system 3. The most narrowed aperture value is, for example, about F22 for a standard lens. On the other hand, it is assumed that the aperture value of the correction target image is the same as that of the reference image or closer to the open side.

一様面撮影は、ゴミの付着状態が変化しないかぎり省くことができる。一様面撮影の挿入回数が多いに越したことはないが、通常は一日一回程度のデータでもあれば、有効なゴミデータになりうる。一様面撮影を行うか否かの判断は、撮影者に委ねられる。しかし、先に行った一様面撮影があまりにも時間的に離れている場合は、その一様面撮影による基準データは信頼性に欠ける場合も生じる。従って、通常撮影から所定時間内の一様面撮影の基準画像データのみを使用するようにしてもよい。また、必ずしも一様面撮影を先に行う必要はない。後に行った一様面撮影の基準画像データを使用してもよい。一様面撮影が、通常撮影の前後に複数ある場合は、時間的に最も近い一様面撮影の基準画像データを使用するようにしてもよい。あるいは、新規付着ゴミの可能性を気にするのであれば、撮影前後の2番目に近いものまでの中からどちらかを選択するようにしてもよい。   Uniform surface photography can be omitted as long as the state of dust adhesion does not change. Although the number of insertions of uniform plane photography has never been too many, data that is usually only once a day can be effective garbage data. The determination as to whether or not to perform uniform plane imaging is left to the photographer. However, if the previously performed uniform plane imaging is too far in time, the reference data obtained by the uniform plane imaging may be unreliable. Therefore, only the reference image data for uniform plane imaging within a predetermined time from normal imaging may be used. Further, it is not always necessary to perform uniform plane imaging first. You may use the reference image data of the uniform surface photography performed later. When there are a plurality of uniform plane imaging before and after the normal imaging, the reference image data of the uniform plane imaging that is closest in time may be used. Alternatively, if you are concerned about the possibility of newly attached dust, you may select one from the second closest one before and after photographing.

(画像処理装置側動作)
第2の実施の形態において、画像処理装置であるPC31に入力される基準画像データと補正対象画像データには、瞳位置と絞り値が識別できるデータが埋め込まれているものとする。瞳位置データは、撮影データに埋め込まれたレンズの種類、ズーム位置、焦点位置の記録データから換算テーブルを使って算出してもよい。図12は、PC31で行う処理の流れを示すフローチャートである。
(Image processing device side operation)
In the second embodiment, it is assumed that data that can identify the pupil position and the aperture value is embedded in the reference image data and the correction target image data input to the PC 31 that is the image processing apparatus. The pupil position data may be calculated by using a conversion table from the recording data of the lens type, zoom position, and focus position embedded in the photographing data. FIG. 12 is a flowchart showing the flow of processing performed by the PC 31.

<基準画像に対する処理>
1)輝度面生成、透過率マップの生成
ステップS21の輝度面生成、ステップS22の透過率マップの生成は、第1の実施の形態と同様に行う。
<Processing for reference image>
1) Luminance surface generation and transmittance map generation The luminance surface generation in step S21 and the transmittance map generation in step S22 are performed in the same manner as in the first embodiment.

2)透過率マップの瞳位置変換
ステップS23では、透過率マップの瞳位置変換を行う。基準画像と補正対処画像の瞳位置が相互に異なっているとき、基準画像のゴミ位置を、補正対象画像の瞳位置から見たときに出現すると予測されるゴミ位置に瞳位置変換する。図8は、瞳位置が変化するとゴミ影の位置が変化する様子を示す図である。図8(a)は、瞳位置とゴミと撮像素子8の撮像面との関係を示す図である。図8(b)は、瞳位置の変化に伴い撮像面上でゴミ影が移動している様子を示す図である。
2) Pupil position conversion of transmittance map In step S23, the pupil position of the transmittance map is converted. When the pupil positions of the reference image and the corrected image are different from each other, the pupil position of the reference image is converted into a dust position predicted to appear when viewed from the pupil position of the correction target image. FIG. 8 is a diagram illustrating how the dust shadow position changes as the pupil position changes. FIG. 8A is a diagram illustrating the relationship between the pupil position, dust, and the imaging surface of the imaging element 8. FIG. 8B is a diagram illustrating a state in which dust shadows are moving on the imaging surface with changes in the pupil position.

図8から明らかなように、瞳位置が異なると画像内に写り込むゴミの位置は、光軸51すなわち画像の中心から動径方向にずれる。ここで、画像内の光軸51から距離rの位置にあるゴミが、動径方向にずれる量Δrを見積もる。基準画像の瞳位置をP0、補正対象画像の瞳位置をP0'、撮像面から距離lの位置にゴミが付着しているとすると、Δrは、次式(14)により計算することができる。

Figure 0004466015
ただし、距離lは光学部品の厚みを空気中の光路長に換算した値である。 As is clear from FIG. 8, when the pupil position is different, the position of dust reflected in the image is shifted in the radial direction from the optical axis 51, that is, the center of the image. Here, the amount Δr of dust deviated in the radial direction from the optical axis 51 in the image is estimated. Assuming that the pupil position of the reference image is P0, the pupil position of the correction target image is P0 ′, and dust is attached at a distance l from the imaging surface, Δr can be calculated by the following equation (14).
Figure 0004466015
However, the distance l is a value obtained by converting the thickness of the optical component into an optical path length in the air.

基準画像の透過率マップT[i,j]を、極座標[r,θ]上で次式(15)により[r',θ]に変位させ、座標[i,j]上の透過率マップT'[i,j]に変換する。

Figure 0004466015
ずれ量Δrは、光軸51から距離が遠くになるに従い大きくなる。実際の画像の周辺部では、瞳位置の値によっては数十画素に及ぶこともある。 The transmittance map T [i, j] of the reference image is displaced to [r ′, θ] by the following equation (15) on the polar coordinates [r, θ], and the transmittance map T on the coordinates [i, j] 'Convert to [i, j].
Figure 0004466015
The shift amount Δr increases as the distance from the optical axis 51 increases. In the periphery of an actual image, it may reach several tens of pixels depending on the value of the pupil position.

3)透過率マップのF値変換
ステップS24では、透過率マップのF値変換を行う。基準画像と補正対処画像の絞り値が相互に異なっているとき、基準画像のゴミ径と透過率を、補正対象画像のより開放側絞り値でのゴミ径と透過率にF値変換する。図9は、絞り値であるF値が変化するとゴミ影の大きさが変化する様子を示す図である。図9(a)は、F値が大きい場合、図9(b)は、F値が小さい場合を示す。図9から明らかなように、F値の定義式(F=焦点距離/レンズの有効口径)を、相似関係にある撮像面からゴミ付着位置までの距離lとゴミ広がりΓに当てはめると次式(16)が成立する。

Figure 0004466015
3) F value conversion of transmittance map In step S24, F value conversion of the transmittance map is performed. When the aperture values of the reference image and the corrected image are different from each other, the dust diameter and the transmittance of the reference image are converted into an F value into the dust diameter and the transmittance of the correction target image at the more open aperture value. FIG. 9 is a diagram illustrating how the size of the dust shadow changes when the F value that is the aperture value changes. FIG. 9A shows a case where the F value is large, and FIG. 9B shows a case where the F value is small. As is apparent from FIG. 9, when the definition formula of the F value (F = focal length / effective aperture of the lens) is applied to the distance l from the imaging surface having a similar relationship to the dust adhesion position and the dust spread Γ, the following formula ( 16) is established.
Figure 0004466015

lを撮像素子の画素ピッチa[mm/pixel]で割り算すると、ゴミ径は画素数で表記できる。このようにして、絞りがF値のとき、点像のゴミは幅Γの大きさに広がることが予測できる。   When l is divided by the pixel pitch a [mm / pixel] of the image sensor, the dust diameter can be expressed by the number of pixels. In this way, it can be predicted that the dust in the point image spreads to the size of the width Γ when the stop has the F value.

一方、その点像の分布関数は、絞り値内で開口したレンズの各入射角度から均等に点像ゴミに光を当ててゴミ影を広げていると考えられるので、完全に一様な広がりを持つ関数と想定してよい。したがって、F値変換には、フィルタ幅Γ画素で表される一様なローパスフィルタ処理を掛けることによって、ゴミ径と透過率を正確に予測するF値変換が可能となる。ローパスフィルタは直径がΓの円形状の非分離型フィルタが普通と考えられるが、処理の高速化を念頭に、縦Γ、横Γの正方状の分離型フィルタでも問題ない。   On the other hand, the distribution function of the point image is considered to spread the dust shadow by applying light to the point image dust evenly from each incident angle of the lens opened within the aperture value. You can assume that it has a function. Therefore, the F value conversion can be performed to accurately predict the dust diameter and the transmittance by applying a uniform low-pass filter process represented by a filter width Γ pixel. As the low-pass filter, a circular non-separable filter having a diameter of Γ is considered to be normal, but there is no problem with a vertical Γ and horizontal Γ square separated filter in consideration of speeding up the processing.

例えば、l=0.5mm、a=5μm/pixelの場合にF22の透過率マップを、F16、F11、F8、F5.6、F4に変換する場合に当てはめると、正方状の分離型フィルタの一次元フィルタ係数は図10ような形式に表される。図10の一次元フィルタ係数を使用して、縦横それぞれフィルタリングをする。なお、絞り値F16の一次元フィルタ係数は、両端に0.5の係数を持ち、7つの係数を有する。これは、偶数幅の広がりを着目画素を中心に左右上下に均等に広がる奇数幅の範囲でフィルタリングをするためである。図11は、絞り値F16フィルタを2次元フィルタで表した図である。   For example, when l = 0.5 mm and a = 5 μm / pixel, the transmission map of F22 is converted to F16, F11, F8, F5.6, and F4. The original filter coefficient is represented in a format as shown in FIG. Using the one-dimensional filter coefficient of FIG. Note that the one-dimensional filter coefficient of the aperture value F16 has a coefficient of 0.5 at both ends and seven coefficients. This is because the even-width spread is filtered in an odd-width range that spreads evenly in the horizontal and vertical directions around the pixel of interest. FIG. 11 is a diagram showing the aperture value F16 filter as a two-dimensional filter.

上記の変換処理を行うことにより、基準画像の透過率マップは、補正対象画像の瞳位置、F値の状態の透過率マップに変換される。すなわち、基準画像の透過率マップは、補正対象画像が撮影される光学的条件下で生成される透過率マップと等価な透過率マップが生成される。   By performing the above conversion process, the transmittance map of the reference image is converted into a transmittance map in the pupil position and F value states of the correction target image. That is, the transmittance map equivalent to the transmittance map generated under the optical condition where the correction target image is captured is generated as the transmittance map of the reference image.

<補正対象画像に対する処理>
3)ゲイン補正
ステップS25では、上記変換処理した透過率マップを使用してゲイン補正を行う。第1の実施の形態と同様に、補正対象画像データのR,G,B値各々に対して、式(17)(18)(19)で示すように、瞳位置、F値変換後の透過率信号の逆数を掛け算して、ゲイン補正を行う。
R[i,j]=R[i.j]/T'[i,j] ...(17)
G[i,j]=G[i.j]/T'[i,j] ...(18)
B[i,j]=B[i.j]/T'[i,j] ...(19)
<Processing for correction target image>
3) Gain correction In step S25, gain correction is performed using the converted transmittance map. Similar to the first embodiment, for each of the R, G, and B values of the correction target image data, as shown by the equations (17), (18), and (19), the pupil position and the transmission after the F value conversion are performed. Gain correction is performed by multiplying the reciprocal of the rate signal.
R [i, j] = R [ij] / T '[i, j] ... (17)
G [i, j] = G [ij] / T '[i, j] ... (18)
B [i, j] = B [ij] / T '[i, j] ... (19)

図13は、中くらい程度のゴミについて、F値変換により透過率が変換される様子を示す図である。横軸は画素位置を示し、縦軸は透過率を示す。   FIG. 13 is a diagram illustrating how the transmittance of medium-sized dust is converted by F-number conversion. The horizontal axis indicates the pixel position, and the vertical axis indicates the transmittance.

このようにして、可変な光学系において、最小絞り値で基準画像を一枚撮影するだけで、他の光学的条件における基準画像の撮影を不要とすることができる。すなわち、1枚の基準画像と相互にゴミデータを変換することにより、有効な補正を達成することができる。したがって、電子カメラのユーザーの負担は大幅に低減される。また、第1の実施の形態と同様に、一様画像撮影の厳密性は要求せずに、極めて高感度なゴミ検出性能も維持することが可能である。   In this way, in a variable optical system, it is not necessary to shoot a reference image under other optical conditions by only shooting a single reference image with a minimum aperture value. In other words, effective correction can be achieved by converting dust data to and from one reference image. Therefore, the burden on the user of the electronic camera is greatly reduced. Further, as in the first embodiment, it is possible to maintain dust detection performance with extremely high sensitivity without requiring strictness of uniform image shooting.

−第3の実施の形態−
第3の実施の形態では、一様面の基準画像が全くない状態で、補正対象画像内でゴミ検出し、除去する方法を示す。基本的原理は、補正対象画像中の平坦部(画像が部分的に一様な領域)を見つければ、第1の実施の基準画像に対して行っていたゴミの透過率マップ生成処理(ゲインマップ抽出)が、そのまま同じように適用できる。電子カメラ1および画像処理装置としてのPC31の構成は、第1の実施の形態と同様であるので、その説明を省略する。
-Third embodiment-
In the third embodiment, a method for detecting and removing dust in a correction target image in a state where there is no uniform plane reference image will be described. The basic principle is that if a flat portion (region in which the image is partially uniform) in the correction target image is found, the dust transmittance map generation processing (gain map) performed for the reference image of the first embodiment is performed. Extraction) can be applied in the same way. Since the configuration of the electronic camera 1 and the PC 31 as the image processing apparatus is the same as that of the first embodiment, description thereof is omitted.

(電子カメラ側の動作)
図14は、第3の実施の形態における、電子カメラ1側の撮影手順について説明する図である。1)瞳位置P1、絞り値A1で通常撮影301を行い、補正対象画像データ1を出力する。2)瞳位置P2、絞り値A2で通常撮影302を行い、補正対象画像データ2を出力する。3)瞳位置P3、絞り値A3で通常撮影303を行い、補正対象画像データ3を出力する。4)瞳位置P4、絞り値A4で通常撮影304を行い、補正対象画像データ3を出力する。すなわち、第3の実施の形態では、第1の実施の形態や第2の実施の形態で行っていた、一様面撮影を行わない。
(Operation on the electronic camera side)
FIG. 14 is a diagram for describing a photographing procedure on the electronic camera 1 side in the third embodiment. 1) Normal photographing 301 is performed at the pupil position P1 and the aperture value A1, and the correction target image data 1 is output. 2) Normal photographing 302 is performed at the pupil position P2 and the aperture value A2, and the correction target image data 2 is output. 3) Normal photographing 303 is performed at the pupil position P3 and the aperture value A3, and the correction target image data 3 is output. 4) The normal photographing 304 is performed at the pupil position P4 and the aperture value A4, and the correction target image data 3 is output. That is, in the third embodiment, the uniform plane imaging that is performed in the first embodiment and the second embodiment is not performed.

(画像処理装置側動作)
<補正対象画像に対する処理>
図15は、画像処理装置であるPC31で行う処理のフローチャートを示す図である。ステップS31では、輝度面の生成を行う。ステップS32では、輝度面のガンマ補正、エッジ抽出フィルタ処理、閾値判定により、エッジマップの生成を行う。ステップS33では、エッジマップに暗黒部を追加処理をする。ステップS34では、エッジマップの拡大処理をする。ステップS35では、平坦マップへの変換を行う。ステップS36では、自己ゲイン抽出処理を行う。ステップS37では、自己ゲイン補正処理を行う。以下、各ステップの詳細について説明する。
(Image processing device side operation)
<Processing for correction target image>
FIG. 15 is a diagram illustrating a flowchart of processing performed by the PC 31 that is the image processing apparatus. In step S31, a luminance plane is generated. In step S32, an edge map is generated by gamma correction of the luminance plane, edge extraction filter processing, and threshold determination. In step S33, a dark portion is added to the edge map. In step S34, the edge map is enlarged. In step S35, conversion to a flat map is performed. In step S36, a self gain extraction process is performed. In step S37, self-gain correction processing is performed. Details of each step will be described below.

1)輝度面の生成(ステップS31)
補正対象画像データの各画素[i,j]について、RGB信号を輝度信号Yへの変換を行う。変換方法は、第1の実施の形態の基準画像に対して行った方法と同様である。
1) Generation of luminance plane (step S31)
The RGB signal is converted into the luminance signal Y for each pixel [i, j] of the correction target image data. The conversion method is the same as the method performed on the reference image of the first embodiment.

2)エッジマップの生成(ステップS32)
エッジ抽出フィルタを輝度面に掛けて、補正対象画像内の平坦部とエッジ部の分離を行う。光路途中に含まれるゴミの画像内への写り込みは非常にコントラストの低いゴミ影となって現れるため、従来技術のようなエッジ抽出フィルタで検出されない場合が多い。この事実を逆に利用すると、エッジ抽出フィルタで抽出されるエッジ部は、ゴミではなく基本的に画像内のエッジであると多くの箇所で仮定できる。この画像内のエッジとゴミとの区別を更によくするために初めに輝度面に対する階調補正処理を行う。
2) Generation of edge map (step S32)
An edge extraction filter is applied to the luminance surface to separate a flat portion and an edge portion in the correction target image. Reflection of dust contained in the optical path in the image appears as dust shadow with very low contrast, and is often not detected by an edge extraction filter as in the prior art. If this fact is used in reverse, it can be assumed in many places that the edge portion extracted by the edge extraction filter is basically an edge in the image, not dust. In order to further distinguish between edges and dust in the image, first, gradation correction processing is performed on the luminance plane.

2−1)輝度面のガンマ補正
補正対象画像が線形階調のまま入力されて、上述の輝度面が生成されているものとする。このとき、入力信号をY(0≦Y≦Ymax)、出力信号をY'(0≦Y'≦Y'max)とし、例えば次式(20)のような階調変換を施す。なお、γ=0.4,0.5,0.6等である。

Figure 0004466015
2-1) Gamma correction of luminance plane Assume that the above-described luminance plane is generated by inputting a correction target image with a linear gradation. At this time, the input signal is Y (0 ≦ Y ≦ Ymax) and the output signal is Y ′ (0 ≦ Y ′ ≦ Y′max). For example, gradation conversion as shown in the following equation (20) is performed. Note that γ = 0.4, 0.5, 0.6 and the like.
Figure 0004466015

この変換は、低輝度側の中間調のコントラストを上げ、高輝度側のコントラストを下げる処理である。すなわち、ゴミ影は暗いところでは目立ちにくく明るいところで目立つため、ゴミ影のコントラストはこの変換によって下がり、一方の通常の画像エッジは主に中間調に分布するため相対的にコントラストを上げている。したがって、ゴミ影と通常エッジのコントラストの分離度が良くなる。さらにY'の量子ゆらぎに起因するショットノイズを全階調にわたって均一に扱えるように変換するには、誤差伝播則から考えてγ=0.5にとるのが最もよい。なお、上記式(20)はべき乗関数になっている。また、γ=0.5は、べき乗関数が平方根関数となっている。   This conversion is a process of increasing the halftone contrast on the low luminance side and decreasing the contrast on the high luminance side. In other words, dust shadows are not noticeable in dark places and stand out in bright places, so the contrast of dust shadows is reduced by this conversion, and one normal image edge is mainly distributed in a halftone, so the contrast is relatively increased. Accordingly, the degree of separation between the dust shadow and the normal edge contrast is improved. Further, in order to convert shot noise caused by the quantum fluctuation of Y ′ so that it can be handled uniformly over all gradations, it is best to set γ = 0.5 in view of the error propagation law. The above equation (20) is a power function. Further, when γ = 0.5, the power function is a square root function.

入力画像に最終出力用のガンマ補正処理が掛かっているとき、上記変換に近いガンマ補正処理がなされている場合はこの処理を飛ばしてもよい。また、逆ガンマ補正を行って線形階調に戻してから、上記処理を行えば、より分離機能が得られる。   When gamma correction processing for final output is applied to the input image, this processing may be skipped if gamma correction processing close to the above conversion is performed. Further, if the above process is performed after performing inverse gamma correction to return to the linear gradation, a more separating function can be obtained.

2−2)エッジ抽出フィルタ処理
次に、ガンマ補正のなされた輝度面に対して、図16および次式(21)によるエッジ抽出フィルタを掛ける。各画素のエッジ抽出成分をYH[i,j]とする。
YH[i,j]={|Y'[i-1,j]-Y'[i,j]|+|Y'[i+1,j]-Y'[i,j]|
+|Y'[i,j-1]-Y'[i,j]|+|Y'[i,j+1]-Y'[i,j]|
+|Y'[i-1,j-1]-Y'[i,j]|+|Y'[i+1,j+1]-Y'[i,j]|
+|Y'[i-1,j+1]-Y'[i,j]|+|Y'[i+1,j-1]-Y'[i,j]|
+|Y'[i-2,j-1]-Y'[i,j]|+|Y'[i+2,j+1]-Y'[i,j]|
+|Y'[i-2,j+1]-Y'[i,j]|+|Y'[i+2,j-1]-Y'[i,j]|
+|Y'[i-1,j-2]-Y'[i,j]|+|Y'[i+1,j+2]-Y'[i,j]|
+|Y'[i-1,j+2]-Y'[i,j]|+|Y'[i+1,j-2]-Y'[i,j]|
+|Y'[i-3,j]-Y'[i,j]|+|Y'[i+3,j]-Y'[i,j]|
+|Y'[i,j-3]-Y'[i,j]|+|Y'[i,j+3]-Y'[i,j]|
+|Y'[i-3,j-3]-Y'[i,j]|+|Y'[i+3,j+3]-Y'[i,j]|
+|Y'[i-3,j+3]-Y'[i,j]|+|Y'[i+3,j-3]-Y'[i,j]|}/24 ...(21)
2-2) Edge Extraction Filter Processing Next, the edge extraction filter according to FIG. 16 and the following equation (21) is applied to the luminance plane subjected to gamma correction. Let YH [i, j] be the edge extraction component of each pixel.
YH [i, j] = {| Y '[i-1, j] -Y' [i, j] | + | Y '[i + 1, j] -Y' [i, j] |
+ | Y '[i, j-1] -Y' [i, j] | + | Y '[i, j + 1] -Y' [i, j] |
+ | Y '[i-1, j-1] -Y' [i, j] | + | Y '[i + 1, j + 1] -Y' [i, j] |
+ | Y '[i-1, j + 1] -Y' [i, j] | + | Y '[i + 1, j-1] -Y' [i, j] |
+ | Y '[i-2, j-1] -Y' [i, j] | + | Y '[i + 2, j + 1] -Y' [i, j] |
+ | Y '[i-2, j + 1] -Y' [i, j] | + | Y '[i + 2, j-1] -Y' [i, j] |
+ | Y '[i-1, j-2] -Y' [i, j] | + | Y '[i + 1, j + 2] -Y' [i, j] |
+ | Y '[i-1, j + 2] -Y' [i, j] | + | Y '[i + 1, j-2] -Y' [i, j] |
+ | Y '[i-3, j] -Y' [i, j] | + | Y '[i + 3, j] -Y' [i, j] |
+ | Y '[i, j-3] -Y' [i, j] | + | Y '[i, j + 3] -Y' [i, j] |
+ | Y '[i-3, j-3] -Y' [i, j] | + | Y '[i + 3, j + 3] -Y' [i, j] |
+ | Y '[i-3, j + 3] -Y' [i, j] | + | Y '[i + 3, j-3] -Y' [i, j] |} / 24 ... (twenty one)

ここで、上記フィルタは、画像本来のエッジ部ができるだけ全て抽出されるように、複数の相関距離をもつ絶対値差分をあらゆる方向から漏れなく集めるように設計されている。   Here, the filter is designed to collect absolute value differences having a plurality of correlation distances from all directions without omission so that all the original edge portions of the image are extracted as much as possible.

2−3)閾値判定
次式(22)(23)により、エッジ抽出成分YHを閾値判定して、エッジ部か平坦部かの分類を行い、結果をエッジマップEDGE[i,j]に出力する。閾値Th1は255階調に対して1〜5程度の値をとる。エッジ部の上に存在するゴミ影は、基本的にゴミ影がエッジ部の振動する信号に埋もれてしまって目立たないためゴミ除去の不要な領域である。
if YH[i,j]>Th1 EDGE[i,j]=1(エッジ部) ...(22)
else EDGE[i,j]=0(平坦部) ...(23)
2-3) Determination of threshold value The edge extraction component YH is determined as a threshold value by the following equations (22) and (23), the edge portion or the flat portion is classified, and the result is output to the edge map EDGE [i, j]. . The threshold value Th1 takes a value of about 1 to 5 for 255 gradations. The dust shadow existing on the edge portion is an area that does not require dust removal because the dust shadow is basically buried in the vibration signal of the edge portion and is not noticeable.
if YH [i, j]> Th1 EDGE [i, j] = 1 (edge part) ... (22)
else EDGE [i, j] = 0 (flat part) ... (23)

上記のように、2−1)で階調変換を行って階調間の重み付けを変え、2−3)で全階調にわたって一定の閾値Th1で閾値判定を行っている。しかし、ほぼ同等な効果は、線形階調のままでエッジ抽出を行い、輝度レベルに応じた閾値を設定して、閾値判定を行うようにしても可能である。   As described above, gradation conversion is performed in 2-1) to change the weight between gradations, and threshold determination is performed with a constant threshold Th1 over all gradations in 2-3). However, almost the same effect can be obtained by performing edge extraction while maintaining the linear gradation, and setting a threshold value according to the luminance level and performing threshold determination.

3)エッジマップに暗黒部を追加(ステップS33)
エッジマップは、ゲインマップ抽出してはいけない領域を表す。エッジ領域の他に、ゲインマップ抽出するのが危険な領域が暗い領域(暗黒部)である。暗黒部は、S/Nが悪いため相対ゲインを抽出しても信頼性が低い。更に暗黒部上に存在するゴミ影はほとんど目立たないのでゴミ除去する必要性がない。したがって、暗い領域も、次式(24)によりエッジマップに追加する。閾値Th2は、255線形階調に対しておよそ20以下の値に設定するものとする。模式的にこの操作を「EDGE'=EDGE+DARK」と記述すると分かりやすい。
if Y[i,j]≦Th2 EDGE[i,j]=1 ...(24)
3) Add dark part to edge map (step S33)
The edge map represents a region where the gain map should not be extracted. In addition to the edge region, a region that is dangerous to extract a gain map is a dark region (dark portion). In the dark area, the S / N is poor, so the reliability is low even if the relative gain is extracted. Further, dust shadows existing on the dark part are hardly noticeable, so there is no need to remove dust. Therefore, a dark region is also added to the edge map by the following equation (24). The threshold value Th2 is set to a value of about 20 or less for 255 linear gradations. This operation can be easily understood by describing this operation as “EDGE '= EDGE + DARK”.
if Y [i, j] ≦ Th2 EDGE [i, j] = 1 ... (24)

4)エッジマップの拡大処理(ステップS34)
第1の実施の形態と同様に、平坦部内で(2a+1)x(2b+1)画素の中心値と平均値の相対比を比較して透過率マップを生成する。従って、事前にエッジ部がこのカーネル内に入らないように、次式(25)により、エッジ部の(2a+1)x(2b+1)画素拡大処理を行う。m=1,2,...,a、n=1,2,...,bである。
if EDGE[i,j]=1 EDGE[i±m,j±n]=1 ...(25)
4) Edge map enlargement process (step S34)
Similar to the first embodiment, a transmittance map is generated by comparing the relative ratio between the center value and the average value of (2a + 1) x (2b + 1) pixels in the flat portion. Therefore, (2a + 1) x (2b + 1) pixel enlargement processing of the edge portion is performed by the following equation (25) so that the edge portion does not enter this kernel in advance. m = 1,2, ..., a, n = 1,2, ..., b.
if EDGE [i, j] = 1 EDGE [i ± m, j ± n] = 1 ... (25)

5)平坦マップへの変換(ステップS35)
次式(26)(27)により、エッジマップEDGE[i,j]を平坦マップFLAT[i,j]に変換する。ビット反転によって達成される。平坦マップが示す平坦領域は、(2a+1)x(2b+1)画素で構成されるゲインマップ抽出カーネルが補正対象画像内で自己抽出してよい領域を表す。
if EDGE[i,j]=0 FLAT[i,j]=1(平坦部) ...(26)
else FLAT[i,j]=0(エッジ部) ...(27)
5) Conversion to flat map (step S35)
The edge map EDGE [i, j] is converted into a flat map FLAT [i, j] by the following equations (26) and (27). Achieved by bit inversion. The flat region indicated by the flat map represents a region that may be self-extracted in the correction target image by the gain map extraction kernel formed of (2a + 1) x (2b + 1) pixels.
if EDGE [i, j] = 0 FLAT [i, j] = 1 (flat part) ... (26)
else FLAT [i, j] = 0 (edge part) ... (27)

6)自己ゲイン抽出(ステップS36)
第1の実施の形態において基準画像データから透過率マップを生成した処理手順を、FLAT[i,j]=1の領域に対してのみ行う。
6) Self-gain extraction (step S36)
The processing procedure for generating the transmittance map from the reference image data in the first embodiment is performed only for the area of FLAT [i, j] = 1.

6−1)局所的規格化処理(ゲイン抽出処理)
FLAT[i,j]=1の領域のT[i,j]を(2a+1)x(2b+1)画素内の相対比から生成する。FLAT[i,j]=0の領域は全てT[i,j]=1に設定する。
6−2)透過率マップの統計解析
FLAT[i,j]=1の領域内のT[i,j]を、第1の実施の形態と同様に統計解析して、平均値mと標準偏差σを算出する。
6−3)閾値判定
FLAT[i,j]=1の領域内のT[i,j]を、第1の実施の形態と同様に閾値判定して、m±3σの値をとるものはT[i,j]=1に設定する。
6-1) Local normalization processing (gain extraction processing)
T [i, j] in the region of FLAT [i, j] = 1 is generated from the relative ratio in (2a + 1) x (2b + 1) pixels. All areas where FLAT [i, j] = 0 are set to T [i, j] = 1.
6-2) Statistical analysis of transmittance map
A statistical analysis is performed on T [i, j] in the region of FLAT [i, j] = 1 in the same manner as in the first embodiment to calculate an average value m and a standard deviation σ.
6-3) Threshold judgment
The threshold value of T [i, j] in the region of FLAT [i, j] = 1 is determined in the same manner as in the first embodiment, and the value of m ± 3σ is T [i, j] = Set to 1.

7)自己ゲイン補正(ステップS37)
第1の実施の形態と同様に、補正対象画像のR,G,B値各々に対して自己抽出した透過率信号T[i,j]の逆数を掛け算して、自己ゲイン補正を行う。
7) Self-gain correction (step S37)
As in the first embodiment, self-gain correction is performed by multiplying the R, G, B values of the correction target image by the reciprocal of the self-extracted transmittance signal T [i, j].

このようにして、一様面の基準画像データがなくても、補正対象画像自身のゴミを自己抽出して補正することができる。すなわち、1つの撮影画像内で上記したように平坦性が保証できる所定の条件を満たす領域を抽出する。抽出した同一の領域を基準画像としかつ補正対象画像とする。また、第3の実施の形態では、可変光学系の影響を全く加味する必要性がない。特に、膨大な数を占める小さなゴミ影の除去に威力を発揮する。   In this way, even if there is no uniform plane reference image data, dust in the correction target image itself can be self-extracted and corrected. That is, a region that satisfies a predetermined condition that can guarantee flatness as described above is extracted from one captured image. The extracted same area is set as a reference image and a correction target image. In the third embodiment, there is no need to take into account the influence of the variable optical system. In particular, it is effective in removing small dust shadows that occupy a huge number.

−第4の実施の形態−
第4の実施の形態では、第2の実施の形態と同様に一枚だけ基準画像を撮影し、ゴミ位置に関する情報を利用しながらも、透過率マップは基準画像からではなく、第3の実施の形態のように補正対象画像自身から自己抽出する方式を採用したものである。第2の実施の形態では、透過率マップの瞳位置変換を行っているが、瞳位置の値が近似値で正確でない場合に、瞳位置変換に誤差が生じる場合が生じる。一方、第3の実施の形態では、エッジマップ抽出において大きなゴミはエッジとして抽出されてしまい、補正がなされない場合が生じる。第4の実施の形態は、このような第2の実施の形態と第3の実施の形態の不具合にも対処するものである。すなわち、第3の実施の形態による信頼性の高い透過率マップの生成方法を利用しながら、第2の実施の形態と同様な方法で取得する信頼性の高いゴミの位置情報で補うものである。なお、電子カメラ1および画像処理装置としてのPC31の構成は、第1の実施の形態と同様であるので、その説明を省略する。
-Fourth embodiment-
In the fourth embodiment, as in the second embodiment, only one reference image is taken and information on the dust position is used, but the transmittance map is not from the reference image, but the third embodiment. In this manner, a method of self-extraction from the correction target image itself is employed. In the second embodiment, the pupil position conversion of the transmittance map is performed. However, when the value of the pupil position is an approximate value and not accurate, an error may occur in the pupil position conversion. On the other hand, in the third embodiment, large dust is extracted as an edge in the edge map extraction, and correction may not be performed. The fourth embodiment addresses such problems of the second embodiment and the third embodiment. In other words, while using the method of generating a highly reliable transmittance map according to the third embodiment, it is supplemented with highly reliable dust position information acquired by the same method as in the second embodiment. . Note that the configurations of the electronic camera 1 and the PC 31 as the image processing apparatus are the same as those in the first embodiment, and a description thereof will be omitted.

(電子カメラ側動作)
撮影手順は、第2の実施の形態と同様である。
(Operation on the electronic camera side)
The shooting procedure is the same as in the second embodiment.

(画像処理装置側動作)
図17は、画像処理装置であるPC31で行う処理のフローチャートを示す図である。
(Image processing device side operation)
FIG. 17 is a diagram illustrating a flowchart of processing performed by the PC 31 that is the image processing apparatus.

<基準画像に対する処理>
1)ステップS41の輝度面の生成は、第1の実施の形態および第2の実施の形態と同様である。2)ステップS42の透過率マップの生成(ゲインマップ抽出)は、第1の実施の形態および第2の実施の形態と同様である。3)ステップS43の透過率マップの瞳位置変換は、第2の実施の形態と同様である。4)ステップS44の透過率マップのF値変換は、第2の実施の形態と同様である。
<Processing for reference image>
1) The generation of the luminance surface in step S41 is the same as in the first and second embodiments. 2) The generation of the transmittance map (gain map extraction) in step S42 is the same as that in the first and second embodiments. 3) The pupil position conversion of the transmittance map in step S43 is the same as in the second embodiment. 4) The F value conversion of the transmittance map in step S44 is the same as that in the second embodiment.

5)透過率マップの閾値判定
ステップS45では、透過率マップの閾値判定を行う。透過率マップのF値変換が行われた場合は、ローパスフィルタ処理によりほとんどゴミ影が消滅しかかっている透過率1に近い画素が多数発生する。これらを鮮明なゴミ影と区別するため、次式(28)(29)により再度閾値判定を行う。ここで、2)の「透過率マップの生成」過程で算出した標準偏差値σを再度利用する。瞳位置、F値変換された透過率マップをT'[i,j]で表す。
if |T'[i,j]-1|≦3σ then T'[i,j]=1 ...(28)
else T'[i,j]=T'[i,j] ...(29)
5) Determination of threshold value of transmittance map In step S45, the threshold value of the transmittance map is determined. When the F value conversion of the transmittance map is performed, a number of pixels close to the transmittance 1 in which dust shadows are almost disappearing are generated by the low-pass filter process. In order to distinguish these from clear dust shadows, threshold determination is performed again using the following equations (28) and (29). Here, the standard deviation value σ calculated in the process 2) “transmission map generation” is used again. The pupil position and the transmittance map after F-number conversion are represented by T ′ [i, j].
if | T '[i, j] -1 | ≦ 3σ then T' [i, j] = 1 ... (28)
else T '[i, j] = T' [i, j] ... (29)

6)ゴミマップへの変換
ステップS46では、次式(30)(31)により透過率マップを2値化してゴミマップdmap[i,j]に変換する。
if T'[i,j]<1 dmap[i,j]=1 ...(30)
else dmap[i,j]=0 ...(31)
ここで式(30)の判定は、もう少し余裕をもたせてT'[i,j]<0.95のように判定してもよい。
6) Conversion to dust map In step S46, the transmittance map is binarized by the following equations (30) and (31) and converted to a dust map dmap [i, j].
if T '[i, j] <1 dmap [i, j] = 1 ... (30)
else dmap [i, j] = 0 ... (31)
Here, the determination of Expression (30) may be made such that T ′ [i, j] <0.95 with a little more margin.

7)ゴミマップの拡大処理
ステップS47では、次式(32)により瞳位置変換で想定される誤差分だけゴミマップを拡大しておくことにより、許容誤差内の領域にはゴミが含まれるようなゴミマップにする。ここでは、例えば±3画素の誤差を見込む。m=1,2,3、n=1,2,3である。
if dmap[i,j]=1 dmap[i±m,j±n]=1 ...(32)
7) Dust Map Enlargement Process In step S47, the dust map is enlarged by the error assumed in the pupil position conversion by the following equation (32), so that the area within the allowable error includes dust. Make a garbage map. Here, for example, an error of ± 3 pixels is expected. m = 1,2,3 and n = 1,2,3.
if dmap [i, j] = 1 dmap [i ± m, j ± n] = 1 ... (32)

<補正対象画像に対する処理>
1)ステップS51の輝度面の生成は、第3の実施の形態と同様である。2)ステップS52のエッジマップの生成は、第3の実施の形態と同様である。3)ステップS53のエッジマップに暗黒部を追加する処理は、第3の実施の形態と同様である。模式的にこの操作を「EDGE'=EDGE+DARK」と記述すると分かりやすい。
<Processing for correction target image>
1) The generation of the luminance surface in step S51 is the same as that in the third embodiment. 2) The generation of the edge map in step S52 is the same as in the third embodiment. 3) The process of adding a dark part to the edge map in step S53 is the same as that in the third embodiment. This operation can be easily understood by describing this operation as “EDGE '= EDGE + DARK”.

4)エッジマップからゴミ領域を除外
ステップS54では、エッジマップからゴミ領域を除外する。ゴミ影の多くはコントラストが低いためエッジ抽出されないが、中には大きなゴミでコントラストの高いものがあり、エッジ抽出されてしまうことがある。特に絞り込んで撮影された補正対象画像内で幾つかのゴミ影に発生する。これらのゴミ影がエッジ領域としてゲイン抽出領域の指定から外れることを防ぐため、ステップS46で求めたゴミマップ情報を利用して、次式(33)によりゴミ位置を強制的にエッジ部から除外する処理を行う。ここで、あまり大きくエッジ領域を削ることを防ぐため、ステップS47のゴミマップの拡大処理を行う前のゴミマップを利用することにする。模式的にこの操作を「EDGE''=EDGE+DARK-DUST」と記述すると分かりやすい。
if dmap[i,j]=1 EDGE[i,j]=0 ...(33)
4) Excluding the dust region from the edge map In step S54, the dust region is excluded from the edge map. Most of the dust shadows are not extracted because the contrast is low. However, some of the dust shadows are large dust and have high contrast, and the edges may be extracted. In particular, it occurs in some dust shadows in the correction target image photographed with narrowing down. In order to prevent these dust shadows from deviating from the designation of the gain extraction region as an edge region, the dust position is forcibly excluded from the edge portion by the following equation (33) using the dust map information obtained in step S46. Process. Here, in order to prevent the edge region from being cut off too much, the dust map before the dust map enlargement process in step S47 is used. This operation can be easily understood by describing this operation as “EDGE '' = EDGE + DARK-DUST”.
if dmap [i, j] = 1 EDGE [i, j] = 0 ... (33)

4’)エッジマップの周辺同化処理(ゴミくりぬき部の補正)(S60)
エッジマップがいびつにゴミ部のみくりぬかれた(除外された)状態は不自然なので、エッジマップ内での周辺同化処理を行う。例えば、背景が青空のような一様な画像であれば、ステップS46のゴミマップ情報を使用して、エッジマップから大きなゴミによるエッジ部をくりぬいてもなんら問題が生じない。むしろ、くりぬく必要がある。しかし、背景が模様や構造のある画像である場合に、ステップS46のゴミマップ情報によりゴミがあるとしてその部分をエッジマップからくりぬくと、周辺の実際の模様や構造との関係から不自然な補正処理を行うことになる。従って、エッジ部でないと判断された画素が、その周辺の画素にエッジ画素が多数あると判断される場合は、その画素を再度エッジ部とするようにする。
4 ′) Edge map peripheral assimilation process (correction of dust cut-out portion) (S60)
Since it is unnatural that the edge map is hollowed out (excluded) only in the dust part, peripheral assimilation processing in the edge map is performed. For example, if the background is a uniform image such as a blue sky, no problem occurs even if the dust map information in step S46 is used to cut out an edge portion of large dust from the edge map. Rather, it needs to be hollowed out. However, if the background is an image having a pattern or structure, and the portion is removed from the edge map by assuming that there is dust from the dust map information in step S46, an unnatural correction is made due to the relationship with the actual pattern or structure around. Processing will be performed. Therefore, when it is determined that a pixel determined not to be an edge portion has a large number of edge pixels in its peripheral pixels, the pixel is set as an edge portion again.

エッジマップの周辺同化処理は、次に示す処理により行う。具体的には、例えば図19に示すような着目画素に対する周辺8画素(図19の黒丸の画素、図19は着目画素[i,j]=[0,0]に対して第4象限のみを示す)のうち4個を超える画素がエッジの場合、着目画素もエッジとする。4個を超えるとは周辺8画素のうちエッジである画素が過半数あることを意味する。すなわち、周辺画素にエッジの画素が過半数存在する場合は、着目画素もエッジとする。なお、以下の処理の例では、水平方向垂直方向の8画素目の画素を見ているが、必ずしも8画素目に限定する必要はない。数画素から十数画素先の画素を見ればよい。また、以下の処理は全画素について行ってもよいし、dmap=1でエッジくり抜きした画素のみに限定してもよい。
データコピー
tmp[i,j]=EDGE[i,j] すべての画素[i,j]に対して
周辺同化処理
if tmp[i,j]=0{
sum = tmp[i-8,j]+tmp[i+8,j]+tmp[i,j-8]+tmp[i,j+8]
+tmp[i-8,j-8]+tmp[i+8,j+8]+tmp[i-8,j+8]+tmp[i+8,j-8]
if sum>4 EDGE[i,j]=1
}
Edge map peripheral assimilation processing is performed by the following processing. Specifically, for example, the surrounding eight pixels for the pixel of interest as shown in FIG. 19 (black circle pixels in FIG. 19, FIG. 19 shows only the fourth quadrant for the pixel of interest [i, j] = [0,0]. In the case where more than four pixels are edges, the pixel of interest is also an edge. Exceeding 4 means that the majority of pixels in the peripheral 8 pixels are edges. That is, when a majority of edge pixels exist in the peripheral pixels, the target pixel is also an edge. In the following processing example, the eighth pixel in the horizontal and vertical directions is seen, but it is not necessarily limited to the eighth pixel. What is necessary is just to look at a pixel several to ten or more pixels ahead. Further, the following processing may be performed for all the pixels, or may be limited to only the pixels that are edge-extracted with dmap = 1.
Data copy
tmp [i, j] = EDGE [i, j] Peripheral assimilation for all pixels [i, j]
if tmp [i, j] = 0 {
sum = tmp [i-8, j] + tmp [i + 8, j] + tmp [i, j-8] + tmp [i, j + 8]
+ tmp [i-8, j-8] + tmp [i + 8, j + 8] + tmp [i-8, j + 8] + tmp [i + 8, j-8]
if sum> 4 EDGE [i, j] = 1
}

5)ステップS55のエッジマップの拡大処理は、第3の実施の形態と同様である。6)ステップS56の平坦マップへの変換は、第3の実施の形態と同様である。   5) The edge map enlargement process in step S55 is the same as in the third embodiment. 6) The conversion to the flat map in step S56 is the same as in the third embodiment.

7)自己ゲイン抽出領域の特定
ステップS57では、自己ゲイン抽出領域の特定をする。平坦部でかつゴミ領域と特定されている領域に限定して、ゴミ除去を行うのが補正対象画像の誤った補正を防ぐ観点から最も合理的である。したがって、この両条件を満たす領域情報を次式(34)により求め平坦マップに代入する。すなわち、FLATとdmapに両方に1のフラグが立っている場合のみFLAT=1となり、それ以外はFLAT=0となる。
FLAT[i,j]=FLAT[i,j]*dmap[i,j] ...(34)
7) Identification of self gain extraction region In step S57, the self gain extraction region is identified. It is most reasonable from the viewpoint of preventing erroneous correction of the correction target image to perform dust removal only on a flat part and an area specified as a dust area. Therefore, area information that satisfies both conditions is obtained by the following equation (34) and substituted into the flat map. That is, FLAT = 1 only when 1 is set in both FLAT and dmap, and FLAT = 0 otherwise.
FLAT [i, j] = FLAT [i, j] * dmap [i, j] ... (34)

8)自己ゲイン抽出
ステップS58の自己ゲイン抽出は、第3の実施の形態とは異なり、局所的規格化処理(ゲイン抽出処理)のみ行う。それ以降の透過率マップの統計解析と閾値処理によるゴミ領域限定処理は、7)の処理により既にゴミ近傍に限定されているので不要である。局所的規格化処理(ゲイン抽出処理)は、第3の実施の形態と同様である。このように、ステップS47の処理によって瞳位置変換精度の誤差分だけゴミ周辺にゲイン抽出領域を広げてゴミ探索することにより、漏れなくゴミ抽出することが可能となる。
8) Self-Gain Extraction Unlike the third embodiment, the self-gain extraction in step S58 performs only the local normalization process (gain extraction process). Subsequent statistical analysis of the transmittance map and dust region limitation processing by threshold processing are unnecessary because they are already limited to the vicinity of dust by the processing of 7). The local normalization process (gain extraction process) is the same as that in the third embodiment. As described above, by performing the dust search by expanding the gain extraction area around the dust by the error of the pupil position conversion accuracy by the process of step S47, dust can be extracted without omission.

ここで自己抽出した透過率マップに対してローパス処理を行う。T[i,j]の自己抽出した全領域に、第1の実施の形態と同様なローパス処理をして、T[i,j]に含まれる画素[i,j]のゆらぎ成分を除去する。本実施の形態では、ゴミ位置の局所領域のみに限定して、統計解析による閾値処理を介さないで、自己ゲイン抽出による自己ゲイン補正を行うので、このローパス処理は重要な処理となる。すなわち、ローパス処理前は画素値と透過率値T[i,j]が同じ方向にゆらいでいるため、ローパス処理をしないで後述の自己ゲイン補正すると、画像はその局所領域のみ全体的にのっぺりとなりやすい。そこで、T[i,j]のゆらぎ成分を取り除いてやれば、画素値が持つゆらぎ成分を失わずに済み、周辺部との粒状性の連続性が保てるようになる。これは、特に高感度画像のような乱雑性が多い場合に威力を発揮する。ここで、ローパスフィルタは、第1の実施の形態よりももう少し強めに設計してもかまわないし、ローパスフィルタの影響を受けやすい大きなゴミ部分(T[i,j]の値が1に比べかなり小さい所)だけはローパスフィルタ処理を外すようにしても構わない。   Here, low-pass processing is performed on the self-extracted transmittance map. A low pass process similar to that of the first embodiment is performed on all self-extracted regions of T [i, j] to remove the fluctuation component of the pixel [i, j] included in T [i, j]. . In the present embodiment, the low-pass process is an important process because the self-gain correction is performed by extracting the self-gain without limiting the threshold value process by statistical analysis only to the local region of the dust position. That is, the pixel value and the transmittance value T [i, j] fluctuate in the same direction before the low-pass processing, so if self-gain correction described later is performed without performing the low-pass processing, the image is entirely covered only in the local region. Cheap. Therefore, if the fluctuation component of T [i, j] is removed, the fluctuation component of the pixel value is not lost, and the continuity of graininess with the peripheral portion can be maintained. This is particularly effective when there is a lot of randomness such as a high-sensitivity image. Here, the low-pass filter may be designed to be a little stronger than the first embodiment, and a large dust portion (T [i, j] value that is easily affected by the low-pass filter is considerably smaller than 1). However, the low-pass filter processing may be removed only for (1).

9)自己ゲイン補正
ステップS59の自己ゲイン補正は、第3の実施の形態と同様である。基準画像の透過率マップの瞳位置変換精度が悪くても、補正対象画像自身からゴミの透過率情報を抽出するので、全くずれのないきれいな補正が可能となる。なお、自己ゲインの抽出は、ステップS57で特定された自己ゲイン抽出領域に限って行われる。従って、補正処理もこの範囲に限ってのみ行われ、処理の負荷が軽減される。
9) Self-Gain Correction The self-gain correction in step S59 is the same as in the third embodiment. Even if the pupil position conversion accuracy of the transmittance map of the reference image is poor, the dust transmittance information is extracted from the correction target image itself, so that clean correction without any deviation can be performed. The self-gain extraction is performed only in the self-gain extraction area specified in step S57. Therefore, the correction process is performed only within this range, and the processing load is reduced.

以上のように、第4の実施の形態では、基準画像のゴミマップ情報を有効に利用することによって、補正対象画像内の大きなゴミから小さなゴミまであらゆるゴミを漏れなく自己抽出することが可能となる。また、基準画像の透過率マップの瞳位置変換精度が悪い場合、第2の実施の形態の代替手段として用いることができる。さらに、第2の実施の形態と同様に基準画像撮影の撮影者の負荷は非常に小さくて済む。   As described above, in the fourth embodiment, by effectively using the dust map information of the reference image, it is possible to self-extract all dust from large dust to small dust in the correction target image without omission. Become. Further, when the pupil position conversion accuracy of the transmittance map of the reference image is poor, it can be used as an alternative means of the second embodiment. Further, as in the second embodiment, the load on the photographer of the reference image photographing can be very small.

上記説明した第1の実施の形態〜第4の実施の形態の画像処理装置では、電子カメラで任意の使用時刻、任意の使用条件で撮影した画像おいて生じたゴミ等の影響による黒染み等の欠陥を、適切に補正し、高品質な画像を再現することができる。   In the image processing apparatuses according to the first to fourth embodiments described above, black stains due to the influence of dust or the like generated in an image taken with an electronic camera at an arbitrary use time and an arbitrary use condition, etc. It is possible to appropriately correct the defect and reproduce a high-quality image.

なお、上記第1、第2、第4の実施の形態では、透過率マップを作成するのに、撮影者が一様に近いと考える基準画像を撮影して、その撮影した基準画像に局所的規格処理等を施して透過率マップを作成していた。しかし、撮影者が一様に近いと考える基準画像に小さな模様等がある場合もある。これは、基本的に被写体をボカして撮影することで対処できる。例えば、紙をレンズの最短撮影距離よりも至近位置において撮影したりすればよい。たとえ、小さな模様があっても(2a+1)x(2b+1)サイズのゲイン抽出カーネルより広い範囲でゆるやかに変化する像にボケれば十分に目的を達成することのできる一様に近い基準画像になり得る。   In the first, second, and fourth embodiments, when creating the transmittance map, a reference image that the photographer thinks is nearly uniform is photographed, and the photographed reference image is localized. A transmittance map was created by applying standard processing. However, there may be a small pattern or the like in the reference image that the photographer thinks is almost uniform. This can be dealt with by basically shooting the subject with a blur. For example, the paper may be photographed at a position closer than the shortest photographing distance of the lens. Even if there is a small pattern, it is almost uniform enough to achieve the purpose if it blurs to an image that changes slowly over a wide range than the gain extraction kernel of (2a + 1) x (2b + 1) size Can be a reference image.

また、上記第4の実施の形態では、ステップS57で自己ゲイン抽出領域の特定をし、ステップS58では限定された範囲で補正を行うようにした。このように補正範囲をゴミ領域を含む周辺範囲(近傍領域)に限定する手法は、上記第1〜第3の実施の形態において適用することも可能である。第1〜第3の実施の形態では、求められた透過率マップからゴミを特定し、その周辺領域を求めればよい。   In the fourth embodiment, the self-gain extraction area is specified in step S57, and correction is performed in a limited range in step S58. The method of limiting the correction range to the peripheral range (neighboring region) including the dust region can be applied in the first to third embodiments. In the first to third embodiments, dust may be identified from the obtained transmittance map and its peripheral area may be obtained.

また、上記第3の実施の形態では、1枚の撮影画像を取得し、1枚の撮影画像の中で平坦部を抽出してゴミマップを生成する処理について説明した。しかし、平坦部に大きなゴミがある場合には、その部分が平坦部として抽出されないことがある。第4の実施の形態では基準画像を取得することによりこれに対処する例を示したが、基準画像を取得しなくても複数の画像の相関を利用することによりそのような大きなゴミの部分も欠陥情報作成対象の平坦部として認識することが可能である。例えば、異なる被写体の複数の撮影画像において、常に同じ位置にエッジ抽出で検出される像があった場合、それはゴミによる像である可能性がある。従って、第3の実施の形態で処理されるエッジマップについて複数の撮影画像でANDを取ったとき、ANDが取れた部分をエッジマップから除外する。このようにすることにより、ANDが取れた部分を平坦部に追加することができ、大きなゴミについても透過率マップを作成することができる。なお、ANDを取るのはエッジマップに限定しなくてもよい。撮影画像から生成されるデータであって、複数の撮影画像間でANDを取って撮影光路上のゴミが認識できるデータであればどのようなデータでもよい。例えば、ゲイン抽出カーネルによる透過率マップを平坦部か否かにかかわらず、強制的に画像全面について算出し、複数の画像間で同じ位置に同じような透過率で抽出される像があった場合、欠陥情報の透過率マップとして残し、他は欠陥情報から除外するようなANDの取り方も考えられる。   In the third embodiment, the process of acquiring one photographed image, extracting a flat portion from one photographed image, and generating a dust map has been described. However, when there is large dust on the flat part, the part may not be extracted as a flat part. In the fourth embodiment, an example of dealing with this by acquiring a reference image has been shown. However, even if a reference image is not acquired, such a large portion of dust can also be obtained by using the correlation of a plurality of images. It can be recognized as a flat part for which defect information is to be created. For example, in a plurality of captured images of different subjects, if there is an image that is always detected by edge extraction at the same position, it may be an image due to dust. Accordingly, when an AND is performed on a plurality of captured images for the edge map processed in the third embodiment, the ANDed portion is excluded from the edge map. In this way, the ANDed portion can be added to the flat portion, and a transmittance map can be created for large dust. Note that the AND is not necessarily limited to the edge map. Any data may be used as long as it is data generated from a photographed image and can recognize dust on the photographing optical path by taking an AND between a plurality of photographed images. For example, if the transmittance map by the gain extraction kernel is forcibly calculated for the entire image regardless of whether it is a flat part, and there is an image extracted with the same transmittance at the same position between multiple images Also, it is conceivable to take an AND that leaves the defect information as a transmittance map and excludes it from the defect information.

また、第3の実施の形態で得られた平坦部における透過率マップについて、複数の撮影画像のORを取れば、撮影画面全体の透過率マップを得ることができる。第3の実施の形態で得られる平坦部は、被写体が異なるごとに撮影画面における平坦部の位置も異なる。これらの平坦部のORを取れば、撮影画面全体になることもある。従って、ゴミ情報を得るための基準画像を撮影しなくても、複数の撮影画像すなわち複数の補正対象画像から撮影画面全体の透過率マップを得ることができる。この撮影画面全体の透過率マップは、複数の補正対象画像に共通に使用することができる。   Further, if the transmittance map in the flat portion obtained in the third embodiment is ORed for a plurality of captured images, a transmittance map of the entire captured screen can be obtained. The flat part obtained in the third embodiment differs in the position of the flat part on the photographing screen every time the subject is different. If the OR of these flat portions is taken, the entire photographing screen may be obtained. Therefore, it is possible to obtain a transmittance map of the entire photographing screen from a plurality of photographed images, that is, a plurality of correction target images, without photographing a reference image for obtaining dust information. The transmittance map of the entire photographing screen can be used in common for a plurality of correction target images.

なお、上述したように複数の撮影画像についてエッジマップのANDを取ったり透過率マップのORを取ったりする場合、撮影画像ごとに瞳位置やF値(絞り値)が異なることもある。この場合は、第2の実施の形態で説明したのと同様に、瞳位置変換やF値変換を画像信号のままの状態や透過率マップの状態で施すなどして活用すればよい。   As described above, when ANDing an edge map or ORing a transmittance map for a plurality of captured images, the pupil position and F value (aperture value) may differ for each captured image. In this case, as described in the second embodiment, the pupil position conversion and the F value conversion may be used in the state of the image signal or in the state of the transmittance map.

また、上記実施の形態では、ベイア配列のRGB表色系の例を説明したが、最終的に補間処理がなされるものであれば、カラーフィルタの配置方法には全く依存しないことは言うまでもない。また、他の表色系(例えば補色表色系)であっても同様である。   In the above embodiment, an example of the RGB color system of the Bayer array has been described, but it goes without saying that it does not depend on the color filter arrangement method at all as long as interpolation processing is finally performed. The same applies to other color systems (for example, complementary color systems).

また、上記実施の形態では、交換レンズ方式の一眼レフ電子スチルカメラの例を説明したが、必ずしもこの内容に限定する必要はない。非交換レンズ方式のカメラにも本発明は適用できる。瞳位置や絞り値は、適宜公知な手法で取得すればよい。   In the above embodiment, an example of an interchangeable lens type single-lens reflex electronic still camera has been described. However, the present invention is not necessarily limited to this content. The present invention can also be applied to a non-interchangeable lens type camera. What is necessary is just to acquire a pupil position and an aperture value by a well-known method suitably.

また、上記実施の形態では、電子スチルカメラ1で撮影した画像データを処理する例を説明したが、必ずしもこの内容に限定する必要はない。本発明は、動画を扱うビデオカメラで撮影した画像データにも適用できる。また、カメラつき携帯電話などで撮影した画像データにも適用できる。さらに、コピー機やスキャナー等にも適用できる。すなわち、撮像素子を使用して撮像したあらゆる画像データに対して、本発明を適用することができる。   In the above-described embodiment, an example in which image data captured by the electronic still camera 1 is processed has been described. However, the present invention is not necessarily limited to this content. The present invention can also be applied to image data taken by a video camera that handles moving images. It can also be applied to image data taken with a camera-equipped mobile phone. Furthermore, it can be applied to a copying machine, a scanner, and the like. That is, the present invention can be applied to any image data captured using an image sensor.

また、上記実施の形態では、電子カメラ1で撮影した画像データをPC(パソコン)31で処理してゴミの影響を除去する例を説明したが、必ずしもこの内容に限定する必要はない。電子カメラ1上で、そのようなプログラムを備えてもよい。また、プリンターや投影装置などにそのようなプログラムを備えてもよい。すなわち、画像データを扱うあらゆる装置に、本発明は適用することができる。   In the above-described embodiment, an example in which image data captured by the electronic camera 1 is processed by the PC (personal computer) 31 to remove the influence of dust has been described. However, the present invention is not necessarily limited to this content. Such a program may be provided on the electronic camera 1. Further, such a program may be provided in a printer, a projection device, or the like. That is, the present invention can be applied to any apparatus that handles image data.

PC31で実行するプログラムは、CD−ROMなどの記録媒体やインターネットなどのデータ信号を通じて提供することができる。図18はその様子を示す図である。PC31は、CD−ROM34を介してプログラムの提供を受ける。また、PC31は通信回線401との接続機能を有する。コンピュータ402は上記プログラムを提供するサーバーコンピュータであり、ハードディスク403などの記録媒体にプログラムを格納する。通信回線401は、インターネット、パソコン通信などの通信回線、あるいは専用通信回線などである。コンピュータ402はハードディスク403を使用してプログラムを読み出し、通信回線401を介してプログラムをPC31に送信する。すなわち、プログラムをデータ信号として搬送波にのせて、通信回線401を介して送信する。このように、プログラムは、記録媒体や搬送波などの種々の形態のコンピュータ読み込み可能なコンピュータプログラム製品として供給できる。   The program executed on the PC 31 can be provided through a recording medium such as a CD-ROM or a data signal such as the Internet. FIG. 18 is a diagram showing this state. The PC 31 receives a program via the CD-ROM 34. Further, the PC 31 has a connection function with the communication line 401. A computer 402 is a server computer that provides the program, and stores the program in a recording medium such as a hard disk 403. The communication line 401 is a communication line such as the Internet or personal computer communication, or a dedicated communication line. The computer 402 reads the program using the hard disk 403 and transmits the program to the PC 31 via the communication line 401. That is, the program is transmitted as a data signal on a carrier wave via the communication line 401. Thus, the program can be supplied as a computer-readable computer program product in various forms such as a recording medium and a carrier wave.

上記では、種々の実施の形態および変形例を説明したが、本発明はこれらの内容に限定されるものではない。本発明の技術的思想の範囲内で考えられるその他の態様も本発明の範囲内に含まれる。   Although various embodiments and modifications have been described above, the present invention is not limited to these contents. Other embodiments conceivable within the scope of the technical idea of the present invention are also included in the scope of the present invention.

交換レンズ方式の電子カメラの構成を示す図である。It is a figure which shows the structure of the electronic camera of an interchangeable lens system. 電子カメラのブロック図とパーソナルコンピュータ(PC)および周辺装置を示す図である。1 is a block diagram of an electronic camera, a personal computer (PC), and a peripheral device. 第1の実施の形態における、電子カメラ側の撮影手順について説明する図である。It is a figure explaining the imaging | photography procedure on the electronic camera side in 1st Embodiment. 輝度面に対して局所的規格化処理を施した様子を示す図である。It is a figure which shows a mode that the local normalization process was performed with respect to the luminance surface. 透過率マップのヒストグラムを示す図である。It is a figure which shows the histogram of a transmittance | permeability map. 第1の実施の形態における、PCで行う処理の流れを示すフローチャートである。It is a flowchart which shows the flow of the process performed by PC in 1st Embodiment. 第2の実施の形態における、電子カメラ側の撮影手順について説明する図である。It is a figure explaining the imaging | photography procedure on the electronic camera side in 2nd Embodiment. 瞳位置が変化するとゴミ影の位置が変化する様子を示す図である。It is a figure which shows a mode that the position of a dust shadow changes when a pupil position changes. 絞り値であるF値が変化するとゴミ影の大きさが変化する様子を示す図である。It is a figure which shows a mode that the magnitude | size of a dust shadow changes when F value which is an aperture value changes. 各絞り値に対する一次元フィルタ係数を示す図である。It is a figure which shows the one-dimensional filter coefficient with respect to each aperture value. 絞り値F16における透過率マップに変換するフィルタを2次元フィルタで表した図である。It is the figure which represented the filter converted into the transmittance | permeability map in aperture value F16 with the two-dimensional filter. 第2の実施の形態における、PCで行う処理の流れを示すフローチャートである。It is a flowchart which shows the flow of the process performed by PC in 2nd Embodiment. 中くらい程度のゴミについて、F値変換により透過率が変換される様子を示す図である。It is a figure which shows a mode that the transmittance | permeability is converted by F value conversion about medium grade garbage. 第3の実施の形態における、電子カメラ側の撮影手順について説明する図である。It is a figure explaining the imaging | photography procedure on the electronic camera side in 3rd Embodiment. 第3の実施の形態における、PCで行う処理のフローチャートを示す図である。It is a figure which shows the flowchart of the process performed by PC in 3rd Embodiment. エッジ抽出フィルタを示す図である。It is a figure which shows an edge extraction filter. 第4の実施の形態における、PCで行う処理のフローチャートを示す図である。It is a figure which shows the flowchart of the process performed by PC in 4th Embodiment. プログラムを、CD−ROMなどの記録媒体やインターネットなどのデータ信号を通じて提供する様子を示す図である。It is a figure which shows a mode that a program is provided through data signals, such as recording media, such as CD-ROM, and the internet. エッジマップの周辺同化処理の様子を示す図である。It is a figure which shows the mode of the edge assimilation process of an edge map.

符号の説明Explanation of symbols

1 電子カメラ
2 カメラ本体
3 可変光学系
4 レンズ
5 絞り
6 シャッター
7 光学部品
8 撮像素子
9 マウント部
12 アナログ信号処理部
13 A/D変換部
14 タイミング制御部
15 画像処理部
16 操作部
17 制御部
18 メモリ
19 圧縮/伸長部
20 表示画像生成部
21、32 モニタ
22 メモリカード用インタフェース部
23 外部インタフェース部
24 バス
30 メモリカード
31 PC(パーソナルコンピュータ)
33 プリンタ
34 CD−ROM
DESCRIPTION OF SYMBOLS 1 Electronic camera 2 Camera main body 3 Variable optical system 4 Lens 5 Aperture 6 Shutter 7 Optical component 8 Imaging element 9 Mount part 12 Analog signal processing part 13 A / D conversion part 14 Timing control part 15 Image processing part 16 Operation part 17 Control part DESCRIPTION OF SYMBOLS 18 Memory 19 Compression / decompression part 20 Display image generation part 21, 32 Monitor 22 Memory card interface part 23 External interface part 24 Bus 30 Memory card 31 PC (personal computer)
33 Printer 34 CD-ROM

Claims (14)

撮像素子により撮影された画像を取得する画像取得手段と、
前記取得した画像内において、着目画素の値と該着目画素を含む所定範囲内の複数の画素の値の平均値との相対比を算出する相対比算出手段と、
前記算出した相対比に基づいて、前記画像内の欠陥情報を作成する欠陥情報作成手段と、
前記欠陥情報に基づいて、前記画像内の欠陥を補正する補正手段とを備え、
前記補正手段は、前記相対比の逆数値を、対応する画素の値に掛け算して補正することを特徴とする画像処理装置。
Image acquisition means for acquiring an image captured by the image sensor;
A relative ratio calculating means for calculating a relative ratio between the value of the pixel of interest and the average value of a plurality of pixels within a predetermined range including the pixel of interest in the acquired image;
Defect information creating means for creating defect information in the image based on the calculated relative ratio;
Correction means for correcting defects in the image based on the defect information,
The image processing apparatus according to claim 1, wherein the correction unit corrects an inverse value of the relative ratio by multiplying a value of a corresponding pixel.
請求項1に記載の画像処理装置において、
前記画像取得手段は、前記撮像素子により撮影された複数の画像を取得し、
前記欠陥情報作成手段は、前記取得した複数の画像を使用して、前記複数の画像のいずれかの画像内の欠陥情報を作成することを特徴とする画像処理装置。
The image processing apparatus according to claim 1.
The image acquisition means acquires a plurality of images taken by the image sensor,
The defect information creating means creates defect information in any one of the plurality of images using the plurality of acquired images.
請求項1に記載の画像処理装置において、
前記画像取得手段は、前記撮像素子により撮影された複数の画像を取得し、
前記欠陥情報作成手段は、前記取得した複数の画像を使用して、前記複数の画像の画像全体に対応する欠陥情報を作成することを特徴とする画像処理装置。
The image processing apparatus according to claim 1.
The image acquisition means acquires a plurality of images taken by the image sensor,
The defect information creating means creates defect information corresponding to the entire images of the plurality of images using the plurality of acquired images.
光学系を通して撮影された基準画像を取得する画像取得手段と、
前記取得した基準画像内において、着目画素の値と該着目画素を含む所定範囲内の複数の画素の値の平均値との相対比を算出する相対比算出手段と、
前記算出した相対比に基づいて、前記基準画像内の欠陥情報を作成する欠陥情報作成手段とを備え、
前記画像取得手段は、前記光学系を通して撮影された補正対象画像を取得し、
前記基準画像内の欠陥情報に基づいて、前記補正対象画像内の欠陥を補正する補正手段を更に備え、
前記補正手段は、前記基準画像の相対比の逆数値を、前記補正対象画像の対応する画素の値に掛け算して補正することを特徴とする画像処理装置。
Image acquisition means for acquiring a reference image photographed through the optical system;
A relative ratio calculating means for calculating a relative ratio between the value of the target pixel and the average value of a plurality of pixels within a predetermined range including the target pixel in the acquired reference image;
A defect information creating means for creating defect information in the reference image based on the calculated relative ratio;
The image acquisition means acquires a correction target image photographed through the optical system,
Based on the defect information in the reference image, further comprising correction means for correcting defects in the correction target image,
The image processing apparatus, wherein the correction unit corrects an inverse value of a relative ratio of the reference image by multiplying a value of a corresponding pixel of the correction target image.
請求項4に記載の画像処理装置において、
前記補正手段は、前記基準画像と前記補正対象画像とが、絞り値および瞳位置が実質的に同じ光学的条件の光学系を通して撮影されている場合、前記生成された欠陥情報をそのまま使用して、前記補正対象画像を構成する画素の値を補正することを特徴とする画像処理装置。
The image processing apparatus according to claim 4.
The correction means uses the generated defect information as it is when the reference image and the correction target image are photographed through an optical system having substantially the same optical conditions in terms of aperture value and pupil position. An image processing apparatus for correcting a value of a pixel constituting the correction target image.
請求項4に記載の画像処理装置において、
前記光学系の光学的条件である絞り値および瞳位置の少なくとも1つに応じて、前記欠陥情報を変換する欠陥情報変換手段をさらに備え、
前記補正手段は、前記基準画像と前記補正対象画像とが、絞り値および瞳位置の少なくとも1つが異なる光学的条件の光学系を通して撮影されている場合、前記変換された欠陥情報を使用して、前記補正対象画像を構成する画素の値を補正することを特徴とする画像処理装置。
The image processing apparatus according to claim 4.
A defect information converting means for converting the defect information according to at least one of an aperture value and a pupil position, which are optical conditions of the optical system,
The correction means uses the converted defect information when the reference image and the correction target image are photographed through an optical system having different optical conditions at least one of an aperture value and a pupil position. An image processing apparatus for correcting a value of a pixel constituting the correction target image.
請求項1または4に記載の画像処理装置において、
前記相対比算出手段は、前記算出した相対比が1を挟んだ所定範囲に含まれるとき、前記算出した相対比を1に設定することを特徴とする画像処理装置。
The image processing apparatus according to claim 1 or 4,
The image processing apparatus according to claim 1, wherein the relative ratio calculation unit sets the calculated relative ratio to 1 when the calculated relative ratio is included in a predetermined range including 1.
請求項7に記載の画像処理装置において、
前記相対比算出手段は、前記算出した相対比を1に設定する前記所定範囲を、前記算出した相対比の標準偏差値と関連づけることを特徴とする画像処理装置。
The image processing apparatus according to claim 7.
The image processing apparatus according to claim 1, wherein the relative ratio calculation unit associates the predetermined range in which the calculated relative ratio is set to 1 with a standard deviation value of the calculated relative ratio.
請求項4に記載の画像処理装置において、
前記画像取得手段は、前記補正対象画像の撮影前後の所定時間内に撮影された基準画像を取得することを特徴とする画像処理装置。
The image processing apparatus according to claim 4.
The image processing apparatus is characterized in that the image acquisition means acquires a reference image captured within a predetermined time before and after the correction target image is captured.
請求項9に記載の画像処理装置において、
前記画像取得手段は、前記補正対象画像の撮影時間に2番目以内に近い時間に撮影された基準画像を取得することを特徴とする画像処理装置。
The image processing apparatus according to claim 9.
The image processing device is characterized in that the image acquisition means acquires a reference image captured at a time that is close to a second time within the imaging time of the correction target image.
複数色に分光可能な撮像素子を使用して撮影された画像を取得する画像取得手段と、
前記画像の複数色の信号から輝度信号を生成する輝度信号生成手段と、
前記取得した画像内において、着目画素の前記生成した輝度信号の値と該着目画素を含む所定範囲内の複数の画素の前記生成した輝度信号の平均値との相対比を算出する相対比算出手段と、
前記算出した相対比に基づいて、前記画像内の欠陥情報を作成する欠陥情報作成手段と、
前記欠陥情報に基づいて、前記画像内の欠陥画素の各色成分の値を補正する補正手段とを備え、
前記補正手段は、前記相対比の逆数値を、対応する画素の各色成分の値毎に掛け算して補正することを特徴とする画像処理装置。
Image acquisition means for acquiring an image photographed using an imaging device capable of splitting into a plurality of colors;
Luminance signal generating means for generating a luminance signal from signals of a plurality of colors of the image;
Relative ratio calculation means for calculating a relative ratio between the value of the generated luminance signal of the target pixel and the average value of the generated luminance signal of a plurality of pixels within a predetermined range including the target pixel in the acquired image. When,
Defect information creating means for creating defect information in the image based on the calculated relative ratio;
Correction means for correcting the value of each color component of the defective pixel in the image based on the defect information;
The image processing apparatus according to claim 1, wherein the correction unit corrects the reciprocal value of the relative ratio by multiplying the value of each color component of the corresponding pixel.
請求項11に記載の画像処理装置において、
前記画像取得手段は、前記撮像素子により撮影された複数の画像を取得し、
前記輝度信号生成手段は、前記取得した複数の画像について前記輝度信号を生成し、
前記欠陥情報作成手段は、前記生成された複数の画像の輝度信号を使用して、前記複数の画像のいずれかの画像内の欠陥情報を作成することを特徴とする画像処理装置。
The image processing apparatus according to claim 11.
The image acquisition means acquires a plurality of images taken by the image sensor,
The luminance signal generation means generates the luminance signal for the acquired plurality of images,
The defect information creating means creates defect information in any one of the plurality of images by using luminance signals of the plurality of generated images.
請求項11に記載の画像処理装置において、
前記画像取得手段は、前記撮像素子により撮影された複数の画像を取得し、
前記輝度信号生成手段は、前記取得した複数の画像について前記輝度信号を生成し、
前記欠陥情報作成手段は、前記取得した複数の画像を使用して、前記複数の画像の画像全体に対応する欠陥情報を作成することを特徴とする画像処理装置。
The image processing apparatus according to claim 11.
The image acquisition means acquires a plurality of images taken by the image sensor,
The luminance signal generation means generates the luminance signal for the acquired plurality of images,
The defect information creating means creates defect information corresponding to the entire images of the plurality of images using the plurality of acquired images.
請求項1〜13のいずれかに記載の画像処理装置の機能をコンピュータに実行させるための画像処理プログラム。 The image processing program for executing the functions of the image processing apparatus according to a computer in any one of claims 1 to 13.
JP2003307355A 2002-12-27 2003-08-29 Image processing apparatus and image processing program Expired - Lifetime JP4466015B2 (en)

Priority Applications (10)

Application Number Priority Date Filing Date Title
JP2003307355A JP4466015B2 (en) 2002-12-27 2003-08-29 Image processing apparatus and image processing program
CN2010101265675A CN101778203B (en) 2002-12-27 2003-12-25 Image processing device
EP12157353.9A EP2461576B1 (en) 2002-12-27 2003-12-25 Image processing apparatus and image processing program
CN200380107791.8A CN1732682B (en) 2002-12-27 2003-12-25 Image processing device
PCT/JP2003/016797 WO2004062275A1 (en) 2002-12-27 2003-12-25 Image processing device and image processing program
CN2010101265533A CN101778222B (en) 2002-12-27 2003-12-25 Image processing apparatus
US10/540,972 US7853097B2 (en) 2002-12-27 2003-12-25 Image processing apparatus and image processing program
EP03768277.0A EP1583356B1 (en) 2002-12-27 2003-12-25 Image processing device and image processing program
US12/640,603 US8031968B2 (en) 2002-12-27 2009-12-17 Image processing apparatus and image processing program
US13/222,842 US8369651B2 (en) 2002-12-27 2011-08-31 Image processing apparatus and image processing program

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
JP2002379719 2002-12-27
JP2003307355A JP4466015B2 (en) 2002-12-27 2003-08-29 Image processing apparatus and image processing program

Publications (2)

Publication Number Publication Date
JP2004222231A JP2004222231A (en) 2004-08-05
JP4466015B2 true JP4466015B2 (en) 2010-05-26

Family

ID=32911253

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2003307355A Expired - Lifetime JP4466015B2 (en) 2002-12-27 2003-08-29 Image processing apparatus and image processing program

Country Status (1)

Country Link
JP (1) JP4466015B2 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9706110B2 (en) 2013-02-18 2017-07-11 Panasonic Intellectual Property Management Co., Ltd. Foreign body information detection device and foreign body information detection method of imaging apparatus

Families Citing this family (20)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2007215151A (en) 2006-01-12 2007-08-23 Canon Inc Imaging apparatus, control method thereof, and program
JP4590355B2 (en) * 2006-01-12 2010-12-01 キヤノン株式会社 Image processing apparatus, image processing method, and program
JP4757085B2 (en) 2006-04-14 2011-08-24 キヤノン株式会社 IMAGING DEVICE AND ITS CONTROL METHOD, IMAGE PROCESSING DEVICE, IMAGE PROCESSING METHOD, AND PROGRAM
JP4968885B2 (en) 2006-06-05 2012-07-04 キヤノン株式会社 IMAGING DEVICE AND ITS CONTROL METHOD, IMAGING SYSTEM, IMAGE PROCESSING METHOD, AND PROGRAM
JP2008033442A (en) 2006-07-26 2008-02-14 Canon Inc Image processor, its control method, and program
JP4771539B2 (en) 2006-07-26 2011-09-14 キヤノン株式会社 Image processing apparatus, control method therefor, and program
JP4771540B2 (en) 2006-07-26 2011-09-14 キヤノン株式会社 Image processing apparatus, control method therefor, image processing method and program
JP5109529B2 (en) * 2006-12-28 2012-12-26 株式会社Jvcケンウッド Imaging device
JP4795286B2 (en) * 2007-03-23 2011-10-19 キヤノン株式会社 Imaging device
JP4799462B2 (en) 2007-03-27 2011-10-26 キヤノン株式会社 Image processing apparatus, control method thereof, program, storage medium, and imaging apparatus
JP2008258982A (en) 2007-04-05 2008-10-23 Canon Inc Image processor, control method therefor, and program
JP5046769B2 (en) 2007-07-24 2012-10-10 キヤノン株式会社 Imaging apparatus, control method thereof, and program
JP4989385B2 (en) 2007-09-12 2012-08-01 キヤノン株式会社 Imaging apparatus, control method thereof, and program
JP4960852B2 (en) * 2007-12-19 2012-06-27 キヤノン株式会社 Image processing apparatus, control method thereof, interchangeable lens single-lens reflex digital camera, and program
JP5094571B2 (en) * 2008-06-05 2012-12-12 キヤノン株式会社 Imaging apparatus, control method thereof, and program
JP5241348B2 (en) * 2008-07-03 2013-07-17 キヤノン株式会社 Imaging apparatus, control method thereof, and program
JP5014262B2 (en) * 2008-06-05 2012-08-29 キヤノン株式会社 Imaging apparatus, control method thereof, and program
US8593537B2 (en) 2008-06-05 2013-11-26 Canon Kabushiki Kaisha Image sensing apparatus, control method thereof, and program for suppressing image deterioration caused by foreign substance
JP5400504B2 (en) 2009-07-03 2014-01-29 キヤノン株式会社 Imaging apparatus, image processing apparatus, control method, and program
JP6488581B2 (en) 2014-07-25 2019-03-27 株式会社ソシオネクスト 霞 Image discrimination device and discrimination method

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9706110B2 (en) 2013-02-18 2017-07-11 Panasonic Intellectual Property Management Co., Ltd. Foreign body information detection device and foreign body information detection method of imaging apparatus

Also Published As

Publication number Publication date
JP2004222231A (en) 2004-08-05

Similar Documents

Publication Publication Date Title
JP4186699B2 (en) Imaging apparatus and image processing apparatus
JP4466015B2 (en) Image processing apparatus and image processing program
EP1583356B1 (en) Image processing device and image processing program
JP6173156B2 (en) Image processing apparatus, imaging apparatus, and image processing method
JP4196124B2 (en) Imaging system diagnostic apparatus, imaging system diagnostic program, imaging system diagnostic program product, and imaging apparatus
JP6833415B2 (en) Image processing equipment, image processing methods, and programs
JP4419479B2 (en) Image processing apparatus and image processing program
JP2007158830A (en) Image pickup device and image pickup device control method
JP4466017B2 (en) Image processing apparatus and image processing program
JP4438363B2 (en) Image processing apparatus and image processing program
JP6185249B2 (en) Image processing apparatus and image processing method
JP4466016B2 (en) Image processing apparatus and image processing program
JP2015192338A (en) Image processing device and image processing program
JP4523629B2 (en) Imaging device
JP6348883B2 (en) Image capturing apparatus, image capturing method, and computer program
JP2011135379A (en) Imaging apparatus, imaging method and program
JP5181952B2 (en) Image processing apparatus, image processing method, and program
JP6556033B2 (en) Image processing apparatus, image processing method, and program
JP7039221B2 (en) Control method of image processing device, image pickup device and image processing device
JP2012222509A (en) Image processor and image processing program
JP2011259344A (en) Imaging apparatus
JP2017116606A (en) Focus adjustment device, imaging device and program
JPH11331691A (en) Image pickup device
JP2012185648A (en) Image processing device and image processing program
JP2012231416A (en) Image processing apparatus and image processing program

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20060712

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20090519

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20090714

RD02 Notification of acceptance of power of attorney

Free format text: JAPANESE INTERMEDIATE CODE: A7422

Effective date: 20090714

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20091027

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20091203

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

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

R150 Certificate of patent or registration of utility model

Ref document number: 4466015

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R150

Free format text: JAPANESE INTERMEDIATE CODE: R150

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

Free format text: PAYMENT UNTIL: 20130305

Year of fee payment: 3

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

Free format text: PAYMENT UNTIL: 20130305

Year of fee payment: 3

S531 Written request for registration of change of domicile

Free format text: JAPANESE INTERMEDIATE CODE: R313531

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

Free format text: PAYMENT UNTIL: 20130305

Year of fee payment: 3

R350 Written notification of registration of transfer

Free format text: JAPANESE INTERMEDIATE CODE: R350

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

Free format text: PAYMENT UNTIL: 20130305

Year of fee payment: 3

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

Free format text: PAYMENT UNTIL: 20130305

Year of fee payment: 3

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

Free format text: PAYMENT UNTIL: 20140305

Year of fee payment: 4

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

EXPY Cancellation because of completion of term