A camera lens contamination detection method and related device

By constructing a network of mutual monitoring cameras, the system utilizes a third-party perspective to detect dirt on vehicle lenses in the mining area. Combining multi-feature fusion scoring and closed-loop verification of cleaning effectiveness, the system solves the problems of reliability and cleaning efficiency in detecting camera lens contamination in the mining area, thereby improving detection accuracy and system reliability.

CN122175902APending Publication Date: 2026-06-09SHENZHEN STREAMING VIDEO TECH

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
SHENZHEN STREAMING VIDEO TECH
Filing Date
2026-03-03
Publication Date
2026-06-09

Smart Images

  • Figure CN122175902A_ABST
    Figure CN122175902A_ABST
Patent Text Reader

Abstract

This application provides a method and related equipment for detecting dirt on camera lenses, used to achieve closed-loop verification and strategy optimization of cleaning effects. The method includes: extracting a lens area image containing the lens surface of the monitored camera from the monitoring video image of the monitoring camera according to a preset mutual monitoring relationship model; wherein, the mutual monitoring relationship model is established based on the installation position and viewing angle of each camera on the vehicle, and the mutual monitoring relationship model ensures that the lens surface of each monitored camera is observed within the field of view of at least one other monitoring camera; processing the extracted lens area image to calculate the final dirt score of the monitored camera; if the final dirt score exceeds a preset dirt threshold, triggering a cleaning operation for the monitored camera.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of visual reliability assurance technology, and in particular to a method and related equipment for detecting dirt in a camera lens. Background Technology

[0002] Mining vehicles are typically equipped with multiple cameras for surround-view monitoring and autonomous driving perception. Due to the high dust and mud-splashing environment of mining areas, contaminants easily adhere to the camera lens surfaces, causing blurred images and severely impacting driving safety and system reliability. Existing lens contamination detection solutions mostly employ a single-camera self-inspection method, analyzing the clarity, contrast, or texture features of the images captured by that camera to determine lens contamination. However, when a lens is severely contaminated (e.g., completely covered in mud), the output image information itself is severely distorted or lost. Analysis algorithms relying on image content struggle to effectively distinguish between lens contamination itself and abnormal ambient lighting (e.g., strong backlighting, nighttime) or the presence of obstructions in the scene. This leads to a significant decrease in detection reliability under heavy contamination and extreme lighting conditions, resulting in missed and false detections. Furthermore, multiple cameras on mining vehicles often have overlapping or opposing fields of view, but existing systems typically manage each camera as an independent unit, failing to effectively utilize the spatial and visual relationships between these cameras to assist in more reliable contamination assessments. In terms of cleaning control, existing systems mostly adopt open-loop control, which means that the cleaning action is considered complete once it is triggered. There is a lack of objective and automated means to confirm the cleaning effect, and it is impossible to determine whether the cleaning meets the standards or whether the cleaning mechanism has malfunctioned, which affects the overall availability and maintenance efficiency of the system. Summary of the Invention

[0003] This application provides a method and related equipment for detecting dirt in a camera lens, which can be used to achieve closed-loop verification and strategy optimization of cleaning effect.

[0004] The first aspect of this application provides a method for detecting dirt in a camera lens, including:

[0005] According to a preset mutual monitoring relationship model, the lens area image containing the lens surface of the monitored camera is extracted from the monitoring video image of the monitoring camera; wherein, the mutual monitoring relationship model is established according to the installation position and viewing angle of each camera on the vehicle, and the mutual monitoring relationship model ensures that the lens surface of each monitored camera is observed within the field of view of at least one other monitoring camera.

[0006] The extracted image of the lens area is processed to calculate the final dirt score of the monitored camera;

[0007] If the final dirt score exceeds a preset dirt threshold, a cleaning operation is triggered for the monitored camera.

[0008] A second aspect of this application provides a dirt detection device for a camera lens, comprising:

[0009] The extraction unit is used to extract the lens area image containing the lens surface of the monitored camera from the monitoring video image of the monitoring camera according to a preset mutual monitoring relationship model; wherein, the mutual monitoring relationship model is established according to the installation position and viewing angle of each camera on the vehicle, and the mutual monitoring relationship model ensures that the lens surface of each monitored camera is observed within the field of view of at least one other monitoring camera.

[0010] A calculation unit is used to process the extracted image of the lens area and calculate the final dirt score of the monitored camera.

[0011] The triggering unit is used to trigger a cleaning operation on the monitored camera when the final dirt score exceeds a preset dirt threshold.

[0012] The camera lens dirt detection device provided in the second aspect of this application is used to perform the camera lens dirt detection method described in the first aspect.

[0013] A third aspect of this application provides a computer program product including computer-readable instructions that, when executed on an electronic device, cause the electronic device to implement the dirt detection method for a camera lens described in the first aspect or any implementation thereof.

[0014] A fourth aspect of this application provides an electronic device, including at least one processor and a memory connected to the processor, wherein:

[0015] The memory is used to store computer programs;

[0016] The processor is used to execute the computer program so that the electronic device can implement the dirt detection method for the camera lens of the first aspect or any implementation thereof.

[0017] The fifth aspect of this application provides a computer storage medium carrying one or more computer programs that, when executed by an electronic device, enable the electronic device to perform a dirt detection method on a camera lens according to the first aspect or any implementation thereof.

[0018] As can be seen from the above technical solutions, the embodiments of this application have the following advantages: By constructing a camera lens mutual monitoring network and directly observing the physical surface of the lens from a third-party perspective, the method for detecting dirt in a camera lens disclosed in this application fundamentally overcomes the problem of self-test failure of a single camera when heavily dirty or completely obscured, significantly improving the detection accuracy in severely polluted scenarios. Simultaneously, the introduction of mutual monitoring relationships effectively resists interference from complex lighting in mining areas, greatly reducing the false detection rate. Furthermore, through quantitative scoring comparison before and after cleaning, automated closed-loop verification and strategy optimization of the cleaning effect are achieved, improving the first-time cleaning success rate and overall system maintenance efficiency, and enhancing the robustness and reliability of the system. Attached Figure Description

[0019] The above and other features, advantages, and aspects of the embodiments of this disclosure will become more apparent from the accompanying drawings and the following detailed description. Throughout the drawings, the same or similar reference numerals denote the same or similar elements. It should be understood that the drawings are schematic, and elements are not necessarily drawn to scale.

[0020] Figure 1 This is a schematic diagram of the architecture of a dirt detection system for a camera lens disclosed in an embodiment of this application;

[0021] Figure 2 This is a schematic flowchart of a method for detecting dirt in a camera lens disclosed in an embodiment of this application;

[0022] Figure 3 This is a schematic flowchart of another method for detecting dirt in a camera lens disclosed in an embodiment of this application;

[0023] Figure 4 This is a schematic flowchart of another method for detecting dirt in a camera lens disclosed in an embodiment of this application;

[0024] Figure 5 This is a schematic flowchart of another method for detecting dirt in a camera lens disclosed in an embodiment of this application;

[0025] Figure 6 This is a schematic flowchart of another method for detecting dirt in a camera lens disclosed in an embodiment of this application;

[0026] Figure 7 This is a schematic diagram of the structure of a dirt detection device for a camera lens disclosed in an embodiment of this application;

[0027] Figure 8 This is a schematic diagram of the structure of an electronic device disclosed in an embodiment of this application. Detailed Implementation

[0028] The embodiments of this application are described below with reference to the accompanying drawings. The terminology used in the implementation section of this application is for explaining specific embodiments only and is not intended to limit the scope of this application.

[0029] The embodiments of this application will now be described with reference to the accompanying drawings. Those skilled in the art will recognize that, with technological advancements and the emergence of new scenarios, the technical solutions provided in the embodiments of this application are equally applicable to similar technical problems.

[0030] The terms "first," "second," etc., used in the specification, claims, and accompanying drawings of this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such terms are interchangeable where appropriate; this is merely a way of distinguishing objects with the same attributes in the embodiments of this application. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion, so that a process, method, system, product, or apparatus that comprises a series of elements is not necessarily limited to those elements but may include other elements not explicitly listed or inherent to those processes, methods, products, or apparatuses.

[0031] Figure 1 This is a schematic diagram of the architecture of a camera lens dirt detection system disclosed in an embodiment of this application. The overall architecture of the camera lens dirt detection system of this application consists of four core modules. Specifically, these include a camera array and mutual monitoring module, a mutual monitoring image acquisition and preprocessing module, a lens dirt detection and analysis module, and a cleaning trigger and effect confirmation module.

[0032] The camera array and mutual monitoring module manages all onboard cameras and their mutual monitoring layout. Each camera not only performs environmental imaging of its assigned area but also observes the lens surfaces of one or more adjacent cameras. The mutual monitoring image acquisition and preprocessing module receives the raw video streams from each camera, crops the area containing the monitored camera lens from the monitoring camera images according to the mutual monitoring topology table, and integrates processing steps such as dynamic anchor point correction and illumination normalization. The lens contamination detection and analysis module takes the standardized region of interest (ROI) image of the lens as input, calculates the lens contamination score through multi-feature fusion, and performs weighted fusion of the multi-path detection results based on the mutual monitoring quality score. The cleaning trigger and effect confirmation module selects a cleaning strategy based on the final contamination score, sends control commands to the cleaning execution mechanism, and re-executes contamination detection after cleaning, calculates the cleaning efficiency, and provides a result judgment.

[0033] Depend on Figure 1As can be seen, the technical solution of this application utilizes the dense layout and overlapping fields of view of multiple cameras on mining vehicles to connect these cameras (such as cameras C1, C2, C3, or C4) into a collaborative network through mutual monitoring. During the system design phase, the installation positions and viewing angles of the cameras are planned to ensure that the lens area of ​​each monitored camera falls within the field of view of at least one monitoring camera.

[0034] During operation, based on the mutual monitoring relationship between different cameras, the system extracts the region of interest (ROI) containing the surface of the monitored camera lens (e.g., the glass lens area) from the images of the monitoring cameras in real time. Then, through lens ROI extraction and dynamic anchor point correction, the illumination normalization of the camera housing is achieved. Specifically, dynamic anchor point correction is used to address vehicle vibration, and the lens housing area is used as the illumination reference for normalization processing.

[0035] After normalization, lens contamination detection and analysis are completed. Specifically, based on the normalized third-party viewpoint lens images, the system uses a multi-feature fusion method to calculate the contamination score and performs weighted fusion of multiple detection results according to mutual monitoring quality.

[0036] Furthermore, when the dirt score of the target lens exceeds the threshold, the system triggers a cleaning action. After cleaning, the system coordinates with the monitoring camera to re-capture images of the lens area, compares the score changes before and after cleaning, determines whether the cleaning meets the standards, and forms a complete closed loop of detection-cleaning-re-inspection.

[0037] To further understand Figure 1 The system architecture shown can be found in [reference]. Figures 2 to 6 The illustrated embodiment.

[0038] Please see Figure 2 , Figure 2 This is a flowchart illustrating a method for detecting dirt in a camera lens according to an embodiment of this application. It includes steps 201-203.

[0039] 201. Based on the preset mutual monitoring relationship model, extract the lens area image containing the lens surface of the monitored camera from the monitoring video image of the monitoring camera.

[0040] In some embodiments, the system uses sets and matrices to model the mutual monitoring relationships of multiple cameras, thereby establishing a mutual monitoring relationship model. Here, the mutual monitoring relationship of multiple cameras should be understood as the fact that the lens surface of each camera can be observed by at least one other camera. In this embodiment, it is described as the lens surface of the monitored camera being observed within the field of view of at least one other monitoring camera.

[0041] In some embodiments, based on the mutual monitoring relationship model between the surveillance camera and the monitored camera, the lens area image containing the lens surface of the monitored camera can be extracted from the surveillance video image of the surveillance camera using lens ROI technology.

[0042] In some embodiments, in the mutual monitoring model, the surveillance camera always monitors the monitored camera. Meanwhile, since vehicle-mounted cameras typically have a large monitoring area, the lens of the monitored camera occupies only a small area in the surveillance camera image. Therefore, lens ROI technology and illumination normalization technology are needed to extract the lens area image. In this embodiment, the lens area image can also be understood as the image of the region of interest (specifically, the glass mirror of the monitored camera).

[0043] For easier understanding, please refer to Figure 3 and Figure 4 The illustrated embodiment.

[0044] 202. Process the extracted lens area image and calculate the final dirt score of the monitored camera.

[0045] In some embodiments, it is necessary to perform dirt detection on the extracted lens area image. The system quantifies the degree of lens dirt based on three aspects: structural similarity, texture anomalies, and edge sharpness, to process the lens area image. Then, by fusing the quantified lens dirt levels, a final dirt score for the monitored camera is obtained.

[0046] In some embodiments, for the current normalized lens ROI image (i.e., the current lens region image) and the clean reference image (which can be understood as the lens region image in a clean state, or the cleaned lens region image), structural similarity is first calculated. Secondly, texture features are extracted using the Local Binary Pattern (LBP) method, and the chi-square distance between the LBP histograms of the current image and the reference image is calculated. Then, the average gradient intensity is calculated within the lens edge region. It should be noted that the LBP method is used to extract texture features and calculate the chi-square distance, while the average gradient intensity is calculated separately in the lens edge region using a conventional gradient operator (such as Sobel) to measure edge sharpness. Furthermore, by fusing the above features, a comprehensive dirt score corresponding to a surveillance camera is obtained, along with the final dirt score for all surveillance cameras corresponding to that monitored camera.

[0047] For easier understanding, please refer to Figure 5 The illustrated embodiment.

[0048] 203. If the final dirt score exceeds the preset dirt threshold, a cleaning operation will be triggered for the monitored camera.

[0049] In some embodiments, when the final dirt score of the monitored camera exceeds a preset dirt threshold, a cleaning operation is triggered for the monitored camera. Different dirt scores correspond to different degrees of dirtiness. The system can select an appropriate cleaning strategy based on the degree of dirtiness.

[0050] Among other feasible technical solutions, combined Figure 1 As shown, if the final dirt score does not exceed the preset dirt threshold, the regular monitoring strategy will continue to be implemented.

[0051] This embodiment discloses a method for detecting dirt on camera lenses. By constructing a multi-camera mutual monitoring model, it directly observes the physical surface of the lens from a third-party perspective, effectively solving the fundamental problem of self-test failure of a single camera under heavy dirt or complete obstruction. Lens ROI extraction and illumination normalization significantly improve detection stability under complex lighting conditions in mining areas. A weighted scoring mechanism integrating structure, texture, and edge features, combined with mutual monitoring quality arbitration, enhances detection accuracy and robustness. Furthermore, a graded cleaning strategy triggered by a scoring threshold and a closed-loop verification mechanism for cleaning effects enable intelligent and adaptive optimization of the cleaning process, significantly improving the first-time cleaning success rate and system maintenance efficiency.

[0052] Figure 3 This is a flowchart illustrating another method for detecting dirt in a camera lens disclosed in an embodiment of this application. It includes steps 301-304.

[0053] 301. Define the set of cameras for all cameras on the vehicle, and define the mutual monitoring reachability function.

[0054] In some embodiments, all cameras on the vehicle establish a mutual monitoring relationship model. Here, the set of cameras installed on the vehicle is defined as follows: , This represents the total number of cameras. Also, for any pair of cameras... Define the mutual reachability function .

[0055] Furthermore, when the surveillance camera The field of view (or angle of view) can cover the monitored camera. When defining the lens surface When the surveillance camera The field of view (or angle of view) cannot cover the monitored camera. When the lens surface is defined as .

[0056] 302. Construct an N×N dimensional mutual adjacency matrix based on the mutual monitoring reachability function.

[0057] In some embodiments, based on the mutual monitoring reachability function, a construction is made. dimensional mutual adjacency matrix Among them, the mutual monitoring adjacency matrix The matrix elements are .

[0058] 303. Ensure that any mutual monitoring adjacency matrix satisfies the coverage completeness constraint, such that for each monitored camera in the camera set, there exists at least one monitoring camera such that A ij =1.

[0059] In some embodiments, it is necessary to ensure that each monitored camera There is at least one surveillance camera. Capable of monitoring, i.e. .

[0060] Understandably, to ensure that the lens surface of each monitored camera can be observed by at least one other camera, the system design must satisfy a coverage integrity constraint. This constraint is as follows: .

[0061] 304. For any monitored camera belonging to the set of key cameras, ensure that the number of monitoring cameras monitoring the lens surface of the monitored camera is not less than the preset redundancy number.

[0062] In some embodiments, camera set This includes a collection of key cameras. Furthermore, there exists a set of key cameras. The monitored camera in the middle, that is, any It is necessary to configure the monitoring of the cameras being monitored. Surveillance camera with lens surface The number shall not be less than the preset redundancy number Then there is, In some embodiments, That is, the typical value is 2.

[0063] This embodiment discloses a method for detecting dirt in camera lenses. By constructing a formalized mutual monitoring relationship model, it achieves a precise mathematical description and systematic design of a multi-camera monitoring network for vehicles. Employing set and matrix modeling methods, the mutual monitoring topology between cameras can be clearly and structurally defined and verified, ensuring that the system meets the fundamental completeness requirement of "each camera being observed by at least one other camera" during the design and deployment phases. Furthermore, by introducing redundant monitoring quantity constraints for key cameras, the monitoring reliability and system robustness of core sensing nodes are significantly improved. Even if a monitoring camera temporarily fails or its view is obstructed, the key camera can still be covered by other monitoring sources, effectively preventing the risk of single-point monitoring failure and laying a solid foundation for subsequent stable and reliable collaborative detection of lens dirt.

[0064] Figure 4 This is a schematic flowchart of another method for detecting dirt in a camera lens disclosed in an embodiment of this application. It includes steps 401-404.

[0065] 401. During the calibration phase, the initial coordinates of the lens surface area of ​​each pair of mutual monitoring cameras are recorded, and multiple rigid feature points are selected as anchor points on the lens shell area of ​​the monitored cameras.

[0066] In some embodiments, the lens of the monitored camera occupies only a small area in the surveillance camera image. The mine truck experiences significant vibrations during operation, and if cropping is performed solely based on fixed coordinates, the lens area can easily shift. Therefore, the lens ROI extraction process can be divided into a calibration phase and an execution phase.

[0067] During the calibration phase, the initial coordinates of the lens surface area of ​​each pair of mutual monitoring cameras can be recorded. Furthermore, multiple rigid feature points are selected as anchor points on the lens housing area of ​​the monitored camera. It is understood that each pair of mutually monitored cameras includes the monitored camera. and the surveillance camera that observes the monitored camera. .

[0068] In some embodiments, the system establishes a lens area lookup table for each pair of mutually monitored cameras during the calibration phase, recording the initial rectangular positions. Furthermore, multiple rigid feature points are selected on the lens housing as anchor points. Unlike the above, because the camera moves in four directions (front, back, left, and right), its height and width also need to be additionally calibrated; details will not be elaborated here. The following will only use left and right (… (This will be explained.)

[0069] 402. During the operation phase, the image offset of the current frame image in the monitoring video image is calculated by searching and matching anchor points near the initial coordinates, and the cropping center coordinates of the lens surface area are corrected according to the image offset.

[0070] In some embodiments, during the runtime phase, the anchor points are first searched for and matched near the initial coordinates, and the image offset of the current frame image in the surveillance video image is calculated. And correct the crop center coordinates of the lens surface area based on the image offset. .in, .

[0071] Furthermore, the system searches for the anchor points of the current frame near the reference coordinates to obtain the overall offset. The cutting center position is corrected according to the offset, that is... .in, The initial coordinates of the lens center (in pixels) recorded during the calibration phase. The position offset calculated based on anchor point matching (in pixels, typical range is...). ). These are the lens center coordinates (in pixels) after dynamic anchor point correction.

[0072] 403. Select the lens shell area of ​​the monitored camera as the illumination reference benchmark, calculate the current average gray value of the lens shell area in the current frame image, and compare it with the reference average gray value obtained in the calibration stage to obtain the illumination compensation coefficient.

[0073] In some embodiments, after calibration, to address the complex lighting issues in mining areas, the lens housing area of ​​the monitored camera can be used as a lighting reference. The lens housing is typically made of black or dark gray matte material, and its brightness variations mainly originate from changes in ambient light. Therefore, the system acquires reference images during the calibration phase and calculates the average grayscale value of the lens housing area. (That is, the reference average grayscale value mentioned above) is used as a reference value. Simultaneously, during operation, the average grayscale value of the current outer shell area is calculated. (i.e., the current average gray value mentioned above), and obtain the illumination compensation coefficient. Understandably, Typical range is , dimensionless.

[0074] In some embodiments, the illumination compensation coefficient The calculation method is as follows:

[0075] ,in, To prevent small constants from being divided by zero, For truncation function

[0076] A number is a function that truncates the input value to its upper or lower bounds. This represents the lower limit of the illumination compensation coefficient. This represents the upper limit of the illumination compensation coefficient.

[0077] 404. Use the illumination compensation coefficient to perform illumination normalization processing on the extracted lens surface area image to obtain the lens area image.

[0078] In some embodiments, the illumination compensation coefficient is then used. The extracted image of the lens surface region (mainly the lens glass area) is subjected to illumination normalization processing to obtain the lens region image. The calculation formula for illumination normalization is as follows: ,in, It refers to the grayscale values ​​of pixels on the lens surface after illumination normalization (or, in other words, the grayscale values ​​of pixels on the glass area after normalization). It refers to the grayscale value of the pixels on the lens surface (or, in other words, the grayscale value of the current pixel in the lens glass area).

[0079] This embodiment discloses a method for detecting dirt in camera lenses. By pre-setting anchor points during the calibration phase and matching them in real time during operation, it achieves dynamic tracking and precise positioning of the lens area, significantly improving the stability and accuracy of ROI extraction under vibration conditions. Simultaneously, by utilizing the optically stable lens casing as a lighting reference, and calculating and compensating for changes in ambient light, it achieves real-time brightness normalization of the lens glass area, eliminating interference from complex lighting conditions such as strong light, backlight, and nighttime on the dirt detection algorithm. The combination of these two technologies ensures that the image area used for subsequent dirt scoring calculations remains in a stable position and with standardized lighting, laying a solid data foundation for highly reliable lens dirt detection.

[0080] Figure 5 This is a flowchart illustrating another method for detecting dirt in a camera lens disclosed in an embodiment of this application. It includes steps 501-502.

[0081] 501. For any image of the lens area provided by a surveillance camera, extract the multi-dimensional difference features between the image of the lens area and the clean state reference image, and fuse them to generate a comprehensive dirt score.

[0082] In some embodiments, the system can quantify the degree of lens dirtiness from multiple aspects such as structural similarity, texture feature differences, or edge sharpness. Specifically, the normalized lens region image (lens ROI image) can be extracted first. and a reference image of a clean state. The multidimensional differences between them are then integrated to generate a comprehensive dirt score. Understandably, a clean state reference image. An image of the lens surface area of ​​the monitored camera in a clean state.

[0083] In some embodiments, generating a comprehensive dirt score may first involve calculating structural similarity. Secondly, texture features are extracted using the Local Binary Pattern (LBP) method, and the chi-square distance between the LBP histograms of the current image and the reference image is calculated. Then, the average gradient intensity is calculated in the lens edge region. Specifically, texture feature differences This is obtained by comparing the local binary pattern histogram between the current lens region image and a clean reference image. Edge sharpness ratio The gradient is obtained by calculating the ratio of the average gradient intensity of the current lens region image to that of the clean reference image in the lens edge region. Based on step 203 above, this embodiment will not further describe the LBP method and gradient calculation method.

[0084] As can be seen from the above description, regarding structural similarity... ,have:

[0085] ,in, This is the normalized image of the lens region of interest (Lens ROI image). The average gray level, Reference image in a clean state The average gray level, , This represents the standard deviation of the grayscale values ​​of the corresponding image. For covariance, To prevent the denominator from approaching 0, a constant.

[0086] In some embodiments, the state of the image lens may be a clean lens, a slightly dirty lens, or a heavily dirty lens.

[0087] For example, in a clean lens reference image acquired during the calibration phase, the lens glass area exhibits uniform transparency when the lens is clean. When the lens being acquired is also clean, the average grayscale value of the current image... grayscale standard deviation Covariance of two images .at this time A value close to 1 (approximately 0.96) indicates that the current lens is highly consistent with a clean reference state.

[0088] When the lens is slightly dirty, with a small amount of dust or water stains on the lens surface, localized brightness changes occur. Current image grayscale average. grayscale standard deviation (Increased due to increased contrast between stained and clean areas), covariance of the two images (Lower correlation with the reference image due to localized contamination). At this time... The value is approximately 0.72, which the system classifies as slightly dirty.

[0089] When the lens is heavily soiled, with a large area of ​​the lens surface covered in mud, the image exhibits obvious non-uniform occlusion characteristics. Current image grayscale mean. (Darkening due to mud obscuring the surface), grayscale standard deviation (The covariance of the two images increases significantly due to the large contrast between the mud edge and the transparent area) (Due to extensive occlusion, it is almost irrelevant to the reference image). At this time... The value is approximately 0.31, which the system determines as heavily soiled and triggers a powerful cleaning process.

[0090] This reflects the following physical law: grayscale standard deviation In terms of aspect ratio, the dirtier the lens, the more pronounced the grayscale contrast between the contaminants and the clean areas, and the larger the standard deviation; covariance... In this respect, the dirtier the lens, the lower the correlation between the pixel changes of the current image and the clean reference image, and the smaller the covariance.

[0091] Therefore, combining the above-mentioned quantitative indicators, its comprehensive dirt score... It can be calculated by weighted fusion of the structural similarity, the texture feature difference, and the edge sharpness.

[0092] , For feature fusion weight coefficients, The edge gradient intensity of the clean reference image. To prevent division by zero by small constants. In some embodiments, The range of values ​​is The closer the value is to 1, the dirtier it is.

[0093] 502. If the lens surface of the same monitored camera is observed simultaneously by multiple monitoring cameras, a mutual monitoring quality score is calculated for each monitoring camera, and the corresponding comprehensive dirt score is weighted and fused based on the mutual monitoring quality score to obtain the final dirt score of the monitored camera.

[0094] In some embodiments, if the lens surface of the same monitored camera is monitored simultaneously by multiple monitoring cameras, the system can define a mutual monitoring quality score. The observation conditions are quantified. These conditions must include at least the distance factor. Angle factor and resolution factor The formula for calculating the mutual monitoring quality score is:

[0095] ,in, These are weighting coefficients (typical values ​​are 0.3, 0.4, and 0.3). It should be noted that this is the distance factor. Angle factor reflects the degree of deviation between the actual observation distance and the optimal observation distance. The cosine of the angle between the optical axis of the surveillance camera and the normal to the lens surface of the camera being monitored; resolution factor. This reflects whether the pixel area occupied by the lens of the monitored camera in the monitoring video image meets the detection requirements.

[0096] In some embodiments, distance factor Angle factor and resolution factor They are defined as follows:

[0097] ,

[0098] ,

[0099] ,

[0100] in, For surveillance cameras To the surveillance camera Spatial distance at the center of the lens (in meters). The desired optimal observation distance (typically 0.5 meters) is given. The angle between the optical axis and the normal to the lens surface. The pixel area of ​​the lens in the surveillance image. This is the minimum effective pixel area threshold for lens imaging. When the imaging area of ​​the lens in the monitoring image reaches this value, the resolution is considered to meet the detection requirements (typically 2500 square pixels). This is the distance tolerance variance in the distance factor, which controls the rate at which the score decreases when the actual observed distance deviates from the optimal distance. The larger the value, the higher the tolerance for distance deviation (typically 0.3 meters).

[0101] Therefore, combining the above-mentioned mutual monitoring quality score, for the monitored cameras The weighted fusion is then performed to obtain the final dirt score. Among them, the final dirt score The calculation formula is:

[0102] ,in, For all cameras that can monitor the monitored cameras A collection of cameras.

[0103] This embodiment discloses a method for detecting dirt on camera lenses. First, by fusing image features across three dimensions—structural similarity, texture anomalies, and edge sharpness—it comprehensively and meticulously captures subtle differences in the lens surface under various contamination states, ranging from slight dust accumulation to heavy mud coverage. This is then converted into a quantified comprehensive dirt score, significantly improving the accuracy and discriminative power of dirt level assessment. Second, for scenarios where the same lens is observed collaboratively by multiple cameras, an innovative mutual monitoring quality scoring model based on factors such as distance, angle, and resolution is introduced. This model objectively evaluates the observation conditions of different monitoring sources and weights and fuses the multi-source detection results accordingly to obtain the final dirt score. This mechanism not only effectively integrates multi-view information and improves detection confidence but also automatically reduces the weight of some monitoring sources when their observation quality deteriorates due to poor angles, excessive distances, or temporary anomalies. This ensures the overall detection stability and reliability of the system under non-ideal observation conditions, thus achieving a leap from single-source qualitative judgment to multi-source quantitative arbitration.

[0104] After completing step 203, a dirt score can be obtained after the cleaning operation. Based on the change between the final dirt score before and after cleaning, the cleaning effect can be determined to complete the cleaning operation loop. In some embodiments, after the cleaning operation is completed and a short period of stabilization is achieved, the system again acquires the ROI image of the monitored camera from the monitoring camera and obtains the dirt score after cleaning (see steps 202 to 203 above for details). Then, based on the change in the dirt score before and after cleaning, the cleaning effect can be determined to complete the cleaning operation loop. In some embodiments, the cleaning efficiency index can be obtained from the dirt scores before and after cleaning, and combined with the dirt score after cleaning, the cleaning effect of the cleaning operation can be effectively determined, thereby further executing other cleaning strategies. For easier understanding, please refer to... Figure 6 The illustrated embodiment. Figure 6 This is a flowchart illustrating another method for detecting dirt in a camera lens disclosed in an embodiment of this application. It includes steps 601-604.

[0105] 601. Select the corresponding cleaning strategy based on the different threshold ranges of the final dirt score.

[0106] In some embodiments, different cleaning strategies can be selected by determining the different threshold ranges in which the final dirt score falls. For example, a cleaning strategy may include at least one or more combinations of air blowing, water spraying, or wiping with a scraper, along with the corresponding duration and intensity of action.

[0107] Furthermore, its threshold range can be set to (Including upper and lower limits), by judging the final dirt score and The ratio (or the interval in which it is located) determines the appropriate cleaning strategy.

[0108] 602. Send control commands to the cleaning actuator corresponding to the monitored camera to execute the selected cleaning strategy.

[0109] In some embodiments, in conjunction with step 601, a control command is sent to the cleaning actuator corresponding to the monitored camera to execute the selected cleaning strategy. For example, light dirt can be treated with short-duration low-pressure air blowing, moderate dirt can be treated with air blowing plus short-duration water spraying, and heavy dirt can be treated with water spraying plus multiple wipes with a scraper. Specific details are not limited here.

[0110] 603. Calculate cleaning efficiency.

[0111] In some embodiments, after the cleaning action is completed and a short period of stabilization has elapsed, the system again acquires the ROI image of the target lens from the monitoring camera to obtain a dirt score after cleaning. The system defines cleaning efficiency metrics: ,in, The final dirt score before cleaning. The final dirt score after cleaning. To prevent small constants from being divided by zero. The cleaning efficiency (dimensionless, normally ranging from...) ).

[0112] 604. The cleaning result is determined based on the final dirt score and cleaning efficiency after cleaning.

[0113] In some embodiments, the system may be configured with a residual threshold, which is then combined with the final dirt score after cleaning. and cleaning efficiency The cleaning results are then assessed.

[0114] For example, if If the cleaning is successful, then the cleaning is considered complete.

[0115] like and If the cleaning is deemed effective, a second cleaning or upgraded cleaning strategy will be triggered; among them... This is a preset effective cleaning efficiency threshold.

[0116] like and If the cleaning fails, an alarm will be triggered and a manual maintenance request will be sent.

[0117] This embodiment discloses a method for detecting dirt in camera lenses, achieving precise, efficient, and automated management of the cleaning process through intelligent graded cleaning and closed-loop effect verification. First, the system automatically matches and executes differentiated cleaning strategies (such as different combinations and intensities of air blowing, water spraying, and scraping) based on different threshold ranges of the quantified dirt score. This optimizes the allocation and efficient utilization of cleaning resources, avoiding the over- or under-cleaning problems of traditional single-method cleaning, and improving the targeting and efficiency of cleaning. Second, it innovatively introduces a quantitative indicator of cleaning efficiency, combining it with the residual score after cleaning to construct a two-dimensional criterion of "score-efficiency." This mechanism can not only objectively determine whether a single cleaning achieves the target cleanliness (success), but also intelligently identify whether the cleaning action is effective (passing the efficiency threshold) and whether there are potential faults in the cleaning mechanism (alarms are triggered when efficiency is low). This forms a complete closed loop of "detection—trigger—execution—verification—feedback—re-decision," significantly improving the system's first-time cleaning success rate, the level of intelligent maintenance response, and overall operational reliability, effectively ensuring that the camera remains in a clear and usable state.

[0118] It should be understood that although the steps in the flowcharts of the embodiments described above are shown sequentially according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some steps in the flowcharts of the embodiments described above may include multiple steps or multiple stages. These steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these steps or stages is not necessarily sequential, but can be performed alternately or in turn with other steps or at least a portion of the steps or stages of other steps.

[0119] The above describes a method for detecting dirt in a camera lens according to embodiments of this application. The following describes the apparatus for performing the above-described method for detecting dirt in a camera lens. Please refer to [link / reference]. Figure 7 , Figure 7 This is a schematic diagram of a dirt detection device for a camera lens provided in an embodiment of this application. Figure 7 As shown, the dirt detection device for the camera lens includes:

[0120] Extraction unit 701 is used to extract a lens area image containing the lens surface of the monitored camera from the monitoring video image of the monitoring camera according to a preset mutual monitoring relationship model; wherein, the mutual monitoring relationship model is established according to the installation position and viewing angle of each camera on the vehicle, and the mutual monitoring relationship model ensures that the lens surface of each monitored camera is observed within the field of view of at least one other monitoring camera.

[0121] The calculation unit 702 is used to process the extracted lens area image and calculate the final dirt score of the monitored camera.

[0122] Trigger unit 703 is used to trigger a cleaning operation for the monitored camera when the final dirt score exceeds a preset dirt threshold.

[0123] For example, the device further includes: a defining unit 704, a constructing unit 705, and a determining unit 706;

[0124] Define unit 704, which is used to define the camera set of all cameras on the vehicle. ;in, This represents the total number of cameras;

[0125] Unit 704 is also used to define mutual reachability functions. Among them, if the surveillance camera The field of view can cover the surveillance camera The surface of the lens, Otherwise ;

[0126] Construction unit 705 is used to construct based on the mutual reachability function. dimensional mutual adjacency matrix ;in matrix elements ;

[0127] Determining unit 706 is used to ensure that any mutual monitoring adjacency matrix satisfies the coverage completeness constraint, so that for the camera set Each of the monitored cameras There is at least one surveillance camera. , making ;in, .

[0128] For example, a camera set Including key camera sets The device also includes:

[0129] The determining unit 706 is also used for any Ensure that the monitored cameras are monitored The number of surveillance cameras on the lens surface shall not be less than the preset redundancy number. ;in , .

[0130] For example, the device further includes: a recording unit 707 and an acquisition unit 708;

[0131] Recording unit 707 is used to record the initial coordinates of the lens surface area of ​​the monitored camera for each pair of mutual monitoring cameras during the calibration phase. And select multiple rigid feature points as anchor points on the lens housing area of ​​the monitored camera; wherein, each pair of mutual monitoring cameras includes the monitored camera and the monitoring camera observing the monitored camera; wherein, For the first One surveillance camera;

[0132] The calculation unit 702 is also used to calculate the image offset of the current frame image in the surveillance video image by searching and matching anchor points near the initial coordinates during the running phase. And correct the crop center coordinates of the lens surface area based on the image offset. ;in, ;

[0133] The calculation unit 702 is also used to select the lens housing area of ​​the monitored camera as a lighting reference and calculate the current average gray value of the lens housing area in the current frame image. and compared with the reference average gray value obtained during the calibration phase. By comparison, the illumination compensation coefficient is obtained. ;

[0134] Acquisition unit 708 is used to obtain the illumination compensation coefficient. The extracted image of the lens surface area is subjected to illumination normalization processing to obtain the lens area image.

[0135] For example,

[0136] Illumination compensation coefficient The calculation method is as follows: ,in, To prevent small constants from being divided by zero, This is a truncation function. This represents the lower limit of the illumination compensation coefficient. This represents the upper limit of the illumination compensation coefficient;

[0137] The formula for calculating illumination normalization is: ,in, This represents the grayscale value of the pixels on the lens surface after illumination normalization. This represents the grayscale value of the pixels on the lens surface.

[0138] Exemplarily, the device includes:

[0139] Extraction unit 701 is specifically used for extracting images of the lens area provided by any surveillance camera. Extract the image of the lens area. Reference image in clean state The multidimensional differences between them are analyzed and fused to generate a comprehensive dirt score. Among them, the clean state reference image An image of the lens surface area of ​​the monitored camera in a clean state;

[0140] The computing unit 702 is specifically used when the same monitored camera The lens surface is covered by multiple surveillance cameras During simultaneous observation, a mutual monitoring quality score is calculated for each surveillance camera. Based on the mutual monitoring quality scores, each entity will receive a corresponding comprehensive dirt score. Weighted fusion is performed to obtain the monitored camera Final dirt score ;in, The serial number used to identify the camera.

[0141] For example, multi-dimensional difference features include: structural similarity, texture feature difference, and edge sharpness ratio;

[0142] Structural similarity It is used to measure the overall structural consistency between the current lens area image and the clean reference image;

[0143] Texture feature differences It is obtained by comparing the local binary pattern histogram between the current lens area image and the clean state reference image;

[0144] Edge sharpness ratio It is obtained by calculating the ratio of the average gradient intensity of the current lens region image to that of the clean state reference image in the lens edge region;

[0145] Overall Dirt Score It is calculated by weighted fusion of structural similarity, texture feature difference and edge sharpness;

[0146] ,in, For feature fusion weight coefficients, The edge gradient intensity of the clean reference image. To prevent small constants from being divided by zero.

[0147] Exemplarily, the device includes:

[0148] The computing unit 702 is specifically used for computing based on surveillance cameras. With the surveillance camera The mutual monitoring quality score is calculated based on the mutual monitoring quality score calculation formula, taking into account the observation conditions between them; the observation conditions include at least the distance factor. Angle factor and resolution factor The formula for calculating the mutual monitoring quality score is:

[0149] ,in, These are the weighting coefficients;

[0150] Final Dirt Score The calculation formula is:

[0151] ,in, For all cameras that can monitor the monitored cameras A collection of cameras.

[0152] For example, the device further includes: a selection unit 709 and an execution unit 710;

[0153] Selection unit 709 is used to select the corresponding cleaning strategy according to the different threshold ranges of the final dirt score. The cleaning strategy includes at least one or more combinations of air blowing, water spraying or scraping, as well as the corresponding action time and intensity.

[0154] The execution unit 710 is used to send control commands to the cleaning execution mechanism corresponding to the monitored camera to execute the selected cleaning strategy.

[0155] For example, the device further includes: a determination unit 711;

[0156] The acquisition unit 708 is also used to acquire a dirt score after cleaning;

[0157] The calculation unit 702 is further configured to calculate the cleaning efficiency based on the change in the final dirt score before cleaning and the dirt score after cleaning. ,in, The final dirt score before cleaning. The final dirt score after cleaning. To prevent division by zero of small constants;

[0158] Judgment unit 711 is used to determine the final dirt score after cleaning. and cleaning efficiency The cleaning results were then assessed.

[0159] Judgment unit 711 is also used when If the cleaning is successful, then the cleaning is considered complete. This is the preset threshold for cleaning residue;

[0160] Judgment unit 711 is also used when and If the cleaning is deemed effective, a second cleaning or upgraded cleaning strategy will be triggered; among them, The preset effective cleaning efficiency threshold;

[0161] The judgment unit is also used when and If this happens, the cleaning process is deemed a failure, triggering an alarm.

[0162] This application also provides an electronic device in its embodiments. (See reference...) Figure 8 The diagram illustrates a structural schematic of an electronic device suitable for implementing the dirt detection method for a camera lens in the embodiments of this application. The electronic device in the embodiments of this application may include, but is not limited to, fixed terminals such as mobile phones, laptops, PDAs (personal digital assistants), PADs (tablet computers), desktop computers, etc. Figure 8 The electronic device shown is merely an example and should not impose any limitation on the functionality and scope of use of the embodiments of this application.

[0163] like Figure 8 As shown, the electronic device may include a processing unit (e.g., a central processing unit, a graphics processing unit, etc.) 801, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 802 or a program loaded from a storage device 808 into a random access memory (RAM) 803. When the electronic device is powered on, the RAM 803 also stores various programs and data required for the operation of the electronic device. The processing unit 801, ROM 802, and RAM 803 are interconnected via a bus 804. An input / output (I / O) interface 805 is also connected to the bus 804.

[0164] Typically, the following devices can be connected to I / O interface 805: input devices 806 including, for example, touchscreens, touchpads, keyboards, mice, cameras, microphones, accelerometers, gyroscopes, etc.; output devices 807 including, for example, liquid crystal displays (LCDs), speakers, vibrators, etc.; storage devices 808 including, for example, memory cards, hard drives, etc.; and communication devices 809. Communication device 809 allows electronic devices to communicate wirelessly or wiredly with other devices to exchange data. Although Figure 8Electronic devices with various devices are shown, but it should be understood that it is not required to implement or have all of the devices shown. More or fewer devices may be implemented or have alternatively.

[0165] This application also provides a computer program product including computer-readable instructions, which, when executed on an electronic device, cause the electronic device to implement any of the camera lens dirt detection methods provided in this application.

[0166] This application also provides a computer-readable storage medium carrying one or more computer programs. When the one or more computer programs are executed by an electronic device, the electronic device can implement any of the dirt detection methods for camera lenses provided in this application.

[0167] It should also be noted that the device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs. In addition, in the device embodiment drawings provided in this application, the connection relationship between modules indicates that they have a communication connection, which can be implemented as one or more communication buses or signal lines.

[0168] Through the above description of the embodiments, those skilled in the art can clearly understand that this application can be implemented by means of software plus necessary general-purpose hardware, or it can be implemented by special-purpose hardware including application-specific integrated circuits, special-purpose CPUs, special-purpose memory, special-purpose components, etc. Generally, any function performed by a computer program can be easily implemented by corresponding hardware, and the specific hardware structure used to implement the same function can also be diverse, such as analog circuits, digital circuits, or special-purpose circuits. However, for this application, software program implementation is more often a better implementation method. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product is stored in a readable storage medium, such as a computer floppy disk, USB flash drive, mobile hard disk, ROM, RAM, magnetic disk, or optical disk, etc., and includes several instructions to cause a computer device (which may be a personal computer, training equipment, or network device, etc.) to execute the methods described in the various embodiments of this application.

[0169] In the above embodiments, implementation can be achieved, in whole or in part, through software, hardware, firmware, or any combination thereof. When implemented in software, it can be implemented, in whole or in part, as a computer program product.

[0170] The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, all or part of the processes or functions described in the embodiments of this application are generated. The computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions may be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another. For example, the computer instructions may be transmitted from one website, computer, training device, or data center to another website, computer, training device, or data center via wired (e.g., coaxial cable, fiber optic, digital subscriber line DSL) or wireless (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium may be any available medium that a computer can store or a data storage device such as a training device or data center that integrates one or more available media. The available media may be magnetic media (e.g., floppy disks, hard disks, magnetic tapes), optical media (e.g., DVDs), or semiconductor media (e.g., solid-state drives (SSDs)).

Claims

1. A method for detecting dirt in a camera lens, characterized in that, Applied to vehicles equipped with multiple cameras, the method includes: According to a preset mutual monitoring relationship model, the lens area image containing the lens surface of the monitored camera is extracted from the monitoring video image of the monitoring camera; wherein, the mutual monitoring relationship model is established according to the installation position and viewing angle of each camera on the vehicle, and the mutual monitoring relationship model ensures that the lens surface of each monitored camera is observed within the field of view of at least one other monitoring camera. The extracted image of the lens area is processed to calculate the final dirt score of the monitored camera; If the final dirt score exceeds a preset dirt threshold, a cleaning operation is triggered for the monitored camera.

2. The method for detecting dirt in a camera lens according to claim 1, characterized in that, The process of establishing the preset mutual monitoring relationship model includes: Define the set of cameras on the vehicle. ; wherein, the This represents the total number of cameras; Define a mutual reachability function Wherein, if the surveillance camera The field of view can cover the monitored camera. The surface of the lens, Otherwise ; Based on the mutual reachability function, construct... dimensional mutual adjacency matrix ; wherein matrix elements ; Ensure that any of the aforementioned mutual monitoring adjacency matrices satisfies the coverage completeness constraint, such that for the set of cameras... Each of the monitored cameras There is at least one surveillance camera. , making ;in, .

3. The method for detecting dirt in a camera lens according to claim 2, characterized in that, The camera set Including key camera sets The method further includes: For any To ensure monitoring of the monitored cameras The number of surveillance cameras on the lens surface shall not be less than the preset redundancy number. ;in The .

4. The method for detecting dirt in a camera lens according to claim 1, characterized in that, The step of extracting the image of the lens area containing the lens surface of the monitored camera includes: During the calibration phase, the initial coordinates of the lens surface area of ​​each pair of mutually monitored cameras are recorded. And select multiple rigid feature points as anchor points on the lens housing area of ​​the monitored camera; wherein, each pair of mutual monitoring cameras includes the monitored camera and the monitoring camera observing the monitored camera; wherein, the For the first One surveillance camera; During the operation phase, the image offset of the current frame in the surveillance video image is calculated by searching for and matching the anchor points near the initial coordinates. And correct the crop center coordinates of the lens surface area according to the image offset. ; wherein, the ; The lens housing area of ​​the monitored camera is selected as the illumination reference, and the current average gray value of the lens housing area in the current frame image is calculated. and compared with the reference average gray value obtained in the calibration stage. By comparison, the illumination compensation coefficient is obtained. ; Using the aforementioned illumination compensation coefficient The image of the extracted lens surface area is subjected to illumination normalization processing to obtain the image of the lens area.

5. The method for detecting dirt in a camera lens according to claim 4, characterized in that, The illumination compensation coefficient The calculation method is as follows: , wherein To prevent small constants from being divided by zero, the For the truncation function, the The lower limit of the illumination compensation coefficient, the This is the upper limit of the illumination compensation coefficient; The calculation formula for the illumination normalization process is as follows: , wherein The grayscale values ​​of the pixels on the lens surface region after illumination normalization are... This represents the grayscale value of the pixels on the lens surface.

6. The method for detecting dirt in a camera lens according to claim 1, characterized in that, The step of processing the extracted image of the lens area to calculate the final dirt score of the monitored camera includes: For the image of the lens area provided by any surveillance camera Extract the image of the lens area. Reference image in clean state The multidimensional differences between them are analyzed and fused to generate a comprehensive dirt score. The clean state reference image; The image is of the lens surface area of ​​the monitored camera in a clean state; If the same monitored camera The lens surface is covered by multiple surveillance cameras Simultaneous observation involves calculating a mutual monitoring quality score for each surveillance camera. Based on the mutual monitoring quality score, the corresponding comprehensive dirt score is calculated. Weighted fusion is performed to obtain the monitored camera. The final dirt score ; wherein, the The serial number used to identify the camera.

7. The method for detecting dirt in a camera lens according to claim 6, characterized in that, The multi-dimensional difference features include: structural similarity, texture feature difference, and edge sharpness ratio; The structural similarity This is used to measure the overall structural consistency between the current lens area image and the clean state reference image; The texture feature differences It is obtained by comparing the local binary pattern histogram between the current lens area image and the clean state reference image; The edge sharpness ratio It is obtained by calculating the ratio of the average gradient intensity of the current lens region image to that of the clean state reference image in the lens edge region; The comprehensive dirt score It is calculated by weighted fusion of the structural similarity, the texture feature difference, and the edge sharpness; The , wherein For feature fusion weight coefficients, the The edge gradient intensity of the clean state reference image, the To prevent small constants from being divided by zero.

8. The method for detecting dirt in a camera lens according to claim 6, characterized in that, The calculation of the mutual monitoring quality score includes: Based on surveillance cameras With the surveillance camera The mutual monitoring quality score is calculated based on the mutual monitoring quality score calculation formula, taking into account the observation conditions between them; wherein, the observation conditions include at least a distance factor. Angle factor and resolution factor The formula for calculating the mutual monitoring quality score is: , wherein These are the weighting coefficients; The final dirt score The calculation formula is: , wherein For all cameras that can monitor the monitored cameras A collection of cameras.

9. The method for detecting dirt in a camera lens according to claim 1, characterized in that, The cleaning operation includes: Based on the different threshold ranges of the final dirt score, a corresponding cleaning strategy is selected. The cleaning strategy includes at least one or more combinations of air blowing, water spraying, or scraping, as well as the corresponding action time and intensity. Control commands are sent to the cleaning actuator corresponding to the monitored camera to execute the selected cleaning strategy.

10. The method for detecting dirt in a camera lens according to claim 1, characterized in that, After triggering the cleaning operation for the monitored camera, the method further includes: Obtain a dirt rating after cleaning; The cleaning efficiency is calculated based on the change in the final dirt score before and after cleaning. , wherein The final dirt score before cleaning, the The final dirt score after cleaning, the To prevent division by zero of small constants; Based on the final dirt score after cleaning and the cleaning efficiency The cleaning results are then assessed. like If the cleaning is successful, then the cleaning is considered complete; wherein, the... This is a preset threshold for cleaning residue; like and If the cleaning is deemed effective, a secondary cleaning or upgraded cleaning strategy will be triggered; wherein, the... The preset effective cleaning efficiency threshold; like and If the cleaning fails, an alarm will be triggered.

11. A dirt detection device for a camera lens, characterized in that, Applicable to vehicles equipped with multiple cameras, including: The extraction unit is used to extract the lens area image containing the lens surface of the monitored camera from the monitoring video image of the monitoring camera according to a preset mutual monitoring relationship model; wherein, the mutual monitoring relationship model is established according to the installation position and viewing angle of each camera on the vehicle, and the mutual monitoring relationship model ensures that the lens surface of each monitored camera is observed within the field of view of at least one other monitoring camera. A calculation unit is used to process the extracted image of the lens area and calculate the final dirt score of the monitored camera. The triggering unit is used to trigger a cleaning operation on the monitored camera when the final dirt score exceeds a preset dirt threshold.

12. A computer program product, characterized in that, Includes computer-readable instructions that, when executed on an electronic device, cause the electronic device to implement the dirt detection method for a camera lens as described in any one of claims 1 to 10.

13. An electronic device, characterized in that, It includes at least one processor and a memory connected to the processor, wherein: The memory is used to store computer programs; The processor is used to execute the computer program to enable the electronic device to implement the dirt detection method for a camera lens as described in any one of claims 1 to 10.

14. A computer storage medium, characterized in that, The storage medium carries one or more computer programs that, when executed by an electronic device, enable the electronic device to implement the dirt detection method for a camera lens as described in any one of claims 1 to 10.