JP7234885B2 - Attached matter detection device and attached matter detection method - Google Patents

Attached matter detection device and attached matter detection method Download PDF

Info

Publication number
JP7234885B2
JP7234885B2 JP2019172207A JP2019172207A JP7234885B2 JP 7234885 B2 JP7234885 B2 JP 7234885B2 JP 2019172207 A JP2019172207 A JP 2019172207A JP 2019172207 A JP2019172207 A JP 2019172207A JP 7234885 B2 JP7234885 B2 JP 7234885B2
Authority
JP
Japan
Prior art keywords
area
unit
adhering matter
luminance
candidate
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.)
Active
Application number
JP2019172207A
Other languages
Japanese (ja)
Other versions
JP2021051378A (en
Inventor
貴 河野
信徳 朝山
修久 池田
泰司 谷
大輔 山本
大輔 塩田
輝彦 上林
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Denso Ten Ltd
Original Assignee
Denso Ten Ltd
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 Denso Ten Ltd filed Critical Denso Ten Ltd
Priority to JP2019172207A priority Critical patent/JP7234885B2/en
Publication of JP2021051378A publication Critical patent/JP2021051378A/en
Application granted granted Critical
Publication of JP7234885B2 publication Critical patent/JP7234885B2/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Description

本発明は、付着物検出装置および付着物検出方法に関する。 The present invention relates to an adhering matter detection device and an adhering matter detection method.

従来、撮像画像の各画素から検出されるエッジに基づき、雨滴等の形状に類似した特徴をもつ候補領域を検出し、候補領域の画素値に基づいて付着物領域を検出する付着物検出装置が知られている(例えば、特許文献1参照)。 Conventionally, there is an adhering matter detection apparatus that detects a candidate area having characteristics similar to the shape of a raindrop or the like based on edges detected from each pixel of a captured image, and detects an adhering matter area based on the pixel values of the candidate area. known (see, for example, Patent Document 1).

特開2019-106644号公報JP 2019-106644 A

しかしながら、従来技術では、付着物を高精度に検出する点で改善の余地があった。例えば、雨滴の形状と、室内照明下における路面反射の形状とが類似しているため、路面反射を付着物領域として誤検出するおそれがあった。 However, in the prior art, there is room for improvement in terms of detecting deposits with high accuracy. For example, since the shape of raindrops is similar to the shape of reflections on the road surface under indoor lighting, there is a risk that the reflections on the road surface will be erroneously detected as an adhering matter area.

本発明は、上記に鑑みてなされたものであって、付着物を高精度に検出することができる付着物検出装置および付着物検出方法を提供することを目的とする。 SUMMARY OF THE INVENTION It is an object of the present invention to provide an adhering matter detection device and an adhering matter detection method capable of detecting adhering matter with high accuracy.

上述した課題を解決し、目的を達成するために、本発明に係る付着物検出装置は、抽出部と、算出部と、判定部とを備える。抽出部は、撮像装置で撮像された画像の各画素から検出されるエッジに基づき、撮像装置に付着した付着物に対応する付着物領域の候補領域を抽出する。算出部は、抽出部によって抽出された候補領域における所定の内部領域において所定方向に連続する複数画素の輝度変化量を算出する。判定部は、算出部によって算出された輝度変化量が第1の範囲にある輝度変化量の数と、第1の範囲よりも輝度変化量が大きい第2の範囲にある輝度変化量の数とに基づいて候補領域が付着物領域であるか否かを判定する。判定部は、第1の範囲にある輝度変化量の数が所定数以上、かつ、第2の範囲にある輝度変化量の数が所定数以上である場合、候補領域が付着物領域ではないと判定する。 In order to solve the above-described problems and achieve the object, an attached matter detection device according to the present invention includes an extraction unit, a calculation unit, and a determination unit . The extraction unit extracts a candidate area for an adhering matter area corresponding to an adhering matter adhering to the imaging device based on the edge detected from each pixel of the image captured by the imaging device . The calculation unit calculates luminance change amounts of a plurality of pixels consecutive in a predetermined direction in a predetermined internal region in the candidate region extracted by the extraction unit . The determination unit determines the number of luminance variations in the first range calculated by the calculation unit , and the number of luminance variations in the second range in which the luminance variation is greater than the first range. It is determined whether or not the candidate area is a deposit area based on the number of luminance change amounts. The determination unit determines that the candidate area is not a deposit area when the number of luminance variations in the first range is a predetermined number or more and the number of luminance variations in the second range is a predetermined number or more. judge.

本発明によれば、付着物を高精度に検出することができる。 According to the present invention, adhering matter can be detected with high accuracy.

図1は、実施形態に係る付着物検出方法の概要を示す図である。FIG. 1 is a diagram showing an outline of an attached matter detection method according to an embodiment. 図2は、実施形態に係る付着物検出装置の構成を示すブロック図である。FIG. 2 is a block diagram showing the configuration of the attached matter detection device according to the embodiment. 図3Aは、抽出部の処理内容を示す図である。FIG. 3A is a diagram illustrating processing contents of an extraction unit; 図3Bは、抽出部の処理内容を示す図である。FIG. 3B is a diagram illustrating processing contents of an extraction unit; 図4Aは、抽出部の処理内容を示す図である。FIG. 4A is a diagram illustrating the processing contents of an extraction unit; 図4Bは、抽出部の処理内容を示す図である。FIG. 4B is a diagram illustrating the processing contents of the extraction unit; 図5は、抽出部による除外処理を示す図である。FIG. 5 is a diagram illustrating exclusion processing by the extraction unit. 図6は、抽出部の判定処理を示す図である。FIG. 6 is a diagram showing determination processing of the extraction unit. 図7は、算出部による算出処理を示す図である。FIG. 7 is a diagram illustrating calculation processing by a calculation unit; 図8は、判定部による判定処理を示す図である。FIG. 8 is a diagram showing determination processing by the determination unit. 図9は、判定部による継続性の判定処理を示す図である。FIG. 9 is a diagram illustrating continuity determination processing by the determination unit. 図10は、フラグ出力部による面積計算処理を示す図である。FIG. 10 is a diagram showing area calculation processing by the flag output unit. 図11は、実施形態に係る付着物検出装置が実行する付着物の全体処理の処理手順を示すフローチャートである。FIG. 11 is a flowchart illustrating a procedure of overall processing of attached matter executed by the attached matter detection apparatus according to the embodiment. 図12は、実施形態に係る付着物検出装置が実行する付着物の判定処理の処理手順を示すフローチャートである。FIG. 12 is a flowchart illustrating a procedure of an attached matter determination process executed by the attached matter detection device according to the embodiment.

以下、添付図面を参照して、本願の開示する付着物検出装置および付着物検出方法の実施形態を詳細に説明する。なお、以下に示す実施形態により本発明が限定されるものではない。 DETAILED DESCRIPTION OF THE INVENTION Embodiments of the attached matter detection device and the attached matter detection method disclosed in the present application will be described in detail below with reference to the accompanying drawings. In addition, this invention is not limited by embodiment shown below.

まず、図1を用いて、実施形態に係る付着物検出方法の概要について説明する。図1は、実施形態に係る付着物検出方法の概要を示す図である。なお、図1には、例えば、車載カメラ(撮像装置の一例)のレンズに雨滴等の水滴が付着した状態で撮像された撮像画像Iを示している。 First, with reference to FIG. 1, an outline of an attached matter detection method according to an embodiment will be described. FIG. 1 is a diagram showing an outline of an attached matter detection method according to an embodiment. Note that FIG. 1 shows a captured image I captured with water droplets such as raindrops adhering to the lens of an in-vehicle camera (an example of an imaging device), for example.

カメラのレンズに、泥や、埃、雨滴、雪片等の付着物が付着すると、撮像画像Iから車両の周囲の情報、例えば、駐車枠や、他車両や、人の情報を取得できず、駐車枠や、他車両や、人などを正確に検出することができなくなるおそれがある。なお、付着物は、泥、埃、雨滴および雪片に限定されるものではなく、付着物の領域がぼやけた領域となる付着物であればよい。 When dirt, dust, raindrops, snowflakes, and other substances adhere to the lens of the camera, information about the vehicle surroundings, such as parking frames, other vehicles, and people, cannot be obtained from the captured image I. There is a risk that it will not be possible to accurately detect frames, other vehicles, people, and the like. Note that the attached matter is not limited to mud, dust, raindrops, and snowflakes, and any attached matter may be used as long as the area of the attached matter becomes a blurred area.

しかしながら、従来は、レンズに付着物が付着していないにも関わらず、付着物を誤検出するおそれがあった。そのようなケースとして、室内照明によって照らされた路面反射を誤検出する場合がある。具体的には、撮像画像における路面反射(特に路面が凹凸の少ないつるつるな状態)の輝度の特徴と、雨滴等のぼやけた付着物領域の輝度の特徴とが類似しているため、路面反射の領域を付着物領域として誤検出するおそれがあった。 Conventionally, however, there is a risk of erroneous detection of adhering matter even though no adhering matter adheres to the lens. One such case is erroneous detection of road surface reflections illuminated by interior lighting. Specifically, since the characteristics of the brightness of the road surface reflection (particularly when the road surface is smooth with little unevenness) in the captured image are similar to the brightness characteristics of the area of blurred deposits such as raindrops, There is a possibility that the area is erroneously detected as an adhering matter area.

そこで、実施形態に係る付着物検出装置1(図2参照)は、付着物検出方法を実行することで、路面反射の領域と付着物領域とを高精度に判別する。 Therefore, the adhering matter detection device 1 (see FIG. 2) according to the embodiment performs the adhering matter detection method to distinguish between the road surface reflection area and the adhering matter area with high accuracy.

具体的には、まず、実施形態に係る付着物検出方法では、撮像画像Iの各画素から検出されるエッジに基づき、カメラのレンズに付着した付着物に対応する付着物領域の候補となる候補領域100を抽出する(ステップS1)。 Specifically, first, in the adhering matter detection method according to the embodiment, based on the edge detected from each pixel of the captured image I, candidates for the adhering matter area corresponding to the adhering matter adhering to the lens of the camera are detected. A region 100 is extracted (step S1).

実施形態に係る付着物検出方法では、例えば、パターンマッチング等のマッチング処理により、雨滴等の円形状の輪郭を含む矩形状の領域を候補領域100として抽出する。 In the attached matter detection method according to the embodiment, for example, a rectangular area including a circular contour such as a raindrop is extracted as the candidate area 100 by matching processing such as pattern matching.

つづいて、実施形態に係る付着物検出方法では、抽出した候補領域100における所定の内部領域200において所定方向に連続する複数画素の輝度変化量を算出する(ステップS2)。 Subsequently, in the attached matter detection method according to the embodiment, luminance change amounts of a plurality of pixels that are continuous in a predetermined direction in a predetermined internal region 200 in the extracted candidate region 100 are calculated (step S2).

図1では、候補領域100において、撮像画像Iの中央領域に内部領域200を設定するとともに、垂直方向に連続する3画素の輝度変化量を算出する。また、輝度変化量は、複数画素における輝度の差分値である。なお、3画素について、2度の差分計算を行った結果を輝度変化量とするが、かかる点については後述する。 In FIG. 1, in the candidate area 100, an internal area 200 is set in the central area of the captured image I, and the luminance change amount of three pixels that are consecutive in the vertical direction is calculated. Also, the luminance change amount is a luminance difference value in a plurality of pixels. It should be noted that the luminance change amount is obtained by performing two difference calculations for three pixels, but this point will be described later.

つづいて、実施形態に係る付着物検出方法では、算出した輝度変化量のヒストグラムを作成し、当該ヒストグラムに基づいて候補領域100が付着物領域であるか否かを判定する(ステップS3)。 Subsequently, in the adhered substance detection method according to the embodiment, a histogram of the calculated luminance change amount is created, and based on the histogram, it is determined whether or not the candidate region 100 is a adhered substance region (step S3).

図1の下段では、横軸である階級を輝度変化量とし、縦軸である度数を領域度数としたヒストグラムを示している。なお、領域度数とは、複数画素の数に対応した数であり、1つの度数が1つの複数画素に対応している。言い換えれば、1つの度数は、1つの複数画素における輝度変化量(すなわち、1つの輝度変化量)に対応している。また、領域度数は、度数総和が所定値となるよう正規化した度数である。 The lower part of FIG. 1 shows a histogram in which the class on the horizontal axis is the luminance change amount and the frequency on the vertical axis is the area frequency. Note that the area frequency is a number corresponding to the number of pixels, and one frequency corresponds to one pixel. In other words, one frequency corresponds to a luminance change amount (ie, one luminance change amount) in one plurality of pixels. Also, the area frequency is a frequency normalized so that the sum of the frequencies is a predetermined value.

実施形態に係る付着物検出方法では、ヒストグラムにおいて、輝度変化量が第1の範囲にある輝度変化量の数と、第1の範囲よりも輝度変化量が大きい第2の範囲にある輝度変化量の数とに基づいて付着物領域の判定を行う。なお、輝度変化量の数は、1つの複数画素を1単位とする複数画素の単位数と言い換えることもできる。 In the attached matter detection method according to the embodiment, in the histogram, the number of luminance change amounts whose luminance change amount is in the first range and the luminance change amount in the second range where the luminance change amount is larger than that of the first range are counted. Determination of the adhering matter region is performed based on the number of . Note that the number of luminance change amounts can also be rephrased as the number of units of a plurality of pixels, with one plurality of pixels being one unit.

例えば、第1の範囲の領域度数(輝度変化量の数)が多いほど、候補領域100は、画像の輝度変化の箇所が少ないのっぺりした状態となり、第2の範囲の領域度数(輝度変化量の数)が多いほど、候補領域100は、画像の輝度変化の箇所が多いざらざらした状態となる。 For example, the higher the area frequency (the number of luminance change amounts) in the first range, the more the candidate area 100 is in a dull state with fewer luminance change locations in the image, and the second range area frequency (the number of luminance change amounts). number), the candidate area 100 will be in a rougher state where there are more places where the luminance changes in the image.

詳細は後述するが、第1の範囲の領域度数が多いほど、雨滴等の付着物領域の特徴に類似し、第2の範囲の領域度数が多いほど、路面反射の特徴に類似する。これは、路面にできた傷や汚れ等により第2の範囲の領域度数が多くなるためであり、雨滴の場合には、このような特徴が見られないため、第2の範囲の領域度数が少なくなる。 Although the details will be described later, the higher the area frequency of the first range, the more similar it is to the feature of a deposit area such as raindrops, and the higher the area frequency of the second range, the more similar it is to the feature of road surface reflection. This is because the area frequency of the second range increases due to scratches, stains, etc. on the road surface. less.

このように、実施形態に係る付着物検出方法では、第1の範囲の輝度変化量の数と、第2の範囲の輝度変化量の数とに基づいて付着物領域を判定することで、路面反射の領域と、付着物領域とを高精度に判別できる。すなわち、実施形態に係る付着物検出方法によれば、付着物を高精度に検出することができる。 As described above, in the method for detecting an adhering matter according to the embodiment, the adhering matter area is determined based on the number of luminance variations in the first range and the number of luminance variations in the second range. A reflection area and an adhering matter area can be discriminated with high accuracy. That is, according to the attached matter detection method according to the embodiment, the attached matter can be detected with high accuracy.

次に、図2を用いて、実施形態に係る付着物検出装置1の構成について説明する。図2は、実施形態に係る付着物検出装置1の構成を示すブロック図である。図2に示すように、実施形態に係る付着物検出装置1は、カメラ10と、車速センサ11と、各種機器50とに接続される。なお、図2では、付着物検出装置1は、カメラ10と、各種機器50とは別体で構成される場合を示したが、これに限らず、カメラ10および各種機器50の少なくとも一方と一体で構成されてもよい。 Next, the configuration of the adhering matter detection device 1 according to the embodiment will be described with reference to FIG. FIG. 2 is a block diagram showing the configuration of the adhering matter detection device 1 according to the embodiment. As shown in FIG. 2 , the attached matter detection device 1 according to the embodiment is connected to a camera 10 , a vehicle speed sensor 11 and various devices 50 . Although FIG. 2 shows a case where the adhering matter detection device 1 is configured separately from the camera 10 and the various devices 50, it is not limited to this, and may be integrated with at least one of the camera 10 and the various devices 50. may consist of

カメラ10は、たとえば、魚眼レンズ等のレンズと、CCD(Charge Coupled Device)やCMOS(Complementary Metal Oxide Semiconductor)などの撮像素子とを備えた車載カメラである。カメラ10は、例えば、車両の前後方、側方の様子を撮像可能な位置にそれぞれ設けられ、撮像された撮像画像Iを付着物検出装置1へ出力する。 The camera 10 is, for example, an in-vehicle camera that includes a lens such as a fisheye lens and an imaging device such as a CCD (Charge Coupled Device) or a CMOS (Complementary Metal Oxide Semiconductor). The cameras 10 are provided, for example, at positions capable of capturing images of the front, rear, and sides of the vehicle, and output captured images I to the adhering matter detection device 1 .

車速センサ11は、車両の速度(車速)を検出するセンサである。車速センサ11は、検出した車速の情報を付着物検出装置1へ出力する。なお、車速センサ11を省略して、例えば、付着物検出装置1は、カメラ10の時系列の画像に基づいて車速の情報を算出してもよい。 The vehicle speed sensor 11 is a sensor that detects the speed of the vehicle (vehicle speed). The vehicle speed sensor 11 outputs information on the detected vehicle speed to the adhering matter detection device 1 . Note that the vehicle speed sensor 11 may be omitted and, for example, the adhering matter detection device 1 may calculate vehicle speed information based on time-series images from the camera 10 .

各種機器50は、付着物検出装置1の検出結果を取得して、車両の各種制御を行う機器である。各種機器50は、例えば、カメラ10のレンズに付着物が付着していることや、ユーザによる付着物の拭き取り指示を通知する表示装置や、流体や気体等をレンズに向かって噴射して付着物を除去する除去装置、自動運転等を制御する車両制御装置を含む。 The various devices 50 are devices that acquire detection results of the adhering matter detection device 1 and perform various vehicle controls. The various devices 50 include, for example, a display device that notifies that an adhering substance is attached to the lens of the camera 10 and a user's instruction to wipe off the adhering matter, and a display device that injects fluid, gas, or the like toward the lens to remove the adhering matter. It includes a removal device that removes dust, a vehicle control device that controls automatic driving, etc.

図2に示すように、実施形態に係る付着物検出装置1は、制御部2と、記憶部3とを備える。制御部2は、画像取得部21と、抽出部22と、算出部23と、判定部24と、フラグ出力部25とを備える。記憶部3は、起伏条件情報31を記憶する。 As shown in FIG. 2 , the adhering matter detection device 1 according to the embodiment includes a control unit 2 and a storage unit 3 . The control unit 2 includes an image acquisition unit 21 , an extraction unit 22 , a calculation unit 23 , a determination unit 24 and a flag output unit 25 . The storage unit 3 stores undulation condition information 31 .

ここで、付着物検出装置1は、たとえば、CPU(Central Processing Unit)、ROM(Read Only Memory)、RAM(Random Access Memory)、データフラッシュ、入出力ポートなどを有するコンピュータや各種の回路を含む。 Here, the adhering matter detection device 1 includes, for example, a computer and various circuits having a CPU (Central Processing Unit), ROM (Read Only Memory), RAM (Random Access Memory), data flash, input/output ports, and the like.

コンピュータのCPUは、たとえば、ROMに記憶されたプログラムを読み出して実行することによって、制御部2の画像取得部21、抽出部22、算出部23、判定部24およびフラグ出力部25として機能する。 The CPU of the computer functions as the image acquisition section 21, the extraction section 22, the calculation section 23, the determination section 24, and the flag output section 25 of the control section 2 by reading and executing programs stored in the ROM, for example.

また、制御部2の画像取得部21、抽出部22、算出部23、判定部24およびフラグ出力部25の少なくともいずれか一つまたは全部をASIC(Application Specific Integrated Circuit)やFPGA(Field Programmable Gate Array)等のハードウェアで構成することもできる。 Further, at least one or all of the image acquisition unit 21, the extraction unit 22, the calculation unit 23, the determination unit 24, and the flag output unit 25 of the control unit 2 may be an ASIC (Application Specific Integrated Circuit) or an FPGA (Field Programmable Gate Array). ) or the like.

また、記憶部3は、たとえば、RAMやデータフラッシュに対応する。RAMやデータフラッシュは、起伏条件情報31や、各種プログラムの情報等を記憶することができる。なお、付着物検出装置1は、有線や無線のネットワークで接続された他のコンピュータや可搬型記録媒体を介して上記したプログラムや各種情報を取得することとしてもよい。 Also, the storage unit 3 corresponds to, for example, a RAM or a data flash. The RAM and data flash can store the undulation condition information 31, various program information, and the like. Note that the adhering matter detection apparatus 1 may acquire the above-described programs and various information via another computer or portable recording medium connected via a wired or wireless network.

記憶部3に記憶された起伏条件情報31は、後述の抽出部22による処理の基準となる条件を含む情報であり、例えば、輝度分布(輝度平均の分布)の起伏のパターン条件を含む。なお、パターン条件とは、輝度平均の分布の起伏変化の変化パターンや、輝度分布における各画素(単位領域R)がとり得る輝度の閾値範囲である。なお、起伏条件情報31を用いた処理については後述する。 The undulation condition information 31 stored in the storage unit 3 is information including conditions that serve as a reference for processing by the extraction unit 22 described later, and includes, for example, undulation pattern conditions of luminance distribution (distribution of average luminance). It should be noted that the pattern condition is a change pattern of undulation change in the average luminance distribution, or a luminance threshold range that each pixel (unit region R) in the luminance distribution can take. Processing using the undulation condition information 31 will be described later.

制御部2は、カメラ10から取得した撮像画像Iの各画素から検出されるエッジに基づき、付着物領域の候補領域100を抽出し、抽出した候補領域100に設定した内部領域200に含まれる複数画素の輝度変化量に基づいて、候補領域100が付着物領域であるか否かを判定する。 The control unit 2 extracts a candidate area 100 for the adhering matter area based on the edge detected from each pixel of the captured image I obtained from the camera 10, and extracts a plurality of candidate areas 100 included in the internal area 200 set as the extracted candidate area 100. Whether or not the candidate area 100 is a deposit area is determined based on the luminance change amount of the pixel.

画像取得部21は、カメラ10で撮像された画像を取得し、現在の撮像画像Iである現在フレームを生成(取得)する。具体的には、画像取得部21は、取得した画像における各画素を輝度に応じて白から黒までの各階調に変換するグレースケール化処理を行う。 The image acquisition unit 21 acquires an image captured by the camera 10 and generates (acquires) a current frame, which is the current captured image I. Specifically, the image acquisition unit 21 performs grayscaling processing for converting each pixel in the acquired image into each gradation from white to black according to the luminance.

また、画像取得部21は、取得した画像に画素の間引き処理を行い、取得した画像よりもサイズが小さい画像を生成する。また、画像取得部21は、間引き処理を施した画像に基づいて、各画素における画素値の和および二乗和の積分画像である現在フレームを生成する。なお、画素値とは、画素の輝度やエッジに対応する情報である。 In addition, the image acquisition unit 21 performs pixel thinning processing on the acquired image to generate an image smaller in size than the acquired image. The image acquisition unit 21 also generates the current frame, which is an integral image of the sum of the pixel values and the sum of the squares of the pixel values of each pixel, based on the thinned image. Note that the pixel value is information corresponding to the luminance and edge of the pixel.

このように、付着物検出装置は、取得した画像に対して間引き処理を行い、積分画像を生成することで、後段における処理の計算を高速化できるため、付着物を検出するための処理時間を短くすることができる。 In this way, the adhering matter detection apparatus thins out the acquired image and generates an integral image, thereby speeding up the processing calculations in the latter stage. can be shortened.

なお、画像取得部21は、各画素について、平均化フィルタなどの平滑化フィルタを用いて平滑化処理を行ってもよい。また、画像取得部21は、間引き処理を行わず、取得した画像と同じサイズの現在フレームを生成してもよい。また、以下では、現在フレームを撮像画像Iと記載する場合がある。 Note that the image acquisition unit 21 may perform smoothing processing on each pixel using a smoothing filter such as an averaging filter. Alternatively, the image acquiring unit 21 may generate a current frame of the same size as the acquired image without performing the thinning process. Also, the current frame may be referred to as a captured image I below.

抽出部22は、画像取得部21が取得した撮像画像Iの各画素から検出されるエッジに基づき、撮像画像Iの中から付着物領域の候補領域100を抽出する。具体的には、まず、抽出部22は、撮像画像Iにおける各画素の輝度およびエッジ情報を抽出する。各画素の輝度は、例えば、0~255のパラメータで表現される。 The extracting unit 22 extracts a candidate area 100 for the adhering matter area from the captured image I based on the edge detected from each pixel of the captured image I acquired by the image acquiring unit 21 . Specifically, first, the extraction unit 22 extracts the luminance and edge information of each pixel in the captured image I. FIG. The brightness of each pixel is represented by a parameter from 0 to 255, for example.

また、抽出部22は、各画素の輝度に基づいてエッジ検出処理を行って、各画素について、X軸方向(撮像画像Iの左右方向)のエッジと、Y軸方向(撮像画像Iの上下方向)のエッジとを検出する。エッジ検出処理には、例えば、Sobelフィルタや、Prewittフィルタ等の任意のエッジ検出フィルタを用いることができる。 In addition, the extraction unit 22 performs edge detection processing based on the luminance of each pixel, and detects an edge in the X-axis direction (horizontal direction of the captured image I) and an edge in the Y-axis direction (vertical direction of the captured image I) for each pixel. ) edges. Any edge detection filter such as a Sobel filter or a Prewitt filter can be used for edge detection processing.

そして、抽出部22は、X軸方向のエッジと、Y軸方向のエッジとに基づき、三角関数を用いることで、画素のエッジ角度およびエッジ強度の情報を含むベクトルをエッジ情報として検出する。具体的には、エッジ角度は、ベクトルの向きによって表現され、エッジ強度は、ベクトルの長さによって表現される。 Then, the extraction unit 22 detects, as edge information, a vector including information on the edge angle and edge strength of the pixel by using a trigonometric function based on the edge in the X-axis direction and the edge in the Y-axis direction. Specifically, the edge angle is represented by the orientation of the vector, and the edge strength is represented by the length of the vector.

そして、抽出部22は、予め作成された付着物の輪郭を示すテンプレート情報と、検出したエッジ情報とのマッチング処理(テンプレートマッチング)を行い、テンプレート情報と類似するエッジ情報を抽出する。そして、抽出部22は、抽出したエッジ情報の領域、すなわち、付着物の輪郭を含む矩形状の領域である候補領域100を抽出する。 Then, the extraction unit 22 performs a matching process (template matching) between the template information created in advance indicating the outline of the adhering matter and the detected edge information, and extracts edge information similar to the template information. Then, the extracting unit 22 extracts the area of the extracted edge information, that is, the candidate area 100 which is a rectangular area including the outline of the adhering matter.

なお、抽出部22は、マッチング処理により抽出した候補領域100の情報を算出部23へ出力してもよく、以下に示す抽出処理により、さらに絞り込んだ候補領域100の情報を算出部23へ出力してもよい。 Note that the extraction unit 22 may output information on the candidate region 100 extracted by the matching process to the calculation unit 23, and output information on the candidate region 100 further narrowed down by the extraction process described below to the calculation unit 23. may

つづいて、抽出部22は、抽出した候補領域100において連続する複数の画素列に関し、所定画素数を単位とする単位領域Rに分割し、単位領域R毎に輝度の平均値および輝度の標準偏差を算出する。 Subsequently, the extracting unit 22 divides a plurality of continuous pixel rows in the extracted candidate region 100 into unit regions R each having a predetermined number of pixels as a unit, and calculates the average luminance value and the standard deviation of luminance for each unit region R. Calculate

ここで、図3A~図4Bを用いて、抽出部22の処理内容について説明する。図3A~図4Bは、抽出部22の処理内容を示す図である。 Here, processing contents of the extraction unit 22 will be described with reference to FIGS. 3A to 4B. 3A to 4B are diagrams showing the processing contents of the extraction unit 22. FIG.

図3Aおよび図3Bに示すように、まず、抽出部22は、候補領域100において連続する複数の画素列を帯領域110として設定する。かかる帯領域110は、後段の単位領域Rの分割処理および輝度情報(平均値および標準偏差)の算出処理の対象となる領域である。 As shown in FIGS. 3A and 3B , first, the extraction unit 22 sets a plurality of continuous pixel columns in the candidate region 100 as the band region 110 . The band area 110 is an area to be subjected to the subsequent process of dividing the unit area R and the process of calculating luminance information (average value and standard deviation).

具体的には、図3Aに示すように、まず、抽出部22は、候補領域100における水平方向の3列の画素列H1~H3と、垂直方向の3列の画素列V1~V3とを選択する。そして、抽出部22は、選択した各画素列について、当該画素列を含む複数の画素列を帯領域110として設定する。 Specifically, as shown in FIG. 3A, first, the extraction unit 22 selects three horizontal pixel columns H1 to H3 and three vertical pixel columns V1 to V3 in the candidate region 100. do. Then, the extracting unit 22 sets a plurality of pixel rows including the selected pixel row as the strip region 110 .

図3Bでは、水平方向の画素列H1を含む帯領域110を示している。なお、垂直方向の画素列V1~V3を含む帯領域110の設定方法については、以下に説明する水平方向の画素列H1を含む帯領域110の設定方法とほぼ同様(画素列が水平方向か垂直方向かの違いのみ)であるため、記載を省略する。 FIG. 3B shows a strip region 110 containing a horizontal row of pixels H1. Note that the setting method of the band region 110 including the vertical pixel columns V1 to V3 is substantially the same as the setting method of the band region 110 including the horizontal pixel column H1 described below (if the pixel column is horizontal or vertical). direction), so the description is omitted.

図3Bに示すように、抽出部22は、選択した画素列H1を中心にして、垂直方向に連続する複数の画素列を帯領域110として設定する。換言すれば、抽出部22は、選択した画素列H1と当該画素列H1に平行な画素列であって、互いに隣接する複数の画素列とを帯領域110として設定する。 As shown in FIG. 3B , the extracting unit 22 sets a plurality of vertically continuous pixel rows as a band region 110 centering on the selected pixel row H1. In other words, the extraction unit 22 sets the selected pixel line H1 and a plurality of pixel lines parallel to the selected pixel line H1 and adjacent to each other as the band region 110 .

図3Bでは、水平方向の画素列H1に対して垂直方向の上側および下側それぞれに連続する3本の画素列(計6本の画素列)と、1本の画素列H1とを含む計7本の画素列を帯領域110として設定する。 In FIG. 3B, a total of 7 pixel columns including 3 pixel columns (total of 6 pixel columns) continuous to the vertical upper side and lower side of the horizontal pixel column H1 and 1 pixel column H1. A row of pixels is set as a band region 110 .

なお、帯領域110における画素列H1の位置は、帯領域110の中心でなくてもよく、垂直方向の上側および下側のいずれかに寄った位置であってもよい。また、画素列H1に対して垂直方向の上側および下側それぞれに連続する画素列は、2本以下でも、4本以上でもよい。 Note that the position of the pixel row H1 in the strip region 110 may not be the center of the strip region 110, and may be located at either the upper side or the lower side in the vertical direction. In addition, the number of pixel columns that are continuous above and below the pixel column H1 in the vertical direction may be two or less, or four or more.

また、選択する画素列H1~H3、V1~V3は、水平方向の画素列H1~H3、または、垂直方向の画素列V1~V3のいずれか一方の方向の画素列であってもよい。また、各方向において選択する画素列H1~H3、V1~V3の本数は、3本に限らず、2本以下や、4本以上であってもよい。 The pixel columns H1 to H3 and V1 to V3 to be selected may be pixel columns in either one of the horizontal pixel columns H1 to H3 and the vertical pixel columns V1 to V3. Further, the number of pixel columns H1 to H3 and V1 to V3 selected in each direction is not limited to three, and may be two or less or four or more.

つづいて、図4Aに示すように、抽出部22は、設定した帯領域110において所定画素数を単位とする単位領域R1~R8に分割し、単位領域R1~R8毎に輝度の平均値および輝度の標準偏差を算出する。 Subsequently, as shown in FIG. 4A, the extraction unit 22 divides the set band region 110 into unit regions R1 to R8 each having a predetermined number of pixels as a unit. Calculate the standard deviation of

なお、図4Aでは、抽出部22は、帯領域110を等間隔(同じ画素数)で分割した8つの単位領域R1~R8を設定する場合を示しているが、単位領域Rの数は6つ以下でも、9つ以上でもよい。また、各単位領域Rに含まれる画素数は同じであっても、異なってもよい。 Note that FIG. 4A shows a case where the extraction unit 22 sets eight unit regions R1 to R8 obtained by dividing the band region 110 at equal intervals (same number of pixels), but the number of unit regions R is six. It may be less than or equal to nine or more. Also, the number of pixels included in each unit region R may be the same or different.

そして、抽出部22は、算出した輝度の標準偏差が所定値未満である場合、帯領域110における単位領域Rの代表値として輝度の平均値を設定する。 Then, when the calculated standard deviation of luminance is less than a predetermined value, the extraction unit 22 sets the average luminance value as the representative value of the unit regions R in the band region 110 .

一方、図4Bに示すように、抽出部22は、算出した輝度の標準偏差が所定値以上である場合、帯領域110における輝度平均の分布として、単位領域Rの輝度平均に代えて、所定の異常値を単位領域Rの代表値に設定する。 On the other hand, as shown in FIG. 4B , when the calculated standard deviation of luminance is equal to or greater than a predetermined value, the extraction unit 22 sets the distribution of the luminance average in the band region 110 to a predetermined An abnormal value is set to a representative value of the unit region R.

図4Bに示す例では、算出部23は、単位領域R8について、輝度の標準偏差が所定値以上である場合、単位領域R8の輝度の平均値に代えて、所定の異常値(例えば、最低値やゼロ等)を単位領域R8の代表値に設定する。 In the example shown in FIG. 4B , when the standard deviation of the brightness of the unit region R8 is equal to or greater than a predetermined value, the calculation unit 23 replaces the average value of the brightness of the unit region R8 with a predetermined abnormal value (for example, the minimum value , zero, etc.) is set as a representative value of the unit area R8.

この異常値は、後段処理において付着物領域ではないと判定するための値である。例えば、抽出部22は、後段処理において、輝度平均の分布が所定のパターンに合致するか否かで付着物領域を判定する場合、かかる所定のパターンに合致しないような異常値を設定する。 This abnormal value is a value for determining that the area is not an adhering matter area in the post-processing. For example, when the extracting unit 22 determines an adhering matter area based on whether or not the average luminance distribution matches a predetermined pattern in the post-processing, it sets an abnormal value that does not match the predetermined pattern.

このように、後段処理において付着物領域ではないと判定されるような異常値を設定することで、新たな処理を追加することなく付着物領域でない候補領域100を除くことができるため、処理が複雑化することを抑制できる。 In this way, by setting an abnormal value that is determined to be not an adhering matter region in the post-processing, the candidate region 100 that is not an adhering matter region can be removed without adding new processing. Complications can be suppressed.

なお、抽出部22は、単位領域Rの代表値として、輝度の平均値を用いたが、例えば、単位領域R1~R8毎に輝度のヒストグラムを作成し、ヒストグラムにおける最頻値や中央値、平均値等を代表値として設定してもよい。 Although the extraction unit 22 uses the average luminance value as the representative value of the unit regions R, for example, a luminance histogram is created for each of the unit regions R1 to R8, and the mode, median, and average A value or the like may be set as a representative value.

つづいて、抽出部22は、単位領域R毎に算出した輝度平均の分布に基づいて候補領域100をさらに絞り込む。 Subsequently, the extraction unit 22 further narrows down the candidate regions 100 based on the distribution of the luminance average calculated for each unit region R. FIG.

具体的には、まず、抽出部22は、候補領域100に含まれる画素の輝度分布(輝度平均の分布)の起伏が所定の除外条件を満たす場合、候補領域100を付着物領域の判定処理の対象から除外する。 Specifically, first, if the unevenness of the luminance distribution (distribution of average luminance) of the pixels included in the candidate region 100 satisfies a predetermined exclusion condition, the extraction unit 22 regards the candidate region 100 as the adhering matter region determination process. Exclude from coverage.

ここで、抽出部22による候補領域100の除外処理について図5を用いて説明する。図5は、抽出部22による除外処理を示す図である。図5では、所定の候補領域100から算出された各帯領域110の輝度平均の分布を示している。図5では、候補領域100に設定された各画素列H1~H3、V1~V3に対応する帯領域110毎の輝度平均の分布を示している。例えば、図5において「H1」のグラフは、画素列H1を含む帯領域110における単位領域Rの輝度平均の分布を示す。 Here, the exclusion processing of the candidate region 100 by the extraction unit 22 will be described with reference to FIG. FIG. 5 is a diagram showing exclusion processing by the extraction unit 22. As shown in FIG. FIG. 5 shows the average luminance distribution of each band area 110 calculated from the predetermined candidate area 100 . FIG. 5 shows the average luminance distribution for each band region 110 corresponding to each pixel row H1 to H3 and V1 to V3 set in the candidate region 100. FIG. For example, the graph of "H1" in FIG. 5 shows the distribution of the luminance average of the unit area R in the band area 110 including the pixel row H1.

抽出部22は、各画素列H1~H3、V1~V3に対応する帯領域110毎の輝度平均の分布における起伏が所定の除外条件を満たす場合、候補領域100を付着物領域の判定処理の対象から除外する。 If the undulations in the distribution of the average brightness of each band region 110 corresponding to each of the pixel rows H1 to H3 and V1 to V3 satisfy a predetermined exclusion condition, the extraction unit 22 selects the candidate region 100 as the target of the adhering matter region determination processing. Exclude from

例えば、抽出部22は、帯領域110に含まれる単位領域Rの代表値に異常値が含まれる場合、候補領域100を付着物領域の判定処理の対象から除外する。換言すれば、抽出部22は、帯領域110において隣接する2つの単位領域Rの代表値の差分が所定値以上となる場合、候補領域100を付着物領域の判定処理の対象から除外する。 For example, if the representative value of the unit regions R included in the band region 110 includes an abnormal value, the extraction unit 22 excludes the candidate region 100 from the target of the adhering matter region determination processing. In other words, when the difference between the representative values of two adjacent unit regions R in the band region 110 is greater than or equal to a predetermined value, the extraction unit 22 excludes the candidate region 100 from the adhering matter region determination processing.

さらに言い換えれば、抽出部22は、帯領域110における単位領域Rの中に、代表値の標準偏差が所定値以上の単位領域R(つまり、異常値が設定された単位領域R)が含まれる場合、候補領域100を付着物領域の判定処理の対象から除外する。 In other words, if the unit regions R in the band region 110 include a unit region R in which the standard deviation of the representative value is equal to or greater than a predetermined value (that is, the unit region R in which an abnormal value is set) , the candidate region 100 is excluded from the adhering matter region determination processing.

すなわち、抽出部22は、輝度平均の分布における起伏の一部が、異常値により急激に凹凸した形状である場合、除外条件を満たすとして、当該候補領域100を付着物領域の判定処理の対象から除外する。このように、抽出部22は、異常値に基づいて除外処理を行うこと、付着物でない領域を高精度に除去できる。 That is, if part of the undulations in the distribution of the average luminance has a shape that is abruptly uneven due to an abnormal value, the extraction unit 22 determines that the exclusion condition is satisfied, and removes the candidate region 100 from the target of the adhering matter region determination processing. exclude. In this way, the extraction unit 22 can perform the exclusion process based on the abnormal value and remove the non-attachment area with high accuracy.

また、図5の画素列V1~V3のグラフに示すように、抽出部22は、単位領域Rの輝度平均の分布における起伏が3つのグラフとも平坦、つまり、垂直方向の画素列V1~V3に対応する3つの帯領域110すべてについて、輝度平均の起伏変化が所定の範囲内である場合、候補領域100を付着物領域の判定処理の対象から除外する。具体的には、候補領域100がバックランプの光が壁に反射した場合、単位領域Rの輝度平均の分布が平坦になる傾向にあることが実験により判明した。そこで、輝度平均の起伏変化が所定の範囲内である場合は候補領域100がバックランプの反射で生じたものであると判定し、付着物領域400の判定処理の対象から除外する。 Further, as shown in the graphs of the pixel columns V1 to V3 in FIG. 5, the extracting unit 22 detects that the undulations in the average luminance distribution of the unit region R are flat in all three graphs, that is, in the pixel columns V1 to V3 in the vertical direction. If the undulation change of the luminance average for all three corresponding band regions 110 is within a predetermined range, the candidate region 100 is excluded from the object region determination processing. Specifically, it has been found by experiments that when the candidate region 100 reflects the light from the back lamp on the wall, the average luminance distribution of the unit region R tends to be flat. Therefore, if the undulation change of the luminance average is within a predetermined range, it is determined that the candidate area 100 is caused by the reflection of the back lamp, and the object area 400 is excluded from the object of determination processing.

なお、図5では、垂直方向の画素列V1~V3における3つの輝度分布が平坦である場合を示したが、水平方向の画素列H1~H3における3つの輝度分布が平坦である場合や、垂直方向および水平方向の画素列H1~H3、V1~V3における6つの輝度分布が平坦である場合に、候補領域100を付着物領域の判定処理の対象から除外してもよい。つまり、抽出部22は、候補領域100における垂直方向および水平方向の画素列のうち、少なくとも一方の画素列の輝度分布の起伏変化が所定の範囲内である場合、除外条件を満たすとし、候補領域100を付着物領域の判定処理の対象から除外する。 Note that FIG. 5 shows the case where the three luminance distributions in the vertical pixel rows V1 to V3 are flat. If the six luminance distributions in the horizontal and horizontal pixel rows H1 to H3 and V1 to V3 are flat, the candidate area 100 may be excluded from the adhering matter area determination process. In other words, the extraction unit 22 determines that the exclusion condition is satisfied when at least one of the vertical and horizontal pixel rows in the candidate region 100 has an undulating change in luminance distribution within a predetermined range, and the candidate region 100 satisfies the exclusion condition. 100 is excluded from the target of the adhering matter region determination processing.

このように、抽出部22は、候補領域100における輝度分布の起伏が所定の除外条件を満たす場合に、かかる候補領域100を付着物領域の判定処理の対象から除外することで、付着物領域の誤判定を減らすことができる。すなわち、付着物を高精度に検出することができる。 In this manner, when the undulations of the luminance distribution in the candidate region 100 satisfy a predetermined exclusion condition, the extraction unit 22 excludes the candidate region 100 from the target of the adhering matter region determination processing, thereby removing the adhering matter region. Misjudgments can be reduced. That is, adhering matter can be detected with high accuracy.

つづいて、抽出部22は、除外条件により除外した候補領域100以外の候補領域100について、さらに絞り込むための処理を行う。ここで、図6を用いて、抽出部22による処理について説明する。 Subsequently, the extraction unit 22 performs processing for further narrowing down the candidate regions 100 other than the candidate regions 100 excluded by the exclusion condition. Here, processing by the extraction unit 22 will be described with reference to FIG.

図6は、抽出部22の判定処理を示す図である。まず、図6に示すように、抽出部22は、まず、各帯領域110について、隣接する単位領域R1~R8の輝度平均の変化量D1~D7を算出する。 FIG. 6 is a diagram showing determination processing of the extraction unit 22. As shown in FIG. First, as shown in FIG. 6, the extraction unit 22 first calculates, for each band region 110, the amounts of change D1 to D7 in the luminance average of adjacent unit regions R1 to R8.

そして、抽出部22は、候補領域100における複数の帯領域110のうち、単位領域Rの輝度平均の分布における起伏変化のパターンが所定の変化パターンを満たす候補領域100を抽出する。例えば、抽出部22は、変化量D1~D7の各値と、記憶部3に記憶された起伏条件情報31に含まれる変化パターンの各値とを比較して判定処理を行う。なお、起伏条件情報31に含まれる変化パターンとは、変化量D1~D7のとり得る最大値および最小値の閾値範囲である。 Then, the extraction unit 22 extracts the candidate region 100 in which the pattern of undulation change in the distribution of the luminance average of the unit region R satisfies a predetermined change pattern from among the plurality of band regions 110 in the candidate region 100 . For example, the extraction unit 22 compares each value of the variation amounts D1 to D7 with each value of the variation pattern included in the undulation condition information 31 stored in the storage unit 3 to perform determination processing. The variation pattern included in the undulation condition information 31 is the threshold range of the maximum and minimum values that the variations D1 to D7 can take.

つまり、抽出部22は、算出した変化量D1~D7の各値が、起伏条件情報31に含まれる変化量D1~D7それぞれの閾値範囲内である候補領域100を抽出する。 In other words, the extracting unit 22 extracts the candidate regions 100 in which the calculated values of the amounts of change D1 to D7 are within the respective threshold ranges of the amounts of change D1 to D7 included in the undulation condition information 31. FIG.

換言すれば、抽出部22は、隣接する単位領域R1~R8の輝度平均の変化量D1~D7のパターンが、起伏条件情報31で設定された閾値範囲である変化パターンを満たす候補領域100を抽出する。 In other words, the extracting unit 22 extracts the candidate region 100 in which the patterns of the amounts of change D1 to D7 in the average brightness of the adjacent unit regions R1 to R8 satisfy the change pattern that is the threshold range set by the undulation condition information 31. do.

また、起伏条件情報31において変化量D1~D7の最大値および最小値を設定して幅をもたせることで、輝度分布の起伏が多少ばらついても、候補領域100として抽出することができる。 In addition, by setting the maximum and minimum values of the variation amounts D1 to D7 in the undulation condition information 31 to provide a range, it is possible to extract the candidate area 100 even if the undulations of the luminance distribution are somewhat uneven.

なお、図6では、起伏条件情報31について、すべての変化量D1~D7の閾値範囲を設定した場合を示したが、例えば、小さいサイズの付着物領域を検出する場合には、変化量D1~D7のうち、一部の変化量の閾値範囲のみを設定してもよい。 FIG. 6 shows a case where threshold ranges for all the variation amounts D1 to D7 are set for the undulation condition information 31. Of D7, only the threshold range of a part of the amount of change may be set.

抽出部22は、抽出した候補領域100の情報を算出部23へ出力する。 The extraction unit 22 outputs the extracted information of the candidate region 100 to the calculation unit 23 .

算出部23は、抽出部22によって抽出された候補領域100における所定の内部領域200において所定方向に連続する複数画素の輝度変化量を算出する。 The calculation unit 23 calculates luminance change amounts of a plurality of pixels that are continuous in a predetermined direction in a predetermined internal region 200 in the candidate region 100 extracted by the extraction unit 22 .

ここで、図7を用いて、算出部23による内部領域200内の輝度変化量の算出処理について説明する。図7は、算出部23による算出処理を示す図である。 Here, the calculation processing of the luminance change amount in the internal region 200 by the calculator 23 will be described with reference to FIG. 7 . FIG. 7 is a diagram showing calculation processing by the calculation unit 23. As shown in FIG.

図7に示すように、算出部23は、まず、抽出された候補領域100に対して内部領域200を設定する。例えば、算出部23は、候補領域100を垂直方向および水平方向それぞれで所定数に分割する。図7では、候補領域100を垂直方向および水平方向それぞれで4分割する場合を示すが、3分割以下でも、5分割以上でもよい。 As shown in FIG. 7 , the calculator 23 first sets an internal region 200 for the extracted candidate region 100 . For example, the calculation unit 23 divides the candidate area 100 into a predetermined number in each of the vertical and horizontal directions. FIG. 7 shows a case where the candidate area 100 is divided into four in each of the vertical direction and the horizontal direction, but may be divided into three or less, or five or more.

そして、算出部23は、所定数に分割した分割領域のうち、中央領域を内部領域200として設定する。図7では、垂直方向および水平方向それぞれで4分割して生成された16の分割領域のうち、中央領域である4つの分割領域を内部領域200として設定する。 Then, the calculation unit 23 sets the central region of the predetermined number of divided regions as the internal region 200 . In FIG. 7 , of the 16 divided areas generated by dividing into four in each of the vertical and horizontal directions, the four central areas are set as the internal areas 200 .

そして、算出部23は、内部領域200において複数画素の輝度変化量を算出する。図7では、算出部23は、垂直方向に連続する3画素の輝度変化量を算出する。これは、路面反射の領域が垂直方向に延びる場合が多いためである。これにより、後段の判定部24により路面反射の領域を高精度に判定することができる。なお、算出部23は、水平方向に連続する複数画素の輝度変化量を算出してもよい。 Then, the calculation unit 23 calculates the amount of change in luminance of multiple pixels in the internal region 200 . In FIG. 7, the calculator 23 calculates the amount of change in brightness of three pixels that are consecutive in the vertical direction. This is because the area of road surface reflection often extends in the vertical direction. As a result, the determination unit 24 in the subsequent stage can determine the area of the road surface reflection with high accuracy. Note that the calculation unit 23 may calculate the amount of change in brightness of a plurality of pixels that are consecutive in the horizontal direction.

まず、算出部23は、垂直方向に隣接する2つの画素の輝度差分値を第1差分として算出する。図7の中段には、1つの第1差分を1マスとし、画素の配列に対応させて2次元状に配列している。つまり、図7の中段において、1つのマスは垂直方向に隣接する2画素の輝度差分値、すなわち第1差分であり、垂直方向に隣接する2つのマスは、3画素から算出された2つの第1差分である。 First, the calculator 23 calculates a luminance difference value between two vertically adjacent pixels as a first difference. In the middle part of FIG. 7, one first difference is defined as one cell, which is arranged two-dimensionally in correspondence with the arrangement of pixels. That is, in the middle part of FIG. 7, one square represents the luminance difference value of two vertically adjacent pixels, that is, the first difference, and two vertically adjacent squares represent two second values calculated from three pixels. 1 difference.

つづいて、算出部23は、垂直方向に連続する2つの第1差分の差分値である第2差分を算出する。図7の下段には、絶対値に変換した1つの第2差分を1マスとし、画素の配列に対応させて2次元状に配列している。つまり、図7の下段において、1つのマスは、3画素から算出された1つの第2差分(輝度変化量)である。換言すれば、第2差分は第1差分の変化量である。 Subsequently, the calculator 23 calculates a second difference, which is a difference value between two first differences that are consecutive in the vertical direction. In the lower part of FIG. 7, one second difference converted into an absolute value is set as one cell and arranged two-dimensionally in correspondence with the arrangement of pixels. That is, in the lower part of FIG. 7, one square is one second difference (luminance change amount) calculated from three pixels. In other words, the second difference is the amount of change in the first difference.

このように、輝度が急激に上下する場合は路面の小さな傷等に起因して発生するケースが考えられ、路面反射の領域である可能性が高い。そこで、算出部23は、第2差分を複数画素の輝度変化量として算出することで、後段の判定部24において、付着物領域であるか路面反射の領域であるかを容易に判定することができる。具体的には、例えば、路面の小さな傷等に起因して、連続する3画素の輝度が急激に上下する領域(図7に示す「180」→「160」→「180」)では、第2差分が高くなる。すなわち、第2差分を算出することで、このような輝度が急激に上下する領域を容易に識別できるようになるため、後述の判定部24において、付着物領域であるか路面反射の領域であるかを容易に判定することができる。 When the luminance fluctuates sharply in this manner, it is likely that the luminance is caused by a small scratch on the road surface, and is highly likely to be a reflection area of the road surface. Therefore, the calculation unit 23 calculates the second difference as the luminance change amount of a plurality of pixels, so that the subsequent determination unit 24 can easily determine whether the area is an adherent area or a road surface reflection area. can. Specifically, for example, in a region where the luminance of three consecutive pixels rapidly rises and falls due to a small scratch on the road surface ("180"→"160"→"180" shown in FIG. 7), the second difference is higher. That is, by calculating the second difference, it becomes possible to easily identify such a region in which the brightness rises and falls rapidly. can be easily determined.

算出部23は、算出結果である第2差分を複数画素の輝度変化量として判定部24へ出力する。 The calculation unit 23 outputs the second difference, which is the calculation result, to the determination unit 24 as the luminance change amount of the plurality of pixels.

なお、算出部23は、第2差分を複数画素の輝度変化量としたが、第1差分を複数画素の輝度変化量としてもよい。第1差分を複数画素の輝度変化量とする場合、複数画素における画素数が2画素以上であればよい。具体的には、2画素の輝度変化量を算出する場合には、算出した1つの第1差分を輝度変化量としてもよく、3画素以上の輝度変化量を算出する場合には、算出した複数の第1差分の平均値を輝度変化量としてもよい。 In addition, although the calculation unit 23 uses the amount of luminance change of a plurality of pixels as the second difference, the amount of luminance change of a plurality of pixels may be used as the first difference. When the first difference is the luminance change amount of a plurality of pixels, the number of pixels in the plurality of pixels should be 2 pixels or more. Specifically, when calculating the luminance change amount of two pixels, one calculated first difference may be used as the luminance change amount. may be used as the luminance change amount.

判定部24は、算出部23によって算出された複数画素の輝度変化量をヒストグラム化することで、候補領域100が付着物領域であるか否かを判定する。ここで、図8を用いて、判定部24による判定処理について説明する。 The determining unit 24 determines whether or not the candidate area 100 is a deposit area by forming a histogram of the luminance change amounts of the plurality of pixels calculated by the calculating unit 23 . Here, determination processing by the determination unit 24 will be described with reference to FIG. 8 .

図8は、判定部24による判定処理を示す図である。図8では、一の内部領域200に含まれる複数の複数画素毎の輝度変化量のヒストグラムを示している。図8に示すヒストグラムでは、横軸を輝度変化量とし、縦軸を領域度数として示している。また、図8では、候補領域100が付着物領域である場合のヒストグラムと、候補領域100が路面反射の領域(付着物以外の領域)である場合のヒストグラムとを示している。 FIG. 8 is a diagram showing determination processing by the determination unit 24. As shown in FIG. FIG. 8 shows a histogram of luminance change amounts for a plurality of pixels included in one internal region 200 . In the histogram shown in FIG. 8, the horizontal axis represents the luminance change amount, and the vertical axis represents the area frequency. In addition, FIG. 8 shows a histogram when the candidate area 100 is the deposit area and a histogram when the candidate area 100 is the road surface reflection area (area other than the deposit).

なお、領域度数とは、複数画素の数に対応した数であり、1つの度数が1つの複数画素に対応している。言い換えれば、1つの度数は、1つの複数画素における輝度変化量(すなわち、1つの輝度変化量)に対応している。また、領域度数は、度数総和が所定値となるよう正規化した度数である。つまり、図8に示すヒストグラムの領域度数の総和は、大きさの異なる各内部領域200間で同じとなる。 Note that the area frequency is a number corresponding to the number of pixels, and one frequency corresponds to one pixel. In other words, one frequency corresponds to a luminance change amount (ie, one luminance change amount) in one plurality of pixels. Also, the area frequency is a frequency normalized so that the sum of the frequencies is a predetermined value. In other words, the sum of the area frequencies of the histogram shown in FIG. 8 is the same between the internal areas 200 having different sizes.

図8に示すように、付着物領域のヒストグラムと、路面反射の領域のヒストグラムとを比較した場合、第1の範囲における領域度数は双方が類似しているものの、第2の範囲において、路面反射の領域の方が、付着物領域に比べて、領域度数の合計がわずかに多い。これは、路面反射の領域では、路面にできた傷や、汚れ等が第2の範囲の領域度数に影響しているためである。 As shown in FIG. 8, when the histogram of the adhering matter area and the histogram of the road surface reflection area are compared, the area frequencies in the first range are similar, but in the second range, the road surface reflection , the total area frequency is slightly higher than that of the deposit area. This is because scratches, stains, etc. on the road surface affect the area frequency of the second range in the area of the road surface reflection.

かかる点に着目して、判定部24は、輝度変化量が第1の範囲にある輝度変化量の数(領域度数)と、第1の範囲よりも輝度変化量が大きい第2の範囲にある輝度変化量の数とに基づいて候補領域100が付着物領域であるか否かを判定する。 Focusing on this point, the determination unit 24 determines the number of luminance variations (region frequency) in which the luminance variation is in the first range, and the number of luminance variations in the second range in which the luminance variation is larger than that in the first range. It is determined whether or not the candidate area 100 is a deposit area based on the number of luminance variations.

具体的には、判定部24は、輝度変化量「0」を最小値とする第1の範囲にある領域度数の和と、第1の範囲の最大値よりも最小値が大きい第2の範囲にある領域度数の和とに基づいて候補領域100が付着物領域であるか否かを判定する。 Specifically, the determining unit 24 determines the sum of the area frequencies in the first range whose minimum value is the amount of change in brightness of "0", and the second range whose minimum value is greater than the maximum value of the first range. It is determined whether or not the candidate region 100 is a deposit region based on the sum of the region frequencies in .

例えば、判定部24は、第1の範囲にある領域度数の和が所定値以上、かつ、第2の範囲にある領域度数の和が所定値未満である場合、候補領域100が付着物領域であると判定する。 For example, when the sum of the area frequencies in the first range is equal to or greater than a predetermined value and the sum of the area frequencies in the second range is less than the predetermined value, the determination unit 24 determines that the candidate area 100 is the adherent area. Determine that there is.

一方、判定部24は、第1の範囲にある領域度数の和が所定値以上、かつ、第2の範囲にある領域度数の和が所定値以上である場合、候補領域100が付着物領域ではない(路面反射領域である)と判定する。 On the other hand, if the sum of the area frequencies in the first range is a predetermined value or more and the sum of the area frequencies in the second range is a predetermined value or more, the determination unit 24 determines that the candidate area 100 is a deposit area. It is determined that there is no road surface reflection area.

これにより、判定部24は、候補領域100の中から、路面反射の領域に対応する領域を除くことができるため、路面反射の領域を付着物領域として誤検出することを抑制することができる。 As a result, the determining unit 24 can exclude the area corresponding to the road surface reflection area from the candidate area 100, thereby suppressing erroneous detection of the road surface reflection area as an adhering matter area.

また、判定部24は、第1の範囲にある領域度数の和が所定値未満である場合には、第2の範囲にある領域度数の和に関わらず、候補領域100が付着物領域ではないと判定する。 Further, if the sum of the area frequencies in the first range is less than a predetermined value, the determination unit 24 determines that the candidate area 100 is not a deposit area regardless of the sum of the area frequencies in the second range. I judge.

そして、判定部24は、候補領域100について付着物領域として継続して判定されたか否かの継続性の判定処理を行う。ここで、判定部24による継続性の判定処理について説明する。 Then, the determination unit 24 performs continuity determination processing to determine whether or not the candidate area 100 has been continuously determined as an adhering matter area. Here, the continuity determination processing by the determination unit 24 will be described.

図9は、判定部24による継続性の判定処理を示す図である。図9では、各候補領域100の状態を管理するためのステートマシンの図を示しており、候補領域100の付着物に関する状態の遷移を示している。 FIG. 9 is a diagram showing continuity determination processing by the determination unit 24 . FIG. 9 shows a diagram of a state machine for managing the state of each candidate area 100, and shows state transitions regarding adhering matter in the candidate area 100. In FIG.

図9に示すように、候補領域100は、「IDLE」、「潜伏」、「付着」および「移動付着」の4つの状態に遷移し得る。 As shown in FIG. 9, candidate region 100 can transition to four states: "IDLE," "latent," "attached," and "move attached."

「IDLE」は、付着物領域として判定されていない状態を示す。すなわち、「IDLE」は、付着物領域として継続していない候補領域100であることを示す。 "IDLE" indicates a state in which the area is not determined as an adhering matter area. In other words, "IDLE" indicates that the candidate area 100 is not continued as an adhering matter area.

「潜伏」は、付着物が付着している可能性があることを示す状態である。すなわち、「潜伏」は、付着物領域であると判定されたものの、付着物領域として継続判定されている期間が所定期間未満の候補領域100であることを示す。 "Latent" is a state indicating that there is a possibility that deposits are attached. In other words, "latency" indicates that the candidate area 100 has been determined to be an adhering matter area but has been continuously determined as an adhering matter area for a period of less than a predetermined period of time.

「付着」は、付着物が付着していることを示す状態である。すなわち、「付着」は、付着物領域として継続判定されている期間が所定期間以上の候補領域100であることを示す。 “Attachment” is a state indicating that an attachment is attached. That is, "adhesion" indicates that the candidate area 100 has been continuously determined as an adhering matter area for a predetermined period or longer.

「移動付着」は、車両が移動中(車速が所定値以上)も継続して付着物が付着していることを示す状態である。すなわち、「移動付着」は、車両が移動中も、引き続き付着物領域として所定期間以上継続判定されている候補領域100であることを示す。なお、以下では、「移動付着」の状態の候補領域100(付着物領域)を移動付着物領域と記載する場合がある。 "Moving attachment" is a state indicating that the attached matter continues to adhere even when the vehicle is moving (vehicle speed is equal to or higher than a predetermined value). That is, "moving attachment" indicates that the candidate area 100 is continuously determined as an attachment area for a predetermined period or longer even while the vehicle is moving. In the following description, the candidate area 100 (attachment area) in the "moving attachment" state may be referred to as a moving attachment area.

以下、各状態間の遷移について説明する。なお、状態の遷移は、判定処理の継続性を示すスコアに基づいて行うことができる。 The transition between states will be described below. Note that the state transition can be performed based on the score indicating the continuity of the determination process.

<「IDLE」→「潜伏」>
例えば、判定部24は、初めて付着物領域であると判定した候補領域100について、「IDLE」から「潜伏」へ遷移させる。
<"IDLE" → "Conceal">
For example, the determination unit 24 transitions the candidate area 100, which is determined to be an adhering matter area for the first time, from "IDLE" to "latent".

<「潜伏」→「IDLE」>
例えば、判定部24は、付着物領域として継続判定されている期間が所定期間未満である候補領域100について、現在の撮像画像Iにおいて付着物領域ではないと判定した場合に、「潜伏」から「IDLE」へ遷移させる。
<"Concealment" → "IDLE">
For example, if the determination unit 24 determines that the candidate region 100, which has been continuously determined as an adhering matter region for a period of time less than a predetermined period, is not an adhering matter region in the current captured image I, the determination unit 24 changes "latency" to " IDLE”.

<「潜伏」→「付着」>
例えば、判定部24は、付着物領域として継続判定されている期間が所定期間以上となった場合に、「潜伏」から「付着」へ遷移させる。判定部24は、「潜伏」から「付着」へ遷移した場合、「付着」の状態であることを紐付けた付着物領域の情報をフラグ出力部25へ出力する。
<"Concealment" → "Attachment">
For example, the determining unit 24 makes a transition from "latency" to "adherence" when the period during which the adhering matter area is continuously determined is equal to or longer than a predetermined period. The determination unit 24 outputs, to the flag output unit 25, the information of the attached matter area that is associated with the state of the “attachment” when the transition from “latent” to “attachment” occurs.

<「付着」→「IDLE」>
例えば、判定部24は、付着物領域として継続判定されている期間が所定期間以上である候補領域100について、現在の撮像画像Iにおいて付着物領域ではないと判定した場合に、「付着」から「IDLE」へ遷移させる。
<“Attachment” → “IDLE”>
For example, if the determination unit 24 determines that the candidate area 100, which has been continuously determined as an adhering matter area for a predetermined period or longer, is not an adhering matter area in the current captured image I, the determining unit 24 changes "adhering" to " IDLE”.

<「付着」→「移動付着」>
例えば、判定部24は、「付着」状態に遷移した後に、車両が移動中も付着物領域として継続判定されている期間が所定期間以上となった場合に、「付着」から「移動付着」へ遷移させる。判定部24は、「付着」から「移動付着」へ遷移した場合、「移動付着」の状態であることを紐付けた付着物領域(移動付着物領域)の情報をフラグ出力部25へ出力する。
<“Attachment” → “Moving attachment”>
For example, after transitioning to the "adhesion" state, the determination unit 24 changes the state from "adhesion" to "moving adhesion" when the period during which the adhering matter area is continuously determined even while the vehicle is moving is equal to or longer than a predetermined period. transition. When the state of "attachment" is changed to "moving attachment", the determination unit 24 outputs to the flag output unit 25 the information of the attachment area (moving attachment area) associated with the state of "moving attachment". .

<「移動付着」→「IDLE」>
例えば、判定部24は、「移動付着」の状態で、車両の移動中に取得した現在の撮像画像Iにおいて付着物領域ではないと判定した場合に、「移動付着」から「IDLE」へ遷移させる。
<“Moving attachment” → “IDLE”>
For example, if the determining unit 24 determines that the current captured image I acquired while the vehicle is moving is not an attached object area in the state of "moving attachment", the determination unit 24 causes a transition from "moving attachment" to "IDLE". .

フラグ出力部25は、判定部24の判定結果に基づいて付着物が付着しているか否かを示す付着物フラグを各種機器50へ出力する。まず、フラグ出力部25は、判定部24によって付着物領域と判定された領域に基づいて、所定の面積計算処理を行う。 The flag output unit 25 outputs an adhering matter flag indicating whether or not an adhering matter is adhered based on the determination result of the determining unit 24 to the various devices 50 . First, the flag output unit 25 performs a predetermined area calculation process based on the area determined by the determination unit 24 to be an adhering matter area.

ここで、図10を用いて、フラグ出力部25による付着物領域の面積計算処理について説明する。 Here, with reference to FIG. 10, the area calculation processing of the adhering matter area by the flag output unit 25 will be described.

図10は、フラグ出力部25による面積計算処理を示す図である。図10に示すように、まず、フラグ出力部25は、撮像画像Iの全体領域を所定の小領域500で分割するとともに、小領域500単位で、3つの領域510、520a、520bに区分けする。 FIG. 10 is a diagram showing area calculation processing by the flag output unit 25. As shown in FIG. As shown in FIG. 10, first, the flag output unit 25 divides the entire area of the captured image I into predetermined small areas 500, and divides each small area 500 into three areas 510, 520a, and 520b.

具体的には、第1の領域510は、路面に対応する領域である。第2の領域520aは、車体に対応する領域(車体領域)である。第3の領域520bは、上空(スカイ)に対応する領域である。 Specifically, the first area 510 is an area corresponding to the road surface. The second region 520a is a region (body region) corresponding to the vehicle body. The third area 520b is an area corresponding to the sky.

例えば、フラグ出力部25は、撮像画像Iにおける水平線を検出し、当該水平線よりも上側の領域を第3の領域520bとして設定する。また、第2の領域520aは、カメラ10の取付位置に応じて予め設定される領域である。また、フラグ出力部25は、撮像画像Iの全体領域のうち、第2の領域520aおよび第3の領域520bを除いた領域を第1の領域510として設定する。 For example, the flag output unit 25 detects a horizontal line in the captured image I, and sets an area above the horizontal line as the third area 520b. Also, the second area 520a is an area preset according to the mounting position of the camera 10 . In addition, the flag output unit 25 sets the area of the entire area of the captured image I excluding the second area 520 a and the third area 520 b as the first area 510 .

そして、フラグ出力部25は、判定部24によって付着物領域であると判定された領域を小領域500の単位に変換し、3つの領域510、520a、520bそれぞれにおける付着物領域(小領域500)の面積比を算出する。例えば、フラグ出力部25は、付着物領域全体を1(100%)として、各領域510、520a、520bに位置する付着物領域の面積比を算出する。 Then, the flag output unit 25 converts the area determined to be the deposit area by the determination unit 24 into units of small areas 500, and determines the deposit areas (small areas 500) in each of the three areas 510, 520a, and 520b. Calculate the area ratio of For example, the flag output unit 25 calculates the area ratio of the deposit areas located in each of the areas 510, 520a, and 520b, with the entire deposit area being 1 (100%).

例えば、フラグ出力部25は、各領域510、520a、520bにおける面積比が概ね同じ(領域510、520a、520b間での面積比の差分が所定値未満)である場合、3つの領域510、520a、520bそれぞれの付着物領域の合計面積を面積計算処理の計算結果とする。 For example, when the area ratios of the areas 510, 520a, and 520b are approximately the same (the difference in area ratio between the areas 510, 520a, and 520b is less than a predetermined value), the flag output unit 25 outputs the three areas 510, 520a. , 520b is the calculation result of the area calculation process.

一方、フラグ出力部25は、各領域510、520a、520bのうち、第1の領域510の面積比が他の領域520a、520bよりも所定値以上大きい場合、他の領域520a、520bの付着物領域の合計面積を面積計算処理の計算結果とする。 On the other hand, if the area ratio of the first region 510 among the regions 510, 520a, 520b is larger than that of the other regions 520a, 520b by a predetermined value or more, the flag output unit 25 The total area of the regions is used as the calculation result of the area calculation process.

これは、雨滴等の付着物の場合、撮像画像I全体に万遍なく付着する場合が多く、一方で、路面反射の領域は、撮像画像Iの路面領域に集中する場合が多いことに着目している。 This is because raindrops and other deposits often adhere evenly over the entire captured image I, while the area of the road surface reflection is often concentrated on the road surface area of the captured image I. ing.

つまり、フラグ出力部25は、路面領域である第1の領域510に付着物領域が集中している場合、当該付着物領域が路面反射の領域であるとし、付着物領域全体から路面反射の領域を減算した面積を面積計算処理の計算結果とする。 In other words, when the adhering matter area is concentrated in the first area 510 which is the road surface area, the flag output unit 25 determines that the adhering matter area is the area of road surface reflection, is used as the calculation result of the area calculation process.

なお、フラグ出力部25は、路面領域である第1の領域510に付着物領域が集中している場合であっても、かかる付着物領域が移動付着物領域である場合には、付着物領域全体から第1の領域510の付着物領域を減算しない。 It should be noted that even if the adhering matter areas are concentrated in the first area 510, which is the road surface area, the flag output unit 25 detects that the adhering matter area is a moving adhering matter area. Do not subtract the deposit area of the first area 510 from the total.

これは、判定結果として確度が高い移動付着物領域が少量付着したことを検出するためである。つまり、路面領域である第1の領域510に移動付着物領域が集中していた場合には、路面反射の領域ではなく付着物領域の可能性が高いためである。 This is for detecting that a small amount of moving adhering matter has adhered as a determination result with high accuracy. In other words, when the moving deposit areas are concentrated in the first area 510, which is the road surface area, there is a high possibility that the moving deposit areas are not the road surface reflection areas but the deposit areas.

そして、フラグ出力部25は、面積計算処理の計算結果として算出された面積が所定値以上である場合には、付着物フラグONを各種機器50へ出力し、かかる面積が所定値未満である場合には、付着物フラグOFFを各種機器50へ出力する。 Then, if the area calculated as the result of the area calculation process is equal to or greater than a predetermined value, the flag output unit 25 outputs the adhering substance flag ON to the various devices 50, and if the area is less than the predetermined value. , the attachment flag OFF is output to the various devices 50 .

具体的には、フラグ出力部25は、移動付着物領域の面積が第1閾値以上である場合、付着物フラグONを出力し、移動付着物領域の面積が第1閾値未満である場合、付着物フラグOFFを出力する。 Specifically, the flag output unit 25 outputs the attached matter flag ON when the area of the moving attached matter region is equal to or larger than the first threshold value, and outputs the attached matter flag ON when the area of the moving attached matter region is less than the first threshold value. Kimono flag OFF is output.

また、フラグ出力部25は、付着物領域(「付着」および「移動付着」)の面積が第1閾値よりも大きい第2閾値以上である場合、付着物フラグONを出力し、第2閾値未満である場合、付着物フラグOFFを出力する。 Further, when the area of the adhering matter region (“adhering” and “moving adhering”) is equal to or larger than a second threshold larger than the first threshold, the flag output unit 25 outputs an adhering matter flag ON, and the area is less than the second threshold. If so, the adhering matter flag OFF is output.

このように、フラグ出力部25は、移動付着物領域の場合、第2閾値よりも小さい第1閾値を設定することで、判定結果の確度が高い移動付着物領域が少量付着した場合でも、高精度に検出することができる。 In this manner, the flag output unit 25 sets the first threshold smaller than the second threshold in the case of the moving deposit area, so that even if a small amount of the moving deposit area with high accuracy of the determination result adheres, the flag output unit 25 It can be detected with precision.

次に、図11を用いて、実施形態に係る付着物検出装置1が実行する全体処理の処理手順について説明する。図11は、実施形態に係る付着物検出装置1が実行する付着物の全体処理の処理手順を示すフローチャートである。 Next, the processing procedure of the overall processing executed by the adhering matter detection device 1 according to the embodiment will be described with reference to FIG. 11 . FIG. 11 is a flow chart showing the procedure of the overall processing of the attached matter executed by the attached matter detection device 1 according to the embodiment.

図11に示すように、まず、画像取得部21は、カメラ10で撮像された撮像画像Iを取得し、取得した撮像画像Iに対してグレースケール化処理および間引き処理した後、縮小した撮像画像Iの画素値に基づいて生成した積分画像を撮像画像Iとして取得する(ステップS101)。 As shown in FIG. 11, first, the image acquisition unit 21 acquires a captured image I captured by the camera 10, performs grayscale processing and thinning processing on the acquired captured image I, and then reduces the captured image. An integral image generated based on the pixel values of I is obtained as a captured image I (step S101).

つづいて、抽出部22は、画像取得部21が取得した撮像画像Iの各画素から検出されるエッジに基づき、カメラ10に付着した付着物に対応する付着物領域の候補領域100を抽出する(ステップS102)。 Subsequently, the extracting unit 22 extracts a candidate area 100 of the attached matter area corresponding to the attached matter attached to the camera 10 based on the edge detected from each pixel of the captured image I acquired by the image acquiring unit 21 ( step S102).

つづいて、抽出部22は、候補領域100において連続する複数の画素列を含む帯領域110に関し、所定画素数を単位とする単位領域Rに分割する(ステップS103)。 Subsequently, the extraction unit 22 divides the band region 110 including a plurality of continuous pixel rows in the candidate region 100 into unit regions R each having a predetermined number of pixels as a unit (step S103).

つづいて、抽出部22は、単位領域Rの輝度情報を算出する(ステップS104)。輝度情報は、例えば、輝度の平均値および輝度の標準偏差である。 Subsequently, the extraction unit 22 calculates luminance information of the unit region R (step S104). The brightness information is, for example, the average value of brightness and the standard deviation of brightness.

つづいて、抽出部22は、算出した輝度の標準偏差が所定値未満であるか否かを判定する(ステップS105)。 Subsequently, the extraction unit 22 determines whether or not the calculated standard deviation of luminance is less than a predetermined value (step S105).

抽出部22は、輝度の標準偏差が所定値未満である場合(ステップS105:Yes)、単位領域Rの代表値として輝度の平均値(輝度平均)を設定する(ステップS106)。 When the standard deviation of luminance is less than the predetermined value (step S105: Yes), the extraction unit 22 sets the average value of luminance (luminance average) as the representative value of the unit region R (step S106).

一方、抽出部22は、輝度の標準偏差が所定値以上である場合(ステップS105:No)、単位領域Rの代表値として異常値を設定する(ステップS107)。 On the other hand, when the standard deviation of luminance is equal to or greater than the predetermined value (step S105: No), the extraction unit 22 sets an abnormal value as the representative value of the unit region R (step S107).

つづいて、抽出部22は、候補領域100における単位領域Rの輝度平均の分布が所定の除外条件を満たす場合に当該候補領域100を付着物領域の判定処理の対象から除外する除外処理を行う(ステップS108)。 Subsequently, the extraction unit 22 performs an exclusion process for excluding the candidate area 100 from the target of the adhering matter area determination process when the distribution of the luminance averages of the unit areas R in the candidate area 100 satisfies a predetermined exclusion condition (( step S108).

つづいて、抽出部22は、候補領域100における単位領域Rの輝度平均の分布における起伏変化が所定の変化パターンに合致する候補領域100を抽出し、判定部24は、算出部23の算出結果に基づいて、当該候補領域100が付着物領域であるか否かを判定する判定処理を行う(ステップS109)。 Subsequently, the extraction unit 22 extracts the candidate region 100 in which the undulation change in the distribution of the luminance average of the unit region R in the candidate region 100 matches a predetermined change pattern. Based on this, determination processing is performed to determine whether or not the candidate area 100 is an adhering matter area (step S109).

つづいて、フラグ出力部25は、判定部24によって継続して付着物領域と判定された領域の面積に基づいて、所定の面積計算処理を行い、計算結果として算出された面積が所定値以上であるか否かを判定する(ステップS110)。 Subsequently, the flag output unit 25 performs a predetermined area calculation process based on the area of the area continuously determined as the adhering matter area by the determination unit 24, and the area calculated as the calculation result is equal to or larger than the predetermined value. It is determined whether or not there is (step S110).

フラグ出力部25は、計算結果である面積が所定値以上の場合に、(ステップS110:Yes)、付着物フラグONを各種機器50へ出力し(ステップS111)、処理を終了する。 When the calculated area is equal to or larger than the predetermined value (step S110: Yes), the flag output unit 25 outputs the adhering matter flag ON to the various devices 50 (step S111), and ends the process.

一方、フラグ出力部25は、計算結果である面積が所定値未満の場合に、(ステップS110:No)、付着物フラグOFFを各種機器50へ出力し(ステップS112)、処理を終了する。 On the other hand, when the calculated area is less than the predetermined value (step S110: No), the flag output unit 25 outputs the adhering matter flag OFF to the various devices 50 (step S112), and ends the process.

次に、図12を用いて、実施形態に係る付着物検出装置1が実行する付着物の判定処理の処理手順について説明する。図12は、実施形態に係る付着物検出装置1が実行する付着物の判定処理の処理手順を示すフローチャートである。 Next, with reference to FIG. 12, the processing procedure of the adhering matter determination processing executed by the adhering matter detection apparatus 1 according to the embodiment will be described. FIG. 12 is a flow chart showing the procedure of the adhering matter determination process executed by the adhering matter detection device 1 according to the embodiment.

図12に示すように、算出部23は、まず、候補領域100に内部領域200を設定する(ステップS201)。 As shown in FIG. 12, the calculator 23 first sets the internal region 200 as the candidate region 100 (step S201).

つづいて、算出部23は、内部領域200内の複数画素において隣接する画素の輝度の差分値である第1差分を算出する(ステップS202)。 Subsequently, the calculation unit 23 calculates a first difference, which is a luminance difference value between adjacent pixels in a plurality of pixels in the internal region 200 (step S202).

つづいて、算出部23は、隣接する第1差分の差分値である第2差分を算出する(ステップS203)。 Subsequently, the calculator 23 calculates a second difference, which is a difference value between adjacent first differences (step S203).

つづいて、判定部24は、算出部23によって算出された第2差分である輝度変化量が第1の範囲にある領域度数(輝度変化量の数)が所定数以上であるか否かを判定する(ステップS204)。 Subsequently, the determination unit 24 determines whether the frequency of regions (the number of luminance change amounts) in which the luminance change amount, which is the second difference calculated by the calculation unit 23, is in the first range is equal to or greater than a predetermined number. (step S204).

判定部24は、第1の範囲にある領域度数が所定数以上である場合(ステップS204:Yes)、第2の範囲にある領域度数が所定数未満であるか否かを判定する(ステップS205)。 If the region frequency in the first range is equal to or greater than the predetermined number (step S204: Yes), the determination unit 24 determines whether the region frequency in the second range is less than the predetermined number (step S205). ).

判定部24は、第2の範囲にある領域度数が所定数未満である場合(ステップS205:Yes)、候補領域100を付着物領域であると判定し(ステップS206)、処理を終了する。 If the area frequency in the second range is less than the predetermined number (step S205: Yes), the determination unit 24 determines that the candidate area 100 is an adhering matter area (step S206), and ends the process.

一方、ステップS204において、判定部24は、第1の範囲にある領域度数が所定数未満である場合(ステップS204:No)、候補領域100を付着物領域ではないと判定し(ステップS207)、処理を終了する。 On the other hand, in step S204, if the area frequency in the first range is less than the predetermined number (step S204: No), the determination unit 24 determines that the candidate area 100 is not an adhering matter area (step S207), End the process.

また、ステップS205において、判定部24は、第2の範囲にある領域度数が所定数以上である場合(ステップS205:No)、候補領域100を付着物領域ではない(路面反射の領域)と判定し(ステップS207)、処理を終了する。 Further, in step S205, when the area frequency in the second range is equal to or greater than the predetermined number (step S205: No), the determination unit 24 determines that the candidate area 100 is not an adhering matter area (a road surface reflection area). (step S207), and the process ends.

上述してきたように、実施形態に係る付着物検出装置1は、抽出部22と、算出部23と、判定部24とを備える。抽出部22は、撮像装置(カメラ10)で撮像された撮像画像Iの各画素から検出されるエッジに基づき、撮像装置に付着した付着物に対応する付着物領域の候補領域100を抽出する。算出部23は、抽出部22によって抽出された候補領域100における所定の内部領域200において所定方向に連続する複数画素の輝度変化量を算出する。判定部24は、算出部23によって算出された輝度変化量が第1の範囲にある輝度変化量の数と、第1の範囲よりも輝度変化量が大きい第2の範囲にある輝度変化量の数とに基づいて候補領域100が付着物領域であるか否かを判定する。これにより、付着物を高精度に検出することができる。 As described above, the attached matter detection device 1 according to the embodiment includes the extraction unit 22 , the calculation unit 23 and the determination unit 24 . The extracting unit 22 extracts a candidate area 100 for an adhering matter area corresponding to an adhering matter adhering to the imaging device (camera 10) based on the edge detected from each pixel of the captured image I captured by the imaging device (camera 10). The calculation unit 23 calculates luminance change amounts of a plurality of pixels that are continuous in a predetermined direction in a predetermined internal region 200 in the candidate region 100 extracted by the extraction unit 22 . The determination unit 24 determines the number of luminance change amounts in the first range calculated by the calculation unit 23, and the number of luminance change amounts in the second range in which the luminance change amount is larger than the first range. It is determined whether or not the candidate area 100 is an adhering matter area based on the number. As a result, adhering matter can be detected with high accuracy.

また、上述した実施形態では、車両に搭載されるカメラで撮像された撮像画像Iを用いたが、撮像画像Iは、例えば、防犯カメラや、街灯等に設置されたカメラで撮像された撮像画像Iであってもよい。つまり、カメラのレンズに付着物が付着する可能性があるカメラで撮像された撮像画像Iであればよい。 Further, in the above-described embodiment, the captured image I captured by a camera mounted on a vehicle is used, but the captured image I is, for example, a captured image captured by a security camera or a camera installed on a streetlight or the like. It may be I. In other words, any captured image I captured by a camera in which there is a possibility that an adhering substance may adhere to the lens of the camera may be used.

さらなる効果や変形例は、当業者によって容易に導き出すことができる。このため、本発明のより広範な態様は、以上のように表しかつ記述した特定の詳細および代表的な実施形態に限定されるものではない。したがって、添付の特許請求の範囲およびその均等物によって定義される総括的な発明の概念の精神または範囲から逸脱することなく、様々な変更が可能である。 Further effects and modifications can be easily derived by those skilled in the art. Therefore, the broader aspects of the invention are not limited to the specific details and representative embodiments so shown and described. Accordingly, various changes may be made without departing from the spirit or scope of the general inventive concept defined by the appended claims and equivalents thereof.

1 付着物検出装置
2 制御部
3 記憶部
10 カメラ
11 車速センサ
21 画像取得部
22 抽出部
23 算出部
24 判定部
25 フラグ出力部
31 起伏条件情報
50 各種機器
100 候補領域
200 内部領域
I 撮像画像
Reference Signs List 1 adhering matter detection device 2 control unit 3 storage unit 10 camera 11 vehicle speed sensor 21 image acquisition unit 22 extraction unit 23 calculation unit 24 determination unit 25 flag output unit 31 undulation condition information 50 various devices 100 candidate area 200 internal area I captured image

Claims (4)

撮像装置で撮像された画像の各画素から検出されるエッジに基づき、前記撮像装置に付着した付着物に対応する付着物領域の候補領域を抽出する抽出部と、
前記抽出部によって抽出された前記候補領域における所定の内部領域において所定方向に連続する複数画素の輝度変化量を算出する算出部と、
前記算出部によって算出された前記輝度変化量が第1の範囲にある前記輝度変化量の数と、前記第1の範囲よりも前記輝度変化量が大きい第2の範囲にある前記輝度変化量の数とに基づいて前記候補領域が前記付着物領域であるか否かを判定する判定部と
を備え
前記判定部は、
前記第1の範囲にある前記輝度変化量の数が所定数以上、かつ、前記第2の範囲にある前記輝度変化量の数が所定数以上である場合、前記候補領域が前記付着物領域ではないと判定することを特徴とする付着物検出装置。
an extraction unit for extracting a candidate area for an adhering matter area corresponding to an adhering matter adhering to the imaging device based on edges detected from pixels of an image captured by the imaging device;
a calculation unit that calculates a luminance change amount of a plurality of pixels consecutive in a predetermined direction in a predetermined internal region in the candidate region extracted by the extraction unit;
The number of luminance change amounts in a first range calculated by the calculation unit, and the number of the luminance change amounts in a second range in which the luminance change amount is larger than the first range. a determination unit that determines whether the candidate area is the adhering matter area based on the number of
The determination unit is
When the number of luminance change amounts in the first range is a predetermined number or more and the number of the luminance change amounts in the second range is a predetermined number or more, the candidate area is the adhering matter area. A deposit detection device characterized in that it determines that there is no attached matter .
前記算出部は、
前記所定方向に隣接する2つの画素の輝度差分値を第1差分として算出し、前記所定方向に連続する2つの前記第1差分の差分値である第2差分を前記輝度変化量として算出すること
を特徴とする請求項1に記載の付着物検出装置。
The calculation unit
calculating a luminance difference value of two pixels adjacent in the predetermined direction as a first difference, and calculating a second difference, which is a difference value between the two first differences consecutive in the predetermined direction, as the luminance change amount; The attached matter detection device according to claim 1, characterized by:
前記算出部は、
前記画像の垂直方向に連続する前記複数画素の輝度変化量を算出すること
を特徴とする請求項1または2に記載の付着物検出装置。
The calculation unit
3. The adhering matter detection apparatus according to claim 1 , wherein the amount of change in luminance of the plurality of pixels that are continuous in the vertical direction of the image is calculated .
撮像装置で撮像された画像の各画素から検出されるエッジに基づき、前記撮像装置に付着した付着物に対応する付着物領域の候補領域を抽出する抽出工程と、
前記抽出工程によって抽出された前記候補領域における所定の内部領域において所定方向に連続する複数画素の輝度変化量を算出する算出工程と、
前記算出工程によって算出された前記輝度変化量が第1の範囲にある前記輝度変化量の数と、前記第1の範囲よりも前記輝度変化量が大きい第2の範囲にある前記輝度変化量の数とに基づいて前記候補領域が前記付着物領域であるか否かを判定し、前記第1の範囲にある前記輝度変化量の数が所定数以上、かつ、前記第2の範囲にある前記輝度変化量の数が所定数以上である場合、前記候補領域が前記付着物領域ではないと判定する判定工程と
を含むことを特徴とする付着物検出方法
an extracting step of extracting a candidate area for an adhering matter area corresponding to an adhering matter adhering to the imaging device based on edges detected from each pixel of an image captured by the imaging device;
a calculation step of calculating a luminance change amount of a plurality of pixels consecutive in a predetermined direction in a predetermined internal region in the candidate region extracted by the extraction step;
The number of luminance change amounts in a first range calculated by the calculating step, and the number of luminance change amounts in a second range in which the luminance change amount is larger than the first range. determining whether or not the candidate area is the adhering matter area based on the number of the candidate areas, and determining whether the number of the luminance change amounts in the first range is equal to or greater than a predetermined number and in the second range. a determination step of determining that the candidate area is not the adhering matter area when the number of luminance change amounts is equal to or greater than a predetermined number;
A deposit detection method , comprising :
JP2019172207A 2019-09-20 2019-09-20 Attached matter detection device and attached matter detection method Active JP7234885B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2019172207A JP7234885B2 (en) 2019-09-20 2019-09-20 Attached matter detection device and attached matter detection method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2019172207A JP7234885B2 (en) 2019-09-20 2019-09-20 Attached matter detection device and attached matter detection method

Publications (2)

Publication Number Publication Date
JP2021051378A JP2021051378A (en) 2021-04-01
JP7234885B2 true JP7234885B2 (en) 2023-03-08

Family

ID=75157908

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2019172207A Active JP7234885B2 (en) 2019-09-20 2019-09-20 Attached matter detection device and attached matter detection method

Country Status (1)

Country Link
JP (1) JP7234885B2 (en)

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2005346651A (en) 2004-06-07 2005-12-15 Sony Corp Image processor, image processing method and program
JP2006262101A (en) 2005-03-17 2006-09-28 Secom Co Ltd Image sensing apparatus
JP2017138736A (en) 2016-02-02 2017-08-10 富士通テン株式会社 Image processor and water droplet removal system

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP6755161B2 (en) * 2016-10-24 2020-09-16 株式会社デンソーテン Adhesion detection device and deposit detection method

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2005346651A (en) 2004-06-07 2005-12-15 Sony Corp Image processor, image processing method and program
JP2006262101A (en) 2005-03-17 2006-09-28 Secom Co Ltd Image sensing apparatus
JP2017138736A (en) 2016-02-02 2017-08-10 富士通テン株式会社 Image processor and water droplet removal system

Also Published As

Publication number Publication date
JP2021051378A (en) 2021-04-01

Similar Documents

Publication Publication Date Title
JP6832105B2 (en) Water drop detector, water drop detection method and water drop detection program
JP7230507B2 (en) Deposit detection device
JP2019106644A (en) Deposit detection apparatus and deposit detection method
JP7206909B2 (en) Attached matter detection device and attached matter detection method
JP7156225B2 (en) Attached matter detection device and attached matter detection method
JP7243546B2 (en) Attached matter detection device and attached matter detection method
JP7200893B2 (en) Attached matter detection device and attached matter detection method
JP7151675B2 (en) Attached matter detection device and attached matter detection method
JP7234885B2 (en) Attached matter detection device and attached matter detection method
JP7163766B2 (en) Attached matter detection device and attached matter detection method
JP7188336B2 (en) Attached matter detection device and attached matter detection method
US10997743B2 (en) Attachable matter detection apparatus
JP7251425B2 (en) Attached matter detection device and attached matter detection method
JP7200894B2 (en) Attached matter detection device and attached matter detection method
JP7234884B2 (en) Attached matter detection device and attached matter detection method
JP2005345290A (en) Streak-like flaw detecting method and streak-like flaw detector
JP7234630B2 (en) Deposit detection device
JP7234886B2 (en) Attached matter detection device and attached matter detection method
JP7283081B2 (en) Attached matter detection device and attached matter detection method
JP2021050932A (en) Attached matter detection device and attached matter detection method
JP7172931B2 (en) Attached matter detection device and attached matter detection method
JP7265693B2 (en) Attached matter detection device and attached matter detection method
JP2020108060A (en) Deposit detector and deposit detection method
JP7059649B2 (en) Deposit detection device and deposit detection method
JP2020109541A (en) Attachment detection device and attachment detection method

Legal Events

Date Code Title Description
RD03 Notification of appointment of power of attorney

Free format text: JAPANESE INTERMEDIATE CODE: A7423

Effective date: 20211116

A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20211117

RD04 Notification of resignation of power of attorney

Free format text: JAPANESE INTERMEDIATE CODE: A7424

Effective date: 20220217

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20221107

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20221122

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20230111

TRDD Decision of grant or rejection written
A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

Effective date: 20230124

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20230206

R150 Certificate of patent or registration of utility model

Ref document number: 7234885

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R150