A method and system for detecting the visibility of a camera based on background modeling
Through the camera visibility detection method based on background modeling, the problem of low visibility detection accuracy in highway foggy weather in the prior art is solved, real-time, accurate and stable monitoring and alarm of highway visibility is achieved, and safe driving of the highway is ensured.
Patent Information
- Application Number
- CN202210045585.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-01-21
- Publication Date
- 2025-07-01
- Estimated Expiration
- 2042-01-21
AI Technical Summary
The existing technology is not robust when manually extracting foggy features through traditional image methods in highway foggy weather. Deep learning methods require large-scale sample annotation training and high computing resource consumption. Single-frame analysis ignores the video timing relationship, resulting in low detection accuracy.
The camera visibility detection method based on background modeling is adopted, and the image is collected through the video image acquisition module, and the video image preprocessing module is used to perform background modeling and image preprocessing. Then, the image visibility score statistics module is used to partition the image and score statistics, and visibility is detected based on the score and the results are output.
Real-time monitoring of highway visibility is realized, with fast detection speed, high accuracy and strong stability. It can automatically monitor alarms in real time, reduce manual intervention, and has the advantages of scene adaptability and rapid detection, ensuring safe driving on the highway.
Smart Images

Figure CN114418985B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of image processing, and in particular to a camera visibility detection method and system based on background modeling. Background Art
[0002] With the continuous and rapid development of my country's expressways, people are paying more and more attention to the traffic safety of expressways while enjoying the convenience brought by expressways. Bad weather is a key factor affecting the traffic safety of expressways. Heavy fog is one of the common meteorological disasters in my country, especially in autumn and winter, when heavy fog is more frequent. Due to the low visibility in foggy days, there is often no time to make correct handling when encountering emergencies. Therefore, the probability of traffic accidents in foggy days is several times higher than usual, or even dozens of times higher. Therefore, strengthening the safety control of foggy weather on expressways is an urgent need. However, the existing technology has the following problems: First, the traditional image method is used to manually extract foggy features, which is not robust enough and is sensitive to data with different distributions; Second, the deep learning method is used to detect visibility, which requires a large number of samples for manual annotation training, has a long iteration cycle, and consumes high GPU computing resources, which greatly increases the technical cost. Third, when analyzing foggy images, only a single frame is analyzed, and the video timing relationship is often ignored, resulting in low accuracy. Summary of the invention
[0003] In view of the above-mentioned shortcomings of the prior art, an object of the present invention is to provide a camera visibility detection method and system based on background modeling, so as to solve the problems existing in the prior art.
[0004] To achieve the above-mentioned object and other related objects, the present invention provides a camera visibility detection method based on background modeling, the method comprising the following steps:
[0005] The video image acquisition module is used to sequentially acquire images, and each acquired frame of the image is transmitted to the video image preprocessing module;
[0006] Performing image preprocessing on each frame of the collected image using a video image preprocessing module, wherein the preprocessing includes background modeling;
[0007] The image visibility score statistics module is used to partition the preprocessed image and count the score of each area; wherein the partitioning includes: directly cutting the entire image into m*n blocks according to the ratio of width to height; the score calculation process includes: calculating the pixel average value for each area, and performing a difference calculation between the pixel value of each area and the pixel average value, dividing the difference of each area by the number of pixels in each area, calculating the pixel change rate of each area, and using the calculated change rate as the score of each area;
[0008] Detect the visibility of the current camera according to the scores of each area, and output the corresponding detection results.
[0009] Optionally, the process of sequentially collecting images using the video image acquisition module includes:
[0010] Use the video image acquisition module to sequentially collect video streams;
[0011] Decode and frame the collected video stream to obtain each frame image corresponding to the video stream;
[0012] Transmit each frame image collected to the video image preprocessing module.
[0013] Optionally, the process of performing image preprocessing on each frame image collected using the video image preprocessing module includes:
[0014] Use the video image preprocessing module to receive each frame image transmitted by the video image acquisition module, and perform grayscale conversion and blurring on the received each frame image;
[0015] Extract edge information from the image after grayscale conversion and blurring to obtain edge features;
[0016] Perform background modeling based on the edge features to complete the preprocessing.
[0017] Optionally, the process of partitioning the preprocessed image and counting the scores of each area includes:
[0018] Obtain the preprocessed image;
[0019] Partition the preprocessed image;
[0020] Obtain the edge features of each area, and count the maximum value of the edge features of all partitions at different times;
[0021] Calculate the ratio of the feature value of each area to the corresponding maximum value, and count the scores of each area according to the ratio calculation result.
[0022] Optionally, the method further includes: updating the calculated ratio as the current feature value to the currently counted maximum value.
[0023] Optionally, the method further includes: comparing the output detection result with a preset threshold, and outputting an alarm message according to the comparison result.
[0024] The present invention also provides a camera visibility detection system based on background modeling, and the system includes the following steps:
[0025] The video image acquisition module is used to acquire images and transmit each frame of the acquired images to the video image preprocessing module;
[0026] The video image preprocessing module is used to perform image preprocessing on each frame of the acquired images, and the preprocessing includes background modeling;
[0027] The image visibility score statistics module is used to perform zoning processing on the preprocessed images and calculate the scores of each area; wherein, the zoning includes: directly cutting the whole image into m*n blocks according to the width and height ratio; the calculation process of the score includes: calculating the pixel average value for each area, calculating the difference between the pixel value of each area and the pixel average value, dividing the difference of each area by the number of pixel points in each area, calculating the pixel change rate of each area, and taking the calculated change rate as the score of each area;
[0028] The visibility logic processing module is used to detect the visibility of the current camera according to the scores of each area and output the corresponding detection results.
[0029] Optionally, the process of the video image acquisition module sequentially acquiring images includes:
[0030] Using the video image acquisition module to sequentially acquire video streams;
[0031] Decoding and frame splitting the acquired video streams to obtain each frame of image corresponding to the video streams;
[0032] Transmitting each frame of the acquired images to the video image preprocessing module.
[0033] Optionally, the process of the video image preprocessing module performing image preprocessing on each frame of the acquired images includes:
[0034] Using the video image preprocessing module to receive each frame of image transmitted by the video image acquisition module and performing grayscale conversion and blurring processing on the received each frame of image;
[0035] Extracting edge information from the images after grayscale conversion and blurring processing to obtain edge features;
[0036] Performing background modeling based on the edge features to complete the preprocessing.
[0037] Optionally, the process of the image visibility score statistics module performing zoning processing on the preprocessed images and calculating the scores of each area includes:
[0038] Obtaining the preprocessed images;
[0039] Performing zoning processing on the preprocessed images;
[0040] Obtain the edge features of each region, and count the maximum values of the edge features of all partitions at different times;
[0041] Calculate the ratio of the feature value of each region to the corresponding maximum value, and count the score of each region according to the ratio calculation result.
[0042] As described above, the present invention provides a method and system for detecting the visibility of a camera based on background modeling, which has the following beneficial effects:
[0043] The present invention uses a video image acquisition module to sequentially acquire images, and transmits each frame of the acquired image to a video image preprocessing module; uses the video image preprocessing module to perform image preprocessing on each frame of the acquired image, and the preprocessing includes background modeling; uses an image visibility score statistics module to perform partition processing on the preprocessed image and count the score of each region; detects the visibility of the current camera according to the score of each region and outputs the corresponding detection result. The present invention uses traditional image processing algorithms such as background modeling to monitor the visibility of highways in real time, achieving fast detection speed, high accuracy, and strong stability. The present invention extracts effective background information for visibility detection for highways in complex scenarios, greatly improving the accuracy and stability. For foggy weather on highways, the present invention can automatically monitor and alarm in real time, reduce manual intervention, and has the advantages of scene adaptability and fast detection. The present invention has the following advantages: First, fast speed, an ordinary computer can process each frame of image in real time. Second, high accuracy, using the background modeling method to remove the interference of the foreground, extract background information for analysis, and is not prone to false alarms. Third, good stability, good detection effect for foggy days in different scenarios, and strong anti-interference ability for motion blur caused by vehicles, etc. Fourth, it can quickly generate alarm information in foggy scenarios to ensure the safe driving of highways. Description of the Drawings
[0044] Figure 1 It is a schematic flowchart of a method for detecting the visibility of a camera based on background modeling provided by an embodiment;
[0045] Figure 2 It is a schematic hardware structure diagram of a system for detecting the visibility of a camera based on background modeling provided by an embodiment;
[0046] Figure 3 It is a schematic hardware structure diagram of a system for detecting the visibility of a camera based on background modeling provided by another embodiment. Detailed Embodiments
[0047] The following specific examples illustrate the implementation manners of the present invention. Those skilled in the art can easily understand other advantages and effects of the present invention from the content disclosed in this specification. The present invention can also be implemented or applied through other different specific implementation manners. Various details in this specification can also be modified or changed based on different viewpoints and applications without departing from the spirit of the present invention. It should be noted that, without conflict, the following embodiments and the features in the embodiments can be combined with each other.
[0048] It should be noted that the drawings provided in the following embodiments only schematically illustrate the basic concept of the present invention. Therefore, only the components related to the present invention are shown in the drawings, rather than being drawn according to the number, shape, and size of the components in actual implementation. The type, quantity, and ratio of each component in actual implementation can be arbitrarily changed, and the component layout type may also be more complex.
[0049] Please refer to Figure 1 As shown, the present invention provides a camera visibility detection method based on background modeling. The method includes the following steps:
[0050] S100, using a video image acquisition module to sequentially acquire images, and transmitting each frame of the acquired image to a video image preprocessing module;
[0051] S200, using the video image preprocessing module to perform image preprocessing on each frame of the acquired image, and the preprocessing includes background modeling;
[0052] S300, using an image visibility score statistics module to perform zoning processing on the preprocessed image, and statistically calculating the score of each area; wherein, the zoning includes: directly cutting the whole image into m*n blocks of areas according to the width and height ratio, and statistically calculating the score of each area; the score calculation method includes: calculating the pixel average value for each area, setting the average value as the reference value, and then calculating the difference between the pixel value of each area and the pixel average value, dividing the difference of each area by the number of pixel points in each area, calculating the pixel change rate of each area, and taking the calculated change rate as the score of each area;
[0053] S400, detecting the visibility of the current camera according to the score of each area, and outputting the corresponding detection result.
[0054] This method uses traditional image processing algorithms such as background modeling to monitor the visibility of highways in real time, achieving fast detection speed, high accuracy, and strong stability. This method extracts effective background information for visibility detection in complex highway scenarios, greatly improving the accuracy and stability. This method can automatically monitor and alarm in case of heavy fog on highways, reducing manual intervention, and has the advantages of scene adaptability and fast detection. This method has the following advantages: First, it is fast. An ordinary computer can process each frame of image in real time. Second, it has high accuracy. By using the background modeling method to remove the interference of the foreground and extract background information for analysis, false alarms are not easily generated. Third, it has good stability. It has good detection effects in foggy days under different scenarios and strong anti-interference ability for motion blur caused by vehicles, etc. Fourth, it can quickly generate alarm information in foggy scenarios to ensure the safe driving of highways.
[0055] In an exemplary embodiment, the process of sequentially collecting images by using the video image acquisition module includes: sequentially collecting a video stream by using the video image acquisition module; decoding and frame-dividing the collected video stream to obtain each frame of image corresponding to the video stream; and transmitting each frame of image collected to the video image preprocessing module.
[0056] According to the above description, in an exemplary embodiment, the process of performing image preprocessing on each frame of image collected by using the video image preprocessing module includes: receiving, by using the video image preprocessing module, each frame of image transmitted by the video image acquisition module, and performing grayscale conversion and blurring processing on the received each frame of image; extracting edge information from the image after grayscale conversion and blurring processing to obtain edge features; and performing background modeling based on the edge features to complete the preprocessing.
[0057] According to the above description, in an exemplary embodiment, the process of partitioning the preprocessed image and counting the score of each region includes: obtaining the preprocessed image; partitioning the preprocessed image; obtaining the edge features of each region, and counting the maximum value of the edge features of all partitions at different times; calculating the ratio of the feature value of each region to the corresponding maximum value, and counting the score of each region according to the ratio calculation result. This method further includes: updating the calculated ratio as the current feature value to the currently counted maximum value. This method further includes: comparing the output detection result with a preset threshold, and outputting an alarm message according to the comparison result.
[0058] In summary, the present invention provides a camera visibility detection method based on background modeling, and the specific steps are as follows:
[0059] (1) The video image acquisition module sequentially collects images, and sequentially sends each frame of image collected to the following modules for analysis.
[0060] (2) Video image preprocessing module, which performs image preprocessing operations such as background modeling on each frame of the collected pictures.
[0061] (3) Image visibility score statistics module, which statistically scores the preprocessed pictures in regions.
[0062] (4) Visibility logic processing module, which judges the visibility size according to the scores statistically obtained in each region.
[0063] (5) Detection result output module outputs the results obtained from the detection of video frames.
[0064] In summary, the present invention provides a method for detecting the visibility of a camera based on background modeling. By using traditional image processing algorithms such as background modeling, the visibility of highways is monitored in real time, achieving fast detection speed, high accuracy, and strong stability. This method extracts effective background information for visibility detection for highways in complex scenarios, greatly improving the accuracy and stability. For foggy weather on highways, this method can achieve automatic real-time monitoring and warning, reducing manual intervention, and has the advantages of scene adaptability and fast detection. This method has the following advantages: First, it is fast. An ordinary computer can process each frame of image in real time. Second, it has high accuracy. By using the background modeling method to remove the interference of the foreground and extract background information for analysis, false alarms are not easily generated. Third, it has good stability. It has good detection effects for foggy days in different scenarios and strong anti-interference ability for motion blur caused by vehicles, etc. Fourth, it can quickly generate warning information in foggy weather scenarios to ensure the safe driving of highways.
[0065] As Figure 2 shown, the present invention also provides a system for detecting the visibility of a camera based on background modeling. The system includes:
[0066] Video image acquisition module 101, which is used to acquire images and transmit each frame of the acquired images to the video image preprocessing module;
[0067] Video image preprocessing module 102, which is used to perform image preprocessing on each frame of the acquired images, and the preprocessing includes background modeling;
[0068] The image visibility score statistics module 103 is used to partition the preprocessed image and calculate the score of each region. Among them, the partitioning includes directly cutting the whole image into m*n regions according to the aspect ratio of width and height, and calculating the score of each region. The score calculation method includes calculating the pixel average value for each region, setting the average value as the reference value, then calculating the difference between the pixel value and the pixel average value for each region, dividing the difference of each region by the number of pixel points in each region, calculating the pixel change rate of each region, and taking the calculated change rate as the score of each region.
[0069] The visibility logic processing module 104 is used to detect the visibility of the current camera according to the score of each region.
[0070] The detection result output module 104 marks the visibility obtained by the visibility logic processing module 104 on the video frame, combines the video frames according to the time sequence, and outputs the final processing result.
[0071] This system uses traditional image processing algorithms such as background modeling to monitor the visibility of highways in real time, achieving fast detection speed, high accuracy, and strong stability. This system extracts effective background information for visibility detection for highways in complex scenarios, greatly improving the accuracy and stability. For foggy weather on highways, this system can automatically monitor and alarm in real time, reducing manual intervention, and has the advantages of scene adaptability and fast detection. This system has the following advantages: First, it is fast. An ordinary computer can process each frame of image in real time. Second, it has high accuracy. By using the background modeling method to remove the interference of the foreground and extract the background information for analysis, false alarms are not easily generated. Third, it has good stability. It has good detection effects for foggy days in different scenarios and strong anti-interference ability for motion blur caused by vehicles, etc. Fourth, it can quickly generate alarm information in foggy scenarios to ensure the safe driving of highways.
[0072] According to the above description, in an exemplary embodiment, the process of the video image acquisition module sequentially acquiring images includes: sequentially acquiring a video stream using the video image acquisition module; decoding and frame-dividing the acquired video stream to obtain each frame of image corresponding to the video stream; and transmitting each frame of image acquired to the video image preprocessing module.
[0073] According to the above description, in an exemplary embodiment, the process of the video image preprocessing module performing image preprocessing on each frame of the collected image includes: using the video image preprocessing module to receive each frame of the image transmitted by the video image acquisition module, and performing grayscale conversion and blurring on the received each frame of the image; extracting edge information from the image after grayscale conversion and blurring to obtain edge features; performing background modeling based on the edge features to complete the preprocessing.
[0074] According to the above description, in an exemplary embodiment, the process of the image visibility score statistics module performing zoning processing on the preprocessed image and statistically calculating the score of each region includes: obtaining the preprocessed image; performing zoning processing on the preprocessed image; obtaining the edge features of each region, and statistically calculating the maximum value of all the edge features of all the regions at different times; calculating the ratio of the feature value of each region to the corresponding maximum value, and statistically calculating the score of each region according to the ratio calculation result.
[0075] As Figure 3 shown, the present invention also provides a camera visibility detection system based on background modeling, including:
[0076] First, decode the obtained video stream, read the video frames, and output them to module 202 in sequence.
[0077] Perform grayscale conversion and blurring on the video frames, then extract edge information to obtain edge features.
[0078] Since the foreground information is not stable enough and will affect the calculation of visibility, the background information is extracted by means of background modeling and analyzed.
[0079] Perform block processing on the background information, statistically calculate the edge features of each block, and statistically calculate the maximum value of all the edge features of all the blocks at different times. Calculate the ratio of the feature value of each block to the maximum value, and the visibility can be calculated. After the calculation is completed, update a certain proportion of the current feature value to the currently statistically maximum value, so that the recorded maximum value remains adaptively changed.
[0080] Compare the calculated visibility with the set threshold to give an alarm message.
[0081] Summarize the issued alarm messages and perform relevant alarm prompts.
[0082] In summary, the present invention provides a camera visibility detection system based on background modeling. By using traditional image processing algorithms such as background modeling, it can monitor the visibility of highways in real time, achieving fast detection speed, high accuracy, and strong stability. This method extracts effective background information for visibility detection in highways under complex scenarios, greatly improving the accuracy and stability. For foggy weather on highways, this method can automatically monitor and alarm in real time, reducing manual intervention, and has the advantages of scene adaptability and fast detection. This method has the following advantages: First, it is fast. An ordinary computer can process each frame of image in real time. Second, it has high accuracy. By using the background modeling method to remove the interference of the foreground and extract background information for analysis, false alarms are not easily generated. Third, it has good stability. It has good detection effects for foggy days in different scenarios and strong anti-interference ability for motion blur caused by vehicles, etc. Fourth, it can quickly generate alarm information in foggy scenarios to ensure the safe driving of highways.
[0083] The above embodiments are only illustrative of the principles and effects of the present invention, and are not intended to limit the present invention. Any person familiar with this technology can modify or change the above embodiments without departing from the spirit and scope of the present invention. Therefore, all equivalent modifications or changes made by those with ordinary knowledge in the technical field without departing from the spirit and technical ideas disclosed by the present invention should still be covered by the claims of the present invention.
Claims
1. A method for detecting the visibility of a camera based on background modeling, characterized in that, The method includes the following steps: Use the video image acquisition module to sequentially acquire images, and transmit each frame of the acquired images to the video image preprocessing module; Use the video image preprocessing module to perform image preprocessing on each frame of the acquired images, and the preprocessing includes background modeling; Use the image visibility score statistics module to perform zoning processing on the preprocessed images and count the scores of each region; wherein, the zoning includes: directly cutting the whole image into m*n blocks of regions according to the width and height ratio; the calculation process of the score includes: calculating the pixel average value for each region, calculating the difference between the pixel value of each region and the pixel average value, dividing the difference of each region by the number of pixel points in each region, calculating the pixel change rate of each region, and using the calculated change rate as the score of each region; Detect the visibility of the current camera according to the scores of each region, and output the corresponding detection result.
2. The method for detecting the visibility of a camera based on background modeling according to claim 1, wherein The process of using the video image acquisition module to sequentially acquire images includes: Use the video image acquisition module to sequentially acquire video streams; Decode and frame the acquired video streams to obtain each frame of images corresponding to the video streams; Transmit each frame of the acquired images to the video image preprocessing module.
3. The method for detecting the visibility of a camera based on background modeling according to claim 1 or 2, characterized in that The process of using the video image preprocessing module to perform image preprocessing on each frame of the acquired images includes: Use the video image preprocessing module to receive each frame of images transmitted by the video image acquisition module, and perform grayscale conversion and blurring processing on the received each frame of images; Extract edge information from the images after grayscale conversion and blurring processing to obtain edge features; Perform background modeling based on the edge features to complete the preprocessing.
4. A camera visibility detection system based on background modeling, characterized in that, The system includes: A video image acquisition module, which is used to acquire images and transmit each frame of the acquired images to the video image preprocessing module; A video image preprocessing module, which is used to perform image preprocessing on each frame of the acquired images, and the preprocessing includes background modeling; An image visibility score statistics module, which is used to perform zoning processing on the preprocessed images and count the scores of each region; wherein, the zoning includes: directly cutting the whole image into m*n blocks of regions according to the width and height ratio; the calculation process of the score includes: calculating the pixel average value for each region, calculating the difference between the pixel value of each region and the pixel average value, dividing the difference of each region by the number of pixel points in each region, calculating the pixel change rate of each region, and using the calculated change rate as the score of each region; A visibility logic processing module, which is used to detect the visibility of the current camera according to the scores of each region and output the corresponding detection result.
5. The camera visibility detection system based on background modeling according to claim 4, wherein The process of the video image acquisition module sequentially acquiring images includes: Use the video image acquisition module to sequentially acquire video streams; Decode and frame the acquired video streams to obtain each frame of images corresponding to the video streams; Transmit each frame of the acquired images to the video image preprocessing module.
6. The camera visibility detection system based on background modeling according to claim 4 or 5, characterized in that The process of the video image preprocessing module performing image preprocessing on each frame of the acquired images includes: The video image preprocessing module receives each frame of the image transmitted by the video image acquisition module, and performs grayscale conversion and blurring on each received frame of the image; Extract edge information from the image after grayscale conversion and blurring to obtain edge features; Perform background modeling based on the edge features to complete the preprocessing.
Citation Information
Patent Citations
Video visibility detection early warning method and system suitable for highway
CN108830880A