A camera recognition-based rainfall image recognition method
By capturing rainfall images with a camera and combining preprocessing, rainfall recognition models, and clustering methods, the noise problem in rainfall image recognition was solved, achieving efficient and accurate recognition of rainfall information.
Patent Information
- Application Number
- CN202410021175.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-01-05
- Publication Date
- 2026-11-24
- Estimated Expiration
- 2044-01-05
AI Technical Summary
Existing rainfall recognition methods suffer from a large amount of irrelevant noise in rainfall images, leading to significant errors between the recognition results and actual rainfall information.
Rainfall images of the target area are captured by a camera. Through preprocessing, a rainfall recognition model, and clustering methods, including filtering, edge enhancement, and image restoration, noise is reduced and rainfall information is highlighted. Features are extracted using the rainfall recognition model, and cluster analysis is performed to determine the rainfall range and level.
It improves the accuracy and efficiency of rainfall image recognition, reflects rainfall information in the target area in real time, and accurately identifies the rainfall range and level within the monitoring area.
Smart Images

Figure CN117830951B_ABST
Abstract
Description
Technical Field
[0001] This specification relates to the field of rainfall monitoring technology, and in particular to a rainfall image recognition method based on camera recognition. Background Technology
[0002] With technological advancements and equipment improvements, rainfall can increasingly be predicted and monitored through satellite remote sensing, real-time image monitoring, and other methods. Existing rainfall identification methods often utilize historical image data to analyze rainfall information and determine the specific rainfall range, amount, and timing. However, the rainfall images acquired by these methods contain significant amounts of irrelevant noise, reducing the quality of the identification and leading to substantial discrepancies between the identified rainfall information and the actual rainfall data. Summary of the Invention
[0003] To address the aforementioned shortcomings in the existing technology, this invention provides a rainfall image recognition method based on camera recognition, which solves the problem of inaccurate recognition of rainfall images.
[0004] To achieve the aforementioned objectives, the present invention employs the following technical solution: a rainfall image recognition method based on camera recognition, comprising:
[0005] S1: Use a camera to capture rainfall images of the target area;
[0006] S2: Preprocess the rainfall image of the target area to obtain rainfall image data;
[0007] S3: The rainfall image data is processed using a rainfall recognition model to obtain rainfall information for the target area;
[0008] S4: Cluster the rainfall information of the target area to determine the rainfall range and rainfall level within the monitoring area, and complete the recognition of the rainfall image.
[0009] The beneficial effects of this invention are as follows: The processor preprocesses the rainfall images of the target area captured by the camera, and determines the rainfall range and rainfall level within the monitoring area through a rainfall recognition model and clustering. Preprocessing significantly reduces noise in the captured rainfall images of the target area, while improving the image's ability to express rainfall information, thus increasing computational efficiency and accuracy. By using a rainfall recognition model to process the rainfall image data, rainfall information for the target area is obtained, allowing for real-time reflection of rainfall information and improving recognition efficiency. Clustering accurately identifies the rainfall range and rainfall level within the monitoring area.
[0010] Further: S2 includes:
[0011] S210: Filter the rainfall image of the area to obtain the grayscale of the target pixel after filtering;
[0012] S220: Calculate the grayscale of the target pixels after filtering to obtain the filtered rainfall image of the target area;
[0013] S230: Perform edge enhancement processing on the filtered target area rainfall image to obtain an enhanced target area rainfall image;
[0014] S240: Perform image restoration on the enhanced target area rainfall image to obtain the rainfall image data.
[0015] In some embodiments of this specification, the processor can preprocess the rainfall image of the target area using filtering, edge enhancement, and image restoration to obtain rainfall image data, which greatly reduces image noise, highlights the rainfall information in the image, and improves the efficiency and accuracy of calculation.
[0016] Furthermore: the specific expression for the grayscale of the filtered target pixel is as follows:
[0017]
[0018] Where g(x,y) represents the gray level of the target pixel after filtering, and k ij The values represent the correction parameters, f(i,j) represent the gray level of the reference pixel, n represents the adjustment range, x represents the horizontal coordinate of the target pixel, y represents the vertical coordinate of the target pixel, i represents the horizontal coordinate of the reference pixel, and j represents the vertical coordinate of the reference pixel.
[0019] In some embodiments of this specification, the processor can use formulas to process the rainfall image of the target area to obtain a filtered rainfall image of the target area, reduce image noise, and obtain a normalized image, thereby reducing the amount of subsequent calculations.
[0020] Furthermore, the edge enhancement processing specifically includes:
[0021] S221: By calculating the filtered rainfall image of the target area, the edge gradient values and corresponding gradient directions are obtained:
[0022]
[0023]
[0024] Where G(x,y) represents the edge gradient value, tanα represents the corresponding gradient direction, and Δ x g(x,y) represents the gradient in the x-direction, Δ y g(x,y) represents the gradient in the y-direction, where x represents the x-coordinate of the target pixel and y represents the y-coordinate of the target pixel.
[0025] S222: Determine whether the edge gradient value exceeds the preset threshold. If so, perform edge enhancement along the gradient direction and return to S221; otherwise, output the enhanced target area rainfall image.
[0026] In some embodiments of this specification, the processor can use formulas to process the filtered target area rainfall image to obtain an enhanced target area rainfall image, further reducing image noise, highlighting target edges, and facilitating feature extraction.
[0027] Furthermore: the directional gradient calculation specifically includes:
[0028]
[0029]
[0030] Where k1 represents the center hardening parameter in the x-direction and k2 represents the center hardening parameter in the y-direction.
[0031] In some embodiments of this specification, the processor uses formulas to determine the directional gradient, and can dynamically adjust the weights of the center parameters to obtain a directional gradient that is more consistent with the actual situation, thereby improving the accuracy of the calculation.
[0032] Furthermore: the specific expression for the rainfall image data is as follows:
[0033]
[0034] Where F(x,y) represents the rainfall image data of the target pixel, g'(x,y) represents the enhanced gray level of the target pixel, N(x,y) represents the noise function, H(x,y) represents the degradation function, x represents the x-coordinate of the target pixel, and y represents the y-coordinate of the target pixel.
[0035] In some embodiments of this specification, the processor can use formulas to process the enhanced target area rainfall image to obtain rainfall image data, eliminating the influence of problems such as focusing, object motion and atmospheric disturbance on the calculation results, and improving the recognition accuracy.
[0036] Further: S3 includes:
[0037] S310: Input the rainfall image data into the feature layer to obtain the rainfall image feature vector; the feature layer belongs to the rainfall recognition model;
[0038] S320: Input the feature vector of the rainfall image into the rainfall recognition layer to obtain rainfall information of the target area; the rainfall recognition layer belongs to the rainfall recognition model.
[0039] In some embodiments of this specification, rainfall image data is processed by a rainfall recognition model, which can take into account the distribution of rainfall features in the rainfall image data, accurately analyze the changes in rainfall features, and make the recognition results more accurate.
[0040] Further: S4 includes:
[0041] S410: Calculate the rainfall information of the target area to obtain the similarity of the target area, specifically as follows:
[0042]
[0043] Among them, P clu k represents the similarity of the target regions. a Indicates rainfall information for the target area, k b Indicates rainfall information for the reference area, d a d represents the coordinates of the target area. b The coordinates of the reference area are represented by 'a', where 'a' represents the target area number and 'b' represents the reference area number.
[0044] S420: Cluster the target regions according to their similarity to obtain clustering results;
[0045] S430: Based on the clustering results, determine the rainfall range and rainfall level within the monitoring area.
[0046] In some embodiments of this specification, the processor can use formulas to cluster the target area, which can accurately identify the rainfall range and rainfall level within the monitoring area. Attached Figure Description
[0047] This specification will be further described by way of exemplary embodiments, which will be described in detail with reference to the accompanying drawings. These embodiments are not limiting; in these embodiments, the same reference numerals denote the same structures, wherein:
[0048] Figure 1 This is an exemplary flowchart illustrating a camera-based rainfall image recognition method according to some embodiments of this specification. Detailed Implementation
[0049] The specific embodiments of the present invention are described below to enable those skilled in the art to understand the present invention. However, it should be understood that the present invention is not limited to the scope of the specific embodiments. For those skilled in the art, various changes are obvious as long as they are within the spirit and scope of the present invention as defined and determined by the appended claims. All inventions utilizing the concept of the present invention are protected.
[0050] Example
[0051] Figure 1 This is an exemplary flowchart illustrating a camera-based rainfall image recognition method according to some embodiments of this specification. Figure 1 As shown, process 100 includes the following steps. In some embodiments, process 100 may be executed by a processor.
[0052] S1: Use a camera to capture images of rainfall in the target area.
[0053] A target area rainfall image is an image that reflects rainfall information in the target area.
[0054] The target area is the image acquisition area of the camera.
[0055] In some embodiments, the processor can use a camera to collect climate images of the target area and obtain rainfall images of the target area.
[0056] S2: Preprocess the rainfall image of the target area to obtain rainfall image data.
[0057] Rainfall image data are images used to highlight rainfall characteristics in a target area.
[0058] In some embodiments, the processor can process the rainfall image of the target area using geometric transformations to obtain rainfall image data.
[0059] In some embodiments, the processor may implement S2 based on the following steps: S210: Filtering the rainfall image of the region to obtain the grayscale of the target pixel after filtering; S220: Statistically calculating the grayscale of the target pixel after filtering to obtain the filtered rainfall image of the target region; S230: Performing edge enhancement processing on the filtered rainfall image of the target region to obtain the enhanced rainfall image of the target region; S240: Performing image restoration on the enhanced rainfall image of the target region to obtain the rainfall image data.
[0060] The filtered target area rainfall image is a normalized image obtained by filtering the target area rainfall image.
[0061] In some embodiments, the processor can use methods such as Gaussian filtering to calculate the grayscale of the target pixel in the rainfall image of the target area, thereby obtaining the grayscale of the target pixel after filtering.
[0062] In some embodiments, the specific expression for the grayscale of the filtered target pixel can be:
[0063]
[0064] Where g(x,y) represents the gray level of the target pixel after filtering, and k ijThe values represent the correction parameters, f(i,j) represent the gray level of the reference pixel, n represents the adjustment range, x represents the horizontal coordinate of the target pixel, y represents the vertical coordinate of the target pixel, i represents the horizontal coordinate of the reference pixel, and j represents the vertical coordinate of the reference pixel.
[0065] In some embodiments, the processor can statistically analyze the grayscale values of the target pixels after filtering to obtain a filtered rainfall image of the target area.
[0066] In some embodiments of this specification, the processor can use formulas to process the rainfall image of the target area to obtain a filtered rainfall image of the target area, reduce image noise, and obtain a normalized image, thereby reducing the amount of subsequent calculations.
[0067] The enhanced target area rainfall image is the image after edge enhancement of the filtered target area rainfall image.
[0068] In some embodiments, the processor can use image sharpening to perform edge enhancement processing on the image to obtain an enhanced rainfall image of the target area.
[0069] In some embodiments, the processor may implement S220 using the following steps: S221: calculate the edge gradient value and the corresponding gradient direction by calculating the filtered target area rainfall image; S222: determine whether the edge gradient value exceeds a preset threshold. If so, perform edge enhancement along the gradient direction and return to S221; otherwise, output the enhanced target area rainfall image.
[0070] In some embodiments, the processor can calculate the edge gradient values and corresponding gradient directions from the filtered rainfall image of the target area:
[0071]
[0072]
[0073] Where G(x,y) represents the edge gradient value, tanα represents the corresponding gradient direction, and Δ x g(x,y) represents the gradient in the x-direction, Δ y g(x,y) represents the gradient in the y-direction, where x represents the x-coordinate of the target pixel and y represents the y-coordinate of the target pixel.
[0074] In some embodiments, the processor may calculate the directional gradient using the following formula:
[0075]
[0076]
[0077] Where k1 represents the center hardening parameter in the x-direction and k2 represents the center hardening parameter in the y-direction.
[0078] In some embodiments of this specification, the processor uses formulas to determine the directional gradient, and can dynamically adjust the weights of the center parameters to obtain a directional gradient that is more consistent with the actual situation, thereby improving the accuracy of the calculation.
[0079] In some embodiments, the processor can compare the edge gradient value with a preset threshold. When the edge gradient value is greater than the preset threshold, the image is enhanced along the gradient direction and returned to S221. When the edge gradient value is less than or equal to the preset threshold, the enhanced target area rainfall image is obtained.
[0080] In some embodiments of this specification, the processor can use formulas to process the filtered target area rainfall image to obtain an enhanced target area rainfall image, further reducing image noise, highlighting target edges, and facilitating feature extraction.
[0081] In some embodiments, the processor can use inverse filtering to process the enhanced target area rainfall image to obtain rainfall image data.
[0082] In some embodiments, the specific expression for rainfall image data can be:
[0083]
[0084] Where F(x,y) represents the rainfall image data of the target pixel, g'(x,y) represents the enhanced gray level of the target pixel, N(x,y) represents the noise function, H(x,y) represents the degradation function, x represents the x-coordinate of the target pixel, and y represents the y-coordinate of the target pixel.
[0085] In some embodiments of this specification, the processor can use formulas to process the enhanced target area rainfall image to obtain rainfall image data, eliminating the influence of problems such as focusing, object motion and atmospheric disturbance on the calculation results, and improving the recognition accuracy.
[0086] In some embodiments of this specification, the processor can preprocess the rainfall image of the target area using filtering, edge enhancement, and image restoration to obtain rainfall image data, which greatly reduces image noise, highlights the rainfall information in the image, and improves the efficiency and accuracy of calculation.
[0087] S3: Use a rainfall recognition model to process rainfall image data to obtain rainfall information for the target area.
[0088] Rainfall information for a target area is data that reflects the rainfall situation in that area. For example, rainfall information for a target area may include data reflecting the rainfall intensity, rainfall amount, and rainfall duration in the target area.
[0089] In some embodiments, the processor can identify rainfall image data to obtain rainfall information for the target area.
[0090] In some embodiments, the processor may implement S3 based on the following steps: S310: inputting the rainfall image data into the feature layer to obtain the rainfall image feature vector; the feature layer belongs to the rainfall recognition model; S320: inputting the rainfall image feature vector into the rainfall recognition layer to obtain rainfall information of the target area; the rainfall recognition layer belongs to the rainfall recognition model.
[0091] A rainfall recognition model is a model used to identify rainfall information in a target area. A rainfall recognition model can be a neural network model. For example, rainfall recognition models can include convolutional neural network models, graph neural network models, etc.
[0092] In some embodiments, the rainfall recognition model may include a feature layer and a rainfall recognition layer, wherein the output of the feature layer serves as the input of the rainfall recognition layer, and the output of the rainfall recognition layer serves as the final output of the model.
[0093] In some embodiments, the feature layer can be used to extract feature vectors related to rainfall from rainfall image data.
[0094] In some embodiments, the rainfall recognition layer can be used to identify the feature vectors of rainfall images to obtain rainfall information for the target area.
[0095] In some embodiments, the input data of the feature layer may be rainfall image data, and the output data of the feature layer may be rainfall image feature vectors.
[0096] A rainfall image feature vector is a vector data that reflects rainfall-related features in a rainfall image. For example, a rainfall image feature vector may include parameters such as image grayscale distribution, image gradient changes, rainfall time, and rainfall probability.
[0097] In some embodiments, the input data of the rainfall recognition layer may be a rainfall image feature vector, and the output data of the rainfall recognition layer may be rainfall information of the target area.
[0098] In some embodiments, the feature layer and the rainfall recognition layer can be obtained through joint training. The joint training sample data includes sample rainfall image data, labeled as rainfall information of the target area. The sample rainfall image data is input into the feature layer of the initial rainfall recognition model to obtain the rainfall image feature vector output by the feature layer. The rainfall image feature vector is then used as training sample data and input into the rainfall recognition layer of the initial rainfall recognition model to obtain the target area rainfall information output by the rainfall recognition layer. A loss function is constructed based on the sample target area rainfall information and the target area rainfall information output by the rainfall recognition layer, and the parameters of the feature layer and the rainfall recognition layer are updated synchronously. Through parameter updates, the trained rainfall recognition model is obtained.
[0099] In some embodiments, the processor may train an initial rainfall recognition model using the following loss function:
[0100]
[0101] Where Loss represents the loss function value, and N represents the number of sample rainfall image data. This represents the rainfall information for the target area being output, k. c This indicates the rainfall information label for the corresponding sample target area.
[0102] In some embodiments of this specification, rainfall image data is processed by a rainfall recognition model, which can take into account the distribution of rainfall features in the rainfall image data, accurately analyze the changes in rainfall features, and make the recognition results more accurate.
[0103] S4: Cluster the rainfall information in the target area to determine the rainfall range and rainfall level within the monitoring area, and complete the recognition of rainfall images.
[0104] Rainfall extent is data reflecting the area covered by rainfall.
[0105] Rainfall level is data that reflects the intensity of rainfall.
[0106] In some embodiments, the processor can perform comprehensive statistics on rainfall information from various target areas to obtain the rainfall range and rainfall level within the monitoring area.
[0107] In some embodiments, the processor may implement S4 based on the following steps: S410: calculate the rainfall information of the target area to obtain the similarity of the target area; S420: perform clustering according to the similarity of the target areas to obtain the clustering results; S430: determine the rainfall range and rainfall level within the monitoring area based on the clustering results.
[0108] The similarity of target regions is data that reflects the degree of similarity between various target regions and their relationship with rainfall.
[0109] In some embodiments, the processor can process regional rainfall information based on the following formula to obtain the similarity of the target region:
[0110]
[0111] Among them, P clu k represents the similarity of the target regions. a Indicates rainfall information for the target area, k b Indicates rainfall information for the reference area, d a d represents the coordinates of the target area. b The coordinates represent the reference area, where 'a' represents the target area number and 'b' represents the reference area number.
[0112] The clustering results are used to distinguish between target areas of rainfall and non-rainfall target areas.
[0113] In some embodiments, the processor can use the target area with the highest rainfall level as the cluster center to perform clustering processing on all target areas within the monitoring range to obtain clustering results.
[0114] In some embodiments, the processor can use clustering results to determine the rainfall range within the monitoring area, combine the rainfall levels of the target area within the rainfall range to determine the rainfall level of the rainfall range, and use the obtained rainfall range and rainfall level within the monitoring area as the final recognition result to complete the recognition of the rainfall image.
[0115] In some embodiments of this specification, the processor can use formulas to cluster the target area, which can accurately identify the rainfall range and rainfall level within the monitoring area.
[0116] In some embodiments of this specification, the processor preprocesses rainfall images of the target area captured by the camera, and determines the rainfall range and intensity within the monitoring area through a rainfall recognition model and clustering. Preprocessing significantly reduces noise in the captured rainfall images of the target area, while improving the image's ability to represent rainfall information, thus increasing computational efficiency and accuracy. Processing the rainfall image data using a rainfall recognition model to obtain rainfall information for the target area allows for real-time reflection of rainfall information in the target area, improving recognition efficiency. Clustering accurately identifies the rainfall range and intensity within the monitoring area.
Claims
1. A rainfall image recognition method based on camera recognition, characterized in that, include: S1: Use a camera to capture rainfall images of the target area; S2: Preprocess the rainfall image of the target area to obtain rainfall image data; S2 includes: S210: Filter the rainfall image of the region to obtain the grayscale value of the filtered target pixel; the specific expression for the grayscale value of the filtered target pixel is: ; in, This indicates the grayscale value of the target pixel after filtering. Indicates the correction parameters. Indicates the grayscale value of the reference pixel. Indicates the adjustment range. Represents the x-coordinate of the target pixel. Represents the y-coordinate of the target pixel. Represents the x-coordinate of the reference pixel. Represents the ordinate of the reference pixel; S220: Calculate the grayscale of the target pixels after filtering to obtain the filtered rainfall image of the target area; S230: Perform edge enhancement processing on the filtered target area rainfall image to obtain an enhanced target area rainfall image; the edge enhancement processing specifically includes: S231: By calculating the filtered rainfall image of the target area, the edge gradient values and corresponding gradient directions are obtained: ; ; in, Indicates the edge gradient value. Indicates the corresponding gradient direction. express Gradient of direction, express Gradient of direction, Represents the x-coordinate of the target pixel. The ordinate of the target pixel is represented; the directional gradient calculation specifically includes: ; ; in, express The center strengthening parameter of the direction, express The center reinforcement parameter of the direction; S232: Determine whether the edge gradient value exceeds the preset threshold. If so, perform edge enhancement along the gradient direction and return to S231; otherwise, output the enhanced rainfall image of the target area. S240: Perform image restoration on the enhanced target area rainfall image to obtain the rainfall image data; the specific expression of the rainfall image data is: ; in, This represents rainfall image data representing the target pixel. This indicates the enhanced grayscale value of the target pixel. Represents the noise function. Represents a degenerate function. Represents the x-coordinate of the target pixel. Represents the ordinate of the target pixel; S3: The rainfall image data is processed using a rainfall recognition model to obtain rainfall information for the target area; S4: Cluster the rainfall information of the target area to determine the rainfall range and rainfall level within the monitoring area, and complete the recognition of the rainfall image.
2. The rainfall image recognition method based on camera recognition according to claim 1, characterized in that, S3 includes: S310: Input the rainfall image data into the feature layer to obtain the rainfall image feature vector; the feature layer belongs to the rainfall recognition model; S320: Input the feature vector of the rainfall image into the rainfall recognition layer to obtain rainfall information of the target area; the rainfall recognition layer belongs to the rainfall recognition model.
3. The rainfall image recognition method based on camera recognition according to claim 1, characterized in that, S4 includes: S410: Calculate the rainfall information of the target area to obtain the similarity of the target area, specifically as follows: ; in, Indicates the similarity of target regions. This indicates rainfall information for the target area. This indicates rainfall information for the reference area. Indicates the coordinates of the target area. Indicates the coordinates of the reference area. Indicates the target area number. Indicates the reference area number; S420: Cluster the target regions according to their similarity to obtain clustering results; S430: Based on the clustering results, determine the rainfall range and rainfall level within the monitoring area.
Citation Information
Patent Citations
Wireless sensor network image fusion method based on multi-focus fusion and image splicing
CN102521814A
Automatic windshield wiper control method
CN103543638A
