A method for calculating the sight distance of tunnel entrances and exits based on image brightness extraction

Through image brightness extraction and regression model analysis, the problem of driving sight line calculation at the entrance and exit of the tunnel is solved, accurate measurement of driving sight line is achieved, and driving safety is improved.

CN115100065BActive Publication Date: 2024-11-22CHONGQING JIAOTONG UNIV +2
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202210767691.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-07-01
Publication Date
2024-11-22
Estimated Expiration
2042-07-01

AI Technical Summary

Technical Problem

The prior art cannot accurately calculate the driving sight distance at the entrances and exits of the tunnel, making it difficult for drivers to reasonably control vehicle speed and increase the risk of traffic accidents.

Method used

Using the method based on image brightness extraction, filtering is performed by obtaining the initial image of the tunnel entrance and exit, extracting the three primary color components, calculating the pixel light brightness, setting the calculation area, using the constant interval pixel calculation method to obtain the target pixel brightness, and analyze it through the regression model. Historical brightness value and driving distance, judge the vehicle position to calculate the driving distance.

Benefits of technology

Accurate measurement and calculation of the driving distance of traffic at the entrance and exit of the tunnel is realized, helping drivers to reasonably control vehicle speed and improve driving safety at the entrance and exit of the tunnel.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115100065B_ABST
    Figure CN115100065B_ABST
Patent Text Reader

Abstract

The present invention discloses a method for calculating the driving sight distance of a tunnel entrance and exit based on image brightness extraction, comprising: obtaining an initial image of the tunnel entrance and exit, filtering, obtaining a target image, extracting the three primary color components of the target image, and calculating the pixel brightness; setting a calculation area, adopting a constant interval pixel calculation method, obtaining the arithmetic mean of the pixels in the calculation area, and screening out the target pixel; calculating the target image brightness based on the pixel brightness of the target pixel, respectively obtaining the historical brightness value of the tunnel entrance and exit and the corresponding driving sight distance, performing regression calculation through a regression model, and obtaining a correlation model between the brightness value of the tunnel entrance and exit and the driving sight distance; judging the vehicle position according to the target image, and inputting the target image brightness into the corresponding correlation model to obtain the driving sight distance of the tunnel entrance and exit. The present invention realizes the measurement and calculation of the driving sight distance of the tunnel entrance and exit, and improves the driving safety of the tunnel entrance and exit.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention relates to the technical field of tunnel traffic safety, and in particular to a method for calculating the driving sight distance at a tunnel entrance and exit based on image brightness extraction. Background Art

[0002] The driver's driving sight distance is an important condition to ensure driving safety, a quantitative indicator to evaluate the quality of the road visual environment, and an important prerequisite for improving driving safety. At present, the main sight distance detection methods include sight distance detection based on running speed, sight distance detection for different roads and vehicle types, and three-dimensional dynamic sight distance calculation for highways. However, none of the above three methods can be applied to the driving sight distance at the entrance and exit of the tunnel. In addition, due to the large brightness difference between the inside and outside of the tunnel during the day, the human eye's perception and adaptation to the brightness difference lags, resulting in a black hole effect. Under the influence of the black hole effect, if the driver cannot accurately perceive the driving sight distance, resulting in excessive driving speed, traffic accidents are very likely to occur.

[0003] Therefore, there is an urgent need for a driving sight distance calculation method that can measure and calculate the driving sight distance at the tunnel entrance and exit so that the driver can reasonably control the vehicle speed and improve the driving safety at the tunnel entrance and exit. Summary of the invention

[0004] The present invention aims to provide a method for calculating the driving sight distance at tunnel entrances and exits based on image brightness extraction, which can measure and calculate the driving sight distance at tunnel entrances and exits, so as to solve the problem that the prior art cannot accurately calculate the driving sight distance at tunnel entrances and exits. The present invention realizes the measurement and calculation of the driving sight distance at tunnel entrances and exits, so that the driver can reasonably control the vehicle speed, thereby improving the driving safety at tunnel entrances and exits.

[0005] In order to achieve the above-mentioned purpose, the basic scheme of the present invention is as follows: a method for calculating the driving sight distance of a tunnel entrance and exit based on image brightness extraction, comprising the following steps: obtaining an initial image of the tunnel entrance and exit, filtering the initial image to obtain a target image, wherein the initial image is composed of a number of pixels; extracting the three primary color components of the target image, and calculating the pixel brightness according to the three primary color components; setting a calculation area in the target image, adopting a constant interval pixel calculation method, obtaining the arithmetic mean of the pixels in the calculation area, and filtering out the target pixels in the calculation area according to the arithmetic mean; calculating and obtaining the brightness of the target image based on the pixel brightness of the target pixel; respectively obtaining the historical brightness values ​​and the corresponding driving sight distances of the tunnel entrance and exit, analyzing the historical brightness values ​​and the corresponding driving sight distances through a regression model, and obtaining a correlation model between the brightness values ​​and the driving sight distances of the tunnel entrance and exit; judging whether the vehicle is in the tunnel entrance section or the tunnel exit section according to the target image, and inputting the brightness of the target image into the corresponding correlation model to obtain the driving sight distance of the vehicle at the tunnel exit or the tunnel entrance.

[0006] In one embodiment, a median filtering algorithm is used to grayscale the pixels of the initial image, and the original pixels are replaced by the median of the grayscale values ​​of each point in the neighborhood of the pixel to obtain a target image.

[0007] In one embodiment, the median filtering algorithm is used to grayscale the pixels of the initial image, and replace them with the median of the grayscale values ​​of each point in the neighborhood of the pixel point to obtain the target image, which specifically includes: dividing the pixels in the initial image and the points surrounding the neighborhood into 3*3 pixel blocks; using a two-dimensional sliding template to traverse all the pixels in the divided blocks; sorting all the pixels in the divided blocks according to the size of the pixel values ​​to generate a monotonically increasing or monotonically decreasing two-dimensional data sequence, replacing the original pixels with the median of the sorted pixel values ​​to obtain the target image.

[0008] In one embodiment, the extracting of the three primary color components of the target image and calculating the pixel brightness according to the three primary color components specifically includes: converting the three primary color vector value domain in the target image into a unit vector value domain, where each pixel has three components, representing the red, blue, and green brightness values ​​of the pixel color, respectively, and the brightness value is limited within the unit vector value domain; calculating and obtaining the pixel brightness according to the red, blue, and green brightness values ​​after the pixel is converted, and the formula is:

[0009] L=0.299R+0.587G+0.114B

[0010] Wherein, R represents the brightness value of red, G represents the brightness value of green, and B represents the brightness value of blue.

[0011] In one embodiment, the calculation area is set in the target image, a constant interval pixel calculation method is used to obtain the arithmetic mean of the pixels in the calculation area, and the target pixel in the calculation area is screened out according to the arithmetic mean, which specifically includes: setting the size of the calculation area in the target image; using a constant interval pixel calculation method with an interval of two rows and two columns, segmenting and selecting the pixels in the calculation area, and obtaining the target pixel, and the calculation formula is:

[0012]

[0013] In the formula, T(x i ,y j ) indicates the image brightness element at the corresponding pixel (x i ,y j ), y t Indicates the y value of the upper edge of the extraction area, y b Indicates the y value of the lower edge of the extraction area, x l Indicates the x value of the left edge of the extraction area, xr represents the x value of the right edge of the extraction area, INT[] represents rounding the formula in the brackets, and T is the arithmetic mean of the image brightness elements of the extraction area; according to the arithmetic mean, the corresponding target pixels are screened out in the calculation area of ​​the target image.

[0014] In one embodiment, the target image brightness is calculated based on the pixel brightness of the target pixel, specifically including: obtaining all target pixels in the calculation area, and obtaining the corresponding pixel brightness according to the target pixel; calculating the average brightness of the pixel brightness corresponding to all target pixels, obtaining the brightness average, and using the brightness average as the target image brightness.

[0015] In one embodiment, the historical brightness values ​​and corresponding driving sight distances of the tunnel entrance and exit are respectively obtained, and the historical brightness values ​​and the corresponding driving sight distances are analyzed through a regression model to obtain a correlation model between the brightness values ​​of the tunnel entrance and exit and the driving sight distance, specifically including: respectively obtaining the historical brightness values ​​and corresponding driving sight distances of the tunnel exit section and the tunnel entrance section; performing regression calculations based on the historical brightness values ​​and corresponding driving sight distances of the tunnel entrance section and the tunnel exit section using univariate linear regression, bivariate polynomial regression, ternary polynomial regression, composite regression and exponential regression models to obtain calculation results; based on the calculation results, using the fitting coefficient represented by the ratio of the regression sum of squares of the driving sight distance variable to the total deviation sum of squares and the Pearson correlation coefficient to compare the regression models, and selecting the optimal regression models of the tunnel exit section and the tunnel entrance section respectively; obtaining the tunnel exit correlation model and the tunnel entrance correlation model based on the optimal regression models of the tunnel exit section and the tunnel entrance section.

[0016] In one embodiment, judging whether the vehicle is in a tunnel entrance section or a tunnel exit section according to the target image, and inputting the target image brightness into a corresponding correlation model to obtain the vehicle driving sight distance at the tunnel exit or the tunnel entrance, specifically includes: judging whether the vehicle is in a tunnel entrance section or a tunnel exit section according to the target image; if the vehicle is in the tunnel entrance section, inputting the target image brightness into the tunnel entrance correlation model to obtain the vehicle driving sight distance at the tunnel entrance; if the vehicle is in the tunnel exit section, inputting the target image brightness into the tunnel exit correlation model to obtain the vehicle driving sight distance at the tunnel exit.

[0017] Compared with the prior art, the advantages and beneficial effects of the present invention are: there is no need to stop in the tunnel or close the traffic for measurement, and only the driving recorder video can be used to obtain the initial image of the tunnel entrance and exit, and filter the image to obtain the target image, extract the three primary color components of the target image, and calculate the pixel brightness; set the calculation area in the target area, adopt the constant interval pixel calculation method, obtain the arithmetic mean of the pixels in the calculation area, and filter the target pixels in the calculation area according to the arithmetic mean; based on the pixel brightness of the target pixel, calculate the target image brightness, respectively obtain the historical brightness value of the tunnel entrance and exit and the corresponding driving sight distance, perform regression calculation through the regression model, and obtain the correlation model of the brightness value of the tunnel entrance and exit and the driving sight distance; judge whether the vehicle is in the tunnel entrance section or the tunnel exit section according to the target image, and input the target image brightness into the corresponding correlation model to obtain the vehicle driving sight distance at the tunnel exit or the tunnel entrance, so as to realize the measurement and calculation of the driving sight distance of the tunnel entrance and exit, so that the driver can reasonably control the vehicle speed according to the driving sight distance, thereby improving the driving safety of the tunnel entrance and exit. BRIEF DESCRIPTION OF THE DRAWINGS

[0018] Figure 1 It is a flowchart of a method for calculating the sight distance of a tunnel entrance and exit based on image brightness extraction in one embodiment;

[0019] Figure 2 This is the effect diagram of using maximum filter and minimum filter to filter the initial image with salt and pepper noise;

[0020] Figure 3 This is the effect diagram of using median filtering and mean filtering to filter the initial image with salt and pepper noise;

[0021] Figure 4 Schematic diagram of segmenting the target image using constant interval pixels. DETAILED DESCRIPTION

[0022] In order to make the present invention more clear, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0023] like Figure 1 As shown, a method for calculating the tunnel entrance and exit sight distance based on image brightness extraction is provided, including:

[0024] Step S101, obtaining an initial image of a tunnel entrance and exit, and performing filtering processing on the initial image to obtain a target image.

[0025] Specifically, the initial image of the vehicle at the entrance and exit of the tunnel is collected by the driving recorder. Since there may be interference or transmission errors when obtaining the initial image, resulting in noise in the initial image, in order to obtain a better image effect, it is necessary to filter the initial image and obtain the filtered target image, so as to obtain more accurate image information based on the target image.

[0026] Among them, the median filtering algorithm is used to grayscale the pixels of the initial image, and the median of the grayscale values ​​of each point in the neighborhood of the pixel point is used to replace the original pixel point to obtain the target image.

[0027] Specifically, Figure 2 and Figure 3 As shown in the figure, after comparing and analyzing the maximum filter, minimum filter, mean filter and median filter, it can be found that the median filter has a better noise reduction effect when performing noise processing. Therefore, when filtering the initial image, the median filter algorithm is used to process the initial image. By graying the pixels in the initial image and replacing the original pixels with the median of the gray values ​​of each point in the neighborhood of the pixel point, the pixel value of the neighborhood is closer to the true value, thereby eliminating isolated noise points and obtaining a clearer target image.

[0028] Among them, the median filtering algorithm is used to process the initial image to obtain the target image, which specifically includes: the pixel points in the initial image and the surrounding points in the neighborhood are divided into 3*3 pixel blocks; a two-dimensional sliding template method is used to traverse all the pixel points in the divided block; all the pixel points in the divided block are sorted according to the pixel value size to generate a monotonically increasing or monotonically decreasing two-dimensional data sequence, and the original pixel points are replaced by the median of the sorted pixel value to obtain the target image.

[0029] Specifically, when performing median filtering, the pixels in the initial image and the points surrounding the neighborhood are first divided into 3*3 pixel blocks, and all the pixels in the divided blocks are traversed through a two-dimensional sliding template method, and all the pixels in the divided blocks are sorted according to the pixel value size to generate a monotonically increasing or monotonically decreasing two-dimensional data sequence, and the original pixels are replaced by the median of the sorted pixel values. After the original pixels of all divided blocks are replaced with the median pixel value, the filtering processing of the initial image is realized to obtain a clearer target image.

[0030] Step S102, extracting the three primary color components of the target image, and calculating the brightness of the pixel points according to the three primary color components.

[0031] Specifically, the acquired target image is an RGB image. Therefore, when calculating the brightness of a pixel, the three primary color components of the target image may be extracted and the brightness of the pixel may be calculated using the three primary color components.

[0032] Among them, the pixel brightness is calculated according to the three primary color components, specifically including: converting the three primary color vector value range in the target image into the unit vector value range, each pixel has three components, representing the red, blue and green brightness values ​​of the pixel color, and the brightness value is limited to the unit vector; according to the red, blue and green brightness values ​​of the pixel after conversion, the pixel brightness is calculated and obtained, and the formula is:

[0033] L=0.299R+0.587G+0.114B

[0034] Wherein, R represents the brightness value of red, G represents the brightness value of green, and B represents the brightness value of blue.

[0035] Specifically, when calculating the brightness of pixels, the RGB three primary color vector value range is converted from [0, 255] to the unit vector value range [0, 1]. Since each pixel has three components, which are used to represent the red, blue and green color of the pixel, and the brightness value is limited to [0, 1], the pixel brightness can be calculated based on the extracted unit vector value to obtain the pixel brightness of all pixels in the target image.

[0036] Step S103, setting a calculation area in the target image, using a constant interval pixel calculation method to obtain the arithmetic mean of the pixels in the calculation area, and filtering out the target pixels in the calculation area according to the arithmetic mean.

[0037] Specifically, through the tunnel entrance and exit, a calculation area is set in the target image, and a constant interval pixel calculation method is used to obtain the arithmetic mean of all pixels in the calculation area. Then, the pixel points in the calculation area are screened according to the arithmetic mean, and valid target pixels are extracted to achieve pixel simplification, which is convenient for subsequent calculations.

[0038] The size of the calculation area is set in the target image; a constant interval pixel calculation method with two rows and two columns is used to segment and select the pixels in the calculation area to obtain the target pixels. The formula is:

[0039]

[0040] In the formula, T(x i ,y j ) indicates the image brightness element at the corresponding pixel (x i ,y j ), y t Indicates the y value of the upper edge of the extraction area, y bIndicates the y value of the lower edge of the extraction area, x l Indicates the x value of the left edge of the extraction area, x r Represents the x value of the right edge of the extraction area, INT[] represents rounding the formula in the brackets, and T is the arithmetic mean of the image brightness elements of the extraction area; based on the arithmetic mean, the corresponding target pixels are screened out in the calculation area of ​​the target image.

[0041] Specifically, the size T of the calculation area is set in the target image. Considering the calculation accuracy and calculation speed factors, the pixels in the calculation area are segmented by two rows and two columns. The segmentation example is as follows: Figure 4 As shown in the figure, the black ones represent the target pixels to be extracted, and the white ones are useless pixels that do not participate in the calculation. The arithmetic mean of the image brightness elements in the calculation area is calculated based on the segmentation results, and based on the arithmetic mean, the pixels in the calculation area that are greater than the arithmetic mean are screened out to obtain the target pixels.

[0042] Step S104: Calculate and obtain the target image brightness based on the pixel brightness of the target pixel.

[0043] Specifically, according to the screened target pixels, the corresponding pixel brightness is obtained, and according to the brightness of all pixels in the calculation area, the target image brightness is calculated, so that the correlation between the target image brightness and the driving sight distance can be analyzed.

[0044] Among them, all target pixels in the calculation area are obtained, and the corresponding pixel brightness is obtained according to the target pixels; the average brightness of the pixel points corresponding to all target pixels is calculated, the brightness average is obtained, and the brightness average is used as the target image brightness.

[0045] Specifically, all target pixels in the calculation area are obtained, the brightness of the corresponding pixel points is obtained according to the target pixels, the average brightness of the corresponding pixel points of all target pixels is calculated, the brightness average is obtained, and the brightness average is used as the target image brightness, so as to analyze the correlation between the target image brightness and the driving sight distance according to the target image brightness.

[0046] Step S105, respectively obtain the historical brightness values ​​and the corresponding driving sight distances of the tunnel entrances and exits, analyze the historical brightness values ​​and the corresponding driving sight distances through a regression model, and obtain a correlation model between the brightness values ​​of the tunnel entrances and exits and the driving sight distances.

[0047] Specifically, the historical brightness values ​​and corresponding driving sight distances of the tunnel entrances and exits are obtained from the database, and based on the extracted historical brightness values, multiple regression models, such as univariate linear regression, binary polynomial regression, ternary polynomial regression, composite regression, exponential regression model, etc. are used to perform regression calculations, and the correlation between the brightness value and the driving sight distance is analyzed. The fitting coefficient and Pearson correlation coefficient are used to screen out the optimal regression model, and based on the optimal regression model, the correlation model between the brightness value of the tunnel entrance and exit and the driving sight distance is obtained.

[0048] Among them, when obtaining the correlation model, it specifically includes: obtaining the historical brightness values ​​and corresponding driving sight distances of the tunnel exit section and the tunnel entrance section respectively; according to the historical brightness values ​​and corresponding driving sight distances of the tunnel entrance section and the tunnel exit section, using univariate linear regression, bivariate polynomial regression, ternary polynomial regression, composite regression and exponential regression models to perform regression calculations to obtain calculation results; according to the calculation results, using the fitting coefficient represented by the ratio of the regression sum of squares of the driving sight distance variable to the total deviation sum of squares and the Pearson correlation coefficient, the regression models are compared, and the optimal regression models of the tunnel exit section and the tunnel entrance section are selected respectively; according to the optimal regression models of the tunnel exit section and the tunnel entrance section, the tunnel exit correlation model and the tunnel entrance correlation model are obtained.

[0049] Specifically, the historical brightness values ​​of the tunnel exit section and the tunnel entrance section and the corresponding driving sight distances are obtained in the database respectively, and multiple regression models are used to perform regression calculations according to the historical brightness values ​​of the tunnel entrance section and the corresponding driving sight distances to obtain calculation results, and the regression models are compared through the ratio of the regression sum of squares of the driving sight distance variables to the total deviation sum of squares, and the Pearson correlation coefficient to obtain the optimal regression model of the tunnel entrance section; similarly, the optimal regression model of the tunnel exit section is obtained; according to the optimal regression models of the tunnel exit section and the tunnel entrance section, the tunnel exit correlation model and the tunnel entrance correlation model are obtained, so that the corresponding driving sight distance can be obtained through the brightness value and the correlation model, so that the driver can reasonably control the driving speed and improve the safety of the tunnel entrance and exit.

[0050] Among them, the ratio of the regression sum of squares of the driving sight distance variable to the total sum of squares of the deviations is:

[0051]

[0052] The calculation formula of Pearson correlation coefficient is:

[0053]

[0054] Specifically, R 2Usually it is in [0, 1], the closer to 1, the better the fitting effect; r is used to measure the correlation between two sides. When it is closer to 1 or -1, it means that the linear relationship between the two variables is more obvious. When it is closer to 0, it means that there is almost no linear relationship between the two variables. When it is equal to 0, it means that there is no linear relationship between the two variables. Therefore, when screening the optimal regression model, it is necessary to screen out R 2 The regression model with y closest to 1 and r closest to 1 or -1.

[0055] Step S106, judging whether the vehicle is in the tunnel entrance section or the tunnel exit section according to the target image, and inputting the brightness of the target image into the corresponding correlation model to obtain the vehicle driving sight distance at the tunnel exit or the tunnel entrance.

[0056] Specifically, before obtaining the vehicle driving sight distance, it is necessary to determine whether the vehicle is in the tunnel entrance section or the tunnel exit section based on the target image. The judgment can be made based on the brightness relationship between the vehicle position in the target image and the tunnel entrance and exit. Obviously, the brightness of the vehicle position in the tunnel entrance section is higher than the brightness at the tunnel entrance. Conversely, the brightness of the vehicle position in the tunnel exit section is lower than the brightness at the tunnel exit. According to whether the vehicle is in the tunnel exit section or the tunnel entrance section, the target image brightness is input into the corresponding correlation model to obtain the vehicle driving sight distance at the tunnel exit or the tunnel entrance, so that the driver can control the driving speed according to the vehicle driving sight distance and improve the safety at the tunnel entrance and exit.

[0057] Among them, according to the brightness of the target image, the vehicle driving sight distance at the tunnel exit or the tunnel entrance is obtained, specifically including: judging whether the vehicle is in the tunnel entrance section or the tunnel exit section according to the target image; if the vehicle is in the tunnel entrance section, inputting the target image brightness into the tunnel entrance correlation model to obtain the vehicle driving sight distance at the tunnel entrance; if the vehicle is in the tunnel exit section, inputting the target image brightness into the tunnel exit correlation model to obtain the vehicle driving sight distance at the tunnel exit.

[0058] Specifically, it is determined whether the vehicle is in the tunnel entrance section or the tunnel exit section according to the target image. When the vehicle is in the tunnel entrance section, the target image brightness is input into the tunnel entrance correlation model to obtain the vehicle driving sight distance at the tunnel entrance; when the vehicle is in the tunnel entrance section, the target image brightness is input into the tunnel exit correlation model to obtain the vehicle driving sight distance at the tunnel exit, so as to facilitate the driver to control the driving speed and improve the driving safety at the tunnel entrance and exit.

[0059] In this embodiment, an initial image of the tunnel entrance and exit is obtained and filtered to obtain a target image, the three primary color components of the target image are extracted, and the pixel brightness is calculated; a calculation area is set in the target area, a constant interval pixel calculation method is used to obtain the arithmetic mean of the pixels in the calculation area, and the target pixels in the calculation area are screened out according to the arithmetic mean; based on the pixel brightness of the target pixel, the target image brightness is calculated, the historical brightness value and the corresponding driving sight distance of the tunnel entrance and exit are respectively obtained, and regression calculation is performed through a regression model to obtain a correlation model between the brightness value of the tunnel entrance and exit and the driving sight distance; according to the target image, it is determined whether the vehicle is in the tunnel entrance section or the tunnel exit section, and the target image brightness is input into the corresponding correlation model to obtain the vehicle driving sight distance at the tunnel exit or the tunnel entrance, thereby realizing the measurement and calculation of the driving sight distance at the tunnel entrance and exit, so that the driver can reasonably control the vehicle speed according to the driving sight distance, thereby improving the driving safety at the tunnel entrance and exit.

[0060] It should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants 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.

[0061] The above is only an embodiment of the present invention. The common sense such as the known specific structure and characteristics in the scheme is not described in detail here. The ordinary technicians in the relevant field know all the common technical knowledge in the technical field of the invention before the application date or priority date, can know all the existing technologies in the field, and have the ability to apply the conventional experimental means before that date. The ordinary technicians in the relevant field can improve and implement this scheme in combination with their own abilities under the enlightenment given by this application. Some typical known structures or known methods should not become obstacles for ordinary technicians in the relevant field to implement this application. It should be pointed out that for those skilled in the art, without departing from the structure of the present invention, several deformations and improvements can be made, which should also be regarded as the protection scope of the present invention, which will not affect the effect of the implementation of the present invention and the practicality of the patent. The protection scope required by this application shall be based on the content of its claims, and the specific implementation methods and other records in the specification can be used to interpret the content of the claims.

Claims

1. A method for calculating the sight distance of a tunnel entrance and exit based on image brightness extraction, characterized in that: The following steps are involved: Acquire an initial image of the tunnel entrance and exit, and perform filtering on the initial image to obtain a target image, wherein the initial image is composed of a number of pixel points; Extracting the three primary color components of the target image, and calculating the brightness of the pixel points according to the three primary color components; A calculation area is set in the target image, a constant interval pixel calculation method is used to obtain an arithmetic mean of pixels in the calculation area, and target pixels in the calculation area are screened out according to the arithmetic mean; Based on the pixel brightness of the target pixel, the brightness of the target image is calculated and obtained; The historical brightness values ​​and the corresponding driving sight distances of the tunnel entrances and exits are respectively obtained, and the historical brightness values ​​and the corresponding driving sight distances are analyzed through a regression model to obtain a correlation model between the brightness values ​​of the tunnel entrances and exits and the driving sight distances; It is determined whether the vehicle is in a tunnel entrance section or a tunnel exit section according to the target image, and the brightness of the target image is input into a corresponding correlation model to obtain the vehicle driving sight distance at the tunnel exit or the tunnel entrance.

2. According to the method for calculating the tunnel entrance and exit sight distance based on image brightness extraction according to claim 1, it is characterized in that: The median filtering algorithm is used to grayscale the pixels of the initial image, and the original pixels are replaced by the median of the grayscale values ​​of each point in the neighborhood of the pixel to obtain the target image.

3. The method for calculating the tunnel entrance and exit sight distance based on image brightness extraction according to claim 2 is characterized in that: The median filtering algorithm is used to grayscale the pixels of the initial image and replace them with the median of the grayscale values ​​of each point in the neighborhood of the pixel to obtain the target image, which specifically includes: The pixel points in the initial image and the neighboring points are divided into 3*3 pixel blocks; Using a two-dimensional sliding template method, traverse all pixel points within the divided plate; All the pixel points in the divided plate are sorted according to the size of the pixel values ​​to generate a monotonically increasing or monotonically decreasing two-dimensional data sequence, and the original pixel points are replaced with the median of the sorted pixel values ​​to obtain the target image.

4. The method for calculating the tunnel entrance and exit sight distance based on image brightness extraction according to claim 1 is characterized in that: The extracting the three primary color components of the target image and calculating the pixel brightness according to the three primary color components specifically includes: Convert the three primary color vector value domain in the target image into a unit vector value domain, where each pixel has three components, representing the red, blue and green brightness values ​​of the pixel color respectively, and the brightness value is limited within the unit vector value domain; According to the brightness values ​​of red, blue and green after pixel conversion, the brightness of the pixel is calculated and obtained. The formula is: L=0.299R+0.587G+0.114B Wherein, R represents the brightness value of red, G represents the brightness value of green, and B represents the brightness value of blue.

5. The method for calculating the tunnel entrance and exit sight distance based on image brightness extraction according to claim 1, characterized in that: The step of setting a calculation area in the target image, using a constant interval pixel calculation method to obtain an arithmetic mean of pixels in the calculation area, and filtering out target pixels in the calculation area according to the arithmetic mean specifically includes: Setting the size of the calculation area in the target image; The constant interval pixel calculation method with two rows and two columns is used to segment and select the pixels in the calculation area to obtain the target pixel. The calculation formula is: In the formula, T(x i ,y j ) indicates the image brightness element at the corresponding pixel point (x i ,y j ), y t Indicates the y value of the upper edge of the extraction area, y b Indicates the y value of the lower edge of the extraction area, x l Indicates the x value of the left edge of the extraction area, x r Indicates the x value of the right edge of the extraction area, INT[] indicates rounding the formula in the brackets, and T is the arithmetic mean of the image brightness elements of the extraction area; According to the arithmetic mean, corresponding target pixels are screened out in the calculation area of ​​the target image.

6. The method for calculating the tunnel entrance and exit sight distance based on image brightness extraction according to claim 1, characterized in that: The step of calculating and acquiring the target image brightness based on the pixel brightness of the target pixel specifically includes: Obtain all target pixels in the calculation area, and obtain the corresponding pixel brightness according to the target pixels; Calculate the average brightness of all pixel points corresponding to the target pixels, obtain the average brightness, and use the average brightness as the target image brightness.

7. The method for calculating the tunnel entrance and exit sight distance based on image brightness extraction according to claim 1, characterized in that: The method of respectively obtaining historical brightness values ​​and corresponding driving sight distances of tunnel entrances and exits, analyzing the historical brightness values ​​and corresponding driving sight distances through a regression model, and obtaining a correlation model between the brightness values ​​of tunnel entrances and exits and the driving sight distances specifically includes: Obtain the historical brightness values ​​and corresponding driving sight distances of the tunnel exit section and the tunnel entrance section respectively; According to the historical brightness values ​​and corresponding driving sight distances of the tunnel entrance and tunnel exit sections, regression calculations are performed using univariate linear regression, bivariate polynomial regression, ternary polynomial regression, composite regression and exponential regression models to obtain calculation results; According to the calculation results, the regression models are compared using the fitting coefficient represented by the ratio of the regression sum of squares of the driving sight distance variable to the total deviation sum of squares, and the Pearson correlation coefficient, and the optimal regression models of the tunnel exit section and the tunnel entrance section are selected respectively; According to the optimal regression models of the tunnel exit section and the tunnel entrance section, a tunnel exit correlation model and a tunnel entrance correlation model are obtained.

8. The method for calculating the tunnel entrance and exit sight distance based on image brightness extraction according to claim 7, characterized in that: The step of determining, according to the target image, whether the vehicle is in a tunnel entrance section or a tunnel exit section, and inputting the brightness of the target image into a corresponding correlation model to obtain the vehicle driving sight distance at the tunnel exit or the tunnel entrance specifically includes: Determining, according to the target image, whether the vehicle is at a tunnel entrance section or a tunnel exit section; If the vehicle is at the tunnel entrance, the target image brightness is input into the tunnel entrance correlation model to obtain the vehicle driving sight distance at the tunnel entrance; If the vehicle is at the tunnel exit section, the target image brightness is input into the tunnel exit correlation model to obtain the vehicle driving sight distance at the tunnel exit.