Method and device for detecting smudginess of windshield and electronic equipment

The front windshield image is obtained through the camera, the average gray value of the area is traversed and judged, and the dirt type is distinguished, which solves the problems of misjudgment and high cost in front windshield detection in the existing technology, and realizes high-precision, low-cost Dirt detection improves driving safety.

CN118570544APending Publication Date: 2024-08-30CHONGQING SELIS PHOENIX INTELLIGENT INNOVATION TECH CO LTD
View PDF 0 Cites 3 Cited by

Patent Information

Application Number
CN202410719120.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-06-05
Publication Date
2024-08-30

AI Technical Summary

Technical Problem

In the existing technology, the accuracy of front windshield dirt detection is insufficient, misjudgment is prone to occur, leading to safety hazards, and the cost is high.

Method used

Acquire the image of the front windshield through the camera, use the preset area size to traverse and determine the average gray value of the target, distinguish opaque and translucent dirt, and judge the image availability based on the area area to avoid misjudgment and reduce costs.

Benefits of technology

It improves the accuracy of front windshield detection, reduces misjudgments and costs, and ensures driving safety. It only relies on cameras and does not require additional hardware and training data.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118570544A
    Figure CN118570544A
Patent Text Reader

Abstract

The invention relates to the technical field of automobiles, and provides a method and device for detecting dirt of a windshield and electronic equipment. The method comprises the following steps: acquiring an image of a windshield shot by a camera; when it is detected that the image is abnormal, traversing the image according to a preset area size, and determining a target average gray value of each traversed area; for each region, the smudginess type of the region is determined according to the target average gray value, and the smudginess type comprises light-proof smudginess and light-transmitting smudginess; and determining the area of the area corresponding to the lightproof smudginess, and determining whether the image of the windshield is an available image according to the area of the area. The technical problem that in the prior art, windshield smudginess detection is prone to misjudgment is solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of automobile technology, and in particular to a method, device and electronic equipment for detecting windshield dirtiness. Background Art

[0002] At present, the front windshield is not only an important window for drivers to observe the road conditions and traffic environment ahead, but also a prerequisite for detecting whether some intelligent driving functions can be turned on; therefore, whether the front windshield is clean and free of stains determines whether the driver can drive safely and whether the intelligent driving function can be turned on. However, the accuracy of the currently commonly used front windshield dirt detection method sometimes cannot meet the needs of intelligent driving functions, and it is easy to cause safety hazards and misjudgment.

[0003] Therefore, there is an urgent need for a method for detecting windshield dirt with high accuracy. Summary of the invention

[0004] In view of this, the embodiments of the present application provide a method, device and electronic device for detecting windshield dirt, so as to solve the problem that windshield dirt detection in the prior art is prone to misjudgment.

[0005] According to a first aspect of an embodiment of the present application, a method for detecting windshield dirtiness is provided, comprising:

[0006] Get the image of the windshield taken by the camera;

[0007] When an abnormality is detected in the image, the image is traversed according to the preset area size, and the target average grayscale value of each traversed area is determined;

[0008] For each region, determine the type of dirt in the region according to the target average grayscale value, where the dirt types include opaque dirt and translucent dirt;

[0009] The area of ​​the region corresponding to the opaque dirt is determined, and whether the image of the windshield is a usable image is determined according to the area of ​​the region.

[0010] According to a second aspect of an embodiment of the present application, there is provided a device for detecting windshield dirt, comprising:

[0011] A data acquisition module, used to acquire an image of the windshield taken by a camera;

[0012] A first determination module is used to traverse the image according to a preset area size and determine a target average grayscale value of each traversed area when an abnormality is detected in the image;

[0013] A second determination module is used to determine the type of dirt in each region according to the target average gray value, wherein the dirt type includes opaque dirt and translucent dirt;

[0014] The third determination module is used to determine the area of ​​the area corresponding to the opaque dirt, and determine whether the image of the windshield is a usable image according to the area of ​​the area.

[0015] According to a third aspect of an embodiment of the present application, an electronic device is provided, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of the above method when executing the computer program.

[0016] According to a fourth aspect of an embodiment of the present application, a readable storage medium is provided, which stores a computer program, and when the computer program is executed by a processor, the steps of the above method are implemented.

[0017] The beneficial effects of the embodiments of the present application include at least:

[0018] By acquiring the image of the windshield taken by the camera, a data basis is provided for the subsequent detection of image abnormalities. When an abnormality is detected in the image, the image is traversed according to the preset area size, and the target average grayscale value of each traversed area is determined. The image of the windshield is firstly detected. When an abnormality is found in the image after the initial detection, the grayscale value of each area in the image is measured, so that the initial detection is performed before the full detection, which greatly saves the operating resources occupied by the detection process, effectively reduces the cost of detection, and makes the detection more comprehensive through two detections, effectively preventing the occurrence of missed detection and false detection. By determining the type of dirt in each area according to the target average grayscale value, wherein the dirt type includes opaque dirt and translucent dirt, and using the target average grayscale value to determine the type of dirt on the windshield, the most effective cleaning method can be adopted according to the dirt type. In addition, by judging the dirt type of each area, a data basis is provided for the subsequent determination of whether the image is a usable image. By determining the area of ​​the region corresponding to the opaque dirt and determining whether the image of the windshield is a usable image based on the area of ​​the region, the area of ​​the region can be used to accurately judge the degree of dirtiness of the windshield, and when the degree of dirtiness reaches a certain value, the image is judged to be unusable, so that the intelligent driving system will not make misjudgments due to unclear images, thereby improving the safety of vehicle driving. In addition, during the detection process, only cameras are used, without relying on hardware equipment and training data, which greatly reduces the cost of dirt detection and solves the problems of high cost and easy misjudgment of windshield dirt detection in the prior art. BRIEF DESCRIPTION OF THE DRAWINGS

[0019] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.

[0020] Figure 1 It is a flow chart of a method for detecting windshield dirtiness provided in an embodiment of the present application;

[0021] Figure 2 It is a flow chart of another method for detecting windshield dirtiness provided by an embodiment of the present application;

[0022] Figure 3 It is a structural schematic diagram of a device for detecting windshield dirtiness provided in an embodiment of the present application;

[0023] Figure 4 It is a structural schematic diagram of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0024] In the following description, specific details such as specific system structures, technologies, etc. are provided for the purpose of illustration rather than limitation, so as to provide a thorough understanding of the embodiments of the present application. However, it should be clear to those skilled in the art that the present application may also be implemented in other embodiments without these specific details. In other cases, detailed descriptions of well-known systems, devices, circuits, and methods are omitted to prevent unnecessary details from obstructing the description of the present application.

[0025] The terms "first", "second", etc. in the specification and claims of this application are used to distinguish similar objects, and are not used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present application can be implemented in an order other than those illustrated or described here, and the objects distinguished by "first", "second", etc. are generally of the same type, and the number of objects is not limited. For example, the first object can be one or more. In addition, "and / or" in the specification and claims represents at least one of the connected objects, and the character " / " generally indicates that the objects associated with each other are in an "or" relationship.

[0026] In addition, it should be noted that the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "includes..." do not exclude the existence of other identical elements in the process, method, article or device including the elements.

[0027] Among the related technologies for detecting dirt on the front windshield, one method is a dirt detection method based on a binocular advanced driving assistance system (Advanced Driving Assistance System) camera, which determines whether the vehicle is in motion. If so, dirt detection is performed and dirt detection is performed based on two cameras. This method requires a device based on a binocular camera and needs to compare the images of the two cameras, which has certain requirements for hardware configuration. In addition, if both binocular cameras are blocked by dirt, it is impossible to determine whether the images of the two cameras are different, and there will be misjudgment. In addition, during the movement process, it is determined whether the static dirt is dirty. If there is a relatively static moving object during the process, a false alarm will occur.

[0028] Another method is a windshield dirt detection method based on texture features. Based on the threshold judgment of the Sobel operator edge detection algorithm, the edge ratio of images with different edge strengths in the image is calculated to obtain pixel blur, and then the dirt candidates are determined according to the threshold division of different texture areas, and false pixels are removed from the dirt candidate area by superimposing multiple frames of images to determine the dirty area and the degree of dirtiness. When the scene is complex and there are many textures, this method is prone to misjudgment through Sobel edge detection, and the complex background is judged as dirty. In addition, this method requires judgment and comparison through multiple frames of images, and requires tracking and processing of multiple frames for comparison and detection, which has a high computational cost.

[0029] In view of the above problems, the present application provides a method, device and electronic equipment for detecting windshield dirtiness, so as to solve the problems of prone to misjudgment and high cost in the above windshield dirtiness detection.

[0030] A method and device for detecting windshield dirt according to an embodiment of the present application will be described in detail below with reference to the accompanying drawings.

[0031] Figure 1 1 is a flow chart of a method for detecting windshield dirtiness provided in an embodiment of the present application. The method can be executed by a terminal device. Figure 1 As shown, the method for detecting windshield dirtiness includes:

[0032] Step 101, obtaining an image of the windshield taken by a camera.

[0033] The camera can be installed inside or outside the vehicle, but the camera should face the windshield and there should be no obstacles between the installation location and the windshield. The windshield can be the front windshield, rear windshield, left and right windows, sunroof, etc., which can be modified and determined as needed.

[0034] Taking the windshield as the front windshield as an example, the camera can be set on the roof inside the vehicle, and its direction is facing the front windshield. The camera can take images or videos of the front windshield at a certain frequency during the driving of the vehicle. The frequency can be determined according to the current weather and road conditions. If it is raining, the shooting frequency can be appropriately increased or even real-time shooting can be performed. If the current road is open and flat and the weather is clear, the shooting frequency can be appropriately reduced. The captured image should include the complete front windshield, that is, the captured image should be unobstructed and without omissions, and the area ratio of the front windshield in the image should be greater than a certain value, which can be 97%, 98%, 99%, etc. The ratio should be as high as possible to avoid false detection during the image detection process.

[0035] This embodiment obtains an image of the windshield to provide a data basis for subsequent dirt detection of the windshield.

[0036] Step 102, when an abnormality is detected in the image, the image is traversed according to a preset area size, and a target average grayscale value of each traversed area is determined.

[0037] The way to detect whether there is an abnormality in the image can use the K-Nearest Neighbor (KNN) classification algorithm or the Local Outlier Factor (LOF) algorithm. Both KNN and LOF classify samples based on k-distance to determine whether there is an abnormal area in the current image.

[0038] The preset area size can be a 20*20 pixel grid area, a 30*30 pixel grid area, a 40*40 pixel grid area, etc., and the preset area size can be determined according to the resolution of the windshield image. For example, a 960*1080 resolution image can correspond to a 30*30 pixel grid area, and the corresponding relationship can be determined according to the actual situation, but it is necessary to ensure that every point in the image needs to be covered. For example, a 640*480 resolution image cannot correspond to a 30*30 pixel grid area, but can correspond to a 20*20 pixel grid area; in addition, when the resolution is low, a small area can be used to avoid missed detection or false detection during the detection process, and when the resolution is high, a large area can be used, thereby reducing the system's computing burden, increasing the computing speed, and thus improving the efficiency of dirt detection.

[0039] Specifically, after acquiring the image of the windshield, the LOF algorithm or the KNN algorithm can be used to analyze the data points in the image to determine whether there are areas with abnormal data. If there are no areas with abnormal data, it is considered that the current windshield is not dirty. If there are areas with abnormal data, it is considered that the current windshield is dirty. At this time, the image will be converted into a grayscale image, and each area will be detected according to the preset area size to determine the grayscale value of the pixel points in each area, thereby determining the target average grayscale value in each area.

[0040] This embodiment performs an initial inspection on the image of the windshield first, and when an abnormality is found in the image after the initial inspection, the grayscale value of each area in the image is measured, so that the initial inspection is performed before the complete inspection, which greatly saves the operating resources occupied by the inspection process and effectively reduces the cost of inspection. In addition, the two inspections make the inspection more comprehensive and effectively prevent missed inspections and false inspections.

[0041] Step 103: for each region, determine the dirt type of the region according to the target average gray value.

[0042] The types of dirt include opaque dirt and translucent dirt.

[0043] Opaque dirt can be dirt that cannot be penetrated by light, such as dirt, stains, and dust. The grayscale value of this type of dirt will be lower; translucent dirt can be dirt that can be penetrated by light, such as water droplets and water mist. The grayscale value of this type of dirt is similar to the grayscale value when there is no dirt. Opaque dirt can be removed by high-pressure water guns, detergents, etc., and translucent dirt can be removed by wipers.

[0044] Specifically, for example, determining the type of dirt in an area according to the target average grayscale value can be achieved by setting a grayscale threshold. When the target average grayscale value is greater than the grayscale threshold, the type of dirt in the area can be considered to be translucent dirt, and when the target average grayscale value is less than or equal to the grayscale threshold, the type of dirt in the area can be considered to be opaque dirt. The grayscale threshold can be set by R&D personnel through repeated experiments or calculated by an algorithm. It should be noted that the classification method of dirt types, the number of grayscale thresholds, etc. are not specifically limited here. The above example is only a simple implementation method for determining the type of dirt. In actual use, other more accurate determination methods can also be used.

[0045] This embodiment determines the type of dirt in each area according to the target average grayscale value, and uses the target average grayscale value to determine the type of dirt on the windshield, so that the most effective cleaning method can be used according to the type of dirt. In addition, by judging the type of dirt in each area, misjudgment is avoided, and a data basis is provided for subsequently determining whether the image is a usable image.

[0046] Step 104 , determining the area of ​​the region corresponding to the opaque dirt, and determining whether the image of the windshield is a usable image based on the area of ​​the region.

[0047] The area of ​​the region can be determined by the area of ​​the pixels contained therein. For example, the unit area of ​​a pixel can be set to 1, and the area of ​​a 30*30 pixel grid area can be set to 900. Then, when the image resolution is 1960*1080, the area of ​​the entire image is 2116800. At this time, the total area of ​​the region corresponding to the opaque dirt can be determined by determining the number of regions corresponding to the opaque dirt, and then the total area of ​​the region corresponding to the opaque dirt can be determined. Then, whether the current image is a usable image can be determined based on the total area. Of course, the area of ​​the region can also be determined by the physical size of the image. For example, the physical size of a preset area can be measured first, and then the total area of ​​the region corresponding to the opaque dirt can be determined based on the number of regions corresponding to the opaque dirt type.

[0048] The available image may be the current image with less dirt. At this time, the intelligent driving function can still accurately identify the information required by the function through the image, so that effective and safe judgments or instructions can be made.

[0049] This embodiment determines the area of ​​the region corresponding to the opaque dirt, and determines whether the image of the windshield is a usable image based on the area of ​​the region. The area of ​​the region can be used to accurately judge the degree of dirt on the windshield, and when the degree of dirt reaches a certain value, the image is judged to be unusable, so that the intelligent driving system will not make misjudgments due to unclear images, thereby improving the safety of vehicle driving. In addition, during the detection process, only cameras are used, without relying on other hardware equipment and training data, thereby greatly reducing the cost of dirt detection.

[0050] According to the technical solution provided by the embodiment of the present application, by acquiring the image of the windshield taken by the camera, a data basis is provided for the subsequent detection of image abnormalities. By traversing the image according to the preset area size when an abnormality is detected in the image, and determining the target average grayscale value of each traversed area, the image of the windshield is firstly detected, and when an abnormality is found in the image after the initial detection, the grayscale value of each area in the image is measured, so that the initial detection is performed before the full detection, which greatly saves the operating resources occupied by the detection process, effectively reduces the cost of detection, and makes the detection more comprehensive through two detections, effectively preventing the occurrence of missed detection and false detection. By determining the type of dirt in each area according to the target average grayscale value, wherein the dirt type includes opaque dirt and translucent dirt, and using the target average grayscale value to determine the type of dirt on the windshield, the most effective cleaning method can be adopted according to the dirt type in the subsequent detection. In addition, by judging the dirt type of each area, a data basis is provided for the subsequent determination of whether the image is a usable image. By determining the area of ​​the region corresponding to the opaque dirt and determining whether the image of the windshield is a usable image based on the area of ​​the region, the area of ​​the region can be used to accurately judge the degree of dirtiness of the windshield, and when the degree of dirtiness reaches a certain value, the image is judged to be unusable, so that the intelligent driving system will not make misjudgments due to unclear images, thereby improving the safety of vehicle driving. In addition, during the detection process, only cameras are used, without relying on hardware equipment and training data, which greatly reduces the cost of dirt detection and solves the problems of high cost and easy misjudgment of windshield dirt detection in the prior art.

[0051] In some embodiments, detecting that an image has an abnormality includes:

[0052] Get the coordinate data of all pixels in the image;

[0053] Determine the local reachable density of any pixel point based on the coordinate data;

[0054] When the local reachable density is less than or equal to the first preset threshold, it is determined that an abnormality exists in the image.

[0055] Specifically, the coordinate data can represent the position of the pixel in the image, which can be determined by establishing a rectangular coordinate system. The position of the origin of the rectangular coordinate system can be the center of the image, the lower left corner of the image, the lower right corner of the image, the upper left corner of the image, the upper right corner of the image, etc., or it can be any point in the image. The directions of the X-axis and the Y-axis in the coordinate system can be horizontally left, horizontally right, vertically upward, vertically downward, etc., and can be any pointing direction, but the angle between the X-axis and the Y-axis should always be 90°, and the pointing direction of the Y-axis is always to the left of the X-axis; for example, the pixel in the lower left corner of the image can be used as the origin (0,0), at which time the X-axis can point horizontally to the right, and the Y-axis can point vertically upward, thereby forming a rectangular coordinate system, and at this time the coordinate data corresponding to each pixel in the image can be determined.

[0056] When determining the local reachable density of any pixel point based on the coordinate data, the Euclidean distance between any two pixels can be determined and calculated using the Local Outlier Factor (LOF) algorithm based on the coordinate data and the Euclidean distance.

[0057] By obtaining the Euclidean distance between any two pixels, the real distance between any two points in space can be determined. The Euclidean distance can be calculated using the following Euclidean distance calculation formula:

[0058]

[0059] Among them, d Euclid (X i ,X j ) can represent point X i and point X j The Euclidean distance between them, m can indicate that the distance value currently calculated is in the m-dimensional space, X ik Can represent point X i The k-dimensional coordinates, X jk Can represent point X j The k-dimensional coordinates of the pixels in the local area can be obtained by using this formula.

[0060] Through the LOF algorithm, the local reachable density of any current pixel can be calculated using the following formula:

[0061]

[0062] lrd k (P) can be expressed as the local reachable density of the current target pixel P, N k(P) can be expressed as a set of pixels whose distance from the target pixel P is less than or equal to k-distance(P). It can be expressed as the maximum value between the k-distance (O) of another target pixel O and the direct distance d (P, O) between point P and point O. In addition, the k-distance of any pixel can be obtained by listing or drawing the Euclidean distance. This formula can express the density of pixels around any pixel, and express the distance of the pixel relative to other areas in a numerical way. The larger the distance, the farther the currently calculated pixel is from other areas and the sparser the density. If the local reachable area of ​​the current pixel is smaller, the closest distance of the current pixel is larger, indicating that the pixel is relatively distant from other pixels, that is, the relative density of the surrounding pixels is small, and the pixel is more likely to be abnormal.

[0063] It should be noted that the calculation result of the LOF algorithm is lrd k (P) measures the degree of abnormality of the current pixel. It does not depend on the local data density of the current area, but on the data density of the adjacent area relative to the overall picture, and is used to determine whether there is an abnormal area in the image.

[0064] The first preset threshold can be determined according to actual needs and prior knowledge. For example, different windshields can be set with different thresholds, or they can be set to the same threshold. However, the setting of the first preset threshold should be moderate, and should not be too large or too small. If the first preset threshold is too large, the normal area may be divided into an abnormal area, which will cause the system to misjudge when detecting abnormal areas, and will also greatly increase the system's computing occupancy and increase invalid computing energy consumption. If the first preset threshold is too small, the abnormal area may be divided into a normal area, which will cause the system to miss judgment when detecting abnormal areas, which may easily cause safety hazards during vehicle driving.

[0065] This embodiment obtains the coordinate data of all pixel points in the image, determines the local reachable density of any pixel point based on the coordinate data, and determines that there is an abnormality in the image when the local reachable density is less than or equal to a first preset threshold value. This allows the system to quickly calculate the local reachable density of the pixel point based on the pixel point data, and determine that there is an abnormality in the image when the density is less than or equal to the first preset threshold value, making the determination of image abnormalities faster and more accurate, greatly saving the research and development time of the algorithm, and effectively reducing the cost of dirt detection.

[0066] In some embodiments, determining the dirt type of a region according to the target average grayscale value includes:

[0067] Get the average gray value of the image;

[0068] If the target average gray value is less than the image average gray value, and the absolute value of the difference between the image average gray value and the target average gray value is greater than the preset gray value, then the dirt type is determined to be opaque dirt;

[0069] If the absolute value of the difference between the average grayscale value of the image and the target average grayscale value is less than or equal to the preset grayscale value, the dirt type is determined to be light-transmitting dirt;

[0070] If the target average grayscale value is greater than the average grayscale value of the image, and the absolute value of the difference between the average grayscale value of the image and the target average grayscale value is greater than the preset grayscale value, the dirt type is determined to be translucent dirt or no dirt.

[0071] Specifically, obtaining the average grayscale value of an image can be achieved by using the cvtColor function in the Computer Vision (CV) library and the mean function in the NumPy library. Specifically, when the system finds that the image is an abnormal image, it will convert the color of the abnormal image, that is, use the cvtColor function in the CV library to convert the abnormal image into a grayscale image. After converting to a grayscale image, the grayscale value of each pixel can be determined from it. At this time, the mean function in the NumPy library can be used to calculate the average grayscale value of the entire abnormal image. In addition, for each pixel grid area divided into a preset area size, the target average grayscale value of the area can also be determined in this way. Of course, the target average grayscale value of each pixel grid area can also be determined first, and then the mean function can be used again to determine the average grayscale value of the entire abnormal image.

[0072] The preset grayscale value can be set to 100, 80, 60, etc., and can be appropriately increased or decreased according to the current driving environment of the vehicle. For example, when the current environment is an open road and the weather is clear, the sunlight can easily shine on the windshield, and the preset grayscale value can be appropriately increased; when the current environment is that there is an obstruction in the sky or the weather is cloudy, the brightness of the external light is obviously low, and the preset grayscale value can be appropriately reduced; the specific data for reducing or increasing the preset grayscale value can also be determined according to the actual situation, and is not specifically limited here.

[0073] Specifically, as an example, it can be assumed that the average grayscale value of the current image is 150 and the preset grayscale value is 60. If the target average grayscale value of the current pixel grid area is 50, the target average grayscale value at this time is less than the average grayscale value of the image, and |150-50|=100, which is greater than 60, that is, the absolute value of the difference between the average grayscale value of the image and the target average grayscale value is greater than the preset grayscale value. At this time, it can be determined that there is dirt in the pixel grid area, and the type of dirt should be opaque dirt; if the target average grayscale value of the current pixel grid area is 100, the target average grayscale value at this time is less than the average grayscale value of the image, but |150-100|=50, which is less than 60, that is, the absolute value of the difference between the average grayscale value of the image and the target average grayscale value is less than the preset grayscale value. At this time, it can be determined that there is dirt in the pixel grid area, and the type of dirt should be translucent dirt; If the target average grayscale value of the current pixel grid area is 200, the target average grayscale value at this time is greater than the average grayscale value of the image, but |150-200|=50, which is less than 60, that is, the absolute value of the difference between the average grayscale value of the image and the target average grayscale value is less than the preset grayscale value. At this time, it can be determined that there is dirt in the pixel grid area, and the type of dirt should be translucent dirt; if the target average grayscale value of the current pixel grid area is 250, the target average grayscale value at this time is greater than the average grayscale value of the image, and |150-250|=100, which is greater than 60, that is, the absolute value of the difference between the average grayscale value of the image and the target average grayscale value is greater than the preset grayscale value. At this time, due to the high light intensity in the area, the specific dirt type cannot be accurately determined by this method, but it can be determined that the area may be translucent dirt or not dirty, and it is impossible to be opaque dirt.

[0074] Specifically, the dirt detection process can be as follows Figure 2 As shown, the image will first be detected to determine whether there are abnormal areas in the image; if there are no abnormal areas, it is considered that the current windshield is clean, and various intelligent driving functions can continue to be in operation. If there are abnormal areas, that is, the current image is an abnormal image, it is necessary to calculate the target average grayscale value of each current pixel grid area and the average grayscale value of the image, and also calculate the absolute value of the difference between the average grayscale value of the image and the target average grayscale value, and compare the absolute value with the preset grayscale value; if it is greater than the preset grayscale value, and the target average grayscale value is less than the average grayscale value of the image, the dirt type is judged as opaque dirt. At this time, the intelligent driving function needs to be turned off and an alarm pop-up window is triggered to ensure that the user can receive the corresponding notification; if it is less than or equal to the preset grayscale value, the dirt type is judged as translucent dirt. Although there is dirt, the dirt can be cleaned by the wiper, and the user does not need to get off the car to clean it or go to a car wash for special cleaning. Therefore, various intelligent driving functions can still work normally.

[0075] This embodiment obtains the target average grayscale value and the average grayscale value of the image, and uses the preset grayscale value set in advance to determine the type of dirt in each pixel grid area, so that the most effective cleaning method can be used according to the dirt type. In addition, by judging the dirt type of each area, a data basis is provided for subsequently determining whether the image is a usable image.

[0076] In some embodiments, determining the area of ​​the region corresponding to the opaque dirt, and determining whether the image of the windshield is a usable image according to the area of ​​the region, includes:

[0077] Determine the number of areas corresponding to opaque dirt;

[0078] Based on the number of regions and the preset region size, the region area corresponding to the opaque type dirt is determined; when the region area is greater than the preset area threshold, it is determined that the image of the windshield is not a usable image; when the region area is less than or equal to the preset area threshold, it is determined that the image of the windshield is a usable image.

[0079] Specifically, the preset area threshold can be determined by directly setting a numerical value, or it can be determined based on the total area of ​​the image. For example, the preset area threshold can be directly set to 30,000 unit areas, or it can be set to 50% of the total area of ​​the image. During specific implementation, it can be set or modified according to actual needs, and no specific limitation is made here.

[0080] It should be noted that the value of the preset area threshold should not be too large or too small. If the value is too large, the safety of the vehicle will be reduced during driving, and there will be safety hazards. Although the output image is marked as a usable image, the intelligent driving function cannot accurately identify the required target from the image, which may easily cause the intelligent driving function to make misjudgments. If the value is too small, the user will be frequently prompted to wash the car during driving, resulting in ineffective cleaning of the vehicle and a waste of water resources, user property and time.

[0081] Specifically, it can be assumed that the preset area threshold is 36,000 unit areas, and the preset area size is 900 unit areas. For example, the number of areas corresponding to the current opaque type dirt is 50, and the area of ​​the area corresponding to the opaque type dirt is 50×900=45,000 unit areas, which is greater than 36,000 unit areas, that is, the area of ​​the area corresponding to the opaque type dirt is greater than the preset area threshold. At this time, the image of the windshield can be determined as not being a usable image; for another example, the number of areas corresponding to the current opaque type dirt is 30, and the area of ​​the area corresponding to the opaque type dirt is 30=27,000 unit areas, which is less than 27,000 unit areas, that is, the area of ​​the area corresponding to the opaque type dirt is less than the preset area threshold. At this time, the image of the windshield can be determined as a usable image.

[0082] This embodiment can accurately determine the degree of dirtiness of the windshield by utilizing the area, and when the degree of dirtiness reaches a certain value, determine that the image is unusable, so that the intelligent driving system will not make misjudgments due to unclear images, thereby improving the safety of vehicle driving. In addition, during the detection process, only cameras are used, without relying on hardware equipment and training data, which greatly reduces the cost of dirtiness detection.

[0083] In some embodiments, after determining the dirt type of the region according to the target average grayscale value, the method further includes:

[0084] In the case where the dirt type is opaque dirt, a first prompt message is issued, wherein the first prompt message is used to prompt that the required cleaning method for the windshield is manual cleaning;

[0085] When the dirt type is translucent dirt, a second prompt message is issued, and the wiper is controlled to clean after a preset time, wherein the second prompt message is used to prompt that the required cleaning method for the windshield is automatic cleaning.

[0086] Specifically, manual cleaning can be manual scrubbing or the user can drive the vehicle to a car wash for cleaning; automatic cleaning can be cleaning with glass water and wipers installed on the vehicle; the preset time can be 5 seconds, 7 seconds, 9 seconds, etc., which can be determined according to actual needs. The first prompt message and the second prompt message can be sent through a pop-up window or through voice broadcast. The specific content of the first prompt message can be "The current windshield has opaque dirt, please clean it manually in time"; the specific content of the second prompt message can be "The current windshield has translucent dirt, and the wipers will be turned on for cleaning in 5 seconds, please pay attention."

[0087] Specifically, when opaque dirt is detected, the system will send a first prompt message to the user in the form of a voice broadcast. After receiving the first prompt message, the user will clean the windshield as soon as possible to ensure the cleanliness of the windshield. When translucent dirt is detected, the system will send a second prompt message to the user in the form of a voice broadcast. After receiving the second prompt message, the user will prepare to turn on the wipers, and after a certain period of time, the system will use the wipers to automatically clean the windshield.

[0088] This embodiment sends different prompt information and performs corresponding operations according to the type of dirt, so that the user can determine the current status of the vehicle windshield at the first time and can make corresponding operations in time. When automatic cleaning is turned on, the user will be informed in advance so that the user can understand the vehicle's operating conditions in real time, avoid sudden cleaning and scare the user, and improve the user's comfort and safety when driving the vehicle.

[0089] In some embodiments, before traversing the image according to the preset area size and determining the target average grayscale value of each traversed area, the method further includes:

[0090] Acquire N consecutive frames of windshield images, where N is greater than or equal to 2;

[0091] When the number of frames of the N frames of images with abnormalities is less than or equal to the preset number of frames, it is determined that there is no dirt on the windshield and the cause of the abnormality is a detection error;

[0092] When the number of frames with abnormal images in the N frames of images is greater than the preset number of frames, the step of traversing the images according to the preset area size and determining the target average grayscale value of each traversed area is entered.

[0093] The number of N can be 5, 7, 9, etc., and the preset number of frames can be 3, 5, 7, etc., which is determined by the value of N and is not specifically limited here.

[0094] Specifically, as an example, when the system detects that there is an abnormality in the image of the windshield, 7 consecutive frames of windshield images can be obtained, and image abnormality detection can be performed on each of the 7 frames, and the images with detected abnormalities are counted to obtain the number of frames of the final abnormal image. If the number of frames is 4, which is less than 5, that is, the number of frames of images with abnormalities is less than the preset number of frames, then it can be considered that the cause of the image abnormality may be due to a detection error, or there is an object relatively stationary with the vehicle during this period, and there is no dirt on the windshield; if the number of frames is 6, which is greater than 5, that is, the number of frames of images with abnormalities is less than or equal to the preset number of frames, then it can be considered that the current image does have an abnormality. At this time, the most recently captured image among the 7 frames can be used as the target image, and based on this image, the step of traversing the image according to the preset area size and determining the target average grayscale value of each traversed area is entered.

[0095] This embodiment selects multiple frames of images to determine whether there is an abnormality in each frame, thereby avoiding the waste of operating resources due to detection errors, and through the repetitive detection of multiple frames, the final result is more reliable.

[0096] In some embodiments, after determining the area of ​​the region corresponding to the opaque dirt and determining whether the image of the windshield is a usable image according to the area of ​​the region, the method further includes:

[0097] When the image of the windshield is not a usable image, the intelligent driving function related to the windshield is controlled to be turned off, and a warning message is issued, wherein the warning message is used to warn that the windshield is currently unusable and the intelligent driving function has been turned off;

[0098] When the intelligent driving function is turned off, if an area detection command is received, the area of ​​the area is re-determined; when it is detected that the area of ​​the area is less than or equal to the preset area threshold, the intelligent driving function is controlled to be turned on.

[0099] Specifically, when the system determines that the current image is not a usable image, it will immediately control the intelligent driving functions related to the windshield to be turned off, and the ongoing functions will also be stopped accordingly. Before stopping, the system will send a warning message to the user through voice or a pop-up window on the central control screen, notifying the user to take over the vehicle immediately. At this time, the driver needs to drive the vehicle entirely based on his own judgment; when the driver believes that the current windshield has been cleaned and the intelligent driving function can be restarted, the driver can use voice commands or check the box on the central control screen. After receiving the driver's command, the system will re-enable dirt detection and re-determine the area of ​​the dirty area. If the area of ​​the area is detected to be less than or equal to the preset area threshold, the intelligent driving functions will be restored; if the area of ​​the area is still detected to be larger than the preset area threshold, the intelligent driving function will be maintained turned off, and a warning message can be sent to the user again, requesting the user to clean the windshield as soon as possible to avoid traffic accidents.

[0100] This embodiment turns off the intelligent driving function and sends a warning message when the image of the windshield is not a usable image, and restores various intelligent driving functions when the image of the windshield is a usable image, so that the intelligent driving function can always accurately identify the collected image, avoiding the intelligent driving function being unable to identify or identifying the content in the wrong graphic, thereby outputting erroneous information, resulting in safety hazards or traffic accidents, thereby improving the safety of the vehicle during driving and the accuracy and reliability of the information output by the intelligent driving function.

[0101] It should be understood that the size of the serial numbers of the steps in the above embodiments does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present application.

[0102] All the above optional technical solutions can be arbitrarily combined to form optional embodiments of the present application, which will not be described one by one here.

[0103] The following is an embodiment of the device of the present application, which can be used to execute the embodiment of the method of the present application. For details not disclosed in the embodiment of the device of the present application, please refer to the embodiment of the method of the present application.

[0104] Figure 3 Schematic diagram of a windshield dirt detection device provided in an embodiment of the present application. Figure 3 As shown, the device comprises:

[0105] A data acquisition module 301 is used to acquire an image of the windshield taken by a camera;

[0106] The first determination module 302 is used to traverse the image according to a preset area size and determine a target average grayscale value of each traversed area when an abnormality is detected in the image;

[0107] A second determination module 303 is used to determine the type of dirt in each region according to the target average gray value, wherein the dirt type includes opaque dirt and translucent dirt;

[0108] The third determination module 304 is used to determine the area of ​​the region corresponding to the opaque dirt, and determine whether the image of the windshield is a usable image according to the area of ​​the region.

[0109] According to the technical solution provided by the embodiment of the present application, the data acquisition module 301 acquires the image of the windshield taken by the camera to provide a data basis for the subsequent detection of image abnormalities. The first determination module 302 traverses the image according to the preset area size when the image is detected to be abnormal, and determines the target average grayscale value of each traversed area. The image of the windshield is firstly detected. When the image is found to be abnormal after the initial detection, the grayscale value of each area in the image is measured, so that the initial detection is performed before the full detection, which greatly saves the operating resources occupied by the detection process, effectively reduces the cost of detection, and makes the detection more comprehensive through two detections, effectively preventing the occurrence of missed detection and false detection. The second determination module 303 determines the type of dirt in the area according to the target average grayscale value for each area, wherein the dirt type includes opaque dirt and translucent dirt. The target average grayscale value is used to determine the type of dirt on the windshield, so that the most effective cleaning method can be adopted according to the dirt type in the subsequent detection. In addition, by judging the dirt type of each area, a data basis is provided for the subsequent determination of whether the image is a usable image. The third determination module 304 determines the area of ​​the region corresponding to the opaque type of dirt, and determines whether the image of the windshield is a usable image based on the area of ​​the region. The area of ​​the region can be used to accurately judge the degree of dirt on the windshield, and when the degree of dirt reaches a certain value, the image is judged to be unusable, so that the intelligent driving system will not make misjudgments due to unclear images, thereby improving the safety of vehicle driving. In addition, during the detection process, only cameras are used, without relying on hardware equipment and training data, which greatly reduces the cost of dirt detection and solves the problems of high cost and easy misjudgment of windshield dirt detection in the prior art.

[0110] In some embodiments, the first determination module 302 is also used to: obtain coordinate data of all pixel points in the image; determine the local reachable density of any pixel point based on the coordinate data; and determine that an abnormality exists in the image when the local reachable density is less than or equal to a first preset threshold.

[0111] In some embodiments, the second determination module 303 is specifically used to: obtain the average grayscale value of the image; if the target average grayscale value is less than the average grayscale value of the image, and the absolute value of the difference between the average grayscale value of the image and the target average grayscale value is greater than the preset grayscale value, then the dirt type is determined to be opaque dirt; if the absolute value of the difference between the average grayscale value of the image and the target average grayscale value is less than or equal to the preset grayscale value, then the dirt type is determined to be translucent dirt; if the target average grayscale value is greater than the average grayscale value of the image, and the absolute value of the difference between the average grayscale value of the image and the target average grayscale value is greater than the preset grayscale value, then the dirt type is determined to be translucent dirt or no dirt.

[0112] In some embodiments, the third determination module 304 is specifically used to: determine the number of areas corresponding to opaque type dirt; determine the area of ​​the areas corresponding to the opaque type dirt based on the number of areas and the preset area size; when the area is greater than the preset area threshold, determine that the image of the windshield is not a usable image; when the area is less than or equal to the preset area threshold, determine that the image of the windshield is a usable image.

[0113] In some embodiments, the second determination module 303 is also used for: when the dirt type is opaque dirt, issuing a first prompt message, wherein the first prompt message is used to prompt that the required cleaning method for the windshield is manual cleaning; when the dirt type is translucent dirt, issuing a second prompt message, and controlling the wiper to clean after a preset time, wherein the second prompt message is used to prompt that the required cleaning method for the windshield is automatic cleaning.

[0114] In some embodiments, the first determination module 302 is also used to: obtain N consecutive frames of images of the windshield, where N is greater than or equal to 2; when the number of frames of abnormal images in the N frames is less than or equal to a preset number of frames, determine that there is no dirt on the windshield and that the cause of the abnormality is a detection error; when the number of frames of abnormal images in the N frames is greater than a preset number of frames, enter the step of traversing the image according to a preset area size and determining the target average grayscale value of each traversed area.

[0115] In some embodiments, the third determination module 304 is also used for: when the image of the windshield is not a usable image, controlling the intelligent driving function related to the windshield to be turned off, and issuing a warning message, wherein the warning message is used to warn that the current windshield is unavailable and the intelligent driving function is turned off; when the intelligent driving function is turned off, if an area detection instruction is received, redetermining the area of ​​the region; and when it is detected that the area of ​​the region is less than or equal to a preset area threshold, controlling the intelligent driving function to be turned on.

[0116] It should be noted that the device provided in the present application can implement all the method steps executed by the above method and can achieve the same technical effect, which will not be repeated here.

[0117] Figure 4 Schematic diagram of an electronic device 4 provided in an embodiment of the present application. Figure 4 As shown, the electronic device 4 of this embodiment includes: a processor 401, a memory 402, and a computer program 403 stored in the memory 402 and executable on the processor 401. When the processor 401 executes the computer program 403, the steps in the above-mentioned method embodiments are implemented. Alternatively, when the processor 401 executes the computer program 403, the functions of the modules / units in the above-mentioned device embodiments are implemented.

[0118] The electronic device 4 may be a desktop computer, a notebook, a PDA, a cloud server, or other electronic device. The electronic device 4 may include, but is not limited to, a processor 401 and a memory 402. Those skilled in the art will appreciate that Figure 4 The electronic device 4 is merely an example and does not limit the electronic device 4 , and may include more or less components than those shown in the figure, or different components.

[0119] The processor 401 may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc.

[0120] The memory 402 may be an internal storage unit of the electronic device 4, for example, a hard disk or memory of the electronic device 4. The memory 402 may also be an external storage device of the electronic device 4, for example, a plug-in hard disk, a smart media card (SMC), a secure digital (SD) card, a flash card, etc. equipped on the electronic device 4. The memory 402 may also include both an internal storage unit and an external storage device of the electronic device 4. The memory 402 is used to store computer programs and other programs and data required by the electronic device.

[0121] Those skilled in the art can clearly understand that for the convenience and simplicity of description, only the division of the above-mentioned functional units and modules is used as an example. In actual applications, the above-mentioned functions can be assigned to different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above. The functional units and modules in the embodiments can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The above-mentioned integrated unit can be implemented in the form of hardware or in the form of software functional units.

[0122] If the integrated module / unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a readable storage medium. Based on this understanding, the present application implements all or part of the process in the above-mentioned embodiment method, and can also be completed by instructing the relevant hardware through a computer program. The computer program can be stored in a readable storage medium, and the computer program can implement the steps of the above-mentioned various method embodiments when executed by the processor. The computer program may include computer program code, which may be in source code form, object code form, executable file or some intermediate form. The readable storage medium may include: any entity or device capable of carrying computer program code, recording medium, U disk, mobile hard disk, magnetic disk, optical disk, computer memory, read-only memory (ROM), random access memory (RAM), electric carrier signal, telecommunication signal and software distribution medium, etc.

[0123] The above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. These modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present application, and should all be included in the protection scope of the present application.

Claims

1. A method for detecting windshield dirtiness, characterized in that: The method comprises: Get the image of the windshield taken by the camera; When an abnormality is detected in the image, the image is traversed according to a preset area size, and a target average grayscale value of each traversed area is determined; For each of the regions, determining the dirt type of the region according to the target average grayscale value, wherein the dirt type includes opaque dirt and translucent dirt; The area of ​​the region corresponding to the opaque dirt is determined, and whether the image of the windshield is a usable image is determined according to the area of ​​the region.

2. The method according to claim 1, characterized in that: The detecting that the image is abnormal includes: Obtaining coordinate data of all pixels in the image; Determine the local reachable density of any of the pixel points according to the coordinate data; When the local reachable density is less than or equal to a first preset threshold, it is determined that the abnormality exists in the image.

3. The method according to claim 1, characterized in that The determining the dirt type of the area according to the target average gray value includes: Obtaining an average grayscale value of the image; If the target average grayscale value is less than the average grayscale value of the image, and the absolute value of the difference between the average grayscale value of the image and the target average grayscale value is greater than a preset grayscale value, then the dirt type is determined to be the opaque dirt; If the absolute value of the difference between the average grayscale value of the image and the target average grayscale value is less than or equal to the preset grayscale value, then determining that the dirt type is the light-transmitting dirt; If the target average grayscale value is greater than the average grayscale value of the image, and the absolute value of the difference between the average grayscale value of the image and the target average grayscale value is greater than a preset grayscale value, the dirt type is determined to be the light-transmitting dirt or no dirt.

4. The method according to claim 1, characterized in that: The step of determining the area of ​​the region corresponding to the opaque dirt and determining whether the image of the windshield is a usable image according to the area of ​​the region includes: Determine the number of areas corresponding to the opaque dirt; Determining the area of ​​the region corresponding to the opaque dirt according to the number of the regions and the preset region size; When the area of ​​the region is greater than a preset area threshold, determining that the image of the windshield is not the usable image; When the area of ​​the region is less than or equal to the preset area threshold, it is determined that the image of the windshield is the available image.

5. The method according to claim 1, characterized in that: After determining the dirt type of the area according to the target average grayscale value, the method further includes: When the dirt type is the opaque dirt, issuing a first prompt message, wherein the first prompt message is used to prompt that the required cleaning method for the windshield is manual cleaning; When the dirt type is the light-transmitting dirt, a second prompt message is issued, and the wiper is controlled to clean after a preset time, wherein the second prompt message is used to prompt that the cleaning method required for the windshield is automatic cleaning.

6. The method according to claim 1, characterized in that Before traversing the image according to the preset area size and determining the target average grayscale value of each traversed area, the method further includes: Acquire N consecutive frames of windshield images, where N is greater than or equal to 2; When the number of frames of the N frames of images in which the abnormality exists is less than or equal to the preset number of frames, it is determined that there is no dirt on the windshield, and the cause of the abnormality is a detection error; When the number of frames in which the abnormal image exists in the N frames of images is greater than the preset number of frames, the step of traversing the image according to the preset area size and determining the target average grayscale value of each traversed area is entered.

7. The method according to claim 1, characterized in that After determining the area of ​​the region corresponding to the opaque dirt and determining whether the image of the windshield is a usable image according to the area of ​​the region, the method further includes: When the image of the windshield is not the available image, controlling the intelligent driving function related to the windshield to be turned off, and issuing a warning message, wherein the warning message is used to warn that the current windshield is unavailable and the intelligent driving function has been turned off; When the intelligent driving function is turned off, if an area detection instruction is received, the area of ​​the region is re-determined; When it is detected that the area of ​​the region is less than or equal to the preset area threshold, the intelligent driving function is controlled to be turned on.

8. A device for detecting windshield dirt, characterized in that: include: A data acquisition module, used to acquire an image of the windshield taken by a camera; A first determination module is used to traverse the image according to a preset area size and determine a target average grayscale value of each traversed area when an abnormality is detected in the image; A second determination module is used to determine, for each of the regions, a dirt type of the region according to the target average grayscale value, wherein the dirt type includes opaque dirt and translucent dirt; The third determination module is used to determine the area of ​​the region corresponding to the opaque dirt, and determine whether the image of the windshield is a usable image according to the area of ​​the region.

9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 7 are implemented.

10. A readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 7 are implemented.

Citation Information

Cited By

  • Automobile motor cleaning system and control method thereof

    CN120308051A

  • Cleaning robot control method and system for photovoltaic power station

    CN121033058A

  • A cleaning robot control method and system for a photovoltaic power station

    CN121033058B