Night mode lens attachment detection method, system, terminal and storage medium

Image segmentation and deep learning technology are used to identify attachments on the car lens in night mode, which solves the problem of difficulty in identifying attachments in the night environment and achieves effective alarm and safety assurance for the autonomous driving system.

CN110532876BInactive Publication Date: 2024-09-03ZONGMU TECH SHANGHAI CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN201910681096.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2019-07-26
Publication Date
2024-09-03
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

In night mode or in an environment with extremely low light intensity, attachments on the car lens (such as condensed water droplets, blurred water stains, dark stains) are difficult to identify, affecting the normal operation of the autonomous driving system, and existing technology cannot be effective Call the police.

Method used

Using image segmentation, feature extraction and early warning judgment methods, by continuously acquiring multiple frames of images, calculating grayscale histograms and saliency maps, combined with deep learning or suspected area segmentation algorithms, identify and separate attachment areas, and perform Verify and determine, and trigger an early warning when the cumulative number exceeds the alarm threshold.

Benefits of technology

In night mode, it can effectively identify and alarm attachments on the lens, reducing its impact on computer vision detection and ensuring the normal operation of the autonomous driving system and user safety.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN110532876B
    Figure CN110532876B
Patent Text Reader

Abstract

The present invention provides a method, system, terminal and storage medium for detecting objects attached to a lens in night mode, comprising the following steps: finding one or more frames of images with a light source in the background, converting the images into grayscale images, and calculating the grayscale histogram of the grayscale image; grading the pixel points in the grayscale histogram, calculating the spatial distances between different grayscale levels and other grayscale values, and calculating the sum of the distance values ​​between the grayscale levels and the product of probability coefficients; thereby obtaining a saliency map of different gray values, separating suspicious areas of attachments; extracting the contour area blurred by the attachment, and statistically calculating one or several evaluation indicators within the contour, determining whether the area is an attachment based on the comprehensive indicator results, accumulating and marking the determination area, and triggering an early warning when the cumulative number of times exceeds the alarm threshold. The present invention can identify attachments such as condensed water droplets, blurred water stains, dark stains, etc. on the lens in night mode or in an environment with extremely low light intensity.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of automotive electronic technology, and in particular to a method, system, terminal and storage medium for detecting objects attached to a lens in a night mode. Background Art

[0002] Among existing technologies, "Auto Valet Parking" has become one of the hot technologies in the field of autonomous driving, and it will also be an important milestone on the road to mass production of autonomous driving. As a complete automatic driverless car system, the AVP system drives the car at a low speed or parks the car in a limited area, such as a parking lot or surrounding roads. In addition, as a functional extension of parking assistance, it will also be one of the earliest commercialized fully autonomous driving functions.

[0003] During the driving process, the vehicle often encounters accidental reasons such as road conditions and weather, which may cause stains on the lens and rain blocking. These situations have a destructive effect on the normal operation of the AVP system. Therefore, when the vehicle is driving, it is necessary to detect the camera image to determine whether the imaging effect is credible.

[0004] In night mode, due to the low intensity of ambient light, the attachments on the lens are not easy to stand out. The presence of attachments in night mode will have a great interference effect on the visual perception and detection of objects, so how to identify attachments and alarm in extremely low light intensity at night has become an urgent problem to be solved. Summary of the invention

[0005] In order to solve the above-mentioned and other potential technical problems, the present invention provides a method, system, terminal and storage medium for detecting objects attached to the lens in night mode. In night mode or in an environment with extremely low light intensity, the method can identify condensed water droplets, blurred water stains, dark stains and other attachments on the lens. After the attachment area is detected, the area is verified and identified. After it is determined to be an attachment, the system is promptly alarmed to reduce the impact of lens attachments on computer vision detection.

[0006] A method for detecting objects attached to a lens in night mode, comprising the following steps:

[0007] S01: Image segmentation: segment the input image into suspected areas;

[0008] S02: Feature extraction: Extract the contour area blurred by the attachment, and perform statistical calculations on one or several evaluation indicators within the contour, and determine whether the area is an attachment based on the comprehensive indicator results;

[0009] S03: Early warning judgment: The judgment area is cumulatively marked, and an early warning is triggered when the cumulative number of times exceeds the alarm threshold.

[0010] Furthermore, in night mode, the image segmentation process of step S01 is as follows:

[0011] Continuously acquire multiple frames of captured images, find one or more frames of images with a light source in the background, convert the images into grayscale images, calculate the grayscale histogram of the grayscale image, and obtain a statistical array containing the grayscale value size, grayscale distribution, and frequency of occurrence of pixel points; classify the pixels in the grayscale histogram, calculate the spatial distance between different grayscale levels and other grayscale values, and calculate the distance value between grayscale levels and the sum of the product of probability coefficients; thereby obtaining a saliency map of different gray values ​​and separating the attached suspicious area.

[0012] Furthermore, the imaging characteristics of the attachment area attached to the lens at night are: when there is a light source in the background, it appears as a bright spot due to the refraction of the light source. The color image is converted into a grayscale image, and the image brightness value is used as the main basis for distinction and to reduce the amount of calculation. The grayscale histogram of the grayscale image is calculated. The grayscale histogram is a function of the grayscale distribution and is a statistic of the grayscale distribution in the image. The grayscale histogram is a statistical frequency of occurrence of all pixels in the digital image according to the size of the grayscale value:

[0013] P(k)=nk / N

[0014] Where N is the total number of pixels, nk is the number of pixels at gray level k;

[0015] Based on the grayscale histogram, the grayscale space distance between different grayscale levels and other grayscale values ​​is calculated;

[0016] D(k,i)=|ki|

[0017] Where D(k,i) represents the grayscale space distance from grayscale level k to grayscale level i;

[0018] Then the calculation method of the significance value of gray level k is the sum of the products of the gray distance value from gray level k to other gray levels and the probability coefficients of other gray values:

[0019]

[0020] S(k) represents the pixel significance value of gray level k, P(i) is the probability value of gray level i, and D(k,i) is the gray space distance value from gray level k to gray level i.

[0021] Thus, saliency maps with different gray values ​​are obtained, and the suspicious attached areas are separated.

[0022] Furthermore, in step S01, the image segmentation method can be implemented by using a suspected region segmentation algorithm or a deep learning method.

[0023] Furthermore, in step S01, the image segmentation method using the suspected region segmentation algorithm includes the following steps:

[0024] S011: Image segmentation downsampling,

[0025] S012: Extract fuzzy difference image,

[0026] S013: and perform multi-image superposition;

[0027] S014: Use one or more operations of binarization, filtering, morphology, and thresholding to achieve image segmentation of the suspected area.

[0028] Furthermore, in step S011, the image segmentation and downsampling operation is expressed as follows: assuming that the original captured image is an image with a pixel value of N*M, and assuming that the downsampling coefficient is k, the downsampling operation is to take a point every k pixels in each row and column of the original captured image to form a downsampled image. The role of the downsampled image is to reduce the computational complexity of image processing and ensure the real-time performance of image processing.

[0029] Furthermore, in step S012, the operation of extracting the fuzzy difference image is expressed as follows: blurring the captured image with a filter operator, subtracting the original image from the image after blurring, taking the absolute value, and obtaining the fuzzy difference image.

[0030] Assume that xsrc is the original image, xblur is the image obtained by blurring and smoothing, and define the current blur difference image as: deltax = |xsrc-xblur|. The purpose of extracting the blur difference image is to use the blur characteristics of the image area with rain attachment, which is insensitive to the filtering and smoothing algorithm; compared with the area without rain attachment, it has less changes, so the image area with rain attachment can be distinguished.

[0031] Deltax is the blurred difference image of the current frame, xsrc is the original image of the current frame, and xblur is the image after filtering and smoothing of the current frame image.

[0032] The blurring process may be one or more of Gaussian filtering, median filtering, and mean filtering for smoothing.

[0033] The relationship between the Gaussian filter, median filter, mean filter and filter kernel size is shown in Table 1:

[0034]

[0035] Table 1

[0036] Preferably, it can be seen from Table 1 that under the current image size, when the filter kernel size is 5, the effect of using mean filtering is best.

[0037] Furthermore, the operation of superimposing multiple images in step S013 is expressed as follows: the fuzzy difference image obtained in step S012 is accumulated by n frames xaccum=delatxk+deltaxk+n

[0038] Xaccum is the fused feature map obtained by accumulating multiple frames, which is the accumulation result from frame k to frame k+n. deltaxk is the fuzzy difference map at the kth frame, and deltaxk+n is the fuzzy difference map at the k+nth frame.

[0039] The role of the accumulated fusion feature map is that the distribution of rain shape and position changes less in a short period of time, and the accumulation of continuous multi-frame fuzzy difference maps can enhance the contrast between the blurred area of ​​rain attachment and the background, and highlight the rain attachment area on the image.

[0040] Furthermore, the operations of binarization processing, neighborhood filtering processing, and morphological processing in step S014 are expressed as follows:

[0041] The role of binarization on the fused feature map accumulated from multiple frames is to convert the grayscale image into a binary image using an automatic thresholding algorithm, and to segment the image into a region of interest suspected of attachments and a region without attachments;

[0042] The function of neighborhood filtering is to count the pixel distribution in the neighborhood of the binary image and remove isolated noise points to reduce the impact of noise points on the area of ​​interest of the attachment;

[0043] The function of morphological filtering is to perform corrosion operation on the binary image to remove smaller noise areas, and to perform expansion operation to fill the holes in the suspected area and repair the area of ​​the suspected area.

[0044] Furthermore, in step S01, the image segmentation method adopts a deep learning method and includes the following steps:

[0045] Preprocessing: Downsample the image to M*N size and convert the image data storage format to three-channel BGR format.

[0046] Image segmentation: The input image data is sent to the semantic segmentation convolutional neural network. After forward propagation, the classification of each pixel is output to obtain the pixel set of the suspected attachment area.

[0047] Furthermore, when the deep learning method is used to obtain the image segmentation result, the network model used is a convolutional neural network for semantic segmentation, and its feature extraction backbone network can adopt resnet18, squeezenet1.1, mobilenent and other networks; the semantic segmentation deconvolution part adopts the PSPnet framework, fuses the feature maps of different scales of the last 4 layers of the backbone network, and finally outputs a segmentation result map with the same size as the original image.

[0048] Furthermore, in the step S02 of feature extraction, the specific expression of extracting the contour of the extraction area is:

[0049] The function of contour extraction is to perform contour extraction on the processed fusion feature map to obtain pixel sets of different contours, which are used to perform feature extraction calculations on different contour areas, evaluate the clarity of each set and the credibility of determining it as a rain attachment area.

[0050] Furthermore, in the feature extraction step S02, the specific expression of statistical calculation of multiple clarity evaluation indicators within the contour is:

[0051] By using one or more of the image statistical features, shape and texture features, and clarity evaluation features, statistical calculations are performed on the divided contours to obtain different types of evaluation index values.

[0052] Image statistical features: Gray, Grads gradient, Laplas quadratic gradient, mean / variance / max / min mathematical statistics, mean variance, maximum value, minimum value

[0053] Shape and texture features: Round / Area roundness and area, Wavelet_f wavelet transform operator,

[0054] Clarity evaluation features: Variance, EVA, Hist, Laplas

[0055] Value = F (area, vector).

[0056] Furthermore, when performing statistical calculations on the divided contours in step S02 to obtain different types of evaluation index values, two evaluation methods are included: a credibility value accumulation evaluation method and a contour area classification judgment using a classifier.

[0057] Furthermore, when using the classifier to classify and judge the contour area, for a certain contour area, N evaluation index values ​​are calculated, and the N evaluation index values ​​are integrated into the feature vector of the area; the feature vector of the rain area is statistically obtained as a training sample and sent to the classifier for training. The classifier can choose decision trees, SVMs, BP networks, etc. to classify the segmented contour area to determine whether it is a rain area.

[0058] Furthermore, when the credibility value accumulation evaluation method is used for judgment, N evaluation indicators are set for a certain contour area, and each evaluation indicator is set with a judgment selection threshold, which is used to express whether the evaluation indicator value of a certain contour area can be identified as a rainwater area;

[0059] Calculate each evaluation index for the contour area to obtain N evaluation index values, and compare each evaluation index with the corresponding evaluation index selection threshold. If it exceeds the evaluation index selection threshold, add one point to the credibility of the contour area; if it does not exceed the evaluation index selection threshold, remove the contour area or do not add points to the credibility of the contour area;

[0060] Finally, the contour areas in the image whose evaluation index is higher than the judgment selection threshold are counted, and the location and area information of these areas are marked.

[0061] Furthermore, the specific method of accumulating marks in the determination area in step S03 is: gridding the detection picture into MxN grids; mapping the output results of multi-frame accumulation to corresponding grid positions, counting the number of objects attached to the grids, and providing quantitative occlusion conditions.

[0062] A night mode lens attachment detection system, comprising the following modules:

[0063] An image segmentation module, which is used to find one or more frames of images with a light source in the background, and use the characteristic that the light source in the image makes the attachment appear as a bright spot to process and separate the suspected area in the image;

[0064] A feature extraction module is used to extract the contour area suspected to be blurred by the attachment, and to perform statistical calculations on a variety of clarity evaluation indicators within the contour, and to determine whether the area is an attachment by combining the results of the various indicators;

[0065] The early warning judgment module is used to count the judgment areas of the feature extraction module and mark the cumulative value, and trigger an alarm for the judgment area whose cumulative number exceeds the alarm threshold.

[0066] Furthermore, the image segmentation module continuously acquires multiple frames of captured images, searches for one or more frames of images with a light source in the background, converts the images into grayscale images, calculates the grayscale histogram of the grayscale image, and obtains a statistical array including the grayscale value size, grayscale distribution, and occurrence frequency of the pixels; classifies the pixels in the grayscale histogram, calculates the spatial distances between different grayscale levels and other grayscale values, and calculates the distance values ​​between the grayscale levels and the sum of the products of the probability coefficients; thereby obtaining a saliency map of different gray values ​​and separating the suspicious attached areas.

[0067] A mobile terminal, which may be a vehicle-mounted terminal or a mobile phone terminal,

[0068] The vehicle-mounted terminal may execute the above-mentioned method for detecting objects attached to the lens in night mode or be equipped with the above-mentioned system for detecting objects attached to the lens in night mode;

[0069] The mobile phone terminal can execute the above-mentioned method for detecting objects attached to the lens in night mode or be equipped with the above-mentioned system for detecting objects attached to the lens in night mode.

[0070] A computer storage medium is a computer program written according to the above-mentioned method for detecting objects attached to the lens in night mode.

[0071] As described above, the present invention has the following beneficial effects:

[0072] 1) When driving in the rain, rainwater adheres to the camera surface in different forms, and there are also situations such as stains blocking the lens and internal defects of the lens. In this case, not only the camera imaging effect is affected, but also the correctness and effectiveness of the algorithm are reduced. In order to ensure the normal operation of the AVP system and the safety of the user's vehicle, it is necessary to detect the problem of lens obstruction and pollution and issue an alarm in time.

[0073] 2) In night mode or in an environment with extremely low light intensity, it can identify condensed water droplets, blurred water stains, dark stains and other attachments on the lens. After detecting the attachment area, it will verify and identify the area. If it is determined to be an attachment, it will promptly alarm the system to reduce the impact of lens attachments on computer vision detection. BRIEF DESCRIPTION OF THE DRAWINGS

[0074] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.

[0075] Figure 1 Images showing several situations in which problems are encountered in the background art.

[0076] Figure 2 Shown is a schematic flow chart of the image segmentation steps of the present invention.

[0077] Figure 3 It is a schematic diagram showing a flow chart of an image undergoing image segmentation steps in another embodiment of the present invention.

[0078] Figure 4 It is a schematic diagram showing a flow chart of an image undergoing image segmentation steps in another embodiment of the present invention.

[0079] Figure 5 It is a schematic diagram showing a flow chart of an image undergoing image segmentation steps in another embodiment of the present invention.

[0080] Figure 6It is a schematic diagram showing a flow chart of an image undergoing image segmentation steps in another embodiment of the present invention.

[0081] Figure 7 Shown is a flow chart of the present invention.

[0082] Figure 8 Shown is a flow chart of the image segmentation steps of the present invention.

[0083] Fig. 9 Shown is a flow chart of image segmentation steps in another embodiment of the present invention. DETAILED DESCRIPTION

[0084] The following describes the embodiments of the present invention by specific examples, and those skilled in the art can easily understand other advantages and effects of the present invention from the contents disclosed in this specification. The present invention can also be implemented or applied through other different specific embodiments, and the details in this specification can also be modified or changed in various ways based on different viewpoints and applications without departing from the spirit of the present invention. It should be noted that the following embodiments and features in the embodiments can be combined with each other without conflict.

[0085] It should be noted that the structures, proportions, sizes, etc. illustrated in the drawings of this specification are only used to match the contents disclosed in the specification for people familiar with this technology to understand and read, and are not used to limit the limiting conditions for the implementation of the present invention, so they have no substantial technical significance. Any modification of the structure, change of the proportion relationship or adjustment of the size should still fall within the scope of the technical content disclosed by the present invention without affecting the effects and purposes that can be achieved by the present invention. At the same time, the terms such as "upper", "lower", "left", "right", "middle" and "one" quoted in this specification are only for the convenience of description, and are not used to limit the scope of the implementation of the present invention. The change or adjustment of their relative relationship should also be regarded as the scope of the implementation of the present invention without substantially changing the technical content.

[0086] See also Figures 1 to 9 ,

[0087] A method for detecting objects attached to a lens in night mode, comprising the following steps:

[0088] S01: Image segmentation: segment the input image into suspected areas;

[0089] S02: Feature extraction: Extract the contour area blurred by the attachment, and perform statistical calculations on one or several evaluation indicators within the contour, and determine whether the area is an attachment based on the comprehensive indicator results;

[0090] S03: Early warning judgment: The judgment area is cumulatively marked, and an early warning is triggered when the cumulative number of times exceeds the alarm threshold.

[0091] As a preferred embodiment, the image segmentation process of step S01 in night mode is as follows:

[0092] Continuously acquire multiple frames of captured images, find one or more frames of images with a light source in the background, convert the images into grayscale images, calculate the grayscale histogram of the grayscale image, and obtain a statistical array containing the grayscale value size, grayscale distribution, and frequency of occurrence of pixel points; classify the pixels in the grayscale histogram, calculate the spatial distance between different grayscale levels and other grayscale values, and calculate the distance value between grayscale levels and the sum of the product of probability coefficients; thereby obtaining a saliency map of different gray values ​​and separating the attached suspicious area.

[0093] As a preferred embodiment, the imaging characteristics of the attachment area attached to the lens at night are: when there is a light source in the background, it appears as a bright spot due to the refraction of the light source. The color image is converted into a grayscale image, and the image brightness value is used as the main basis for distinction and to reduce the amount of calculation. The grayscale histogram of the grayscale image is calculated. The grayscale histogram is a function of the grayscale distribution and is a statistic of the grayscale distribution in the image. The grayscale histogram is a statistical frequency of occurrence of all pixels in the digital image according to the size of the grayscale value:

[0094] P(k)=nk / N

[0095] Where N is the total number of pixels, nk is the number of pixels at gray level k;

[0096] Based on the grayscale histogram, the grayscale space distance between different grayscale levels and other grayscale values ​​is calculated;

[0097] D(k,i)=|ki|

[0098] Where D(k,i) represents the grayscale space distance from grayscale level k to grayscale level i;

[0099] Then the calculation method of the significance value of gray level k is the sum of the products of the gray distance value from gray level k to other gray levels and the probability coefficients of other gray values:

[0100]

[0101] S(k) represents the pixel significance value of gray level k, P(i) is the probability value of gray level i, and D(k,i) is the gray space distance value from gray level k to gray level i.

[0102] Thus, saliency maps with different gray values ​​are obtained, and the suspicious attached areas are separated.

[0103] As a preferred embodiment, in step S01, the image segmentation method can be implemented by using a suspected region segmentation algorithm or a deep learning method.

[0104] Furthermore, in step S01, the image segmentation method using the suspected region segmentation algorithm includes the following steps:

[0105] S011: Image segmentation downsampling,

[0106] S012: Extract fuzzy difference image,

[0107] S013: and perform multi-image superposition;

[0108] S014: Use one or more operations of binarization, filtering, morphology, and thresholding to achieve image segmentation of the suspected area.

[0109] As a preferred embodiment, in step S011, the image segmentation and downsampling operation is expressed as follows: assuming that the original captured image is an image with a pixel value of N*M, and assuming that the downsampling coefficient is k, the downsampling operation is to take a point every k pixels in each row and column of the original captured image to form a downsampled image. The role of the downsampled image is to reduce the computational complexity of image processing and ensure the real-time performance of image processing.

[0110] As a preferred embodiment, in step S012, the operation of extracting the fuzzy difference image is expressed as follows: blurring the captured image with a filter operator, subtracting the original image from the blurred image, taking the absolute value, and obtaining the fuzzy difference image.

[0111] Assume that xsrc is the original image, xblur is the image obtained by blurring and smoothing, and define the current blur difference image as: deltax = |xsrc-xblur|. The purpose of extracting the blur difference image is to use the blur characteristics of the image area with rain attachment, which is insensitive to the filtering and smoothing algorithm; compared with the area without rain attachment, it has less changes, so the image area with rain attachment can be distinguished.

[0112] Deltax is the blurred difference image of the current frame, xsrc is the original image of the current frame, and xblur is the image after filtering and smoothing of the current frame image.

[0113] The blurring process may be one or more of Gaussian filtering, median filtering, and mean filtering for smoothing.

[0114] The relationship between the Gaussian filter, median filter, mean filter and filter kernel size is shown in Table 1:

[0115]

[0116] Table 1

[0117] Preferably, it can be seen from Table 1 that under the current image size, when the filter kernel size is 5, the effect of using mean filtering is best.

[0118] As a preferred embodiment, the operation of superimposing multiple images in step S013 is expressed as follows: the fuzzy difference image obtained in step S012 is accumulated by n frames xaccum=delatxk+deltaxk+n

[0119] Xaccum is the fused feature map obtained by accumulating multiple frames, which is the accumulation result from frame k to frame k+n. deltaxk is the fuzzy difference map at the kth frame, and deltaxk+n is the fuzzy difference map at the k+nth frame.

[0120] The role of the accumulated fusion feature map is that the distribution of rain shape and position changes less in a short period of time, and the accumulation of continuous multi-frame fuzzy difference maps can enhance the contrast between the blurred area of ​​rain attachment and the background, and highlight the rain attachment area on the image.

[0121] As a preferred embodiment, the operations of binarization processing, neighborhood filtering processing, and morphological processing in step S014 are expressed as follows:

[0122] The role of binarization on the fused feature map accumulated from multiple frames is to convert the grayscale image into a binary image using an automatic thresholding algorithm, and to segment the image into a region of interest suspected of attachments and a region without attachments;

[0123] The function of neighborhood filtering is to count the pixel distribution in the neighborhood of the binary image and remove isolated noise points to reduce the impact of noise points on the area of ​​interest of the attachment;

[0124] The function of morphological filtering is to perform corrosion operation on the binary image to remove smaller noise areas, and to perform expansion operation to fill the holes in the suspected area and repair the area of ​​the suspected area.

[0125] As a preferred embodiment, in step S01, the image segmentation method adopts a deep learning method and includes the following steps:

[0126] Preprocessing: Downsample the image to M*N size and convert the image data storage format to three-channel BGR format.

[0127] Image segmentation: The input image data is sent to the semantic segmentation convolutional neural network. After forward propagation, the classification of each pixel is output to obtain the pixel set of the suspected attachment area.

[0128] As a preferred embodiment, when the deep learning method is used to obtain the image segmentation result, the network model used is a convolutional neural network for semantic segmentation, and the backbone network for feature extraction can adopt resnet18, squeezenet1.1, mobilenent and other networks; the semantic segmentation deconvolution part adopts the PSPnet framework, integrates the feature maps of different scales of the last 4 layers of the backbone network, and finally outputs a segmentation result map with the same size as the original image.

[0129] As a preferred embodiment, in the step S02 of feature extraction, the specific expression of extracting the contour of the extraction area is:

[0130] The function of contour extraction is to perform contour extraction on the processed fusion feature map to obtain pixel sets of different contours, which are used to perform feature extraction calculations on different contour areas, evaluate the clarity of each set and the credibility of determining it as a rain attachment area.

[0131] As a preferred embodiment, in the step S02 of feature extraction, the specific expression of statistical calculation of multiple clarity evaluation indicators within the contour is:

[0132] By using one or more of the image statistical features, shape and texture features, and clarity evaluation features, statistical calculations are performed on the divided contours to obtain different types of evaluation index values.

[0133] Image statistical features: Gray, Grads gradient, Laplas quadratic gradient, mean / variance / max / min mathematical statistics, mean variance, maximum value, minimum value

[0134] Shape and texture features: Round / Area roundness and area, Wavelet_f wavelet transform operator,

[0135] Clarity evaluation features: Variance, EVA, Hist, Laplas

[0136] Value = F (area, vector).

[0137] As a preferred embodiment, when performing statistical calculations on the divided contours in step S02 to obtain different types of evaluation index values, two evaluation methods are included: a credibility value accumulation evaluation method and a contour area classification judgment using a classifier.

[0138] As a preferred embodiment, when using a classifier to classify and judge the contour area, for a certain contour area, N evaluation index values ​​are calculated, and the N evaluation index values ​​are integrated into a feature vector of the area; the feature vector of the rain area is statistically obtained as a training sample and sent to the classifier for training. The classifier can select a decision tree, SVM, BP network, etc. to classify the segmented contour area to determine whether it is a rain area.

[0139] As a preferred embodiment, when judging by using the credibility value accumulation evaluation method, N evaluation indicators are set for a certain contour area, and each evaluation indicator is set with a judgment selection threshold, which is used to express whether the evaluation indicator value of a certain contour area can be identified as a rainwater area;

[0140] Calculate each evaluation index for the contour area to obtain N evaluation index values, and compare each evaluation index with the corresponding evaluation index selection threshold. If it exceeds the evaluation index selection threshold, add one point to the credibility of the contour area; if it does not exceed the evaluation index selection threshold, remove the contour area or do not add points to the credibility of the contour area;

[0141] Finally, the contour areas in the image whose evaluation index is higher than the judgment selection threshold are counted, and the location and area information of these areas are marked.

[0142] As a preferred embodiment, the specific method of accumulating marks in the judgment area in step S03 is: gridding the detection picture and dividing it into MxN grids; mapping the output results of multi-frame accumulation to the corresponding grid positions, counting the number of objects attached to the grid, and providing a quantitative occlusion situation.

[0143] A night mode lens attachment detection system, comprising the following modules:

[0144] An image segmentation module, which is used to find one or more frames of images with a light source in the background, and use the characteristic that the light source in the image makes the attachment appear as a bright spot to process and separate the suspected area in the image;

[0145] A feature extraction module is used to extract the contour area suspected to be blurred by the attachment, and to perform statistical calculations on a variety of clarity evaluation indicators within the contour, and to determine whether the area is an attachment by combining the results of the various indicators;

[0146] The early warning judgment module is used to count the judgment areas of the feature extraction module and mark the cumulative value, and trigger an alarm for the judgment area whose cumulative number exceeds the alarm threshold.

[0147] As a preferred embodiment, the image segmentation module continuously acquires multiple frames of captured images, searches for one or more frames of images with a light source in the background, converts the images into grayscale images, calculates the grayscale histogram of the grayscale image, and obtains a statistical array including the grayscale value size, grayscale distribution, and occurrence frequency of the pixels; classifies the pixels in the grayscale histogram, calculates the spatial distances between different grayscale levels and other grayscale values, and calculates the distance values ​​between the grayscale levels and the sum of the products of probability coefficients; thereby obtaining a saliency map of different gray values ​​and separating the attached suspicious areas.

[0148] As a preferred embodiment, the technical parameters of the lens attachment detection system are shown in Table 2:

[0149]

[0150] Table 2

[0151] As a preferred embodiment, the configuration requirements of the lens attachment detection system are as follows:

[0152] The detection system for objects attached to the lens can be configured to run independently in the background, or it can be triggered to run when other algorithms are running, using a multi-frame interval detection method. The detection inputs for objects attached to the lens include: original images from four cameras, vehicle body CAN signals: vehicle speed, and ambient brightness information. When the vehicle moves, the detection system for objects attached to the lens is triggered to detect the images from the four cameras.

[0153] As a preferred embodiment, the detection alarm performance requirements of the lens attachment detection system are as follows:

[0154] (1) Scope of application: It can detect raindrops and stains of different forms in indoor and outdoor environments and different road conditions, and has a certain ability to detect more serious water mist and lens defects;

[0155] (2) Stability: Not affected by weather, environmental changes and other factors, and has good reliability;

[0156] (3) The algorithm running time and resources used meet the requirements.

[0157] As a preferred embodiment, the specific application scenarios and special scenario descriptions of the lens attachment detection system are shown in Table 3 below:

[0158]

[0159] Table 3

[0160] A mobile terminal, which may be a vehicle-mounted terminal or a mobile phone terminal,

[0161] The vehicle-mounted terminal may execute the above-mentioned method for detecting objects attached to the lens in night mode or be equipped with the above-mentioned system for detecting objects attached to the lens in night mode;

[0162] The mobile phone terminal can execute the above-mentioned method for detecting objects attached to the lens in night mode or be equipped with the above-mentioned system for detecting objects attached to the lens in night mode.

[0163] A computer storage medium is a computer program written according to the above-mentioned method for detecting objects attached to the lens in night mode.

[0164] As a preferred embodiment, this embodiment also provides a terminal device, such as a smart phone, tablet computer, laptop computer, desktop computer, rack-mounted cloud, blade cloud, tower cloud or cabinet cloud (including independent cloud, or cloud cluster composed of multiple clouds) that can execute programs. The terminal device of this embodiment at least includes but is not limited to: a memory and a processor that can communicate with each other through a system bus. It should be pointed out that the terminal device has a component memory and a processor, but it should be understood that it is not required to implement all the components shown, and more or fewer components can be implemented in the alternative night mode lens attachment detection method.

[0165] As a preferred embodiment, the memory (i.e., readable storage medium) includes flash memory, hard disk, multimedia card, card-type memory (e.g., SD or DX memory, etc.), random access memory (RAM), static random access memory (SRAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), programmable read-only memory (PROM), magnetic memory, disk, optical disk, etc. In some embodiments, the memory may be an internal storage unit of a computer device, such as a hard disk or memory of the computer device. In other embodiments, the memory may also be an external storage device of a computer device, such as a plug-in hard disk, a smart memory card (Smart Media Card, SMC), a secure digital (Secure Digital, SD) card, a flash card, etc. equipped on the computer device. Of course, the memory may also include both the internal storage unit of the computer device and its external storage device. In this embodiment, the memory is generally used to store the operating system and various application software installed in the computer device, such as the program code of the method for detecting the object attached to the lens in the night mode in the embodiment, etc. In addition, the memory may also be used to temporarily store various data that have been output or are to be output.

[0166] This embodiment also provides a computer-readable storage medium, such as a flash memory, a hard disk, a multimedia card, a card-type memory (e.g., an SD or DX memory, etc.), a random access memory (RAM), a static random access memory (SRAM), a read-only memory (ROM), an electrically erasable programmable read-only memory (EEPROM), a programmable read-only memory (PROM), a magnetic memory, a disk, an optical disk, a cloud, an App application store, etc., on which a computer program is stored, and when the program is executed by a processor, a corresponding function is realized. The computer-readable storage medium of this embodiment is used for a method program for detecting lens attachment in night mode, and when executed by a processor, the method for detecting lens attachment in the method program embodiment for detecting lens attachment in night mode is realized.

[0167] The above embodiments are merely illustrative of the principles and effects of the present invention, and are not intended to limit the present invention. Anyone familiar with the art may modify or alter the above embodiments without departing from the spirit and scope of the present invention. Therefore, all equivalent modifications or alterations made by those skilled in the art without departing from the spirit and technical ideas disclosed by the present invention shall still be covered by the claims of the present invention.

Claims

1. A method for detecting objects attached to a lens in night mode, characterized in that: The following steps are involved: S01: Image segmentation: segment the input image into suspected areas; wherein, continuously acquire multiple frames of captured images, find one or more frames of images with a light source in the background, and convert the images into grayscale images; Calculate the grayscale histogram of the grayscale image to obtain a statistical array including the grayscale value size, grayscale distribution, and occurrence frequency of the pixel points; classify the pixel points in the grayscale histogram and calculate the spatial distance between different grayscale levels and other grayscale values; calculate the sum of the distance value between the grayscale levels and the product of the probability coefficients to obtain a saliency map of different gray values, and separate the suspected area; S02: Feature extraction: extracting the contour area blurred by the attachment in the suspected area, and performing statistical calculations on a variety of clarity evaluation indicators in the contour area, and comprehensively determining whether the contour area is an attachment based on the indicator results; S03: Early warning judgment: The judgment area is cumulatively marked, and an early warning is triggered when the cumulative number of times exceeds the alarm threshold.

2. The method for detecting objects attached to a lens in night mode according to claim 1, characterized in that: When there is a light source in the background, it will be reflected as a bright spot. The color image will be converted into a grayscale image, and the image brightness value will be used as the main basis for distinction and to reduce the amount of calculation. Calculating a grayscale histogram of a statistical grayscale image, wherein the grayscale histogram is a function of grayscale distribution and is a statistic of grayscale distribution in an image; The grayscale histogram is a statistical graph of the frequency of occurrence of all pixels in a digital image according to the size of the grayscale value: P(k)=nk / N Where N is the total number of pixels, nk is the number of pixels at gray level k; Based on the grayscale histogram, the grayscale space distance between different grayscale levels and other grayscale values ​​is calculated; D(k,i)=|ki| Where D(k,i) represents the grayscale space distance from grayscale level k to grayscale level i; Then the calculation method of the significance value of gray level k is the sum of the products of the gray distance value from gray level k to other gray levels and the probability coefficients of other gray values: S(k) represents the pixel significance value of gray level k, P(i) is the probability value of gray level i, and D(k,i) is the gray space distance value from gray level k to gray level i; Thus, saliency maps of different gray values ​​are obtained, and the suspected area is separated.

3. The method for detecting objects attached to a lens in night mode according to claim 1, characterized in that: In the feature extraction step S02, the specific expression of statistical calculation of multiple clarity evaluation indicators within the contour is: Using one or more of the image statistical features, shape and texture features, and clarity evaluation features, statistical calculations are performed on the divided contour areas to obtain different types of evaluation index values; Image statistical features: grayscale, gradient, quadratic gradient, mathematical statistics, mean variance, maximum value, minimum value; Shape and texture features: roundness and area, wavelet transform operator; Clarity evaluation features: mean, EVA, Hist, quadratic gradient.

4. The method for detecting objects attached to a lens in night mode according to claim 3, characterized in that: When performing statistical calculations on the divided contour areas to obtain different types of evaluation index values ​​in step S02, two evaluation methods are included: a credibility value accumulation evaluation method and a contour area classification judgment using a classifier.

5. The method for detecting objects attached to a lens in night mode according to claim 4, characterized in that: When using the credibility value accumulation evaluation method to make judgments, N evaluation indicators are set for a certain contour area, and each evaluation indicator is set with a judgment selection threshold, which is used to express whether the evaluation indicator value of a certain contour area can be identified as a rainwater area; Calculate each evaluation index for the contour area to obtain N evaluation index values, and compare each evaluation index with the corresponding evaluation index selection threshold. If it exceeds the evaluation index selection threshold, add one point to the credibility of the contour area; if it does not exceed the evaluation index selection threshold, remove the contour area or do not add points to the credibility of the contour area; Finally, the contour areas in the image whose evaluation index is higher than the judgment selection threshold are counted, and the location and area information of these areas are marked.

6. The method for detecting objects attached to a lens in night mode according to claim 4, characterized in that: When using a classifier to classify and judge the contour area, for a certain contour area, N evaluation index values ​​are calculated and integrated into the feature vector of the area; the feature vector of the rain area obtained by statistics is sent to the classifier as a training sample for training; the classifier includes decision trees, SVMs, and BP networks to classify the segmented contour area and determine whether it is a rain area.

7. A computer storage medium, characterized in that: The computer storage medium stores a computer program written according to the method for detecting night mode lens attachments as described in any one of claims 1 to 6.