Dirt detection device, dirt detection method, and dirt detection program
The dirt detection device uses luminance histogram analysis to classify and threshold frequency distributions for accurate dirt detection on camera lenses, addressing the challenge of large affected image regions.
Patent Information
- Application Number
- JP2025080850
- Authority / Receiving Office
- JP · JP
- Patent Type
- Applications
- Current Assignee / Owner
- Filing Date
- 2025-05-14
- Publication Date
- 2026-11-27
AI Technical Summary
Existing methods for detecting dirt on camera lenses struggle to accurately identify dirt when the affected image region is large, particularly due to interference from automatic camera exposure or gain adjustments.
A dirt detection device that analyzes the shape and frequency of luminance histograms to determine the presence of dirt by classifying the frequency distribution near peaks and comparing it against specified thresholds, using software or hardware components to identify dirt on the lens.
Effectively detects various types of dirt, including large image areas affected by dirt, by utilizing the distribution shape and frequency of luminance peaks, thereby improving detection accuracy.
Smart Images

Figure 2026184542000001_ABST
Abstract
Description
[Technical Field]
[0001] The present disclosure relates to a technique for detecting dirt attached to a lens of a camera. [Background Art]
[0002] If dirt adheres to a lens of an in-vehicle camera used for road environment recognition or the like, normal image information cannot be obtained. In order to determine that such a state has occurred, a camera lens dirt detection technique for detecting dirt on the lens surface of the camera has been proposed.
[0003] Patent Literature 1 describes calculating a luminance gradient, which is a change ratio between the luminance of a predetermined region of an image captured by a camera mounted on a vehicle and the surrounding luminance, and determining that there is dirt in a region where the predetermined regions where the luminance gradient is within a set value are continuous. [[Prior Art Literature]] [[Patent Literature]]
[0004] [Patent Literature 1] Japanese Unexamined Patent Application Publication No. 2015-070566 [Summary of Invention] [Problem to be Solved by the Invention]
[0005] However, when an image region caused by dirt is relatively large, the influence of automatic adjustment of camera exposure or gain also becomes large. Therefore, as described in Patent Literature 1, it has been difficult to apply a detection method in which the luminance gradient is within a predetermined value. An object of the present disclosure is to make it possible to appropriately detect dirt on a lens even when an image region caused by the dirt is large. [Means for Solving the Problem]
[0006] A dirt detection device according to the present disclosure includes A distribution determination unit determines whether the shape of the frequency distribution near a peak with a high frequency compared to the surrounding luminance is a specified shape, in a luminance histogram showing the frequency for each luminance for a pixel region to be detected in image data captured by an image acquisition device. A frequency determination unit that determines whether the frequency of the aforementioned peak is greater than a frequency threshold, If the distribution determination unit determines that the shape of the frequency distribution near the peak is the specified shape, and the frequency determination unit determines that the frequency of the peak is greater than the frequency threshold, the dirt determination unit determines that there is dirt in the part of the lens of the image capture device that captures the pixel area. It is equipped with. [Effects of the Invention]
[0007] This disclosure uses the distribution shape near the peak of the luminance histogram and the frequency of the peak to detect dirt. By detecting dirt using the distribution shape expected to represent dirt and the frequency expected to represent dirt, it is possible to appropriately detect various types of dirt, including cases where the image area caused by the dirt is large. [Brief explanation of the drawing]
[0008] [Figure 1] A diagram illustrating the configuration of the dirt detection system 100 according to Embodiment 1. [Figure 2] A diagram illustrating the functional configuration of the dirt detection device 10 according to Embodiment 1. [Figure 3] A flowchart showing the processing flow of the dirt detection device 10 according to Embodiment 1. [Figure 4] A figure showing an example of a histogram indicating the frequency for each brightness level according to Embodiment 1. [Figure 5] An explanatory diagram of the frequency comparison process according to Embodiment 1. [Figure 6] This figure shows an example of a histogram indicating the frequency for each brightness level according to Embodiment 2. [Figure 7] Diagram illustrating the luminance width according to Embodiment 2. [Modes for carrying out the invention]
[0009] Embodiment 1. ***Explanation of the structure*** Referring to Figure 1, the configuration of the dirt detection system 100 according to Embodiment 1 will be described. The dirt detection system 100 comprises an image capture device 110 and a dirt detection device 10.
[0010] The image acquisition device 110 comprises a lens 111, a CMOS sensor 112, and a sensor control unit 113. CMOS stands for Complementary Metal Oxide Semiconductor. Based on the control of the sensor control unit 113, the image acquisition device 110 acquires image data by extracting light captured through the lens 111 as an electrical signal for each pixel using the CMOS sensor 112.
[0011] The dirt detection device 10 is a computer equipped with computing units 11 such as an MCU, CPU, and GPU, and temporary storage devices 12 such as RAM. MCU stands for Micro-Control Unit. CPU stands for Central Processing Unit. GPU stands for Graphics Processing Unit. RAM stands for Random Access Memory. The dirt detection device 10 detects dirt adhering to the lens 111 of the image capture device 110.
[0012] Referring to Figure 2, the functional configuration of the dirt detection device 10 according to Embodiment 1 will be described. The dirt detection device 10 comprises, as functional components, an adjustment setting unit 21, an image acquisition unit 22, a histogram generation unit 23, a distribution determination unit 24, a frequency determination unit 25, and a dirt detection unit 26. The functions of each functional component of the dirt detection device 10 are implemented by software.
[0013] ***Explanation of operation*** Referring to Figures 3 to 5, the operation of the dirt detection device 10 according to Embodiment 1 will be explained. The operation procedure of the stain detection device 10 according to the first embodiment corresponds to the stain detection method according to the first embodiment. A program that realizes the operation of the stain detection device 10 according to the first embodiment corresponds to the stain detection program according to the first embodiment.
[0014] With reference to FIG. 3, the flow of processing of the stain detection device 10 according to the first embodiment will be described. (Step S101: adjustment setting process) The adjustment setting unit 21 sets automatic adjustment of at least one of camera exposure and gain during imaging. The image area to be subjected to automatic adjustment may be the entire sensor or a part thereof.
[0015] (Step S102: image acquisition process) The image acquisition unit 22 acquires image data obtained by capturing an image with the image capturing apparatus 110 that has been automatically adjusted in accordance with the setting in step S101.
[0016] (Step S103: area setting process) The histogram generation unit 23 sets a pixel region (ROI: Region of Interest) to be detected in the image data acquired in step S102. The pixel area to be detected is an arbitrary area in the image data.
[0017] (Step S104: luminance extraction process) The histogram generation unit 23 extracts, from the image data acquired in step S102, luminance information for each pixel in the pixel region set in step S103.
[0018] (Step S105: histogram generation process) The histogram generation unit 23 organizes the frequency for each luminance of the luminance information extracted in step S104. Then, the histogram generation unit 23 generates a histogram indicating the frequency for each luminance as shown in FIG.
[0019] (Step S106: distribution classification process) The distribution determination unit 24 classifies the shape of the frequency distribution near peaks in the luminance histogram generated in step S105, where the frequency is larger than the surrounding luminance. Here, the distribution determination unit 24 identifies the maximum value of the frequency as the peak and classifies the shape of the frequency distribution near the peak. The area near the peak is the specified range before and after the peak in terms of luminance, including the peak. In this case, the distribution determination unit 24 identifies a luminance width that indicates the range of luminance of the frequency distribution near the peak and classifies it into a classification type according to the luminance width. Here, the luminance width is determined based on a reference frequency, which is the frequency at the peak, and the range of luminance near the peak where the frequency is greater than the determination frequency is set as the determination frequency, with frequencies lower than the reference frequency being used as the determination frequency. For example, the distribution determination unit 24 classifies the shape of the frequency distribution near the peak into two classification types: a normal distribution with a brightness range less than or equal to a width threshold, and an exponential distribution with a brightness range less than or equal to a width threshold. In the histogram shown in Figure 4, the brightness peaks near the lowest value, and the shape of the frequency distribution near the peak is classified as a normal distribution with a brightness range less than or equal to a width threshold.
[0020] (Step S107: Distribution determination process) The distribution determination unit 24 determines whether the classification type classified in step S106 is a classification type of a specified shape. In other words, the distribution determination unit 24 determines whether the shape of the frequency distribution near the peak is a specified shape that is a specified classification type. The specified shape is, for example, the shape of a normal distribution in which the luminance width is less than or equal to the width threshold. Here, the distribution determination unit 24 uses a classification type with some distribution shape in which the luminance width is less than or equal to the width threshold as the specified classification type. If the classification type is the specified shape, the distribution determination unit 24 proceeds to step S108. On the other hand, if the classification type is not the specified shape, the distribution determination unit 24 assumes that there is no dirt in the part of the lens 111 of the image capture device 110 that captures the current pixel area, and returns to step S103 to set a new pixel area to be detected. If the necessary areas have already been set as pixel areas to be detected, the distribution determination unit 24 terminates the process.
[0021] (Step S108: Frequency comparison process) As shown in Figure 5, the frequency determination unit 25 compares the frequency of peaks in the luminance histogram generated in step S105 with a frequency threshold. The frequency threshold is a value pre-set as a criterion for determining the presence or absence of dirt.
[0022] (Step S109: Frequency determination process) The frequency determination unit 25 determines, based on the comparison results in step S108, whether the peak frequency is greater than the frequency threshold. If the frequency determination unit 25 determines that the peak frequency is greater than the frequency threshold, it proceeds to step S110. On the other hand, if the peak frequency is less than or equal to the frequency threshold, the frequency determination unit 25 determines that there is no dirt in the part of the lens 111 of the image capture device 110 that captures the current pixel area, and returns to step S103 to set a new pixel area to be detected. If the necessary areas have already been set as pixel areas to be detected, the distribution determination unit 24 terminates the process.
[0023] (Step S110: Dirt detection process) The dirt detection unit 26 determines that there is dirt in the part of the lens 111 of the image capture device 110 that captures the current pixel area. In other words, the dirt detection unit 26 determines that there is dirt in the part of the lens 111 of the image capture device 110 that captures the current pixel area if, in step S107, the shape of the frequency distribution near the peak is determined to be the specified shape, and in step S109, the frequency of the peak is determined to be greater than the frequency threshold.
[0024] In step S102, the image acquisition unit 22 may acquire multiple image data captured by the image capture device 110. For example, the image acquisition unit 22 may acquire image data of multiple frames captured during a reference period. In this case, in step S104, the histogram generation unit 23 extracts brightness information for each pixel in a pixel region from each image data and identifies the average brightness of each pixel as the brightness of that pixel. Then, in step S105, the histogram generation unit 23 generates a histogram using the brightness of each pixel. This prevents false detection of dirt due to temporary changes in brightness.
[0025] ***Effects of Embodiment 1*** As described above, the stain detection device 10 according to Embodiment 1 detects stains using the distribution shape near the peak of the luminance histogram and the frequency of the peak. By detecting stains using the distribution shape expected to represent stains and the frequency expected to represent stains, it is possible to appropriately detect various types of stains, including cases where the image area caused by the stain is large.
[0026] The dirt detection device 10 according to Embodiment 1 performs classification using brightness range. When the proportion of the dirt area within the area subject to automatic adjustment of at least one of exposure and gain increases, the contribution of automatic adjustment related to brightness range increases. Therefore, by determining whether or not the brightness range is below a width threshold and determining the presence or absence of dirt, it is possible to appropriately detect dirt.
[0027] As shown in Figure 4, suppose there is a peak in brightness near the minimum value, the shape of the frequency distribution near the peak is classified as a normal distribution with a brightness range less than or equal to the width threshold, and the frequency of the peak is greater than the frequency threshold. In this case, it is detected that a dark-colored occlusion, such as black, is attached to most of the pixel area to be detected. Conversely, if there is a peak in brightness near the maximum value, it is detected that a light-colored occlusion, such as white, is attached to most of the pixel area to be detected.
[0028] Embodiment 2. Embodiment 2 describes a specific method for implementing the distribution classification process and the distribution determination process (steps S106 and S107 in Figure 3).
[0029] The distribution determination unit 24 determines whether the shape of the frequency distribution near the peak is a specified shape using a method for testing the likelihood of the distribution shape. Specifically, the distribution determination unit 24 determines that the shape of the frequency distribution near the peak is a specified shape if the likelihood is greater than or equal to a standard value. Examples of methods for testing the likelihood of the distribution shape include the Shapiro-Wilk test or the Kolgomolov-Smirnov test. When the distribution determination unit 24 uses the Shapiro-Wilk test or the Kolgomolov-Smirnov test to determine whether the distribution is a normal distribution, it may determine that the distribution is a normal distribution if the p-value is ≥ 0.05. The distribution determination unit 24 may also use a QQ plot as a method for testing the likelihood of the distribution shape.
[0030] In this case, the distribution determination unit 24 classifies the data into classification types according to the luminance range. Here, the distribution determination unit 24 uses the half-width of the peak frequency as the luminance range. For example, suppose that in step S105 a histogram showing the frequency for each brightness level is generated as shown in Figure 6. In this case, as shown in Figure 7, the distribution determination unit 24 identifies the half-width as the brightness level, which represents the range of brightness levels where the frequency is half of the peak frequency.
[0031] ***Effects of Embodiment 2*** As described above, the stain detection device 10 according to Embodiment 2 uses a method for testing the likelihood of the distribution shape to determine whether the shape of the frequency distribution near the peak is a specified shape. This makes it possible to appropriately determine whether the shape of the frequency distribution near the peak is a specified shape. When the proportion of the stained area within the area subject to automatic adjustment of at least one of the exposure and gain increases, the contribution of automatic adjustment related to the distribution shape increases. Therefore, by making it possible to appropriately determine whether or not it is a specified shape, it becomes possible to appropriately detect various types of stains, including when the image area caused by stains is large.
[0032] ***Other configurations*** <Example 1> In Embodiment 1, each functional component was implemented in software. However, in Modification 1, each functional component may be implemented in hardware. The differences between this Modification 1 and Embodiment 1 will be explained below.
[0033] When each functional component is implemented in hardware, the dirt detection device 10 includes electronic circuits instead of the processor 11, memory 12, and storage 13. The electronic circuits are dedicated circuits that implement the functions of each functional component, as well as the functions of the memory 12 and storage 13.
[0034] Electronic circuits can include single circuits, complex circuits, programmed processors, parallel programmed processors, logic ICs, GAs, ASICs, and FPGAs. GA stands for Gate Array. ASIC stands for Application Specific Integrated Circuit. FPGA stands for Field-Programmable Gate Array. Each functional component may be implemented in a single electronic circuit, or it may be implemented by distributing each functional component across multiple electronic circuits.
[0035] <Modification 2> As a second variation, some of the functional components may be implemented in hardware, while others may be implemented in software.
[0036] The processor 11, memory 12, storage 13, and electronic circuitry are collectively referred to as the processing circuit. In other words, the function of each functional component is realized by the processing circuit.
[0037] Furthermore, the term "part" in the above explanation may be replaced with "circuit," "process," "procedure," "processing," or "processing circuit."
[0038] The various aspects of this disclosure are summarized below as an appendix. (Note 1) A distribution determination unit determines whether the shape of the frequency distribution near a peak with a high frequency compared to the surrounding luminance is a specified shape, in a luminance histogram showing the frequency for each luminance for a pixel region to be detected in image data captured by an image acquisition device. A frequency determination unit that determines whether the frequency of the aforementioned peak is greater than a frequency threshold, If the distribution determination unit determines that the shape of the frequency distribution near the peak is the specified shape, and the frequency determination unit determines that the frequency of the peak is greater than the frequency threshold, the dirt determination unit determines that there is dirt in the part of the lens of the image capture device that captures the pixel area. A dirt detection device equipped with the following features. (Note 2) The distribution determination unit determines whether the shape of the frequency distribution near the peak is the specified shape, using a method for testing the likelihood of the distribution shape. The dirt detection device described in Appendix 1. (Note 3) The distribution determination unit determines whether the shape of the frequency distribution near the peak is a specified shape by considering whether the luminance width, which represents the range of luminance near the peak where the determination frequency is lower than the reference frequency (which is the frequency at the peak), is less than or equal to a width threshold. A dirt detection device as described in Appendix 1 or 2. (Note 4) The distribution determination unit determines whether the brightness width is less than or equal to the width threshold, using the half-width of the peak as the brightness width. The dirt detection device described in Appendix 3. (Note 5) The computer determines whether the shape of the frequency distribution near a peak with a high frequency compared to the surrounding luminance is a specified shape, in the luminance histogram showing the frequency for each luminance for the pixel region to be detected in the image data obtained by the image capture device. The computer determines whether the frequency of the peak is greater than the frequency threshold. A method for detecting dirt in the part of the lens of an image capture device that captures the pixel area, when the computer determines that the shape of the frequency distribution near the peak is the specified shape, and that the frequency of the peak is greater than the frequency threshold. (Note 6) A distribution determination process that determines whether the shape of the frequency distribution near a peak with a high frequency compared to the surrounding luminance is a specified shape in a luminance histogram showing the frequency for each luminance for a pixel region to be detected in image data obtained by an image capture device, and A frequency determination process that determines whether the frequency of the aforementioned peak is greater than a frequency threshold, If the distribution determination process determines that the shape of the frequency distribution near the peak is the specified shape, and the frequency determination process determines that the frequency of the peak is greater than the frequency threshold, then a dirt detection process is performed to determine that there is dirt in the part of the lens of the image capture device that captures the pixel area. A dirt detection program that makes a computer function as a dirt detection device.
[0039] The embodiments and variations of this disclosure have been described above. Some of these embodiments and variations may be implemented in combination. Alternatively, some or all of them may be implemented in part. However, this disclosure is not limited to the embodiments and variations described above, and various modifications are possible as needed. [Explanation of Symbols]
[0040] 100 Dirt detection system, 110 Image acquisition device, 111 Lens, 112 CMOS sensor, 113 Sensor control unit, 10 Dirt detection device, 11 Processing unit, 12 Temporary storage device, 21 Adjustment setting unit, 22 Image acquisition unit, 23 Histogram generation unit, 24 Distribution determination unit, 25 Frequency determination unit, 26 Dirt determination unit.
Claims
1. A distribution determination unit determines whether the shape of the frequency distribution near a peak with a high frequency compared to the surrounding luminance is a specified shape, in a luminance histogram showing the frequency for each luminance for a pixel region to be detected in image data captured by an image acquisition device. A frequency determination unit that determines whether the frequency of the aforementioned peak is greater than a frequency threshold, If the distribution determination unit determines that the shape of the frequency distribution near the peak is the specified shape, and the frequency determination unit determines that the frequency of the peak is greater than the frequency threshold, the dirt determination unit determines that there is dirt in the part of the lens of the image capture device that captures the pixel area. A dirt detection device equipped with the following features.
2. The distribution determination unit determines whether the shape of the frequency distribution near the peak is the specified shape, using a method for testing the likelihood of the distribution shape. The dirt detection device according to claim 1.
3. The distribution determination unit determines whether the shape of the frequency distribution near the peak is a specified shape by considering whether the luminance width, which represents the range of luminance near the peak where the determination frequency is greater than a determination frequency that is lower than the reference frequency, is less than or equal to a width threshold. The dirt detection device according to claim 1.
4. The distribution determination unit determines whether the brightness width is less than or equal to the width threshold, using the half-width of the peak as the brightness width. The dirt detection device according to claim 3.
5. The computer determines whether the shape of the frequency distribution near a peak with a high frequency compared to the surrounding luminance is a specified shape, in the luminance histogram showing the frequency for each luminance for the pixel region to be detected in the image data obtained by the image capture device. The computer determines whether the frequency of the peak is greater than the frequency threshold. A method for detecting dirt in the part of the lens of an image capture device that captures the pixel area, when the computer determines that the shape of the frequency distribution near the peak is the specified shape, and that the frequency of the peak is greater than the frequency threshold.
6. A distribution determination process that determines whether the shape of the frequency distribution near a peak with a high frequency compared to the surrounding luminance is a specified shape in a luminance histogram showing the frequency for each luminance for a pixel region to be detected in image data obtained by an image capture device, and A frequency determination process that determines whether the frequency of the aforementioned peak is greater than a frequency threshold, If the distribution determination process determines that the shape of the frequency distribution near the peak is the specified shape, and the frequency determination process determines that the frequency of the peak is greater than the frequency threshold, then a dirt detection process is performed to determine that there is dirt in the part of the lens of the image capture device that captures the pixel area. A dirt detection program that makes a computer function as a dirt detection device.
Citation Information
Patent Citations
Device for detecting lens dirt of camera
JP2015070566A
