Lens fouling detection method and device, vehicle and storage medium
By inputting the environmental image collected by the camera into the pre-trained lens contamination detection model, the area ratio of the contamination type in each image area is obtained, which solves the problem in the existing technology that it is difficult to detect the lens when the vehicle is stationary or the edge features of the contamination image are unclear. The problem of contamination enables accurate judgment of contamination and improved safety on the impact of smart driving functions.
Patent Information
- Application Number
- CN202310167942.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-02-23
- Publication Date
- 2024-08-23
AI Technical Summary
The existing technology is difficult to accurately detect the contamination of the vehicle camera lens when the vehicle is stationary or the edge features of the contamination image are not clear, leading to an increased risk of safety accidents.
By inputting the environmental image collected by the camera into the pre-trained lens stain detection model, the area ratio corresponding to various stain types in each image area is obtained, including no stain, translucent stain and full occlusion stain, and then the judgment is made. Whether there is dirt in the image area that affects the intelligent driving function, this method can be used when the vehicle is stationary or in motion.
It achieves accurate detection of dirt that affects smart driving functions, improves vehicle driving safety, avoids unnecessary function degradation, and enhances environmental adaptability.
Smart Images

Figure CN118540459A
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and more specifically, to a lens contamination detection method, device, vehicle and computer-readable storage medium. Background Art
[0002] Before using the Advanced Driving Assistance System and the autonomous driving system, the camera needs to be tested for lens contamination to assess whether the current camera status can normally complete the specified functions, ensure the reliability and safety of the system during operation, and avoid safety accidents caused by lens contamination.
[0003] At present, the lens contamination detection methods of vehicle-mounted cameras are mainly divided into two categories. One is the manual evaluation method, which relies on the driver's subjective judgment of whether the lens is contaminated. This method has high stability but low efficiency and cannot be embedded in the intelligent driving system; the other is the automatic evaluation method, which evaluates the image quality through a specific algorithm and detects lens contamination by detecting changes in image edge information, histogram statistics and other features. However, lens contamination can only be detected when the vehicle is in motion or has significant edge features. Therefore, when the vehicle is stationary or the edge features of the contaminated image are unclear, it is difficult to achieve accurate detection of lens contamination using the above method, so a lens contamination detection method is urgently needed to overcome this shortcoming. Summary of the invention
[0004] The present application proposes a lens contamination detection method, device, vehicle and computer-readable storage medium to improve the above-mentioned defects.
[0005] In a first aspect, an embodiment of the present application provides a headlight control method, the method comprising: controlling a camera installed on a vehicle to collect an environmental image outside the vehicle; inputting the environmental image into a pre-trained lens stain detection model to obtain area ratios corresponding to multiple stain types in each image area in the environmental image; wherein the multiple stain types include at least no stain, semi-transparent stain and fully occluded stain; no stain indicates the absence of stain, semi-transparent stain indicates stain that allows part of the light to pass through, and fully occluded stain indicates stain that prevents all light from passing through; according to the area ratios corresponding to the multiple stain types in each image area in the environmental image, the stain condition of each image area in the environmental image is obtained to determine the dirty image area in the environmental image.
[0006] In a second aspect, an embodiment of the present application also provides a lens damage detection device, which includes: an acquisition unit, used to control a camera installed on a vehicle to acquire an environmental image outside the vehicle; an acquisition unit, used to input the environmental image into a pre-trained lens damage detection model, and obtain area ratios corresponding to multiple types of damage in each image area in the environmental image; wherein the multiple types of damage include at least no damage, semi-transparent damage, and fully-occluded damage; no damage indicates the absence of damage, semi-transparent damage indicates damage that allows part of the light to pass through, and fully-occluded damage indicates damage that prevents all light from passing through; a determination unit, used to obtain the damage conditions of each image area in the environmental image according to the area ratios corresponding to the multiple types of damage in each image area in the environmental image, so as to determine the image area in the environmental image where there is dirt.
[0007] In a third aspect, an embodiment of the present application further provides a vehicle, characterized in that the vehicle comprises: one or more processors; a memory; one or more applications, wherein one or more applications are stored in the memory and configured to be executed by one or more processors, and one or more programs are configured to execute the above method.
[0008] In a fourth aspect, an embodiment of the present application further provides a computer-readable storage medium, which stores a program code executable by a processor, and when the program code is executed by the processor, the processor executes the above method.
[0009] The present application discloses a lens contamination detection method, device, vehicle and storage medium, the method comprising: inputting the environmental image collected by the camera into the lens contamination detection model, the lens contamination detection model outputting the area ratio corresponding to multiple contamination types of each image area in the environmental image, and obtaining the contamination rate of each image area according to the area ratio corresponding to multiple contamination types of each image area in the environmental image and the degree of influence of the contamination type on the image quality, and judging whether there is contamination in each image area in the environmental image that really affects the normal operation of the intelligent driving function. Compared with the lens contamination detection method based on feature changes such as image edge information in the prior art, it can more accurately judge the contamination that affects the intelligent driving function, and the method of the present application has strong environmental adaptability and can be used when the vehicle is stationary or moving. Furthermore, in the present application, different processing can be performed according to the contamination conditions of each image area (such as the degree of contamination and whether the image area is located in the area of interest of the environmental image, etc.), so as to avoid unnecessary influence on the normal operation of the intelligent driving function.
[0010] Other features and advantages of the embodiments of the present application will be described in the subsequent description, and partly become apparent from the description, or can be understood by practicing the embodiments of the present application. The purposes and other advantages of the embodiments of the present application can be realized and obtained by the structures specifically pointed out in the written description, claims, and drawings. BRIEF DESCRIPTION OF THE DRAWINGS
[0011] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For those skilled in the art, other drawings can be obtained based on these drawings without creative work.
[0012] Figure 1 A schematic diagram of a vehicle hardware environment suitable for an embodiment of the present application is shown.
[0013] Figure 2 A flow chart of a lens contamination detection method proposed according to an embodiment of the present application is shown.
[0014] Figure 3 A flow chart of a lens contamination detection method proposed according to another embodiment of the present application is shown.
[0015] Figure 4 A flow chart of a lens contamination detection method proposed according to another embodiment of the present application is shown.
[0016] Figure 5 A flow chart of a lens contamination detection method proposed according to another embodiment of the present application is shown.
[0017] Figure 6 A structural block diagram of a lens contamination detection device proposed in an embodiment of the present application is shown.
[0018] Figure 7 A structural block diagram of a computer-readable storage medium provided in an embodiment of the present application is shown. DETAILED DESCRIPTION
[0019] In order to make those skilled in the art better understand the present application scheme, the technical scheme in the present application embodiment will be clearly and completely described below in conjunction with the drawings in the present application embodiment. Obviously, the described embodiment is only a part of the present application embodiment, rather than all the embodiments. The components of the present application embodiment usually described and shown in the drawings here can be arranged and designed in various different configurations. Therefore, the following detailed description of the embodiments of the present application provided in the drawings is not intended to limit the scope of the present application for protection, but merely represents the selected embodiment of the present application. Based on the embodiments of the present application, all other embodiments obtained by those skilled in the art without making creative work belong to the scope of protection of the present application.
[0020] It should be noted that similar reference numerals and letters represent similar items in the following drawings, so once an item is defined in one drawing, it does not need to be further defined and explained in subsequent drawings. At the same time, in the description of this application, the terms "first", "second", etc. are only used to distinguish the description and cannot be understood as indicating or implying relative importance.
[0021] Currently, there are two main types of methods for detecting lens contamination of vehicle-mounted cameras. One is the manual evaluation method, which relies on the driver's subjective judgment on whether the lens is contaminated. This method has high stability but low efficiency and cannot be embedded in intelligent driving systems. The other is the automatic evaluation method, which evaluates image quality through a specific algorithm and detects lens contamination by detecting changes in image edge information, histogram statistics and other features. However, lens contamination can only be detected when the vehicle is in motion or has significant edge features.
[0022] However, the above method cannot accurately detect lens contamination when the vehicle is stationary or the contaminated image does not have obvious edge features, which may lead to safety accidents.
[0023] Therefore, in order to overcome the above-mentioned defects, the inventors have proposed a lens damage detection method, device, camera, vehicle and computer-readable storage medium, which can input the image collected by the camera into a pre-trained lens damage detection model, and the lens damage detection model obtains the damage area ratios corresponding to multiple damage types in each image area of the image, and then determines whether the lens has damage that affects the functional operation according to the damage area ratios corresponding to the damage types, so that the vehicle can perform subsequent processing according to the detection results output by the lens damage detection model (for example, different processing according to different degrees of dirtiness), thereby improving the driving safety of the vehicle.
[0024] See also Figure 1 , Figure 1A schematic diagram of a vehicle hardware environment suitable for an embodiment of the present application is shown, where the vehicle 100 includes one or more (only one is shown in the figure) processors 110 , a memory 111 , and a camera 112 .
[0025] The processor 110 may be a microcontroller unit (MCU) having a built-in memory 111 . The memory 111 stores a program that can execute the contents of the following embodiments, and the processor 110 may execute the program stored in the memory 111 .
[0026] Among them, the processor 110 may include one or more processors. The processor 110 uses various interfaces and lines to connect various parts in the entire vehicle 100, and executes various functions and processes data of the vehicle 10 by running or executing instructions, programs, code sets or instruction sets stored in the memory 111, and calling data stored in the memory 111. Optionally, the processor 110 can be implemented in at least one hardware form of digital signal processing (Digital Signal Processing, DSP), field programmable gate array (Field-Programmable Gate Array, FPGA), and programmable logic array (Programmable Logic Array, PLA). The processor 12 can integrate one or a combination of a central processing unit (Central Processing Unit, CPU), a graphics processing unit (Graphics Processing Unit, GPU) and a modem. Among them, the CPU mainly processes the operating system, user interface and application programs; the GPU is responsible for rendering and drawing display content; and the modem is used to process wireless communications. It can be understood that the above-mentioned modem may not be integrated into the processor 110, but may be implemented separately through a communication chip.
[0027] The memory 111 may include a random access memory (RAM) or a read-only memory (ROM). The memory 15 may be used to store instructions, programs, codes, code sets or instruction sets. The memory 15 may include a program storage area and a data storage area, wherein the program storage area may store instructions for implementing an operating system, instructions for implementing at least one function (such as a touch function, a sound playback function, an image playback function, etc.), instructions for implementing the following various method embodiments, etc.
[0028] The camera 112 is used to capture images or videos. The camera 112 mainly includes structures such as a lens and an image sensor. Among them, the lens is composed of several lenses, including a plastic lens (Plastic) or a glass lens (Glass). Image sensors generally include two major categories, CCD (charge-coupled device) and CMOS (complementary metal oxide semiconductor). In some embodiments of the present disclosure, the camera 112 may also include a flash. The flash can be a single-color temperature flash or a dual-color temperature flash. A dual-color temperature flash refers to a combination of a warm light flash and a cold light flash, which can be used for light compensation at different color temperatures. The image captured by the camera 112 is transmitted to the processor 110, and the processor 110 performs data analysis and processing on the image captured by the camera 112.
[0029] See also Figure 2 , Figure 2 A flow chart of a lens contamination detection method proposed in an embodiment of the present application is shown, which is used in a vehicle. The method includes:
[0030] S201 , controlling a camera installed on a vehicle to collect an image of the environment outside the vehicle.
[0031] The vehicle may be an electric vehicle or a fuel vehicle, and the vehicle may be a sedan, an SUV, a bus, a truck, etc. The camera is installed on the vehicle to collect the environment image outside the vehicle.
[0032] In some embodiments, the camera can respond to a lens contamination detection instruction to collect an environmental image outside the vehicle. The lens contamination detection instruction can be sent periodically by the vehicle. In response to the lens contamination detection instruction, the camera periodically collects environmental images outside the vehicle. The acquisition period can be 0.1s or 0.2s, and the period size can be selected according to demand. Of course, the lens contamination detection instruction can also be triggered by the user. The user triggers the lens contamination detection instruction in real time by touching the lens contamination detection control or voice control. After receiving the lens detection instruction, the camera turns on the image acquisition function to collect environmental images outside the vehicle. After completing the image acquisition, the camera transmits the acquired image to the computing device in the vehicle. The computing device can be the aforementioned processor, or other devices with data processing capabilities, which are not limited here.
[0033] Optionally, after receiving the environmental images captured by the camera, the computing device preprocesses the environmental images. Due to the influence of external conditions such as weather and lighting, there may be noise in the environmental images captured by the camera. In order to avoid interference with subsequent contamination detection, image preprocessing is required. The image preprocessing here includes but is not limited to filtering, noise reduction and other processing of the image.
[0034] S202: Input the environment image into a pre-trained lens contamination detection model to obtain the contamination type of each image area in the environment image and the area ratio corresponding to the contamination type.
[0035] The environment image input to the lens detection model may be an original image captured by a camera or an environment image that has undergone image preprocessing. Furthermore, the environment image may be an RGB image or a grayscale image, which is not limited here.
[0036] The lens damage detection model includes an image segmentation module, a pixel accumulation module and a ratio determination module, wherein the image segmentation module divides the input environment image into multiple image areas; the pixel accumulation module determines the damage type of each pixel point in each image area, and accumulates the number of pixels of each damage type in the multiple damage types of each image area; the ratio determination module determines the area ratio corresponding to each damage type in each image area according to the number of pixels of each damage type.
[0037] The environment image may be divided into a plurality of image regions in an even manner or in an uneven manner, which is not limited here.
[0038] In one implementation, the lens contamination detection model divides the environment image into M×N image regions, and obtains the contamination type and the corresponding area ratio existing in each image region.
[0039] The above-mentioned contamination types include at least three types: no contamination, semi-transparent contamination, and full occlusion contamination. In the prior art, the lens contamination method usually divides the pixels in the image into two categories: no contamination and contamination. If the number of pixels classified as contamination is greater than a preset threshold, it is determined that the lens is contaminated and needs to be cleaned.
[0040] However, the inventors have found that when there are semi-transparent stains (such as water droplets) on the lens or when the stains are present in non-interested areas of the lens image, these semi-transparent stains or stains present in non-interested areas do not affect the normal operation of the intelligent driving function, and there is no need to downgrade the intelligent driving function that requires the corresponding camera or even stop starting the intelligent driving function. Therefore, the lens stains detected by the above method cannot accurately determine the dirt that actually affects the intelligent driving function, which will lead to unnecessary function degradation, thereby affecting the normal operation of the vehicle intelligent driving system.
[0041] Therefore, the lens contamination detection model in this embodiment outputs the area ratios corresponding to the three types of contamination for each image area, where no contamination refers to an area where there is no contamination, that is, an area where all light can pass through. Translucent contamination refers to contamination that allows some light to pass through, such as water droplets remaining on the lens; full-blocking contamination refers to contamination that prevents all light from passing through, such as impurities such as dust or mud droplets attached to the lens.
[0042] For each image region, the area ratio corresponding to the type of contamination existing in the image region is obtained, which can be to determine the contamination type of each pixel point for each pixel point in the image region, accumulate the number of pixels of each contamination type, and thus obtain the ratio of the number of pixels of each contamination type to the total number of pixels in the image region as the area ratio corresponding to each contamination type. For example, if image region A includes 100 pixels, 50 of which are semi-transparent contamination, and the remaining pixels are non-contamination, then for image region A, the contamination types existing therein include non-contamination and semi-transparent contamination types, and the area ratios corresponding to both are 50%.
[0043] After the lens stain detection model detects the stain type and the corresponding stain area ratio of each image area divided by the environment image, it outputs an array R of M×N×Q, where M refers to the number of rows of the image area of the environment image, N refers to the number of columns of the image area of the environment image, and Q refers to the number of stain types. In this embodiment, there are three types of stains, so Q is 3. In other embodiments, Q can be other values. Each element R(i,j,k) in the array represents the area ratio of the k stain type in the image area of the i-th row and j-th column, where k=0,1,2 respectively correspond to the non-stain, semi-transparent stain, and fully occluded stain types. Assuming that the above image area A is located in the 2nd row and 3rd column of the environment image, the elements in the array corresponding to the above image area A in the result output by the lens stain detection model should include R(2,3,0)=0.5, R(2,3,1)=0.5, and R(2,3,2)=0.
[0044] The lens damage detection model is trained by using a large number of camera images and a data set constructed by pre-annotating the area ratio of each type of damage in each image area of these camera images. In the process of constructing the data set, the camera images are divided into regions, and the area ratio corresponding to each type of damage in each image area is annotated. There are three types of damage: no damage, semi-transparent damage, and fully occluded damage. The initial model predicts the area ratio of each type of damage in each image area in the training data and compares the obtained results with the true value of the aforementioned annotation to obtain the loss function value. The training is stopped until the loss function group meets the convergence condition. In the process of constructing the data set, data enhancement can be performed on the training data, including but not limited to translation, rotation, flipping, and color transformation of the data to improve the accuracy of the model.
[0045] In some embodiments, the classification model may be a deep learning model. For example, the deep learning model may include a MobileNet network, a ShuffleNet network, a SqueezeNet network, a Resnet network, and other neural networks. Of course, the deep learning model may also be a CNN (convolutional neural networks), a twin convolution network, a pseudo twin convolution network, etc. As an implementation method, the backbone network structure of the lens contamination detection model is Resnet-18, the last fully connected layer is removed, and a convolution layer is added. The activation function uses ReLU. The network model structure is simple and suitable for deployment on the embedded end.
[0046] In the above process, taking the lens contamination detection model of Resnet-18 as an example, multiple environmental images are input into Resnet-18, and the environmental images are convolved, pooled and activated through multiple hidden layers in Resnet-18. The output image of each hidden layer is used as the input image of the next hidden layer. The output image of the last convolution layer is input into the normalization layer, and the output image of the last convolution layer is exponentially normalized (softmax) through the normalization layer, so as to obtain the area ratio of each contamination type in each image area in the environmental image.
[0047] S203 , obtaining the contamination status of each image region in the environment image according to the area ratios corresponding to the multiple contamination types of each image region in the environment image, so as to determine the dirty image region in the environment image.
[0048] After the lens contamination detection model outputs the contamination type and the area ratio corresponding to the contamination type in each image area in the environmental image, based on the output result, the dirty image areas in the lens can be accurately located and the degree of contamination of these areas can be determined.
[0049] In this embodiment, the environmental image is input into a pre-trained lens damage detection model, and the lens damage detection model outputs the area ratios corresponding to the multiple types of damage in each image area in the environmental image, and further obtains the damage conditions of each image area in the environmental image based on the area ratios corresponding to the multiple types of damage in each image area in the environmental image. Since the damage types in this embodiment include at least three categories: no damage, semi-transparent damage, and fully occluded damage, the damage condition of the image area is determined by combining the damage area ratios of these three types of damage. Compared with the prior art, this method more accurately locates the dirty image areas in the environmental image that affect the normal operation of the intelligent driving function. At the same time, this method does not need to use feature changes such as image edge information for lens damage detection, has strong environmental adaptability, and is applicable when the vehicle is stationary or in motion.
[0050] Continue reading Figure 3 , Figure 3 A flowchart of a lens contamination detection method proposed in another embodiment of the present application is shown, the method includes steps S301-S304, wherein steps S301 and S302 are the same as steps S201 and S202 of the above embodiment, and are not described here. The following is a further explanation of steps S303 and S304.
[0051] As an implementation method, the contamination condition of each image area in the environmental image is obtained according to the area ratio corresponding to multiple contamination types of each image area in the environmental image, specifically including: S303, multiplying the area ratio corresponding to the contamination type of each image area in the environmental image by the weight corresponding to the contamination type to obtain the contamination rate of each image area in the environmental image.
[0052] Among them, different types of pollution correspond to different weights, and the weight of the pollution type indicates the degree of influence of the pollution type on the image quality of the image area. Generally, the higher the degree of influence of the pollution type on the image quality, the greater the influence of the pollution type on the normal operation of the intelligent driving system. Therefore, the higher the degree of influence of the pollution type on the image quality, the greater the weight of the pollution type on the image quality. For example, the weights corresponding to the non-fouling, semi-transparent pollution and fully occluded pollution types in this embodiment can be set to 0, 0.5 and 1, respectively. For the aforementioned image area A, the area ratios corresponding to the non-fouling, semi-transparent pollution and fully occluded pollution types are 0.5, 0.5 and 0, respectively. Assuming that the weights corresponding to the non-fouling, semi-transparent pollution and fully occluded pollution types are 0, 0.5 and 1, respectively, then the pollution rate of the aforementioned image area A is 0.5*0+0.5*0.5+0*1=0.25.
[0053] In order to further improve the detection accuracy, the pollution conditions of each image area of the current frame environment image can be further determined according to the pollution conditions of each image area in the environment images collected at different times in multiple frames. Specifically, for each image area of the current frame environment image, n frames of environment images before or after the current frame can be selected, and the pollution conditions of each image area in the current frame environment image and the image areas corresponding to the n frames of environment images can be counted, so as to determine the pollution conditions of the image area of the current frame environment image, where the value of n is not limited. It can be understood that the current frame environment image can also be used as an intermediate frame, and n frames of environment images can be selected before and after, and the pollution conditions of each image area in the current frame environment image and the image areas corresponding to the 2n frames of environment images can be counted, so as to determine the pollution conditions of the image area of the current frame environment image. The statistical method can be a simple arithmetic average of the pollution conditions of each image area of multiple frames of environment images, or a weighted arithmetic average of the pollution conditions of each image area of multiple frames of environment images. The weight of the statistical multiple frames of environment images can be set according to the distance from the current frame, and the weight of the environment image closer to the current frame is higher.
[0054] According to the area ratio corresponding to the pollution type of each image area in the environmental image, the pollution condition of each image area in the environmental image is obtained, which also includes: S304, judging whether the pollution rate of each image area is greater than a first pollution preset value; if the image area is greater than the first pollution preset value, it is determined that the image area is dirty.
[0055] Continue reading Figure 4 , Figure 4 A flowchart of a lens contamination detection method proposed in another embodiment of the present application is shown, the method includes steps S401-S406, wherein steps S401 and S402 are the same as steps S201 and S202 of the above embodiment, and step S403 is the same as step S303 of the above embodiment, which will not be described in detail here. The following is a further explanation of steps S404-S406.
[0056] As another implementation, obtaining the contamination status of each image region in the environment image according to the area ratios corresponding to the multiple contamination types of each image region in the environment image further includes:
[0057] S404, determining whether each image region is located in an area of interest in the environment image;
[0058] S405: If the image area is located in the region of interest in the environment image, determine whether the contamination rate of the image area is greater than a second contamination preset value corresponding to the region of interest;
[0059] S406: If the contamination rate of the image area is greater than the second contamination preset value, it is determined that the image area is contaminated. It can be understood that if the contamination rate of the image area is less than or equal to the second contamination preset value, it is determined that the image area is not contaminated;
[0060] Furthermore, if the image area is not located in the area of interest in the environmental image, it is determined whether the contamination rate of the image area is greater than the third contamination preset value corresponding to the non-interested area; if the image area is greater than the third contamination preset value, it is determined that there is dirt in the image area, otherwise it is determined that there is no dirt in the image area. The second contamination preset value of the area of interest is less than the third contamination preset value of the non-interested area. It can be understood that the image captured by the camera can be divided into an area of interest and an area of non-interest in practical applications. If the dirt is in the non-interested area of the image, the dirt usually does not affect the normal operation of the intelligent driving system, and the dirt does not need to be processed; if the dirt is in the area of interest in the image, the dirt may seriously affect the normal operation of the intelligent driving system. Therefore, the contamination threshold of the non-interested area of the image can be set higher than the contamination threshold of the interested area of the image, so as to accurately detect the dirt in the area of interest in the image, and further process the dirt that really affects the normal operation of the intelligent driving system.
[0061] In this embodiment, the method for determining the contamination of the image area located in the area of interest and the area of non-interest of the environmental image is different. According to the method of this embodiment, even if the contamination rate of the image area located in the area of interest is lower than the contamination rate of the image area located in the area of non-interest, the image area located in the area of interest may also be determined to be dirty. Therefore, the above method is conducive to keenly capturing the dirt in the area of interest in the environmental image.
[0062] Continue reading Figure 5 , Figure 5 A flowchart of a lens contamination detection method proposed in another embodiment of the present application is shown, the method includes steps S501-S509, wherein steps S501-S503 are the same as steps S201-S203 of the above embodiment, and are not described in detail here. The following is a further explanation of steps S504-S509.
[0063] After obtaining the contamination status of each image region in the environment image, different processing can be performed according to the contamination rate of the dirty image region. Specifically, the following steps can be included:
[0064] S504, determining whether the dirty image area is located in the area of interest of the environment image;
[0065] S505: If the dirty image region is located in the region of interest in the environment image, further determine whether the contamination rate of the dirty image region is greater than a fourth preset contamination value;
[0066] S506: If the contamination rate of the dirty image area is greater than a fourth preset contamination value, it indicates that the contamination of the dirty image area seriously affects the normal operation of the intelligent driving system, and the intelligent driving function of the camera that collects the environment image needs to be stopped;
[0067] S507: If the contamination rate of the dirty image region is less than or equal to the fourth preset contamination value, further determine whether the contamination rate of the dirty image region is greater than a fifth preset contamination value;
[0068] S508. If the contamination rate of the dirty image area is greater than the fifth preset contamination value, it means that the contamination of the dirty image area has a great impact on the normal operation of the intelligent driving system, and the intelligent driving function of the camera that needs to be used to collect the environmental image is downgraded, for example, only part of the intelligent driving function is enabled; wherein the fifth preset contamination value is less than the fourth preset contamination value;
[0069] S509. If the contamination rate of the dirty image area is less than or equal to the fifth preset contamination value, it means that the contamination of the dirty image area has little impact on the normal operation of the intelligent driving system, and then the image restoration / reconstruction algorithm is called to restore or reconstruct the environmental image.
[0070] It can be understood that if the image region with dirt is not located in the region of interest of the environment image, the dirt may not be further processed to reduce the amount of dirt processing.
[0071] In summary, in this embodiment, the environmental image captured by the camera is input into the lens damage detection model, and the lens damage detection model outputs the area ratios corresponding to multiple damage types in each image area in the environmental image, and according to the area ratios corresponding to multiple damage types in each image area in the environmental image and the degree of influence of the damage type on the image quality, the damage rate of each image area is obtained, and it is judged whether there is dirt in each image area in the environmental image that really affects the normal operation of the intelligent driving function, and the dirt that affects the intelligent driving function is judged more accurately, and different processing is performed according to the dirtiness of each image area (such as the degree of dirtiness and whether the image area is located in the area of interest of the environmental image) to avoid unnecessary influence on the normal operation of the intelligent driving function.
[0072] See attached Figure 6 , Figure 6 The structure block diagram of a lens contamination detection device proposed in one embodiment of the present application is shown, which is used in a vehicle. The device 700 includes:
[0073] The acquisition unit 601 is used to control the camera installed on the vehicle to acquire the environment image outside the vehicle;
[0074] The acquisition unit 602 is used to input the environment image into a pre-trained lens damage detection model to obtain area ratios corresponding to multiple types of damage in each image area in the environment image; wherein the multiple types of damage include at least no damage, semi-transparent damage, and fully blocked damage; no damage indicates that no damage exists, semi-transparent damage indicates that damage allows some light to pass through, and fully blocked damage indicates that damage does not allow all light to pass through;
[0075] The determination unit 603 is used to obtain the contamination status of each image area in the environment image according to the area ratios corresponding to the multiple contamination types of each image area in the environment image, so as to determine the dirty image area in the environment image.
[0076] Optionally, the acquisition unit 602 is further used to divide the input environment image into multiple image areas; determine the pollution type of each pixel point for each image area, accumulate the number of pixels of each pollution type in the multiple pollution types of each image area, and determine the area ratio corresponding to each pollution type of each image area according to the number of pixels of each pollution type.
[0077] Optionally, the lens damage detection model is trained in the following manner: predicting the area ratio of each damage type in each image area in the training data through an initial model; the training data includes a data set constructed by multiple frames of images and the area ratios of each damage type pre-marked on each image area of the multiple frames of images; comparing the predicted area ratios of each damage type in each image area in the training data with the area ratios of each damage type pre-marked on each image area of the multiple frames of images to obtain a loss function value, and stopping the training until the loss function value meets a convergence condition.
[0078] Optionally, the determination unit 603 is further configured to multiply the area ratio corresponding to each pollution type of each image area in the environment image by the weight corresponding to each pollution type to obtain the pollution rate of each image area in the environment image;
[0079] Determining whether the contamination rate of each image area is greater than a first contamination preset value; if the image area is greater than the first contamination preset value, determining that the image area is dirty;
[0080] Or determine whether the image area is located in the area of interest in the environmental image; if the image area is located in the area of interest in the environmental image, determine whether the contamination rate of the image area is greater than a second contamination preset value corresponding to the area of interest; if the contamination rate of the image area is greater than the second contamination preset value, determine that the image area is dirty.
[0081] Optionally, the determination unit 603 is also used to determine whether the contamination rate of the image area is greater than a third contamination preset value corresponding to the non-interest area if the image area is not located in the area of interest in the environmental image; if the contamination rate of the image area is greater than the third contamination preset value, it is determined that there is dirt in the image area; wherein the second contamination preset value is less than the third contamination preset value.
[0082] Optionally, the above-mentioned device also includes a control unit 604, which is used to determine whether the dirty image area is located in the area of interest of the environmental image; if the dirty image area is located in the area of interest of the environmental image, determine whether the defacement rate of the dirty image area is greater than a fourth defacement preset value; if the defacement rate of the dirty image area is greater than the fourth defacement preset value, control the smart driving function that needs to be applied to the camera to stop starting; if the defacement rate of the dirty image area is less than or equal to the fourth defacement preset value, determine whether the defacement rate of the dirty image area is greater than a fifth defacement preset value; the fifth defacement preset value is less than the fourth defacement preset value; if the defacement rate of the dirty image area is greater than the fifth defacement preset value, control the smart driving function that needs to be applied to the camera to only start some functions; if the defacement rate of the dirty image area is less than or equal to the fifth defacement preset value, call the image restoration algorithm to restore the environmental image.
[0083] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the above-described devices and modules can refer to the corresponding processes in the aforementioned method embodiments, and will not be repeated here.
[0084] In addition, each function in each embodiment of the present application can be integrated into one processing module, or each module can exist physically separately, or two or more modules can be integrated into one module. The above integrated module can be implemented in the form of hardware or in the form of software function module.
[0085] See attached Figure 7 , Figure 7 The structure block diagram of a computer-readable storage medium provided in an embodiment of the present application is shown. The computer-readable storage medium 700 stores program codes, which can be called by a processor to execute the method described in the above method embodiment.
[0086] The computer readable storage medium 700 may be an electronic memory such as a flash memory, an EEPROM (electrically erasable programmable read-only memory), an EPROM, a hard disk, or a ROM. Optionally, the computer readable storage medium 700 includes a non-transitory computer-readable storage medium. The computer readable storage medium 800 has storage space for program code 710 that performs any method step of the above method. These program codes can be read from or written to one or more computer program products. The program code 710 can be compressed, for example, in an appropriate form.
[0087] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit it. 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. However, these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present application.
Claims
1. A lens contamination detection method, It is characterized in that The method comprises: Control the camera installed on the vehicle to collect the environment image outside the vehicle; Input the environment image into a pre-trained lens stain detection model to obtain area ratios corresponding to multiple stain types in each image area of the environment image; wherein the multiple stain types include at least no stain, semi-transparent stain, and fully blocked stain; no stain indicates that no stain exists, semi-transparent stain indicates that stain allows some light to pass through, and fully blocked stain indicates that stain does not allow all light to pass through; According to the area ratios corresponding to the multiple contamination types of each image region in the environment image, the contamination condition of each image region in the environment image is obtained to determine the dirty image region in the environment image.
2. The lens contamination detection method according to claim 1, It is characterized in that The lens contamination detection model includes an image segmentation module, a pixel accumulation module and a ratio determination module. The environment image is input into a pre-trained lens contamination detection model to obtain area ratios corresponding to multiple contamination types in each image area of the environment image, including: The image segmentation module divides the input environment image into multiple image regions; The pixel accumulation module determines the pollution type of each pixel point in each image area, and accumulates the number of pixels of each pollution type in multiple pollution types in each image area. The ratio determination module determines the area ratio corresponding to each pollution type in each image region according to the number of pixels of each pollution type.
3. The lens contamination detection method according to claim 1, It is characterized in that The obtaining the pollution condition of each image area in the environment image according to the area ratios corresponding to the multiple pollution types of each image area in the environment image includes: The area ratio corresponding to each pollution type of each image area in the environment image is multiplied by the weight corresponding to each pollution type to obtain the pollution rate of each image area in the environment image; wherein the weights corresponding to the full occlusion pollution, the semi-transparent pollution and the no pollution decrease in sequence; It is determined whether the contamination rate of each image area is greater than a first contamination preset value; if the contamination rate of the image area is greater than the first contamination preset value, it is determined that the image area is dirty.
4. The lens contamination detection method according to claim 1, It is characterized in that The obtaining the pollution condition of each image area in the environment image according to the area ratios corresponding to the multiple pollution types of each image area in the environment image includes: The area ratio corresponding to each pollution type of each image area in the environment image is multiplied by the weight corresponding to each pollution type to obtain the pollution rate of each image area in the environment image; wherein the weights corresponding to the full occlusion pollution, the semi-transparent pollution and the no pollution decrease in sequence; Determining whether the image area is located in an area of interest in an environment image; If the image area is located in the area of interest in the environment image, determining whether the contamination rate of the image area is greater than a second contamination preset value corresponding to the area of interest; If the contamination rate of the image area is greater than the second contamination preset value, it is determined that the image area is dirty; if the image area is not located in the area of interest in the environment image, it is determined whether the contamination rate of the image area is greater than the third contamination preset value corresponding to the non-interest area; If the contamination rate of the image area is greater than the third contamination preset value, it is determined that there is dirt in the image area; and the second contamination preset value is less than the third contamination preset value.
5. The lens contamination detection method according to any one of claims 1 to 4, It is characterized in that After obtaining the contamination status of each image area in the environment image, the method includes: Determining whether the dirty image area is located in the area of interest of the environment image; If the dirty image region is located in the region of interest of the environment image, determining whether the contamination rate of the dirty image region is greater than a fourth preset contamination value; If the contamination rate of the dirty image area is greater than the fourth preset contamination value, controlling the intelligent driving function that needs to be applied to the camera to stop starting; If the contamination rate of the dirty image area is less than or equal to the fourth preset contamination value, determining whether the contamination rate of the dirty image area is greater than a fifth preset contamination value; the fifth preset contamination value is less than the fourth preset contamination value; If the contamination rate of the dirty image area is greater than the fifth preset contamination value, controlling the intelligent driving function required to be applied to the camera to only partially enable the function; If the contamination rate of the dirty image area is less than or equal to the fifth preset contamination value, an image restoration algorithm is called to restore the environment image.
6. A lens contamination detection device, It is characterized in that The device comprises: A collection unit, used to control a camera installed on the vehicle to collect an environmental image outside the vehicle; an acquisition unit, configured to input the environment image into a pre-trained lens stain detection model, and obtain area ratios corresponding to a plurality of stain types in each image region of the environment image; wherein the plurality of stain types at least include no stain, semi-transparent stain, and fully-occluded stain; no stain indicates that no stain exists, semi-transparent stain indicates that some light is allowed to pass through, and fully-occluded stain indicates that no light is allowed to pass through; The determination unit is used to obtain the contamination status of each image area in the environment image according to the area ratios corresponding to multiple contamination types of each image area in the environment image, so as to determine the dirty image area in the environment image.
7. The lens contamination detection device according to claim 6, It is characterized in that The acquisition unit is also used to divide the environmental image into multiple image areas through a lens damage detection model; determine the damage type of each pixel point in each image area, accumulate the number of pixels of each damage type in the multiple damage types of each image area, and determine the area ratio corresponding to each damage type according to the number of pixels of each damage type.
8. The lens contamination detection device according to claim 6, It is characterized in that The determination unit is also used to divide the input environment image into multiple image areas; determine the pollution type of each pixel point in each image area, accumulate the number of pixels of each pollution type in the multiple pollution types of each image area, and determine the area ratio corresponding to each pollution type of each image area according to the number of pixels of each pollution type.
9. A vehicle, It is characterized in that The vehicle comprises: one or more processors; Memory; One or more application programs, wherein the one or more application programs are stored in the memory and configured to be executed by the one or more processors, and the one or more programs are configured to execute the method according to any one of claims 1-8.
10. A computer-readable storage medium, It is characterized in that The computer-readable storage medium stores a program code executable by a processor, and when the program code is executed by the processor, the processor executes the method according to any one of claims 1 to 8.
Citation Information
Cited By
Automatic driving perception system test method, system, equipment and medium
CN121595170A
