A visibility detection method based on image grayscale comparison of light of different wavelengths
Through the image grayscale comparison method based on different wavelengths of light, the atmospheric extinction coefficient vector is calculated to achieve visibility detection, which solves the problem of poor detection accuracy and effect in the prior art, and realizes efficient and accurate visibility monitoring along the expressway.
Patent Information
- Application Number
- CN202411769951.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-04
- Publication Date
- 2025-03-04
- Estimated Expiration
- 2044-12-04
AI Technical Summary
The existing visibility detection methods are not ideal in terms of detection accuracy and effectiveness, and it is difficult to achieve efficient monitoring of full coverage along the expressway.
A visibility detection method based on different wavelengths of light is used to compare the image grayscale. By constructing a standard grayscale data set of standard target objects, real-time grayscale images are obtained in the environment to be tested, the atmospheric extinction coefficient vectors of each luminous wavelength are calculated, and the visibility detection results are finally calculated.
It realizes high-precision monitoring of visibility, can timely and accurately judge the fog situation on the expressway, provides a large-scale, timely and accurate perception of visibility, and supports refined traffic management.
Smart Images

Figure CN119228808B_ABST
Abstract
Description
Technical Field
[0001] The invention relates to the field of image analysis, in particular to a visibility detection method based on image grayscale comparison of lights of different wavelengths. Background Art
[0002] Heavy fog (fog clusters) is known as the "mobile killer" of highways. Traffic accidents and casualties caused by heavy fog (fog clusters) are common every year. At present, the collection of fog information on highways mostly relies on police patrols or road company patrols. Due to the wide distribution range and large spatial span of highway routes, the uneven distribution of visibility in each section and its strong mutation, it is difficult to timely and comprehensively grasp the local fog information of all sections.
[0003] Visibility is an indicator of atmospheric transparency. According to Short-term Weather Forecast (GB / T 21984-2017), definition 2.19: During the day, it refers to the maximum horizontal distance at which a target object (black, moderate in size) can be seen or identified from the sky background by a person with normal vision (contrast threshold of 0.05) under the prevailing weather conditions; at night, it refers to the maximum horizontal distance at which a medium-intensity luminous body can be seen and identified. Visibility is the most important indicator for highway traffic safety control in foggy weather. At present, my country generally adopts a visibility classification control strategy to achieve foggy highway management. According to Traffic Safety Control Conditions for Highways in Foggy Weather (GB / T 31445-2015), the traffic control level is four, and the corresponding visibility is level four (100m≤visibility<200m), level three (50m≤visibility<100m), level two (30m≤visibility<50m), and level one (visibility<30m).
[0004] However, in actual traffic control, it is often based solely on on-site judgment with the naked eye, which lacks scientific basis. The technologies currently used in common visibility meters include: LiDAR visibility meter: Uses LiDAR technology to measure air visibility. This instrument measures scattering and absorption in the atmosphere by emitting lasers and receiving their returned signals to calculate visibility. Scattering visibility meter: This type of instrument estimates the meteorological optical range (MOR) by measuring the scattering coefficient. The attenuation of light in the atmosphere is mainly caused by scattering. The scattering visibility meter directly measures the intensity of scattered light from a small sampling volume and estimates visibility by calculating the scattering coefficient. Transmitometer: The transmissometer works based on the principle of light transmission in the atmosphere. It emits a light beam and measures the intensity of light after transmission through the atmosphere, and uses the measurement of transmittance to calculate the extinction coefficient to estimate visibility.
[0005] However, the existing visibility level detection has a high cost to achieve full coverage along the highway, and the detection accuracy and effect are not ideal in later use. Therefore, a visibility detection method with higher detection accuracy and effect is needed nowadays. Summary of the invention
[0006] The purpose of the present invention is to overcome the problems in the prior art that the detection accuracy and effect are not ideal, and to provide a visibility detection method based on image grayscale comparison of light of different wavelengths.
[0007] In order to achieve the above-mentioned object of the invention, the present invention provides the following technical solutions:
[0008] A visibility detection method based on image grayscale comparison of light of different wavelengths comprises the following steps:
[0009] S1: constructing a standard grayscale data set of a standard target object in a laboratory environment; the surface of the standard target object includes a plurality of squares with different luminous wavelengths;
[0010] S2: Acquire a real-time grayscale image of the standard target object in the test environment;
[0011] S3: Calculating the atmospheric extinction coefficient vector of each luminous wavelength of the standard target under the test environment according to the real-time grayscale image and the standard grayscale data set;
[0012] S4: Calculate the visibility detection result of the test environment according to the atmospheric extinction coefficient vector.
[0013] As a preferred embodiment of the present invention, S1 comprises the following steps:
[0014] S11: photographing a standard target object in a laboratory environment to obtain a number of grayscale images;
[0015] S12: Calculate the initial grayscale value of each square respectively;
[0016] S13: Calculate the initial brightness ratio and initial brightness product of each square according to the initial grayscale value of each square, and output the data as a standard grayscale data set of the standard target in a laboratory environment.
[0017] As a preferred solution of the present invention, the calculation of the initial grayscale value of each square in S12 includes:
[0018] Get the grayscale values of all pixels corresponding to the current square on different grayscale images, calculate the corresponding average grayscale value of the current square, and output it as the initial grayscale value.
[0019] As a preferred embodiment of the present invention, the calculation formulas for the initial brightness ratio and the initial brightness product in S13 are:
[0020] ,
[0021] ρM(i)=GS(i)×GS(i+1),
[0022] Among them, ρR(i) is the initial brightness ratio of square i; ρM(i) is the initial brightness product of square i, and GS(i) is the initial grayscale value of square i.
[0023] As a preferred embodiment of the present invention, S3 comprises the following steps:
[0024] S31: Calculate the average gray value GV(i) of each square respectively;
[0025] S32: Calculate the visible brightness ratio σR(i) and visible brightness product σM(i) of each square according to the average gray value GV(i) of each square; the expression is:
[0026] ,
[0027] σM(i)=GV(i)×GV(i+1),
[0028] S33: Calculate the atmospheric extinction coefficient μ(i) of the luminous wavelength corresponding to each square in the test environment;
[0029] S34: Output the atmospheric extinction coefficient vector μV of each luminous wavelength;
[0030] Where μV=(μ(1),μ(2),…,μ(i),…,μ(N)), where N is the number of squares.
[0031] As a preferred embodiment of the present invention, the expression of the atmospheric extinction coefficient μ(i) in S33 is:
[0032] ,
[0033] Wherein, D is the distance between the real-time grayscale image acquisition camera and the standard target object.
[0034] As a preferred embodiment of the present invention, S4 comprises the following steps:
[0035] S41: Obtain the standard vector μs(j) of the multi-wavelength atmospheric extinction coefficient of each wavelength under each visibility, 1≤j≤W, W is the visibility level number;
[0036] S42: Calculate the Euclidean distance E(j) between the atmospheric extinction coefficient vector μV and the multi-wavelength atmospheric extinction coefficient standard vector μs(j) at each visibility;
[0037] S43: Obtain the minimum value E(jmin) in the Euclidean distance E(j);
[0038] S44: Use the visibility corresponding to jmin as the visibility detection result VD.
[0039] As a preferred solution of the present invention, the S41 comprises the following steps:
[0040] S411: Select W different visibilities Cj;
[0041] S412: Under each visibility Cj, the standard value μs(i,j) of the atmospheric extinction coefficient corresponding to the luminous wavelength λi of each square in the standard target is tested respectively, and the standard vector μs(j) of the multi-wavelength atmospheric extinction coefficient under the visibility condition Cj is output; wherein, μs (j)=( μs (1,j), μs (2,j),…, m (i,j),…, μs ( N ,j));
[0042] S413: After all visibility Cj are tested, enter S42.
[0043] As a preferred solution of the present invention, the calculation formula of the Euclidean distance E(j) is:
[0044] .
[0045] A visibility detection device for image grayscale contrast based on light of different wavelengths, comprising at least one processor and a memory communicatively connected to the at least one processor; the memory stores instructions executable by the at least one processor, the instructions are executed by the at least one processor so that the at least one processor can execute any of the methods described above.
[0046] Compared with the prior art, the present invention has the following beneficial effects:
[0047] The present invention establishes a standard grayscale data set based on a standard target object including a number of squares with different luminous wavelengths, and then conducts a comprehensive analysis with the grayscale image collected under the test environment. By utilizing the principle that the atmospheric transmittance of light of different wavelengths is different, the grayscale value image is used to automatically adapt to the changes in natural environmental conditions and realize visibility monitoring, so as to timely and accurately judge the fog situation on the highway and provide a wide range, timely and accurate perception of visibility; furthermore, scientific support is provided for highway traffic management measures to realize refined management. BRIEF DESCRIPTION OF THE DRAWINGS
[0048] Figure 1 This is a flow chart of a visibility detection method based on image grayscale comparison of light of different wavelengths as described in Example 1 of the present invention;
[0049] Figure 2This is a structural schematic diagram of a visibility detection device for performing image grayscale comparison based on light of different wavelengths described in Example 3 of the present invention, which utilizes the visibility detection method for performing image grayscale comparison based on light of different wavelengths described in Example 1. DETAILED DESCRIPTION
[0050] A digital image is an image represented in the form of a two-dimensional digital group. Pixels (or picture elements, Pixel) are the basic elements of digital images. Pixels are obtained by discretizing continuous space when digitizing analog images. Each pixel of an image usually corresponds to a specific "position" in two-dimensional space, with integer row (height) and column (width) position coordinates.
[0051] Grayscale images are a type of digital image. The pixel values of grayscale images are grayscale values from the darkest black to the brightest white. Grayscale images are different from black and white images. Black and white images only have two colors, black and white, while grayscale images have many levels of color depth between black and white.
[0052] In industrial cameras, especially high-performance industrial cameras, there is a strong linear relationship between grayscale value and brightness. By analyzing the relationship between brightness and digital image grayscale, a CCD imaging brightness meter can be designed.
[0053] The present invention is further described in detail below in conjunction with test examples and specific implementation methods. However, this should not be understood as the scope of the above subject matter of the present invention being limited to the following embodiments, and all technologies realized based on the content of the present invention belong to the scope of the present invention.
[0054] Example 1
[0055] like Figure 1 As shown, a visibility detection method based on image grayscale comparison of light of different wavelengths includes the following steps:
[0056] S1: Construct a standard grayscale data set of a standard target object in a laboratory environment; the surface of the standard target object includes a plurality of squares with different luminous wavelengths.
[0057] S2: Acquire a real-time grayscale image of the standard target object in the test environment.
[0058] S3: Calculate the atmospheric extinction coefficient vector of each luminous wavelength of the standard target object in the test environment according to the real-time grayscale image and the standard grayscale data set.
[0059] S4: Calculate the visibility detection result of the test environment according to the atmospheric extinction coefficient vector.
[0060] Example 2
[0061] This embodiment is a specific implementation of the visibility detection method based on image grayscale comparison of light of different wavelengths described in Embodiment 1, comprising the following steps:
[0062] S1: Construct a standard grayscale data set of a standard target object in a laboratory environment; the surface of the standard target object includes a plurality of squares with different luminous wavelengths.
[0063] In this embodiment, the panel of the standard target object is divided into N rectangular grids in both vertical and horizontal directions. The surface luminescence wavelength of each rectangular grid (the luminescence wavelength of the i-th grid is denoted as i) is different.
[0064] S11: photographing a standard target object in a laboratory environment to obtain a number of grayscale images;
[0065] S12: Calculate the initial grayscale value of each square respectively; the calculation of the initial grayscale value of each square includes:
[0066] Get the grayscale values of all pixels corresponding to the current square on different grayscale images, calculate the corresponding average grayscale value of the current square, and output it as the initial grayscale value.
[0067] In a grayscale image, grayscale equals brightness, which is equal to the intensity of the image (the value of the pixel).
[0068] In industrial cameras, especially high-performance industrial cameras, there is a strong linear relationship between grayscale value and brightness. This is because these cameras are calibrated at the factory to ensure the accuracy of the measurement. By analyzing the relationship between brightness and digital image grayscale during CCD imaging, a CCD imaging brightness meter can be designed.
[0069] S13: Calculate the initial brightness ratio and initial brightness product of each square according to the initial grayscale value of each square, and output the data as a standard grayscale data set of the standard target in a laboratory environment.
[0070] The calculation formulas for the initial brightness ratio and the initial brightness product are:
[0071] ,
[0072] ρM(i)=GS(i)×GS(i+1),
[0073] Among them, ρR(i) is the initial brightness ratio of square i; ρM(i) is the initial brightness product of square i, and GS(i) is the initial grayscale value of square i.
[0074] S2: Acquire a real-time grayscale image of the standard target object in the test environment.
[0075] S3: Calculate the atmospheric extinction coefficient vector of each luminous wavelength of the standard target object in the test environment according to the real-time grayscale image and the standard grayscale data set.
[0076] S31: Calculate the average gray value GV(i) of each square respectively;
[0077] S32: Calculate the visible brightness ratio σR(i) and visible brightness product σM(i) of each square according to the average gray value GV(i) of each square; the expression is:
[0078] ,
[0079] σM(i)=GV(i)×GV(i+1),
[0080] S33: Calculate the atmospheric extinction coefficient μ(i) of the luminous wavelength corresponding to each square in the test environment;
[0081] The expression of the atmospheric extinction coefficient μ(i) is:
[0082] ,
[0083] Wherein, D is the distance between the real-time grayscale image acquisition camera and the standard target object.
[0084] S34: Output the atmospheric extinction coefficient vector μV of each luminous wavelength;
[0085] Where μV=(μ(1),μ(2),…,μ(i),…,μ(N)), where N is the number of squares.
[0086] Furthermore, the atmospheric extinction coefficient is that when light propagates in the atmosphere, it will be affected by the atmosphere and its energy (brightness) will decay. The attenuation of light brightness conforms to the following rules:
[0087] ,
[0088] Where Ls is the initial brightness of the light, D is the transmission distance, and Le is the brightness of the light after attenuation.
[0089] μ is the atmospheric extinction coefficient. It is not difficult to see that the atmospheric extinction coefficient is numerically equal to the reciprocal of the transmission distance when the light wave energy decays to 1 / e times.
[0090] Under the same atmospheric conditions, light of different wavelengths has different atmospheric extinction coefficients.
[0091] In this embodiment, the expression of the atmospheric extinction coefficient μ(i) is derived according to the above principle and the following process:
[0092] For the rectangular grid (1), let its original brightness be Ls1, and the atmospheric extinction coefficient of the grid color (wavelength) be μλ1. Then, at the camera end, the brightness of the rectangular grid becomes:
[0093] .
[0094] For the rectangular grid (2), let its original brightness be Ls2, and the atmospheric extinction coefficient of the grid color (wavelength) be μλ2. Then, at the camera end, the brightness of the rectangular grid becomes:
[0095] .
[0096] If there is a linear relationship between the brightness value and the grayscale value of the image, that is:
[0097] L=kG.
[0098] Where k is a linear ratio.
[0099] Then we have:
[0100] ,
[0101] , .
[0102] So we get:
[0103] ,
[0104] ,
[0105] ,
[0106] ,
[0107] ,
[0108] ,
[0109] .
[0110] S4: Calculate the visibility detection result of the test environment according to the atmospheric extinction coefficient vector.
[0111] S41: Obtain the standard vector μs(j) of the multi-wavelength atmospheric extinction coefficient of each wavelength under each visibility, 1≤j≤W, W is the visibility level number;
[0112] S411: Select W different visibilities Cj;
[0113] S412: Under each visibility Cj, the standard value μs(i,j) of the atmospheric extinction coefficient corresponding to the luminous wavelength λi of each square in the standard target is tested respectively, and the standard vector μs(j) of the multi-wavelength atmospheric extinction coefficient under the visibility condition Cj is output; wherein, μs (j)=( μs (1,j), μs (2,j),…, m (i,j),…, μs ( N ,j));
[0114] S413: After all visibility Cj are tested, enter S42.
[0115] S42: Calculate the Euclidean distance E(j) between the atmospheric extinction coefficient vector μV and the multi-wavelength atmospheric extinction coefficient standard vector μs(j) at each visibility;
[0116] S43: Obtain the minimum value E(jmin) in the Euclidean distance E(j);
[0117] The calculation formula of the Euclidean distance E(j) is:
[0118] .
[0119] S44: Use the visibility corresponding to jmin as the visibility detection result VD.
[0120] Example 3
[0121] like Figure 2 As shown, a visibility detection device based on image grayscale contrast of light of different wavelengths includes at least one processor, a memory connected to the at least one processor, and at least one input / output interface connected to the at least one processor; the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the visibility detection method based on image grayscale contrast of light of different wavelengths described in the above embodiment. The input / output interface may include a display, a keyboard, a mouse, and a USB interface for inputting and outputting data.
[0122] Those skilled in the art can understand that: all or part of the steps of implementing the above method embodiments can be completed by hardware related to program instructions, and the aforementioned program can be stored in a computer-readable storage medium. When the program is executed, it executes the steps of the above method embodiments; and the aforementioned storage medium includes: mobile storage devices, read-only memories (ROM), disks or optical disks, etc. Various media that can store program codes.
[0123] When the above-mentioned integrated unit of the present invention is implemented in the form of a software functional unit and sold or used as an independent product, it can also be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the embodiment of the present invention can be essentially or partly reflected in the form of a software product that contributes to the prior art. The computer software product is stored in a storage medium and includes several instructions for a computer device (which can be a personal computer, server, or network device, etc.) to execute all or part of the methods described in each embodiment of the present invention. The aforementioned storage medium includes: various media that can store program codes, such as mobile storage devices, ROMs, magnetic disks, or optical disks.
[0124] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions and improvements made within the spirit and principles of the present invention should be included in the protection scope of the present invention.
Claims
1. A visibility detection method based on image grayscale comparison using light of different wavelengths, characterized in that: The following steps are involved: S1: constructing a standard grayscale data set of a standard target object in a laboratory environment; the surface of the standard target object includes a plurality of squares with different luminous wavelengths; S2: Acquire a real-time grayscale image of the standard target object in the test environment; S3: Calculating the atmospheric extinction coefficient vector of each luminous wavelength of the standard target under the test environment according to the real-time grayscale image and the standard grayscale data set; S4: Calculating the visibility detection result of the environment to be tested according to the atmospheric extinction coefficient vector; The S3 comprises the following steps: S31: Calculate the average gray value GV(i) of each square respectively; S32: Calculate the visible brightness ratio σR(i) and visible brightness product σM(i) of each square according to the average gray value GV(i) of each square; the expression is: , σM(i)=GV(i)×GV(i+1), S33: Calculate the atmospheric extinction coefficient μ(i) of the luminous wavelength corresponding to each square in the test environment; the expression of the atmospheric extinction coefficient μ(i) is: , Wherein, D is the distance between the real-time grayscale image acquisition camera and the standard target object; S34: Output the atmospheric extinction coefficient vector μV of each luminous wavelength; Where, μV=(μ(1),μ(2),…,μ(i),…,μ(N)), N is the number of squares; The S4 comprises the following steps: S41: Obtain the standard vector μs(j) of the multi-wavelength atmospheric extinction coefficient of each wavelength under each visibility, 1≤j≤W, W is the visibility level number; S42: Calculate the Euclidean distance E(j) between the atmospheric extinction coefficient vector μV and the multi-wavelength atmospheric extinction coefficient standard vector μs(j) at each visibility; S43: Obtain the minimum value E(jmin) in the Euclidean distance E(j); S44: Use the visibility corresponding to jmin as the visibility detection result VD.
2. The visibility detection method based on image grayscale contrast of light of different wavelengths according to claim 1, characterized in that: The S1 comprises the following steps: S11: photographing a standard target object in a laboratory environment to obtain a number of grayscale images; S12: Calculate the initial grayscale value of each square respectively; S13: Calculate the initial brightness ratio and initial brightness product of each square according to the initial grayscale value of each square, and output the data as a standard grayscale data set of the standard target in a laboratory environment.
3. The visibility detection method based on image grayscale contrast of light of different wavelengths according to claim 2 is characterized in that: The calculation of the initial grayscale value of each square in S12 includes: Get the grayscale values of all pixels corresponding to the current square on different grayscale images, calculate the corresponding average grayscale value of the current square, and output it as the initial grayscale value.
4. The visibility detection method based on image grayscale contrast of light of different wavelengths according to claim 2 is characterized in that: The calculation formula of the initial brightness ratio and the initial brightness product in S13 is: , ρM(i)=GS(i)×GS(i+1), Among them, ρR(i) is the initial brightness ratio of square i; ρM(i) is the initial brightness product of square i, and GS(i) is the initial grayscale value of square i.
5. The visibility detection method based on image grayscale contrast of light of different wavelengths according to claim 1, characterized in that: The S41 comprises the following steps: S411: Select W different visibilities Cj; S412: Under each visibility Cj, the standard value μs(i,j) of the atmospheric extinction coefficient corresponding to the luminous wavelength λi of each square in the standard target is tested respectively, and the standard vector μs(j) of the multi-wavelength atmospheric extinction coefficient under the visibility condition Cj is output; wherein, μs (j)=( μs (1,j), μs (2,j),…, μ (i,j),…, μs ( N ,j)); S413: After all visibility Cj are tested, enter S42.
6. The visibility detection method based on image grayscale comparison of light of different wavelengths according to claim 5, characterized in that: The calculation formula of the Euclidean distance E(j) is: 。 7. A visibility detection device based on image grayscale comparison using light of different wavelengths, characterized in that: It includes at least one processor and a memory communicatively connected to the at least one processor; the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the method described in any one of claims 1 to 6.
Citation Information
Patent Citations
All-weather video measurement method for visibility
CN101957309A
Determination of atmospheric visibility in autonomous vehicle applications
CN115508851A