Tracking method for a large number of moving particles based on image recognition
By introducing color marks on the particles and using image recognition technology, the stability and repeatability issues of tracking the motion trajectories of a large number of particles are solved, and efficient and economical particle position and trajectory identification is achieved.
Patent Information
- Application Number
- CN202510116732.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-01-24
- Publication Date
- 2025-09-23
- Estimated Expiration
- 2045-01-24
AI Technical Summary
In the existing technology, the stability and repeatability of tracking the motion trajectories of a large number of active particles are not high. The fluorescent labeling method increases the complexity and cost and affects the stability of the method.
By introducing stable and non-interfering colored marks (such as colored tape) on the particles, using image recognition technology, setting RGB thresholds and pixel cluster thresholds, and developing a MATLAB algorithm to identify and track particle positions and record particle motion trajectories.
It achieves stable and highly repeatable motion trajectory tracking of a large number of particles, reduces time and economic costs, and ensures long-term tracking stability.
Smart Images

Figure CN119559214B_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of particle motion trajectory recognition, and in particular relates to a method for tracking a large number of moving particles based on image recognition. Background Art
[0002] Living matter, composed of a large number of monomers in continuous motion, is a typical example of a nonequilibrium system and a hot topic of international research. The study of living matter has already impacted traditional statistical physics, giving rise to novel thermodynamic concepts such as active pressure and effective temperature. Furthermore, the study of living matter contributes to our understanding of fundamental scientific questions such as the evolution of topological defects in active nematic phases, bacterial aggregation, and cellular chemotaxis. It also provides valuable insights into the design and fabrication of intelligent living materials and micro-nanomachines with important applications in engineering materials.
[0003] Particles undergoing active Brownian motion have long been a crucial tool for studying living matter. While computer simulations have been the primary method, experimental approaches have lagged significantly behind. However, efficient particle tracking and image analysis techniques are essential for experimentally studying the motion and collective behavior of living particles.
[0004] For the movement of single active particles, simple fluorescent labeling and microscopy can be used to track the particles. However, for a large number of particles, fluorescent labeling will significantly increase the complexity of particle preparation, resulting in additional time and economic costs. At the same time, fluorescence quenching will also affect the stability and repeatability of the method.
[0005] Therefore, a stable and reproducible method to track the trajectories of a large number of particles is necessary. Summary of the Invention
[0006] In order to solve the above-mentioned problems existing in the prior art, the present invention provides a method for tracking a large number of moving particles based on image recognition, aiming to solve the technical problems in the prior art of low stability and repeatability in tracking the motion trajectories of particles undergoing Brownian motion.
[0007] To achieve the above objectives, the present invention provides the following technical solution: a method for tracking a large number of moving particles based on image recognition. The method is applicable to moving particles that do not flip or overlap and undergo active Brownian motion. The method uses a microscope or a video recorder as an image acquisition device and comprises the following steps:
[0008] Step 1: Identification of moving particles;
[0009] 1. Mark each moving particle with the same shape, size, and color (such as a colored tape mark or a mark based on the stable structural features on the surface of the moving particle), and use an image acquisition device to capture images of the moving particles;
[0010] 2. Import the collected images of moving particles into the computer, set the RGB values, and identify the pixel clusters corresponding to the color marks on each moving particle;
[0011] 3. Set the upper and lower thresholds for the size of 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 corresponding color marks on the moving particles;
[0012] Specifically, an algorithm is developed based on MATLAB or Python. One pixel is selected from a pixel cluster corresponding to any color mark, its two-dimensional coordinates are recorded, and all pixels adjacent to it in the horizontal and vertical directions are found. Similarly, the two-dimensional coordinates of all pixels in the pixel cluster are located. Then, in a pixel cluster corresponding to any color mark, the two-dimensional coordinates of all pixels are averaged to obtain a unique two-dimensional coordinate. This two-dimensional coordinate is the position of the pixel cluster, that is, the position of the moving particles corresponding to the pixel cluster.
[0013] 4. Determine the positions of the pixels corresponding to all color markers, and take the pixel corresponding to the average position of all position data as the position of the moving particle;
[0014] Step 2: Identify the trajectory of moving particles: Locate the position of each moving particle at different time points and record the movement trajectory of all moving particles within a period of time.
[0015] The resolution of the image acquisition device is negatively correlated with the particle size of the moving particles and the size of the color mark.
[0016] Compared with the prior art, the present invention has the following beneficial effects:
[0017] Existing research on the motion of active particles undergoing Brownian motion is relatively basic. The motion of a single active particle can be tracked using simple fluorescent labeling and microscopy. However, for large numbers of particles, fluorescent labeling significantly increases the complexity of particle preparation, resulting in additional time and financial costs. Furthermore, fluorescence quenching can affect the stability and repeatability of this method. In contrast, the present invention introduces a stable and distinct color mark (such as colored tape) onto the moving particles, develops an algorithm to identify this color mark, and calculates and records the average position of the pixel corresponding to the color mark, thereby achieving stable tracking of particles undergoing active Brownian motion. Crucially, the color mark is stable and does not interfere with each other, ensuring that large numbers of moving particles can be tracked over long periods of time. BRIEF DESCRIPTION OF THE DRAWINGS
[0018] The accompanying drawings are used to provide further understanding of the present invention and constitute a part of the specification. They are used to explain the present invention together with the embodiments of the present invention and do not constitute a limitation of the present invention.
[0019] In the attached figure:
[0020] Figure 1 Schematic diagram of the identification of a single moving particle in the present invention;
[0021] Figure 2 Schematic diagram of five moving particles being identified simultaneously in the present invention;
[0022] Figure 3 A schematic diagram of a pixel cluster on a particle and the positioning of its geometric center in the present invention;
[0023] Figure 4 Schematic diagram of the simultaneous positioning of multiple moving particles in the present invention;
[0024] Figure 5 Schematic diagram of the trajectories of five moving particles in 20 seconds in the present invention;
[0025] Figure 6 is a schematic diagram of the simultaneous identification of different particles in a particle mixture in the present invention;
[0026] Figure 7 Schematic diagram of the motion trajectories of all moving particles in the particle mixture of the present invention;
[0027] Figure 8 Schematic diagram of the steps for identifying a large number of moving particles in the present invention. DETAILED DESCRIPTION
[0028] The following will clearly and completely describe the technical solutions in the embodiments of the present invention in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of the present invention.
[0029] Example 1:
[0030] In this embodiment, a method for tracking a large number of moving particles based on image recognition is disclosed. This method is applicable to moving particles that do not flip, do not overlap, and undergo active Brownian motion. The method uses a video recorder as an image acquisition device and includes the following steps:
[0031] Step 1: Identification of moving particles;
[0032] 1. Mark each moving particle with colored tape and capture images of the moving particles using a video recorder;
[0033] 2. Import the collected images of moving particles into the computer, set the RGB values, and identify the pixel clusters corresponding to the colored tape marks on each moving particle;
[0034] Specifically, in this embodiment, the algorithm is developed based on MATLAB:
[0035] The specific steps are as follows:
[0036] (1) Set RGB threshold
[0037] R_limit = 80;
[0038] G_limit = 80;
[0039] B_limit = 80;
[0040] (2) Reading an image
[0041] image = imread('your_image_file.jpg');
[0042] (3) Extract the RGB values of all pixels in the image
[0043] R = image(:, :, 1);
[0044] G = image(:, :, 2);
[0045] B = image(:, :, 3);
[0046] (4) Determine the coordinates of the pixel points that meet the RGB threshold
[0047] mask_black = R<= R_limit&G<= G_limit&B<= B_limit;
[0048] [x_black, y_black] = find(mask_black);
[0049] (5) Visualization results
[0050] result_image = zeros(size(image)); creates a completely black image
[0051] result_image(mask_black) = image(mask_black); Only pixels that meet the conditions are retained
[0052] imshow(uint8(result_image)); Display the result image
[0053] title('Filtered Image');
[0054] (6) Statistical quantity
[0055] num_black_pixels = length(x_black); Count the number of pixels that meet the conditions
[0056] fprintf('Number of black pixels: %d\n', num_black_pixels);
[0057] (7) Save the result image (optional)
[0058] imwrite(uint8(result_image), 'filtered_image.jpg'); saves the result image.
[0059] Thus, the pixel points corresponding to the black color marks on the moving particles are identified;
[0060] Set the upper and lower thresholds for 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 colored tape marks on the corresponding moving particles;
[0061] Also developed based on MATLAB:
[0062] (1) Determine all relevant pixels (such as black_pixels_remain), set the minimum value (num_pixel_min) and maximum value (num_pixel_max) of the number of pixels in the pixel cluster (such as particle), and exclude clusters outside the threshold.
[0063] if size(particle,1)<num_pixel_min || size(particle,1)> num_pixel_max
[0064] black_pixels_remain = setdiff(black_pixels_remain, particle,'rows', 'stable');
[0065] (2) Retain pixels within the threshold (pixels_on_particles)
[0066] elseif size(particle,1)>= num_pixel_min&size(particle,1)<= num_pixel_max
[0067] pixels_on_particles = [pixels_on_particles; particle];
[0068] End.
[0069] Select any pixel in the pixel cluster corresponding to any colored tape mark, record its 2D coordinates, find all pixels adjacent to it in the horizontal and vertical directions, and so on, locate the 2D coordinates of all pixels in the pixel cluster;
[0070] Then, in any pixel cluster corresponding to a colored tape mark, the two-dimensional coordinates of all pixels are averaged to obtain a unique two-dimensional coordinate. This two-dimensional coordinate is the position of the pixel cluster, that is, the position of the moving particle corresponding to the pixel cluster.
[0071] 4. Determine the positions of the pixels corresponding to all colored tape marks, and take the pixel corresponding to the average position of all position data as the position of the moving particle;
[0072] Step 2: Identification of moving particle trajectories: Locate the position of each moving particle at different time points and record the movement trajectories of all moving particles over a period of time.
[0073] Example 2:
[0074] Based on the tracking method of a large number of moving particles based on image recognition in Example 1, this embodiment also provides a method for identifying a single moving particle in an image acquisition device (video recorder), as shown in the attached Figure 1 As shown, the following steps are included:
[0075] Step 1: Develop a MATLAB algorithm as in Example 1, set the RGB values, and identify the pixel points (red circles) corresponding to the markers (black) on the particles;
[0076] Step 2: Determine the positions of all the pixels corresponding to the markers and take the average value as the particle position (blue dot).
[0077] The position of the blue dot is the corresponding position of the moving particle.
[0078] Therefore, based on the method disclosed in Example 1, a single moving particle can be accurately identified and located by the video recorder.
[0079] Example 3:
[0080] Based on the tracking method of a large number of moving particles based on image recognition in Example 1, and the identification method of a single moving particle in an image acquisition device (video recorder) in Example 2, this embodiment also provides a method for identifying five moving particles at the same time, as shown in the attached figure. Figure 2-Figure 4 As shown, the following steps are included:
[0081] Step 1: Set the RGB value and use it to identify all relevant pixels (red areas), such as Figure 2 ;
[0082] Step 2: Set a threshold for the pixel cluster size (i.e., the number of pixels), identify pixel clusters with a number of pixels less than the threshold, exclude them, and the remaining pixel clusters correspond to the marks on the particles;
[0083] Step 3: Select a pixel point (such as the pixel point where the yellow circle is located), and then find all the pixel points adjacent to it in the horizontal and vertical directions (the pixel point where the green circle is located); and so on, until all the pixel points in the cluster are found; calculate the average value of the positions of these pixel points as the position of the particle, such as Figure 3 ;
[0084] Step 4: Repeat the method in step 3 to identify all moving particles until the positions of all particles are found, such as Figure 4 .
[0085] Therefore, based on the method disclosed in Example 1, multiple moving particles can be accurately identified and located by the video recorder.
[0086] Example 4:
[0087] Based on the method for tracking a large number of moving particles based on image recognition in Example 1 and the method for simultaneously identifying five moving particles in Example 3, this example also provides a method for tracking the trajectories of five moving particles in 20 seconds, locating the positions of the five moving particles at different time points, and obtaining their trajectories, such as Figure 5 .
[0088] Example 5:
[0089] Based on the method for tracking a large number of moving particles based on image recognition in Example 1, the method for simultaneously identifying five moving particles in Example 3, and the method for tracking the trajectories of five moving particles in 20 seconds in Example 4, this embodiment also provides a method for simultaneously identifying different particles in a particle mixture, such as Figure 6-7 As shown, the following steps are included:
[0090] Step 1: Develop a MATLAB algorithm as in Example 1, set multiple sets of RGB values, and identify all relevant pixels (such as black and green) in the particle mixture. Figure 6 ;
[0091] Step 2: Set the pixel cluster size threshold to exclude pixel clusters that are not related to particle marking, such as Figure 6 ;
[0092] Step 3: Determine the positions of all moving particles in the particle mixture and record their trajectories within 20 seconds, e.g. Figure 7 .
[0093] Therefore, based on the method disclosed in this embodiment, different particles in a particle mixture can also be identified simultaneously, and their movement trajectories over a period of time can be accurately tracked.
[0094] Finally, it should be noted that the above descriptions are merely preferred embodiments of the present invention and are not intended to limit the present invention. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art will be able to modify the technical solutions described in the aforementioned embodiments or substitute equivalents for some of the technical features. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of the present invention shall be included within the scope of protection of the present invention.
Claims
1. A method for tracking a large number of moving particles based on image recognition. This method is applicable to particles that do not flip, do not overlap, and undergo active Brownian motion. The method is characterized by: The method uses a microscope or a video recorder as an image acquisition device, and the method comprises the following steps: Sp1: identification of moving particles; Sp1-1: Mark each moving particle with the same color and capture images of the moving particles using an image acquisition device; Sp1-2: Import the collected images of moving particles into the computer, set the RGB values, and identify the pixel clusters corresponding to the color marks on each moving particle; Sp1-3: Set the upper and lower thresholds for the size of 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 corresponding color marks on the moving particles; Sp1-4: Determine the positions of the pixels corresponding to all color markers, and take the pixel corresponding to the average position of all position data as the position of the moving particle; Sp2: Identification of moving particle trajectories: Locate the position of each moving particle at different time points and record the movement trajectories of all moving particles over a period of time.
2. The tracking method according to claim 1, wherein: The color marks of each of the moving particles are of the same shape, size and color.
3. The tracking method according to claim 2, wherein: The color of each moving particle is marked with a colored tape of the same length.
4. The tracking method according to claim 1, wherein: The color marking of each moving particle can also adopt the stable structural characteristics of the surface of the moving particle, that is, the inherent color of the surface of the moving particle and the brightness difference of different parts of the surface of the moving particle.
5. The tracking method according to claim 1, wherein: In the steps Sp1-4, Determining the positions of the pixels corresponding to all color markers includes: selecting a pixel in a cluster of pixels corresponding to any color marker, recording its two-dimensional coordinates, finding all pixels adjacent to it in the horizontal and vertical directions, and similarly locating the two-dimensional coordinates of all pixels in the pixel cluster; The pixel point corresponding to the average position of all position data is taken as the position of the moving particle, including: taking the average of the two-dimensional coordinates of all pixels in the pixel cluster corresponding to any color mark to obtain a unique two-dimensional coordinate. The two-dimensional coordinate is the position of the pixel cluster, that is, the position of the moving particle corresponding to the pixel cluster.
6. The tracking method according to claim 1, wherein: In the step Sp1-3, a shape matching degree threshold of the pixel cluster needs to be set. When the shape matching degree of the pixel cluster is less than the shape matching degree threshold of the pixel cluster, the pixel cluster is excluded.
7. The tracking method according to claim 1, wherein: In the step Sp1-2, the collected image of the moving particles is imported into a computer, RGB values are set, and pixel clusters corresponding to color marks on each moving particle are identified, including: Step 1: Set RGB threshold; Step 2: Extract the RGB values of all pixels in the pixel cluster; Step 3: Determine the coordinates of the pixels that meet the RGB threshold.
8. The tracking method according to claim 7, wherein: In step Sp1-3, an upper threshold and a lower threshold of the size of the pixel cluster are set, and the pixel clusters whose number of pixels is between the upper threshold and the lower threshold are determined, and other pixel clusters are excluded. The pixel clusters between the upper threshold and the lower threshold are the corresponding color marks on the moving particles, including: Step 1: Determine all relevant pixels, set the minimum and maximum values of the number of pixels in the pixel cluster, and exclude pixel clusters outside the minimum and maximum thresholds; Step 2: Keep the pixels within the minimum and maximum thresholds.
9. The tracking method according to claim 1, wherein: The resolution of the image acquisition device is negatively correlated with the particle size of the moving particles and the size of the color mark.
10. The tracking method according to claim 7 or 8, characterized in that: The method for identifying pixels in pixel clusters and excluding pixel clusters is run based on MATLAB or Python.
Citation Information
Cited By
Intelligent identification and classification method for TAP condensate microscopic image based on deep learning
CN122049898A