Vertical Axis Vortex Identification and Tracking Algorithm
Through the vertical axis vortex recognition and tracking algorithm in MATLAB, combined with image processing and artificial intelligence technology, the accuracy and adaptability problems of vertical axis vortex recognition and tracking are solved, and efficient identification and continuous tracking of complex flow fields are realized, and the results are visualized to meet the diverse output needs.
Patent Information
- Application Number
- CN202411563947.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-05
- Publication Date
- 2025-07-25
- Estimated Expiration
- 2044-11-05
AI Technical Summary
The existing vertical axis vortex recognition methods are difficult to accurately capture all features when dealing with complex flow fields, and lack effective algorithms to track the evolution of vertical axis vortex in real time and continuously.
Using MATLAB-based vertical axis vortex recognition and tracking algorithm, through image processing, pattern recognition and artificial intelligence technology, normalized cross-correlation calculation and center of mass coordinate extraction, combined with feature template training, the recognition and continuous tracking of vertical axis vortex is achieved.
It improves the accuracy and adaptability of vertical axis vortex recognition, realizes continuous tracking and efficient positioning, visualizes the results, meets different user needs, and improves the practicality and readability of the technology.
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of vertical axis vortex identification, specifically to a vertical axis vortex identification and tracking algorithm. Background Art
[0002] Currently, there are various existing vertical axis vortex identification methods, such as the vortex identification method based on the velocity gradient tensor, the vortex identification method based on Rortex, etc., which have many limitations in practical applications. For example, some methods may not be able to accurately capture all the characteristics of the vertical axis vortex when dealing with complex flow fields; there are also some methods that may be restricted by factors such as computing resources and data accuracy, and it is difficult to achieve high-precision identification in real-time monitoring. In addition, the research on the tracking of vertical axis vortices is relatively less, and there is a lack of effective algorithms that can track the evolution process of vertical axis vortices in real-time and continuously.
[0003] Based on this, the present invention provides a vertical axis vortex identification and tracking algorithm to solve the above-mentioned technical problems. Summary of the Invention
[0004] The purpose of the present invention is to provide a vertical axis vortex identification and tracking algorithm, which can improve the identification accuracy and enhance the adaptability in vertical axis vortex identification, can achieve continuous tracking and improve the tracking efficiency in vertical axis vortex tracking, and in terms of result output and visualization, the diverse output forms can meet the needs of different users, improve the practicality of the technology, and realize the intuitive visualization of the results by drawing the identification results, tracking trajectories, characteristic analysis charts, etc. of the vertical axis vortices, which helps to intuitively understand the motion laws of the vertical axis vortices and improves the readability and usability of the technology.
[0005] To achieve the above purpose, the present invention provides the following technical solutions:
[0006] The present invention provides a vertical axis vortex identification and tracking algorithm, including the following steps:
[0007] S1. Environment configuration and data preparation: In the MATLAB environment, clear the variables in the workspace, turn off all warning messages, and obtain the paths of the specified folders in the current working directory and the upper-level directory; read all the vertical axis vortex image files in the specified format in the specified folder; load the pre-trained vertical axis vortex feature template containing the typical image features of the vertical axis vortex.
[0008] S2. Vertical axis vortex identification: Read the obtained image, perform normalized cross-correlation calculation, then set the matching degree threshold, extract and adjust the centroid coordinates of the connected regions, then display the image and mark the vortex positions, and extract the local images of the vortices. After capturing and storing the extracted image frames, clear the image.
[0009] S3. Vertical axis vortex tracking: Extract the coordinates of a certain vertical axis vortex in a certain frame of image, regard it as the tracking object and use it as the initial position for tracking; then perform trajectory tracking; then extract the vortex image sequence and visualize the vortex trajectory; finally, calculate the area and velocity of the vortex and output the results.
[0010] The present invention is further configured such that: in the step S1, the specified folder is read using the dir function.
[0011] The present invention is further configured such that: in the step S41, the specified format file is a file ending with.jpg.
[0012] The present invention is further configured such that: in the step S2, the specific process is as follows:
[0013] S21. Image reading: For each frame of image, use the imread function to read the image data and store it in the variable A;
[0014] S22. Normalized cross-correlation calculation: Use the normxcorr2 function to calculate the normalized cross-correlation between the image A and the vertical axis vortex feature template vorxPattern to obtain the matching degree matrix c;
[0015] S23. Matching degree threshold setting: Set the matching degree threshold, screen out the regions with a matching degree higher than the threshold, regard them as potential vertical axis vortex positions, and store them in the variable cr;
[0016] S24. Centroid coordinate extraction and adjustment: Extract the centroid coordinates of each connected region in cr, and adjust the centroid coordinates according to the size of the vertical axis vortex feature template vorxPattern to make them correspond to the actual position of the vertical axis vortex, and merge and store these coordinates in the variable cCen;
[0017] S25. Display the image and mark the vortex position: Display the current frame image A through the imshow function, initialize a cell array vortexs to store the local image area of each vortex, and draw a rectangular box to mark the recognized vertical axis vortex position;
[0018] S26. Extract the local vortex image: Intercept the vertical axis vortex image in the original image A and extract the local image area containing the vertical axis vortex centered on the centroid, and store it in the variable vortexs;
[0019] S27. Capture the image frame and store it: Use the getframe function to capture the image frame of the current axis and store it in the variable F, and store the adjusted vortex center coordinates, the local vortex image, and the captured image frame in the cell array results;
[0020] S28. Clear the image for subsequent preparation: Clear the current figure window to prepare for processing the next frame of the image.
[0021] The present invention is further configured such that: in the step S22, the matching degree matrix c = nor mxcorr2(vorxPattern, A).
[0022] The present invention is further configured such that: in the step S24, the function used to extract the centroid coordinates of each connected region in cr is the regionprops function.
[0023] The present invention is further configured such that: in the step S3, the specific process is as follows:
[0024] S31. Initialize trajectory tracking: Extract the coordinates of a certain vertical axis vortex in a certain frame of the image, regard it as the tracking object, and use it as the initial position of the tracking.
[0025] S32. Trajectory tracking: Initialize an empty array vortexline to store the motion trajectory of the vortex. Traverse the images from the 37th frame to the 180th frame. For each frame of the image, extract the centroid coordinates of all the identified vertical axis vortices in the current frame, calculate the Euclidean distance between the centroid of these vortices and the position of the vortices in the previous frame, find the vortex with the minimum distance, and use it as the tracking object for the current frame.
[0026] S33. Extract the vortex image sequence: Initialize an empty array imgN to store the image sequence of the tracked vortices. Traverse each vortex position in vortexline, extract the local image of the vortex from the corresponding frame image, and add it to imgN.
[0027] S34. Visualize the vortex trajectory: Use the montage function to display the morphology of a single vortex changing over time, and draw the historical motion trajectory of the vortex on the original image.
[0028] S35. Calculate the area and velocity of the vortex: Convert each vortex image in imgN to a grayscale image, then perform binary processing, and use the regionprops function to calculate the area of each vortex. Calculate the change in the position of the vortex between adjacent frames to estimate the velocity of the vortex.
[0029] S36. Result output: Plot the relationship between the velocity and radius of a single vortex structure as a graph, plot the change in the area of a single vortex structure over time as a graph, and output a prompt message.
[0030] The present invention is further configured such that: in the step S32, if the minimum distance is less than the set threshold, update the position information of the tracking object and add it to vortexline.
[0031] Compared with the prior art, the beneficial effects of the present invention are as follows:
[0032] (1) In terms of vertical-axis vortex recognition, the present invention not only integrates advanced technologies such as image processing, pattern recognition, and artificial intelligence, can extract the features of vertical-axis vortices more accurately, thereby improving the recognition accuracy. Compared with the traditional "rule"-based recognition method, this "feature"-based recognition method can better adapt to complex and changing fluid environments. Moreover, by training feature templates, it can adapt to vertical-axis vortex recognition tasks in different scenarios, enhancing the adaptability and generality of the technology.
[0033] (2) In terms of vertical-axis vortex tracking, the present invention realizes continuous tracking of vertical-axis vortices, thereby providing the complete motion trajectory of vertical-axis vortices, which is of great significance for studying the motion laws of vertical-axis vortices and predicting their development trends. At the same time, by calculating the Euclidean distance between all recognized vertical-axis vortices in the current frame and the position of the tracking object in the previous frame, the vertical-axis vortex with the smallest distance is found as the tracking object in the current frame. This method can quickly locate the tracking object and improve the tracking efficiency.
[0034] (3) In terms of result output and visualization, the present invention saves the image data, position information, feature parameters, etc. generated during the recognition and tracking processes to a specified folder and synthesizes them into a video file for subsequent analysis and display. The diverse output forms can meet the needs of different users and improve the practicality of the technology. In addition, by drawing the recognition results, tracking trajectories, feature analysis charts, etc. of vertical-axis vortices, the intuitive visualization of the results is realized, which helps to intuitively understand the motion laws of vertical-axis vortices and improves the readability and usability of the technology. Detailed implementation manners
[0035] Next, the technical solutions in the embodiments of the present invention will be clearly and completely described in conjunction with the embodiments of the present invention. Obviously, the described embodiments are only a part of the embodiments of the present invention, rather than all the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without making creative efforts belong to the scope of protection of the present invention.
[0036] Embodiment:
[0037] This embodiment provides a vertical-axis vortex recognition and tracking algorithm, and an implementation process thereof is as follows:
[0038] 1. Environment configuration and data preparation:
[0039] S11. In the MATLAB environment, first clear the variables in the workspace, turn off all warning messages, and obtain the paths of the "functional module" folder in the current working directory and the upper-level directory.
[0040] S12. Use the dir function to read all the vertical-axis vortex image files ending with ".jpg" in the specified folder. Through an automated image processing process, the efficiency of vertical-axis vortex recognition and tracking is greatly improved, the need for manual operations is reduced, and the consistency and accuracy of data processing are ensured.
[0041] S13. Load the pre-trained vertical-axis vortex feature template (vorxPattern.mat) containing the typical image features of the vertical-axis vortex for subsequent image matching and recognition.
[0042] 2. Vertical-axis vortex recognition:
[0043] S21. Image reading: For each frame of the image, use the imread function to read the image data and store it in the variable A.
[0044] S22. Normalized cross-correlation calculation: Use the normxcorr2 function to calculate the normalized cross-correlation between the image A and the vertical-axis vortex feature template vorxPattern to improve the recognition of similar features in the image and obtain the matching degree matrix c.
[0045] Among them, c = normxcorr2(vorxPattern, A).
[0046] S23. Matching degree threshold setting: Set the matching degree threshold to 0.6, and screen out the regions with a matching degree higher than the threshold, which are regarded as potential vertical-axis vortex positions and stored in the variable cr, that is, cr = c > 0.6.
[0047] S24. Centroid coordinate extraction and adjustment: Use the regionprops function to extract the centroid coordinates of each connected region in cr, that is, the centroid coordinates of the potential vertical-axis vortex region, and adjust the centroid coordinates according to the template size to make them correspond to the actual position of the vertical-axis vortex. Combine these coordinates and store them in the variable cCen. By extracting and adjusting the centroid coordinates, the actual position of the vertical-axis vortex can be accurately located, providing a basis for the tracking and analysis of the vortex.
[0048] Among them, cCen = regionprops(cr, 'Centroid').
[0049] S25. Display the image and mark the vortex position: Display the current frame image A through the imshow function, and initialize a cell array vortexs to store the local image region of each vortex; draw a rectangular box to mark the recognized vertical-axis vortex position.
[0050] S26. Extract the local image of the vortex: Intercept the vertical-axis vortex image in the original image A and extract the local image region containing the vertical-axis vortex centered on the centroid and store it in the variable vortexs.
[0051] S27. Capture and store the image frame: Use the getframe function to capture the image frame of the current axis and store it in the variable F. Store the adjusted coordinates of the vortex center, the local image of the vortex, and the captured image frame in the cell array results.
[0052] S28. Clear the image for subsequent preparation: Clear the current figure window to prepare for processing the next image frame.
[0053] 3. Vertical-axis vortex tracking
[0054] S31. Initialize trajectory tracking: Output a prompt message indicating the start of the trajectory tracking calculation for a single vertical-axis vortex. Extract the coordinates of a vertical-axis vortex in a certain frame of the image as the tracking object, which serves as the initial position for tracking.
[0055] S32. Trajectory tracking: Initialize an empty array vortexline to store the motion trajectory of the vortex. Traverse the images from frame 37 to frame 180. For each frame of the image, extract the centroid coordinates of all identified vertical-axis vortices in the current frame, calculate the Euclidean distance between the centroid of these vortices and the position of the vortices in the previous frame, find the vortex with the minimum distance, and use it as the tracking object for the current frame. If the minimum distance is less than the set threshold (20 pixels), update the position information of the tracking object and add it to vortexline.
[0056] S33. Extract the vortex image sequence: Initialize an empty array imgN to store the image sequence of the tracked vortices; traverse each vortex position in vortexline, extract the local image of the vortex from the corresponding frame image, and add it to imgN.
[0057] S34. Visualize the vortex trajectory: Use the montage function to display the morphology of a single vortex changing over time, and draw the historical motion trajectory of the vortex on the original image.
[0058] S35. Calculate the area and velocity of the vortex: Convert each vortex image in imgN to a grayscale image, then perform binarization processing, and use the regionprops function to calculate the area of each vortex, calculate the change in the position of the vortex between adjacent frames, and estimate the velocity of the vortex.
[0059] S36. Result output: Plot the relationship between the velocity and radius of a single vortex structure as a chart, plot the change in the area of a single vortex structure over time as a chart, and output a prompt message indicating that the results have been saved as an MP4 video file and the program processing is complete.
[0060] In the description of this specification, the descriptions referring to the terms "one embodiment", "example", "specific example", etc. mean that the specific features, structures, materials or characteristics described in connection with the embodiment or example are included in at least one embodiment or example of the present invention. In this specification, the schematic representations of the above terms do not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described may be combined in any one or more embodiments or examples in a suitable manner.
[0061] The preferred embodiments of the present invention disclosed above are only used to help explain the present invention. The preferred embodiments do not describe all the details in detail, nor do they limit the invention to the specific embodiments described. Obviously, many modifications and variations can be made according to the content of this specification. These embodiments are selected and specifically described in this specification in order to better explain the principles and practical applications of the present invention, so that those skilled in the art can well understand and utilize the present invention. The present invention is only limited by the claims and their full scope and equivalents.
Claims
1. Vertical-axis vortex identification and tracking algorithm, characterized in that It includes the following steps: S1. Environment configuration and data preparation: In the MATLAB environment, clear the variables in the workspace, turn off all warning messages, and obtain the paths of the current working directory and the specified folder in the upper-level directory; read all the vertical-axis vortex image files to be detected included in the files with the specified format in the specified folder; load the pre-trained vertical-axis vortex feature template containing the typical image features of the vertical-axis vortex. S2. Vertical-axis vortex recognition: Read the obtained image, perform normalized cross-correlation calculation, then set the matching degree threshold, extract and adjust the centroid coordinates of the connected regions, then display the image and mark the vortex positions, and extract the local images of the vortices. After capturing and storing the extracted image frames, clear the image. The specific process is as follows: S21. Image reading: For each frame of the image, use the imread function to read the image data and store it in the variable A. S22. Normalized cross-correlation calculation: Use the normxcorr2 function to calculate the normalized cross-correlation between the image A and the vertical-axis vortex feature template vorxPattern to obtain the matching degree matrix c. S23. Setting the matching degree threshold: Set the matching degree threshold, filter out the regions with a matching degree higher than the threshold, regard them as potential vertical-axis vortex positions, and store them in the variable cr. S24. Extraction and adjustment of centroid coordinates: Extract the centroid coordinates of each connected region in cr, and adjust the centroid coordinates according to the size of the vertical-axis vortex feature template vorxPattern to make them correspond to the actual positions of the vertical-axis vortices, and merge and store these coordinates in the variable cCen. S25. Displaying the image and marking the vortex positions: Display the current frame image A through the imshow function, initialize a cell array vortexs to store the local image regions of each vortex, and draw a rectangular box to mark the recognized vertical-axis vortex positions. S26. Extracting the local images of the vortices: Intercept the vertical-axis vortex images in the original image A and extract the local image regions containing the vertical-axis vortices centered on the centroid, and store them in the variable vortexs. S27. Capturing and storing the image frames: Use the getframe function to capture the image frames of the current axis and store them in the variable F, and store the adjusted vortex center coordinates, the local images of the vortices, and the captured image frames in the cell array results. S28. Clearing the image for subsequent preparation: Clear the current figure window to prepare for processing the next frame of the image. S3. Vertical-axis vortex tracking: Extract the coordinates of a certain vertical-axis vortex in a certain frame of the image, regard it as the tracking object and use it as the initial position of the tracking; then perform trajectory tracking; then extract the vortex image sequence and visualize the vortex trajectories; finally, calculate the area and speed of the vortices and output the results.
2. The vertical-axis vortex identification and tracking algorithm according to claim 1, wherein In the step S1, the specified folder is read using the dir function.
3. The vertical-axis vortex identification and tracking algorithm according to claim 1, characterized in that, In the step S41, the specified format file is a file ending with.jpg.
4. The vertical-axis vortex identification and tracking algorithm according to claim 1, wherein In the step S22, the matching degree matrix c = nor mxcorr2(vorxPattern, A).
5. The vertical-axis vortex recognition and tracking algorithm according to claim 1, wherein In the step S24, the function used to extract the centroid coordinates of each connected region in cr is the regionprops function.
6. The vertical-axis vortex recognition and tracking algorithm according to claim 1, characterized in that In the step S3, the specific process is as follows: S31. Initialize trajectory tracking: Extract the coordinates of a certain vertical axis vortex in a certain frame of the image, regard it as the tracking object, and use it as the initial position of the tracking. S32. Trajectory tracking: Initialize an empty array vortexline to store the motion trajectory of the vortex. Traverse the images from the 37th frame to the 180th frame. For each frame of the image, extract the centroid coordinates of all recognized vertical axis vortices in the current frame, calculate the Euclidean distance between the centroid of these vortices and the position of the vortices in the previous frame, find the vortex with the smallest distance, and use it as the tracking object in the current frame. S33. Extract the vortex image sequence: Initialize an empty array imgN to store the image sequence of the tracked vortices. Traverse each vortex position in vortexline, extract the local image of the vortex from the corresponding frame image, and add it to imgN. S34. Visualize the vortex trajectory: Use the montage function to display the morphology of a single vortex changing with time, and draw the historical motion trajectory of the vortex on the original image. S35. Calculate the area and velocity of the vortex: Convert each vortex image in imgN into a grayscale image, then perform binarization processing, and use the regionprops function to calculate the area of each vortex, calculate the change in the position of the vortex between adjacent frames, and estimate the velocity of the vortex. S36. Result output: Plot the relationship between the velocity and radius of a single vortex structure as a chart, plot the change in the area of a single vortex structure over time as a chart, and output a prompt message.
7. The vertical-axis vortex identification and tracking algorithm according to claim 6, characterized in that, In the step S32, if the minimum distance is less than the set threshold, update the position information of the tracking object and add it to vortexline.
Citation Information
Patent Citations
Cross-modal target tracking method based on visual semantics
CN117474950A
Automatic tracking circulation calculation method for moving vortex structure
CN118445922A