Method for Simultaneously Tracking Position and Orientation Angle of Moving Particles Based on Image Recognition
By making significant color marks on moving particles and using image recognition technology, the problem of difficulty in tracking the position and orientation angle of moving particles in the prior art is solved, and effective analysis and research of active rotors and composite moving particles is achieved.
Patent Information
- Application Number
- CN202510433487.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-08
- Publication Date
- 2025-07-01
- Estimated Expiration
- 2045-04-08
AI Technical Summary
The prior art is difficult to track the position and orientation angle of moving particles simultaneously, especially the lack of effective methods for motion video analysis of active particles that can rotate.
By making significant color marks on moving particles, image recognition technology is used to determine the position and orientation angle of the particles. Specific steps include confirming the trajectory and orientation angle of the moving particle, using the geometric center of the pixel dot cluster and the position data of the clusters at both ends, and performing linear fit and monotonic processing.
Simultaneous confirmation of the position trajectory and orientation angle of moving particles is achieved, providing a new method to study the collective behavior of active rotors and composite moving particles models.
Smart Images

Figure CN119941779B_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of particle motion recognition, and particularly relates to a method for simultaneously tracking the position and orientation angle of moving particles based on image recognition. Background Art
[0002] Active rotors are active particles that rotate around an axis of their own while randomly moving in an external environment. They, together with active particles with a fixed moving rate (such as active Brownian particles), constitute an important model for studying the kinetic properties and collective behaviors of active matter. The additional dynamics of active rotors in the rotational degree of freedom can trigger many novel collective phenomena, such as boundary flow, chiral separation, and rotating crystals. Studying these collective phenomena of active rotors can help discover and understand the guiding principles of active matter behavior, and be used in fields such as intelligent material development and device design.
[0003] However, the research on the collective behavior of active rotors mainly focuses on theoretical calculations, and experimental models are relatively lacking. For example, particles with inclined support legs will continuously rotate on a vertically vibrating platform while randomly moving in the horizontal orientation; these active rotors provide a powerful experimental model for studying collective behavior.
[0004] Efficient particle tracking and image analysis techniques are the basis for experimentally studying the active motion of particles. Existing image analysis algorithms are only applicable to particles with certain specific structural characteristics, and algorithms for particles that can perform translational, rotational, and their combined motions need to be further developed. For particles performing translational motion, their motion parameters can be obtained by tracking the position coordinates of a point (usually the centroid) on the particle at different times, while the current technology still lacks protection for the analysis method of the motion videos of active particles that can rotate, that is, it is difficult to track the change of the particle orientation. Summary of the Invention
[0005] To solve the above problems existing in the prior art, the present invention provides a method for simultaneously tracking the position and orientation angle of moving particles based on image recognition, aiming to solve the technical problem that it is difficult to simultaneously track the position coordinates and orientation angle of moving and marked particles at different time points in the prior art.
[0006] To achieve the above object, the present invention provides the following technical solution: A method for simultaneously tracking the position and orientation angle of moving particles based on image recognition, the moving particles applicable to this method are particles that do not flip, do not overlap, undergo active Brownian motion, and rotate around an axis of their own. This method uses a microscope or a video recorder as an image acquisition device, and this method includes the following steps:
[0007] Step 1: Confirmation of the trajectory of moving particles:
[0008] 1. Make marks of the same shape, the same size, and the same color on each moving particle (such as marks with colored tape or marks based on the stable structural features existing on the surface of the moving particle), and collect images of the moving particles through an image acquisition device;
[0009] 2. Import the collected images of the moving particles into a computer, set the RGB values, and identify the pixel point clusters corresponding to the color marks on each moving particle;
[0010] 3. Set the upper threshold and the lower threshold for the size in the pixel point clusters, determine the pixel point clusters with the number of pixel points between the upper threshold and the lower threshold, and exclude other pixel point clusters. The pixel point clusters between the upper threshold and the lower threshold correspond to the color marks on the moving particles;
[0011] Specifically, develop an algorithm based on MATLAB or Python. Select any pixel point in the pixel point cluster corresponding to any color mark, record its two-dimensional coordinates, find all the pixel points adjacent to it in the horizontal and vertical directions, and so on, to locate the two-dimensional coordinates of all the pixel points in this pixel point cluster; then, in the pixel point cluster corresponding to any color mark, take the average value of the two-dimensional coordinates of all the pixel points to obtain a unique two-dimensional coordinate. This two-dimensional coordinate is the position of this pixel point cluster, that is, the position of the moving particle corresponding to this pixel point cluster.
[0012] Determine the positions of the pixel points corresponding to all the color marks, and take the pixel point corresponding to the average position of all the position data as the geometric center of the moving particle;
[0013] Determine the movement trajectories of each moving particle over a period of time according to the position data of the geometric centers of the color marks on the moving particles.
[0014] Step 2. Confirmation of the orientation angle of the moving particle:
[0015] 1. Make a circular area with the geometric center of the pixel point cluster as the center. The pixel point cluster within the circular area is the central cluster A (the number of pixel points in the central cluster A should be less than the total number of pixel points in the pixel point cluster). The remaining clusters excluding the central cluster A are at both ends, namely the end cluster B and the end cluster C;
[0016] 2. According to the position data of the end cluster B and the end cluster C, determine the positions of all the pixel points in this cluster, and take the pixel point corresponding to the average position of all the position data in each cluster as the position of the geometric center of this cluster;
[0017] 3. Define a vector α using the geometric centers of the two-terminal clusters B and C (the definition of vector α can be from the geometric center of the two-terminal cluster B to the geometric center of the two-terminal cluster C, or from the geometric center of the two-terminal cluster C to the geometric center of the two-terminal cluster B). Use the angle φ between vector α and any fixed direction, such as the angle between vector α and the X-axis, as the orientation angle of the moving particle.
[0018] 4. Obtain the orientation angles of each moving particle over a period of time, and perform linear fitting and monotonic processing to obtain the relationship between the orientation angle of each moving particle and time.
[0019] Among them, over a period of time, the orientation angles of the moving particles are taken at multiple time points. For any two adjacent time points a and b, the following conditions must be satisfied: when the moving particle rotates counterclockwise, 0 ≤ φa ≤ π and 0 ≤ φb ≤ π; when the moving particle rotates clockwise, -π ≤ φa ≤ 0 and -π ≤ φb ≤ 0.
[0020] During the image recognition process, φ can be calculated as the angle between the vector from the geometric center of the two-terminal cluster B to the geometric center of the two-terminal cluster C and the X-axis (i.e., φ1), or as the angle between the vector from the geometric center of the two-terminal cluster C to the geometric center of the two-terminal cluster B and the X-axis (φ2). These two vectors are in opposite directions, that is, |φ2 - φ1| = π. Therefore, the particle orientation angles obtained at different time points will have sudden changes. The defined mutation value of the sudden change is related to the rotational speed v of the moving particle around its own axis and the time interval t, that is: v * t < mutation value < π. When |φb - φa| > mutation value, it is regarded as a sudden change, and then φb is subtracted by π (when the moving particle rotates clockwise, φb is added by π).
[0021] At the same time, the moving particles protected by this method are also applicable to randomly rotating particles, except that the orientation angle and time are no longer linearly related.
[0022] Compared with the prior art, the beneficial effects of the present invention are:
[0023] In the prior art, image analysis algorithms are only applicable to particles with certain specific structural characteristics. However, algorithms for particles that can perform translational, rotational, and combined motions need to be further developed. For particles undergoing translational motion, their motion parameters can be obtained by tracking the position coordinates of a point (usually the centroid) on the particle at different times. However, the current technology still lacks protection for the analysis method of the motion videos of active particles that can rotate, that is, it is difficult to track the change of particle orientation. Therefore, in the present invention, by tracking the position change of significant color markers on the moving particles, the motion trajectory of the moving particles is determined. By selecting two symmetric clusters on the color marker, and the two clusters are located at both ends of the color marker, the angle between the vector determined by the geometric centers of the two clusters and a fixed direction (such as the X coordinate axis) is used as the orientation angle of the moving particle. By taking the orientation angles at multiple time points within a period of time and performing mutation removal, linear fitting, and monotonic processing on the orientation angles, the relationship between the orientation angle and time of each moving particle within a period of time can be obtained, so as to simultaneously confirm the position trajectory and orientation angle of the moving particle. Based on image recognition technology, a new method has been developed, which provides a practical algorithm for studying the collective behavior of active rotors and provides a new method for analyzing images and videos of particle models that can perform translational, rotational, and combined motions. BRIEF DESCRIPTION OF THE DRAWINGS
[0024] The drawings are used to provide a further understanding of the present invention and constitute a part of the specification. They are used together with the embodiments of the present invention to explain the present invention and do not constitute a limitation to the present invention.
[0025] In the drawings:
[0026] Figure 1 It is a schematic diagram of the method for simultaneously tracking the position and orientation angle of moving particles in the present invention;
[0027] Figure 2 It is a schematic diagram of the identification of a single moving particle based on an image in the present invention;
[0028] Figure 3 It is a schematic diagram of the confirmation of the orientation angle of a single moving particle in the present invention;
[0029] Figure 4 It is a schematic diagram of the trajectory of a single moving particle and the relationship between the orientation angle and time at different time points in the present invention;
[0030] Figure 5 It is a schematic diagram of the definition and determination of the orientation angles of two moving particles with different rotation directions in the present invention;
[0031] Figure 6 It is a schematic diagram of the motion trajectories and the relationship between the orientation angle and time of two moving particles with different rotation directions within 15 seconds in the present invention;
[0032] Figure 7 It is a schematic diagram for determining the positions and orientations of particles in the rotating particle group in the present invention. Specific embodiments
[0033] Next, the technical solutions in the embodiments of the present invention will be clearly and completely described in conjunction with the accompanying drawings in 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. All other embodiments obtained by those of ordinary skill in the art based on the embodiments of the present invention without creative efforts shall fall within the protection scope of the present invention.
[0034] Embodiment 1. In this embodiment, a method for simultaneously tracking the positions and orientation angles of moving particles based on image recognition is disclosed. The moving particles applicable to this method are particles that do not flip, do not overlap, undergo active Brownian motion, and rotate around one of their own axes. This method uses a microscope or a video recorder as an image acquisition device. This method includes the following steps:
[0035] Step 1: Confirmation of the moving particle trajectory:
[0036] 1. Make colored tape marks of the same shape, the same size, and the same color on each moving particle, and collect images of the moving particles through a video recorder;
[0037] 2. Import the collected images of the moving particles into a computer, set the RGB values, and identify the pixel point clusters corresponding to the colored tape marks on each moving particle;
[0038] 3. Set the upper limit threshold and the lower limit threshold of the size in the pixel point cluster, determine the pixel point clusters with the number of pixel points between the upper limit threshold and the lower limit threshold, and exclude other pixel point clusters. The pixel point clusters between the upper limit threshold and the lower limit threshold correspond to the colored tape marks on the moving particles;
[0039] Specifically, an algorithm is developed based on MATLAB or Python. Select any pixel point in the pixel point cluster corresponding to any colored tape mark, record its two-dimensional coordinates, find all the pixel points adjacent to it in the horizontal and vertical directions, and so on, to locate the two-dimensional coordinates of all the pixel points in this pixel point cluster; then, in the pixel point cluster corresponding to any colored tape mark, take the average value of the two-dimensional coordinates of all the pixel points to obtain a unique two-dimensional coordinate, and this two-dimensional coordinate is the position of this pixel point cluster, that is, the position of the moving particle corresponding to this pixel point cluster.
[0040] 4. Determine the positions of the pixel points corresponding to all the colored tape marks, and take the pixel point corresponding to the average value position of all the position data as the geometric center of the moving particle;
[0041] 5. Determine the movement trajectory of each moving particle within a period of time based on the position data of the geometric center of the colored tape mark on the moving particle.
[0042] Step 2. Confirmation of the orientation angle of the moving particle:
[0043] 1. Make a circular area with the geometric center of the pixel cluster as the center. The pixel cluster within the circular area is the central cluster A. Among them, the number of pixel points in the central cluster A is 40% of the total number of pixel clusters. The remaining clusters excluding the central cluster A are located at both ends, namely the end cluster B and the end cluster C.
[0044] 2. Determine the positions of all pixel points in the cluster according to the position data of the end cluster B and the end cluster C. Take the pixel point corresponding to the average position of all position data in each cluster as the position of the geometric center of the cluster.
[0045] 3. Define a vector α with the geometric centers of the end cluster B and the end cluster C, that is, define the vector α from the geometric center of the end cluster B to the geometric center of the end cluster C. Take the angle φ between the vector α and the X coordinate axis as the orientation angle of the moving particle.
[0046] 4. Obtain the orientation angle of each moving particle within a period of time, and perform linear fitting and monotonic processing to obtain the relationship between the orientation angle and time of each moving particle.
[0047] Among them, within a period of time, the orientation angles of the moving particle are taken at multiple time points. For any two adjacent time points a and b, the following conditions need to be satisfied: when the moving particle rotates counterclockwise, 0 ≤ φa ≤ π, 0 ≤ φb ≤ π; when the moving particle rotates clockwise, -π ≤ φa ≤ 0, -π ≤ φb ≤ 0.
[0048] In the process of image recognition, since φ can be calculated as the angle (i.e., φ1) between the vector from the geometric center of the end cluster B to the geometric center of the end cluster C and the X axis, and can also be calculated as the angle (φ2) between the vector from the geometric center of the end cluster C to the geometric center of the end cluster B and the X axis, these two vectors are in opposite directions, that is, |φ2 - φ1| = π. Therefore, the particle orientation angles obtained at different time points will have mutations. It is defined that the mutation value of the mutation is related to the rotation speed v of the moving particle around its own axis and the time interval t, that is: v * t < mutation value < π. When |φb - φa| > mutation value, it is regarded as a mutation, and then φb is subtracted by π (when the moving particle rotates clockwise, φb is added by π).
[0049] At the same time, the moving particles protected by this embodiment are also applicable to randomly rotating particles, except that the orientation angle and time are no longer linearly related.
[0050] Example 2. Based on the method for simultaneously tracking the position and orientation angle of moving particles based on image recognition in Example 1, this example provides the application of this method to the motion trajectory recognition and orientation angle determination of a single counterclockwise rotating moving particle, including the following steps:
[0051] Step 1: As Figure 2 shown, develop the MATLAB algorithm as in Example 1, set the RGB values, and identify the pixel points (yellow) corresponding to the colored tape marks on the moving particle;
[0052] In this step, develop the algorithm based on MATLAB:
[0053] The specific steps are as follows:
[0054] (1) Set the RGB thresholds
[0055] R_limit = 80;
[0056] G_limit = 80;
[0057] B_limit = 80;
[0058] (2) Read the image
[0059] image = imread('your_image_file.jpg');
[0060] (3) Extract the RGB values of all pixel points in the image
[0061] R = image(:, :, 1);
[0062] G = image(:, :, 2);
[0063] B = image(:, :, 3);
[0064] (4) Determine the coordinates of the pixel points that meet the RGB thresholds
[0065] mask_black = R <= R_limit & G <= G_limit & B <= B_limit;
[0066] [x_black, y_black] = find(mask_black);
[0067] (5) Visualize the result
[0068] result_image = zeros(size(image)); Create a completely black image
[0069] result_image(mask_black) = image(mask_black); Only retain the pixels that meet the conditions
[0070] imshow(uint8(result_image)); Display the result image
[0071] title('Filtered Image');
[0072] (6)Count the quantity
[0073] num_black_pixels = length(x_black); Count the number of pixels that meet the conditions
[0074] fprintf('Number of black pixels: %d\n', num_black_pixels);
[0075] (7)Save the result image (optional)
[0076] imwrite(uint8(result_image), 'filtered_image.jpg'); Save the result image.
[0077] Step 2: Set the upper threshold and lower threshold for the size in the pixel cluster, determine the pixel clusters with the number of pixels between the upper threshold and the lower threshold, exclude other pixel clusters, and the pixel clusters between the upper threshold and the lower threshold correspond to the colored tape marks on the moving particles;
[0078] Also develop an algorithm based on MATLAB:
[0079] (1)Determine all relevant pixels (such as black_pixels_remain), set the minimum (num_pixel_min) and maximum (num_pixel_max) number of pixels in the pixel cluster (such as particle), and exclude the clusters outside the threshold
[0080] if size(particle,1)<num_pixel_min || size(particle,1)>num_pixel_max
[0081] black_pixels_remain = setdiff(black_pixels_remain, particle, 'rows','stable');
[0082] (2)Retain the pixel points (pixels_on_particles) within the threshold
[0083] elseif size(particle,1)>= num_pixel_min&size(particle,1)<= num_pixel_max
[0084] pixels_on_particles = [pixels_on_particles; particle];
[0085] End.
[0086] Specifically, select a pixel point from any pixel point cluster corresponding to a color marker, record its two-dimensional coordinates, find all the pixel points adjacent to it in the horizontal and vertical directions, and so on, to locate the two-dimensional coordinates of all pixel points within the pixel point cluster; then, in any pixel point cluster corresponding to a color marker, take the average value of the two-dimensional coordinates of all pixel points to obtain a unique two-dimensional coordinate, which is the position of the pixel point cluster, that is, the position of the moving particle corresponding to the pixel point cluster;
[0087] Step 3: Determine the positions of the pixel points corresponding to all the colored tape markers, and take the pixel point corresponding to the average position of all the position data as the geometric center of the moving particle. In this embodiment, the position of the moving particle is the geometric center (solid blue dot) of the marked pixel point cluster; according to the position data of the geometric center of the colored tape marker on the moving particle, determine the movement trajectory of each moving particle over a period of time.
[0088] Step 4:
[0089] (1)As Figure 3 shown, take 40% of the clusters near the geometric center of the pixel point cluster as the central cluster A, and the remaining clusters outside the central cluster A are located at both ends, namely the end clusters B and the end clusters C, that is, the clusters corresponding to the green and cyan circles;
[0090] (2)Calculate the geometric centers (hollow blue circles 1 and 2) of the two small clusters respectively. The angle between the vector defined by these two centers (i.e., from blue circle 1 to blue circle 2) and the X coordinate is the orientation angle φ of the particle, and the calculated orientation angle is restricted within the range of 0 to 180°, that is, [0,π];
[0091] (3)Define the mutation value as 2π / 3. To prevent the orientation of the moving particle from randomly jumping in two opposite orientations, when the orientation angle shows a mutation, that is, the change is greater than 2π / 3, its value will be deducted by 180°;
[0092] (4)As Figure 4As shown, by obtaining the orientation angles of moving particles over a period of time and performing linear fitting and monotonic processing, the relationship between the orientation angles of moving particles and time can be obtained.
[0093] In this embodiment, the calculation of the orientation angle φ and the removal of mutations can both be based on algorithms developed using MATLAB or Python. The specific steps are as follows:
[0094] (1) Assume that the central coordinates of the small clusters of green and cyan pixel points are marked as center_1 and center_2. The calculation code for the orientation angle (phi) is as follows:
[0095] Step 1: Calculate the vector
[0096] vector = center_1 - center_2;
[0097] Step 2: Calculate the phi value in different cases.
[0098] (1) Case 1: The x value of the vector is greater than 0 and the y value is not less than 0, and phi is in the interval [0, π / 2);
[0099] if (vector(1)) > 0 && (vector(2)) >= 0
[0100] phi = atan((vector(2)) / (vector(1)));
[0101] (2) Case 2: The x value of the vector is less than 0 and the y value is not less than 0, and phi is in the interval (π / 2, π];
[0102] elseif (vector(1)) < 0 && (vector(2)) >= 0
[0103] phi = atan((vector(2)) / (vector(1))) + pi;
[0104] (3) Case 3: The x value of the vector is less than 0 and the y value is less than 0. Theoretically, phi is in the interval (π, 3π / 2), but it is forced to be adjusted to (0, π / 2);
[0105] elseif (vector(1)) < 0 && (vector(2)) < 0
[0106] phi = atan((vector(2)) / (vector(1)));
[0107] (4)Case 4: The x value of the vector is greater than 0 and the y value is less than 0. Theoretically, phi is in the interval (3π / 2, 2π), but it is forced to be adjusted to (π / 2, π);
[0108] elseif (vector(1))>0&&(vector(2))<0
[0109] phi = atan((vector(2)) / (vector(1)))+pi;
[0110] (5)Case 5: The x value of the vector is 0 and phi is equal to π / 2.
[0111] elseif (vector(1))==0
[0112] phi = pi / 2;
[0113] end
[0114] (2)When removing mutations:
[0115] Assume the number of images (i.e., time points) is n_t, the number of rotating particles is n_P, and all orientation angles are Phi. The code for correcting the orientation angles and removing mutations is as follows.
[0116] for j=1:n_P
[0117] for i=3:n_t
[0118] Case 1: The orientation angle at time point i is less than the orientation angle at time point i - 1, and the absolute value of the difference is greater than 2π / 3, which means that π has been wrongly subtracted from the orientation angle at time point i; therefore, π is added to the orientation angles corresponding to all time points after time point i - 1;
[0119] if Phi(i,j)<Phi(i-1,j)&&Phi(i-1,j)-Phi(i,j)>(2*pi / 3)
[0120] Phi(i:end,j) = Phi(i:end,j)+pi;
[0121] Case 2: The orientation angle at time point i is greater than the orientation angle at time point i - 1, and the absolute value of the difference is greater than 2π / 3, which means that π has been wrongly added to the orientation angle at time point i; therefore, π is subtracted from the orientation angles corresponding to all time points after time point i - 1;
[0122] elseif Phi(i,j)>Phi(i-1,j)&&Phi(i,j)-Phi(i-1,j)>(2*pi / 3)
[0123] Phi(i:end,j) = Phi(i:end,j)-pi;
[0124] end
[0125] end
[0126] End
[0127] Figure 4 The data in [object] is linearly fitted, and the rotational speed of the particles can be obtained as 7.4 rad / s.
[0128] Example 3. Based on the method for simultaneously tracking the position and orientation angle of moving particles based on image recognition in Example 1, this example also provides the application of this method to the motion trajectory recognition and orientation angle determination of moving particles with different rotation directions, including the following steps:
[0129] Step 1: As Figure 5 shown, develop the MATLAB algorithm as in Example 2, repeat the steps for motion trajectory confirmation in Example 1, set the RGB values, identify the pixel points (red) corresponding to the colored tape marks (black) on the two moving particles, and identify the positions of the two moving particles as the geometric centers (solid blue dots) of the marked pixel point clusters; determine the motion trajectories of the two moving particles over a period of time based on the position data of the geometric centers of the colored tape marks on the moving particles.
[0130] Step 2:
[0131] As Figure 5 shown, continue to repeat the steps for orientation angle confirmation in Example 1, and respectively determine the positions and orientation angles of the circular rotor and the triangular rotor in the two moving particles. Among them, the circular rotor rotates counterclockwise, and the triangular rotor rotates clockwise;
[0132] Among them, the orientation angle of the counterclockwise rotating circular rotor takes a positive value, and the orientation angle is restricted within the range of 0 to 180°, that is, [0,π], and the orientation angle of the clockwise rotating triangular rotor takes a negative value, and the orientation angle is restricted within the range of -180° to 0°, that is, [-π,0];
[0133] Similarly, obtain the orientation angles of the two moving particles within 15 s, and perform linear fitting and monotonic processing to obtain the relationship between the orientation angle of the moving particles and time;
[0134] Among them, as Figure 6 shown, the data is linearly fitted, and the rotational speeds of the counterclockwise rotating circular rotor and the clockwise rotating triangular rotor are 23.9 and 22.7 rad / s respectively.
[0135] Example 4. Based on the method for simultaneously tracking the position and orientation angle of moving particles based on image recognition in Example 1, this example also provides the application of this method to the recognition of the motion trajectories and determination of the orientation angles of each moving particle in a rotating particle group, including the following steps:
[0136] Step 1: As shown in Figure 5 , develop the MATLAB algorithm as in Example 2, repeat the steps for motion trajectory confirmation in Example 1, set the RGB values, identify the pixel points (red) corresponding to the colored tape marks (black) on two moving particles, and identify the positions of the two moving particles as the geometric centers (solid blue dots) of the marked pixel point clusters; determine the motion trajectories of the two moving particles over a period of time based on the position data of the geometric centers of the colored tape marks on the moving particles.
[0137] Step 2:
[0138] As shown in Figure 7 , continue to repeat the steps for orientation angle confirmation in Example 1 to determine the position and orientation angle of each moving particle;
[0139] Among them, the orientation angle of counterclockwise rotation takes a positive value, and the orientation angle is restricted within the range of 0 to 180°, that is, [0, π], and the orientation angle of clockwise rotation takes a negative value, and the orientation angle is restricted within the range of -180° to 0°, that is, [-π, 0];
[0140] Similarly, obtain the orientation angle of each moving particle within 15 s, and perform linear fitting and monotonic processing to obtain the relationship between the orientation angle of the moving particle and time;
[0141] Among them, as shown in Figure 7 , the positions (solid blue dots) and orientations (blue arrows) of all particles can be obtained.
[0142] Finally, it should be noted that the above are only the preferred embodiments of the present invention and are not used to limit the present invention. Although the present invention has been described in detail with reference to the foregoing embodiments, for those skilled in the art, they can still modify the technical solutions recorded in the foregoing embodiments, or perform equivalent replacements for some of the technical features. Any modifications, equivalent replacements, improvements, etc. made within the spirit and principle of the present invention shall be included in the protection scope of the present invention.
Claims
1. A method for simultaneously tracking the position and orientation angle of moving particles based on image recognition, wherein the method is applicable to moving particles that do not flip, do not overlap, undergo active Brownian motion, and rotate around one of their own axes, and is characterized by: The method collects image information of moving particles by an image acquisition device, and the method comprises the following steps: Sp1: Identification of moving particles: Make the same color mark on each moving particle, and collect image information of the moving particles through an image acquisition device, then import the collected image information into a computer, set the RGB value, and identify the pixel cluster corresponding to the color mark on the moving particle; Sp2: Confirmation of moving particle trajectories: Sp2-1: Confirmation of geometric center: Determine the geometric center of the color mark on the moving particle based on the position data of the pixel cluster corresponding to the color mark on the moving particle; Sp2-2: Determine the movement trajectory of each moving particle over a period of time based on the position data of the geometric center of the color mark on the moving particle; Sp3: Confirmation of orientation angle: Sp3-1: A circular area is determined with the geometric center of the pixel cluster as the center, and the pixel cluster within the circular area is the central cluster A. Among the pixel clusters corresponding to the color mark, the remaining clusters excluding the central cluster A are located at the two ends, namely, the two end clusters B and the two end clusters C; Sp3-2: Determine the geometric centers of the two end clusters B and the two end clusters C according to the position data of the two end clusters B and the two end clusters C; Sp3-3: The vector α is defined by the geometric centers of the two end clusters B and C, and the angle φ between the vector α and any fixed direction is taken as the orientation angle of the moving particle; Sp4: Obtain the orientation angle of each moving particle within a period of time, and perform linear fitting and monotonic processing to obtain the relationship between the orientation angle of each moving particle and time; Wherein, in the step Sp3-3, the vector α is defined as the geometric center of the two end clusters B pointing to the geometric center of the two end clusters C, or the geometric center of the two end clusters C pointing to the geometric center of the two end clusters B; In the step Sp4, when obtaining the orientation angle of each moving particle within a period of time, the following steps are included: Sp4-1: Determine the time interval t according to the rotation speed v of the moving particle around one of its own axes. The time interval t is the time from time point a to time point b. The orientation angle φ of the moving particle is obtained once every time interval t. Sp4-2: Orientation angle φa of the moving particle at time point a, after a time interval t, orientation angle φb of the moving particle at time point b. When orientation angle φb changes suddenly compared with orientation angle φa, subtract or increase orientation angle φb by π; When the moving particle rotates counterclockwise, in the time interval t, |φb-φa|<π, and 0≤φ≤π; In the step Sp4-2, when the orientation angle φb changes suddenly compared with the orientation angle φa, the sudden change value is defined to be related to the rotation speed v of the moving particle around one axis thereof and the time interval t, that is: v*t<mutation value<π; When |φb-φa|>mutation value, it is considered that a mutation has occurred, and φb is subtracted from π.
2. The method for simultaneously tracking position and orientation angle according to claim 1, characterized in that: In the step Sp1, when identifying moving particles, it is necessary to exclude pixel clusters that are not related to color markings, which includes the following steps: Sp1-1: Set the upper and lower thresholds of the size of the pixel clusters, determine the pixel clusters whose number of pixels is between the upper and lower thresholds, exclude other pixel clusters, and the pixel clusters between the upper and lower thresholds are the color marks on the corresponding moving particles.
3. The method for simultaneously tracking position and orientation angle according to claim 1, characterized in that: In the step Sp2-1 and the step Sp3-2, the confirmation of the geometric center of the moving particle and the confirmation of the geometric center of the two-end cluster B and the two-end cluster C include the following steps: In the cluster whose geometric center needs to be determined, including the pixel cluster corresponding to the color mark, as well as the two end clusters B and C, the positions of all pixel points in the cluster are determined, and the pixel point corresponding to the average position of all position data is taken as the position of the geometric center of the cluster.
4. The method for simultaneously tracking position and orientation angle according to claim 1, characterized in that: In the step Sp3-1, in the same color mark, the number of pixels in a circular area determined with the geometric center of the pixel cluster as the center is less than the total number of pixels in the pixel cluster corresponding to the color mark.
5. The method for simultaneously tracking position and orientation angle according to claim 1, characterized in that: When the moving particle rotates clockwise, in the time interval t, |φb-φa|<π, and -π≤φ≤0.
6. The method for simultaneously tracking position and orientation angle according to claim 1, characterized in that: The moving particle rotates around one of its own axes in a uniform rotation or non-uniform rotation; Among them, for the moving particles rotating at a uniform speed, the orientation angle has a linear relationship with time, while for the moving particles rotating at a non-uniform speed, the orientation angle has a non-linear relationship with time.
Citation Information
Patent Citations
Particle material motion trail acquisition method and device, electronic equipment and storage medium
CN117456451A
Tracking method for massive moving particles based on image recognition
CN119559214A