JP2009017158A - Camera inspection device - Google Patents

Camera inspection device Download PDF

Info

Publication number
JP2009017158A
JP2009017158A JP2007175786A JP2007175786A JP2009017158A JP 2009017158 A JP2009017158 A JP 2009017158A JP 2007175786 A JP2007175786 A JP 2007175786A JP 2007175786 A JP2007175786 A JP 2007175786A JP 2009017158 A JP2009017158 A JP 2009017158A
Authority
JP
Japan
Prior art keywords
image data
luminance
camera
stain
differential value
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
JP2007175786A
Other languages
Japanese (ja)
Inventor
Kazuo Oda
和夫 小田
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.)
Panasonic Corp
Original Assignee
Panasonic 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 Panasonic Corp filed Critical Panasonic Corp
Priority to JP2007175786A priority Critical patent/JP2009017158A/en
Publication of JP2009017158A publication Critical patent/JP2009017158A/en
Pending legal-status Critical Current

Links

Images

Abstract

<P>PROBLEM TO BE SOLVED: To provide a camera inspection device which is capable of precisely detecting a stain in image data by reducing an influence of luminance shading that an optical system of a camera has. <P>SOLUTION: The camera inspection device 1000 includes an image data acquisition part 110 for acquiring image data obtained by imaging a reference subject, a double differential value calculation part 140 for calculating a double differential value of luminance along a prescribed direction from the image data, and a stain position detection part 161 for detecting a position of a stain in the image data from the calculation result of the double differential value calculation part 140, and detects the stain in an image caused by a foreign matter stuck to the light receiving surface of an imaging device of the camera or its peripheral part. The double differential value calculation part 140 varies a differential interval at the time of calculating the double differential values according to a position along the prescribed direction on the basis of luminance shading characteristics causing a luminance distribution in the picked-up image of the reference subject. <P>COPYRIGHT: (C)2009,JPO&INPIT

Description

本発明は、撮像素子を有するカメラにより撮像された画像データに基づいて、撮像素子の受光面またはその周辺部に付着したゴミおよび塵等の異物に起因するシミを検出するカメラ検査装置に関する。カメラは例えば携帯電話等の携帯機器搭載用のカメラに代表される。   The present invention relates to a camera inspection device that detects a stain caused by foreign matter such as dust and dust attached to a light receiving surface of an image sensor or its peripheral part based on image data captured by a camera having the image sensor. The camera is typified by a camera mounted on a mobile device such as a mobile phone.

近年、撮像素子を有するカメラが様々な電子機器に搭載されている。撮像素子を有するカメラでは、製造工程にてゴミおよび塵が撮像素子やレンズ部に異物として付着して、当該異物がカメラの撮像画像内にシミとして写り込んでしまう場合があった。図18にシミが写り込んだ撮像画像の例を示す。図18の例では、シミ1801が撮像画像1802の左下側に現れており、シミ1801の存在により撮像画像の画質が低下している。   In recent years, cameras having an image sensor are mounted on various electronic devices. In a camera having an image sensor, dust and dust may adhere to the image sensor and the lens unit as foreign matters during the manufacturing process, and the foreign matters may appear as spots in the captured image of the camera. FIG. 18 shows an example of a captured image in which a stain is reflected. In the example of FIG. 18, a spot 1801 appears on the lower left side of the captured image 1802, and the image quality of the captured image is degraded due to the presence of the spot 1801.

携帯電話等の携帯機器に搭載されるカメラにおいては、市場からの高解像度化の要請に伴って1画素当たりのピッチが小さくなってきており、また、携帯機器本体の薄肉化の要請に伴って撮像素子の受光面およびレンズ部との間の距離が短くなってきている。このため、携帯機器用のカメラでは、より微細なゴミおよび塵が撮像素子やレンズ部に付着するだけで、撮像画像にシミが写り込んでしまう場合があった。   In cameras mounted on mobile devices such as mobile phones, the pitch per pixel is decreasing with the demand for higher resolution from the market, and with the request for thinner mobile device bodies. The distance between the light receiving surface of the image sensor and the lens portion is becoming shorter. For this reason, in a camera for a portable device, there is a case where a stain appears in a captured image simply because finer dust and dust adhere to the imaging element and the lens unit.

従来、カメラの撮像画像中のシミに関する検査は、人間による目視判断によって行われていた。しかしながら、撮像画像内に生じるシミは微弱なものであり、人間の目視による感応的な評価では、検査員によって判断基準が相違し、この違いが検査結果にばらつきを生じさせ、製造歩留まりにも影響を及ぼしていた。携帯機器の量産台数が著しく増加している昨今の状況下においては、目視検査に頼らずに、効率よく高精度に安定して撮像画像中のシミを検出することが望まれる。   Conventionally, an inspection relating to a spot in a captured image of a camera has been performed by human visual judgment. However, the stains that appear in the captured image are weak, and in the sensitive evaluation by human visual inspection, the judgment criteria differ depending on the inspector, and this difference causes variations in the inspection results and affects the manufacturing yield. Was exerting. Under the current situation in which the number of mass-produced portable devices has increased remarkably, it is desirable to detect stains in captured images efficiently and with high accuracy without relying on visual inspection.

目視検査によらない検査技術としては、例えば特許文献1に記載のカメラ検査技術が知られている。特許文献1に記載のカメラ検査技術では、カメラにより撮像された画像データから、所定方向に沿った輝度曲線上の各位置における2回微分値が算出される。輝度曲線は上記所定方向に沿った輝度変化を表す曲線であり、具体的には上記所定方向に沿ったライン上の各画素の輝度値で表される。そして、2回微分値が輝度曲線の形状を表すことを利用して、2次微分値の算出結果に基づいてシミの位置を検出して、検出されたシミの濃度に基づいてカメラの良否判定を行っている。
特開2006−191231号公報
As an inspection technique not based on visual inspection, for example, a camera inspection technique described in Patent Document 1 is known. In the camera inspection technique described in Patent Document 1, a differential value is calculated twice at each position on a luminance curve along a predetermined direction from image data captured by a camera. The luminance curve is a curve representing the luminance change along the predetermined direction, and is specifically expressed by the luminance value of each pixel on the line along the predetermined direction. Then, utilizing the fact that the second derivative value represents the shape of the luminance curve, the position of the spot is detected based on the calculation result of the second derivative value, and the quality of the camera is determined based on the detected spot density It is carried out.
JP 2006-191231 A

しかしながら、従来のカメラ検査技術では、カメラの光学系の輝度シェーディング特性が考慮されていないために、シミの検出精度が低下するという問題があった。輝度シェーディングとは、カメラのレンズ部や撮像素子等の光学系に依存する現象であって、カメラの撮像画像の中心部と周縁部との間に輝度差が生じる現象をいう。輝度シェーディング特性によれば、カメラの撮像画像の周縁部は中央部と比べて輝度が急に低下することがある。また、例えば図19に示されるように、カメラの撮像画像の周縁部と中心部との間に輝度差が生じるだけでなく、周縁部に凹型の暗い部分が生じる場合もある。輝度シェーディングによって、輝度のうねりや大きな輝度変化が生じると、これらがシミとして誤検出される可能性があった。   However, the conventional camera inspection technology has a problem in that the accuracy of spot detection is lowered because the luminance shading characteristics of the optical system of the camera are not taken into consideration. Luminance shading is a phenomenon that depends on an optical system such as a camera lens unit and an image sensor, and is a phenomenon in which a luminance difference occurs between the central part and the peripheral part of a captured image of the camera. According to the luminance shading characteristic, the luminance at the peripheral portion of the captured image of the camera may suddenly decrease compared to the central portion. Further, for example, as shown in FIG. 19, not only a luminance difference occurs between the peripheral portion and the central portion of the captured image of the camera, but also a concave dark portion may occur in the peripheral portion. If luminance shading or large luminance changes occur due to luminance shading, these may be erroneously detected as spots.

特に、携帯機器用のカメラでは、携帯機器の薄肉化に伴って、撮像素子やレンズ部等の光学部の厚みが極端に薄肉化されており、カメラの光学系がもつ輝度シェーディング特性がシミの検出精度に大きく影響する傾向にある。従って、輝度シェーディングの影響を受けずに、高精度にシミを検出することが望まれる。   Particularly in cameras for portable devices, the thickness of optical parts such as image sensors and lens parts has become extremely thin as the thickness of portable equipment has been reduced, and the brightness shading characteristics of the optical system of the camera have become stains. It tends to greatly affect the detection accuracy. Therefore, it is desirable to detect a spot with high accuracy without being affected by luminance shading.

本発明は、上記従来の問題を解決するためになされたもので、カメラの光学系がもつ輝度シェーディングの影響を低減して、画像データ中のシミを精度よく検出することができるカメラ検査装置を提供することを目的とする。   The present invention has been made in order to solve the above-described conventional problems, and provides a camera inspection apparatus capable of accurately detecting a stain in image data by reducing the influence of luminance shading of a camera optical system. The purpose is to provide.

本発明のカメラ検査装置は、撮像素子を有するカメラにより撮像された画像データに基づいて、前記撮像素子の受光面またはその周辺部に付着した異物に起因する画像中のシミを検出するカメラ検査装置であって、前記カメラを用いて基準被写体を撮像することにより得られる画像データを取得する画像データ取得部と、前記画像データから所定方向に沿った輝度の2回微分値を算出する2回微分値算出部と、前記2回微分値算出部の算出結果に基づいて、前記画像データ中のシミの位置を検出する位置検出部とを備え、前記2回微分値算出部は、前記カメラの光学系がもつ特性であって前記基準被写体の撮像画像に輝度分布を生じさせる輝度シェーディング特性に基づいて、前記2回微分値を算出する際の微分間隔を前記所定方向に沿った位置に応じて異ならせる構成を有している。   The camera inspection apparatus according to the present invention detects a stain in an image caused by a foreign matter attached to a light receiving surface of the image sensor or its peripheral portion based on image data captured by a camera having an image sensor. An image data acquisition unit that acquires image data obtained by imaging a reference subject using the camera, and a second derivative that calculates a second derivative value of luminance along a predetermined direction from the image data. A value calculation unit; and a position detection unit that detects a position of a spot in the image data based on a calculation result of the two-time differential value calculation unit, wherein the two-time differential value calculation unit is an optical unit of the camera. Based on a luminance shading characteristic that is a characteristic of the system and produces a luminance distribution in the captured image of the reference subject, a differential interval for calculating the second differential value along the predetermined direction Has a structure made different depending on the location.

この構成により、画像データから所定方向に沿った輝度の2回微分値を算出し、2回微分値に基づいて画像データ中のシミの位置を検出する。このシミ位置検出では、2回微分値が負の大きな値(負であって絶対値が大きい値)になる位置が、シミの端部として特定される。本発明では、特にシミ位置検出のために輝度の2回微分値を計算する際に、基準被写体の撮像画像に輝度分布を生じる輝度シェーディング特性に基づいて、微分間隔を所定方向に沿った位置に応じて異ならせている。この構成により、輝度シェーディングによる輝度変化の緩急に応じて、上記微分間隔を適切に変化させることで、輝度シェーディングの輝度変化をシミとして誤検出するのを抑止できる。この結果、カメラの光学系がもつ輝度シェーディングの影響を低減して、画像データ中のシミを精度よく検出することができる。   With this configuration, a twice differential value of luminance along a predetermined direction is calculated from the image data, and the position of a spot in the image data is detected based on the twice differential value. In this spot position detection, the position where the twice-differentiated value becomes a large negative value (a negative value with a large absolute value) is specified as the end of the spot. In the present invention, especially when calculating the differential value of the luminance twice for spot position detection, the differential interval is set to a position along a predetermined direction based on the luminance shading characteristic that produces a luminance distribution in the captured image of the reference subject. Different depending on the situation. With this configuration, it is possible to prevent erroneous detection of a luminance change in luminance shading as a stain by appropriately changing the differential interval in accordance with the gradual change in luminance due to luminance shading. As a result, it is possible to reduce the influence of luminance shading of the optical system of the camera and to accurately detect spots in the image data.

また、本発明のカメラ検査装置において、前記2回微分値算出部は、前記画像データの中央部での微分間隔と比較して、前記画像データの周縁部での微分間隔を小さく設定している構成を有している。   In the camera inspection apparatus of the present invention, the second differential value calculation unit sets a differential interval at a peripheral portion of the image data smaller than a differential interval at a central portion of the image data. It has a configuration.

この構成により、画像データの中央部での微分間隔と比較して、中央部より外側の周縁部での微分間隔を小さく設定して、画像データから輝度の2回微分値が算出される。この構成は、画像データの周縁部では中央部と比べて輝度が急に低下するといった輝度シェーディング特性を有する光学系を備えたカメラの検査に適している。画像データの中央部では、周縁部よりも微分間隔を大きく設定することにより、シミ端部での2回微分値が負の方向に増大し、シミ端部が2回微分値に特徴点としてより顕著に現れ、シミの位置を検出し易くすることができる。一方、画像データの周縁部では、中央部よりも微分間隔を小さく設定することにより、シミが画像の縁部にある場合でも、2回微分値が負の大きな値になって、特徴点が確実に現れるとともに、輝度シェーディングによる輝度の急変化点で2回微分値が負の大きな値になるのを防ぎ、シミと輝度シェーディングによる輝度変化との切り分けを明確に行うことができる。このようにして、画像データの中央部での微分間隔と比較して、周縁部での微分間隔を小さく設定することにより、カメラの光学系がもつ輝度シェーディングの影響を低減して、画像データ中のシミを精度よく検出することができる。   With this configuration, the differential value at the peripheral edge outside the central part is set smaller than the differential distance at the central part of the image data, and the twice differential value of luminance is calculated from the image data. This configuration is suitable for the inspection of a camera equipped with an optical system having luminance shading characteristics such that the luminance at the peripheral portion of the image data is sharply reduced compared to the central portion. In the central part of the image data, by setting the differential interval larger than that of the peripheral part, the double differential value at the stain end increases in the negative direction, and the stain end becomes a feature point at the double differential value. Remarkably appear, and the position of the spot can be easily detected. On the other hand, by setting the differential interval smaller at the periphery of the image data than at the center, even if the stain is at the edge of the image, the twice differential value becomes a large negative value, and the feature point is reliably In addition, it is possible to prevent the differential value from becoming a large negative value twice at the point of sudden change in luminance due to luminance shading, and to clearly distinguish between the stain and the luminance change due to luminance shading. In this way, by setting the differential interval at the peripheral portion to be smaller than the differential interval at the center portion of the image data, the influence of the luminance shading of the camera optical system can be reduced. Can be detected with high accuracy.

また、本発明のカメラ検査装置において、前記位置検出部は、前記2回微分値を所定のシミ端判定閾値と比較することにより、前記画像データ中の前記シミの位置を検出する構成を有している。これにより、所定のシミ端判定閾値を基準に、2回微分値が負の大きな値になる位置を特徴点として特定できるので、画像データ中のシミの位置を容易に検出することができる。   Further, in the camera inspection apparatus of the present invention, the position detection unit has a configuration for detecting the position of the stain in the image data by comparing the twice differential value with a predetermined stain end determination threshold value. ing. As a result, the position where the twice-differentiated value becomes a large negative value can be specified as a feature point with reference to a predetermined spot edge determination threshold, so that the position of the spot in the image data can be easily detected.

また、本発明のカメラ検査装置において、前記位置検出部は、前記2回微分値が、先に前記所定のシミ端閾値以上になる位置を前記シミの開始位置とし、次に前記所定のシミ端閾値以上になる位置を前記シミの終了位置として、前記シミの位置を検出する構成を有している。これにより、所定のシミ端判定閾値を基準に、画像データ中で先に2回微分値が負の大きな値になる位置をシミの開始位置とし、後に2回微分値が負の大きな値になる位置をシミの終了位置として特定できるので、画像データ中のシミの位置を容易に検出することができる。   Further, in the camera inspection apparatus of the present invention, the position detection unit sets the position where the double differential value is equal to or greater than the predetermined stain end threshold value as the start position of the stain, and then the predetermined stain end. The position of the spot is detected by setting a position that is equal to or greater than a threshold value as an end position of the spot. As a result, based on a predetermined spot edge determination threshold, the position where the twice differential value becomes a negative negative value first in the image data is set as the spot start position, and the double differential value becomes a negative negative value later. Since the position can be specified as the end position of the stain, the position of the stain in the image data can be easily detected.

本発明のカメラ検査プログラムは、撮像素子を有するカメラにより撮像された画像データに基づいて、前記撮像素子の前記受光面またはその周辺部に付着した異物に起因する画像中のシミを検出する処理をコンピュータに行わせるカメラ検査プログラムであって、前記カメラを用いて基準被写体を撮像することにより得られる画像データを取得するステップと、前記画像データから所定方向に沿った輝度の2回微分値を算出するステップと、前記2回微分値算出部の算出結果に基づいて、前記画像データ中のシミの位置を検出するステップとを前記コンピュータに実行させ、前記輝度の2回微分値を算出するステップでは、前記カメラの光学系がもつ特性であって前記基準被写体の撮像画像に輝度分布を生じさせる輝度シェーディング特性に基づいて、前記2回微分値を算出する際の微分間隔を前記所定方向に沿った位置に応じて異ならせる構成を有している。この構成によっても、上述した本発明の利点が得られる。   The camera inspection program of the present invention performs a process of detecting a stain in an image caused by a foreign matter attached to the light receiving surface of the image sensor or its peripheral part based on image data captured by a camera having an image sensor. A camera inspection program to be executed by a computer, the step of acquiring image data obtained by imaging a reference subject using the camera, and calculating a twice differential value of luminance along a predetermined direction from the image data And a step of causing the computer to execute a step of detecting a position of a stain in the image data based on a calculation result of the double differential value calculation unit, and calculating a double differential value of the luminance. , A characteristic of the optical system of the camera, and a luminance shading characteristic that generates a luminance distribution in the captured image of the reference subject Zui and has a configuration in which different differential distance when calculating the second derivative values depending on the position along said predetermined direction. This configuration also provides the advantages of the present invention described above.

また、本発明の別の態様は、上述のカメラ検査プログラムを記録したコンピュータ読み取り可能な記録媒体である。   Another aspect of the present invention is a computer-readable recording medium that records the above-described camera inspection program.

また、本発明のカメラ検査方法は、撮像素子を有するカメラにより撮像された画像データに基づいて、前記撮像素子の前記受光面またはその周辺部に付着した異物に起因する画像中のシミを検出するカメラ検査方法であって、前記カメラを用いて基準被写体を撮像することにより得られる画像データを取得するステップと、前記画像データから所定方向に沿った輝度の2回微分値を算出するステップと、前記2回微分値算出部の算出結果に基づいて、前記画像データ中のシミの位置を検出するステップとを含み、前記輝度の2回微分値を算出するステップでは、前記カメラの光学系がもつ特性であって前記基準被写体の撮像画像に輝度分布を生じさせる輝度シェーディング特性に基づいて、前記2回微分値を算出する際の微分間隔を前記所定方向に沿った位置に応じて異ならせる構成を有している。このカメラ検査方法によっても、上述した本発明の利点が得られる。   Further, the camera inspection method of the present invention detects a stain in an image caused by a foreign matter attached to the light receiving surface of the image sensor or its peripheral part based on image data captured by a camera having an image sensor. A camera inspection method, the step of acquiring image data obtained by imaging a reference subject using the camera, the step of calculating a twice differential value of luminance along a predetermined direction from the image data, Detecting a position of a spot in the image data based on a calculation result of the double differential value calculation unit, and calculating the double differential value of the brightness in the optical system of the camera A differential interval for calculating the second differential value based on a luminance shading characteristic that produces a luminance distribution in a captured image of the reference subject. It has a configuration in which different depending on the position along the direction. The advantages of the present invention described above can also be obtained by this camera inspection method.

本発明は、画像データ中のシミを検出するために輝度の2回微分値を算出する際に、輝度シェーディング特性に基づいて、微分間隔を場所によって異ならせることにより、カメラの光学系がもつ輝度シェーディングの影響を低減して、画像データ中のシミを精度よく検出することができるという効果を有するカメラ検査装置を提供することができるものである。   In the present invention, when calculating a differential value of luminance twice in order to detect a stain in image data, the luminance interval of the optical system of the camera is obtained by varying the differential interval depending on the location based on the luminance shading characteristics. It is possible to provide a camera inspection apparatus having an effect of reducing the influence of shading and detecting a stain in image data with high accuracy.

以下、本発明の実施の形態に係るカメラ検査装置について、図面を用いて説明する。本発明の実施の形態におけるカメラ検査装置の機能ブロック図を図1に示すとともに、このカメラ検査装置をハードウエア面から見た構成を図2に示す。最初に図2を参照してカメラ検査装置の構成をハードウエア面から説明して、次に図1に基づいてカメラ検査装置の各機能について説明する。   Hereinafter, a camera inspection apparatus according to an embodiment of the present invention will be described with reference to the drawings. A functional block diagram of the camera inspection apparatus according to the embodiment of the present invention is shown in FIG. 1, and a configuration of the camera inspection apparatus viewed from the hardware side is shown in FIG. First, the configuration of the camera inspection apparatus will be described from the hardware aspect with reference to FIG. 2, and then each function of the camera inspection apparatus will be described based on FIG.

カメラ検査装置1000は、カメラの撮像画像中のシミを検出して、カメラを検査するための装置である。カメラは、例えば携帯電話等の携帯機器に搭載されるカメラモジュールであって、外筐体にレンズ部および撮像素子を備えている。レンズ部は被写体からの光を撮像素子に結像し、撮像素子はレンズ部により結像された像を光電変換することにより、撮像画像の画像データを生成する。   The camera inspection apparatus 1000 is an apparatus for detecting a spot in a captured image of a camera and inspecting the camera. The camera is a camera module mounted on a mobile device such as a mobile phone, for example, and includes a lens unit and an image sensor in an outer casing. The lens unit images light from the subject on the image sensor, and the image sensor photoelectrically converts the image formed by the lens unit to generate image data of the captured image.

カメラを製造する過程において、撮像素子の受光面またはその周辺部(レンズ部を含む)にゴミおよび塵等の異物が付着すると、カメラにより撮像された画像データにシミとして写りこんでしまうことがある。カメラ検査装置1000は、カメラにより撮像された画像データに基づいて、カメラの撮像画像中のシミを検出して、シミレベルを良否判定することにより、カメラの検査を行う。   In the process of manufacturing a camera, if foreign matter such as dust or dust adheres to the light receiving surface of the image sensor or its peripheral part (including the lens part), it may appear as a spot in the image data captured by the camera. . The camera inspection apparatus 1000 inspects the camera by detecting a stain in the image captured by the camera based on image data captured by the camera and determining whether the stain level is acceptable.

カメラ検査装置1000は、コンピュータ装置で構成されており、図2に示されるように、コンピュータ本体210と、表示部220と、操作部230とを備えている。コンピュータ本体210は、プログラム実行部211と、通信部212と、メモリ部213と、プログラム記憶部214とを備えている。   The camera inspection device 1000 is configured by a computer device, and includes a computer main body 210, a display unit 220, and an operation unit 230, as shown in FIG. The computer main body 210 includes a program execution unit 211, a communication unit 212, a memory unit 213, and a program storage unit 214.

プログラム実行部211は、CPU等のプロセッサで構成され、プログラム記憶部214に記憶されているシミ検査プログラム214aを実行する。通信部212は、USBケーブル等の通信ケーブルを介して、外部機器に接続されており、外部機器との間でデータの送受を行うことができる。例えば、外部機器がデータ記憶装置であり、予めカメラにより撮像した画像データがデータ記憶装置に記憶されている。そして、データ記憶装置から通信部212を介して、コンピュータ本体210に画像データを取り込むことができる。外部機器はカメラが搭載された携帯機器でもよい。この場合、予めカメラにより撮像して携帯機器の記憶部に記憶されている画像データを、コンピュータ本体210に取り込むことができる。カメラがカメラ検査装置1000に直接接続され、カメラから撮像画像が取り込まれてもよい。   The program execution unit 211 includes a processor such as a CPU, and executes a spot inspection program 214 a stored in the program storage unit 214. The communication unit 212 is connected to an external device via a communication cable such as a USB cable, and can send and receive data to and from the external device. For example, the external device is a data storage device, and image data captured by a camera in advance is stored in the data storage device. Then, image data can be taken into the computer main body 210 from the data storage device via the communication unit 212. The external device may be a portable device equipped with a camera. In this case, image data captured in advance by the camera and stored in the storage unit of the portable device can be taken into the computer main body 210. A camera may be directly connected to the camera inspection apparatus 1000 and a captured image may be captured from the camera.

メモリ部213は、プログラム実行部211がシミ検査プログラムを実行する等の処理を行う際の作業用のメモリである。プログラム記憶部214には、シミ検査プログラム214aが記憶されている。シミ検査プログラム214aは、本実施の形態におけるカメラ検査装置およびカメラ検査方法を実現するためのプログラムであって、特に、カメラにより撮像された画像データに基づいて、画像データの輝度値の2回微分値からシミの位置を検出して、検出したシミの程度を表すシミレベルを算出し、シミレベルに対して良否判定を行うことにより、カメラの検査を行う。こうしたシミ検査プログラム214aを実行することにより、本実施の形態におけるカメラ検出装置およびカメラ検出方法が実現される。このシミ検査プログラム214aの内容は、後で詳細に説明するカメラ検査装置およびカメラ検査方法にて述べられる。   The memory unit 213 is a working memory used when the program execution unit 211 performs processing such as executing a spot inspection program. The program storage unit 214 stores a spot inspection program 214a. The spot inspection program 214a is a program for realizing the camera inspection apparatus and the camera inspection method according to the present embodiment, and in particular, based on the image data captured by the camera, the second derivative of the luminance value of the image data. The position of the spot is detected from the value, a spot level representing the degree of the detected spot is calculated, and the camera is inspected by performing pass / fail judgment on the spot level. By executing the spot inspection program 214a, the camera detection apparatus and the camera detection method in the present embodiment are realized. The contents of the spot inspection program 214a will be described in a camera inspection apparatus and a camera inspection method which will be described in detail later.

表示部220はディスプレイであって、この表示部220には検査プログラム214aの処理情報等が表示される。操作部230は、テンキー等が配列されたキーボード等であって、例えば検査プログラム214aの実行に関する指示を入力するため等に用いられる。   The display unit 220 is a display, and the display unit 220 displays processing information of the inspection program 214a. The operation unit 230 is a keyboard or the like on which numeric keys and the like are arranged, and is used, for example, for inputting an instruction regarding execution of the inspection program 214a.

次に、図1を参照して、カメラ検査装置の構成について更に説明する。図1ではカメラ検査装置1000が機能ブロックで表されている。図1の各構成が、図2のコンピュータ装置により、具体的にはプログラム記憶部214のシミ検出プログラム214aをプログラム実行部211が実行することによって実現される。カメラ検査装置1000は、画像データ取得部110と、輝度値算出部120と、輝度値平均化部130と、2回微分値算出部140と、微分間隔記憶部150と、シミ検出部160と、シミ判定用閾値記憶部170と、良否判定部180と、判定結果出力部190とを備えている。   Next, the configuration of the camera inspection apparatus will be further described with reference to FIG. In FIG. 1, the camera inspection apparatus 1000 is represented by functional blocks. Each configuration of FIG. 1 is realized by the computer apparatus of FIG. 2, specifically, when the program execution unit 211 executes the spot detection program 214 a of the program storage unit 214. The camera inspection apparatus 1000 includes an image data acquisition unit 110, a luminance value calculation unit 120, a luminance value averaging unit 130, a twice differential value calculation unit 140, a differential interval storage unit 150, a spot detection unit 160, A stain determination threshold value storage unit 170, a pass / fail determination unit 180, and a determination result output unit 190 are provided.

画像データ取得部110は、カメラを用いて基準被写体を撮像することにより得られる画像データを取得する。この画像データ取得部110が取得する画像データは、撮像素子(カメラ)から出力される生データであり、ホワイトバランス調整処理やウェーブレット変換処理等の各種画像処理が施されていないデータである。基準被写体は、例えば白色、灰色等の無彩色であって全体に色が均一な被写体であり、パネル等が用いられる。カメラの撮像素子の受光面またはその周辺部(レンズ部を含む)にゴミおよび塵等の異物が付着していると、この異物が撮像画像上においてシミとして影のような形で現れる。図2のプログラム実行部211および通信部212が、上記の画像データ取得部110として機能する。   The image data acquisition unit 110 acquires image data obtained by imaging a reference subject using a camera. The image data acquired by the image data acquisition unit 110 is raw data output from the image sensor (camera) and is not subjected to various image processing such as white balance adjustment processing and wavelet transform processing. The reference subject is an achromatic subject such as white or gray and has a uniform color throughout, and a panel or the like is used. If foreign matter such as dust or dust adheres to the light receiving surface of the image sensor of the camera or its peripheral part (including the lens part), the foreign matter appears as a shadow on the captured image. The program execution unit 211 and the communication unit 212 in FIG. 2 function as the image data acquisition unit 110 described above.

輝度値算出部120は、画像データ取得部110が取得する画像データの各画素の輝度値を算出する。3原色画像信号である赤(R)信号、緑(G)信号および青(B)信号の画素値をそれぞれR、GおよびBとすると、輝度値Yは式(1)のように表される。輝度値算出部120は式(1)に従って、RGBの画素値を8ビット(bit)グレースケールの輝度信号に変換することにより、輝度値を算出する。図2のプログラム実行部211が、上記の輝度値算出部120として機能する。
Y=0.299×R+0.587×G+0.114×B ・・・(1)
The luminance value calculation unit 120 calculates the luminance value of each pixel of the image data acquired by the image data acquisition unit 110. If the pixel values of the red (R) signal, the green (G) signal, and the blue (B) signal, which are the three primary color image signals, are R, G, and B, respectively, the luminance value Y is expressed as in Expression (1). . The luminance value calculation unit 120 calculates the luminance value by converting the RGB pixel value into an 8-bit grayscale luminance signal according to the equation (1). The program execution unit 211 in FIG. 2 functions as the luminance value calculation unit 120 described above.
Y = 0.299 × R + 0.587 × G + 0.114 × B (1)

輝度値平均化部130は、輝度算出部120により算出された各画素の輝度値Yに対して、平均化処理を行う。ここで、平滑な照度の基準被写体を撮像しても、カメラの画像データは電気的なノイズによる揺らぎを含んでいる。平均化処理はこのような電気的ノイズを低減または除去する。図2のプログラム実行部211が、上記の輝度値平均化部130として機能する。   The luminance value averaging unit 130 performs an averaging process on the luminance value Y of each pixel calculated by the luminance calculating unit 120. Here, even if a reference subject with smooth illuminance is imaged, the image data of the camera includes fluctuations due to electrical noise. The averaging process reduces or eliminates such electrical noise. The program execution unit 211 in FIG. 2 functions as the luminance value averaging unit 130 described above.

平均化処理では、例えば下記の単純平均化が行われる。すなわち、輝度値平均化部130は、注目画素を含む所定範囲(例えば7×7画素の合計49画素)の輝度値の平均値を算出して、注目画素の輝度値を平均値に置き換える。この処理が画像データ内の全画素に対して行われる。この単純平均処理を例えば3回繰り返すことにより、シミを要因とする輝度変化が保持され、電気的なノイズが消去される。   In the averaging process, for example, the following simple averaging is performed. That is, the luminance value averaging unit 130 calculates an average value of luminance values in a predetermined range including the target pixel (for example, a total of 49 pixels of 7 × 7 pixels), and replaces the luminance value of the target pixel with the average value. This process is performed for all pixels in the image data. By repeating this simple averaging process, for example, three times, a luminance change caused by a stain is retained, and electrical noise is eliminated.

図3に輝度値の平均化処理を示す。図3(a)および図3(b)において、横軸は画像データ上の画素の位置であり、縦軸は輝度値であり、各図の輝度曲線は画像データの所定方向に配列する各画素の輝度値の変化を示している。図3(a)は、平均化処理前の輝度曲線を示す図であり、図3(b)は、平均化処理後の輝度曲線を示す図である。図3(a)に示されるように、平均化処理前の輝度曲線では、電気的なノイズを原因とした輝度の揺らぎが多く生じている。一方、図3(b)に示されるように、平均化処理後の輝度曲線では、電気的なノイズが除去されており、輝度の揺らぎ低減されている。   FIG. 3 shows the luminance value averaging process. 3 (a) and 3 (b), the horizontal axis represents the position of the pixel on the image data, the vertical axis represents the luminance value, and the luminance curve in each figure represents each pixel arranged in a predetermined direction of the image data. The change of the luminance value is shown. FIG. 3A is a diagram showing a luminance curve before the averaging process, and FIG. 3B is a diagram showing a luminance curve after the averaging process. As shown in FIG. 3A, the luminance curve before the averaging process has many luminance fluctuations due to electrical noise. On the other hand, as shown in FIG. 3B, the electric noise is removed from the luminance curve after the averaging processing, and the luminance fluctuation is reduced.

各画素の輝度値の平均化処理は、上記手法に限定されない。検出したいシミの大きさとレベルに対応して、平均化処理の手法を適正化する必要がある。また、低減または除去したいノイズ量はカメラの仕様によって異なってくるが、そのような低減または除去したいノイズ量に対応して、平均化処理の手法を適正化する必要がある。そこで、これらの要求を満たす処理を行うように、輝度値平均化部130が構成されている。   The averaging process of the luminance value of each pixel is not limited to the above method. It is necessary to optimize the averaging method according to the size and level of the stain to be detected. Further, the amount of noise to be reduced or removed varies depending on the specifications of the camera, but it is necessary to optimize the averaging processing method in accordance with the amount of noise to be reduced or removed. Therefore, the luminance value averaging unit 130 is configured to perform processing that satisfies these requirements.

2回微分値算出部140は、画像データから所定方向に沿った輝度の2回微分値を算出する。2回微分値算出部140は、輝度値平均化部130による輝度値の平均化処理後の画像データを用いて、上記2回微分値を算出する。2回微分値算出部140は、画像データの水平方向または垂直方向の1ラインを選択して、このラインに沿った輝度の2回微分値を算出する。図2のプログラム実行部211が、上記の2回微分値算出部140として機能する。   The twice differential value calculation unit 140 calculates a double differential value of luminance along a predetermined direction from the image data. The twice-differential value calculation unit 140 calculates the above-described twice-differential value using the image data after the luminance value averaging processing by the luminance value averaging unit 130. The twice differential value calculation unit 140 selects one line in the horizontal direction or the vertical direction of the image data, and calculates a double differential value of the luminance along this line. The program execution unit 211 in FIG. 2 functions as the above-described double differential value calculation unit 140.

2回微分値算出部140は、所定方向の複数のラインの各々を対象として、2回微分値を計算する。所定方向は、水平方向でもよく、垂直方向でもよく、両方の方向であってもよい。また、全ラインを対象として2回微分値が計算されてもよい。あるいは、適当な間引きが行われ、所定間隔毎のラインを対象として2回微分値が算出されてよい。この場合、ラインの間隔は検出すべきシミの大きさに応じて適当に設定される。2回微分値の計算と計算結果を用いたシミ検出および良否判定等の以降の処理は、各ラインに対して同様に行われる。そこで、以下では、水平方向の1つのラインについての処理を中心に、本実施の形態のカメラ検査装置1000について説明する。   The twice differential value calculation unit 140 calculates the differential value twice for each of a plurality of lines in a predetermined direction. The predetermined direction may be a horizontal direction, a vertical direction, or both directions. Further, the differential value may be calculated twice for all lines. Alternatively, appropriate thinning may be performed, and the differential value may be calculated twice for the lines at predetermined intervals. In this case, the line interval is appropriately set according to the size of the stain to be detected. Subsequent processes such as the calculation of the differential value twice, the spot detection using the calculation result, and the quality determination are performed in the same manner for each line. Therefore, hereinafter, the camera inspection apparatus 1000 according to the present embodiment will be described with a focus on processing for one horizontal line.

2回微分値算出部140は、次に示す式(2)および式(3)に従って2回微分値を算出する。式(2)は1回微分値の計算式であり、式(3)は1回微分値から2回微分値を計算する式である。
D1 = (Y―Yn−1)/{n―(n−α)} ・・・(2)
D2 = (D1―D1n−1)/{n―(n−α)} ・・・(3)
The twice-differential value calculation unit 140 calculates the twice-differential value according to the following equations (2) and (3). Formula (2) is a formula for calculating a single differential value, and Formula (3) is a formula for calculating a differential value twice from a single differential value.
D1 n = (Y n −Y n−1 ) / {n− (n−α)} (2)
D2 n = (D1 n −D1 n−1 ) / {n− (n−α)} (3)

ここでは、nは計算対象である選択ライン上での画素座標であり、Yはn画素の輝度値であり、D1はn画素の1回微分値であり、D2はn画素の2回微分値である。本実施の形態では、式(2)および式(3)に示されるように、微分間隔αを隔てた2点の輝度値から2回微分値が算出される。 Here, n is a pixel coordinate on the selection line to be calculated, Y n is a luminance value of n pixels, D1 n is a one-time differential value of n pixels, and D2 n is 2 of n pixels. It is a differential value. In the present embodiment, as shown in Expression (2) and Expression (3), the differential value is calculated twice from the luminance values at two points separated by the differential interval α.

本実施の形態では、特に上記の微分間隔が、画像データ上の位置に応じて異なって設定されている。この微分間隔設定に従い、2回微分値算出部140は、画像データ上の位置によって異なる微分間隔を用いて、2回微分値を計算する。微分間隔は検査対象のカメラの輝度シェーディング特性に基づいて設定されている。輝度シェーディングは、カメラの撮像素子やレンズ部等の光学系に依存する現象である。輝度シェーディング特性によって、基準被写体の撮像画像に輝度分布が生じる。   In the present embodiment, the differential interval is set differently depending on the position on the image data. In accordance with this differential interval setting, the double differential value calculation unit 140 calculates the differential value twice using a differential interval that varies depending on the position on the image data. The differential interval is set based on the luminance shading characteristics of the camera to be inspected. Luminance shading is a phenomenon that depends on an optical system such as an image sensor or a lens unit of a camera. Due to the luminance shading characteristics, a luminance distribution is generated in the captured image of the reference subject.

本実施の形態では、輝度シェーディング特性として、画像データの周縁部では中央部と比べて輝度が急に低下することが想定されている。そこで、画像データの中央部の所定範囲とその外側の周縁部とで微分間隔が異なって設定されており、具体的には中央部と比較して、周縁部の微分間隔が小さく設定されている。微分間隔の設定とその効果については、後述にて詳細に説明する。   In the present embodiment, it is assumed as the luminance shading characteristic that the luminance at the peripheral portion of the image data is suddenly lowered as compared with the central portion. Therefore, the differential interval is set differently between the predetermined range in the central portion of the image data and the outer peripheral portion, and specifically, the differential interval at the peripheral portion is set smaller than the central portion. . The setting of the differential interval and its effect will be described in detail later.

微分間隔記憶部150には、2回微分値を算出する際の微分間隔が記憶されている。上述の通り、2回微分値を算出する際の微分間隔として、中央部用微分間隔151および周縁部用微分間隔152が設定されており、後者のほうが小さく設定されている。図2のメモリ部213が、上記の微分間隔記憶部150として機能する。   The differential interval storage unit 150 stores a differential interval for calculating the differential value twice. As described above, the central differential interval 151 and the peripheral differential interval 152 are set as differential intervals when calculating the differential value twice, and the latter is set smaller. The memory unit 213 in FIG. 2 functions as the differential interval storage unit 150 described above.

シミ検出部160は、シミ位置検出部161と、シミレベル算出部162とを備えている。シミ位置検出部161は、2回微分値算出部140の算出結果に基づいて、画像データ中のシミの位置を検出する。シミレベル算出部162は、シミ位置検出部161により検出されたシミ位置に基づいて、シミレベルを算出する。図2のプログラム実行部211が、上記のシミ検出部160として機能する。   The spot detection unit 160 includes a spot position detection unit 161 and a spot level calculation unit 162. The spot position detection unit 161 detects the position of the spot in the image data based on the calculation result of the twice differential value calculation unit 140. The stain level calculation unit 162 calculates a stain level based on the stain position detected by the stain position detection unit 161. The program execution unit 211 in FIG. 2 functions as the spot detection unit 160 described above.

ここで、図4を参照して、画像中のシミと上記の2回微分値の関係と、2回微分値によるシミ検出およびシミレベル算出について説明する。図4は、画像データ中でシミが生じている位置における輝度曲線を拡大した図である。図示のように、シミが生じている位置では、シミの周辺と比較して輝度値が小さくなる。図4に示されるように、画像データ中のシミの端部A、Bでは特に輝度が急に変化して、輝度曲線が急に曲がる。しかも、シミの端部A、Bでは輝度曲線が「上に凸」である。従って、輝度の2回微分値の算出結果では、シミの端部A、Bが輝度の2回微分値がマイナスであって絶対値が大きい特徴点として現れる。この特徴点を特定することにより、シミの開始位置(シミ端A)と終了位置(シミ端B)を検出でき、それらの間をシミとして検出できる。   Here, with reference to FIG. 4, the relationship between the stain in the image and the above-described twice differential value, and the stain detection and the stain level calculation based on the double differential value will be described. FIG. 4 is an enlarged view of a luminance curve at a position where a spot is generated in the image data. As shown in the drawing, the luminance value is smaller at the position where the spot is generated as compared with the periphery of the spot. As shown in FIG. 4, the brightness changes particularly sharply at the edge portions A and B of the stain in the image data, and the brightness curve bends sharply. Moreover, the brightness curve is “convex upward” at the edges A and B of the stain. Accordingly, in the calculation result of the twice-difference value of luminance, the end portions A and B of the stain appear as feature points having a large absolute value and a negative second-derivative value of luminance. By specifying this feature point, the start position (stain end A) and end position (stain end B) of the stain can be detected, and a space between them can be detected as a stain.

具体的には、シミ位置検出部161は以下のようにして、シミ位置を検出する。シミ位置検出部161は、シミ判定用閾値記憶部170に記憶されているシミ端判定閾値171と、2回微分値算出部140により算出された2回微分値とを比較して、画像データ中のシミの位置を検出する。このとき、シミ位置検出部161は、2回微分値が、先にシミ端判定閾値以上となる位置をシミの開始位置とし、次にシミ端判定閾値以上となる位置をシミの終了位置として、シミの位置を検出する。図4の例では、シミ端Aがシミの開始位置A、シミ端Bがシミの終了位置となる。   Specifically, the spot position detection unit 161 detects the spot position as follows. The stain position detection unit 161 compares the stain end determination threshold value 171 stored in the stain determination threshold value storage unit 170 with the twice differential value calculated by the twice differential value calculation unit 140, and stores the image data in the image data. Detect the position of the spot. At this time, the spot position detection unit 161 sets the position where the double differential value is equal to or higher than the spot end determination threshold first as the spot start position, and then sets the position where the second differential value is equal to or higher than the spot end determination threshold as the spot end position. Detect the position of the stain. In the example of FIG. 4, the spot end A is the spot start position A, and the spot end B is the spot end position.

シミレベル算出部162は、シミの開始位置(シミ端A)と終了位置(シミ端B)の間で最も輝度が小さい位置(最低輝度位置M)を特定し、その位置における輝度値を抽出して、次の式(4)に従ってシミレベルを算出する。シミレベルは、「シミの開始位置と終了位置の輝度の平均値」に対する「最も輝度が小さい位置における輝度値」の割合である。「シミの開始位置と終了位置の輝度の平均値」は、シミが無いとした場合の該当位置の輝度を表す値として用いられる。

Figure 2009017158
The spot level calculation unit 162 identifies a position (lowest brightness position M) having the lowest brightness between the start position (spot end A) and the end position (stain end B), and extracts a brightness value at that position. The stain level is calculated according to the following equation (4). The stain level is a ratio of “the luminance value at the position with the lowest luminance” to “the average value of luminance at the start position and the end position of the stain”. The “average value of the luminance at the start position and the end position of the spot” is used as a value representing the luminance at the corresponding position when there is no spot.
Figure 2009017158

シミ判定用閾値記憶部170には、シミ端判定閾値171およびシミレベル判定閾値172が記憶されている。シミ端判定閾値171は、上述の通り、シミ位置検出部161が画像データ中のシミの開始位置および終了位置を検出するのに用いられる。シミレベル判定閾値172は、以下に説明する良否判定部180にて、シミレベル算出部162の算出結果であるシミレベルが良好なレベルか否かを判断するのに用いられる。図2のメモリ213が上記のシミ判定用閾値記憶部170として機能する。   The spot determination threshold storage unit 170 stores a spot end determination threshold 171 and a spot level determination threshold 172. As described above, the spot end determination threshold 171 is used by the spot position detection unit 161 to detect the start position and the end position of the spot in the image data. The stain level determination threshold value 172 is used by the pass / fail determination unit 180 described below to determine whether the stain level, which is a calculation result of the stain level calculation unit 162, is a satisfactory level. The memory 213 in FIG. 2 functions as the above-described spot determination threshold storage unit 170.

良否判定部180は、シミレベル算出部162により算出されたシミレベルと、シミレベル判定閾値172とを比較する。そして、比較の結果、良否判定部180は、シミレベルがシミレベル判定閾値172より小さい場合に「良」と判定し、シミレベルがシミレベル判定閾値172より大きい場合に「否」と判定する。図2のプログラム実行部211が、上記の良否判定部180として機能する。判定結果出力部190は、良否判定部180の判定結果を出力する。図2の表示部220が上記の判定結果出力部190として機能する。   The pass / fail determination unit 180 compares the stain level calculated by the stain level calculation unit 162 with the stain level determination threshold value 172. As a result of the comparison, the pass / fail determination unit 180 determines “good” when the stain level is smaller than the stain level determination threshold 172, and determines “no” when the stain level is greater than the stain level determination threshold 172. The program execution unit 211 in FIG. 2 functions as the above pass / fail judgment unit 180. The determination result output unit 190 outputs the determination result of the pass / fail determination unit 180. The display unit 220 in FIG. 2 functions as the determination result output unit 190 described above.

ここで、上述した2回微分値算出部140にて、2回微分値を算出する際の微分間隔の設定について説明する。ここでは、まず、画像データ中の中央部および周縁部にシミが位置するときの微分間隔と2回微分値算出結果の関係を具体例に基づいて説明し、更に輝度シェーディングの影響と微分間隔の関係について説明し、それから本実施の形態の好適な微分間隔の設定を説明する。   Here, the setting of the differential interval when calculating the differential value twice in the above-described double differential value calculation unit 140 will be described. Here, first, the relationship between the differential interval when the stain is located at the central portion and the peripheral portion in the image data and the result of the twice differential value calculation will be described based on a specific example. Further, the influence of luminance shading and the differential interval The relationship will be described, and then the preferred differential interval setting of the present embodiment will be described.

まず、画像データの中央部にシミが写り込んでいる例について説明する。図5は、画像の一例を示す図であって、画像の中央部にシミが写り込んでいる。図6は、図5に対応する輝度曲線であって、図5のシミを水平方向(紙面にて左右方向)に通る線に沿った輝度曲線(水平断面波形)を示す。図7は、微分間隔を16画素間隔として、図6の輝度曲線で表される輝度の2回微分値を算出した算出結果を示す。図8は、微分間隔を図7より大きい32画素間隔として、図6の輝度曲線で表される輝度の2回微分値を算出した算出結果を示す。   First, an example in which a stain appears in the center of the image data will be described. FIG. 5 is a diagram illustrating an example of an image, and a stain is reflected in the center of the image. FIG. 6 is a luminance curve corresponding to FIG. 5 and shows a luminance curve (horizontal cross-sectional waveform) along a line passing through the stain of FIG. 5 in the horizontal direction (left and right direction on the paper surface). FIG. 7 shows a calculation result of calculating the twice differential value of the luminance represented by the luminance curve of FIG. 6 with the differential interval being 16 pixel intervals. FIG. 8 shows a calculation result obtained by calculating the twice differential value of the luminance represented by the luminance curve of FIG. 6 by setting the differential interval to 32 pixel intervals larger than FIG.

図5の例では、画像502の中央部にシミ501が発生しており、そのために図6に示されるように、シミ501に対応する位置で輝度が落ち込んでいる。そして、図7および図8に示されるように、2回微分値の算出結果では、シミ端部A1、B1にて、2回微分値が負の大きな値になる特徴点a、b、c、dが現れる。図7と図8とを比較すると双方共に特徴点が明確に現れているが、図8の特徴点c、dの方が図7の特徴点a、bよりも2次微分値の絶対値で大きい。このように、微分間隔を大きく設定することにより、シミ端に相当する特徴点における2次微分値の絶対値を大きくでき、画像データのシミの位置を検出し易くすることができる。   In the example of FIG. 5, a spot 501 is generated at the center of the image 502, and as a result, the brightness drops at a position corresponding to the spot 501 as shown in FIG. 6. Then, as shown in FIGS. 7 and 8, in the calculation result of the double differential value, the characteristic points a, b, c, where the double differential value becomes a large negative value at the spot ends A1 and B1. d appears. When comparing FIG. 7 and FIG. 8, the feature points clearly appear in both cases, but the feature points c and d in FIG. 8 are the absolute values of the secondary differential values than the feature points a and b in FIG. 7. large. Thus, by setting the differential interval large, the absolute value of the secondary differential value at the feature point corresponding to the stain edge can be increased, and the position of the stain in the image data can be easily detected.

次に、画像データの周縁部にシミが写り込んでいる例について説明する。図9は、画像の一例を示す図であって、画像の左上の周縁部にシミが写り込んでいる。図10は、図9に対応する輝度曲線であって、左上のシミを水平方向に通る輝度曲線を示す。図11および図12は、図10の輝度曲線で表される輝度の2回微分値の算出結果を示す図であって、図11では微分間隔が20画素間隔であり、図12では微分間隔が8画素間隔である。   Next, an example in which a stain appears in the peripheral portion of the image data will be described. FIG. 9 is a diagram illustrating an example of an image, in which a stain appears in the upper left edge of the image. FIG. 10 is a luminance curve corresponding to FIG. 9 and shows a luminance curve passing through the upper left spot in the horizontal direction. 11 and 12 are diagrams showing the calculation result of the twice differential value of the luminance represented by the luminance curve of FIG. 10, in which the differential interval is 20 pixel intervals in FIG. 11, and the differential interval is FIG. The interval is 8 pixels.

図9の例では、画像902の左上部にシミ901が発生しており、そのために図10に示されるように、輝度曲線の左端では輝度が低下して落ち込んでいる。図10の輝度曲線に従えば、シミの両端A2、B2に対応して、2回微分値の曲線においても2箇所に特徴点が現れるはずである。しかしながら、微分間隔が大きい図11では1つの特徴点eしか現れておらず、シミ901の開始位置に相当する点A2の位置を特定できない。これに対して、微分間隔を8画素と小さく設定した図12では、2つの特徴点f、gが明確に現れており、シミ901の開始位置および終了位置に相当する点A2、B2の双方の位置を確実に特定することができる。従って、画像データの周縁部では、輝度の2回微分値を算出する際の微分間隔を小さくすることにより、画像端部にシミが発生した場合でも、シミの位置を確実に検出することができる。   In the example of FIG. 9, a stain 901 occurs in the upper left part of the image 902, and as a result, as shown in FIG. 10, the luminance is lowered and falls at the left end of the luminance curve. According to the luminance curve of FIG. 10, characteristic points should appear in two places in the curve of the twice differential value corresponding to both ends A2 and B2 of the stain. However, in FIG. 11 where the differential interval is large, only one feature point e appears, and the position of the point A2 corresponding to the start position of the spot 901 cannot be specified. On the other hand, in FIG. 12 in which the differential interval is set to be as small as 8 pixels, two feature points f and g clearly appear, and both the points A2 and B2 corresponding to the start position and the end position of the spot 901 are displayed. The position can be reliably identified. Therefore, at the peripheral portion of the image data, by reducing the differential interval when calculating the differential value of the brightness twice, the position of the stain can be reliably detected even when a stain occurs at the edge of the image. .

次に、輝度シェーディングの影響と微分間隔の関係について説明する。図13は、画像の一例を示す図であって、画像の左上にシミが写り込んでいる。図14は、図13に対応する輝度曲線であって、図13のシミを水平方向に通る線に沿った輝度曲線を示す。図15および図16は、図14の輝度曲線で表される輝度の2回微分値の算出結果を示す図であって、図15では微分間隔が32画素間隔であり、図16では微分間隔が16画素間隔である。   Next, the relationship between the influence of luminance shading and the differential interval will be described. FIG. 13 is a diagram illustrating an example of an image, and a stain appears in the upper left of the image. FIG. 14 is a luminance curve corresponding to FIG. 13 and shows a luminance curve along a line passing through the stain of FIG. 13 in the horizontal direction. FIGS. 15 and 16 are diagrams showing the calculation results of the twice differential value of the luminance represented by the luminance curve of FIG. 14. In FIG. 15, the differential interval is 32 pixel intervals, and in FIG. 16 the differential interval is The interval is 16 pixels.

図13の例では、画像1302の左上部にシミ1301が発生しており、そのために図14の輝度曲線の左側部分には輝度が低下して落ち込んでおり、そして、図15の2回微分値の曲線でもシミ1301に対応する場所に特徴点が現れている。図15を更に見ると、図15の右側部分においては、図13で画面の右側部分にシミが発生していないにも拘らず、2回微分値が負の大きな値になっており、特徴点が現れている。特徴点における2回微分値の絶対値はシミの位置と同程度に達している。この特徴点の発生は輝度シェーディングに起因している。図14に示すように、画像の右側部分では輝度シェーディングによって輝度が急に低下しており、図15ではその部分で2回微分値が負の大きな値になっている。このような特徴点はシミの誤検出の原因になる。   In the example of FIG. 13, a stain 1301 is generated at the upper left portion of the image 1302. For this reason, the luminance is lowered and falls on the left side of the luminance curve of FIG. 14. Also in the curve, feature points appear at locations corresponding to the spots 1301. Looking further at FIG. 15, in the right part of FIG. 15, the double differential value has a large negative value despite the fact that no stain has occurred in the right part of the screen in FIG. 13. Appears. The absolute value of the twice differential value at the feature point has reached the same level as the position of the spot. The occurrence of this feature point is due to luminance shading. As shown in FIG. 14, the luminance suddenly decreases due to luminance shading in the right portion of the image, and in FIG. 15, the twice-differentiated value becomes a large negative value in that portion. Such feature points cause false detection of spots.

これに対して、図16では、図15と比較して微分間隔が小さく設定されている。微分間隔を小さく設定することにより、シミ端部での急な屈曲箇所では2回微分値が負の大きな値になるが、輝度シェーディングで単に輝度の傾きが大きい場所では2回微分値が大きくならない。従って、図16に示すように、シミの位置では特徴点を維持しつつ、輝度シェーディングで輝度が急変化する場所での特徴点の出現が抑えられる。このようにして、微分間隔を小さく設定することにより、シミの部分と輝度シェーディングの部分との切り分けを行うことができ、このことから、カメラの光学系がもつ輝度シェーディングの影響をより適切に低減して、画像データ中のシミをより精度よく検出することができる。   On the other hand, in FIG. 16, the differential interval is set smaller than that in FIG. By setting the differential interval small, the double differential value becomes a large negative value at a sharp bend at the edge of the stain, but the double differential value does not increase at locations where the luminance gradient is simply large due to luminance shading. . Therefore, as shown in FIG. 16, the appearance of feature points at locations where the luminance changes suddenly by luminance shading is suppressed while maintaining the characteristic points at the positions of the spots. In this way, by setting the differential interval to be small, it is possible to separate the spot portion from the luminance shading portion, and this reduces the influence of luminance shading on the camera optical system more appropriately. Thus, it is possible to detect a stain in the image data with higher accuracy.

以上にシミが画像データの中央部および周縁部に発生したときの各々について、微分間隔と2回微分値の関係を説明し、更に輝度シェーディングの影響と微分間隔の関係について説明した。本実施の形態では、これらの関係に基づいて、微分間隔が設定されている。本実施の形態では、画像データの周縁部では中央部と比べて輝度が急に低下するといった輝度シェーディング特性が想定されている。   As described above, the relationship between the differential interval and the twice differential value is described for each of when the stain occurs in the central portion and the peripheral portion of the image data, and further, the relationship between the influence of luminance shading and the differential interval is described. In the present embodiment, the differential interval is set based on these relationships. In the present embodiment, a luminance shading characteristic is assumed in which the luminance is sharply reduced in the peripheral portion of the image data as compared with the central portion.

そして、画像データの中央部、すなわち画像中央の所定の範囲では、周縁部よりも微分間隔を大きく設定している。該中央部の両側である周縁部では、中央部よりも微分間隔を小さく設定している。中央部と周縁部との境界は、画像の中心を挟んで両側の所定位置、すなわち、画像の一方の半部の1ヶ所と、他方の半部の1ヶ所とに予め設定されている。より詳細には、中央部と周縁部との境界は、輝度シェーディングによる輝度変化の度合が変化する場所であって、画像データの中央部から周縁部に向けて輝度が急に低下し始める場所に応じて設定されており、この輝度変化が急になる場所より内側の所定の位置に、中央部と周縁部の境界が予め設定されている。この輝度の急変化開始部を境に、画像の内側(中央側)の領域では中央部の微分間隔が設定され、画像の外側(両端側)の領域では周縁部の微分間隔が設定される。   In the central portion of the image data, that is, a predetermined range in the center of the image, the differential interval is set larger than that of the peripheral portion. In the peripheral part which is both sides of the central part, the differential interval is set smaller than that in the central part. The boundary between the central portion and the peripheral portion is set in advance at a predetermined position on both sides across the center of the image, that is, one location in one half of the image and one location in the other half. More specifically, the boundary between the central portion and the peripheral portion is a place where the degree of luminance change due to luminance shading changes, and where the luminance starts to suddenly decrease from the central portion to the peripheral portion of the image data. The boundary between the central portion and the peripheral portion is set in advance at a predetermined position inside the place where the luminance change is steep. With the sudden change start portion of the brightness as a boundary, a differential interval at the center is set in an area inside (center side) of the image, and a differential interval at a peripheral edge is set in an area outside (both ends) of the image.

これらの設定により、画像データの中央部では、シミ端部が2回微分値に特徴点としてより顕著に現れる。画像データの周縁部では、シミが画像の縁部にある場合でも、2回微分値が負の大きな値になって、特徴点が確実に現れるとともに、シミと輝度シェーディングによる輝度変化との切り分けを明確に行うことができる。このような設定により、カメラの光学系がもつ輝度シェーディングの影響を低減して、画像データ中のシミを精度よく検出することができる。   With these settings, a spot edge appears more prominently as a feature point in the differential value at the center of the image data. At the periphery of the image data, even when the stain is at the edge of the image, the differential value becomes a large negative value twice, and the feature point appears reliably, and the brightness change due to the brightness shading is separated from the stain. Can be done clearly. By such setting, it is possible to reduce the influence of luminance shading of the optical system of the camera and accurately detect a stain in the image data.

以上に、本実施の形態におけるカメラ検査装置1000の各機能について説明した。次に、本発明の実施の形態におけるカメラ検査装置1000の動作について、図に基づいて説明する。図17は、カメラ検査装置1000の動作フローを示す図である。プログラム記憶部214の検査プログラム214aをプログラム実行部211が実行することにより、カメラ検査装置1000が図17のカメラ検査処理を行う。   The functions of the camera inspection apparatus 1000 according to the present embodiment have been described above. Next, the operation of the camera inspection apparatus 1000 according to the embodiment of the present invention will be described with reference to the drawings. FIG. 17 is a diagram illustrating an operation flow of the camera inspection apparatus 1000. When the program execution unit 211 executes the inspection program 214a in the program storage unit 214, the camera inspection apparatus 1000 performs the camera inspection process of FIG.

まず、図17に示されるように、画像データ取得部110が、カメラにより基準被写体を撮像して得られる画像データを取得する(ステップ(STEP:以下、Sと称する)1701)。輝度算出部120が、画像データ取得部110により取得される画像データの各画素の輝度値を算出する(S1702)。この際、輝度算出部120は上述の通り、式(1)に従って、8ビット(bit)グレースケールの輝度信号への変換によって輝度値を算出する。   First, as shown in FIG. 17, the image data acquisition unit 110 acquires image data obtained by imaging a reference subject with a camera (step (STEP: hereinafter referred to as S) 1701). The luminance calculation unit 120 calculates the luminance value of each pixel of the image data acquired by the image data acquisition unit 110 (S1702). At this time, as described above, the luminance calculation unit 120 calculates a luminance value by conversion into an 8-bit grayscale luminance signal according to the equation (1).

次に、輝度値平均化部130が、輝度算出部120により算出された各画素の輝度値に対して、平均化処理を行う(S1703)。具体的には、注目画素を含む所定範囲(例えば7×7画素の合計49画素)の輝度値の平均値を算出して、注目画素の輝度値を平均値に置き換える。この処理が画像データ内の全画素に対して3回繰り返される。このような平均化処理により、図3(a)および図3(b)を用いて説明したように、シミを要因とする輝度変化が保持され、電気的なノイズが消去される。   Next, the luminance value averaging unit 130 performs an averaging process on the luminance value of each pixel calculated by the luminance calculating unit 120 (S1703). Specifically, an average value of luminance values in a predetermined range including the target pixel (for example, a total of 49 pixels of 7 × 7 pixels) is calculated, and the luminance value of the target pixel is replaced with the average value. This process is repeated three times for all pixels in the image data. With this averaging process, as described with reference to FIGS. 3A and 3B, the luminance change caused by the stain is retained, and the electrical noise is eliminated.

次に、2回微分値算出部140が、画像データの水平方向または垂直方向の1ラインを選択して、このラインに沿った輝度の2回微分値を上述の式(2)および式(3)に従って算出する(S1704)。2回微分値は、輝度値平均化部130による輝度値の平均化処理後の画像データから算出される。前述したように、カメラ検査装置1000は、多数のラインを順次選択して、各々のラインについて、2回微分値の計算と以後のシミ検出等の処理を行うが、以下の説明では主として1本のラインに着目して説明を行う。   Next, the twice differential value calculation unit 140 selects one line in the horizontal direction or the vertical direction of the image data, and calculates the double differential value of the luminance along this line using the above-described equations (2) and (3). ) In accordance with (1704). The twice differentiated value is calculated from the image data after the luminance value averaging processing by the luminance value averaging unit 130. As described above, the camera inspection apparatus 1000 sequentially selects a large number of lines and performs a process of calculating a differential value twice and detecting a subsequent spot for each line. In the following description, one line is mainly used. An explanation will be given focusing on the line.

次に、シミ位置検出部161が、2回微分値算出部140の算出結果に基づいて、画像データ中のシミの位置を検出する(S1705)。具体的には、シミ位置検出部161は、シミ判定用閾値記憶部170に記憶されているシミ端判定閾値171と、2回微分値算出部140により算出された2回微分値とを比較して、画像データ中のシミの位置を検出する。このとき、シミ位置検出部161は2回微分値がシミ端判定閾値以上になる位置をシミ位置として検出する。より具体的には、シミ位置検出部161は、2回微分値が、先にシミ端判定閾値以上となる位置をシミの開始位置とし、次にシミ端判定閾値以上になる位置をシミの終了位置として、シミの位置を検出する。   Next, the spot position detection unit 161 detects the position of the spot in the image data based on the calculation result of the twice differential value calculation unit 140 (S1705). Specifically, the stain position detection unit 161 compares the stain end determination threshold value 171 stored in the stain determination threshold storage unit 170 with the double differential value calculated by the double differential value calculation unit 140. Thus, the position of the spot in the image data is detected. At this time, the spot position detection unit 161 detects a position where the twice differential value is equal to or larger than the spot end determination threshold as the spot position. More specifically, the spot position detection unit 161 sets the position where the double differential value is equal to or higher than the spot end determination threshold first, and then sets the position where the second differential value is equal to or higher than the spot end determination threshold to the end of the spot. As the position, the position of the spot is detected.

ここで、前述にて詳細に説明したように、S1704の2回微分算出処理においては、画像データの中央部では、微分間隔が大きい中央部用微分間隔151が設定され、周縁部では、中央部と比較して微分間隔が小さい周縁部用微分間隔152が設定されている。これにより、S1705のシミ位置検出処理では、カメラの光学系がもつ輝度シェーディングの影響をより適切に低減して、画像データ中のシミをより精度よく検出することができる。   Here, as described in detail above, in the second derivative calculation process of S1704, the central differential interval 151 having a large differential interval is set in the central portion of the image data, and the central portion is set in the peripheral portion. The differential interval 152 for the peripheral portion, which has a smaller differential interval compared to, is set. Thereby, in the spot position detection process of S1705, the influence of the luminance shading of the optical system of the camera can be reduced more appropriately, and the spot in the image data can be detected with higher accuracy.

次に、シミレベル算出部162が、S1705で検出されたシミ位置に基づいて、シミレベルを算出する(S1706)。具体的には、図4を用いて説明したように、シミレベル算出部162が、シミの開始位置と終了位置の間で最も輝度が小さい位置(最低輝度位置)を特定し、その位置における輝度値を抽出して、上記の式(4)に従ってシミレベルを算出する。   Next, the stain level calculation unit 162 calculates a stain level based on the stain position detected in S1705 (S1706). Specifically, as described with reference to FIG. 4, the spot level calculation unit 162 identifies a position (the lowest brightness position) having the lowest brightness between the start position and the end position of the spot, and the brightness value at that position. And the stain level is calculated according to the above equation (4).

シミレベルが算出された後、良否判定部180が、算出されたシミレベルと、シミレベル判定閾値172とを比較して、シミレベルの良否判定を行う(S1707)。具体的には、良否判定部180は、算出されたシミレベルとシミレベル判定閾値172を比較した結果、シミレベルがシミレベル判定閾値172より小さい場合に「良」と判定し、シミレベルがシミレベル判定閾値172より大きい場合に「否」と判定する。この良否判定部180の判定結果は、判定結果出力部190により出力され、検査員がシミレベルの良否判定結果を確認することができる。以上の通り、本発明の実施の形態におけるカメラ検査装置1000の動作について説明した。   After the stain level is calculated, the pass / fail determination unit 180 compares the calculated stain level with the stain level determination threshold 172 to determine pass / fail of the stain level (S1707). Specifically, the pass / fail determination unit 180 compares the calculated stain level with the stain level determination threshold 172, and determines that the stain level is “good” when the stain level is smaller than the stain level determination threshold 172. The stain level is greater than the stain level determination threshold 172. In this case, “No” is determined. The determination result of the pass / fail determination unit 180 is output by the determination result output unit 190, and the inspector can check the pass / fail determination result of the stain level. As described above, the operation of the camera inspection apparatus 1000 according to the embodiment of the present invention has been described.

このような本発明の実施の形態のカメラ検査装置によれば、画像データから所定方向に沿った輝度の2回微分値を算出し、2回微分値に基づいて画像データ中のシミの位置を検出する。このシミ位置検出では、2回微分値が負の大きな値(負であって絶対値が大きい値)になる位置が、シミの端部として特定される。本発明では、特にシミ位置検出のために輝度の2回微分値を計算する際に、基準被写体の撮像画像に輝度分布を生じる輝度シェーディング特性に基づいて、微分間隔を所定方向に沿った位置に応じて異ならせている。この構成により、輝度シェーディングによる輝度変化の緩急に応じて、上記微分間隔を適切に変化させることで、輝度シェーディングの輝度変化をシミとして誤検出するのを抑止できる。この結果、カメラの光学系がもつ輝度シェーディングの影響を低減して、画像データ中のシミを精度よく検出することができる。   According to the camera inspection apparatus of the embodiment of the present invention as described above, the twice differential value of the luminance along the predetermined direction is calculated from the image data, and the position of the stain in the image data is determined based on the twice differential value. To detect. In this spot position detection, the position where the twice-differentiated value becomes a large negative value (a negative value with a large absolute value) is specified as the end of the spot. In the present invention, especially when calculating the differential value of the luminance twice for spot position detection, the differential interval is set to a position along a predetermined direction based on the luminance shading characteristic that produces a luminance distribution in the captured image of the reference subject. Different depending on the situation. With this configuration, it is possible to prevent erroneous detection of a luminance change in luminance shading as a stain by appropriately changing the differential interval in accordance with the gradual change in luminance due to luminance shading. As a result, it is possible to reduce the influence of luminance shading of the optical system of the camera and to accurately detect spots in the image data.

また、本発明の形態のカメラ検査装置によれば、画像データの中央部での微分間隔と比較して、中央部より外側の周縁部での微分間隔を小さく設定して、画像データから輝度の2回微分値が算出される。この構成は、画像データの周縁部では中央部と比べて輝度が急に低下するといった一般的な輝度シェーディング特性を有する光学系を備えたカメラの検査に適している。画像データの中央部では、周縁部よりも微分間隔を大きく設定することにより、シミ端部での2回微分値が負の方向に増大し、シミ端部が2回微分値に特徴点としてより顕著に現れ、シミの位置を検出し易くすることができる。一方、画像データの周縁部では、中央部よりも微分間隔を小さく設定することにより、シミが画像の縁部にある場合でも、2回微分値が負の大きな値になって、特徴点が確実に現れるとともに、輝度シェーディングによる輝度の急変化点で2回微分値が負の大きな値になるのを防ぎ、シミと輝度シェーディングによる輝度変化との切り分けを明確に行うことができる。このようにして、画像データの中央部での微分間隔と比較して、周縁部での微分間隔を小さく設定することにより、カメラの光学系がもつ輝度シェーディングの影響を低減して、画像データ中のシミを精度よく検出することができる。   In addition, according to the camera inspection apparatus of the present invention, the differential interval at the peripheral edge outside the central portion is set smaller than the differential interval at the central portion of the image data, and the luminance of the image data is increased. A differential value is calculated twice. This configuration is suitable for inspection of a camera including an optical system having a general luminance shading characteristic in which the luminance is sharply decreased in the peripheral portion of the image data as compared with the central portion. In the central part of the image data, by setting the differential interval larger than that of the peripheral part, the double differential value at the stain end increases in the negative direction, and the stain end becomes a feature point at the double differential value. Remarkably appear, and the position of the spot can be easily detected. On the other hand, by setting the differential interval smaller at the periphery of the image data than at the center, even if the stain is at the edge of the image, the twice differential value becomes a large negative value, and the feature point is reliably In addition, it is possible to prevent the differential value from becoming a large negative value twice at the point of sudden change in luminance due to luminance shading, and to clearly distinguish between the stain and the luminance change due to luminance shading. In this way, by setting the differential interval at the peripheral portion to be smaller than the differential interval at the center portion of the image data, the influence of the luminance shading of the camera optical system can be reduced. Can be detected with high accuracy.

また、本発明の実施の形態におけるカメラ検査装置によれば、2回微分値を所定のシミ端判定閾値と比較することにより、画像データ中のシミの位置を検出する。従って、所定のシミ端判定閾値を基準に、2回微分値が負の大きな値になる位置を特徴点として特定できるので、画像データ中のシミの位置を容易に検出することができる。   Further, according to the camera inspection apparatus in the embodiment of the present invention, the position of the stain in the image data is detected by comparing the differential value twice with a predetermined stain end determination threshold value. Accordingly, the position where the twice differential value becomes a large negative value can be specified as a feature point with reference to a predetermined spot edge determination threshold, so that the position of the spot in the image data can be easily detected.

また、本発明の実施の形態におけるカメラ検査装置によれば、2回微分値が、先に所定のシミ端閾値を超えた位置をシミの開始位置とし、次に所定のシミ端閾値を越えた位置をシミの終了位置として、シミの位置を検出する構成を有している。これにより、所定のシミ端判定閾値を基準に、画像データ中で先に2回微分値が負の大きな値になる位置をシミの開始位置とし、後に2回微分値が負の大きな値になる位置をシミの終了位置として特定できるので、画像データ中のシミの位置を容易に検出することができる。   Further, according to the camera inspection apparatus in the embodiment of the present invention, the differential value of the second time exceeds the predetermined spot end threshold at the position where the predetermined threshold end threshold is exceeded, and then exceeds the predetermined spot end threshold. The position of the spot is detected with the position as the end position of the spot. As a result, based on a predetermined spot edge determination threshold, the position where the twice differential value becomes a negative negative value first in the image data is set as the spot start position, and the double differential value becomes a negative negative value later. Since the position can be specified as the end position of the stain, the position of the stain in the image data can be easily detected.

以上、本発明の実施の形態を例示により説明したが、本発明の範囲はこれらに限定されるものではなく、請求項に記載された範囲内において目的に応じて変更・変形することが可能である。   The embodiments of the present invention have been described above by way of example, but the scope of the present invention is not limited to these embodiments, and can be changed or modified according to the purpose within the scope of the claims. is there.

上記実施態様では、本発明の実施の形態におけるカメラは携帯電話端末や携帯情報端末等の携帯端末に搭載されているカメラモジュールであると説明したが、これに限らず、本発明の実施の形態におけるカメラは一般的なデジタルカメラであってもよい。   In the above embodiment, the camera in the embodiment of the present invention has been described as a camera module mounted on a portable terminal such as a mobile phone terminal or a portable information terminal. However, the present invention is not limited to this. The camera in may be a general digital camera.

上記実施態様では、2回微分値算出部240は、画像データの水平方向または垂直方向の1ラインを選択して、このラインに沿った輝度の2回微分値を算出すると説明したが、2回微分値算出部240は、水平方向または垂直方向に限らず、画像データの任意の所定の方向に沿った輝度の2回微分値を算出してもよい。   In the above embodiment, it has been described that the twice differential value calculation unit 240 selects one line in the horizontal direction or the vertical direction of the image data and calculates the double differential value of the brightness along this line. The differential value calculation unit 240 may calculate a double differential value of the luminance along any predetermined direction of the image data, not limited to the horizontal direction or the vertical direction.

上記実施態様では、本発明に係るカメラ検査装置およびカメラ検査方法について具体的に説明した。しかし、本発明はこれらに限定されない。本発明は、上述したカメラ検査方法の各ステップをコンピュータに実行させるカメラ検査プログラムであってもよく、また、このカメラ検査プログラムを記録したコンピュータ読み取り可能な記録媒体であってもよい。   In the above embodiment, the camera inspection apparatus and the camera inspection method according to the present invention have been specifically described. However, the present invention is not limited to these. The present invention may be a camera inspection program that causes a computer to execute each step of the above-described camera inspection method, or may be a computer-readable recording medium that records the camera inspection program.

以上のように、本発明は、カメラの光学系がもつ輝度シェーディングの影響を低減して、画像データ中のシミを精度よく検出することができるという効果を有し、撮像素子を有するカメラにより撮像された画像データに基づいて、撮像素子の受光面またはその周辺部に付着したゴミおよび塵等の異物に起因するシミを検出するカメラ検査装置に有用である。   As described above, the present invention has the effect of reducing the influence of luminance shading of the optical system of the camera and accurately detecting spots in the image data, and is imaged by a camera having an image sensor. It is useful for a camera inspection apparatus that detects spots caused by foreign matters such as dust and dust attached to the light receiving surface of the image sensor or its peripheral part based on the image data thus obtained.

本発明の実施の形態におけるカメラ検査装置の機能ブロック図Functional block diagram of a camera inspection apparatus in an embodiment of the present invention 本発明の実施の形態におけるカメラ検査装置の構成をハードウエア面から示す図The figure which shows the structure of the camera inspection apparatus in embodiment of this invention from a hardware surface (a) 平均化処理前の輝度曲線を示す図 (b) 平均化処理後の輝度曲線を示す図(A) The figure which shows the luminance curve before the averaging process (b) The figure which shows the luminance curve after the averaging process 画像データ中でシミが生じている部分を拡大した輝度曲線の一例を示す図The figure which shows an example of the brightness | luminance curve which expanded the part which the stain has arisen in image data 中央部にシミが生じた画像の一例を示す図The figure which shows an example of the image which the spot produced in the center part 画像の輝度曲線の一例を示す図The figure which shows an example of the brightness | luminance curve of an image 微分間隔が16画素間隔の場合の輝度の2回微分値の算出結果を示す図The figure which shows the calculation result of the twice differential value of the brightness | luminance in case a differentiation space | interval is a 16-pixel space | interval. 微分間隔が32画素間隔の場合の輝度の2回微分値の算出結果を示す図The figure which shows the calculation result of the twice differential value of the brightness | luminance in case a differential interval is a 32 pixel interval. 周縁部にシミが生じた画像の一例を示す図The figure which shows an example of the image which the spot produced in the peripheral part 画像の輝度曲線の一例を示す図The figure which shows an example of the brightness | luminance curve of an image 微分間隔が20画素間隔の場合の輝度の2回微分値の算出結果を示す図The figure which shows the calculation result of the twice differential value of the brightness | luminance in case a differentiation space | interval is a 20 pixel space | interval. 微分間隔が8画素間隔の場合の輝度の2回微分値の算出結果を示す図The figure which shows the calculation result of the twice differential value of the brightness | luminance in case a differential interval is an 8-pixel interval. 左上部にシミが生じた画像の一例を示す図The figure which shows an example of the image which the spot has arisen in the upper left 画像の輝度曲線の一例を示す図The figure which shows an example of the brightness | luminance curve of an image 微分間隔が32画素間隔の場合の輝度の2回微分値の算出結果を示す図The figure which shows the calculation result of the twice differential value of the brightness | luminance in case a differential interval is a 32 pixel interval. 微分間隔が16画素間隔の場合の輝度の2回微分値の算出結果を示す図The figure which shows the calculation result of the twice differential value of the brightness | luminance in case a differentiation space | interval is a 16-pixel space | interval. 本発明の実施の形態におけるカメラ検査装置の動作フローを示す図The figure which shows the operation | movement flow of the camera inspection apparatus in embodiment of this invention シミが写り込んだ撮像画像の例を示す図The figure which shows the example of the picked-up image where the spot is reflected 画像の輝度曲線の一例を示す図The figure which shows an example of the brightness | luminance curve of an image

符号の説明Explanation of symbols

110 画像データ取得部
120 輝度値算出部
130 輝度値平均化部
140 2回微分値算出部
150 微分間隔記憶部
160 シミ検出部
161 シミ位置検出部
162 シミレベル算出部
170 シミ判定用閾値記憶部
180 良否判定部
190 判定結果出力部
1000 カメラ検査装置
210 コンピュータ本体
211 プログラム実行部
212 通信部
213 メモリ部
214 プログラム記憶部
214a シミ検査プログラム
220 表示部
230 操作部
DESCRIPTION OF SYMBOLS 110 Image data acquisition part 120 Luminance value calculation part 130 Luminance value averaging part 140 Two-time differential value calculation part 150 Differential interval storage part 160 Spot detection part 161 Spot position detection part 162 Spot level calculation part 170 Spot determination threshold storage part 180 Pass / fail Determination unit 190 Determination result output unit 1000 Camera inspection device 210 Computer main body 211 Program execution unit 212 Communication unit 213 Memory unit 214 Program storage unit 214a Spot inspection program 220 Display unit 230 Operation unit

Claims (7)

撮像素子を有するカメラにより撮像された画像データに基づいて、前記撮像素子の受光面またはその周辺部に付着した異物に起因する画像中のシミを検出するカメラ検査装置であって、
前記カメラを用いて基準被写体を撮像することにより得られる画像データを取得する画像データ取得部と、
前記画像データから所定方向に沿った輝度の2回微分値を算出する2回微分値算出部と、
前記2回微分値算出部の算出結果に基づいて、前記画像データ中のシミの位置を検出する位置検出部とを備え、
前記2回微分値算出部は、前記カメラの光学系がもつ特性であって前記基準被写体の撮像画像に輝度分布を生じさせる輝度シェーディング特性に基づいて、前記2回微分値を算出する際の微分間隔を前記所定方向に沿った位置に応じて異ならせることを特徴とするカメラ検査装置。
A camera inspection device for detecting a stain in an image caused by a foreign matter attached to a light receiving surface of the image sensor or its peripheral portion based on image data captured by a camera having an image sensor,
An image data acquisition unit for acquiring image data obtained by imaging a reference subject using the camera;
A two-time differential value calculating unit for calculating a double differential value of luminance along a predetermined direction from the image data;
A position detection unit that detects a position of a stain in the image data based on a calculation result of the second derivative calculation unit;
The two-time differential value calculation unit is a characteristic of the camera optical system, and is a derivative for calculating the second-time differential value based on a luminance shading characteristic that generates a luminance distribution in a captured image of the reference subject. A camera inspection apparatus, wherein the interval is varied according to a position along the predetermined direction.
前記2回微分値算出部は、前記画像データの中央部での微分間隔と比較して、前記画像データの周縁部での微分間隔を小さく設定していることを特徴とする請求項1に記載のカメラ検査装置。   2. The differential value calculation unit sets the differential interval at the peripheral portion of the image data to be smaller than the differential interval at the central portion of the image data. Camera inspection equipment. 前記位置検出部は、前記2回微分値を所定のシミ端判定閾値と比較することにより、前記画像データ中の前記シミの位置を検出することを特徴とする請求項1または2に記載のカメラ検査装置。   3. The camera according to claim 1, wherein the position detection unit detects the position of the spot in the image data by comparing the twice-differentiated value with a predetermined spot end determination threshold value. Inspection device. 前記位置検出部は、前記2回微分値が、先に前記所定のシミ端閾値以上になる位置を前記シミの開始位置とし、次に前記所定のシミ端閾値以上になる位置を前記シミの終了位置として、前記シミの位置を検出することを特徴とする請求項3に記載のカメラ検査装置。   The position detection unit sets the position where the double differential value first becomes equal to or greater than the predetermined stain end threshold as the start position of the stain, and then sets the position where the second differential value is equal to or greater than the predetermined stain end threshold as the end of the stain The camera inspection apparatus according to claim 3, wherein the position of the spot is detected as a position. 撮像素子を有するカメラにより撮像された画像データに基づいて、前記撮像素子の前記受光面またはその周辺部に付着した異物に起因する画像中のシミを検出する処理をコンピュータに行わせるカメラ検査プログラムであって、
前記カメラを用いて基準被写体を撮像することにより得られる画像データを取得するステップと、
前記画像データから所定方向に沿った輝度の2回微分値を算出するステップと、
前記2回微分値算出部の算出結果に基づいて、前記画像データ中のシミの位置を検出するステップとを前記コンピュータに実行させ、
前記輝度の2回微分値を算出するステップでは、前記カメラの光学系がもつ特性であって前記基準被写体の撮像画像に輝度分布を生じさせる輝度シェーディング特性に基づいて、前記2回微分値を算出する際の微分間隔を前記所定方向に沿った位置に応じて異ならせることを特徴とするカメラ検査プログラム。
A camera inspection program for causing a computer to perform a process of detecting a stain in an image caused by a foreign substance attached to the light receiving surface of the image sensor or its peripheral part based on image data captured by a camera having an image sensor. There,
Obtaining image data obtained by imaging a reference subject using the camera;
Calculating a twice differential value of luminance along a predetermined direction from the image data;
Detecting the position of a stain in the image data based on the calculation result of the twice differential value calculation unit, causing the computer to execute,
In the step of calculating the twice differential value of the luminance, the second differential value is calculated based on a luminance shading characteristic that is a characteristic of the optical system of the camera and causes a luminance distribution in the captured image of the reference subject. A camera inspection program characterized in that a differential interval at the time of performing is varied according to a position along the predetermined direction.
請求項5に記載されたカメラ検査プログラムを記録したコンピュータ読み取り可能な記録媒体。   A computer-readable recording medium on which the camera inspection program according to claim 5 is recorded. 撮像素子を有するカメラにより撮像された画像データに基づいて、前記撮像素子の前記受光面またはその周辺部に付着した異物に起因する画像中のシミを検出するカメラ検査方法であって、
前記カメラを用いて基準被写体を撮像することにより得られる画像データを取得するステップと、
前記画像データから所定方向に沿った輝度の2回微分値を算出するステップと、
前記2回微分値算出部の算出結果に基づいて、前記画像データ中のシミの位置を検出するステップとを含み、
前記輝度の2回微分値を算出するステップでは、前記カメラの光学系がもつ特性であって前記基準被写体の撮像画像に輝度分布を生じさせる輝度シェーディング特性に基づいて、前記2回微分値を算出する際の微分間隔を前記所定方向に沿った位置に応じて異ならせることを特徴とするカメラ検査方法。
On the basis of image data captured by a camera having an image sensor, a camera inspection method for detecting a stain in an image caused by a foreign matter attached to the light receiving surface of the image sensor or its peripheral portion,
Obtaining image data obtained by imaging a reference subject using the camera;
Calculating a twice differential value of luminance along a predetermined direction from the image data;
Detecting a position of a stain in the image data based on a calculation result of the twice differential value calculation unit,
In the step of calculating the twice differential value of the luminance, the second differential value is calculated based on a luminance shading characteristic that is a characteristic of the optical system of the camera and causes a luminance distribution in the captured image of the reference subject. A camera inspection method, characterized in that a differential interval at the time of performing is varied according to a position along the predetermined direction.
JP2007175786A 2007-07-04 2007-07-04 Camera inspection device Pending JP2009017158A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2007175786A JP2009017158A (en) 2007-07-04 2007-07-04 Camera inspection device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2007175786A JP2009017158A (en) 2007-07-04 2007-07-04 Camera inspection device

Publications (1)

Publication Number Publication Date
JP2009017158A true JP2009017158A (en) 2009-01-22

Family

ID=40357512

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2007175786A Pending JP2009017158A (en) 2007-07-04 2007-07-04 Camera inspection device

Country Status (1)

Country Link
JP (1) JP2009017158A (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR101559338B1 (en) * 2013-07-17 2015-10-12 (주)탑중앙연구소 System for testing camera module centering and method for testing camera module centering using the same
CN106791804A (en) * 2016-11-23 2017-05-31 歌尔股份有限公司 For the smear detecting method and device of camera module
JP2019161813A (en) * 2018-03-12 2019-09-19 オムロン株式会社 Evaluation device and power conditioner
CN112862832A (en) * 2020-12-31 2021-05-28 重庆盛泰光电有限公司 Dirt detection method based on concentric circle segmentation positioning

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR101559338B1 (en) * 2013-07-17 2015-10-12 (주)탑중앙연구소 System for testing camera module centering and method for testing camera module centering using the same
CN106791804A (en) * 2016-11-23 2017-05-31 歌尔股份有限公司 For the smear detecting method and device of camera module
CN106791804B (en) * 2016-11-23 2018-07-03 歌尔股份有限公司 For the smear detecting method and device of camera module
JP2019161813A (en) * 2018-03-12 2019-09-19 オムロン株式会社 Evaluation device and power conditioner
CN112862832A (en) * 2020-12-31 2021-05-28 重庆盛泰光电有限公司 Dirt detection method based on concentric circle segmentation positioning
CN112862832B (en) * 2020-12-31 2022-07-12 盛泰光电科技股份有限公司 Dirt detection method based on concentric circle segmentation positioning

Similar Documents

Publication Publication Date Title
JP4378746B2 (en) Digital image sensor and method capable of detecting defective pixels
EP2224726A2 (en) Image processing apparatus, image processing method, and program
TW201020972A (en) System and method to generate depth data using edge detection
JPWO2007105359A1 (en) Image processing apparatus, image processing program, electronic camera, and image processing method for image analysis of lateral chromatic aberration
CN110519485B (en) Image processing method, image processing device, storage medium and electronic equipment
JP4769764B2 (en) Input method for entering points into the system, setting method, calibration method
US10354352B2 (en) Image processing apparatus, image processing method, and storage medium
JP4466015B2 (en) Image processing apparatus and image processing program
CN102025901A (en) Camera module and detection method thereof
JP2015127668A (en) Measurement device, system and program
JP2005172559A (en) Method and device for detecting line defect on panel
JP2009017158A (en) Camera inspection device
KR20200106854A (en) Pixel correction
CN113785181A (en) OLED screen point defect judgment method and device, storage medium and electronic equipment
JPWO2014013792A1 (en) Noise evaluation method, image processing apparatus, imaging apparatus, and program
JP2006098217A (en) Image inspection apparatus, image inspection method, and image inspection program
JP4741019B2 (en) Intercom device
JP6482589B2 (en) Camera calibration device
JP5754931B2 (en) Image analysis apparatus, image analysis method, and program
JP2011029710A (en) Image processor, image processing program, and imaging apparatus
CN111639708B (en) Image processing method, device, storage medium and equipment
JPWO2018198916A1 (en) Image processing apparatus, image processing method, and storage medium
JP2011114760A (en) Method for inspecting camera module
JP2009053019A (en) Chart, system and method for testing resolution
JP2020095017A (en) Information processing device, control method thereof, program, and storage medium