A cloud tracking method based on FPGA
Through the FPGA-based cloud tracking method, combined with CMOS cameras and ARM processors, the LSTM-SuperGlue network is used for cloud feature extraction and matching, which solves the accuracy problem of cloud shape change tracking and improves the accuracy and real-time performance of cloud tracking. Enhanced climate prediction capabilities.
Patent Information
- Application Number
- CN202210508159.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-05-11
- Publication Date
- 2024-10-15
- Estimated Expiration
- 2042-05-11
AI Technical Summary
Existing technology is difficult to accurately and quickly track the shape changes of clouds, and traditional target detection methods cannot effectively achieve accurate tracking of clouds.
The FPGA-based cloud tracking method is used to collect images through CMOS line array industrial cameras, use the AXI bus to exchange data with the ARM processor, and combine the image processing algorithm, feature extraction algorithm and LSTM-SuperGlue network to perform distortion correction, feature extraction and matching. Multi-features are used for cloud tracking, and prediction models are trained for different types of clouds.
It improves the accuracy and real-time performance of cloud tracking, enhances the performance of image collection, avoids the interference of cloud changing trends on prediction results, and achieves accurate tracking of cloud shape changes.
Smart Images

Figure CN115100514B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field related to meteorological forecasting and ground-based cloud image research, and specifically designs a cloud tracking method based on FPGA. Background Art
[0002] The study of clouds is an effective means to mitigate climate deterioration. It can help people understand their characteristics, improve climate prediction capabilities, and make corresponding adjustments to production activities. In particular, tracking changes in cloud status can allow us to obtain more effective information about meteorology.
[0003] However, the existing technology lacks a method that can accurately and quickly track clouds, especially for changes in cloud shape. Unlike general object tracking, the shape of clouds changes over time. Traditional target detection methods cannot effectively achieve accurate cloud tracking. Therefore, there is an urgent need for a method that can track clouds while taking into account the characteristic that cloud shape changes. Summary of the invention
[0004] The purpose of the present invention is to provide a cloud tracking method based on FPGA in view of the shortcomings of the prior art.
[0005] Technical solution: The technical solution adopted by the present invention to solve the problem is:
[0006] A cloud tracking method based on FPGA, firstly, obtains the image 1 and the image 2 of the cloud before and after a period of time through a CMOS linear array industrial camera and inputs them into FPGA, unifies the data exchange between the ARM processor and the FPGA through the AXI bus, and generalizes the image processing algorithm, the feature extraction algorithm and the LSTM-SuperGlue network to the high-performance ARM processor. The image is subjected to distortion correction, image smoothing, morphological operation, Canny edge detection and moment feature extraction, and on the other hand, the gray level co-occurrence matrix feature quantity is extracted from the image, and the above two features are given appropriate weights as the total cloud feature. The LSTM-SuperGlue network is used to predict the feature quantity state of the cloud after a period of time, and then the above feature quantity is matched with the image 2 to realize cloud tracking. The present invention takes into account that the size of the cloud will change over time, and uses multiple features to track the cloud to improve the tracking accuracy. At the same time, considering that different types of cloud clusters have different evolution modes, the prediction model is trained for different types of cloud clusters. The present invention adopts the "FPGA+ARM" system architecture to improve the real-time, speed and performance of image acquisition.
[0007] The specific steps include:
[0008] S1: Collect cloud images and classify clouds;
[0009] S2: Process the cloud image to obtain cloud features:
[0010] On the one hand, the image is subjected to distortion correction, image smoothing, morphological operations, Canny edge detection, and moment feature extraction. On the other hand, the gray-level co-occurrence matrix feature is extracted from the image, and the moment feature and gray-level co-occurrence matrix feature are given appropriate weights as the overall cloud feature. A relevant threshold is set for the cloud part in the image, smaller clouds are ignored, and larger, easily identifiable clouds are retained;
[0011] S3: Use the LSTM-SuperGlue network to predict the feature state of the cloud after a period of time, and then match the feature with Image 2 to achieve cloud tracking.
[0012] Furthermore, in step S1, the cloud image 1 and the cloud image 2 at intervals are captured by the same camera, and data are transmitted using differential signals.
[0013] Furthermore, in step S1, the collected cloud images are also used to form a training set, which is classified using a decision tree, and the cloud images in the training set are also classified.
[0014] Furthermore, in step S2, after the camera captures the image, the cloud image is firstly subjected to distortion correction, and the distortion correction algorithm is implemented as follows:
[0015]
[0016] In the formula, {p i} is the set of all two-dimensional vectors in the corrected image;
[0017] p i is the pixel coordinate corresponding to the i-th pixel;
[0018] F k As the objective function, by making F k By minimizing, we can find the optimal transformation {p i-Best};
[0019]
[0020] In the formula, F 1 Distortion correction for clouds;
[0021] n is the number of clouds;
[0022] O n is the range of the nth cloud cluster;
[0023] w iis the cloud weight, where the cloud is 1 and the others are 0;
[0024] m i is the weight positively correlated with the distance from pixel i to the center of the image;
[0025] u i is the projection vector;
[0026] S n , t n is the scale factor and zoom factor of the cloud image transformation;
[0027] (S n u i +t n ) is the similarity transformation of the cloud;
[0028]
[0029] In the formula, F 2 Distortion correction for the non-cloud part (i.e. the background part);
[0030] v i , v j are the coordinates of points i and j after cloud image correction;
[0031] (v i -v j ) is the vector between points i and j after cloud image correction;
[0032] N(i) is the corrected image area to which i is mapped;
[0033] e ij is the vector between points i and j after non-cloud image correction;
[0034] F k =μF 1 +vF 2
[0035] In the formula, μ, v are the relevant weight coefficients;
[0036] By making F k Minimize and find the best transformation matrix, correct the cloud and non-cloud parts separately and then combine them.
[0037] Further, in step S2, a feature extraction algorithm is used to obtain a feature quantity with strong characterization ability by combining the moment feature and the gray level co-occurrence matrix feature quantity. The moment feature includes spatial moment, center distance, normalized center distance and Hu moment. The gray level co-occurrence matrix feature includes energy, entropy, contrast and inverse difference moment of the image in the directions of 0°, 45°, 90° and 135°. The implementation method of feature combination is as follows:
[0038] V=αv 1 +βv 2
[0039] In the formula, v 1 is the moment feature;
[0040] v 2 is the gray-level co-occurrence matrix feature;
[0041] α, β are appropriate weight coefficients selected.
[0042] Furthermore, in step S3, the extracted features are input into the LSTM-SuperGlue network model. The network model includes two parts: LSTM and SuperGlue. The LSTM network is used for training to obtain a cloud feature prediction model, and the SuperGlue network is used for feature matching.
[0043] Furthermore, in step S3, the LSTM network model is used to predict the trend of cloud feature changes after a period of time, the cloud image in image 2 is matched, and a cloud feature prediction model is obtained through training; the LSTM network input is the feature quantity of cloud image 1, and the output is the predicted state of the cloud feature quantity.
[0044] Further, in step S3,
[0045] The output layer of LSTM is used as the input layer of SuperGlue, and the key points are encoded after the input layer. The implementation is as follows:
[0046] x i =d i +MLP(p i )
[0047] Where, d i is the offset of the feature point;
[0048] MLP(p i ) is to transform the feature point p i Embedding into high-dimensional vectors using MLP;
[0049] x i For p i The coordinates of the mapping in a high-dimensional vector space;
[0050] Through the SuperGlue network, the cloud cluster with the highest matching degree in the second cloud cluster image is obtained, that is, cloud tracking is achieved.
[0051] Beneficial effects: Compared with the prior art, the present invention has the following advantages:
[0052] (1) The "FPGA+ARM" architecture used in the present invention improves the real-time, speed and performance of image acquisition. Compared with the "ARM+DSP" architecture, the "FPGA+ARM" architecture integrates the ARM Cortex-A57 processor and FPGA programmable logic resources, and has the characteristics of both hardware and software being reprogrammable. The collaborative work of software and hardware improves the flexibility of design.
[0053] (2) The present invention proposes an image distortion correction method for correcting a captured image to facilitate subsequent feature extraction. Compared with traditional camera lens correction, the present method uses separate corrections for the cloud and non-cloud parts and then combines them.
[0054] (3) In the present invention, a corresponding prediction model is trained for each type of cloud cluster. Compared with training and learning all cloud cluster images, the change trend of some cloud clusters may interfere with the prediction results of the neural network. Training the prediction model separately can avoid this problem, thereby improving the pertinence and accuracy of the prediction model.
[0055] (4) In order to obtain effective features, the present invention adopts a method of combining moment features and gray-level co-occurrence matrix features to improve the characterization ability of input features.
[0056] (5) The present invention adopts the LSTM-SuperGlue network model, which combines the advantages of LSTM and SuperGlue. While being able to efficiently learn the changing trend of feature quantities, it can also accurately perform feature matching to achieve cloud tracking effects.
[0057] (6) The present invention takes into account that the size of clouds may change over time and uses multiple features to track clouds, thereby improving tracking accuracy. BRIEF DESCRIPTION OF THE DRAWINGS
[0058] Figure 1 It is a flowchart of the present invention.
[0059] Figure 2 It is a specific flow chart of the present invention;
[0060] Figure 3 It is the image processing flow chart;
[0061] Figure 4 This is the LSTM-SuperGlue network model diagram. DETAILED DESCRIPTION
[0062] The present invention is further explained below in conjunction with the accompanying drawings and specific embodiments. The embodiments are implemented based on the technical solution of the present invention. It should be understood that these embodiments are only used to illustrate the present invention and are not used to limit the scope of the present invention.
[0063] An FPGA-based cloud tracking method, such as Figure 1 and 2 As shown, the following steps are included:
[0064] S1: Collect cloud images and classify clouds:
[0065] The present invention uses a CMOS linear array industrial camera with a Cameralink interface for image acquisition. The same camera is used to capture images of each type of cloud at intervals; and images are collected separately for different types of clouds. According to the characteristics of cloud color, texture, physical changes, etc., the ground-based cloud map is divided into four categories: cirrus, cumulus, cumulonimbus, and stratus. Cirrus is a type of cloud scattered in the cloud layer, with a linear structure, soft luster, and a cloud body that is usually white and without shadows. Cirrus clouds mostly appear in the form of tiny ice crystals, which are usually not thick, thin, or scattered. The top of cumulus clouds is arc-shaped or arched, the bottom of the cloud layer is almost horizontal, and the cloud body has a clear boundary. Cumulonimbus clouds are thicker and spread over a larger range, and develop rapidly in the vertical direction. The cloud top is composed of ice crystals and has a silky structure with a white silky luster. The cloud bottom is dark and chaotic, with obvious ups and downs. The cloud body of stratus clouds is hook-shaped, gray in color, often appears on hillsides, and is mainly composed of small water droplets.
[0066] The camera uses a CMOS linear array industrial camera with a Cameralink interface. For each type of cloud, the same camera is used to take pictures at appropriate intervals to ensure that samples are collected at all times of the day or even every day of the year. The camera is used to collect high-resolution cloud images, and the same camera is used to take cloud image 1 and image 2 at intervals, and differential signals are used to transmit data. The interval time period should not be too long to prevent a huge change in the state of the cloud, nor should it be too short. An appropriate time period should be selected to take pictures to ensure that the subsequent neural network can learn the complete cloud change process.
[0067] Cloud classification algorithm: The collected cloud images are also used to form a training set, which is classified using a decision tree, and the cloud images in the training set are also classified.
[0068] The LSTM part of the network model trains a prediction model for each type of cloud image, which can improve the pertinence and accuracy of the prediction. The network input is the feature value of cloud image 1, and the output is the predicted state of the cloud feature value.
[0069] S2: Process the cloud image to obtain cloud features;
[0070] The present invention uses an FPGA with a Cameralink interface and a Cortex-A57 processor to perform image processing and obtain cloud features; the FPGA with a Cameralink interface and a Cortex-A57 processor has high-performance processing and computing capabilities and a large-capacity DDR unit to store image data. The data exchange between the ARM processor and the FPGA is unified through the AXI bus, and the algorithm program is generalized to the high-performance ARM processor. At the same time, the image can be processed in parallel, which improves the efficiency problem in practical applications. The LVDS serial high-speed image signal generated by the image source passes through the Cameralink chip DS90CR286MTD, and is converted into a parallel TTL signal according to the Cameralink interface protocol, and the TTL signal is input to the FPGA interface. The FPGA performs acquisition and control at the PL end. During this process, the PL end will store the image data in the DDR through the AXI bus, and the PS end starts to read the image data in the DDR when receiving the image interrupt signal. After the image captured by the camera is obtained, it is transmitted to the FPGA, and then the image processing operation is performed.
[0071] like Figure 3 As shown in the figure, the image processing algorithm includes distortion correction, image smoothing, morphological operation, and Canny edge detection. The distortion correction algorithm is used to remove the distorted part of the image, and the outline of the cloud is identified through noise filtering and edge detection. The cloud part in the captured image can be identified and the relevant threshold is set, and smaller clouds are ignored, while larger and easily identifiable clouds are retained. The specific steps of the method for processing cloud images include:
[0072] S2-1: Read cloud image;
[0073] S2-2: perform distortion correction;
[0074] After the camera captures the image, the cloud image is firstly subjected to distortion correction. The distortion correction algorithm is implemented as follows:
[0075]
[0076] In the formula, {p i} is the set of all two-dimensional vectors in the corrected image;
[0077] p i is the pixel coordinate corresponding to the i-th pixel;
[0078] F k As the objective function, by making F k By minimizing, we can find the optimal transformation {p i-Best};
[0079]
[0080] In the formula, F 1 Distortion correction for clouds;
[0081] n is the number of clouds;
[0082] O n is the range of the nth cloud cluster;
[0083] w i is the cloud weight, where the cloud is 1 and the others are 0;
[0084] m i is the weight positively correlated with the distance from pixel i to the center of the image;
[0085] u i is the projection vector;
[0086] S n , t n is the scale factor and zoom factor of the cloud image transformation;
[0087] (S n u i +t n ) is the similarity transformation of the cloud;
[0088]
[0089] In the formula, F 2 Distortion correction for the non-cloud part (i.e. the background part);
[0090] v i , v j are the coordinates of points i and j after cloud image correction;
[0091] (v i -v j ) is the vector between points i and j after cloud image correction;
[0092] N(i) is the corrected image area to which i is mapped;
[0093] e ij is the vector between points i and j after non-cloud image correction;
[0094] F k =μF 1 +vF 2
[0095] In the formula, μ, v are the relevant weight coefficients;
[0096] By making F kBy minimizing the above, the best transformation matrix can be obtained. The present invention corrects the cloud and non-cloud parts separately and then combines them, effectively improving the picture effect.
[0097] S2-3: Then, the corrected image is smoothed, and the smoothing process includes Gaussian filtering;
[0098] S2-4: perform morphological operations, including opening operations;
[0099] S2-5: Finally, the Canny edge detection of the image is performed. The Canny edge detection includes denoising, calculating the amplitude and direction of the gradient, non-maximum suppression, determining the edge, and finally dividing the range of the cloud.
[0100] By using the feature extraction algorithm, the feature quantity with stronger characterization ability is obtained by combining the moment feature and the gray level co-occurrence matrix feature quantity. The moment feature includes spatial moment, center distance, normalized center distance and Hu moment. The gray level co-occurrence matrix feature includes the energy, entropy, contrast and inverse moment of the image in the directions of 0°, 45°, 90° and 135°. The implementation method of feature combination is as follows:
[0101] V=αv 1 +βv 2
[0102] In the formula, v 1 is the moment feature;
[0103] v 2 is the gray-level co-occurrence matrix feature;
[0104] α, β are appropriate weight coefficients selected.
[0105] S3: Figure 4 As shown in the figure, the extracted features are input into the LSTM-SuperGlue network model, which consists of two parts: LSTM and SuperGlue. The LSTM network is used to train the cloud feature prediction model, and the SuperGlue network is used for feature matching.
[0106] S3-1: Use the LSTM network model to predict the trend of cloud feature changes after a period of time, match the cloud image in Image 2, and train to obtain a cloud feature prediction model;
[0107] By utilizing the LSTM part in the network model and training respective prediction models for each type of cloud image, the pertinence and accuracy of the prediction can be improved. The network input is the feature quantity of cloud image 1, and the output is the predicted state of the feature quantity of the cloud.
[0108] S3-2: Feature matching using SuperGlue network.
[0109] Feature matching is solved by solving the differentiable optimization transfer problem, and the loss function is constructed by GNN. The output layer of LSTM is used as the input layer of SuperGlue, and the key points are encoded after the input layer. The implementation method is as follows:
[0110] x i =d i +MLP(p i )
[0111] Where, d i is the offset of the feature point;
[0112] MLP(p i ) is to transform the feature point p i Embedding into high-dimensional vectors using MLP;
[0113] x i For p i The coordinates of the map in a high-dimensional vector space.
[0114] Through the SuperGlue network, the cloud cluster with the highest matching degree with the second cloud cluster image is obtained, that is, the cloud tracking effect is achieved.
[0115] The "FPGA+ARM" architecture used in the present invention improves the real-time, speed and performance of image acquisition. The ARM Cortex-A57 processor and FPGA programmable logic resources are integrated, with the characteristics that both hardware and software can be reprogrammed, and the collaborative work of software and hardware improves the flexibility of design.
[0116] The image distortion correction method proposed in the present invention can achieve a better correction effect than the traditional camera lens correction. In the present invention, the corresponding prediction model is trained for each type of cloud cluster, which improves the pertinence and accuracy of the prediction model compared to training and learning all cloud cluster images. In the present invention, the moment feature and the gray level co-occurrence matrix feature are combined as the total feature to improve the characterization ability of the input feature. The LSTM-SuperGlue network model adopted by the present invention combines the advantages of LSTM and SuperGlue, and can efficiently learn the trend of feature quantity changes while accurately matching features to achieve cloud tracking effects. Thereby improving the climate prediction ability and making corresponding adjustments to people's production activities.
[0117] The above specific implementation is only a preferred embodiment of the present invention and is not intended to limit the implementation of the present invention and the scope of the claims. All equivalent changes and modifications made according to the content of the patent protection scope of the present invention should be included in the scope of the patent application of the present invention.
Claims
1. A cloud tracking method based on FPGA, characterized in that: The following steps are involved: S1: Collect cloud images and classify clouds; S2: Process the cloud image to obtain cloud features: On the one hand, the image is subjected to distortion correction, image smoothing, morphological operation, Canny edge detection and moment feature extraction. On the other hand, the gray-level co-occurrence matrix feature is extracted from the image, and the moment feature and the gray-level co-occurrence matrix feature are given appropriate weights as the overall cloud feature. After the camera captures the image, the cloud image is firstly subjected to distortion correction. The distortion correction algorithm is implemented as follows: In the formula, {p i } is the set of all two-dimensional vectors in the corrected image; p i is the pixel coordinate corresponding to the i-th pixel; F k As the objective function, by making F k By minimizing, we can find the optimal transformation {p i-Best }; Where F1 is the distortion correction for the cloud part; n is the number of clouds; O n is the range of the nth cloud cluster; w i is the cloud weight, where the cloud is 1 and the others are 0; m i is the weight positively correlated with the distance from pixel i to the center of the image; u i is the projection vector; S n ,t n is the scale factor and zoom factor of the cloud image transformation; (S n u i +t n ) is the similarity transformation of the cloud; Where F2 is the distortion correction for the non-cloud part (i.e., the background part); v i ,v j are the coordinates of points i and j after cloud image correction; (v i -v j ) is the vector between points i and j after cloud image correction; N(i) is the corrected image area to which i is mapped; e ij is the vector between points i and j after non-cloud image correction; F k =μF1+vF2 In the formula, μ,v is the relevant weight coefficient; By making F k Minimize and find the best transformation matrix, correct the cloud and non-cloud parts separately and then combine them; S3: Use the LSTM-SuperGlue network to predict the feature state of the cloud after a period of time, and then match the feature with Image 2 to achieve cloud tracking.
2. The FPGA-based cloud tracking method according to claim 1, characterized in that: In step S1, the cloud image 1 and the cloud image 2 at intervals are captured by the same camera, and data are transmitted using differential signals.
3. The FPGA-based cloud tracking method according to claim 1, characterized in that: In step S1, the collected cloud images are also used to form a training set and a test set, and are classified using a decision tree, and the cloud images in the test set are also classified.
4. The FPGA-based cloud tracking method according to claim 1, characterized in that: In step S2, a feature extraction algorithm is used to obtain a feature with strong characterization ability by combining the moment feature and the gray level co-occurrence matrix feature. The moment feature includes spatial moment, center distance, normalized center distance and Hu moment. The gray level co-occurrence matrix feature includes the energy, entropy, contrast and inverse moment of the image in the directions of 0°, 45°, 90° and 135°. The implementation method of feature combination is as follows: V=αv1+βv2 Where v1 is the moment feature; v2 is the gray-level co-occurrence matrix feature; α, β are appropriate weight coefficients selected.
5. The FPGA-based cloud tracking method according to claim 1, characterized in that: In step S3, the extracted features are input into the LSTM-SuperGlue network model. The network model includes two parts: LSTM and SuperGlue. The LSTM network is used for training to obtain the cloud feature prediction model, and the SuperGlue network is used for feature matching.
6. The FPGA-based cloud tracking method according to claim 5, characterized in that: In step S3, the LSTM network model is used to predict the trend of cloud feature changes after a period of time, the cloud image in image 2 is matched, and a cloud feature prediction model is obtained through training; the LSTM network input is the feature quantity of cloud image 1, and the output is the predicted state of the cloud feature quantity.
7. The FPGA-based cloud tracking method according to claim 5, characterized in that: In step S3, The output layer of LSTM is used as the input layer of SuperGlue, and the key points are encoded after the input layer. The implementation is as follows: x i =d i +MLP(p i ) Where, d i is the offset of the feature point; MLP(p i ) is to transform the feature point p i Embedding into high-dimensional vectors using MLP; x i For p i The coordinates of the mapping in a high-dimensional vector space; Through the SuperGlue network, the cloud cluster with the highest matching degree in the second cloud cluster image is obtained, that is, cloud tracking is achieved.
Citation Information
Patent Citations
Auxiliary diagnostic system for tracing self-adaptive kernel matching and auxiliary diagnostic method thereof
CN101551855A
Precipitation cloud cluster tracking method based on feature matching tracking algorithm
CN110458878A
Foundation cloud picture classification method based on heterogeneous feature fusion network
CN111967511A
Cloud tracking method, system and device
CN112801184A
SAR image sea ice type classification method based on two-round voting strategy ensemble learning
CN112926397A
