JP2013162488A - Dust detector for detecting dust in image, camera, program, and recording medium - Google Patents

Dust detector for detecting dust in image, camera, program, and recording medium Download PDF

Info

Publication number
JP2013162488A
JP2013162488A JP2012025428A JP2012025428A JP2013162488A JP 2013162488 A JP2013162488 A JP 2013162488A JP 2012025428 A JP2012025428 A JP 2012025428A JP 2012025428 A JP2012025428 A JP 2012025428A JP 2013162488 A JP2013162488 A JP 2013162488A
Authority
JP
Japan
Prior art keywords
dust
detection
range
image
image data
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.)
Pending
Application number
JP2012025428A
Other languages
Japanese (ja)
Inventor
Takeshi Matsumoto
豪 松本
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
Application filed by Nikon Corp filed Critical Nikon Corp
Priority to JP2012025428A priority Critical patent/JP2013162488A/en
Publication of JP2013162488A publication Critical patent/JP2013162488A/en
Pending legal-status Critical Current

Links

Images

Landscapes

  • Facsimile Image Signal Circuits (AREA)
  • Studio Devices (AREA)

Abstract

PROBLEM TO BE SOLVED: To provide a dust detector for detecting dust in an image, and to provide a camera, a program, and a recording medium.SOLUTION: The dust detector comprises: detection means (102) which detects specific positions or ranges (18, 20, 22, 28) designated by a user, within image data (50) displayed by display means (10); range determination means (104) which determines detection ranges (24, 26, 28) on the basis of the specific positions or ranges (18, 20, 22, 28) detected by the detection means (102); and dust detection means (108) which performs dust detection by processing image data positioned within the detection ranges (24, 26, 28) determined by the range determination means (104).

Description

本発明は、画像のゴミ検出を行うゴミ検出装置、カメラ、プログラム、記録媒体に関する。   The present invention relates to a dust detection device, a camera, a program, and a recording medium that detect dust in an image.

近年、デジタルカメラ等の撮像装置にて撮像を行う際に、撮像素子や光学フィルタ等にゴミが付着していると、付着したゴミの影(ゴミ影)が撮影画像に写り込み、画像の品質の劣化を招くことが問題となっている。   In recent years, when taking an image with an imaging device such as a digital camera, if dust adheres to the image sensor or optical filter, the shadow of the attached dust (dust shadow) appears in the photographed image, and the image quality It is a problem to cause deterioration of the material.

この問題を解決するため、例えば特許文献1に示す従来技術では、基準画像を取得するための所定の背景でゴミ影が写り込んだ基準画像を予め撮像しておき、ゴミ位置の座標を算出する。そして、その基準画像のゴミ位置に対応する座標を利用して、補正対象の撮像画像のゴミ影を削除する補正を行なう。また、特許文献1には、補正対象の画像に含まれる各画素の輝度の情報に基づいてゴミ影を抽出する方法が記載されている。   In order to solve this problem, for example, in the prior art disclosed in Patent Document 1, a reference image in which a dust shadow is reflected in a predetermined background for acquiring a reference image is captured in advance, and the coordinates of the dust position are calculated. . Then, using the coordinates corresponding to the dust position of the reference image, correction is performed to delete the dust shadow of the captured image to be corrected. Patent Document 1 describes a method of extracting dust shadows based on luminance information of each pixel included in an image to be corrected.

しかし、上記の基準画像を撮影する方法においては、カメラ操作等により、ゴミの位置の座標や向きが変わったときに、高品質の画像を得ることができない。さらに、撮影者は基準画像を予め撮影しておかなければならないので、撮影者に負担が掛かる。   However, in the method for capturing the reference image, a high-quality image cannot be obtained when the position and coordinates of the dust position are changed by camera operation or the like. Furthermore, since the photographer has to take a reference image in advance, a burden is placed on the photographer.

また、輝度の情報に基づいてゴミ影を抽出する方法においては、ゴミの位置が補正対象の画像内のエッジ部分に近いと輝度勾配が重なってしまいゴミの検出が困難である。さらに、輝度の情報に基づいてゴミ影を抽出する方法において、エッジ付近のゴミ影を抽出しようとすると、他の位置での検出精度を低下させてしまう問題や、他の場所での誤検出を招くという問題が新たに発生する。   Further, in the method of extracting dust shadows based on the luminance information, if the dust position is close to the edge portion in the image to be corrected, the luminance gradients overlap and it is difficult to detect the dust. Furthermore, in the method of extracting dust shadows based on luminance information, if dust shadows near the edges are extracted, problems such as lowering detection accuracy at other positions and false detection at other locations may occur. A new problem arises.

特開2004−220553号公報JP 2004-220553 A

本発明の目的は、画像のゴミ検出を高精度に行うことができるゴミ検出装置、カメラ、プログラム、記録媒体を提供することである。   An object of the present invention is to provide a dust detection device, a camera, a program, and a recording medium that can detect dust in an image with high accuracy.

上記の目的を達成するために、本発明の画像のゴミ検出装置は、
表示手段(10)に表示される画像データ(50)の内、ユーザが指定している特定の位置または範囲(18,20,22,28)を検出する検出手段(102)と、
前記検出手段(102)により検出された特定の位置または範囲(18,20,22,28)に基づき、検出範囲(24,26,28)を決定する範囲決定手段(104)と、
前記範囲決定手段(104)により決定された検出範囲(24,26,28)内に位置する画像データを処理することでゴミ検出処理を行うゴミ検出手段(108)とを有する。
In order to achieve the above object, an image dust detection apparatus according to the present invention includes:
Detection means (102) for detecting a specific position or range (18, 20, 22, 28) designated by the user among the image data (50) displayed on the display means (10);
Range determining means (104) for determining the detection range (24, 26, 28) based on the specific position or range (18, 20, 22, 28) detected by the detection means (102);
Dust detection means (108) for performing dust detection processing by processing image data located within the detection range (24, 26, 28) determined by the range determination means (104).

本発明のゴミ検出装置は、前記検出範囲(24,26,28)内に位置する画像データに基づき、前記ゴミ検出処理のパラメータを決定するパラメータ決定手段(106)をさらに有してもよい。   The dust detection apparatus of the present invention may further include parameter determination means (106) for determining parameters of the dust detection processing based on image data located within the detection range (24, 26, 28).

前記パラメータは、前記検出範囲(24,26,28)内に位置する画像データの輝度または輝度勾配の平均化処理のパラメータであってもよい。   The parameter may be a parameter of an averaging process of luminance or luminance gradient of image data located in the detection range (24, 26, 28).

前記平均化処理の強弱パラメータは、前記検出範囲(24,26,28)内に位置する画像データの輝度の標準偏差または輝度勾配の標準偏差により決定されてもよい。   The strength parameter of the averaging process may be determined by a standard deviation of luminance or a standard deviation of luminance gradient of image data located in the detection range (24, 26, 28).

前記パラメータは、前記検出範囲内に位置する画像データの輝度勾配からゴミを検出する際の閾値であってもよい。   The parameter may be a threshold value when dust is detected from a luminance gradient of image data located within the detection range.

本発明のゴミ検出装置は、ゴミ検出手段(108)で検出されたゴミに対応する画像データを補正する補正手段(110)をさらに有してもよい。   The dust detection apparatus of the present invention may further include a correction unit (110) that corrects image data corresponding to the dust detected by the dust detection unit (108).

本発明のゴミ検出装置は、範囲決定手段(104)により決定された検出範囲(24,26,28)を、画像データ(50)と共に表示手段に表示させる範囲表示手段(112)をさらに有してもよい。   The dust detection apparatus of the present invention further includes range display means (112) for displaying the detection ranges (24, 26, 28) determined by the range determination means (104) on the display means together with the image data (50). May be.

本発明のカメラは、上記のゴミ検出装置を有してもよい。   The camera of the present invention may have the above dust detection device.

本発明のコンピュータに実行させるためのプログラムは、
表示手段に表示される画像データの内、ユーザが指定している特定の位置または範囲を検出する検出工程と、
前記検出工程により検出された特定の位置または範囲に基づき、検出範囲を決定する範囲決定工程と、
前記範囲決定工程により決定された検出範囲内に位置する画像データを処理することでゴミ検出処理を行うゴミ検出工程とを有する。
A program for causing a computer of the present invention to execute is as follows:
A detection step of detecting a specific position or range designated by the user among the image data displayed on the display means;
A range determination step for determining a detection range based on the specific position or range detected by the detection step;
A dust detection step of performing dust detection processing by processing image data located within the detection range determined by the range determination step.

本発明の記憶媒体には、上記のプログラムが記録してある。   The above program is recorded in the storage medium of the present invention.

なお、上述の説明では、本発明をわかりやすく説明するために、実施形態を示す図面の符号に対応付けて説明したが、本発明は、これに限定されるものでない。後述の実施形態の構成を適宜改良してもよく、また、少なくとも一部を他の構成に代替させてもよい。更に、その配置について特に限定のない構成要件は、実施形態で開示した配置に限らず、その機能を達成できる位置に配置することができる。   In the above description, in order to explain the present invention in an easy-to-understand manner, the description has been made in association with the reference numerals of the drawings illustrating the embodiments, but the present invention is not limited to this. The configuration of the embodiment described later may be improved as appropriate, or at least a part of the configuration may be replaced with another configuration. Further, the configuration requirements that are not particularly limited with respect to the arrangement are not limited to the arrangement disclosed in the embodiment, and can be arranged at a position where the function can be achieved.

図1は、本発明の一実施形態に係るカメラの概略図である。FIG. 1 is a schematic view of a camera according to an embodiment of the present invention. 図2は、図1に示すカメラの制御装置に係るブロック図である。FIG. 2 is a block diagram according to the control device of the camera shown in FIG. 図3は、図1および図2に示す制御装置の動作の一例を示すフローチャートである。FIG. 3 is a flowchart showing an example of the operation of the control device shown in FIGS. 1 and 2. 図4は、図1に示すカメラの液晶タッチパネルに表示される画像の一例である。FIG. 4 is an example of an image displayed on the liquid crystal touch panel of the camera shown in FIG. 図5(A)〜図5(D)は、図4の画像の一部に画像処理を施した画像である。5A to 5D are images obtained by performing image processing on part of the image of FIG. 図6は、本発明の一実施形態に係るPCの概略図である。FIG. 6 is a schematic diagram of a PC according to an embodiment of the present invention.

第1実施形態
図1に示すカメラ200は、レンズ群252等が備えられるレンズ鏡筒部250と、撮像素子216等が備えられるカメラ本体部210とを含む。以下では、レンズ鏡筒部250がカメラ本体部210に着脱自在に取り付けられるレンズ交換式カメラを例に説明するが、本実施形態はこれに限定されない。例えば、レンズ鏡筒部250とカメラ本体部210が一体であるコンパクトカメラやカメラ付きモバイル機器であっても良い。
First Embodiment A camera 200 shown in FIG. 1 includes a lens barrel portion 250 provided with a lens group 252 and the like, and a camera body portion 210 provided with an image sensor 216 and the like. In the following, a lens interchangeable camera in which the lens barrel 250 is detachably attached to the camera body 210 will be described as an example, but the present embodiment is not limited to this. For example, a compact camera in which the lens barrel portion 250 and the camera body portion 210 are integrated or a mobile device with a camera may be used.

図1に示すカメラ本体部210には、タッチパネル液晶8,シャッター212,光学フィルタ214,撮像素子216,ボディCPU218,メモリ220等が備えられる。   A camera body 210 shown in FIG. 1 includes a touch panel liquid crystal 8, a shutter 212, an optical filter 214, an image sensor 216, a body CPU 218, a memory 220, and the like.

カメラ本体部210に内蔵してあるボディCPU218は、レンズ接点260を介して、レンズCPU258に接続してある。レンズ接点260は、カメラ本体部210に対してレンズ鏡筒部250を連結することで、ボディCPU218と、レンズCPU258とを電気的に接続するようになっている。ボディCPU218には、電源245が接続してある。電源245は、カメラ本体部210に内蔵してある。   A body CPU 218 built in the camera body 210 is connected to the lens CPU 258 via a lens contact 260. The lens contact 260 electrically connects the body CPU 218 and the lens CPU 258 by connecting the lens barrel 250 to the camera body 210. A power source 245 is connected to the body CPU 218. The power source 245 is built in the camera body 210.

ボディCPU218には、タッチパネル液晶8、レリーズスイッチ231、ストロボ232、ジャイロセンサ233、メモリ220、防振スイッチ234、防塵フィルタ駆動回路240、画像処理コントローラ236、AFセンサ244、防振追随制御IC235などが接続してある。   The body CPU 218 includes a touch panel liquid crystal 8, a release switch 231, a strobe 232, a gyro sensor 233, a memory 220, an anti-vibration switch 234, an anti-dust filter driving circuit 240, an image processing controller 236, an AF sensor 244, an anti-vibration follow-up control IC 235, and the like. Connected.

ボディCPU218は、カメラ200全体の制御を行う。たとえば、ボディCPU218は、ユーザによるレリーズスイッチ231からの全押し信号を受けて、ミラー239,シャッター212および撮像素子216等を制御し、カメラ200の撮影動作を制御する。また、ボディCPU218は、後述のように、タッチパネル液晶8のタッチパネル部9と共に図2に示すゴミ検出装置100を構成し、画像のゴミ検出を行う。   The body CPU 218 controls the entire camera 200. For example, the body CPU 218 receives a full-press signal from the release switch 231 by the user, controls the mirror 239, the shutter 212, the image sensor 216, and the like, and controls the shooting operation of the camera 200. As will be described later, the body CPU 218 constitutes the dust detection device 100 shown in FIG. 2 together with the touch panel unit 9 of the touch panel liquid crystal 8 to detect dust in the image.

タッチパネル液晶8は、入力部として機能するタッチパネル部9と表示部として機能する液晶ディスプレイ部10とを有する。タッチパネル部9は、ユーザによる操作を検出して、ユーザの操作に対応する信号をボディCPU218に出力する。たとえば、ユーザは、タッチパネル部9にタップ操作を行ってタッチパネル部9上の位置座標を入力したり、ドラッグ操作を行ってタッチパネル部9に表示された画像の中心位置を移動させたり、ピンチ操作を行ってタッチパネル部9に表示された画像を拡大/縮小させることができる。また、液晶ディスプレイ部10は、撮像素子216で撮像した画像やメモリ220に記憶された画像を表示する。   The touch panel liquid crystal 8 includes a touch panel unit 9 that functions as an input unit and a liquid crystal display unit 10 that functions as a display unit. The touch panel unit 9 detects a user operation and outputs a signal corresponding to the user operation to the body CPU 218. For example, the user performs a tap operation on the touch panel unit 9 to input position coordinates on the touch panel unit 9, performs a drag operation to move the center position of the image displayed on the touch panel unit 9, or performs a pinch operation. The image displayed on the touch panel unit 9 can be enlarged / reduced. In addition, the liquid crystal display unit 10 displays an image captured by the image sensor 216 and an image stored in the memory 220.

レリーズスイッチ231は、シャッター駆動のタイミングを操作するスイッチであり、ボディCPU218にスイッチの状態を出力する。たとえば、レリーズスイッチ231が半押し時には、AF、AE、防振駆動等が行われる。また、レリーズスイッチ231が全押し時には、ミラーアップ、シャッター駆動等が行われる。   The release switch 231 is a switch for operating the shutter drive timing, and outputs the switch state to the body CPU 218. For example, when the release switch 231 is half-pressed, AF, AE, anti-vibration driving, and the like are performed. When the release switch 231 is fully pressed, mirror up, shutter drive, and the like are performed.

ジャイロセンサ233は、ボディに生じるブレの角速度を検出し、不図示のアンプを介して、その出力をボディCPU218に出力する。ボディCPU218は、ジャイロセンサ233の角速度を積分することによって、振れ角度を求める。   The gyro sensor 233 detects the angular velocity of the blur generated in the body and outputs the output to the body CPU 218 via an amplifier (not shown). The body CPU 218 obtains the deflection angle by integrating the angular velocity of the gyro sensor 233.

メモリ220は、ハードディスクやフラッシュメモリ等で構成され、画像データや音声データ、カメラ200の設定、ジャイロセンサ233の調整値等のデータを記憶する。   The memory 220 is configured by a hard disk, a flash memory, or the like, and stores data such as image data and audio data, settings of the camera 200, adjustment values of the gyro sensor 233, and the like.

防振スイッチ234は、防振ON、OFFの状態を撮像素子ユニットCPUに出力する。AFセンサ244は、オートフォーカス(AF)を行うためのセンサである。このAFセンサとしては、通常CCDが用いられる。   The image stabilization switch 234 outputs the image stabilization ON / OFF state to the image sensor unit CPU. The AF sensor 244 is a sensor for performing autofocus (AF). As this AF sensor, a CCD is usually used.

画像処理コントローラ236には、インターフェース回路237を介して、撮像素子216が接続してあり、撮像素子216にて撮像された画像の画像処理を制御可能になっている。   An image sensor 216 is connected to the image processing controller 236 via an interface circuit 237 so that image processing of an image captured by the image sensor 216 can be controlled.

防塵フィルタ駆動回路240は、光学フィルタ214に取り付けられた不図示の圧電素子に接続してあり、所定条件を満足する場合に、圧電素子を駆動し、光学フィルタ214を振動させ、光学フィルタ214の表面に付着している塵埃などを除去する動作を行う。光学フィルタ214が振動して、塵埃がガラス面から受ける慣性力が塵埃の付着力を上回ると、塵埃がガラス面から離れる。   The dustproof filter driving circuit 240 is connected to a piezoelectric element (not shown) attached to the optical filter 214. When a predetermined condition is satisfied, the dustproof filter driving circuit 240 drives the piezoelectric element to vibrate the optical filter 214. An operation for removing dust adhering to the surface is performed. When the optical filter 214 vibrates and the inertial force that the dust receives from the glass surface exceeds the adhesion force of the dust, the dust is separated from the glass surface.

撮像素子ユニット241は、撮像素子216を備えており、光軸Z方向に対して垂直なX軸およびY軸方向に沿って、カメラ本体部210に対して相対移動自在である。X軸とY軸とは垂直である。コイル247xと永久磁石246xは、X軸方向移動手段としてのボイスコイルモータ(VCM)を構成しており、コイル247yと永久磁石246yは、Y軸方向移動手段としてのボイスコイルモータを構成している。コイル247xおよび247yへの電流制御により、撮像素子ユニット241がX軸方向およびY軸方向に移動制御されるようになっている。なお、X軸方向およびY軸方向の移動手段としては、VCMに限定されず、その他のアクチュエータを用いることができる。   The image sensor unit 241 includes an image sensor 216, and is relatively movable with respect to the camera body 210 along the X-axis and Y-axis directions perpendicular to the optical axis Z direction. The X axis and the Y axis are perpendicular. The coil 247x and the permanent magnet 246x constitute a voice coil motor (VCM) as X-axis direction moving means, and the coil 247y and the permanent magnet 246y constitute a voice coil motor as Y-axis direction moving means. . The image sensor unit 241 is controlled to move in the X-axis direction and the Y-axis direction by controlling the current to the coils 247x and 247y. The moving means in the X-axis direction and the Y-axis direction is not limited to the VCM, and other actuators can be used.

防振追従制御IC235は、防振制御を行うためのICである。ボディCPU218からの撮像素子ユニット241の目標位置に関する情報と、位置検出部238からの撮像素子ユニット241の位置情報から、撮像素子ユニット241の移動量を算出し、防振駆動ドライバ235へ出力する。   The image stabilization tracking control IC 235 is an IC for performing image stabilization control. The amount of movement of the image sensor unit 241 is calculated from the information regarding the target position of the image sensor unit 241 from the body CPU 218 and the position information of the image sensor unit 241 from the position detector 238, and is output to the image stabilization drive driver 235.

防振駆動ドライバ243は、防振駆動部を制御するためのドライバであり、防振追従制御IC235から駆動量の入力を受けて、防振駆動部の駆動方向、駆動量を制御する。すなわち、防振駆動ドライバ243は、防振追従制御IC235からの入力情報に基づき、コイル247x,247yに駆動電流を流し、撮像素子ユニット241を、カメラ本体部210に対してX軸方向およびY軸方向に相対移動させ、像ブレ補正制御を行う。   The image stabilization drive driver 243 is a driver for controlling the image stabilization drive unit, and receives the drive amount from the image stabilization tracking control IC 235 to control the drive direction and drive amount of the image stabilization drive unit. That is, the image stabilization drive driver 243 sends a drive current to the coils 247x and 247y based on the input information from the image stabilization tracking control IC 235, and causes the image sensor unit 241 to move in the X axis direction and the Y axis with respect to the camera body 210. Image blur correction control is performed by relatively moving in the direction.

カメラ本体部210の内部において、撮像素子216の光軸方向(Z軸方向)の前方には、シャッター212が配置してある。シャッター212のZ軸方向の前方には、ミラー239が配置してあり、そのZ軸方向の前方には、レンズ鏡筒部250に内蔵してある絞り部254およびレンズ群252が配置してある。   Inside the camera body 210, a shutter 212 is disposed in front of the image sensor 216 in the optical axis direction (Z-axis direction). A mirror 239 is arranged in front of the shutter 212 in the Z-axis direction, and a diaphragm unit 254 and a lens group 252 built in the lens barrel unit 250 are arranged in front of the Z-axis direction. .

ミラー239は、構図決定の際にファインダーに像を映し出すためのもので、露光中は光路から退避する。ボディCPU218からレリーズスイッチ231の情報が入力され、全押し時にミラーアップ、露光終了後にミラーダウンを行う。ミラー239は、不図示のミラー駆動部(例えばDCモータ)により駆動される。ミラー239には、サブミラー239aが連結してある。   The mirror 239 is for projecting an image on the viewfinder when determining the composition, and retracts from the optical path during exposure. Information on the release switch 231 is input from the body CPU 218, and the mirror is raised when fully pressed, and the mirror is lowered after the exposure is completed. The mirror 239 is driven by a mirror driving unit (not shown) (for example, a DC motor). A sub mirror 239 a is connected to the mirror 239.

サブミラー239aは、AFセンサに光を送るためのミラーであり、ミラーを通過した光束を反射してAFセンサに導く。このサブミラー239aは、露光中は光路から退避する。   The sub mirror 239a is a mirror for sending light to the AF sensor, reflects the light beam that has passed through the mirror, and guides it to the AF sensor. The sub mirror 239a is retracted from the optical path during exposure.

シャッター212は、ボディCPU218により制御され、レンズ鏡筒部250から撮像素子216へ向かう撮影光を遮蔽および通過させることによって、露光時間を調整する。図1では、シャッター212は、メカニカルシャッターであるが、本実施形態では、メカニカルシャッター212を含まなくても良い。メカニカルシャッター212を含まない場合は、撮像素子216を電子シャッターとして機能させても良い。   The shutter 212 is controlled by the body CPU 218, and adjusts the exposure time by blocking and passing photographing light from the lens barrel 250 to the image sensor 216. In FIG. 1, the shutter 212 is a mechanical shutter, but in the present embodiment, the mechanical shutter 212 may not be included. When the mechanical shutter 212 is not included, the image sensor 216 may function as an electronic shutter.

光学フィルタ214は、撮像に際して偽色(色モアレ)等の発生を防止する光学ローパスフィルタ等によって構成される。   The optical filter 214 is configured by an optical low-pass filter or the like that prevents generation of false colors (color moire) or the like during imaging.

撮像素子216は、CCDやCMOS等で構成される。撮像素子216は、ボディCPU218により制御され、撮像素子216に導かれた光を光電変換することによって、画像データを取得する。   The image sensor 216 is configured by a CCD, a CMOS, or the like. The image sensor 216 is controlled by the body CPU 218 and acquires image data by photoelectrically converting light guided to the image sensor 216.

レンズ鏡筒部250には、焦点距離エンコーダ256、距離エンコーダ262、絞り部254、絞り部254を制御する駆動モータ264、レンズCPU258、カメラ本体部210とのレンズ接点260、及び、複数のレンズ群252が具備してある。レンズ接点260には、カメラ本体部210からレンズ駆動系電源を供給するための接点と、レンズCPU258を駆動するためのCPU電源の接点とデジタル通信用の接点がある。   The lens barrel 250 includes a focal length encoder 256, a distance encoder 262, a diaphragm 254, a drive motor 264 that controls the diaphragm 254, a lens CPU 258, a lens contact 260 with the camera body 210, and a plurality of lens groups. 252 is provided. The lens contact 260 includes a contact for supplying lens driving system power from the camera body 210, a contact for a CPU power source for driving the lens CPU 258, and a contact for digital communication.

駆動系電源およびCPU電源はカメラ本体部210の電源245から供給され、レンズCPU258や駆動系の電源を供給している。デジタル通信用接点では、レンズCPU258から出力された焦点距離、被写体距離、フォーカス位置情報等のデジタル情報をボディCPU218に入力するための通信と、ボディCPU218から出力されたフォーカス位置や絞り量等のデジタル情報をレンズCPU258に入力するための通信を行う。ボディCPU218からのフォーカス位置情報や絞り量情報を受けて、レンズCPU258が、AF、絞り制御等を行う。   Drive system power and CPU power are supplied from a power source 245 of the camera body 210, and supply power for the lens CPU 258 and the drive system. In the digital communication contact, communication for inputting digital information such as focal length, subject distance, and focus position information output from the lens CPU 258 to the body CPU 218 and digital information such as a focus position and an aperture amount output from the body CPU 218 are provided. Communication for inputting information to the lens CPU 258 is performed. In response to the focus position information and aperture amount information from the body CPU 218, the lens CPU 258 performs AF, aperture control, and the like.

焦点距離エンコーダ256は、ズームレンズ群の位置情報より焦点距離を換算する。すなわち、焦点距離エンコーダ256は、焦点距離をエンコードし、レンズCPU258に出力する。   The focal length encoder 256 converts the focal length from the position information of the zoom lens group. That is, the focal length encoder 256 encodes the focal length and outputs it to the lens CPU 258.

距離エンコーダ262は、フォーカシングレンズ群の位置情報より被写体距離を換算する。すなわち、距離エンコーダ262は、被写体距離をエンコードし、レンズCPU258に出力する。   The distance encoder 262 converts the subject distance from the position information of the focusing lens group. That is, the distance encoder 262 encodes the subject distance and outputs it to the lens CPU 258.

レンズCPU258は、カメラ本体部210との通信機能、レンズ群252の制御機能を有している。レンズCPU258には、焦点距離、被写体距離等が入力され、レンズ接点を介してボディCPU218に出力する。ボディCPU218からレンズ接点260を介して、レリーズ情報、AF情報が入力される。   The lens CPU 258 has a communication function with the camera body 210 and a control function of the lens group 252. The lens CPU 258 receives a focal length, a subject distance, and the like, and outputs them to the body CPU 218 via a lens contact. Release information and AF information are input from the body CPU 218 via the lens contact 260.

図2に示すように、図1に示すボディCPU218は、位置検出部102と検出範囲決定部104とパラメータ決定部106とゴミ検出部108と画像補正部110と範囲表示部112とを有する。   As illustrated in FIG. 2, the body CPU 218 illustrated in FIG. 1 includes a position detection unit 102, a detection range determination unit 104, a parameter determination unit 106, a dust detection unit 108, an image correction unit 110, and a range display unit 112.

位置検出部102は、位置座標を検出し、検出範囲決定部104に出力する。検出範囲決定部104は、位置検出部102からの位置座標を基に検出範囲を決定し、検出範囲に関する情報をパラメータ決定部106に出力する。パラメータ決定部106は、検出範囲決定部104からの検出範囲に関する情報を基にパラメータを決定し、ゴミ検出部108に出力する。ゴミ検出部108は、パラメータ決定部106からのパラメータを基にゴミを検出し、ゴミに関する情報を画像補正部110に出力する。画像補正部110は、ゴミ検出部108からのゴミに関する情報を基に画像を補正する。範囲表示部112は、検出範囲決定部104からの検出範囲に関する情報をタッチパネル液晶8に表示させる。ゴミ検出装置100は、タッチパネル部9と位置検出部102と検出範囲決定部104とパラメータ決定部106とゴミ検出部108と画像補正部110と範囲表示部112とを有して構成され、画像のゴミ検出を行う。   The position detection unit 102 detects position coordinates and outputs them to the detection range determination unit 104. The detection range determination unit 104 determines a detection range based on the position coordinates from the position detection unit 102 and outputs information related to the detection range to the parameter determination unit 106. The parameter determination unit 106 determines a parameter based on the information regarding the detection range from the detection range determination unit 104 and outputs the parameter to the dust detection unit 108. The dust detection unit 108 detects dust based on the parameters from the parameter determination unit 106 and outputs information about the dust to the image correction unit 110. The image correction unit 110 corrects the image based on the information about dust from the dust detection unit 108. The range display unit 112 displays information on the detection range from the detection range determination unit 104 on the touch panel liquid crystal 8. The dust detection apparatus 100 includes a touch panel unit 9, a position detection unit 102, a detection range determination unit 104, a parameter determination unit 106, a dust detection unit 108, an image correction unit 110, and a range display unit 112. Perform dust detection.

次に図3に示すフローチャートを用いて、図2に示すゴミ検出装置100の動作を説明する。ステップS102にて、図1に示すカメラ200にて取得した画像データ50を液晶ディスプレイ部10に表示させる。液晶ディスプレイ部10での表示画像の一例を図4に示す。   Next, the operation of the dust detection apparatus 100 shown in FIG. 2 will be described using the flowchart shown in FIG. In step S102, the image data 50 acquired by the camera 200 shown in FIG. An example of a display image on the liquid crystal display unit 10 is shown in FIG.

図1に示すカメラ200では、上記のように、光学フィルタ214を振動させ、光学フィルタ214に付着した埃等のゴミを除去しているが、ゴミを完全に除去できない場合がある。たとえば、図1に示すカメラ200では、撮影光の光路上にあって撮影光を透過する光学フィルタ214に、異物230が付着している。このため、カメラ200にて撮影を行った場合、撮像素子216によって取得される画像データは、異物230の影響を受ける。すなわち、図1に示すカメラ200において、異物230の影響を受けた箇所は、図4に示す画像50において、ゴミ影12,14,16として現れ、画像の品質を低下させる。そこで、ユーザは、図2に示すゴミ検出装置100を利用して、図4に示す画像50のゴミ影12,14,16を検出する。本実施形態では、ゴミ影12を検出する。   In the camera 200 shown in FIG. 1, as described above, the optical filter 214 is vibrated to remove dust such as dust adhering to the optical filter 214, but the dust may not be completely removed. For example, in the camera 200 shown in FIG. 1, the foreign material 230 is attached to the optical filter 214 that is on the optical path of the imaging light and transmits the imaging light. For this reason, when photographing is performed with the camera 200, the image data acquired by the imaging element 216 is affected by the foreign matter 230. That is, in the camera 200 shown in FIG. 1, the part affected by the foreign matter 230 appears as dust shadows 12, 14, and 16 in the image 50 shown in FIG. Therefore, the user detects dust shadows 12, 14, and 16 of the image 50 shown in FIG. 4 using the dust detection device 100 shown in FIG. In the present embodiment, the dust shadow 12 is detected.

ステップS104にて、ユーザは、図1に示すタッチパネル液晶8を操作して、図4に示すゴミ影12の概略位置を入力する。たとえば、ユーザは、図1に示すタッチパネル液晶8を操作して、図4に示すカーソル18を移動させ、カーソル18をゴミ影12の概略位置に合わせてタッチパネル液晶8をタップ操作する。図1に示すタッチパネル液晶8のタッチパネル部9は、図4に示すカーソル18の位置およびユーザによるタップ操作を検出して、カーソル18の位置に関する情報を図2に示す位置検出部102に出力する。位置検出部102は、図1に示すタッチパネル部9からの図4に示すカーソル18の位置に関する情報を利用して、ゴミ影12の概略位置座標を検出し、図2に示す検出範囲決定部104に出力する。   In step S104, the user operates the touch panel liquid crystal 8 shown in FIG. 1 to input the approximate position of the dust shadow 12 shown in FIG. For example, the user operates the touch panel liquid crystal 8 shown in FIG. 1 to move the cursor 18 shown in FIG. 4, aligns the cursor 18 with the approximate position of the dust shadow 12, and taps the touch panel liquid crystal 8. The touch panel unit 9 of the touch panel liquid crystal 8 shown in FIG. 1 detects the position of the cursor 18 shown in FIG. 4 and the tap operation by the user, and outputs information related to the position of the cursor 18 to the position detection unit 102 shown in FIG. The position detection unit 102 detects the approximate position coordinates of the dust shadow 12 using information on the position of the cursor 18 shown in FIG. 4 from the touch panel unit 9 shown in FIG. 1, and detects the range detection unit 104 shown in FIG. Output to.

ステップS106にて、図2に示す検出範囲決定部104は、位置検出部102で検出された図4に示すゴミ影12の概略位置座標を利用して、ゴミ検出範囲24を決定する。図2に示す検出範囲決定部104は、図4に示すゴミ影12の概略位置座標を中心にして、想定するゴミの大きさよりも大きい範囲をゴミ検出範囲24として決定する。たとえば、図2に示す検出範囲決定部104は、図4に示すゴミ影12の概略位置座標を中心にして、想定するゴミの大きさの1.5倍〜5倍の四角形の範囲をゴミ検出範囲24として決定する。検出範囲決定部104が決定するゴミ検出範囲の大きさおよび形状は、これに限定されず、たとえば、想定するゴミの大きさの数倍の直径を有する円であっても良い。ゴミ検出範囲に関する設定は、ユーザにより予め設定されており、図2に示すメモリ220に記憶されている。検出範囲決定部104は、ゴミ検出範囲24の位置座標、大きさ等の情報を対応する画像に関連させて(あるいは関連させずに)メモリ220またはその他のメモリに記憶させる。   In step S106, the detection range determination unit 104 illustrated in FIG. 2 determines the dust detection range 24 using the approximate position coordinates of the dust shadow 12 illustrated in FIG. 4 detected by the position detection unit 102. The detection range determination unit 104 illustrated in FIG. 2 determines a range larger than the assumed dust size as the dust detection range 24 around the approximate position coordinates of the dust shadow 12 illustrated in FIG. For example, the detection range determination unit 104 shown in FIG. 2 detects a square range 1.5 to 5 times the assumed dust size around the approximate position coordinates of the dust shadow 12 shown in FIG. The range 24 is determined. The size and shape of the dust detection range determined by the detection range determination unit 104 are not limited to this, and may be, for example, a circle having a diameter several times the size of the assumed dust. Settings relating to the dust detection range are preset by the user and stored in the memory 220 shown in FIG. The detection range determination unit 104 stores information such as the position coordinates and size of the dust detection range 24 in the memory 220 or other memory in association with (or not in association with) the corresponding image.

ステップS108にて、図2に示すゴミ検出部108は、検出範囲決定部104で決定された図4に示すゴミ検出範囲24の画像データに基づき、図5(a)に示す輝度平面を算出する。図5(a)に示す輝度平面では、白いところほど輝度が大きく、黒いところほど輝度が小さい。   In step S108, the dust detection unit 108 illustrated in FIG. 2 calculates the luminance plane illustrated in FIG. 5A based on the image data of the dust detection range 24 illustrated in FIG. 4 determined by the detection range determination unit 104. . In the luminance plane shown in FIG. 5A, the luminance is higher as it is whiter, and the luminance is lower as it is blacker.

ステップS110およびステップS112にて、図2に示すパラメータ決定部106とゴミ検出部108とは、図5(a)に示す輝度平面の平均化処理(n×nフィルタ等(nは3などの整数))を行う。図5(a)に示す輝度平面からノイズ成分を取り除いて、好適にゴミ検出範囲24のゴミ検出を行うためである。   In step S110 and step S112, the parameter determination unit 106 and the dust detection unit 108 illustrated in FIG. 2 perform luminance plane averaging processing (n × n filter or the like (n is an integer such as 3) illustrated in FIG. ))I do. This is because dust components in the dust detection range 24 are preferably detected by removing noise components from the luminance plane shown in FIG.

ステップS110にて、図2に示すパラメータ決定部106は、図5(a)に示す輝度平面から輝度の標準偏差を算出する。図5(a)に示す輝度平面では、輝度の標準偏差が小さい。なぜなら、図5(a)に示す輝度平面は、図4に示すゴミ検出範囲24に基づく輝度平面であり、ゴミ検出範囲24では、ゴミ影12以外の部分で輝度のバラツキが小さい。   In step S110, the parameter determination unit 106 shown in FIG. 2 calculates the luminance standard deviation from the luminance plane shown in FIG. In the luminance plane shown in FIG. 5A, the standard deviation of luminance is small. This is because the luminance plane shown in FIG. 5A is a luminance plane based on the dust detection range 24 shown in FIG. 4, and in the dust detection range 24, the luminance variation is small except for the dust shadow 12.

図2に示すパラメータ決定部106は、図5(a)に示す輝度平面において輝度の標準偏差が小さいので、輝度平面の平均化を所定値B1より弱くするように平均化パラメータを決定する。輝度平面の平均化を必要以上に強くすると、ゴミ影の形状までもがぼやけてしまいゴミを好適に検出することができないからである。なお、所定値B1は、輝度平面の平均化の度合いを示す所定の基準値であり、平均化処理によりゴミ影の形状がぼやけないように決定される。   The parameter determination unit 106 shown in FIG. 2 determines the averaging parameter so that the averaging of the luminance plane is weaker than the predetermined value B1 because the luminance standard deviation is small in the luminance plane shown in FIG. This is because if the averaging of the luminance plane is strengthened more than necessary, the shape of the dust shadow becomes blurred and dust cannot be detected suitably. The predetermined value B1 is a predetermined reference value indicating the degree of averaging of the luminance plane, and is determined so that the shape of the dust shadow is not blurred by the averaging process.

図3に示すステップS112にて、図2に示すゴミ検出部108は、パラメータ決定部106が決定した輝度平面の平均化パラメータを利用して、図5(a)に示す輝度平面の平均化処理を行う。   In step S112 shown in FIG. 3, the dust detection unit 108 shown in FIG. 2 uses the luminance plane averaging parameter determined by the parameter determination unit 106 to perform the luminance plane averaging process shown in FIG. I do.

ステップS114にて、図2に示すゴミ検出部108は、ステップS108〜S112で取得された図5(a)に示す輝度平面に基づき、図5(b)に示す輝度勾配平面を算出する。図5(b)に示す輝度勾配平面において、白いところほど輝度勾配が大きく、黒いところほど輝度勾配が小さい。   In step S114, the dust detection unit 108 illustrated in FIG. 2 calculates a luminance gradient plane illustrated in FIG. 5B based on the luminance plane illustrated in FIG. 5A acquired in steps S108 to S112. In the luminance gradient plane shown in FIG. 5B, the white portion has a larger luminance gradient and the black portion has a smaller luminance gradient.

ステップS116およびステップS118にて、図2に示すパラメータ決定部106とゴミ検出部108とは、図5(b)に示す輝度勾配平面の平均化処理(n×nフィルタ等(nは3などの整数))を行う。図5(b)に示す輝度勾配平面からノイズ成分を取り除いて、ゴミ検出範囲24で好適にゴミ検出を行うためである。   In step S116 and step S118, the parameter determination unit 106 and the dust detection unit 108 shown in FIG. 2 perform the luminance gradient plane averaging process (n × n filter or the like (n is 3 or the like) shown in FIG. 5B). Integer)). This is because noise components are preferably removed from the dust detection range 24 by removing noise components from the luminance gradient plane shown in FIG.

ステップS116にて、図2に示すパラメータ決定部106は、図5(b)に示す輝度勾配平面から輝度勾配の標準偏差を算出する。図5(b)に示す輝度勾配平面では、輝度勾配の標準偏差が小さい。なぜなら、図5(b)に示す輝度勾配平面は、図4に示すゴミ検出範囲24に基づく輝度勾配平面であり、ゴミ検出範囲24では、ゴミ影12以外の部分で輝度のバラツキが小さい。   In step S116, the parameter determination unit 106 shown in FIG. 2 calculates the standard deviation of the luminance gradient from the luminance gradient plane shown in FIG. In the luminance gradient plane shown in FIG. 5B, the standard deviation of the luminance gradient is small. This is because the luminance gradient plane shown in FIG. 5B is a luminance gradient plane based on the dust detection range 24 shown in FIG. 4, and in the dust detection range 24, the luminance variation is small in portions other than the dust shadow 12.

図2に示すパラメータ決定部106は、図5(b)に示す輝度勾配平面において輝度勾配の標準偏差が小さいので、輝度勾配平面の平均化処理を所定値Bd1より弱くするように平均化パラメータを決定する。輝度勾配平面の平均化を必要以上に強くすると、ゴミ影の形状までもがぼやけてしまいゴミを好適に検出することができないからである。なお、所定値Bd1は、輝度勾配平面の平均化の度合いを示す所定の基準値であり、平均化処理によりゴミ影の形状がぼやけないように決定される。   2 has a small standard deviation of the luminance gradient in the luminance gradient plane shown in FIG. 5B, the parameter determination unit 106 sets the averaging parameter so that the averaging process of the luminance gradient plane is weaker than the predetermined value Bd1. decide. This is because if the averaging of the luminance gradient plane is strengthened more than necessary, even the shape of the dust shadow becomes blurred and dust cannot be detected suitably. The predetermined value Bd1 is a predetermined reference value indicating the degree of averaging of the luminance gradient plane, and is determined so that the shape of the dust shadow is not blurred by the averaging process.

図3に示すステップS118にて、図2に示すゴミ検出部108は、パラメータ決定部106が決定した輝度勾配の平均化パラメータを利用して、図5(b)に示す輝度勾配平面の平均化処理を行う。   In step S118 shown in FIG. 3, the dust detection unit 108 shown in FIG. 2 uses the luminance gradient averaging parameter determined by the parameter determination unit 106 to average the luminance gradient plane shown in FIG. Process.

ステップS120にて、図2に示すパラメータ決定部106は、図5(a)に示す輝度平面および図5(b)に示す輝度勾配平面等を解析して、図4に示すゴミ検出範囲24にエッジがあるか否かを判断し、輝度勾配の2値化パラメータを決定する。パラメータ決定部106は、ゴミ検出範囲24にエッジがあるので、輝度勾配の2値化の閾値を所定値T1より大きくするようにパラメータを決定する。ゴミ影とエッジとの分離を好適に行うためである。なお、所定値T1は、輝度勾配の二値化の閾値を示す所定の基準値であり、ゴミ影とエッジとの分離が良好となるように決定される。   In step S120, the parameter determination unit 106 shown in FIG. 2 analyzes the luminance plane shown in FIG. 5A, the luminance gradient plane shown in FIG. 5B, and the like, and enters the dust detection range 24 shown in FIG. It is determined whether or not there is an edge, and a binarization parameter for the luminance gradient is determined. Since there is an edge in the dust detection range 24, the parameter determination unit 106 determines a parameter so that the threshold value for luminance gradient binarization is larger than the predetermined value T1. This is because the dust shadow and the edge are preferably separated. The predetermined value T1 is a predetermined reference value indicating a threshold value for binarization of the luminance gradient, and is determined so that separation between dust shadows and edges is good.

ここで、パラメータ決定部106は、輝度勾配の2値化のパラメータを決定する際に、図5(c)に示すゴミ判別画像でのゴミ影の形状を評価しながら、輝度勾配の2値化のパラメータを決定しても良い。たとえば、2値化後のゴミ影の形状を円類似度により評価し、円類似度が低い場合には、円類似度が設定値より高くなるように、2値化時の閾値を上げる。ゴミ影の形状が円形であるときに、このようにして輝度勾配の2値化のパラメータを決定することにより、好適にゴミ影を検出することができる。   Here, the parameter determination unit 106 binarizes the luminance gradient while evaluating the dust shadow shape in the dust discrimination image shown in FIG. 5C when determining the binarization parameter of the luminance gradient. The parameters may be determined. For example, the binarized dust shadow shape is evaluated based on the circular similarity, and when the circular similarity is low, the threshold for binarization is increased so that the circular similarity is higher than the set value. When the shape of the dust shadow is circular, the dust shadow can be suitably detected by determining the binarization parameter of the luminance gradient in this way.

ステップS122にて、図2に示すゴミ検出部108は、パラメータ決定部106が決定した輝度勾配の2値化のパラメータを利用して、図5(b)に示す輝度勾配平面を2値化して、図5(c)に示すゴミ検出画像を得る。   In step S122, the dust detection unit 108 illustrated in FIG. 2 binarizes the luminance gradient plane illustrated in FIG. 5B using the luminance gradient binarization parameters determined by the parameter determination unit 106. The dust detection image shown in FIG. 5C is obtained.

ステップS124にて、図2に示すゴミ検出部108は、図5(c)に示すゴミ検出画像に基づき、ゴミ影12の位置座標、大きさ等の情報を算出し、メモリ220に記憶させる。   In step S124, the dust detection unit 108 shown in FIG. 2 calculates information such as the position coordinates and size of the dust shadow 12 based on the dust detection image shown in FIG.

本実施形態では、上記のように、ユーザにより指定された検出範囲内に位置する画像データを処理してゴミ検出を行うので、その指定された範囲内で、好適に画像処理(輝度/輝度勾配の平均化および輝度勾配の2値化)を行い、ゴミを好適に検出することができる。   In the present embodiment, as described above, dust detection is performed by processing the image data located within the detection range designated by the user. Therefore, image processing (luminance / luminance gradient) is preferably performed within the designated range. , And binarization of the brightness gradient), dust can be detected suitably.

なお、従来の方法(画像全体における輝度の情報に基づいてゴミ影を抽出する方法)では、ゴミ影がエッジの近辺にあるときに、図4(d)に示すように、ゴミの輝度勾配とエッジの輝度勾配とが2値化後に連結してしまい、ゴミ影を高精度に検出することができない。   In the conventional method (method of extracting dust shadow based on luminance information in the entire image), when the dust shadow is in the vicinity of the edge, as shown in FIG. The edge brightness gradient is connected after binarization, and dust shadows cannot be detected with high accuracy.

ステップS126にて、図2に示す画像補正部110は、ゴミ検出部108で検出されたゴミ影12の影響を低減する画像補正を行う。たとえば、画像補正部110は、ゴミ影の領域の輝度を、周辺の画素の輝度と同程度になるように増加させることより、ゴミ影の影響を低減することができる。   In step S126, the image correction unit 110 illustrated in FIG. 2 performs image correction to reduce the influence of the dust shadow 12 detected by the dust detection unit. For example, the image correcting unit 110 can reduce the influence of the dust shadow by increasing the brightness of the dust shadow area so as to be approximately the same as the brightness of the surrounding pixels.

本実施形態では、上記のように、好適に検出されたゴミに関するデータを利用して、ユーザにより指定された検出範囲内のゴミ影の補正・除去を行うので、高品質の画像データを取得することができる。   In the present embodiment, as described above, dust shadows within the detection range designated by the user are corrected and removed using data relating to dust that is suitably detected, so that high-quality image data is acquired. be able to.

ステップS128にて、図2に示す範囲表示部112は、範囲決定手段104により決定され、メモリ220に記憶されたゴミ検出範囲24をゴミ影12の影響を低減した画像データと共にタッチパネル液晶8に表示させる。ユーザは、ゴミ検出範囲24内に表示された補正後の画像を見て、良好に画像補正がなされているか否かを判断し、良好に補正がなされていれば、補正後の画像をメモリ220に記憶させる。   In step S128, the range display unit 112 shown in FIG. 2 displays the dust detection range 24 determined by the range determination unit 104 and stored in the memory 220 on the touch panel liquid crystal 8 together with the image data in which the influence of the dust shadow 12 is reduced. Let The user looks at the corrected image displayed in the dust detection range 24 to determine whether or not the image correction has been performed satisfactorily. If the correction has been performed satisfactorily, the corrected image is stored in the memory 220. Remember me.

また、良好に画像補正がなされていないと判断した場合には、補正前の画像データを、ゴミ影の位置データなどとともに、メモリ220に記憶させる。ゴミ影の位置データなどと共に保存された画像データは、カメラからパソコンに移されて、パソコンに搭載してあるその他の画像補正アルゴニズムにより処理されて、ゴミ影の補正除去を行うことができる。   If it is determined that the image correction has not been performed satisfactorily, the image data before correction is stored in the memory 220 together with dust shadow position data. Image data stored together with dust shadow position data and the like can be transferred from the camera to a personal computer and processed by other image correction algorithms installed in the personal computer to perform dust shadow correction and removal.

なお、本実施形態のカメラ200では、光学フィルタ214に付着したゴミを除去する構成を有していたが、これに限定されず、ゴミを除去する構成を有さないカメラ200であっても良い。また、ゴミ検出部108は、光学フィルタ214以外の撮影光の光路上にあって撮影光を透過する部材に付着したゴミを検出しても良い。
第2実施形態
The camera 200 according to the present embodiment has a configuration for removing dust attached to the optical filter 214. However, the present invention is not limited to this, and the camera 200 may not have a configuration for removing dust. . The dust detection unit 108 may detect dust attached to a member that is on the optical path of the imaging light other than the optical filter 214 and transmits the imaging light.
Second embodiment

本発明の第2実施形態では、図4に示すゴミ影14を検出する。すなわち、前述した第1実施形態では、ゴミ影12を検出したのに対して、本実施形態では、ゴミ影14を検出する。下記の説明において、上記の第1実施形態と重複する部分の説明を省略する。   In the second embodiment of the present invention, the dust shadow 14 shown in FIG. 4 is detected. That is, the dust shadow 12 is detected in the first embodiment described above, whereas the dust shadow 14 is detected in the present embodiment. In the following description, the description of the same parts as those in the first embodiment is omitted.

ユーザは、図1に示すタッチパネル液晶8を操作して、図4に示すゴミ影14の概略位置を入力する。たとえば、ユーザは、図1に示すタッチパネル液晶8を操作して、図4に示すカーソル20を移動させ、カーソル20をゴミ影14の概略左上位置に合わせて、タッチパネル液晶8をタップ操作する。次に、ユーザは、図1に示すタッチパネル液晶8を操作して、図4に示すカーソル22を移動させ、カーソル22をゴミ影14の概略右下位置に合わせて、タッチパネル液晶8をタップ操作する。タッチパネル液晶8のタッチパネル部9は、カーソル20および22の位置座標およびユーザによるタップ操作を検出して、カーソル20および22の位置に関する情報を図2に示す位置検出部102に出力する。位置検出部102は、図1に示すタッチパネル部9からのカーソル20および22の位置に関する情報を利用して、図4に示すゴミ影14の概略位置座標を検出し、図2に示す検出範囲決定部104に出力する。   The user operates the touch panel liquid crystal 8 shown in FIG. 1 to input the approximate position of the dust shadow 14 shown in FIG. For example, the user operates the touch panel liquid crystal 8 shown in FIG. 1, moves the cursor 20 shown in FIG. 4, aligns the cursor 20 with the approximate upper left position of the dust shadow 14, and taps the touch panel liquid crystal 8. Next, the user operates the touch panel liquid crystal 8 shown in FIG. 1, moves the cursor 22 shown in FIG. 4, aligns the cursor 22 with the approximate lower right position of the dust shadow 14, and taps the touch panel liquid crystal 8. . The touch panel unit 9 of the touch panel liquid crystal 8 detects the position coordinates of the cursors 20 and 22 and the tap operation by the user, and outputs information related to the positions of the cursors 20 and 22 to the position detection unit 102 shown in FIG. The position detection unit 102 detects the approximate position coordinates of the dust shadow 14 shown in FIG. 4 using information on the positions of the cursors 20 and 22 from the touch panel unit 9 shown in FIG. 1, and determines the detection range shown in FIG. Output to the unit 104.

検出範囲決定部104は、位置検出部102で検出されたゴミ影14の概略位置座標を利用して、図4に示すゴミ検出範囲26を決定する。たとえば、検出範囲決定部104は、図4に示すゴミ影14の概略左上位置の座標(カーソル20の位置座標)とゴミ影14の概略右下位置の座標(カーソル22の位置座標)とを含む四角形の範囲をゴミ検出範囲26として決定する。   The detection range determination unit 104 determines the dust detection range 26 illustrated in FIG. 4 using the approximate position coordinates of the dust shadow 14 detected by the position detection unit 102. For example, the detection range determination unit 104 includes the coordinates of the upper left position of the dust shadow 14 (position coordinates of the cursor 20) and the coordinates of the lower right position of the dust shadow 14 (position coordinates of the cursor 22) shown in FIG. A rectangular range is determined as the dust detection range 26.

図2に示すパラメータ決定部106とゴミ検出部108とは、図4に示すゴミ検出範囲26の画像データから輝度平面を算出し(図3に示すステップS108〜S112)、その輝度平面から輝度勾配平面を算出し(ステップS114〜S118)、その輝度勾配平面を2値化してゴミ影の検出を行う(ステップS120〜S124)。   The parameter determination unit 106 and the dust detection unit 108 illustrated in FIG. 2 calculate a luminance plane from the image data in the dust detection range 26 illustrated in FIG. 4 (Steps S108 to S112 illustrated in FIG. 3), and the luminance gradient is calculated from the luminance plane. A plane is calculated (steps S114 to S118), and the brightness gradient plane is binarized to detect dust shadows (steps S120 to S124).

図4に示すゴミ検出範囲26では、ゴミ影14以外の部分で輝度のバラツキが少ないので、ゴミ検出範囲26では、輝度および輝度勾配の標準偏差が小さい。したがって、図2に示すパラメータ決定部106とゴミ検出部108とは、図3に示すステップS110〜S112にて、輝度平面に所定値B2より弱い平均化処理を行い、ステップS116〜S118にて、輝度勾配平面に所定値Bd2より弱い平均化処理を行う。輝度平面および輝度勾配平面の平均化を必要以上に強くすると、ゴミ影の形状までもがぼやけてしまいゴミを好適に検出することができないからである。なお、この実施形態の所定値B2およびBd2は、第1実施形態の所定値B1およびBd1と同じように決定され、その数値は同じであってもよいが、異なっていてもよい。   In the dust detection range 26 shown in FIG. 4, there is little variation in luminance in portions other than the dust shadow 14, and therefore, the standard deviation of the luminance and the luminance gradient is small in the dust detection range 26. Therefore, the parameter determination unit 106 and the dust detection unit 108 shown in FIG. 2 perform an averaging process that is weaker than the predetermined value B2 on the luminance plane in steps S110 to S112 shown in FIG. 3, and in steps S116 to S118, An averaging process weaker than the predetermined value Bd2 is performed on the luminance gradient plane. This is because if the averaging of the luminance plane and the luminance gradient plane is strengthened more than necessary, even the shape of the dust shadow becomes blurred and dust cannot be detected suitably. The predetermined values B2 and Bd2 of this embodiment are determined in the same manner as the predetermined values B1 and Bd1 of the first embodiment, and the numerical values may be the same or different.

また、図4に示すゴミ検出範囲26にはエッジがない。したがって、図2に示すパラメータ決定部106とゴミ検出部108とは、図3に示すステップS120〜S122にて、所定値T2より小さい閾値で輝度勾配の2値化を行う。閾値を必要以上に大きくして輝度勾配の2値化を行うと、ゴミ影の外周部を好適に検出できないからである。なお、所定値T2は、ゴミ影の外周部を好適に検出できるように決定され、第1実施形態の所定値T1と同等以下の値である。
第3実施形態
Further, the dust detection range 26 shown in FIG. 4 has no edge. Therefore, the parameter determination unit 106 and the dust detection unit 108 illustrated in FIG. 2 perform binarization of the luminance gradient with a threshold smaller than the predetermined value T2 in steps S120 to S122 illustrated in FIG. This is because if the threshold value is increased more than necessary and the luminance gradient is binarized, the outer periphery of the dust shadow cannot be suitably detected. The predetermined value T2 is determined so that the outer peripheral portion of the dust shadow can be suitably detected, and is equal to or smaller than the predetermined value T1 of the first embodiment.
Third embodiment

本発明の第3実施形態では、図4に示すゴミ影16を検出する。すなわち、前述した第1実施形態では、ゴミ影12を検出したのに対して、本実施形態では、ゴミ影16を検出する。下記の説明において、上記の第1実施形態と重複する部分の説明を省略する。   In the third embodiment of the present invention, the dust shadow 16 shown in FIG. 4 is detected. That is, the dust shadow 12 is detected in the first embodiment described above, whereas the dust shadow 16 is detected in the present embodiment. In the following description, the description of the same parts as those in the first embodiment is omitted.

本実施形態では、図4に示すカーソル28の形状が四角形である。カーソル28の形状および大きさは、あらかじめ決定されてもよいが、ユーザにより設定可能にしてあることが好ましい。ユーザは、検出するゴミ影の形状および大きさに合わせてカーソル28の形状および大きさを変更することができる。   In the present embodiment, the cursor 28 shown in FIG. 4 has a quadrangular shape. The shape and size of the cursor 28 may be determined in advance, but are preferably settable by the user. The user can change the shape and size of the cursor 28 according to the shape and size of the dust shadow to be detected.

ユーザは、図1に示すタッチパネル液晶8を操作して、図4に示すゴミ影16の概略位置を入力する。たとえば、ユーザは、図1に示すタッチパネル液晶8を操作して、図4に示すカーソル28を移動させ、ゴミ影16がカーソル28の枠内に入るようにして、タッチパネル液晶8をタップ操作する。図1に示すタッチパネル液晶8のタッチパネル部9は、図4に示すカーソル28の位置座標およびユーザによるタップ操作を検出して、カーソル28の位置に関する情報を図2に示す位置検出部102に出力する。位置検出部102は、図1に示すタッチパネル部9からの図4に示すカーソル28の位置に関する情報を利用して、ゴミ影16の概略位置座標を検出し、図2に示す検出範囲決定部104に出力する。   The user operates the touch panel liquid crystal 8 shown in FIG. 1 to input the approximate position of the dust shadow 16 shown in FIG. For example, the user operates the touch panel liquid crystal 8 shown in FIG. 1 to move the cursor 28 shown in FIG. 4 so that the dust shadow 16 enters the frame of the cursor 28 and taps the touch panel liquid crystal 8. The touch panel unit 9 of the touch panel liquid crystal 8 shown in FIG. 1 detects the position coordinates of the cursor 28 shown in FIG. 4 and the tap operation by the user, and outputs information related to the position of the cursor 28 to the position detection unit 102 shown in FIG. . The position detection unit 102 detects the approximate position coordinates of the dust shadow 16 using information on the position of the cursor 28 shown in FIG. 4 from the touch panel unit 9 shown in FIG. 1, and detects the range of detection 104 shown in FIG. Output to.

検出範囲決定部104は、位置検出部102で検出された図4に示すゴミ影16の概略位置座標(ゴミ検出範囲28)を利用して、ゴミ検出範囲28を決定する。たとえば、図2に示す検出範囲決定部104は、図4に示すゴミ検出範囲28のm倍の範囲をゴミ検出範囲24として決定する。   The detection range determination unit 104 determines the dust detection range 28 using the approximate position coordinates (dust detection range 28) of the dust shadow 16 shown in FIG. 4 detected by the position detection unit 102. For example, the detection range determination unit 104 shown in FIG. 2 determines the m detection range 28 as the dust detection range 24 that is m times the dust detection range 28 shown in FIG.

図2に示すパラメータ決定部106とゴミ検出部108とは、図4に示すゴミ検出範囲28の画像データから輝度平面を算出し(図3に示すステップS108〜S112)、その輝度平面から輝度勾配平面を算出し(ステップS114〜S118)、その輝度勾配平面を2値化してゴミ影の検出を行う(ステップS120〜S124)。   The parameter determination unit 106 and the dust detection unit 108 illustrated in FIG. 2 calculate a luminance plane from the image data in the dust detection range 28 illustrated in FIG. 4 (Steps S108 to S112 illustrated in FIG. 3), and the luminance gradient is calculated from the luminance plane. A plane is calculated (steps S114 to S118), and the brightness gradient plane is binarized to detect dust shadows (steps S120 to S124).

図4に示すゴミ検出範囲28では、ゴミ影16以外の部分で輝度のバラツキが多いので、ゴミ検出範囲28では、輝度および輝度勾配の標準偏差が大きい。したがって、図2に示すパラメータ決定部106とゴミ検出部108とは、図3に示すステップS110〜S112にて、輝度平面に所定値B3より強い平均化処理を行い、ステップS116〜S118にて、輝度勾配平面に所定値Bd3より強い平均化処理を行う。ゴミ検出範囲28のゴミ影16以外の部分における輝度のバラツキを平均化して、ゴミ影16を良好に検出するためである。なお、この実施形態の所定値B3およびBd3は、輝度のばらつきが多い状態でもゴミ影を良好に検出できるように決定され、第1実施形態の所定値B1およびBd1と同等以上となるように決定される。   In the dust detection range 28 shown in FIG. 4, there are many variations in luminance in portions other than the dust shadow 16, and thus the standard deviation of the luminance and the luminance gradient is large in the dust detection range 28. Therefore, the parameter determination unit 106 and the dust detection unit 108 shown in FIG. 2 perform an averaging process stronger than the predetermined value B3 on the luminance plane in steps S110 to S112 shown in FIG. 3, and in steps S116 to S118, An averaging process stronger than the predetermined value Bd3 is performed on the luminance gradient plane. This is because the variation in luminance in the portion other than the dust shadow 16 in the dust detection range 28 is averaged to detect the dust shadow 16 satisfactorily. Note that the predetermined values B3 and Bd3 of this embodiment are determined so that dust shadows can be detected well even in a state where there are many variations in luminance, and are determined to be equal to or greater than the predetermined values B1 and Bd1 of the first embodiment. Is done.

また、図4に示すゴミ検出範囲28にはエッジがある。したがって、図2に示すパラメータ決定部106とゴミ検出部108とは、図3に示すステップS120〜S122にて、所定値T3より大きい閾値で輝度勾配の2値化を行う。ゴミ影とエッジとの分離を好適に行うためである。なお、所定値T3は、第1実施形態の所定値T1と同じでも異なっていてもよい。
第4実施形態
Further, the dust detection range 28 shown in FIG. 4 has an edge. Therefore, the parameter determination unit 106 and the dust detection unit 108 illustrated in FIG. 2 binarize the luminance gradient with a threshold value greater than the predetermined value T3 in steps S120 to S122 illustrated in FIG. This is because the dust shadow and the edge are preferably separated. The predetermined value T3 may be the same as or different from the predetermined value T1 of the first embodiment.
Fourth embodiment

本発明の第4実施形態では、図6に示すように、制御装置218がPC本体500に組み込まれる。すなわち、前述した第1実施形態では、図1に示すように、カメラ200にボディCPU218が組み込まれるのに対して、本実施形態では、図6に示すように、PC本体500に制御装置218が組み込まれる。また、前述した第1実施形態では、図1に示すように、表示装置がタッチパネル液晶8のディスプレイ部10であったのに対して、本実施形態では、図6に示すように、表示装置が液晶ディスプレイ10である。以下の説明において、上記の実施形態と重複する部分の説明を省略する。   In the fourth embodiment of the present invention, as shown in FIG. 6, the control device 218 is incorporated in the PC main body 500. That is, in the first embodiment described above, the body CPU 218 is incorporated in the camera 200 as shown in FIG. 1, whereas in the present embodiment, the control device 218 is provided in the PC main body 500 as shown in FIG. Incorporated. In the first embodiment described above, the display device is the display unit 10 of the touch panel liquid crystal 8 as shown in FIG. 1, whereas in this embodiment, the display device is shown in FIG. This is a liquid crystal display 10. In the following description, the description of the same part as the above embodiment is omitted.

図5に示すPC本体500は、USBインターフェース502と制御装置218とメモリ220とを有する。PC本体500には、PC本体500により制御されて映像を表示する液晶ディスプレイ10と、ユーザからの指示をPC本体500に入力するキーボード504およびマウス506が接続される。   A PC main body 500 illustrated in FIG. 5 includes a USB interface 502, a control device 218, and a memory 220. Connected to the PC main body 500 are a liquid crystal display 10 that is controlled by the PC main body 500 and displays an image, and a keyboard 504 and a mouse 506 for inputting an instruction from the user to the PC main body 500.

ユーザは、図1に示すカメラ200を、不図示のUSB接続ケーブルを介して、図5に示すPC本体500に接続して、カメラ200にて取得した画像50を、液晶ディスプレイ部10に表示させる。ユーザは、キーボード504およびマウス506を利用して、図4に示す液晶ディスプレイ10に表示された画像50のゴミ影12,14,16の概略位置を入力する。   The user connects the camera 200 shown in FIG. 1 to the PC main body 500 shown in FIG. 5 via a USB connection cable (not shown), and displays the image 50 acquired by the camera 200 on the liquid crystal display unit 10. . Using the keyboard 504 and the mouse 506, the user inputs the approximate positions of the dust shadows 12, 14, and 16 of the image 50 displayed on the liquid crystal display 10 shown in FIG.

なお、本発明は、上記の実施形態に限定されない。   In addition, this invention is not limited to said embodiment.

上記の実施形態では、カメラ200により取得された画像のゴミ検出を行ったが、これに限定されず、たとえば、他のカメラで取得された画像のゴミ検出を行っても良い。また、一般的な画像処理装置によりゴミ影が除去された画像について、更にゴミ検出を行っても良い。   In the above embodiment, dust detection of an image acquired by the camera 200 is performed. However, the present invention is not limited to this. For example, dust detection of an image acquired by another camera may be performed. Further, dust detection may be further performed on an image from which dust shadows have been removed by a general image processing apparatus.

また、上記の実施形態では、カメラの表示装置はタッチパネル液晶で構成されたが、これに限定されず、一般的なLCDや有機EL等の表示装置であっても良い。この場合、ユーザは不図示のマルチセレクター等の入力装置を利用して、ゴミ影の概略位置等を入力する。   In the above embodiment, the display device of the camera is configured by the touch panel liquid crystal, but is not limited thereto, and may be a general display device such as an LCD or an organic EL. In this case, the user inputs an approximate position or the like of the dust shadow using an input device such as a multi selector (not shown).

また、上記の実施形態のゴミ検出装置は、コンピュータに実行させるためのプログラムにより実現されても良い。コンピュータに実行させるためのプログラムは、記憶媒体(たとえば、DVDやメモリースティック、ハードディスク等)に記憶され、記憶媒体から直接に実行されても良いし、記憶媒体からパソコンにインストールされて実行されても良い。   Moreover, the dust detection apparatus of the above embodiment may be realized by a program for causing a computer to execute. A program to be executed by a computer is stored in a storage medium (for example, a DVD, a memory stick, or a hard disk), and may be executed directly from the storage medium, or may be installed from a storage medium and executed on a personal computer. .

8・・・タッチパネル液晶
9・・・タッチパネル部
10・・・表示装置
12,14,16・・・ゴミ影
18,20,22,28・・・カーソル
24,26,28・・・ゴミ検出範囲
102・・・位置検出部
104・・・検出範囲決定部
106・・・ パラメータ決定部
108・・・ゴミ検出部
110・・・画像補正部
112・・・範囲表示部
200・・・カメラ
210・・・カメラ本体部
218・・・ボディCPU、制御装置
250・・・レンズ鏡筒部
500・・・PC本体
504・・・キーボード
506・・・マウス
8 ... Touch panel liquid crystal 9 ... Touch panel 10 ... Display devices 12, 14, 16 ... Dust shadows 18, 20, 22, 28 ... Cursors 24, 26, 28 ... Dust detection range 102 ... Position detection unit 104 ... Detection range determination unit 106 ... Parameter determination unit 108 ... Dust detection unit 110 ... Image correction unit 112 ... Range display unit 200 ... Camera 210 ..Camera body 218 ... Body CPU, control device 250 ... Lens barrel 500 ... PC body 504 ... Keyboard 506 ... Mouse

Claims (10)

表示手段に表示される画像データの内、ユーザが指定している特定の位置または範囲を検出する検出手段と、
前記検出手段により検出された特定の位置または範囲に基づき、検出範囲を決定する範囲決定手段と、
前記範囲決定手段により決定された検出範囲内に位置する画像データを処理することでゴミ検出処理を行うゴミ検出手段とを有する画像のゴミ検出装置。
Detection means for detecting a specific position or range designated by the user among the image data displayed on the display means;
Range determining means for determining a detection range based on the specific position or range detected by the detecting means;
An image dust detection apparatus comprising dust detection means for performing dust detection processing by processing image data located within a detection range determined by the range determination means.
前記検出範囲内に位置する画像データに基づき、前記ゴミ検出処理のパラメータを決定するパラメータ決定手段をさらに有する請求項1に記載のゴミ検出装置。   The dust detection apparatus according to claim 1, further comprising parameter determination means for determining a parameter for the dust detection processing based on image data located within the detection range. 前記パラメータは、前記検出範囲内に位置する画像データの輝度または輝度勾配の平均化処理のパラメータである請求項2に記載のゴミ検出装置。   The dust detection apparatus according to claim 2, wherein the parameter is a parameter of an averaging process of luminance or luminance gradient of image data located within the detection range. 前記平均化処理の強弱パラメータは、前記検出範囲内に位置する画像データの輝度の標準偏差または輝度勾配の標準偏差により決定される請求項3に記載のゴミ検出装置。   The dust detection apparatus according to claim 3, wherein the strength parameter of the averaging process is determined by a standard deviation of luminance or a standard deviation of luminance gradient of image data located within the detection range. 前記パラメータは、前記検出範囲内に位置する画像データの輝度勾配からゴミを検出する際の閾値である請求項2に記載のゴミ検出装置。   The dust detection apparatus according to claim 2, wherein the parameter is a threshold value when dust is detected from a luminance gradient of image data located within the detection range. 前記ゴミ検出手段で検出されたゴミに対応する画像データを補正する補正手段をさらに有する請求項1〜5のいずれかに記載のゴミ検出装置。   6. The dust detection apparatus according to claim 1, further comprising a correction unit that corrects image data corresponding to the dust detected by the dust detection unit. 前記範囲決定手段により決定された検出範囲を、前記画像データと共に前記表示手段に表示させる範囲表示手段をさらに有する請求項1〜6のいずれかに記載のゴミ検出装置。   The dust detection apparatus according to claim 1, further comprising a range display unit that causes the display unit to display the detection range determined by the range determination unit together with the image data. 請求項1〜7の何れかに記載のゴミ検出装置を有するカメラ。   A camera comprising the dust detection device according to claim 1. 表示手段に表示される画像データの内、ユーザが指定している特定の位置または範囲を検出する検出工程と、
前記検出工程により検出された特定の位置または範囲に基づき、検出範囲を決定する範囲決定工程と、
前記範囲決定工程により決定された検出範囲内に位置する画像データを処理することでゴミ検出処理を行うゴミ検出工程とを、
コンピュータに実行させるためのプログラム。
A detection step of detecting a specific position or range designated by the user among the image data displayed on the display means;
A range determination step for determining a detection range based on the specific position or range detected by the detection step;
A dust detection step of performing dust detection processing by processing image data located within the detection range determined by the range determination step;
A program that causes a computer to execute.
請求項9に記載のプログラムが記録してある記憶媒体。   A storage medium on which the program according to claim 9 is recorded.
JP2012025428A 2012-02-08 2012-02-08 Dust detector for detecting dust in image, camera, program, and recording medium Pending JP2013162488A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2012025428A JP2013162488A (en) 2012-02-08 2012-02-08 Dust detector for detecting dust in image, camera, program, and recording medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2012025428A JP2013162488A (en) 2012-02-08 2012-02-08 Dust detector for detecting dust in image, camera, program, and recording medium

Publications (1)

Publication Number Publication Date
JP2013162488A true JP2013162488A (en) 2013-08-19

Family

ID=49174370

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2012025428A Pending JP2013162488A (en) 2012-02-08 2012-02-08 Dust detector for detecting dust in image, camera, program, and recording medium

Country Status (1)

Country Link
JP (1) JP2013162488A (en)

Similar Documents

Publication Publication Date Title
JP5967432B2 (en) Processing apparatus, processing method, and program
US10129479B2 (en) Photographing apparatus and photographing method with optical low-pass filter effect
JP5593990B2 (en) Imaging system and pixel signal readout method
US9912867B2 (en) Image processing apparatus, image capturing apparatus and storage medium storing image processing apparatus
JP6154081B2 (en) Imaging device, imaging device body, and lens barrel
JP2008289032A (en) Imaging apparatus
US9451149B2 (en) Processing apparatus, processing method, and program
JP2016143022A (en) Imaging device and imaging method
US10659692B2 (en) Image blur correction device, imaging apparatus, control method of imaging apparatus and non-transitory storage medium
JP5610106B1 (en) Foreign matter information detection device and foreign matter information detection method for imaging apparatus
WO2013094551A1 (en) Imaging device, method for controlling same, and program
JP6350538B2 (en) Imaging apparatus and control method thereof
US11218637B2 (en) Image capture apparatus and control method having image stabilization which reduces peripheral light variation
JP2006267220A (en) Auto focus system
KR20160104236A (en) Auto focusing image pick-up apparatus, terminal including the same and auto focus controlling method using the same
US9264603B2 (en) Imaging apparatus and imaging method
JP5233554B2 (en) Imaging apparatus and program
JP2011002690A (en) Imaging apparatus, focusing method and program
JP2013162488A (en) Dust detector for detecting dust in image, camera, program, and recording medium
JP2016218106A (en) Imaging device
JP2011242796A (en) Imaging device, focusing method and program
JP5561392B2 (en) Imaging apparatus, focusing method, and program
KR20110090092A (en) Apparatus and method for detecting image blur
JP2018005130A (en) Interchangeable lens
JP2017200028A (en) Image deterioration detector