A method and system for evaluating precipitation observation quality using a raindrop spectrometer based on a surveillance camera

By combining a monitoring camera with a raindrop spectrometer, the problem that the raindrop spectrometer observation results are easily affected by wind interference and instrument failure is solved, and efficient and accurate precipitation observation quality assessment is achieved, which is suitable for the fields of meteorology and water conservancy.

CN119515909BActive Publication Date: 2025-09-26NANJING UNIV +1
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411711537.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-11-27
Publication Date
2025-09-26
Estimated Expiration
2044-11-27

AI Technical Summary

Technical Problem

The observation results of existing raindrop spectrometers are easily affected by wind interference, instrument failure and insect interference, resulting in large measurement errors. In addition, there is a lack of automatic calibration methods, making it difficult to evaluate the observation quality.

Method used

By combining a surveillance camera with a raindrop spectrometer, rain lines are extracted through clock alignment and sparse coding algorithm, the tilt angle of raindrops is calculated, the wind impact is evaluated in combination with wind speed data, and the occurrence of rainfall and the instrument status are judged.

Benefits of technology

The accuracy evaluation of raindrop spectrometer observation results was achieved, measurement errors were reduced, and the accuracy and reliability of observation data were ensured, making it suitable for large-scale promotion and application.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119515909B_ABST
    Figure CN119515909B_ABST
Patent Text Reader

Abstract

The present invention belongs to the field of precipitation observation technology, and in particular relates to a method and system for assessing the quality of precipitation observations using a raindrop spectrometer based on a surveillance camera. The method comprises: aligning the surveillance camera with the raindrop spectrometer clock; establishing a rainline extraction model; establishing a raindrop tilt calculation model; determining the occurrence of rainfall; measuring the impact of wind; and determining the working status of the raindrop spectrometer. The present invention provides important evidence for the effectiveness of ground-based precipitation information observations, enables automated assessment of the effectiveness of ground-based precipitation products, greatly saves time and money spent on current precipitation ground data verification, and solves the current problem of meteorological and water conservancy departments having difficulty effectively determining whether ground-based precipitation observations are usable. In addition, the present invention further improves the efficiency of existing surface observation equipment, plays a positive role in improving the accuracy of weather forecasts, meteorological modeling, and meteorological radars / satellites, and has significant significance for meteorological and hydrological scientific research and business applications.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to but is not limited to the field of precipitation observation technology, and in particular relates to a method and system for evaluating precipitation observation quality using a raindrop spectrometer based on a monitoring camera. Background Art

[0002] The microphysical characteristics of surface precipitation, including information about particle size, number concentration, shape, and velocity, are crucial for understanding the formation and evolution of precipitation and assessing its impact on the environment and human activities. Accurate raindrop spectrometer observations are crucial for accurately understanding and analyzing surface precipitation characteristics, as well as for error modeling and precision correction in meteorological satellites and radars.

[0003] Raindrop spectrometers include one-dimensional laser raindrop spectrometers and two-dimensional video raindrop spectrometers. These instruments are primarily deployed at surface meteorological stations. Using laser and visual imaging technology, they record and calculate the size, terminal velocity, and shape parameters of precipitation particles, enabling the measurement and inversion of precipitation microphysical parameters and characteristics. They are crucial instruments in the field of atmospheric observation. Currently, the price and maintenance costs of a single raindrop spectrometer remain high; the purchase costs of a one-dimensional laser raindrop spectrometer and a two-dimensional video raindrop spectrometer are RMB 200,000 and 700,000, respectively. This results in a relatively small number of raindrop spectrometers in China and an uneven distribution density. Improving the measurement accuracy of raindrop spectrometers within limited observation sites is crucial for enhancing their practical application value.

[0004] However, in actual application, raindrop spectrometers will have a series of errors, mainly including the following aspects: (1) Wind interference. Since the measurement area of ​​1D laser and 2D video raindrop spectrometers is small, the presence of wind causes the raindrop to fall tilted, which leads to deviations in the observation results. In particular, when the wind speed is greater than level 3, the raindrops fall with a significant tilt, and the raindrop spectrometer will have a measurement error of >20%. Moreover, the presence of wind will interfere with the measurement accuracy of the microphysical parameters of raindrop velocity and falling shape; (2) After the rain, there are still raindrops sliding down the inner wall of the device, which is mistakenly identified as continuing rain, when in fact the rain has stopped; (3) On sunny days, there is light in the measurement area, and the light source of the machine itself will attract moths and insects, resulting in misjudgment; (4) In extreme rainstorm scenes, the number of raindrops is large, and the amount of data that the instrument needs to process increases sharply, causing the instrument to freeze. At this time, the instrument output measurement is 0, while the actual precipitation intensity is very large.

[0005] Especially since my country cancelled the manual scheduled observation and daily duty services at meteorological stations in 2013, how to realize the automatic verification of raindrop spectrometer observation results has not been well solved. Summary of the Invention

[0006] In response to the problems existing in the prior art, the present invention provides a method and system for evaluating the quality of precipitation observation using a raindrop spectrometer based on a monitoring camera.

[0007] The present invention is implemented as follows: a method for evaluating the quality of precipitation observation using a raindrop spectrometer based on a monitoring camera, the method comprising:

[0008] S1, align the clocks of the monitoring camera and the raindrop spectrometer by comparing and calibrating their timestamps to ensure synchronization of their observation data;

[0009] S2, establishes a rain line extraction model, uses a sparse coding-based algorithm to extract raindrop trajectories from the video data of the surveillance camera, performs edge detection on the rain lines in the image, and draws the outer contours of the raindrops;

[0010] S3, establishes a raindrop tilt calculation model, analyzes the extracted raindrop trajectory shape, calculates the raindrop tilt angle, and combines it with wind speed data to quantify the impact of wind on rainfall observation;

[0011] S4, determining whether rainfall has occurred by comparing the rain lines extracted from the surveillance camera video with the raindrop spectrometer data;

[0012] S5, wind impact measurement, assessing the impact of wind on rainfall based on the tilt angle of raindrops and wind speed data;

[0013] S6, judge the working status of the raindrop spectrometer, and judge whether the raindrop spectrometer is working normally by comparing the data of the monitoring camera and the raindrop spectrometer, and evaluate the quality of precipitation observation.

[0014] Furthermore, the S1 specifically includes:

[0015] Since the observation periods of the surveillance camera and the raindrop spectrometer are different, the clocks of the two are first aligned; after comparative analysis, the observation results of the surveillance camera and the raindrop spectrometer are aligned in seconds, and subsequent observation correction work is carried out on this basis.

[0016] Furthermore, the S2 specifically includes:

[0017] A sparse coding-based method is used to extract rain lines. From a single-frame image, rain lines have a linear structure, that is, they appear in a linear form. The appearance of rain lines destroys the non-rainy image, and can also be understood as the continuity of the background part of the rainy image. Therefore, compared with the natural non-rainy image, the rainy image is sparse. In addition, from the video, the appearance of rain lines in the image and video sequence has the characteristics of random distribution. Based on the above analysis, a sparse coding-based rain line pre-extraction algorithm is proposed:

[0018] (1)

[0019] Where, L1 or L2 regularization; is the vertical differential component; is the horizontal differential component; is the time series difference component; parameter is an adjustable non-negative weight; the gradient descent method is selected to solve equation (1). For the original video; The background part of the video; is the rain line layer in the video; the time sequence is adjacent frames.

[0020] Furthermore, the S3 specifically includes:

[0021] S31: Draw the boundary of the rain line through the edge detection algorithm, and then obtain the outer contour of the rain line;

[0022] The rain line image obtained by S2 is converted into a binary image, with the grayscale value of the rain line being 255 and the background being 0; the outer contour of the rain line is obtained using the contour approximation method;

[0023] S32: Calculate the circumscribed rectangle of the rain line contour and obtain the center point, height, and width of the circumscribed rectangle;

[0024] After obtaining the outer contour of the rain line in S31, the maximum enclosing rectangle method is used to obtain the center point, height, and width of the enclosing rectangle of any rain line in the image. The center point of the rectangle is obtained by calculating the mean of the contour point set; then, by calculating the covariance matrix, the eigenvector and eigenvalue associated with the matrix are found.

[0025] S33: Calculate the tilt angle of the raindrop;

[0026] Define the image's horizontal axis as the Y-axis. For any rain line, the maximum Y-axis value is P[0]. P[0] rotates clockwise around the rain line's centroid. A negative rotation angle places P[0] in the lower left corner, while a positive rotation angle places P[0] in the lower right corner. This is how we obtain the rain line's tilt angle.

[0027] S34: rainfall tilt angle calculation;

[0028] Because the tilt angles of rain lines within a picture vary, the present invention uses the average of all rain line tilt angles in the entire picture as the current raindrop tilt angle. Similarly, for raindrop tilt within a period of time, the average of the tilt angles of all pictures within that period of time is used as the raindrop tilt within that period of time.

[0029] Furthermore, the S4 specifically includes:

[0030] Using the S1 method, rain lines are extracted from the surveillance video. If rain lines are detected, it indicates that rainfall has occurred; otherwise, it means that no rainfall has occurred. Based on the above rules, the measurement results of the surveillance camera and the raindrop spectrometer are compared. If rain lines are detected in the surveillance video, but the raindrop spectrometer does not determine the occurrence of rainfall, it indicates that the raindrop spectrometer has misjudged it. Otherwise, it indicates that the raindrop spectrometer correctly judged rainfall. If the surveillance camera does not detect rainfall, but the raindrop spectrometer has misjudged it;

[0031] The function of judging whether it is raining or not is used to distinguish the interference of external insects on sunny days and the misreading caused by raindrops attached to the inside of the machine sliding down after rainfall.

[0032] Furthermore, the S5 specifically includes:

[0033] When both the monitoring camera and the raindrop spectrometer detect the occurrence of rainfall, the tilt angle of the raindrop under the influence of wind is determined according to the raindrop tilt calculation model proposed in (2). Confidence of measurement results The relationship between them is as follows:

[0034] (2)

[0035] In the formula Represents the confidence level of the results, that is, the accuracy of the raindrop spectrometer observation results.

[0036] Furthermore, the S6 specifically includes:

[0037] The S1 method is used to extract rain lines from the surveillance video. If rain lines are extracted, it means that rainfall has occurred. Considering the time dimension, assuming that the surveillance camera is at time ( ) Rainfall begins to appear and the duration of rainfall is detected. , and the raindrop spectrometer from time ( ) detected rainfall, but the duration of rainfall was . ,and ; , is the preset threshold, in seconds. At this time, it is judged that the raindrop spectrometer has crashed, otherwise it is in normal state.

[0038] Another object of the present invention is to provide a monitoring camera-based raindrop spectrometer precipitation observation quality assessment system based on the monitoring camera-based raindrop spectrometer precipitation observation quality assessment method, the system specifically comprising:

[0039] Registration module, used for monitoring camera-raindrop spectrometer clock registration;

[0040] The rain line extraction module is connected to the registration module and uses a sparse coding-based method to extract rain lines;

[0041] The model building module is connected to the rain line extraction module. It draws the boundary of the rain line through the edge detection algorithm, and then obtains the outer contour of the rain line; calculates the circumscribed rectangle of the rain line contour, obtains the center point, height, and width of the circumscribed rectangle; calculates the inclination angle of the raindrop; and calculates the rainfall inclination angle.

[0042] The rainfall occurrence judgment module is connected to the registration module and is used to judge whether it is raining or not;

[0043] The wind impact measurement module is connected to the rain line extraction module to determine the inclination angle of raindrops under the influence of wind;

[0044] The raindrop spectrometer working status judgment module is connected to the registration module and is used to extract rain lines from the monitoring video. If rain lines are extracted, it indicates that rainfall has occurred.

[0045] Another object of the present invention is to provide a computer device, characterized in that the computer device includes a memory and a processor, the memory stores a computer program, and when the computer program is executed by the processor, the processor executes the steps of the raindrop spectrometer precipitation observation quality assessment method based on the monitoring camera.

[0046] Another object of the present invention is to provide a computer-readable storage medium storing a computer program, which, when executed by a processor, causes the processor to perform the steps of the method for evaluating precipitation observation quality using a raindrop spectrometer based on a monitoring camera.

[0047] In combination with the above technical solutions and the technical problems solved, the advantages and positive effects of the technical solutions to be protected by the present invention are as follows:

[0048] First, this invention innovatively utilizes computer vision theory and methods to measure and judge the accuracy of professional raindrop spectrometers using video data captured by surveillance cameras. Surveillance cameras are low-cost, simple to deploy, provide high observation frequency, and are non-contact with the raindrop spectrometers, thus not interfering with their operation. This method is highly portable and reproducible, making it suitable for widespread deployment and use nationwide and even globally. The applicant has reviewed relevant research findings domestically and internationally in recent years and has found no similar work.

[0049] This invention provides important evidence for the validity of surface precipitation observations and enables automated assessment of the effectiveness of surface precipitation products. This significantly reduces the time and expense of current ground-based precipitation data verification, resolving the current challenge faced by meteorological and water conservancy departments in effectively determining the availability of surface precipitation observations. Furthermore, this invention further enhances the efficiency of existing surface observation equipment, positively impacting weather forecasting, meteorological modeling, and the accuracy of weather radar / satellite data, significantly impacting meteorological and hydrological research and operational applications.

[0050] Second, the anticipated benefits and commercial value of this invention's technical solution after implementation include further enhancing the value and efficiency of existing ground-based precipitation observation resources, providing more reliable precipitation data support for meteorological and hydrological scientific research and business applications. The patented technical solution is simple to implement, highly portable, and reproducible, making it suitable for widespread application.

[0051] The technical solution of the present invention solves a long-cherished but unsuccessful technical challenge: the quality assessment of raindrop spectrometer observation results is crucial. However, due to their high cost, the feasibility of using two (or more) raindrop spectrometers for simultaneous observation and subsequent mutual verification is limited. The issue of how to assess the accuracy and effectiveness of these observation results remains unresolved. The present invention innovatively utilizes video data from surveillance cameras to measure the observation status and effectiveness of raindrop spectrometers. This method does not interfere with the normal operation of the raindrop spectrometers, effectively and cost-effectively resolving this challenge. The applicants have researched relevant domestic literature and found similar work to the present invention.

[0052] Third, the technical solution of this invention addresses numerous issues in existing precipitation observation and assessment technologies in industrial applications, particularly ensuring the accuracy and reliability of precipitation observation data in the face of wind interference and raindrop spectrometer failure. Traditional precipitation observation methods, such as the use of a single raindrop spectrometer, are susceptible to interference from external wind speed fluctuations, resulting in unstable or distorted observation data. Furthermore, the operating status of the raindrop spectrometer cannot be monitored in real time, making any malfunction difficult to detect in a timely manner, impacting observation quality.

[0053] This invention utilizes surveillance cameras for simultaneous monitoring, combined with data from a raindrop spectrometer, to achieve multi-dimensional, multi-device data comparison and calibration, significantly improving observation accuracy. Through clock alignment, rainline extraction, and raindrop tilt angle calculation, it effectively mitigates the impact of wind on precipitation observations, resulting in more accurate observations. Furthermore, wind impact measurement and operating status assessment functions enable real-time determination of the raindrop spectrometer's operating status, ensuring proper operation and enhancing overall system reliability.

[0054] Significant technological progress is reflected in: by combining video surveillance and data processing algorithms, innovatively integrating multiple technical modules, providing a more comprehensive and real-time precipitation quality assessment system, effectively overcoming the deficiency of a single device being unable to handle complex environmental influences, and having important application value and promotion potential in the field of precipitation observation. BRIEF DESCRIPTION OF THE DRAWINGS

[0055] Figure 1 This is a flow chart of a method for evaluating precipitation observation quality using a raindrop spectrometer based on a surveillance camera, provided by an embodiment of the present invention;

[0056] Figure 2 This is a flow chart of a method for establishing a raindrop tilt calculation model provided by an embodiment of the present invention;

[0057] Figure 3 This is a structural diagram of a raindrop spectrometer precipitation observation quality assessment system based on a monitoring camera provided by an embodiment of the present invention;

[0058] Figure 4 The embodiment of the present invention provides a raindrop spectrometer for domestic and foreign countries;

[0059] Figure 5 This is a site layout diagram provided by an embodiment of the present invention.

[0060] In the figure: 1. Registration module; 2. Rain line extraction module; 3. Model building module; 4. Rainfall occurrence judgment module; 5. Wind impact measurement module; 6. Raindrop spectrometer working status judgment module. DETAILED DESCRIPTION

[0061] In order to make the purpose, technical solutions and advantages of the present invention more clearly understood, the present invention is further described in detail below in conjunction with the embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not intended to limit the present invention.

[0062] like Figure 1 As shown, an embodiment of the present invention provides a method for evaluating precipitation observation quality using a raindrop spectrometer based on a surveillance camera, the method comprising:

[0063] S1, align the clocks of the monitoring camera and the raindrop spectrometer by comparing and calibrating their timestamps to ensure synchronization of their observation data;

[0064] S2, establishes a rain line extraction model, uses a sparse coding-based algorithm to extract raindrop trajectories from the video data of the surveillance camera, performs edge detection on the rain lines in the image, and draws the outer contours of the raindrops;

[0065] S3, establishes a raindrop tilt calculation model, analyzes the extracted raindrop trajectory shape, calculates the raindrop tilt angle, and combines it with wind speed data to quantify the impact of wind on rainfall observation;

[0066] S4, determining whether rainfall has occurred by comparing the rain lines extracted from the surveillance camera video with the raindrop spectrometer data;

[0067] S5, wind impact measurement, assessing the impact of wind on rainfall based on the tilt angle of raindrops and wind speed data;

[0068] S6, judge the working status of the raindrop spectrometer, and judge whether the raindrop spectrometer is working normally by comparing the data of the monitoring camera and the raindrop spectrometer, and evaluate the quality of precipitation observation.

[0069] To ensure effective synchronization between the surveillance camera and the raindrop spectrometer data, this method first performs clock alignment. Since the surveillance camera and the raindrop spectrometer operate as independent devices, clock errors may exist. By comparing and calibrating their timestamps, we ensure that the rainfall images captured by the surveillance camera and the precipitation data recorded by the raindrop spectrometer match the same time points. Clock alignment is the foundation for subsequent rainline extraction and data comparison, ensuring the timeliness and accuracy of the data.

[0070] This method establishes a rainline extraction model to extract raindrop trajectories from surveillance camera video data. Using a sparse coding-based algorithm, it effectively identifies raindrop trajectories in rainfall videos and eliminates background interference. The rainline extraction model performs edge detection on rainlines in the image, delineating the outer contours of raindrops and generating an image of raindrop trajectories in two-dimensional space. This extraction model provides the foundational data for subsequent raindrop angle calculation and rainfall status assessment.

[0071] Based on the results of rainline extraction, this method further develops a raindrop tilt calculation model. By analyzing the shape and contours of the extracted raindrop trajectories, the model can calculate the raindrop tilt angle, specifically the degree of raindrop deflection under the influence of wind. The raindrop tilt angle directly reflects the magnitude and direction of wind speed during rainfall. By combining tilt angle and wind speed data, the system can quantify the impact of wind on rainfall observations, providing a basis for accurately measuring rainfall quality.

[0072] Rainfall is determined by comparing rain lines captured by the surveillance camera with data from the raindrop spectrometer. If a rain line is successfully captured in the surveillance camera video, the system determines that rainfall has occurred during the current time period. Combined with raindrop tilt calculations and wind impact measurement (S5), the system assesses the degree to which current environmental conditions interfere with rainfall observations. If the wind impact is significant, the observation quality is corrected and evaluated. By comparing the surveillance camera and raindrop spectrometer data (S6), the system determines whether the raindrop spectrometer is functioning properly. If the data do not match, the system indicates a problem with the observation equipment and requires further adjustment or maintenance.

[0073] Said S1 specifically includes:

[0074] Since the observation periods of the surveillance camera and the raindrop spectrometer are different, the clocks of the two are first aligned; after comparative analysis, the observation results of the surveillance camera and the raindrop spectrometer are aligned in seconds, and subsequent observation correction work is carried out on this basis.

[0075] The S2 specifically includes:

[0076] A sparse coding-based method is used to extract rain lines. From a single-frame image, rain lines have a linear structure, that is, they appear in a linear form. The appearance of rain lines destroys the non-rainy image, and can also be understood as the continuity of the background part of the rainy image. Therefore, compared with the natural non-rainy image, the rainy image is sparse. In addition, from the video, the appearance of rain lines in the image and video sequence has the characteristics of random distribution. Based on the above analysis, a sparse coding-based rain line pre-extraction algorithm is proposed:

[0077] (1)

[0078] Where, L1 or L2 regularization; is the vertical differential component; is the horizontal differential component; is the time series (adjacent frames) differential component; parameter is an adjustable non-negative weight; the gradient descent method is selected to solve equation (1).

[0079] like Figure 2 As shown, the S3 specifically includes:

[0080] S31: Draw the boundary of the rain line through the edge detection algorithm, and then obtain the outer contour of the rain line;

[0081] The rain line image obtained by S2 is converted into a binary image, with the grayscale value of the rain line being 255 and the background being 0; the outer contour of the rain line is obtained using the contour approximation method;

[0082] The key code for extracting the outer contour of the rain line is as follows:

[0083] void findContours (

[0085] InputOutputArray image,

[0086] OutputArrayOfArrays contours, / / Detected contours, each contour is represented as a point vector

[0087] OutputArray hierarchy,

[0088] int mode, / / describes the required contour type and the desired return value method

[0089] int method, / / contour approximation method

[0090] Point offset = Point()

[0091] )void drawContours / / Draw contours, used to draw the found image contours (

[0093] InputOutputArray image, / / The image to be outlined

[0094] InputArrayOfArrays contours, / / All input contours, each contour is saved as a point vector

[0095] int contourIdx, / / Specify the number of the contour to be drawn. If it is a negative number, all contours will be drawn.

[0096] const Scalar& color, / / The color used to draw the outline

[0097] int thickness = 1, / / The thickness of the line used to draw the outline. If it is a negative number, the inside of the outline will be filled.

[0098] int lineType = 8, / Connectivity of the lines used to draw the contour

[0099] InputArray hierarchy = noArray(), / / Optional parameters about the hierarchy, only used when drawing part of the outline

[0100] int maxLevel = INT_MAX, / / The highest level of contour drawing. This parameter is valid only when hierarchy is valid.

[0101] / / maxLevel = 0, draw all contours that belong to the same level as the input contour, that is, the input contour and its adjacent contours

[0102] / / maxLevel=1, draw all contours and their child nodes at the same level as the input contour.

[0103] / / maxLevel = 2, draw all contours at the same level as the input contour and their child nodes and child nodes of the child nodes

[0104] Point offset = Point() )

[0106] S32: Calculate the circumscribed rectangle of the rain line contour and obtain the center point, height, and width of the circumscribed rectangle;

[0107] After obtaining the outer contours of the rain lines in S31, the maximum bounding rectangle method is used to obtain the center point, height, and width of the bounding rectangle of any rain line in the image. The center point of the rectangle is obtained by calculating the mean of the contour point set; then, by calculating the covariance matrix, the eigenvectors and eigenvalues ​​associated with the matrix are found. The key code is as follows:

[0108] box = cv2.boxPoints(rect)

[0109] print(box)

[0110] box = np.round(box)

[0111] box = np.int64(box)

[0112] cv2.drawContours(hello, [box], 0, (255, 0, 0), 2) #The maximum bounding rectangle of the rain line returns four parameters

[0113] x, y, w, h = cv2.boundingRect(contours[1])

[0114] cv2.rectangle(hello, (x, y), (x + w, y + h), (0, 0, 255), 2)

[0115] S33: Calculate the tilt angle of the raindrop;

[0116] Define the image's horizontal axis as the Y-axis. For any rain line, the maximum Y-axis value is P[0]. P[0] rotates clockwise around the rain line's centroid. A negative rotation angle places P[0] in the lower left corner, while a positive rotation angle places P[0] in the lower right corner. This is how we obtain the rain line's tilt angle.

[0117] S34: rainfall tilt angle calculation;

[0118] Because the tilt angles of rain lines within a picture vary, the present invention uses the average of all rain line tilt angles in the entire picture as the current raindrop tilt angle. Similarly, for raindrop tilt within a period of time, the average of the tilt angles of all pictures within that period of time is used as the raindrop tilt within that period of time.

[0119] The core code for calculating the raindrop landing tilt angle:

[0120] vector <vector <point>> contours;

[0121] vector<vector <point>> contours1;

[0122] Mat image = imread("C:\\Users\\Administrator\\Desktop\\tp_01.bmp"); / / Read in rain line image

[0123] Mat image1 = imread("C:\\Users\\Administrator\\Desktop\\tp_03.bmp"); / / Read in rain line image

[0124] Mat temp_img = caculate(image);

[0125] findContours(temp_img, contours, CV_RETR_TREE, CV_CHAIN_APPROX_NONE, Point(0, 0)); / / Draw the outline of the rain line

[0126] RotatedRect temp_r = minAreaRect(contours[0]); / / Calculate the tilt angle of each rain line

[0127] int temp_angle = temp_r.angle;

[0128] int temp_x = temp_r.center.x;

[0129] int temp_y = temp_r.center.y;

[0130] Size2i temp_size = temp_r.size;

[0131] Point2f fourPoint2f[4];

[0132] temp_r.points(fourPoint2f);

[0133] for (int i = 0; i < 3; i++)

[0134] {

[0135] line(image, fourPoint2f[i], fourPoint2f[i + 1], Scalar(55, 100, 195), 2, CV_AA);

[0136] }

[0137] line(image, fourPoint2f[0], fourPoint2f[3], Scalar(55, 100, 195), 2, CV_AA);

[0138] Mat dst_img = caculate(image1);

[0139] findContours(dst_img, contours1, CV_RETR_TREE, CV_CHAIN_APPROX_NONE, Point(0, 0));

[0140] drawContours(image1, contours1, -1, Scalar(0, 255, 0), 1.5, 8);

[0141] RotatedRect dst_r= minAreaRect(contours1[0]);

[0142] int dst_angle = dst_r.angle;

[0143] int dst_x = dst_r.center.x;

[0144] int dst_y = dst_r.center.y;

[0145] Size2i dst_size = dst_r.size;

[0146] Point2f fourPoint2f1[4];

[0147] The S4 specifically includes:

[0148] Using the S1 method, rain lines are extracted from the surveillance video. If rain lines are detected, it indicates that rainfall has occurred; otherwise, it means that no rainfall has occurred. Based on the above rules, the measurement results of the surveillance camera and the raindrop spectrometer are compared. If rain lines are detected in the surveillance video, but the raindrop spectrometer does not determine the occurrence of rainfall, it indicates that the raindrop spectrometer has misjudged it. Otherwise, it indicates that the raindrop spectrometer correctly judged rainfall. If the surveillance camera does not detect rainfall, but the raindrop spectrometer has misjudged it;

[0149] The function of judging whether it is raining or not is used to distinguish the interference of external insects on sunny days and the misreading caused by raindrops attached to the inside of the machine sliding down after rainfall.

[0150] The S5 specifically includes:

[0151] When both the monitoring camera and the raindrop spectrometer detect the occurrence of rainfall, the tilt angle of the raindrop under the influence of wind is determined according to the raindrop tilt calculation model proposed in (2). Confidence of measurement results The relationship between them is as follows:

[0152] (2)

[0153] In the formula Represents the confidence level of the result, that is, the accuracy of the raindrop spectrometer observation results. Modify formula (2) to:

[0154]

[0155] The S6 specifically includes:

[0156] The S1 method is used to extract rain lines from the surveillance video. If rain lines are extracted, it means that rainfall has occurred. Considering the time dimension, assuming that the surveillance camera is at time ( ) Rainfall begins to appear and the duration of rainfall is detected. , and the raindrop spectrometer from time ( ) detected rainfall, but the duration of rainfall was . ,and , , is the preset threshold, in seconds. At this time, it is judged that the raindrop spectrometer has crashed, otherwise it is in normal state.

[0157] like Figure 3 As shown, an embodiment of the present invention provides a monitoring camera-based raindrop spectrometer precipitation observation quality assessment system based on the monitoring camera-based raindrop spectrometer precipitation observation quality assessment method, the system specifically comprising:

[0158] Registration module 1, used for monitoring camera-raindrop spectrometer clock registration;

[0159] The rain line extraction module 2 is connected to the registration module 1 and uses a sparse coding-based method to extract rain lines;

[0160] The model building module 3 is connected to the rain line extraction module 2, and the boundary of the rain line is drawn through the edge detection algorithm to obtain the outer contour of the rain line; the circumscribed rectangle of the rain line contour is calculated to obtain the center point, height, and width of the circumscribed rectangle; the inclination angle of the raindrop is calculated; and the rainfall inclination angle is calculated.

[0161] The rainfall occurrence judgment module 4 is connected to the registration module 1 and is used to judge whether it is raining or not;

[0162] The wind impact measurement module 5 is connected to the rain line extraction module 2 and is used to determine the inclination angle of raindrops under the influence of wind;

[0163] The raindrop spectrometer working state judgment module 6 is connected to the registration module 1 and is used to extract rain lines from the monitoring video. If rain lines are extracted, it indicates that rainfall has occurred.

[0164] The core function of Registration Module 1 is to synchronize the clocks of the surveillance camera and the raindrop spectrometer, ensuring that they collect data during the same time period. Because the surveillance camera and the raindrop spectrometer operate independently, clock errors may exist. To ensure consistency in the observed data, the Registration Module calibrates the surveillance camera's timestamp with the raindrop spectrometer's. This calibrated time information effectively matches the raindrop spectrometer data with the rainfall images captured by the surveillance camera, laying the foundation for subsequent rainline extraction and quality assessment.

[0165] Rainline Extraction Module 2 uses a sparse coding algorithm to extract raindrop trajectories, or rainlines, from the surveillance video. This sparse coding algorithm effectively filters out background noise and extracts rainline features from the video. The extracted rainline data is then passed to Model Building Module 3, where an edge detection algorithm is used to further map the outer contours of the rainlines. Based on these contours, the system calculates the bounding rectangle of the rainline and extracts key parameters such as its center point, width, and height, thereby obtaining information about the spatial distribution of the raindrops.

[0166] In addition to mapping the outlines of rain lines, Model Building Module 3 also calculates the tilt angle of raindrops based on their shapes. The system uses the tilt angle of raindrops to determine the extent of wind influence during rainfall. Wind Impact Measurement Module 5 further combines the raindrop tilt angle with wind speed data to quantify the extent of wind influence, thereby optimizing rainfall measurement accuracy. Furthermore, Rainfall Occurrence Detection Module 4, connected to Clock Alignment Module 1, determines whether rainfall has occurred by analyzing rainline extraction results from surveillance camera video data. If rainlines are detected in the video image, rainfall is occurring during the current period.

[0167] The raindrop spectrometer operating status determination module 6 extracts rainline data from the surveillance video and compares it with the real-time data from the raindrop spectrometer. If the extracted rainline data matches the raindrop spectrometer data, the system confirms that the raindrop spectrometer is in normal operation and can accurately observe rainfall data. If the surveillance camera detects rainlines but the raindrop spectrometer does not detect rainfall, it indicates that the raindrop spectrometer is operating abnormally or that there is a problem with the observation quality. By monitoring the raindrop spectrometer's operating status in real time and comprehensively analyzing the rainline data, the system can comprehensively evaluate the quality of precipitation observations, improving the accuracy and reliability of rainfall observations.

[0168] An embodiment of the present invention provides a computer device, comprising a memory and a processor, wherein the memory stores a computer program, and when the computer program is executed by the processor, the processor executes the steps of the method for assessing precipitation observation quality using a raindrop spectrometer based on a surveillance camera.

[0169] An embodiment of the present invention provides a computer-readable storage medium storing a computer program. When the computer program is executed by a processor, the processor executes the steps of the method for evaluating precipitation observation quality using a raindrop spectrometer based on a surveillance camera.

[0170] like Figure 4 Shown are raindrop spectrometers from home and abroad;

[0171] like Figure 5 The following is a diagram of the on-site layout.

[0172] In the embodiment of the present invention, the working principle of the raindrop spectrometer precipitation observation quality assessment method based on the monitoring camera is divided into six steps, which are described in detail as follows:

[0173] 1. Clock alignment between the surveillance camera and the raindrop spectrometer: Throughout the precipitation observation process, the data from the surveillance camera and the raindrop spectrometer must remain synchronized. Therefore, the system first performs clock alignment, comparing the timestamps of the two devices to ensure the time consistency of the observations. Clock calibration accurately ensures that the observations from different devices match at the same time, thereby improving the accuracy of data comparison and avoiding observation errors caused by time differences.

[0174] 2. Establishing a rainline extraction model: The system uses a sparse coding algorithm to extract raindrop trajectories from video data captured by surveillance cameras. Rainline extraction is achieved through edge detection technology, which clearly depicts the outer contours of raindrops in the image. This step aims to separate raindrops from complex backgrounds, thereby obtaining more accurate raindrop shapes and motion trajectories for subsequent analysis.

[0175] 3. Establishing a Raindrop Tilt Calculation Model: The system further analyzes the extracted raindrop trajectories to calculate the raindrop's tilt angle. By analyzing the shape of the raindrop trajectories and combining them with real-time wind speed data, the system can quantify the impact of wind on rainfall. The calculation of raindrop tilt angle helps understand the effect of wind speed under varying rainfall intensities, providing foundational data for subsequent wind impact measurement.

[0176] 4. Rainfall Determination: By comparing rain line data extracted from surveillance cameras with data collected by a raindrop spectrometer, the system can determine whether rainfall has occurred. The surveillance camera provides visual data, while the raindrop spectrometer provides particle-level precipitation data. By comparing the two, the system can accurately determine whether precipitation has occurred and provide timely updates on rainfall conditions.

[0177] 5. Wind Impact Measurement: Based on the previously calculated raindrop tilt angle and wind speed data, the system evaluates the degree of wind impact on rainfall observations. This process provides a quantitative assessment of wind impact by analyzing how winds of varying directions and intensities alter raindrop trajectories. This helps determine whether wind interference is affecting the raindrop spectrometer data, thereby improving observation accuracy.

[0178] 6. Raindrop spectrometer operating status assessment and observation quality assessment: The system compares data from the surveillance camera and the raindrop spectrometer to assess whether the raindrop spectrometer is operating properly. If the surveillance camera detects rainfall but the raindrop spectrometer does not record corresponding data, or the data is inconsistent, the system will indicate an anomaly in the raindrop spectrometer. This assessment enables the system to monitor observation quality in real time, ensuring the accuracy and reliability of precipitation data.

[0179] These six steps are closely integrated to form a comprehensive raindrop observation and quality assessment system, which improves the comprehensiveness and accuracy of precipitation observations by combining image processing, wind speed analysis and equipment status monitoring.

[0180] It should be noted that the embodiments of the present invention can be implemented by hardware, software, or a combination of software and hardware. The hardware portion can be implemented using dedicated logic; the software portion can be stored in a memory and executed by an appropriate instruction execution system, such as a microprocessor or dedicated design hardware. Those skilled in the art will appreciate that the above-mentioned devices and methods can be implemented using computer-executable instructions and / or contained in processor control code, for example, such as a carrier medium such as a disk, CD or DVD-ROM, a programmable memory such as a read-only memory (firmware), or a data carrier such as an optical or electronic signal carrier. The devices and modules of the present invention can be implemented by hardware circuits such as very large-scale integrated circuits or gate arrays, semiconductors such as logic chips, transistors, or programmable hardware devices such as field programmable gate arrays, programmable logic devices, etc., can also be implemented by software executed by various types of processors, or can be implemented by a combination of the above-mentioned hardware circuits and software, such as firmware.

[0181] The above description is only a specific embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any modifications, equivalent substitutions and improvements made by any technician familiar with this technical field within the technical scope disclosed by the present invention and within the spirit and principles of the present invention should be covered by the scope of protection of the present invention.< / point> < / point>

Claims

1. A method for evaluating the quality of precipitation observation using a raindrop spectrometer based on a surveillance camera, characterized in that: The method includes: S1, align the clocks of the monitoring camera and the raindrop spectrometer by comparing and calibrating their timestamps to ensure synchronization of their observation data; S2, establishes a rain line extraction model, uses a sparse coding-based algorithm to extract raindrop trajectories from the video data of the surveillance camera, performs edge detection on the rain lines in the image, and draws the outer contours of the raindrops; S3, establishes a raindrop tilt calculation model, analyzes the extracted raindrop trajectory shape, calculates the raindrop tilt angle, and combines it with wind speed data to quantify the impact of wind on rainfall observation; S4, determining whether rainfall has occurred by comparing the rain lines extracted from the surveillance camera video with the raindrop spectrometer data; S5, wind impact measurement, assessing the impact of wind on rainfall based on the tilt angle of raindrops and wind speed data; S6, judging the working status of the raindrop spectrometer, by comparing the data from the monitoring camera and the raindrop spectrometer, to determine whether the raindrop spectrometer is working normally and evaluate the quality of precipitation observation; The S3 specifically includes: S31: Draw the boundary of the rain line through the edge detection algorithm, and then obtain the outer contour of the rain line; The rain line image obtained by S2 is converted into a binary image, with the grayscale value of the rain line being 255 and the background being 0; the outer contour of the rain line is obtained using the contour approximation method; S32: Calculate the circumscribed rectangle of the rain line contour and obtain the center point, height, and width of the circumscribed rectangle; After obtaining the outer contour of the rain line in S31, the center point, height, and width of the circumscribed rectangle of any rain line in the image are obtained using the maximum circumscribed rectangle method; the center point of the rectangle is obtained by calculating the mean of the contour point set; then, the covariance matrix is ​​calculated to find the eigenvector and eigenvalue associated with the matrix; S33: Calculate the tilt angle of the raindrop; Define the horizontal coordinate of the image as the Y axis; for any rain line, the maximum Y axis is P[0], P[0] rotates clockwise around the center of mass of the rain line. If the rotation angle is negative, P[0] is in the lower left corner, and if it is positive, P[0] is in the lower right corner. In this way, the tilt angle of the rain line is obtained; S34: rainfall tilt angle calculation; Since there is a certain deviation in the tilt angle of rain lines in a picture, the present invention uses the average value of the tilt angles of all rain lines in the entire picture as the current raindrop tilt angle; for the tilt of raindrops within a period of time, the average value of the tilt of all pictures in the time period is used as the tilt of raindrops in the time period.

2. The method for evaluating precipitation observation quality using a raindrop spectrometer based on a surveillance camera according to claim 1, wherein: Said S1 specifically includes: Since the observation periods of the surveillance camera and the raindrop spectrometer are different, the clocks of the two are first aligned; after comparative analysis, the observation results of the surveillance camera and the raindrop spectrometer are aligned in seconds, and subsequent observation correction work is carried out on this basis.

3. The method for evaluating precipitation observation quality using a raindrop spectrometer based on a surveillance camera as claimed in claim 1, wherein: The S2 specifically includes: A sparse coding-based method is used to extract rain lines. From a single-frame image, rain lines have a linear structure, that is, they appear in a linear form. The appearance of rain lines destroys the non-rainy image, and can also be understood as the continuity of the background part of the rainy image. Therefore, compared with the natural non-rainy image, the rainy image is sparse. In addition, from the video, the appearance of rain lines in the image and video sequence has the characteristics of random distribution. Based on the above analysis, a sparse coding-based rain line pre-extraction algorithm is proposed: Where ||·|| is L1 or L2 regularization; is the vertical differential component; is the horizontal differential component; is the time series difference component; parameters λ1, λ2, λ3, λ4 λ1, λ2, λ3, λ4 are adjustable non-negative weights; the gradient descent method is selected to solve equation (1); For the original video; The background part of the video; This is the rain line layer in the video.

4. The method for evaluating precipitation observation quality using a raindrop spectrometer based on a surveillance camera as claimed in claim 1, wherein: The S4 specifically includes: Use the S1 method to extract rain lines from the surveillance video. If rain lines are extracted, it indicates that rainfall has occurred, otherwise it means that no rainfall has occurred. Based on the above rules, compare the measurement results of the surveillance camera and the raindrop spectrometer. If rain lines are detected in the surveillance video, but the raindrop spectrometer does not determine the occurrence of rainfall, it indicates that the raindrop spectrometer has misjudged it. Otherwise, it indicates that the raindrop spectrometer has correctly judged rainfall. If the surveillance camera does not detect rainfall, it means that the raindrop spectrometer has misjudged it. The function of judging whether it is raining or not is used to distinguish the interference of external insects on sunny days and the misreading caused by raindrops attached to the inside of the machine sliding down after rainfall.

5. The method for evaluating precipitation observation quality using a raindrop spectrometer based on a surveillance camera as claimed in claim 1, wherein: The S5 specifically includes: When both the monitoring camera and the raindrop spectrometer detect the occurrence of rainfall, the tilt angle of the raindrop under the influence of wind is determined according to the raindrop tilt calculation model proposed in (2). Referring to existing research results and a large number of experimental comparative analyses, the relationship between the tilt angle θ and the confidence level P of the measurement result is as follows: Where P represents the confidence level of the result, that is, the accuracy of the raindrop spectrometer observation results.

6. The method for evaluating precipitation observation quality using a raindrop spectrometer based on a surveillance camera as claimed in claim 1, wherein: The S6 specifically includes: Use the S1 method to extract rain lines from the surveillance video. If rain lines are extracted, it indicates that rainfall has occurred. From the time dimension, assume that the surveillance camera detects rainfall from time T0 (T0±n(s)) and detects that the rainfall lasts for T1, while the raindrop spectrometer detects rainfall from time T0 (T0±n(s)) but detects that the rainfall lasts for T2. T2<T1, and |T2-T1|>threshold, where threshold is the preset threshold value in seconds. At this time, it is judged that the raindrop spectrometer has crashed, otherwise it is in normal state.

7. A monitoring camera-based raindrop spectrometer precipitation observation quality assessment system based on the monitoring camera-based raindrop spectrometer precipitation observation quality assessment method according to any one of claims 1 to 6, characterized in that: The system specifically includes: Registration module, used for monitoring camera-raindrop spectrometer clock registration; The rain line extraction module is connected to the registration module and uses a sparse coding-based method to extract rain lines; The model building module is connected to the rain line extraction module. It draws the boundary of the rain line through the edge detection algorithm, and then obtains the outer contour of the rain line; calculates the circumscribed rectangle of the rain line contour, obtains the center point, height, and width of the circumscribed rectangle; calculates the tilt angle of the raindrop; and calculates the rainfall tilt angle. The rainfall occurrence judgment module is connected to the registration module and is used to judge whether it is raining or not; The wind impact measurement module is connected to the rain line extraction module to determine the inclination angle of raindrops under the influence of wind; The raindrop spectrometer working status judgment module is connected to the registration module and is used to extract rain lines from the monitoring video. If rain lines are extracted, it indicates that rainfall has occurred.

8. A computer device, characterized in that: The computer device includes a memory and a processor, the memory stores a computer program, and when the computer program is executed by the processor, the processor performs the steps of the method for evaluating precipitation observation quality of a raindrop spectrometer based on a monitoring camera as described in any one of claims 1 to 6.

9. A computer-readable storage medium storing a computer program, wherein when the computer program is executed by a processor, the processor executes the steps of the method for evaluating precipitation observation quality using a raindrop spectrometer based on a surveillance camera according to any one of claims 1 to 6.

Citation Information

Patent Citations

  • Rainfall measurement method based on video images

    CN102707340A

  • Rainfall inversion method and device, computer equipment and storage medium

    CN117765431A