Road Visibility Detection Method, Device, Equipment and Storage Medium
By obtaining road images and determining the invisible sections in road visibility detection, and calculating the visibility distance value based on actual length and position, the problems of high detection complexity and low accuracy in the prior art are solved, and higher detection accuracy and traffic safety are achieved.
Patent Information
- Application Number
- CN202111081343.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-09-15
- Publication Date
- 2025-06-17
- Estimated Expiration
- 2041-09-15
AI Technical Summary
The prior art has problems with high implementation complexity and low detection accuracy in road visibility detection, especially in foggy days, which are prone to traffic safety accidents.
By acquiring the road image collected by the camera, acquiring the image mask corresponding to the road area, and traversing the pixel points of the road area in the image mask in units of pixels to determine the invisible segment. Based on the actual length of the invisible segment, determine the target invisible segment, and determine the visible boundary point based on its position. Use the actual coordinates of the visual boundary point and the actual coordinates of the camera to calculate the road visibility distance value.
It reduces the implementation complexity, improves the accuracy of road visibility distance detection, reduces errors due to noise interference between headlights and body, and improves traffic safety.
Smart Images

Figure CN113888479B_ABST
Abstract
Description
Technical Field
[0001] This application belongs to the field of intelligent transportation technology, and particularly relates to a method, device, equipment and storage medium for detecting road visibility. Background Art
[0002] In the highway scenario, visibility is one of the most important objective environmental factors affecting driving safety. The low visibility caused by foggy days can lead to serious traffic safety accidents. Therefore, how to improve the accuracy of road visibility detection is an urgent problem to be solved.
[0003] Generally, special visibility measuring instruments can be used to obtain accurate visibility distances. However, this solution not only has a high budget cost but also a high implementation cost. In order to reduce costs, currently, the visibility distance is mainly obtained from road monitoring images through a preset algorithm. Among them, the preset algorithm can be, for example, a method of calculating the transmittance based on the dark channel to convert the visibility distance. Some of these algorithms have a high implementation complexity, while some are easily affected by the noise of vehicle lights and vehicle bodies, resulting in a large error between the calculated visibility distance and the actual situation, thus making the visibility detection result inaccurate. Summary of the Invention
[0004] The embodiments of this application provide a method, device, equipment and storage medium for detecting road visibility, which can improve the accuracy of road visibility distance detection while reducing the implementation complexity.
[0005] In a first aspect, the embodiments of this application provide a method for detecting road visibility. The method includes:
[0006] Obtain a road image collected by a camera;
[0007] Obtain an image mask corresponding to the road area in the road image;
[0008] Traverse each pixel point in the range corresponding to the road area in the image mask from bottom to top in units of pixel rows, and determine the invisible segments in the range corresponding to the road area; where the invisible segments include at least one invisible row;
[0009] Determine a target invisible segment according to the actual length corresponding to the invisible segment; where the target invisible segment is an invisible segment determined when the actual cumulative length of the determined invisible segments is greater than a first preset length, or the first invisible segment with an actual length greater than a second preset length among the determined invisible segments;
[0010] Determine the visible boundary points in the image mask according to the position of the target invisible segment in the image mask;
[0011] Determine the actual coordinates corresponding to the visible boundary points according to the image coordinates corresponding to the visible boundary points;
[0012] Determine the road visibility distance value according to the actual coordinates corresponding to the visual boundary points and the actual coordinates corresponding to the camera.
[0013] In an alternative implementation, determining the road visibility distance value according to the actual coordinates corresponding to the visual boundary points and the actual coordinates corresponding to the camera includes:
[0014] Calculate an initial road visibility distance value according to the actual coordinates corresponding to the visual boundary points and the actual coordinates corresponding to the camera;
[0015] Input the initial road visibility distance value into a preset filter, and use the preset filter to perform data smoothing processing on the initial road visibility distance value, and output the road visibility distance value.
[0016] In an alternative implementation, the preset filter is a g-h filter; wherein, when the initial road visibility distance value is greater than the filter prediction value, the parameter value of the confidence parameter g corresponding to the g-h filter is a first value, and when the initial road visibility distance value is not greater than the filter prediction value, the parameter value of the confidence parameter g corresponding to the g-h filter is set to a second value, and the first value is less than the second value.
[0017] In an alternative implementation, the image coordinates include an abscissa and an ordinate;
[0018] Obtain an image mask corresponding to the road area in the road image, including:
[0019] Determine a set of left lane line boundary points and a set of right lane line boundary points corresponding to the road area in the road image;
[0020] Traverse each pixel point in the road image in sequence, and determine a first upper boundary point and a first lower boundary point corresponding to the target ordinate from the set of left lane line boundary points, and a second upper boundary point and a second lower boundary point corresponding to the target ordinate from the set of right lane line boundary points according to the target ordinate corresponding to the currently traversed pixel point;
[0021] Determine whether the currently traversed pixel point is a pixel point within the road area according to the image coordinates corresponding to the first upper boundary point, the first lower boundary point, the second upper boundary point, and the second lower boundary point, until each pixel point in the road image is traversed, and determine the image mask corresponding to the road area in the road image.
[0022] In an alternative implementation, determining the visual boundary points in the image mask according to the position of the target invisible segment in the image mask includes:
[0023] Determine the previous visible segment adjacent to the target invisible segment according to the position of the target invisible segment in the image mask;
[0024] Determine the upper boundary of the visible segment as the visible boundary;
[0025] Determine the first visible point from the left in the pixel row corresponding to the visible boundary as the visible boundary point.
[0026] In an alternative embodiment, determining the invisible segments within the range corresponding to the road area includes:
[0027] Determine whether there is a visible point in the target pixel row being traversed currently;
[0028] In the case where there is no visible point, determine the target pixel row as an invisible row;
[0029] Divide multiple consecutive invisible rows into one invisible segment to obtain the invisible segments within the range corresponding to the road area.
[0030] In an alternative embodiment, determining whether there is a visible point in the target pixel row being traversed currently includes:
[0031] Obtain the contrast value corresponding to the pixel points in the target pixel row being traversed currently;
[0032] Determine whether there is a target pixel point in the target pixel row whose contrast value is greater than a preset threshold;
[0033] In the case where there is a target pixel point, determine that there is a visible point in the target pixel row; otherwise, determine that there is no visible point in the target pixel row.
[0034] In an alternative embodiment, the actual coordinates are longitude and latitude coordinates;
[0035] Before determining the target invisible segment according to the actual length corresponding to the invisible segment, the method further includes:
[0036] Determine the mapping relationship between the image coordinates and the longitude and latitude coordinates;
[0037] According to the mapping relationship and the image length of the invisible segment in the image mask, determine the actual length corresponding to the invisible segment;
[0038] According to the image coordinates corresponding to the visible boundary point, determining the actual coordinates corresponding to the visible boundary point includes:
[0039] Based on the mapping relationship, according to the image coordinates corresponding to the visible boundary point, determine the longitude and latitude coordinates corresponding to the visible boundary point.
[0040] In a second aspect, an embodiment of the present application provides a road visibility detection device, and the road visibility detection device includes:
[0041] An image acquisition module, configured to acquire a road image collected by a camera;
[0042] A mask acquisition module, configured to acquire an image mask corresponding to a road area in the road image;
[0043] A first determination module, configured to traverse each pixel point within the range corresponding to the road area in the image mask from bottom to top in units of pixel rows, and determine an invisible segment within the range corresponding to the road area; wherein, the invisible segment includes at least one invisible row;
[0044] A second determination module, configured to determine a target invisible segment according to the actual length corresponding to the invisible segment; wherein, the target invisible segment is an invisible segment determined when the actual cumulative length of the determined invisible segments is greater than a first preset length, or the first invisible segment among the determined invisible segments whose actual length is greater than a second preset length;
[0045] A boundary point determination module, configured to determine visible boundary points in the image mask according to the position of the target invisible segment in the image mask;
[0046] A coordinate determination module, configured to determine the actual coordinates corresponding to the visible boundary points according to the image coordinates corresponding to the visible boundary points;
[0047] A distance determination module, configured to determine a road visibility distance value according to the actual coordinates corresponding to the visible boundary points and the actual coordinates corresponding to the camera.
[0048] In an optional implementation manner, the distance determination module includes:
[0049] A calculation sub-module, configured to calculate an initial road visibility distance value according to the actual coordinates corresponding to the visible boundary points and the actual coordinates corresponding to the camera;
[0050] A data processing sub-module, configured to input the initial road visibility distance value into a preset filter, perform data smoothing processing on the initial road visibility distance value by using the preset filter, and output a road visibility distance value.
[0051] In an optional implementation manner, the preset filter is a g-h filter; wherein, when the initial road visibility distance value is greater than the filter prediction value, the parameter value of the confidence parameter g corresponding to the g-h filter is a first value, and when the initial road visibility distance value is not greater than the filter prediction value, the parameter value of the confidence parameter g corresponding to the g-h filter is set to a second value, and the first value is less than the second value.
[0052] In an optional implementation manner, the image coordinates include an abscissa and an ordinate;
[0053] The mask acquisition module includes:
[0054] A first determination sub-module, configured to determine a set of left lane boundary points and a set of right lane boundary points corresponding to a road area in a road image;
[0055] A second determination sub-module, configured to sequentially traverse each pixel point in the road image, and determine, according to a target ordinate corresponding to the currently traversed pixel point, a first upper boundary point and a first lower boundary point corresponding to the target ordinate from the set of left lane boundary points, and a second upper boundary point and a second lower boundary point corresponding to the target ordinate from the set of right lane boundary points;
[0056] A third determination sub-module, configured to determine whether the currently traversed pixel point is a pixel point within the road area according to the image coordinates corresponding to the first upper boundary point, the first lower boundary point, the second upper boundary point, and the second lower boundary point, until each pixel point in the road image is traversed, and determine an image mask corresponding to the road area in the road image.
[0057] In an optional implementation manner, the boundary point determination module includes:
[0058] A visible segment determination sub-module, configured to determine a previous visible segment adjacent to a target invisible segment according to the position of the target invisible segment in the image mask;
[0059] A visible boundary determination sub-module, configured to determine the upper boundary of the visible segment as the visible boundary;
[0060] A visible boundary point determination sub-module, configured to determine the first visible point from the left in the pixel row corresponding to the visible boundary as the visible boundary point.
[0061] In an optional implementation manner, the first determination module includes:
[0062] A visible point determination sub-module, configured to determine whether there is a visible point in the currently traversed target pixel row;
[0063] An invisible row determination sub-module, configured to determine the target pixel row as an invisible row when there is no visible point;
[0064] An invisible segment determination sub-module, configured to divide a continuous plurality of invisible rows into an invisible segment to obtain an invisible segment within the corresponding range of the road area.
[0065] In an optional implementation manner, the visible point determination sub-module includes:
[0066] An acquisition unit, configured to acquire a contrast value corresponding to a pixel point in the currently traversed target pixel row;
[0067] A first determination unit, configured to determine whether there are target pixel points in a target pixel row whose contrast value is greater than a preset threshold;
[0068] A second determination unit, configured to determine that there are visible points in the target pixel row if there are target pixel points; otherwise, determine that there are no visible points in the target pixel row.
[0069] In an optional implementation manner, the actual coordinates are longitude and latitude coordinates; the apparatus further includes:
[0070] A mapping relationship determination module, configured to determine the mapping relationship between the image coordinates and the longitude and latitude coordinates before determining the target invisible segment according to the actual length corresponding to the invisible segment;
[0071] A third determination module, configured to determine the actual length corresponding to the invisible segment according to the mapping relationship and the image length of the invisible segment in the image mask;
[0072] The third determination module includes:
[0073] A coordinate determination sub-module, configured to determine the longitude and latitude coordinates corresponding to the visible boundary points based on the mapping relationship according to the image coordinates corresponding to the visible boundary points.
[0074] In a third aspect, an embodiment of the present application provides an electronic device, which includes: a processor and a memory storing computer program instructions;
[0075] When the processor executes the computer program instructions, the road visibility detection method described in any embodiment of the first aspect is implemented.
[0076] In a fourth aspect, an embodiment of the present application provides a computer storage medium, on which computer program instructions are stored, and when the computer program instructions are executed by a processor, the road visibility detection method described in any embodiment of the first aspect is implemented.
[0077] The method, device, equipment and storage medium for detecting road visibility according to the embodiments of the present application obtain an image mask corresponding to a road area in a road image, then determine invisible segments within the range corresponding to the road area, determine a target invisible segment in combination with the actual length corresponding to the determined invisible segments, and then determine visible boundary points according to the positions of the target invisible segments. By using the actual coordinates corresponding to the visible boundary points and the actual coordinates of the camera, a road visibility distance value is calculated. In this way, on the one hand, since the embodiments of the present application perform calculation processing based on the image mask corresponding to the road area in the road image, the implementation complexity can be reduced; on the other hand, since the target invisible segment is an invisible segment determined when the actual cumulative length of the determined invisible segments is greater than a first preset length, or the first invisible segment among the determined invisible segments with an actual length greater than a second preset length, when the actual length or actual cumulative length of the invisible segment exceeds the preset length, it can be determined that the visible boundary has been reached, and thus the influence of vehicle lights and vehicle bodies in the distance on the visibility distance value can be excluded, achieving the effect of improving the accuracy of road visibility distance detection. BRIEF DESCRIPTION OF THE DRAWINGS
[0078] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the following will briefly introduce the drawings required to be used in the embodiments of the present application. For those of ordinary skill in the art, other drawings can also be obtained based on these drawings without creative efforts.
[0079] Figure 1 is one of the schematic flowcharts of the method for detecting road visibility provided by an embodiment of the present application;
[0080] Figure 2 is one of the schematic diagrams of the image mask corresponding to the road area provided by an embodiment of the present application;
[0081] Figure 3 is the second schematic diagram of the image mask corresponding to the road area provided by an embodiment of the present application;
[0082] Figure 4 is the second schematic flowchart of the method for detecting road visibility provided by an embodiment of the present application;
[0083] Figure 5 is the schematic structural diagram of the device for detecting road visibility provided by an embodiment of the present application;
[0084] Figure 6 is the schematic structural diagram of the electronic device provided by an embodiment of the present application. DETAILED DESCRIPTION OF THE EMBODIMENTS
[0085] The features and exemplary embodiments of various aspects of the present application will be described in detail below. To make the objectives, technical solutions, and advantages of the present application clearer, the present application will be further described in detail below with reference to the accompanying drawings and specific embodiments. It should be understood that the specific embodiments described herein are only intended to explain the present application, rather than to limit the present application. For those skilled in the art, the present application can be implemented without some of these specific details. The following description of the embodiments is only to provide a better understanding of the present application by showing examples of the present application.
[0086] It should be noted that, in this document, relational terms such as first and second are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variant thereof are intended to cover non-exclusive inclusion, such that a process, method, article or device including a series of elements not only includes those elements but also includes other elements not expressly listed, or further includes elements inherent to such process, method, article or device. Without further limitation, an element defined by the statement "including..." does not exclude the existence of additional identical elements in the process, method, article or device including the said element.
[0087] To solve the problems of the prior art, embodiments of the present application provide a road visibility detection method, device, equipment and computer storage medium. The road visibility detection method can be applied to scenarios where visibility is detected on a road. First, the road visibility detection method provided by the embodiments of the present application will be introduced below.
[0088] Figure 1 The flowchart of the road visibility detection method provided by an embodiment of the present application is shown. As Figure 1 shown, the road visibility detection method may specifically include the following steps:
[0089] Step 110, obtaining a road image collected by a camera.
[0090] Step 120, obtaining an image mask corresponding to the road area in the road image.
[0091] Step 130, traversing each pixel point in the range corresponding to the road area in the image mask from bottom to top in pixel rows, and determining the invisible segments in the range corresponding to the road area; wherein, the invisible segments include at least one invisible row.
[0092] Step 140: Determine a target invisible segment according to the actual length corresponding to the invisible segment. Herein, the target invisible segment is an invisible segment determined when the actual cumulative length of the determined invisible segments is greater than a first preset length, or the first invisible segment among the determined invisible segments whose actual length is greater than a second preset length.
[0093] Step 150: Determine visible boundary points in the image mask according to the position of the target invisible segment in the image mask.
[0094] Step 160: Determine the actual coordinates corresponding to the visible boundary points according to the image coordinates corresponding to the visible boundary points.
[0095] Step 170: Determine the road visibility distance value according to the actual coordinates corresponding to the visible boundary points and the actual coordinates corresponding to the camera.
[0096] Thus, by obtaining the image mask corresponding to the road area in the road image, further determining the invisible segments within the range corresponding to the road area, combining the actual lengths corresponding to the determined invisible segments to determine the target invisible segment, then determining the visible boundary points according to the position of the target invisible segment, and using the actual coordinates corresponding to the visible boundary points and the actual coordinates corresponding to the camera, the road visibility distance value is calculated. In this way, on the one hand, since the calculation process of the embodiment of the present application is based on the image mask corresponding to the road area in the road image, the implementation complexity can be reduced. On the other hand, since the target invisible segment is an invisible segment determined when the actual cumulative length of the determined invisible segments is greater than the first preset length, or the first invisible segment among the determined invisible segments whose actual length is greater than the second preset length, when the actual length or the actual cumulative length of the invisible segment exceeds the preset length, it can be determined that the visible boundary has been reached, and thus the influence of the vehicle lights and the vehicle body in the distance on the visibility distance value can be excluded, achieving the effect of improving the accuracy of road visibility distance detection.
[0097] The above steps are described in detail as follows:
[0098] First, regarding Step 110, in the embodiment of the present application, the road image can be an image with clear lane dividing lines and the road area captured by a camera. Herein, the camera can be a monitoring camera set on both sides of the road or a moving camera set on the vehicle, which is not limited herein.
[0099] Second, regarding Step 120, in the embodiment of the present application, the range of the image mask can be automatically obtained or manually selected through a lane line segmentation algorithm. Herein, the mask can be used to block all or part of the image to control the image processing area or the processing process. Here, it can be used to block the area outside the road area in the road image to process the image within the road area range.
[0100] In a specific example, for instance, as Figure 2 shown, after obtaining the road image collected by the monitoring camera, an image mask corresponding to the road area in the road image is automatically obtained through a preset algorithm.
[0101] In an alternative embodiment, the image coordinates include an abscissa and an ordinate;
[0102] The above step 120 may specifically include:
[0103] Determine the set of left lane boundary points and the set of right lane boundary points corresponding to the road area in the road image;
[0104] Traverse each pixel point in the road image in sequence. According to the target ordinate corresponding to the currently traversed pixel point, determine the first upper boundary point and the first lower boundary point corresponding to the target ordinate from the set of left lane boundary points, and determine the second upper boundary point and the second lower boundary point corresponding to the target ordinate from the set of right lane boundary points;
[0105] According to the image coordinates corresponding to the first upper boundary point, the first lower boundary point, the second upper boundary point, and the second lower boundary point respectively, determine whether the currently traversed pixel point is a pixel point within the road area range until each pixel point in the road image is traversed, and determine the image mask corresponding to the road area in the road image.
[0106] Here, in the case of multiple lane lines, the set of left lane boundary points may be the set of boundary points of the leftmost lane line in the road image, and the set of right lane boundary points may be the set of boundary points of the rightmost lane line in the road image. Among them, the boundary points can be selected through an edge detection algorithm or manually selected. Each pixel point can be traversed in the order from bottom to top and from left to right. The currently traversed pixel point can be within or outside the road area range.
[0107] In addition, the target ordinate may be the ordinate corresponding to the currently traversed pixel point in the image coordinates. The first upper boundary point and the first lower boundary point may be the boundary points adjacent to the pixel point corresponding to the target ordinate above and below in the set of left lane boundary points, and the second upper boundary point and the second lower boundary point may be the boundary points adjacent to the pixel point corresponding to the target ordinate above and below in the set of right lane boundary points.
[0108] In a specific example, after obtaining the road image through the monitoring camera, use the edge detection algorithm to obtain the set of left lane boundary points and the set of right lane boundary points And traverse all the pixels in the road image. Let the corresponding coordinates of the currently traversed pixel in the image coordinates be A(x, y), respectively in the ordered left lane boundary point set and the right lane boundary point set Using the y coordinate as a reference, find the set of left lane boundary points whose y coordinates are adjacent to the y coordinate of point A. The two points in the upper boundary and the lower boundary point And the set of right lane boundary points whose y coordinates are adjacent to the y coordinates of point A The two points in the upper boundary and the lower boundary point Let the vector:
[0109]
[0110]
[0111]
[0112]
[0113] When the following conditions are met, it means that the currently traversed pixel point A is a pixel point within the road area:
[0114] N left ×M left >0 and N right ×M right <0
[0115] Traverse each pixel point in the road image in turn, and use the above formula to obtain all the pixels that meet the conditions, and then obtain the image mask corresponding to the road area in the road image. left is the set of left lane boundary points The upper boundary point in and the lower boundary point The vector distance between right is the boundary point set of the right lane line The upper boundary point in and the lower boundary point The vector distance between left The set of currently traversed pixel point A and the left lane boundary point Middle and lower boundary points The vector distance between right The set of currently traversed pixel point A and the boundary point of the right lane line Middle and lower boundary points The vector distance between .
[0116] Thus, by traversing all the pixel points in the road image and using the formula to obtain the pixel points within all the road regions, the image mask corresponding to the road region in the road image can be accurately obtained, avoiding the interference of pixel points outside the road region, and at the same time, the image processing range can be reduced and the computational complexity can be decreased.
[0117] Regarding step 130, in the embodiments of the present application, an invisible row can be a pixel row without visible points. A pixel row can be composed of a row of pixel points, and an invisible segment can be composed of consecutive invisible rows.
[0118] In an alternative embodiment, the above step 130 may specifically include:
[0119] Determine whether there are visible points in the target pixel row currently being traversed;
[0120] In the case where there are no visible points, determine the target pixel row as an invisible row;
[0121] Divide multiple consecutive invisible rows into an invisible segment to obtain the invisible segments within the corresponding range of the road region.
[0122] Here, the target pixel row can be the pixel row where the currently traversed pixel point is located. Whether a pixel point is a visible point can be determined according to the contrast between the pixel point and its surrounding pixel points. An invisible row can be a pixel row without visible points, that is, in the case where there are no visible points in the target pixel row, the target pixel row can be recognized as an invisible row. An invisible segment can include one invisible row or multiple continuously distributed invisible rows.
[0123] In a specific example, after obtaining the road image and the image mask corresponding to the road region through a monitoring camera, in the road image, within the visibility detection range of the image mask, the pixel points corresponding to the road region are traversed from bottom to top and from left to right. If there are visible points in the target pixel row currently being traversed, the target pixel row is a visible row. If there are no visible points in the target pixel row currently being traversed, determine the target pixel row as an invisible row, and divide the consecutive invisible rows into an invisible segment.
[0124] Thus, by traversing all the pixel points corresponding to the road region in the road image and using the formula to determine whether there are visible points in the target pixel row currently being traversed, the invisible segments can be accurately obtained.
[0125] In an alternative embodiment, the above determination of whether there are visible points in the target pixel row currently being traversed may specifically include:
[0126] Obtain the contrast value corresponding to the pixel points in the target pixel row currently being traversed;
[0127] Determine whether there are target pixel points in the target pixel row whose contrast values are greater than a preset threshold;
[0128] In the case where there are target pixel points, determine that there are visible points in the target pixel row; otherwise, determine that there are no visible points in the target pixel row.
[0129] Here, contrast refers to the degree of light and dark contrast in the picture. The preset threshold can be determined according to the definition of the human eye contrast threshold by the International Commission on Illumination. The target pixel point can be a pixel point in the currently traversed pixel row whose contrast value is greater than the preset threshold.
[0130] In addition, the contrast corresponding to a pixel point can be calculated using the values of multiple neighborhoods or different window scales. For example, define the contrast calculation formula for two pixel points:
[0131]
[0132] where a and b represent the gray values of the two pixel points. For a certain pixel point x, take the pixel points adjacent to it in the four directions of up, down, left, and right and calculate the contrast respectively, and take the maximum value as the contrast value of this pixel point:
[0133] C x =max(C(x, x i )), i ∈ V4
[0134] where i represents the four directions of up, down, left, and right, and x i represents the four adjacent pixel points in the up, down, left, and right directions. According to the definition of the human eye contrast threshold by the International Commission on Illumination, C x ≥ 0.05 is a visible point.
[0135] In a specific example, according to the range of image mask visibility detection, traverse the pixel points within the road area in the road image. According to the contrast calculation formula, if the contrast value corresponding to a certain pixel point in the currently traversed pixel row is greater than the preset threshold, then this pixel point is a visible point, and the pixel row corresponding to this pixel point is a visible row.
[0136] Thus, according to the contrast values of the pixel points corresponding to the road area in the road image, it is possible to accurately determine whether there are visible points in the target pixel row.
[0137] Regarding step 140, in the embodiments of the present application, the actual length corresponding to the invisible segment can be determined by the distance between longitude and latitude coordinates, specifically, it can be the actual distance between the midpoints or endpoints of the invisible rows where the upper and lower boundaries of the invisible segment are located. The actual cumulative length of the determined invisible segment can be the cumulative length of the actual distances between the midpoints or endpoints of the invisible rows where the upper and lower boundaries of each invisible segment are located, or the endpoints, midpoints, or any visible points of adjacent visible rows. The first preset length and the second preset length can be lengths set arbitrarily according to needs.
[0138] In a specific example, as Figure 3 shown, when the first preset length is set to 50 meters, traverse the pixel points within the road area range in the road image from bottom to top, and after determining the invisible segment 31 (with a length of 30 meters) and the invisible segment 32 (with a length of 100 meters), the actual length corresponding to the invisible segment 31 can be added to the actual length corresponding to the invisible segment 32 as the actual cumulative length. Since the actual cumulative length is 130 meters, which is greater than the first preset length of 50 meters, the invisible segment 32 is determined as the target invisible segment.
[0139] In addition to the above method of determining the target invisible segment, in another specific example, as Figure 3 shown, when the second preset length is set to 50 meters, traverse the pixel points within the road area range in the road image from bottom to top, and after determining the invisible segment 31 (with a length of 30 meters) and the invisible segment 32 (with a length of 100 meters), it can be known that the invisible segment 32 is the first invisible segment whose corresponding actual length is greater than the second preset length of 50 meters, so the invisible segment 32 is determined as the target invisible segment.
[0140] In this way, the visibility error range can be controlled within the first preset length or the second preset length, avoiding being affected by the vehicle lights or the vehicle body.
[0141] In an alternative embodiment, the actual coordinates are longitude and latitude coordinates;
[0142] Before step 140, the road visibility detection method may specifically further include:
[0143] Determine the mapping relationship between the image coordinates and the longitude and latitude coordinates;
[0144] According to the mapping relationship and the image length of the invisible segment in the image mask, determine the actual length corresponding to the invisible segment.
[0145] Here, the longitude and latitude coordinates can be determined by using a high-precision map to locate the lane lines on the road or by using artificial markers equipped with positioning devices. Among them, the positioning system relied on during positioning can be the Global Positioning System (GPS), the Beidou positioning system, etc. For example, a connected vehicle equipped with a GPS positioning device drives through the road. By associating the GPS coordinates corresponding to the connected vehicle with the image coordinates corresponding to the connected vehicle in the road image, the mapping relationship between the GPS coordinates and the image coordinates can be obtained. In addition, if the mapping relationship between the image coordinates and the longitude and latitude coordinates is obtained by setting multiple artificial markers, the artificial markers should cover the range corresponding to the road area as much as possible.
[0146] Exemplarily, the mapping relationship between the image coordinates and the longitude and latitude coordinates can be determined in the following way: within the field of view of the collected road image, the GPS coordinates P of the artificial marker are obtained through a GPS instrument GPS , and the GPS coordinates of the location where the monitoring camera is located At the same time, mark the central pixel point coordinate P of the end of the artificial marker in contact with the ground at the bottom in the image IMG , and establish a two-dimensional coordinate system with the road image (for example, a coordinate system established with the width of the image as the abscissa and the height of the image as the ordinate). According to the mapping relationship:
[0147] P GPS = M·P IMG
[0148] Then there is:
[0149]
[0150] where X and Y are the image pixel point coordinates, Lon and Lat are the actual longitude coordinates and latitude coordinates corresponding to the pixel points in the road image, z is the mapping scaling coefficient, and a 11 ~a 32 are the coefficients in the projection matrix M. Then there is:
[0151] a 11 ·X + a 12 ·Y + a 13 = Lon·z
[0152] a 21 ·X + a 22 ·Y + a 23 = Lat·z
[0153] a 31 + a 32 + 1 = z
[0154] Convert to matrix form:
[0155]
[0156] After filling the obtained multiple GPS coordinates P GPS and the image pixel point coordinates P IMG into the formula respectively, a 11 ~a 32 can be obtained, that is, the projection matrix M is obtained. Among them, the solution methods include but are not limited to SVD decomposition, pseudo-inverse calculation, etc.
[0157] Thus, by judging whether the actual length or the actual cumulative length in the invisible segment is greater than the preset length, the target invisible segment is determined, and through the mapping relationship between the image coordinates and the longitude and latitude coordinates, and the image length of the invisible segment in the image mask, the actual length corresponding to the invisible segment can be accurately determined, thereby reducing the error caused by regarding the vehicle lights or the vehicle body in the distance of the road as visible points.
[0158] Regarding step 150, in the embodiment of the present application, the visible boundary point may be the leftmost visible point in the visible row corresponding to the visible boundary, where the visible boundary may be the upper boundary of the previous visible segment adjacent to the target invisible segment. Of course, the visible boundary point may also be other visible points or end points in the visible row corresponding to the visible boundary, which is not limited herein.
[0159] In an alternative embodiment, the above step 150 may specifically include:
[0160] Determine the previous visible segment adjacent to the target invisible segment according to the position of the target invisible segment in the image mask;
[0161] Determine the upper boundary of the visible segment as the visible boundary;
[0162] Determine the leftmost visible point in the pixel row corresponding to the visible boundary as the visible boundary point.
[0163] Among them, the visible boundary point may be the leftmost visible point in the pixel row corresponding to the visible boundary, or the middle visible point in the pixel row corresponding to the visible boundary, or the leftmost pixel point in the pixel row corresponding to the visible boundary.
[0164] In a specific example, as Figure 3 shown, since the invisible segment 32 is the first invisible segment whose corresponding actual length is greater than 50 meters, therefore, the invisible segment 32 is determined as the target invisible segment, and then the upper boundary of the previous visible segment adjacent to the invisible segment 32 is determined as the visible boundary 33, and the leftmost visible point in the pixel row corresponding to the visible boundary 33 is determined as the visible boundary point.
[0165] Thus, by determining the upper boundary of the previous visible segment adjacent to the target invisible segment as the visible boundary, and determining the first visible point from the left in the pixel row corresponding to the visible boundary as the visible boundary point, the visible boundary point can be determined more accurately, thereby improving the accuracy of the visibility distance.
[0166] Regarding step 160, in the embodiments of the present application, the actual coordinates corresponding to the visible boundary point can be the longitude and latitude coordinates corresponding to the visible boundary point, and can be determined through the mapping relationship between the image coordinates and the longitude and latitude coordinates, as well as the image coordinates corresponding to the visible boundary point.
[0167] The above step 160 may specifically include:
[0168] Based on the mapping relationship, according to the image coordinates corresponding to the visible boundary point, determine the longitude and latitude coordinates corresponding to the visible boundary point.
[0169] In a specific example, after obtaining the projection matrix M according to the GPS coordinates and image pixel point coordinates of multiple artificial markers, take the image coordinates of the visible boundary point as the independent variable P IMG Substitute into the mapping relationship: P GPS = M·P IMG , so as to obtain the actual GPS coordinates P GPS of the visible boundary point, that is, the longitude and latitude coordinates corresponding to the visible boundary point.
[0170] Thus, through the mapping relationship and the image coordinates corresponding to the visible boundary point, the longitude and latitude coordinates corresponding to the visible boundary point can be accurately determined.
[0171] Regarding step 170, determine the road visibility distance value according to the actual coordinates corresponding to the visible boundary point and the actual coordinates corresponding to the camera.
[0172] In a specific example, after obtaining the actual GPS coordinates of the visible boundary point according to the mapping relationship and the image coordinates corresponding to the visible boundary point, through the GPS coordinates of the location where the camera is located and the true GPS coordinates of the visible boundary point, convert the true distance between the camera and the visible boundary point as the road visibility distance value.
[0173] Based on this, in a possible embodiment, as Figure 4 shown, the above step 170 may specifically include step 1701 - step 1702, as follows:
[0174] Step 1701, calculate the initial road visibility distance value according to the actual coordinates corresponding to the visible boundary point and the actual coordinates corresponding to the camera;
[0175] Step 1702: Input the initial road visibility distance value into a preset filter, and use the preset filter to perform data smoothing processing on the initial road visibility distance value, and output the road visibility distance value.
[0176] Here, the initial road visibility distance value can be the actual distance obtained by converting according to the actual coordinates corresponding to the visible boundary point and the camera.
[0177] There are many noise interferences in the real world, and the calculated road visibility distance results often contain a lot of noise. Therefore, it is necessary to use filtering to smooth the data. According to the characteristic that noise often appears in the distance in the daytime visibility scenario of the highway, in order to further improve the accuracy of the calculation result in this embodiment of the present application, a preset filter is set to filter out the distant noise contained in the calculation result. Among them, the preset filter can be a mean filter, a median filter, a Kalman filter or an alpha-beta filter (α-β filter / g-h filter), etc.
[0178] In an alternative embodiment, the preset filter is a g-h filter; wherein, when the initial road visibility distance value is greater than the filter prediction value, the parameter value of the confidence parameter g corresponding to the g-h filter is the first value, and when the initial road visibility distance value is not greater than the filter prediction value, the parameter value of the confidence parameter g corresponding to the g-h filter is set to the second value, and the first value is less than the second value.
[0179] Here, the filter prediction value can be the predicted visibility distance value of the g-h filter, the confidence parameter g can be the trust degree of the g-h filter for the filter prediction value, and the first value and the second value can be the parameter values of the confidence parameter g set according to needs.
[0180] Exemplarily, the calculation process of the g-h filter is as follows:
[0181]
[0182] d x =0
[0183] while input data: X n , n∈R +
[0184]
[0185]
[0186]
[0187]
[0188]
[0189] end while
[0190] Among them, X n is the initially calculated initial road visibility distance value, and its initial value is set to X0. This X0 can be the initial road visibility distance value obtained in the first calculation. is the road visibility distance value after filtering by the g-h filter. is the predicted visibility distance value of the g-h filter, d x is the visibility change rate, and its initial value is set to 0, d t is the change time interval, Y is the difference between the predicted result and the original result. h is the acceleration of the g-h filter change rate, which is set to h = 0.000001 here and can be modified according to actual situations.
[0191] In addition, g is the confidence level of the g-h filter for the predicted visibility distance value. According to the characteristic that noise often appears in the distance in the daytime visibility scenario of the highway, the following setting is made for the g value in the embodiments of the present application: when the input initial road visibility distance value is greater than the filter prediction value, the parameter value of the confidence parameter g corresponding to the filter is increased, so that the road visibility distance value is more biased towards the smaller filter prediction value. Otherwise, normal calculation is performed. Due to the existence of the change rate acceleration h, if there is a rapid dissipation of the cluster fog and the predicted visibility distance value of the filter rises rapidly, after a slight delay, the road visibility distance value output by the g-h filter can also quickly approach the predicted visibility distance value of the filter.
[0192] Thus, through the data smoothing process of the initial road visibility distance value by the g-h filter and the setting of the confidence parameter g value, when the calculated value suddenly becomes large, the finally output road visibility distance value can be more biased towards the filter prediction value, avoiding being affected by the vehicle lights or vehicle bodies in the distance of the road.
[0193] Figure 5 is a schematic structural diagram of a road visibility detection device shown according to an exemplary embodiment.
[0194] As Figure 5 shown, the road visibility detection device 500 may include:
[0195] An image acquisition module 501, configured to acquire a road image collected by a camera;
[0196] A mask acquisition module 502, configured to acquire an image mask corresponding to the road area in the road image;
[0197] The first determination module 503 is configured to traverse each pixel point within the range corresponding to the road area in the image mask from bottom to top in units of pixel rows, and determine the invisible segments within the range corresponding to the road area; wherein, the invisible segments include at least one invisible row.
[0198] The second determination module 504 is configured to determine a target invisible segment according to the actual length corresponding to the invisible segment; wherein, the target invisible segment is an invisible segment determined when the actual cumulative length of the determined invisible segments is greater than a first preset length, or the first invisible segment among the determined invisible segments whose actual length is greater than a second preset length.
[0199] The boundary point determination module 505 is configured to determine the visible boundary points in the image mask according to the position of the target invisible segment in the image mask.
[0200] The coordinate determination module 506 is configured to determine the actual coordinates corresponding to the visible boundary points according to the image coordinates corresponding to the visible boundary points.
[0201] The distance determination module 507 is configured to determine the road visibility distance value according to the actual coordinates corresponding to the visible boundary points and the actual coordinates corresponding to the camera.
[0202] In an alternative embodiment, the distance determination module 507 may specifically include:
[0203] A calculation sub-module, configured to calculate an initial road visibility distance value according to the actual coordinates corresponding to the visible boundary points and the actual coordinates corresponding to the camera.
[0204] A data processing sub-module, configured to input the initial road visibility distance value into a preset filter, and perform data smoothing processing on the initial road visibility distance value by using the preset filter, and output the road visibility distance value.
[0205] In an alternative embodiment, the preset filter is a g-h filter; wherein, when the initial road visibility distance value is greater than the filter prediction value, the parameter value of the confidence parameter g corresponding to the g-h filter is a first value, and when the initial road visibility distance value is not greater than the filter prediction value, the parameter value of the confidence parameter g corresponding to the g-h filter is set to a second value, and the first value is less than the second value.
[0206] In an alternative embodiment, the image coordinates include an abscissa and an ordinate.
[0207] The mask acquisition module 502 may specifically include:
[0208] A first determination sub-module, configured to determine a set of left lane line boundary points and a set of right lane line boundary points corresponding to the road area in the road image.
[0209] A second determination sub-module, configured to sequentially traverse each pixel point in the road image, and determine, according to the target ordinate corresponding to the currently traversed pixel point, a first upper boundary point and a first lower boundary point corresponding to the target ordinate from the set of left lane line boundary points, and a second upper boundary point and a second lower boundary point corresponding to the target ordinate from the set of right lane line boundary points;
[0210] A third determination sub-module, configured to determine whether the currently traversed pixel point is a pixel point within the road area according to the image coordinates corresponding to the first upper boundary point, the first lower boundary point, the second upper boundary point, and the second lower boundary point, until each pixel point in the road image is traversed, and determine the image mask corresponding to the road area in the road image.
[0211] In an optional implementation manner, the boundary point determination module 505 may specifically include:
[0212] A visible segment determination sub-module, configured to determine the previous visible segment adjacent to the target invisible segment according to the position of the target invisible segment in the image mask;
[0213] A visible boundary determination sub-module, configured to determine the upper boundary of the visible segment as the visible boundary;
[0214] A visible boundary point determination sub-module, configured to determine the first visible point from the left in the pixel row corresponding to the visible boundary as the visible boundary point.
[0215] In an optional implementation manner, the first determination module 503 may specifically include:
[0216] A visible point determination sub-module, configured to determine whether there is a visible point in the currently traversed target pixel row;
[0217] An invisible row determination sub-module, configured to determine the target pixel row as an invisible row when there is no visible point;
[0218] An invisible segment determination sub-module, configured to divide a continuous plurality of invisible rows into an invisible segment to obtain an invisible segment within the corresponding range of the road area.
[0219] In an optional implementation manner, the visible point determination sub-module includes:
[0220] An acquisition unit, configured to acquire the contrast value corresponding to the pixel point in the currently traversed target pixel row;
[0221] A first determination unit, configured to determine whether there is a target pixel point in the target pixel row whose contrast value is greater than a preset threshold;
[0222] A second determination unit, configured to determine that there is a visible point in the target pixel row when there is a target pixel point; otherwise, determine that there is no visible point in the target pixel row.
[0223] In an optional implementation manner, the actual coordinates are longitude and latitude coordinates; the road visibility detection device 500 may specifically further include:
[0224] A mapping relationship determination module, configured to determine the mapping relationship between the image coordinates and the longitude and latitude coordinates before determining the target invisible segment according to the actual length corresponding to the invisible segment;
[0225] A third determination module, configured to determine the actual length corresponding to the invisible segment according to the mapping relationship and the image length of the invisible segment in the image mask;
[0226] The third determination module includes:
[0227] A coordinate determination sub-module, configured to determine the longitude and latitude coordinates corresponding to the visible boundary point based on the mapping relationship according to the image coordinates corresponding to the visible boundary point.
[0228] Thus, by obtaining the image mask corresponding to the road area in the road image, further determining the invisible segments within the corresponding range of the road area, combining the actual lengths corresponding to the determined invisible segments to determine the target invisible segment, and then determining the visible boundary point according to the position of the target invisible segment, and using the actual coordinates corresponding to the visible boundary point and the actual coordinates corresponding to the camera, the road visibility distance value is calculated. In this way, on the one hand, since the calculation process of the embodiment of the present application is based on the image mask corresponding to the road area in the road image, the implementation complexity can be reduced; on the other hand, since the target invisible segment is the invisible segment determined when the actual cumulative length of the determined invisible segments is greater than the first preset length, or the first invisible segment with an actual length greater than the second preset length among the determined invisible segments, when the actual length or the actual cumulative length of the invisible segment exceeds the preset length, it can be determined that the visible boundary has been reached, and thus the influence of the vehicle lights and the vehicle body in the distance on the visibility distance value can be excluded, achieving the effect of improving the accuracy of the road visibility distance detection.
[0229] Figure 6 The hardware structure diagram of the electronic device provided by the embodiment of the present application is shown.
[0230] The electronic device may include a processor 601 and a memory 602 storing computer program instructions.
[0231] Specifically, the above-mentioned processor 601 may include a central processing unit (CPU), or an application specific integrated circuit (ASIC), or may be an integrated circuit configured to implement one or more embodiments of the present application.
[0232] The memory 602 may include a mass storage for data or instructions. By way of example and not limitation, the memory 602 may include a hard disk drive (HDD), a floppy disk drive, a flash memory, an optical disc, a magneto-optical disc, a magnetic tape, or a universal serial bus (USB) drive or a combination of two or more of these. In a suitable case, the memory 602 may include a removable or non-removable (or fixed) medium. In a suitable case, the memory 602 may be internal or external to the integrated gateway disaster recovery device. In a specific embodiment, the memory 602 is a non-volatile solid state memory.
[0233] The memory may include a read-only memory (ROM), a random access memory (RAM), a magnetic disk storage medium device, an optical storage medium device, a flash memory device, an electrical, optical, or other physical / tangible memory storage device. Thus, in general, the memory includes one or more tangible (non-transitory) computer-readable storage media (e.g., memory devices) encoded with software including computer-executable instructions, and when the software is executed (e.g., by one or more processors), it is operable to perform the operations described with reference to the method according to the first aspect of the present disclosure.
[0234] The processor 601 reads and executes the computer program instructions stored in the memory 602 to implement any one of the road visibility detection methods in the above embodiments.
[0235] In one example, the electronic device may further include a communication interface 603 and a bus 610. Among them, as Figure 6 shown, the processor 601, the memory 602, and the communication interface 603 are connected through the bus 610 and complete communication with each other.
[0236] The communication interface 603 is mainly used to implement communication between the various modules, devices, units, and / or devices in the embodiments of the present application.
[0237] The bus 610 includes hardware, software, or both, and couples the components of the online data flow metering device to each other. By way of example and not limitation, the bus may include an Accelerated Graphics Port (AGP) or other graphics bus, an Enhanced Industry Standard Architecture (EISA) bus, a Front Side Bus (FSB), a HyperTransport (HT) interconnect, an Industry Standard Architecture (ISA) bus, an InfiniBand interconnect, a Low Pin Count (LPC) bus, a memory bus, a MicroChannel Architecture (MCA) bus, a Peripheral Component Interconnect (PCI) bus, a PCI-Express (PCI-X) bus, a Serial Advanced Technology Attachment (SATA) bus, a Video Electronics Standards Association Local (VLB) bus, or other suitable buses, or a combination of two or more of these. Where appropriate, the bus 610 may include one or more buses. Although the embodiments of the present application describe and illustrate specific buses, the present application contemplates any suitable bus or interconnect.
[0238] The electronic device can execute the road visibility detection method in the embodiments of the present application based on the image mask corresponding to the road area in the road image, so as to implement the combination of Figures 1 to 5 the described road visibility detection method and device.
[0239] In addition, in combination with the road visibility detection method in the above embodiments, the embodiments of the present application can be implemented by providing a computer storage medium. Computer program instructions are stored on the computer storage medium; when the computer program instructions are executed by a processor, any one of the road visibility detection methods in the above embodiments is implemented.
[0240] It should be clear that the present application is not limited to the specific configurations and processes described above and shown in the figures. For the sake of brevity, detailed descriptions of known methods are omitted here. In the above embodiments, several specific steps are described and shown as examples. However, the method process of the present application is not limited to the specific steps described and shown, and those skilled in the art can make various changes, modifications, and additions, or change the order between steps after understanding the spirit of the present application.
[0241] The functional blocks shown in the above-described structural block diagrams can be implemented as hardware, software, firmware, or a combination thereof. When implemented in hardware, it can be, for example, an electronic circuit, an application specific integrated circuit (ASIC), appropriate firmware, a plug-in, a functional card, and so on. When implemented in software, the elements of the present application are programs or code segments for performing the required tasks. The program or code segment can be stored in a machine-readable medium, or transmitted over a transmission medium or communication link via a data signal carried in a carrier wave. A "machine-readable medium" can include any medium that can store or transmit information. Examples of machine-readable media include electronic circuits, semiconductor memory devices, ROM, flash memory, erasable ROM (EROM), floppy disks, CD-ROMs, optical discs, hard disks, fiber optic media, radio frequency (RF) links, and so on. The code segment can be downloaded via a computer network such as the Internet, an intranet, and so on.
[0242] It should also be noted that in the exemplary embodiments mentioned in the present application, some methods or systems are described based on a series of steps or devices. However, the present application is not limited to the order of the above steps, that is, the steps can be executed in the order mentioned in the embodiments, or different from the order in the embodiments, or several steps can be executed simultaneously.
[0243] Aspects of the present disclosure have been described above with reference to the flowcharts and / or block diagrams of methods, apparatuses (systems), and computer program products according to embodiments of the present disclosure. It should be understood that each block in the flowcharts and / or block diagrams, and the combinations of blocks in the flowcharts and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device to produce a machine, such that the instructions executed by the processor of the computer or other programmable data processing device enable the implementation of the functions / actions specified in one or more blocks of the flowcharts and / or block diagrams. Such a processor can be, but is not limited to, a general-purpose processor, a special-purpose processor, a special application processor, or a field programmable logic circuit. It can also be understood that each block in the block diagrams and / or flowcharts, and the combinations of blocks in the block diagrams and / or flowcharts, can also be implemented by dedicated hardware for performing the specified functions or actions, or by a combination of dedicated hardware and computer instructions.
[0244] As described above, this is only the specific implementation manner of the present application. Those skilled in the art can clearly understand that for the convenience and brevity of description, the specific working processes of the systems, modules, and units described above can refer to the corresponding processes in the foregoing method embodiments, and will not be elaborated herein. It should be understood that the protection scope of the present application is not limited thereto. Any person skilled in the art within the technical scope disclosed by the present application can easily think of various equivalent modifications or substitutions, and these modifications or substitutions should all be covered within the protection scope of the present application.
Claims
1. A method for detecting road visibility, characterized in that, Including: Obtain a road image collected by a camera; Obtain an image mask corresponding to the road area in the road image; Traverse each pixel point in the range corresponding to the road area in the image mask row by pixel row from bottom to top, and determine the invisible section in the range corresponding to the road area; wherein, the invisible section includes at least one invisible row; Determine a target invisible section according to the actual length corresponding to the invisible section; wherein, the target invisible section is an invisible section determined when the actual cumulative length of the determined invisible section is greater than a first preset length, or the first invisible section in the determined invisible sections whose actual length is greater than a second preset length; Determine visible boundary points in the image mask according to the position of the target invisible section in the image mask; Determine the actual coordinates corresponding to the visible boundary points according to the image coordinates corresponding to the visible boundary points; Determine a road visibility distance value according to the actual coordinates corresponding to the visible boundary points and the actual coordinates corresponding to the camera; The determining the invisible section in the range corresponding to the road area includes: Determine whether there are visible points in the target pixel row being traversed currently; In the case that there are no visible points, determine the target pixel row as an invisible row; Divide multiple consecutive invisible rows into an invisible section to obtain the invisible section in the range corresponding to the road area; The determining whether there are visible points in the target pixel row being traversed currently includes: Obtain the contrast value corresponding to the pixel points in the target pixel row being traversed currently; Determine whether there are target pixel points in the target pixel row whose contrast value is greater than a preset threshold; In the case that there are the target pixel points, determine that there are visible points in the target pixel row; otherwise, determine that there are no visible points in the target pixel row.
2. The method according to claim 1, characterized in that, The determining the road visibility distance value according to the actual coordinates corresponding to the visible boundary points and the actual coordinates corresponding to the camera includes: Calculate an initial road visibility distance value according to the actual coordinates corresponding to the visible boundary points and the actual coordinates corresponding to the camera; Input the initial road visibility distance value into a preset filter, and use the preset filter to perform data smoothing processing on the initial road visibility distance value, and output a road visibility distance value.
3. The method according to claim 2, characterized in that, The preset filter is a g-h filter; wherein, in the case that the initial road visibility distance value is greater than the filter prediction value, the parameter value of the confidence parameter g corresponding to the g-h filter is a first value, and in the case that the initial road visibility distance value is not greater than the filter prediction value, the parameter value of the confidence parameter g corresponding to the g-h filter is set to a second value, and the first value is less than the second value.
4. The method according to claim 1, characterized in that, The image coordinates include an abscissa and an ordinate; The obtaining the image mask corresponding to the road area in the road image includes: Determine a set of left lane line boundary points and a set of right lane line boundary points corresponding to the road area in the road image; Traverse each pixel point in the road image in sequence. According to the target vertical coordinate corresponding to the currently traversed pixel point, determine a first upper boundary point and a first lower boundary point corresponding to the target vertical coordinate from the set of left lane line boundary points, and determine a second upper boundary point and a second lower boundary point corresponding to the target vertical coordinate from the set of right lane line boundary points; According to the image coordinates corresponding to the first upper boundary point, the first lower boundary point, the second upper boundary point, and the second lower boundary point respectively, determine whether the currently traversed pixel point is a pixel point within the road area range, until each pixel point in the road image is traversed, and determine the image mask corresponding to the road area in the road image.
5. The method according to claim 1, characterized in that, The determining the visible boundary points in the image mask according to the position of the target invisible segment in the image mask includes: According to the position of the target invisible segment in the image mask, determine the previous visible segment adjacent to the target invisible segment; Determine the upper boundary of the visible segment as the visible boundary; Determine the first visible point from the left in the pixel row corresponding to the visible boundary as the visible boundary point.
6. The method according to any one of claims 1-5, characterized in that, The actual coordinates are longitude and latitude coordinates; Before determining the target invisible segment according to the actual length corresponding to the invisible segment, the method further includes: Determine the mapping relationship between the image coordinates and the longitude and latitude coordinates; According to the mapping relationship and the image length of the invisible segment in the image mask, determine the actual length corresponding to the invisible segment; The determining the actual coordinates corresponding to the visible boundary point according to the image coordinates corresponding to the visible boundary point includes: Based on the mapping relationship, according to the image coordinates corresponding to the visible boundary point, determine the longitude and latitude coordinates corresponding to the visible boundary point.
7. A road visibility detection device, characterized in that, including: An image acquisition module, configured to acquire a road image collected by a camera; A mask acquisition module, configured to acquire an image mask corresponding to the road area in the road image; A first determination module, configured to traverse each pixel point within the range corresponding to the road area in the image mask from bottom to top in units of pixel rows, and determine the invisible segments within the range corresponding to the road area; wherein, at least one invisible row is included in the invisible segments; A second determination module, configured to determine a target invisible segment according to the actual length corresponding to the invisible segment; wherein, the target invisible segment is an invisible segment determined when the actual cumulative length of the determined invisible segments is greater than a first preset length, or the first invisible segment in the determined invisible segments whose actual length is greater than a second preset length; A boundary point determination module, configured to determine the visible boundary points in the image mask according to the position of the target invisible segment in the image mask; A coordinate determination module, configured to determine the actual coordinates corresponding to the visible boundary point according to the image coordinates corresponding to the visible boundary point; A distance determination module, configured to determine a road visibility distance value according to the actual coordinates corresponding to the visible boundary point and the actual coordinates corresponding to the camera; The first determination module includes: A visible point determination sub-module, configured to determine whether there is a visible point in the target pixel row currently being traversed; An invisible row determination sub-module, configured to determine the target pixel row as an invisible row when there is no visible point; An invisible segment determination sub-module, configured to divide a plurality of consecutive invisible rows into an invisible segment to obtain the invisible segments within the corresponding range of the road area; The visible point determination sub-module includes: An acquisition unit, configured to acquire the contrast value corresponding to the pixel points in the target pixel row currently being traversed; A first determination unit, configured to determine whether there is a target pixel point in the target pixel row whose contrast value is greater than a preset threshold; A second determination unit, configured to determine that there is a visible point in the target pixel row when there is the target pixel point; otherwise, determine that there is no visible point in the target pixel row.
8. An electronic device, characterized in that, The electronic device includes: a processor and a memory storing computer program instructions; When the processor executes the computer program instructions, the road visibility detection method according to any one of claims 1-6 is implemented.
9. A computer storage medium, characterized in that, Computer program instructions are stored on the computer storage medium, and when the computer program instructions are executed by the processor, the road visibility detection method according to any one of claims 1-6 is implemented.
Citation Information
Patent Citations
Image processing method and device, mobile terminal and computer readable storage medium
CN107277299A
Driving sight distance measuring method and system
CN111121714A