Filter stick motion trail tracking method and system

By extracting and linking the corresponding coordinates of the filter rod in the video frame, a path tracking algorithm is used to generate a complete path, which solves the problem of insufficient tracking accuracy and real-timeness of the filter rod motion trajectory in the prior art, and realizes efficient and accurate tracking of the filter rod motion trajectory.

CN119648744APending Publication Date: 2025-03-18CHINA TOBACCO GUANGDONG IND
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411861139.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-17
Publication Date
2025-03-18

AI Technical Summary

Technical Problem

The existing filter rod motion trajectory tracking methods have problems of low detection accuracy and poor real-time performance when dealing with specific industrial scenarios. Especially when the filter rod appearance is similar, the Kalman filter and Hungarian algorithm of the DeepSORT algorithm are difficult to effectively track.

Method used

By obtaining each frame image of the filter rod motion video, extracting and linking the corresponding coordinates of the filter rod in each frame image, and using a path tracking algorithm to generate the complete path. After obtaining the filter rod coordinates in the current frame image, this method sets a threshold to search for the coordinates in the next frame image within the corresponding range to ensure that the search range is small and accurate.

Benefits of technology

It realizes efficient and accurate tracking of the motion trajectory of the filter rod, improves detection accuracy and real-timeness, reduces time-consuming and improves efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119648744A_ABST
    Figure CN119648744A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of computer vision, and discloses a filter stick motion trail tracking method, which comprises the following steps of S1, acquiring a filter stick motion video, and extracting each frame of image of the filter stick motion video; and S2, obtaining the coordinates of the filter rod in each frame of image, obtaining the corresponding coordinates of the filter rod in the next frame of image according to the coordinates of the filter rod in the current frame of image, and linking the corresponding coordinates of the filter rod in each frame of image to generate a complete path. In the step S2, a threshold value is set according to the radius of the filter stick; and searching the next frame of image within the range of a circle with the circle center of the filter stick in the current frame of image as the circle center and the radius as the threshold value, and obtaining the circle center coordinate of the filter stick in the next frame of image as the next frame coordinate value corresponding to the circle center of the filter stick in the current frame of image. The motion trail tracking accuracy is high, the time consumption is low, and the efficiency is improved. The invention also provides a filter stick motion trail tracking system for realizing the method.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention relates to the technical field of computer vision, and in particular to a filter rod motion trajectory tracking method and system. Background Art

[0002] In the tobacco production process, the quality control of filter rods is crucial. Traditional filter rod tracking methods rely on manual inspection, which is not only inefficient but also prone to missed detection and false detection. In recent years, with the development of computer vision technology, target detection and motion trajectory tracking technology have provided new solutions for automated detection. However, existing methods still have some shortcomings when dealing with filter rod positioning and tracking in specific industrial scenarios, such as low detection accuracy and poor real-time performance.

[0003] In terms of path tracking, the DeepSORT algorithm is currently used. However, because the appearance of the filter rods is almost the same when photographed at a slightly longer distance, the ordinary Kalman filter in the DeepSORT algorithm is difficult to distinguish when extracting features, and the time complexity of the Hungarian algorithm in the DeepSORT algorithm is around O(n3), which is very time-consuming under a large amount of data. In the path tracking algorithm, DeepSORT (Deep Learning Simple Online and Realtime Tracking) is one of the solutions. It is developed based on the SORT (Simple Online and Realtime Tracking) algorithm, but the Kalman filter in it has certain limitations in dealing with the detection of filter rods with almost identical appearance, and feature extraction is more difficult. When the Hungarian algorithm is used to solve the maximum weight matching problem of the bipartite graph, the time complexity of the standard implementation of the Hungarian algorithm is O(n3), where n is the number of elements to be matched. In the path tracking application scenario, n actually represents the number of current active trajectories plus the number of newly detected targets. The DeepSORT algorithm was applied to the tracking of filter rod motion trajectories in ordinary filter-tipped cigarette making machines and their supporting packaging machines. Finally, hundreds of thousands or even millions of paths were obtained, and the corresponding time operation cost was very considerable. Summary of the invention

[0004] The purpose of the present invention is to provide a method and system for tracking the motion trajectory of a filter rod with high efficiency and accuracy.

[0005] In order to achieve the above object, the present invention provides a filter rod motion trajectory tracking method, comprising the following steps:

[0006] S1: Obtain filter rod motion video and extract each frame image of the filter rod motion video;

[0007] S2: Obtain the coordinates of the filter rod in each frame of the image, obtain the corresponding coordinates of the filter rod in the next frame of the image according to the coordinates of the filter rod in the current frame of the image, and link the corresponding coordinates of the filter rod in each frame of the image to generate a complete path.

[0008] As a preferred solution, in step S2, set a threshold according to the radius of the filter rod; within the range of a circle with the center of the filter rod in the current frame of the image as the center and the radius as the threshold, search the next frame of the image, and the obtained center coordinates of the filter rod in the next frame of the image are the corresponding next frame coordinate values of the center of the filter rod in the current frame of the image.

[0009] As a preferred solution, in step S2, the threshold is less than the radius of the filter rod.

[0010] As a preferred solution, in step S2, a complete path is generated according to the coordinates of the filter rod in each frame of the image through a path tracking algorithm. The path tracking algorithm obtains the corresponding coordinates of the filter rod in the next frame of the image according to the coordinates of the filter rod in the current frame of the image, and links the corresponding coordinates of the filter rod in each frame of the image to generate a complete path.

[0011] As a preferred solution, the path tracking algorithm is a neighborhood search algorithm.

[0012] As a preferred solution, in step S2, for all frame images of the video in, each frame of image I k already has a complete set of coordinate points P k ,

[0013]

[0014] where the width w and height h are the width and height of the image I k respectively, x is the abscissa in the image, and y is the ordinate in the image;

[0015] Similarly, the next frame of image I k+1 has a coordinate set P k+1 ;

[0016] Define a matrix M k , where

[0017] For the point p(x k ,y ki ,y ki ) in P where its next frame coordinates are * where p k+1 ∈P * ), and there is a distance s = d(p,p

[0018] For the set Pk All the points in the circle generate the corresponding grid point set C k,i ,have

[0019]

[0020] For all (x i ,y i )∈P k ,have Point p(x ki ,y ki ), the coordinates of the next frame And link two points to generate a path

[0021] Keep traversing P k To P n , then get the full path For all paths r, we synthesize a set T, which is all the paths. Each path starts from the uth frame to the vth frame.

[0022] g:P k →T

[0023] The mapping g is the path following algorithm.

[0024] As a preferred solution, step S2 includes:

[0025] S201: Get each image I k and its corresponding coordinate list P k ;

[0026] S202: Generate two empty lists T1 and T2;

[0027] S203: Generate a coordinate table L1, where the coordinates (x, y) in the table satisfy x 2 +y 2 ≤r, where r <x<h-r,r<y<w-r, r is set manually;

[0028] S204: First read and traverse P1, and store all the coordinate points in it into T1, where its format is path form, which is stored in Python as [(x ki ,y ki ),], except that the path length is 1;

[0029] S205: Generate a two-dimensional all-zero matrix M with a width and height equal to the image width w and height h;

[0030] S206: Check list P k Traverse and use the traversed coordinate point D ki (ie (xki ,y ki )) and change the coordinates of matrix M to D ki The value of is assigned 1;

[0031] S207: Traverse all paths r in T1 and obtain path r u The last coordinate point D k-1,i (ie (x k-1,i ,y k-1,i )), this coordinate point is the path r u In the previous frame image I k-1 The coordinate points on the coordinate set P k-1 ;

[0032] S208: Each time a coordinate point D is traversed k-1,i , perform a traversal of list L1, and traverse all the coordinate points C in table L1 ki , plus the coordinate point D k-1,i Then we get list L2. Assume that the coordinate point C ki =(x ki ,y ki ), and the coordinate points traversed from table L1 are

[0033] L1={(x′ k1 ,y′ k2 ),(x′ k1 ,y′ k2 ),…,(x′ kn ,y′ kn )},

[0034] After adding, we get

[0035] L2={(x k-1,i +x′ k1 ,y k-1,i +y k ′2),(x k-1,i +x′ k1 ,y k-1,i +y k ′2),…,(x k-1,i +x′ kn ,y k-1,i +y k ' n )};

[0036] S209: Traverse L2 and obtain coordinate point D ki , to find the matrix M at coordinate point D ki If the value is 1, then D k-1,i ((x k-1,i ,y k-1,i )) in this frame image I k Point Dki ;

[0037] S210: path r u Update, link to the latest point D ki , and point D ki From the list P k Removed;

[0038] S211: If no new path point D is found after step S209 is completed ki , then we can assume that the path r u Completed, the entire path r u Remove from set T1 and put into set T2;

[0039] S212: After traversing the set T1 in step S207, if the list P k There are still some coordinate points left, which shows that these coordinate points are the starting points of the path from the new page. As in step S204, the remaining coordinate points are stored in the set T1 in the form of a path, and stored in Python as [(x ki ,y ki ),], except that the path length is 1;

[0040] S213: Repeat steps S207-S12 until the traversal is completed, and the generated set T2 is the set of all paths.

[0041] As a preferred solution, step 2 further includes S214,

[0042] S214: Integrate all sets T2 into a dictionary PD1, where the dictionary key value is the end frame and the item value is all paths ending at that frame number; then generate a path dictionary PD2, using the relationship between the key value and the path length to generate a path with the start frame as the key value, and store the path; after completion, the path dictionary PD2 key value is the start frame number, and the item value is all paths starting from that frame number.

[0043] As a preferred solution, step S2 further includes S215,

[0044] S215: If PD1 still exists, directly read the corresponding path and draw the path from back to front until the first coordinate point of the path; otherwise, directly perform the reverse operation on PD2 to obtain PD1 and then perform the above operation.

[0045] The present invention also provides a filter rod motion trajectory tracking system, comprising:

[0046] The processing object acquisition module is used to acquire the filter rod motion video and extract each frame image of the filter rod motion video;

[0047] The path generation module is used to obtain the coordinates of the filter rod in each frame image, obtain the corresponding coordinates of the filter rod in the next frame image according to the coordinates of the filter rod in the current frame image, and link the corresponding coordinates of the filter rod in each frame image to generate a complete path.

[0048] Compared with the prior art, the present invention has the following beneficial effects:

[0049] The present invention first obtains the filter rod coordinates of each frame image, and then obtains the corresponding coordinates of the filter rod in the next frame image according to the filter rod coordinates of the current frame image. Since the filter rod is a solid, it is impossible for the filter rods to overlap, and the movement process of the filter rod in the cigarette making machine and the packaging machine is guided and restricted. Therefore, the corresponding coordinates are searched in the next frame image according to the coordinates of the current frame. The search range is small, and the corresponding coordinates can be found quickly and accurately. Then the coordinates of all frame images are linked to obtain an accurate motion trajectory. Therefore, the motion trajectory tracking of the present invention is highly accurate, less time-consuming, and more efficient. BRIEF DESCRIPTION OF THE DRAWINGS

[0050] Figure 1 It is a flow chart of the filter rod motion trajectory tracking method according to an embodiment of the present invention.

[0051] Figure 2 It is a schematic diagram of the coordinate relationship between the current frame image and the next frame image according to an embodiment of the present invention.

[0052] Figure 3 It is a path diagram of a filter rod portion selection obtained by the method of an embodiment of the present invention.

[0053] Figure 4 It is the full path diagram of the packaging machine obtained by the method of the embodiment of the present invention.

[0054] Figure 5 It is the full path diagram of the cigarette making machine obtained by the method of the embodiment of the present invention.

[0055] Figure 6 It is a principle block diagram of a filter rod motion trajectory tracking system according to an embodiment of the present invention. DETAILED DESCRIPTION

[0056] The specific implementation of the present invention is further described in detail below in conjunction with the accompanying drawings and examples. The following examples are used to illustrate the present invention, but are not intended to limit the scope of the present invention.

[0057] Embodiment 1

[0058] like Figure 1 As shown, a filter rod motion trajectory tracking method according to a preferred embodiment of the present invention comprises the following steps:

[0059] S1: Obtain filter rod motion video and extract each frame image of the filter rod motion video;

[0060] S2: Obtain the coordinates of the filter rod in each frame image, obtain the corresponding coordinates of the filter rod in the next frame image according to the coordinates of the filter rod in the current frame image, and link the corresponding coordinates of the filter rod in each frame image to generate a complete path.

[0061] This embodiment first obtains the filter rod coordinates of each frame image, and then obtains the corresponding coordinates of the filter rod in the next frame image according to the filter rod coordinates of the current frame image. Since the filter rod is a solid, it is impossible for the filter rods to overlap, and the movement of the filter rod in the cigarette making machine and the packaging machine is guided and restricted. Therefore, the corresponding coordinates are searched in the next frame image according to the coordinates of the current frame. The search range is small, and the corresponding coordinates can be found quickly and accurately. Then the coordinates of all frame images are linked to obtain an accurate motion trajectory. Therefore, the motion trajectory tracking of the present invention is highly accurate, less time-consuming, and more efficient.

[0062] Furthermore, in step S2 of this embodiment, a threshold is set according to the radius of the filter rod; within the range of a circle with the filter rod center in the current frame image as the center and the radius as the threshold, the next frame image is searched, and the center coordinates of the filter rod in the next frame image obtained are the next frame coordinate values ​​corresponding to the center of the filter rod in the current frame image. Furthermore, in step S2, the threshold is less than the filter rod radius.

[0063] The motion trajectory tracking of the filter rod is mainly to track the motion trajectory of the filter rod in the cigarette making machine and its supporting packaging machine on the production line. This embodiment uses a high-definition camera that can shoot at a speed of 60 frames per second to obtain the filter rod movement video. The cigarette making machine produces and the packaging machine consumes about 8,000 cigarettes / minute, and a 1-to-4 filter rod is used. The cigarette making machine feeds 1 stick at a time, and the motion path of each stick is about 1.2cm-1.3cm, while the packaging machine feeds 20 cigarettes at a time, but the 20 slots do not affect each other, so the motion path of each cigarette corresponds to the diameter of the cigarette, which is about 0.773cm. Combined with the image comparison, the radius of the filter rod is about 16-20px, and it can be calculated that the feeding speed of the cigarette making machine is about 3.35px / fps, and the feeding speed of the packaging machine is about 4.04px / fps, where px and fps are pixels and frames respectively. This lays the foundation for the development of the method of the present invention. Figure 2 As shown, we can assume that the moving path s of the filter rod is smaller than its radius r between each frame. In practice, s is about 1 / 4 of r, so the moving distance s of the same filter rod between each frame will not exceed its radius r, that is, the center c2 found in the next frame corresponding to the radius r of the center c1 of the filter rod is the next frame position of c1, and c1 and c2 are the previous and next frame positions of the same filter rod. The proof is as follows:

[0064] For any two circles on a plane, their centers are O A (x1,y1) and OB (x1, y1), and both have a radius of r. We give the following definitions. Define the distance between any two of them as d(O A , O B ). Define O′ A (x1 + Δx, y1 + Δy) as the next-frame coordinates of point O A . Define O′ B (x2 + Δx, y2 + Δy) as the next-frame coordinates of point O B .

[0065] Since the filter rods cannot overlap in reality, the two circles must be externally tangent or separated and will not intersect, be internally tangent, or be contained within each other. Therefore, there must be d(O′ A , O′ B ) ≥ 2r, where r is the radius of the filter rod. According to the observation, the condition s = d(O A , O′ A ) < r can be given. According to the triangle inequality, it can be known that

[0066] d(O A , O′ B ) + d(O A , O′ A ) ≥ d(O′ A , O′ B )

[0067] It is easy to prove that d(O A , O′ B ) > r, thus proving that within the range of the circle with point O A (x1, y1) as the center and radius r, searching for the next-frame image, the obtained value (x2, y2) is the next-frame coordinate value of the center O A (x1, y1).

[0068] In this embodiment, in step S2, a complete path is generated according to the filter rod coordinates in each frame image through a path tracking algorithm. The path tracking algorithm obtains the corresponding coordinates of the filter rod in the next-frame image based on the filter rod coordinates in the current-frame image, and links the corresponding coordinates of the filter rod in each frame image to generate a complete path. Specifically, the path tracking algorithm is a neighborhood search algorithm.

[0069] Embodiment 2

[0070] The difference between this embodiment and Embodiment 1 is that, based on Embodiment 1, this embodiment further explains step S2.

[0071] In step S2, for all frame images of the video , in each frame image I k there is already a complete set of coordinate points P k ,

[0072]

[0073] where the width w and height h are the width and height of the image I k respectively, x is the abscissa in the image, and y is the ordinate in the image;

[0074] Similarly, the next-frame image I k+1 has a coordinate set P k+1 ;

[0075] Define a matrix M k , where

[0076] For a point p(x k ,y ki ,y ki ) in P, its next-frame coordinates are where p * ∈P k+1 , and there is a distance s = d(p, p * ) < r, the distance s is the threshold, and r is the filter rod radius;

[0077] For all points in the set P k , generate a corresponding set C of lattice points inside the circle k,i , and there is

[0078]

[0079] For all (x i ,y i ) ∈ P k , there is The point p(x ki ,y ki ), its next-frame coordinates And connect the two points to generate a path

[0080] Keep traversing P k to P n , then a complete path is obtained For all paths r, synthesize a set T, which is all the paths. Each path starts from the u-th frame to the v-th frame. There is

[0081] g: P k → T

[0082] The mapping g is the path tracking algorithm.

[0083] Since the cross section of the filter rod is circular, the coordinates of the filter rod in each frame of image are grid points within the circle, and the coordinates of the entire filter rod are a set of grid points within the circle. This embodiment uses a neighborhood search algorithm combined with a path tracking algorithm of a grid point list within the circle.

[0084] The other steps of this embodiment are the same as those of the first embodiment and will not be described again here.

[0085] Embodiment 3

[0086] The difference between this embodiment and the second embodiment is that, based on the second embodiment, this embodiment further illustrates step S2.

[0087] Step S2 includes:

[0088] S201: Get each image I k and its corresponding coordinate list P k ;

[0089] S202: Generate two empty lists T1 and T2;

[0090] S203: Generate a coordinate table L1, where the coordinates (x, y) in the table satisfy x 2 +y 2 ≤r, where r <x<h-r,r<y<w-r, r is set manually;

[0091] S204: First read and traverse P1, and store all the coordinate points in it into T1, where its format is path form, which is stored in Python as [(x ki ,y ki ),], except that the path length is 1;

[0092] S205: Generate a two-dimensional all-zero matrix M with a width and height equal to the image width w and height h;

[0093] S206: Check list P k Traverse and use the traversed coordinate point D ki (ie (x ki ,y ki )) and change the coordinates of matrix M to D ki The value of is assigned 1;

[0094] S207: Traverse all paths r in T1 and obtain path r u The last coordinate point D k-1,i (ie (x k-1,i ,y k-1,i )), this coordinate point is the path r u In the previous frame image I k-1 The coordinate points on the coordinate set P k-1 ;

[0095] S208: Each time a coordinate point D is traversed k-1,i , perform a traversal of list L1, and traverse all the coordinate points C in table L1 ki , plus the coordinate point D k-1,i Then we get list L2. Assume that the coordinate point C ki =(x ki ,y ki ), and the coordinate points traversed from table L1 are

[0096] L1={(x′ k1 ,y′ k2 ),(x′ k1 ,y′ k2 ),…,(x′ kn ,y′ kn )},

[0097] After adding, we get

[0098] L2={(x k-1,i +x′ k1 ,y k-1,i +y k ′2),(x k-1,i +x′ k1 ,y k-1,i +y k ′2),…,(x k-1,i +x′ kn ,y k-1,i +y k ' n )};

[0099] S209: Traverse L2 and obtain coordinate point D ki , to find the matrix M at coordinate point D ki If the value is 1, then D k-1,i ((x k-1,i ,y k-1,i )) in this frame image I k Point D ki ;

[0100] S210: path r u Update, link to the latest point D ki , and point D ki From the list P k Removed;

[0101] S211: If no new path point D is found after step S209 is completed ki , then we can assume that the path r u Completed, the entire path r uRemove from set T1 and put into set T2;

[0102] S212: After traversing the set T1 in step S207, if the list P k There are still some coordinate points left, which shows that these coordinate points are the starting points of the path from the new page. As in step S204, the remaining coordinate points are stored in the set T1 in the form of a path, and stored in Python as [(x ki ,y ki ),], except that the path length is 1;

[0103] S213: Repeat steps S207-S12 until the traversal is completed, and the generated set T2 is the set of all paths.

[0104] Through the above steps, the time complexity is analyzed. First, the time required for the table lookup process is analyzed. The number of integer coordinate points in a circle with a given radius r is N(r), which is equal to the area of ​​the circle πr 2 The relationship is N(r)=E(r)+πr 2 , where E(r) is the error term, and there is no exact solution yet. The best solution is that Mr. Chen Jingrun has proved that a lower bound of E(r) is Where ε is any constant greater than 0. The time complexity of traversing the coordinate point list P1 is O(n), so the time complexity of the algorithm is O(N(r)*n). In this embodiment, the maximum value of r is generally set to no more than 20, and the corresponding N(r) value is 1257, while n is basically more than three or four thousand in each frame, and even in thin cigarette filter sticks, the corresponding n value is close to tens of thousands, but the r value is lower, avoiding excessive computing time, so the path tracking algorithm has a more efficient tracking capability.

[0105] Tested on a computer with AMD Ryren7 3700X CPU and 16G memory, for an image containing 17910 frames, each image has a set of about 4000 filter rods. The average time taken per image is about 0.7s, and the total time taken is about 3.5 hours.

[0106] The other steps of this embodiment are the same as those of the second embodiment and will not be described again here.

[0107] Embodiment 4

[0108] The difference between this embodiment and the third embodiment is that, based on the third embodiment, this embodiment further illustrates step S2.

[0109] Step 2 of this embodiment also includes S214 and S15, specifically:

[0110] S214: Integrate all sets T2 into a dictionary PD1, where the dictionary key value is the end frame and the item value is all paths ending at that frame number; then generate a path dictionary PD2, using the relationship between the key value and the path length to generate a path with the start frame as the key value, and store the path; after completion, the path dictionary PD2 key value is the start frame number, and the item value is all paths starting from that frame number.

[0111] S215: If PD1 still exists, directly read the corresponding path and draw the path from back to front until the first coordinate point of the path; otherwise, directly perform the reverse operation on PD2 to obtain PD1 and then perform the above operation.

[0112] Step S14 records the path, and step S15 records the track, which facilitates the selection and search of the path.

[0113] like Figure 3 , Figure 4 and Figure 5 As shown, according to the tracking method of this embodiment, a filter rod path diagram, a full path diagram of a packaging machine, and a full path diagram of a cigarette making machine are obtained.

[0114] The other steps of this embodiment are the same as those of the third embodiment and will not be described again here.

[0115] Embodiment 5

[0116] An embodiment of the present invention provides a filter rod tracking system, comprising:

[0117] The processing object acquisition module is used to acquire the filter rod motion video and extract each frame image of the filter rod motion video;

[0118] The path generation module is used to obtain the coordinates of the filter rod in each frame image, obtain the corresponding coordinates of the filter rod in the next frame image according to the coordinates of the filter rod in the current frame image, and link the corresponding coordinates of the filter rod in each frame image to generate a complete path.

[0119] The processing object acquisition module is used to implement step S1 of embodiment 1, embodiment 2, embodiment 3, or embodiment 4, and the path generation module is used to implement step S2 of embodiment 1, embodiment 2, embodiment 3, or embodiment 4.

[0120] In summary, the embodiment of the present invention provides a filter rod tracking method, which first obtains the filter rod coordinates of each frame image, and then obtains the corresponding coordinates of the filter rod in the next frame image according to the filter rod coordinates of the current frame image. Since the filter rod is a physical entity, it is impossible for the filter rods to overlap, and the movement process of the filter rod in the cigarette making machine and the packaging machine is guided and restricted. Therefore, the corresponding coordinates are searched in the next frame image according to the coordinates of the current frame. The search range is small, and the corresponding coordinates can be found quickly and accurately. Then the coordinates of all frame images are linked to obtain an accurate motion trajectory. Therefore, the motion trajectory tracking of the embodiment of the present invention is highly accurate, less time-consuming, and improves efficiency. Specifically, in step S2, the embodiment of the present invention sets a threshold according to the radius of the filter rod; within the range of a circle with the center of the filter rod in the current frame image as the center and the radius as the threshold, the next frame image is searched, and the center coordinates of the filter rod in the next frame image obtained are the next frame coordinate values ​​corresponding to the center of the filter rod in the current frame image. The embodiment of the present invention also provides a filter rod tracking system for implementing the above method.

[0121] The above is only a preferred embodiment of the present invention. It should be pointed out that for ordinary technicians in this technical field, several improvements and substitutions can be made without departing from the technical principles of the present invention. These improvements and substitutions should also be regarded as the scope of protection of the present invention.

Claims

1. A filter rod motion trajectory tracking method, characterized in that: The steps include: S1: Obtain filter rod motion video and extract each frame image of the filter rod motion video; S2: Obtain the coordinates of the filter rod in each frame image, obtain the corresponding coordinates of the filter rod in the next frame image according to the coordinates of the filter rod in the current frame image, and link the corresponding coordinates of the filter rod in each frame image to generate a complete path.

2. The filter rod motion trajectory tracking method according to claim 1, characterized in that: In step S2, a threshold is set according to the radius of the filter rod; within the range of a circle with the center of the filter rod in the current frame image as the center and the radius as the threshold, the next frame image is searched, and the center coordinates of the filter rod in the next frame image obtained are the next frame coordinate values ​​corresponding to the center of the filter rod in the current frame image.

3. The filter rod motion trajectory tracking method according to claim 2, characterized in that: In step S2, the threshold value is smaller than the filter rod radius.

4. The filter rod motion trajectory tracking method according to claim 3, characterized in that: In step S2, a complete path is generated according to the coordinates of the filter rod in each frame image through a path tracking algorithm. The path tracking algorithm obtains the corresponding coordinates of the filter rod in the next frame image according to the coordinates of the filter rod in the current frame image, and links the corresponding coordinates of the filter rod in each frame image to generate a complete path.

5. The filter rod motion trajectory tracking method according to claim 4, characterized in that: The path tracking algorithm is a neighborhood search algorithm.

6. The filter rod motion trajectory tracking method according to claim 4, characterized in that: In step S2, for all the frame images of the video In each frame image I k There is already a complete set of coordinate points P k , The width w and height h are the image I k The width and height of the image, x is the horizontal coordinate in the image, and y is the vertical coordinate in the image; Similarly, the image I of the next frame k+1 There is a coordinate set P k+1 ; Define a matrix M k ,in For P k For a point p(x ki , y ki ) within it, the coordinates of its next frame are where p * ∈P k+1 , and there is a distance s = d(p, p * ) < r, where the distance s is the threshold and r is the filter rod radius; For the set P k All the points in the circle generate the corresponding grid point set C k,i ,have For all (x i ,y i )∈P k ,have Point p(x ki ,y ki ), the coordinates of the next frame And link two points to generate a path Keep traversing P k To P n , then get the full path For all paths r, we synthesize a set T, which is all the paths. Each path starts from the uth frame to the vth frame. g:P k →T The mapping g is the path following algorithm.

7. The filter rod motion trajectory tracking method according to claim 6, characterized in that: Step S2 includes: S201: Get each image I k and its corresponding coordinate list P k ; S202: Generate two empty lists T1 and T2; S203: Generate a coordinate table L1, where the coordinates (x, y) in the table satisfy x 2 +y 2 ≤r, where r is set manually; S204: First read and traverse P1, and store all the coordinate points in it into T1, where its format is path form, which is stored in Python as [(x ki ,y ki ),], except that the path length is 1; S205: Generate a two-dimensional all-zero matrix M with a width and height equal to the image width w and height h; S206: Check list P k Traverse and use the traversed coordinate point D ki (ie (x ki ,y ki )) and change the coordinates of matrix M to D ki The value of is assigned 1; S207: Traverse all paths r in T1 and obtain path r u The last coordinate point D k-1,i (ie (x k-1,i ,y k-1,i )), this coordinate point is the path r u In the previous frame image I k-1 The coordinate points on the coordinate set P k-1 ; S208: Each time a coordinate point D is traversed k-1,i , perform a traversal of list L1, and traverse all the coordinate points C in table L1 ki , plus the coordinate point D k-1,i Then we get list L2. Assume that the coordinate point C ki =(x ki ,y ki ), and the coordinate points traversed from table L1 are L1={(x′ k1 ,and' k2 ),(x′ k1 ,and' k2 ),…,(x′ kn ,and' kn )}, After adding, we get L2={(x k-1,i +x′ k1 ,and k-1,i +y k ′2),(x k-1,i +x′ k1 ,and k-1,i +y k ′2),…,(x k-1,i +x′ kn ,and k-1,i +y k ′ n )}; S209: Traverse L2 and obtain coordinate point D ki , to find the matrix M at coordinate point D ki If the value is 1, then D k-1,i ((x k-1,i ,y k-1,i )) in this frame image I k Point D ki ; S210: path r u Update, link to the latest point D ki , and point D ki From the list P k Removed; S211: If no new path point D is found after step S209 is completed ki , then we can assume that the path r u Completed, the entire path r u Remove from set T1 and put into set T2; S212: After traversing the set T1 in step S207, if the list P k There are still some coordinate points left, which shows that these coordinate points are the starting points of the path from the new page. As in step S204, the remaining coordinate points are stored in the set T1 in the form of a path, and stored in Python as [(x ki ,y ki ),], except that the path length is 1; S213: Repeat steps S207-S12 until the traversal is completed, and the generated set T2 is the set of all paths.

8. The filter rod motion trajectory tracking method according to claim 7, characterized in that: Step 2 also includes S214, S214: Integrate all sets T2 into a dictionary PD1, where the dictionary key value is the end frame and the item value is all paths ending at that frame number; then generate a path dictionary PD2, using the relationship between the key value and the path length to generate a path with the start frame as the key value, and store the path; after completion, the path dictionary PD2 key value is the start frame number, and the item value is all paths starting from that frame number.

9. The filter rod motion trajectory tracking method according to claim 8, characterized in that: Step S2 also includes S215, S215: If PD1 still exists, directly read the corresponding path and draw the path from back to front until the first coordinate point of the path; otherwise, directly perform the reverse operation on PD2 to obtain PD1 and then perform the above operation.

10. A filter rod motion trajectory tracking system, characterized in that: include: The processing object acquisition module is used to acquire the filter rod motion video and extract each frame image of the filter rod motion video; The path generation module is used to obtain the coordinates of the filter rod in each frame image, obtain the corresponding coordinates of the filter rod in the next frame image according to the coordinates of the filter rod in the current frame image, and link the corresponding coordinates of the filter rod in each frame image to generate a complete path.