Visibility determination method and device, electronic equipment and storage medium
The dark channel algorithm is used to dehaze the images around the vehicle and establish the relationship between transmittance and depth value, which solves the problem of high cost and large difference in lidar visibility determination, and achieves low-cost, real-time and accurate visibility detection, which is close to Perception of the human eye.
Patent Information
- Application Number
- CN202410429733.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-04-10
- Publication Date
- 2024-09-06
AI Technical Summary
In the existing technology, the method of using lidar to determine visibility is costly and the resulting visibility is significantly different from the visibility determined by the human eye.
The dark channel algorithm is used to dehaze the image around the vehicle, obtain the transmittance and depth data, establish the corresponding relationship between the transmittance and the depth value, and determine the target depth value corresponding to the preset transmittance as the visibility.
Low-cost, real-time and accurate determination of visibility is achieved, and the resulting visibility is closer to the actual visibility seen by the human eye, avoiding the use of high-cost lidar sensors.
Smart Images

Figure CN118608587A
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and in particular to a visibility determination method, device, electronic device and storage medium. Background Art
[0002] As people use cars more and more when traveling, the requirements for vehicle performance and safety are also getting higher and higher. When driving in foggy weather, traffic accidents are very likely to occur due to low visibility, thus affecting driving safety. At present, most people use sensors such as laser radar installed on vehicles to judge visibility, which is costly, and the visibility obtained in this way is based on the inherent characteristics of the equipment, which is somewhat different from the visibility corresponding to the human eye. Summary of the invention
[0003] The embodiments of the present application provide a visibility determination method, device, electronic device and storage medium to solve the problem that the method of using laser radar to determine visibility in the prior art is high in cost and the determined visibility is significantly different from the visibility determined by the human eye.
[0004] In a first aspect, an embodiment of the present application provides a visibility determination method, the method comprising:
[0005] Using a dark channel algorithm to perform defogging on a first image corresponding to the field of view around the vehicle to obtain a second image and transmittance data, wherein the transmittance data includes a transmittance corresponding to each pixel in the first image;
[0006] Acquire first depth data corresponding to the first image and second depth data corresponding to the second image;
[0007] Determine a correspondence between transmittance and depth value according to the first depth data, the second depth data and the transmittance data;
[0008] According to the corresponding relationship between the transmittance and the depth value, a target depth value corresponding to the preset transmittance is determined, and the target depth value is determined as the visibility.
[0009] In a second aspect, an embodiment of the present application further provides a visibility determination device, the device comprising:
[0010] a processing module, configured to perform defogging processing on a first image corresponding to the field of view around the vehicle using a dark channel algorithm to obtain a second image and transmittance data, wherein the transmittance data includes a transmittance corresponding to each pixel in the first image;
[0011] An acquisition module, configured to acquire first depth data corresponding to the first image and second depth data corresponding to the second image;
[0012] A first determining module, configured to determine a corresponding relationship between transmittance and depth value according to the first depth data, the second depth data and the transmittance data;
[0013] The second determination module is used to determine a target depth value corresponding to a preset transmittance according to the corresponding relationship between the transmittance and the depth value, and determine the target depth value as visibility.
[0014] In a third aspect, an embodiment of the present application further provides an electronic device, comprising a processor, a memory, and a computer program stored in the memory and executable on the processor, wherein the computer program implements the above-mentioned visibility determination method when executed by the processor.
[0015] In a fourth aspect, an embodiment of the present application further provides a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, the above-mentioned visibility determination method is implemented.
[0016] The embodiments of the present application include at least the following technical effects:
[0017] The technical solution of the embodiment of the present application obtains a clear second image by performing dehazing processing on the acquired first image, and can filter out some pixels with abnormal depth value estimation based on the first depth data and transmittance data corresponding to the first image and the second depth data corresponding to the second image, so that the correspondence between the obtained transmittance and the depth value is more accurate, and then the target depth value corresponding to the preset transmittance can be determined as the visibility. The present application does not require the aid of expensive sensors such as lidar, and can accurately and real-time determine the current visibility only through image processing, which is low in cost, and the obtained visibility is closer to the actual visibility seen by the human eye. BRIEF DESCRIPTION OF THE DRAWINGS
[0018] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art are briefly introduced below.
[0019] Figure 1 It is one of the flowcharts of the visibility determination method provided in the embodiment of the present application;
[0020] Figure 2 This is the second flow chart of the visibility determination method provided in the embodiment of the present application;
[0021] Figure 3 This is the third flow chart of the visibility determination method provided in the embodiment of the present application;
[0022] Figure 4This is the fourth flowchart of the visibility determination method provided in the embodiment of the present application;
[0023] Figure 5 is a schematic diagram of the structure of a visibility determination device provided in an embodiment of the present application;
[0024] Figure 6 A block diagram of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0025] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0026] It should be understood that the references to "one embodiment" or "an embodiment" throughout the specification mean that the specific features, structures, or characteristics associated with the embodiment are included in at least one embodiment of the present application. Therefore, the references to "in one embodiment" or "in an embodiment" appearing throughout the specification do not necessarily refer to the same embodiment. In addition, these specific features, structures, or characteristics may be combined in any suitable manner in one or more embodiments.
[0027] In the various embodiments of the present application, it should be understood that the size of the serial numbers of the following processes 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.
[0028] At present, when a vehicle is driving, the visibility of the current environment is mostly determined by installing sensors such as lasers and radars on the vehicle. This is costly, and the visibility obtained is based on the inherent characteristics of the equipment, which is somewhat different from the visibility corresponding to the human eye.
[0029] It can be seen that the method of using laser radar to determine visibility in the prior art is costly and has the problem that the determined visibility is significantly different from the visibility determined by the human eye.
[0030] In response to the above problems, an embodiment of the present application provides a visibility determination method that does not require the use of expensive sensors such as lidar. The current visibility can be accurately and real-time determined only through image processing. The cost is low, and the obtained visibility is closer to the actual visibility seen by the human eye.
[0031] The visibility determination method provided in the embodiment of the present application is introduced below. Figure 1 As shown, the method includes:
[0032] Step 101 , using a dark channel algorithm to perform defogging processing on a first image corresponding to the field of view around the vehicle, to obtain a second image and transmittance data, wherein the transmittance data includes the transmittance corresponding to each pixel in the first image.
[0033] Specifically, during the driving process of the vehicle, the first image corresponding to the field of view around the vehicle is obtained in real time through the existing on-board camera or driving recorder on the vehicle, wherein the first image can be a picture or a video frame, wherein when the first image is obtained through the driving recorder, the field of view around the vehicle is the field of view in front of the vehicle, and when the first image is obtained through the on-board camera, if the on-board camera is a front-view camera, the field of view around the vehicle is the field of view in front of the vehicle, and if the on-board camera is a surround-view camera, the field of view around the vehicle is the field of view in front of the vehicle, the field of view on the left, the field of view on the right, and the field of view on the rear. Therefore, the visibility determined by the embodiment of the present application can be the visibility of the field of view in front of the vehicle, or it can be the visibility corresponding to each field of view of the vehicle, depending on the position of the camera installed on the vehicle that can take pictures.
[0034] After acquiring the first image, a dark channel algorithm is used to perform dehazing processing on the first image to obtain a clearer image after dehazing, namely, the second image. When performing the dehazing processing through the dark channel, the transmittance corresponding to each pixel in the first image can also be estimated to obtain transmittance data. The transmittance data here may include the transmittance corresponding to each pixel in the first image.
[0035] The process of using the dark channel algorithm to process the first image to obtain the second image is as follows:
[0036] First, based on the fog generation model
[0037] I(x)=J(x)t(x)+A(1-t(x))
[0038] Where I(x) is the pixel in the first image, J(x) is the pixel in the second image, t(x) is the transmittance of the pixel, and A is the atmospheric light component. J(x)t(x) is the direct attenuation term, which is used to describe the part of the light in the image scene that is attenuated in the medium; A(1-t(x)) is the atmospheric illumination, which is caused by scattering in front of the image acquisition device and will cause the color tone of the scene to shift.
[0039] Since about 75% of the pixel values in the dark channel are zero and 90% of the pixel intensities are less than 25, the average brightness of most dark channels is very low, which means that only a small number of outdoor haze-free images deviate from the dark channel prior theory. First, assuming that the atmospheric light A is given and the local area Ω(x) is constant, the minimum value operation is performed on the three channels of the haze image model. c Represents the dark primary colors of the three color channels in the first image I.
[0040]
[0041] Taking the minimum value operation again for the above formula, we get:
[0042]
[0043] According to the dark channel prior theory, is close to zero, and A c is a positive number, so
[0044] You can get:
[0045]
[0046] Considering that in reality, due to the diffuse reflection of dust and light in the atmosphere, the clarity of distant objects is always a little worse, so it is necessary to retain a little fog and correct the estimated transmittance. According to relevant papers, the defogging coefficient ω is set, and we can get:
[0047]
[0048] The transmittance here will be fitted with the depth value later to obtain the corresponding relationship between the transmittance and the depth value. For A, according to the dark channel defogging algorithm, the first 0.1% of pixels are taken from the dark channel image according to the brightness. Among these positions, the corresponding point with the highest brightness is found in the original foggy image as the A value. When the obtained transmittance t(x) value is very small, the pixel value after defogging will be too large, causing the overall image to transition to the white field or even overexposed. Therefore, a threshold t0 is set for the transmittance to obtain the defogging image J(x).
[0049]
[0050] Step 102: Acquire first depth data corresponding to the first image and second depth data corresponding to the second image.
[0051] After acquiring the first image, depth estimation is performed on the first image to obtain first depth data, wherein the first depth data may include a depth value corresponding to each pixel in the first image. After defogging the first image to obtain a second image, depth estimation is performed on the second image to obtain second depth data, wherein the second depth data may include a depth value corresponding to each pixel in the second image.
[0052] Specifically, different depth value determination algorithms can be used according to different methods of acquiring the first image. For the first image acquired by a monocular camera, a mature neural network algorithm can be selected; for the first image acquired by a binocular camera, epipolar geometry or a network algorithm can be used; for the first image obtained by stitching multiple views, a multi-view geometry or a neural network algorithm in a simultaneous localization and mapping (SLAM) solution can be used.
[0053] Among them, the present application can also determine the depth value range for each column of pixels in the first depth data and the second depth based on the depth value of the reference pixel in the column of pixels. If the depth value of the target pixel after the reference pixel is outside the depth value range and the number of the target pixel is less than the number threshold, the target pixel can be filtered out. Since there is no need to denoise the depth data manually, the efficiency and accuracy of denoising the depth data are improved, the efficiency and accuracy of image processing are improved, and the labor cost is reduced.
[0054] Step 103: Determine a corresponding relationship between transmittance and depth value according to the first depth data, the second depth data and the transmittance data.
[0055] Specifically, by analyzing and processing the first depth data and the second depth data, it is possible to filter the pixels included in the first image, filter out invalid pixels, obtain valid pixels, and then combine the transmittance data to obtain the transmittance corresponding to the valid pixels. Furthermore, based on the transmittance and depth value corresponding to the valid pixels, weighted fitting is performed to determine the correspondence between the transmittance and the depth value.
[0056] Step 104 : Determine a target depth value corresponding to a preset transmittance according to the corresponding relationship between the transmittance and the depth value, and determine the target depth value as visibility.
[0057] After determining the correspondence between the transmittance and the depth value, the target depth value corresponding to the preset transmittance can be obtained based on the correspondence and the preset transmittance, wherein the preset transmittance is a preset transmittance value that can be seen by the human eye. Then the target depth value determined based on the preset transmittance is the visibility of the current field of view.
[0058] In the embodiment of the present application, a clear second image is obtained by performing dehazing processing on the acquired first image, and based on the first depth data and transmittance data corresponding to the first image and the second depth data corresponding to the second image, some pixels with abnormal depth value estimation can be filtered out, so that the correspondence between the obtained transmittance and the depth value is more accurate, and then the target depth value corresponding to the preset transmittance can be determined as the visibility. The present application does not require the aid of expensive sensors such as lidar, and the current visibility can be accurately and real-time determined only through image processing, which is low in cost, and the obtained visibility is closer to the actual visibility seen by the human eye.
[0059] In addition, most vehicles are currently equipped with forward-looking cameras for driving records. This solution uses the camera that the vehicle is already equipped with to obtain external environmental images. There is no change in hardware facilities and circuit structure. Visibility can be determined only by performing image processing on the environmental images collected by the camera that the vehicle is already equipped with. Multiple uses of a camera device can be achieved. Only software costs need to be increased, and no additional hardware costs are required. There is no need to add additional laser, radar and other sensors. The method of determining visibility in the embodiment of the present application is more cost-effective.
[0060] Among them, for mid-to-high-end vehicles, they are generally equipped with visual solutions to estimate the point clouds of three-dimensional entities such as surrounding vehicles, pedestrians, obstacles, etc. Therefore, this solution can reuse the results of these algorithms for the estimation of depth values, so there is no need for a special network or algorithm, and it has strong adaptability; at the same time, there are relatively mature algorithms for the existing general atmospheric diffusion estimation, and the trade-off between accuracy and speed can be achieved based on hardware performance. It is generally much faster than the previous driving algorithm, and the two can basically be run in parallel. Under the premise that the depth algorithm can be real-time, the later estimation of this solution consumes almost no time, and real-time processing and feedback can be given.
[0061] In an optional embodiment of the present application, if Figure 2 As shown, step 103 determines the corresponding relationship between transmittance and depth value according to the first depth data, the second depth data and the transmittance data, including:
[0062] Step 201: determining a target pixel point set and a weight value corresponding to each target pixel point in the target pixel point set according to the first depth data, the second depth data and the transmittance data;
[0063] Step 202: According to the transmittance and weight value corresponding to each target pixel in the target pixel set and the corresponding depth value in the second depth data, obtain the corresponding relationship between the transmittance and the depth value through weighted fitting.
[0064] Specifically, in the process of determining the correspondence between the transmittance and the depth value, in order to improve the accuracy of the correspondence between the transmittance and the depth value finally obtained, the pixels in the first image can be screened based on the depth value, and the invalid pixels can be filtered out to obtain a target pixel point set composed of the remaining valid pixels, and the weight value corresponding to each pixel in the target pixel point set is calculated. The weight value is positively correlated with the effectiveness. The higher the effectiveness, the higher the weight value.
[0065] After determining the weight value corresponding to each target pixel in the target pixel set, a cubic polynomial weighted fitting method can be used according to the corresponding transmittance and weight value of each target pixel in the target pixel set and the corresponding depth value in the second depth data to obtain the corresponding relationship between the transmittance and the depth value, wherein the fitting function is first expressed in the form of a cubic polynomial, and the transmittance and depth value of the target pixel constitute a data point. A weighting coefficient can be assigned to each data point according to the importance or reliability of the data point, and the weighting coefficient corresponding to the data point is the weight value corresponding to the target pixel. The coefficients of the polynomial are calculated according to the data points and the weighting coefficients by the least squares method. After obtaining the fitting function, the accuracy of the fitting can be further evaluated by comparing the differences between the data points in the fitting function and the actual data points.
[0066] In the embodiment of the present application, complex data patterns can be captured through data fitting, and the introduction of weighting coefficients makes some important data points have a greater influence in the fitting, thereby improving the accuracy of the corresponding relationship between the transmittance and depth value obtained by fitting.
[0067] In an optional embodiment of the present application, if Figure 3 As shown, in step 201, determining a target pixel point set according to the first depth data, the second depth data and the transmittance data includes:
[0068] Step 301: Sort the pixel points in the first depth data from small to large according to their depth values to obtain a first sorting order corresponding to each pixel point;
[0069] Step 302: Sort the pixel points in the second depth data from small to large according to their depth values to obtain a second sorting order corresponding to each pixel point;
[0070] Step 303: Calculate a first difference corresponding to each pixel, wherein the first difference is an absolute value of a difference between a first sorting order corresponding to the pixel and a second sorting order corresponding to the pixel;
[0071] Step 304: Determine the pixel points whose first difference value is less than or equal to the first preset threshold as the primary screening pixel points;
[0072] Step 305: sorting the pre-screened pixel points in the second depth data from small to large according to their depth values, to obtain a third sorting order corresponding to each pre-screened pixel point;
[0073] Step 306, sorting the transmittance of the primary screening pixel points in the transmittance data from large to small to obtain a fourth sorting order corresponding to each primary screening pixel point;
[0074] Step 307, calculating a second difference value of each preliminary screening pixel point, where the second difference value is an absolute value of a difference value between the third sorting order corresponding to the preliminary screening pixel point and the fourth sorting order corresponding to the preliminary screening pixel point;
[0075] Step 308: Determine the pixel point whose second difference value is less than or equal to the second preset threshold as the target pixel point;
[0076] Step 309: determine a set including all the target pixel points as the target pixel point set.
[0077] Specifically, when determining the target pixel set, the depth values in the first depth data are sorted from small to large to obtain the first sorting order corresponding to each pixel, and the depth values in the second depth data are sorted from small to large to obtain the second sorting order corresponding to each pixel; for each pixel, the absolute value of the difference between the first sorting order and the second sorting order is calculated to obtain the first difference. Ideally, for different objects on the same image, the estimated distance trend in the images before and after defogging should be the same, so the order of pixels in the first depth data and the order of pixels in the second depth data should be the same, so the pixels whose first difference is greater than the first preset threshold can be filtered out, and the pixels whose first difference is less than or equal to the first preset threshold are determined as preliminary screening pixels. The preliminary screening pixels obtained here are pixels whose depth values are estimated more accurately in the first image and the second image.
[0078] After obtaining multiple preliminary screening pixel points, the depth values corresponding to the preliminary screening pixel points in the second depth data are sorted from small to large to obtain the third sorting order corresponding to each preliminary screening pixel point; the transmittance of the preliminary screening pixel points in the transmittance data is sorted from large to small to obtain the fourth sorting order corresponding to each preliminary screening pixel point.
[0079] For each pre-screened pixel point, the absolute value of the difference between the third sorting order corresponding to the pre-screened pixel point and the fourth sorting order corresponding to the pre-screened pixel point is calculated to obtain the second difference. Ideally, in a foggy environment, the farther away the object is, the worse the clarity and the lower the transmittance. Therefore, the transmittance is negatively correlated with the distance, that is, the third sorting order of the pixel point in the second depth data and the fourth sorting order in the transmittance data should be the same. Therefore, the pixel points whose second difference is greater than the second preset threshold can be filtered out, and the pixel points whose second difference is less than or equal to the second preset threshold can be determined as the target pixel points. After determining whether each pre-screened pixel point is a target pixel point, a target pixel point set composed of target pixels can be obtained. The pixels in the target pixel point set obtained here are pixels obtained after two screenings, and the points with inaccurate depth value estimation and mismatched relationship between depth value and transmittance can be filtered out.
[0080] In the above implementation scheme of the present application, a target pixel point set can be obtained by filtering the pixel points twice, so as to facilitate the subsequent acquisition of a more accurate correspondence between the transmittance and the depth value based on the target pixel point set.
[0081] In an optional embodiment of the present application, if Figure 4 As shown, in step 201, the weight value corresponding to each pixel in the target pixel set is determined according to the first depth data, the second depth data and the transmittance data, including:
[0082] Step 401: for each target pixel, calculate a third difference value corresponding to each target pixel, where the third difference value is the sum of a first difference value corresponding to the target pixel and a second difference value corresponding to the target pixel;
[0083] Step 402: Determine a weight value corresponding to each target pixel in the target pixel set according to the third difference value corresponding to each target pixel.
[0084] Specifically, when determining the weight value of the target pixel point, for each target pixel point, the sum of the first difference and the second difference corresponding to the target pixel point is calculated to obtain the third difference. Since the first difference and the second difference are the parameters used when filtering the pixel points, the third difference can characterize the effectiveness of the target pixel point. The larger the third difference, the higher the effectiveness. Therefore, the weight value corresponding to each target pixel point in the target pixel point set can be determined based on the third difference corresponding to each pixel point in the target pixel point set, so that the correspondence between the transmittance and the depth value can be obtained through weighted fitting according to the transmittance and weight value corresponding to each target pixel point in the target pixel point set and the corresponding depth value in the second depth data.
[0085] In an optional embodiment of the present application, after the first image corresponding to the front field of view of the vehicle is defogged by using a dark channel algorithm to obtain a second image, the method further includes:
[0086] The second image is displayed on a display screen corresponding to the vehicle-mounted terminal.
[0087] After obtaining the defogging second image, the second image can be displayed on a corresponding screen of the vehicle-mounted terminal to provide visual feedback to the driver, thereby assisting the driver in driving when visibility is low and improving driving safety.
[0088] In an optional embodiment of the present application, after determining the target depth value as visibility, the method further includes:
[0089] Determining a target safe vehicle speed corresponding to the visibility according to a correspondence between visibility and safe vehicle speed that is preset or required by traffic regulations;
[0090] Determine a target following vehicle corresponding to the visibility according to a correspondence between the visibility and the following distance that is preset or required by traffic regulations;
[0091] When the current speed of the vehicle is greater than or equal to the target safe speed, outputting speeding reminder information;
[0092] When the distance between the vehicle and the preceding vehicle in the same lane is less than or equal to the target following distance, outputting a warning message indicating that the following distance is too close.
[0093] Specifically, after determining the visibility, the target safe speed and target following distance corresponding to the current visibility can be determined based on the corresponding relationship between the preset or traffic regulations required visibility and the safe speed, and the corresponding relationship between the preset or traffic regulations required visibility and the following distance. Then the current speed and the current following distance are monitored. When the current speed is greater than the target safe speed, an overspeed reminder message is output through the in-vehicle voice. When the current following distance is less than the target following distance, a following distance too close reminder message is output through the in-vehicle voice. This can avoid traffic accidents caused by excessive speed or too close following distance when visibility is low, thereby improving driving safety.
[0094] The above introduces the visibility determination method provided in the embodiment of the present application. The following will introduce the visibility determination device provided in the embodiment of the present application in conjunction with the accompanying drawings.
[0095] like Figure 5 As shown, an embodiment of the present invention further provides a visibility determination device, the device comprising:
[0096] A processing module 501 is used to perform defogging on a first image corresponding to the field of view around the vehicle using a dark channel algorithm to obtain a second image and transmittance data, wherein the transmittance data includes a transmittance corresponding to each pixel in the first image;
[0097] An acquisition module 502 is used to acquire first depth data corresponding to the first image and second depth data corresponding to the second image;
[0098] A first determining module 503, configured to determine a correspondence between transmittance and depth value according to the first depth data, the second depth data and the transmittance data;
[0099] The second determining module 504 is configured to determine a target depth value corresponding to a preset transmittance according to the corresponding relationship between the transmittance and the depth value, and determine the target depth value as visibility.
[0100] Optionally, the first determining module includes:
[0101] A first determination submodule, configured to determine a target pixel point set and a weight value corresponding to each target pixel point in the target pixel point set according to the first depth data, the second depth data, and the transmittance data;
[0102] The second determination submodule is used to obtain the corresponding relationship between the transmittance and the depth value through weighted fitting according to the transmittance and weight value corresponding to each target pixel in the target pixel set and the corresponding depth value in the second depth data.
[0103] Optionally, the first determining submodule includes:
[0104] A first sorting unit, configured to sort the pixel points in the first depth data in ascending order according to their depth values, to obtain a first sorting order corresponding to each pixel point;
[0105] A second sorting unit, configured to sort the pixel points in the second depth data in ascending order according to their depth values, to obtain a second sorting order corresponding to each pixel point;
[0106] A first calculation unit, configured to calculate a first difference corresponding to each pixel point, wherein the first difference value is an absolute value of a difference between a first sorting order corresponding to the pixel point and a second sorting order corresponding to the pixel point;
[0107] A first determining unit, configured to determine a pixel point whose first difference is less than or equal to a first preset threshold as a primary screening pixel point;
[0108] A third sorting unit, used to sort the pre-screened pixel points in the second depth data according to their depth values from small to large, to obtain a third sorting order corresponding to each pre-screened pixel point;
[0109] A fourth sorting unit, used to sort the primary screening pixel points in the transmittance data from large to small according to the transmittance of the primary screening pixel points, to obtain a fourth sorting order corresponding to each primary screening pixel point;
[0110] A second calculation unit is used to calculate a second difference value of each preliminary screening pixel point, where the second difference value is an absolute value of a difference value between a third sorting order corresponding to the preliminary screening pixel point and a fourth sorting order corresponding to the preliminary screening pixel point;
[0111] A second determining unit, configured to determine a pixel point whose second difference is less than or equal to a second preset threshold as a target pixel point;
[0112] The third determining unit is used to determine a set including all the target pixel points as the target pixel point set.
[0113] Optionally, the first determining submodule further includes:
[0114] A third calculation unit is used to calculate, for each target pixel, a third difference corresponding to each target pixel, where the third difference is the sum of the first difference corresponding to the target pixel and the second difference corresponding to the target pixel;
[0115] The fourth determining unit is used to determine the weight value corresponding to each target pixel point in the target pixel point set according to the third difference value corresponding to each target pixel point in the target pixel point set.
[0116] Optionally, the device further comprises:
[0117] The display module is used to display the second image on a display screen corresponding to the vehicle-mounted terminal.
[0118] Optionally, the device further comprises:
[0119] A third determination module is used to determine a target safe vehicle speed corresponding to the visibility according to a correspondence between visibility and safe vehicle speed that is preset or required by traffic regulations;
[0120] A fourth determination module, configured to determine a target following distance corresponding to the visibility according to a correspondence between visibility and following distance that is preset or required by traffic regulations;
[0121] A first output module, configured to output speeding reminder information when the current speed of the vehicle is greater than or equal to the target safe speed;
[0122] The second output module is used to output a reminder message of a vehicle following too close when the distance between the vehicle and the preceding vehicle in the same lane is less than or equal to the target vehicle following distance.
[0123] The visibility determination device provided in the present application obtains a clear second image by performing dehazing processing on the acquired first image, and can filter out some pixels with abnormal depth value estimation based on the first depth data and transmittance data corresponding to the first image and the second depth data corresponding to the second image, so that the correspondence between the obtained transmittance and the depth value is more accurate, and then the target depth value corresponding to the preset transmittance can be determined as the visibility. The present application does not require the aid of expensive sensors such as lidar, and can accurately and real-time determine the current visibility only through image processing, which is low in cost, and the obtained visibility is closer to the actual visibility seen by the human eye.
[0124] An embodiment of the present application also provides an electronic device, including: a processor, a memory, and a computer program stored in the memory and executable on the processor. When the computer program is executed by the processor, the various processes of the above-mentioned visibility determination method embodiment are implemented, and the same technical effect can be achieved. To avoid repetition, it will not be described here.
[0125] For example, Figure 6 A schematic diagram of the physical structure of an electronic device is shown.
[0126] like Figure 6 As shown, the electronic device may include: a processor 610, a communication interface 620, a memory 630 and a communication bus 640, wherein the processor 610, the communication interface 620 and the memory 630 communicate with each other through the communication bus 640. The processor 610 may call the logic instructions in the memory 630, and the processor 610 is used to perform the following steps: using a dark channel algorithm to perform defogging on a first image corresponding to the field of view around the vehicle to obtain a second image and transmittance data, wherein the transmittance data includes the transmittance corresponding to each pixel in the first image; obtaining first depth data corresponding to the first image and second depth data corresponding to the second image; determining the corresponding relationship between the transmittance and the depth value according to the first depth data, the second depth data and the transmittance data; determining a target depth value corresponding to a preset transmittance according to the corresponding relationship between the transmittance and the depth value, and determining the target depth value as visibility.
[0127] In addition, the logic instructions in the above-mentioned memory 630 can be implemented in the form of a software functional unit and can be stored in a computer-readable storage medium when it is sold or used as an independent product. Based on this understanding, the technical solution of the present application can be essentially or partly embodied in the form of a software product that contributes to the prior art, and the computer software product is stored in a storage medium, including several instructions to enable a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a disk or an optical disk.
[0128] An embodiment of the present application also provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the various processes of the above-mentioned visibility determination method embodiment are implemented and the same technical effect can be achieved. To avoid repetition, it will not be repeated here.
[0129] It should be noted that, in this article, 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, an element defined by the sentence "comprises a ..." does not exclude the existence of other identical elements in the process, method, article or device including the element.
[0130] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present invention, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, a magnetic disk, or an optical disk), and includes a number of instructions for enabling a terminal (which can be a mobile phone, a computer, a server, an air conditioner, or a network device, etc.) to execute the methods described in each embodiment of the present invention.
[0131] The embodiments of the present invention are described above in conjunction with the accompanying drawings, but the present invention is not limited to the above-mentioned specific implementation modes, which are merely illustrative rather than restrictive. Under the guidance of the present invention, ordinary technicians in this field can also make many forms without departing from the scope of protection of the present invention and the claims, all of which are within the protection of the present invention.
[0132] Those of ordinary skill in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed in the embodiments of the present invention can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the present invention.
[0133] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.
[0134] In the embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
[0135] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0136] In addition, each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.
[0137] If the functions are implemented in the form of software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art, or the part of the technical solution, can be embodied in the form of a software product. The computer software product is stored in a storage medium, including several instructions for a computer device (which can be a personal computer, server, or network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: various media that can store program codes, such as USB flash drives, mobile hard disks, ROM, RAM, magnetic disks, or optical disks.
[0138] The above is only a specific embodiment of the present invention, but the protection scope of the present invention is not limited thereto. Any person skilled in the art can easily think of changes or substitutions within the technical scope disclosed by the present invention, which should be included in the protection scope of the present invention. Therefore, the protection scope of the present invention should be based on the protection scope of the claims.
Claims
1. A visibility determination method, It is characterized in that include: Using a dark channel algorithm to perform defogging on a first image corresponding to the field of view around the vehicle to obtain a second image and transmittance data, wherein the transmittance data includes a transmittance corresponding to each pixel in the first image; Acquire first depth data corresponding to the first image and second depth data corresponding to the second image; Determine a correspondence between transmittance and depth value according to the first depth data, the second depth data and the transmittance data; According to the corresponding relationship between the transmittance and the depth value, a target depth value corresponding to the preset transmittance is determined, and the target depth value is determined as the visibility.
2. The visibility determination method according to claim 1, It is characterized in that Determining a correspondence between transmittance and depth value according to the first depth data, the second depth data, and the transmittance data includes: Determine a target pixel point set and a weight value corresponding to each target pixel point in the target pixel point set according to the first depth data, the second depth data, and the transmittance data; According to the transmittance and weight value corresponding to each target pixel in the target pixel set and the corresponding depth value in the second depth data, a corresponding relationship between the transmittance and the depth value is obtained through weighted fitting.
3. The visibility determination method according to claim 2, It is characterized in that The determining a target pixel point set according to the first depth data, the second depth data, and the transmittance data includes: Sort the pixel points in the first depth data in ascending order according to their depth values to obtain a first sorting order corresponding to each pixel point; Sort the pixel points in the second depth data in ascending order according to their depth values to obtain a second sorting order corresponding to each pixel point; Calculate a first difference corresponding to each pixel, wherein the first difference is an absolute value of a difference between a first sorting order corresponding to the pixel and a second sorting order corresponding to the pixel; Determine the pixel points whose first difference value is less than or equal to the first preset threshold as the primary screening pixel points; Sort the pre-screened pixel points in the second depth data according to their depth values from small to large to obtain a third sorting order corresponding to each pre-screened pixel point; Sorting the primary screening pixel points in the transmittance data from large to small according to the transmittance of the primary screening pixel points, to obtain a fourth sorting order corresponding to each primary screening pixel point; Calculating a second difference value of each preliminary screening pixel point, where the second difference value is an absolute value of a difference value between a third sorting order corresponding to the preliminary screening pixel point and a fourth sorting order corresponding to the preliminary screening pixel point; Determine a pixel point whose second difference is less than or equal to a second preset threshold as a target pixel point; A set including all the target pixel points is determined as the target pixel point set.
4. The visibility determination method according to claim 3, It is characterized in that Determining a weight value corresponding to each pixel in the target pixel set according to the first depth data, the second depth data, and the transmittance data, includes: For each target pixel, calculate a third difference value corresponding to each target pixel, where the third difference value is the sum of the first difference value corresponding to the target pixel and the second difference value corresponding to the target pixel; The weight value corresponding to each target pixel in the target pixel set is determined according to the third difference value corresponding to each target pixel.
5. The visibility determination method according to claim 1, It is characterized in that After the first image corresponding to the front field of view of the vehicle is defogged by using a dark channel algorithm to obtain a second image, the method further includes: The second image is displayed on a display screen corresponding to the vehicle-mounted terminal.
6. The visibility determination method according to claim 1, It is characterized in that After determining the target depth value as visibility, the method further includes: Determining a target safe vehicle speed corresponding to the visibility according to a correspondence between visibility and safe vehicle speed that is preset or required by traffic regulations; Determining a target following distance corresponding to the visibility according to a correspondence between the visibility and the following distance that is preset or required by traffic regulations; When the current speed of the vehicle is greater than or equal to the target safe speed, outputting speeding reminder information; When the distance between the vehicle and the preceding vehicle in the same lane is less than or equal to the target following distance, outputting a warning message indicating that the following distance is too close.
7. A visibility determination device, It is characterized in that include: a processing module, configured to perform defogging processing on a first image corresponding to the field of view around the vehicle using a dark channel algorithm to obtain a second image and transmittance data, wherein the transmittance data includes a transmittance corresponding to each pixel in the first image; An acquisition module, configured to acquire first depth data corresponding to the first image and second depth data corresponding to the second image; A first determining module, configured to determine a corresponding relationship between transmittance and depth value according to the first depth data, the second depth data and the transmittance data; The second determination module is used to determine a target depth value corresponding to a preset transmittance according to the corresponding relationship between the transmittance and the depth value, and determine the target depth value as visibility.
8. The visibility determination device according to claim 7, It is characterized in that The first determining module includes: The first determination submodule is used to determine the corresponding relationship between the transmittance and the depth value according to the first depth data, the second depth data and the transmittance data, including: A second determination submodule, configured to determine a target pixel point set and a weight value corresponding to each target pixel point in the target pixel point set according to the first depth data, the second depth data and the transmittance data; The third determination submodule is used to obtain the corresponding relationship between the transmittance and the depth value through weighted fitting according to the transmittance and weight value corresponding to each target pixel point in the target pixel point set and the corresponding depth value in the second depth data.
9. An electronic device, It is characterized in that The invention comprises a processor, a memory and a computer program stored in the memory and executable on the processor, wherein when the computer program is executed by the processor, the visibility determination method according to any one of claims 1 to 6 is implemented.
10. A computer-readable storage medium, It is characterized in that The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the visibility determination method according to any one of claims 1 to 6 are implemented.
