CN116152293A - Activity track determining method, activity track determining device, activity track determining terminal and storage medium - Google Patents
Activity track determining method, activity track determining device, activity track determining terminal and storage medium Download PDFInfo
- Publication number
- CN116152293A CN116152293A CN202310123621.8A CN202310123621A CN116152293A CN 116152293 A CN116152293 A CN 116152293A CN 202310123621 A CN202310123621 A CN 202310123621A CN 116152293 A CN116152293 A CN 116152293A
- Authority
- CN
- China
- Prior art keywords
- image
- track
- images
- vector
- speed
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T7/00—Image analysis
- G06T7/20—Analysis of motion
- G06T7/246—Analysis of motion using feature-based methods, e.g. the tracking of corners or segments
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T2207/00—Indexing scheme for image analysis or image enhancement
- G06T2207/10—Image acquisition modality
- G06T2207/10016—Video; Image sequence
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T2207/00—Indexing scheme for image analysis or image enhancement
- G06T2207/30—Subject of image; Context of image processing
- G06T2207/30241—Trajectory
Landscapes
- Engineering & Computer Science (AREA)
- Multimedia (AREA)
- Computer Vision & Pattern Recognition (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Theoretical Computer Science (AREA)
- Image Analysis (AREA)
Abstract
The invention relates to the technical field of image recognition, in particular to a method, a device, a terminal and a storage medium for determining a moving track; then extracting a plurality of vectors corresponding to the plurality of images according to the plurality of images; extracting a plurality of speed features corresponding to the plurality of moving targets according to the plurality of vectors; and finally, repeatedly iterating between planning a plurality of moving tracks according to the plurality of speed features and adjusting the speed features according to the plurality of moving tracks until the fluctuation amounts of the plurality of speed features and the smoothness of the plurality of moving tracks are smaller than a smoothness threshold. The method and the device are based on the speed planning track, and do not need to identify the characteristics of the movable main body, so that the method and the device have low calculation cost, consume less calculation resources and human resources, and consume less analysis time when a plurality of targets are used. After the track is planned based on the speed, the accuracy of the track is verified through the track smoothness, the possibility of track misjudgment is reduced, and the track planning is more accurate.
Description
Technical Field
The present invention relates to the field of image recognition technologies, and in particular, to a method, an apparatus, a terminal, and a storage medium for determining a motion trajectory.
Background
The moving track of people or things has important value in a plurality of fields, for example, after the moving track is known in the business field, the moving track can be used for navigating a user, realizing more accurate place recommendation for the user and optimizing advertisement site selection for merchants. The training guidance can be given by combining the motion trail in the field of sports, so that the training effect is enhanced.
The existing method for analyzing the moving track is to identify the characteristics of a target main body through a plurality of images and track the target according to the characteristics so as to analyze the moving track, and the track accuracy obtained by the method is higher.
However, the algorithm adopted in the analysis method for identifying the features is complex, the workload of extracting the features in the early stage is large, the calculation cost of tracking the features in the later stage is high, and the analysis method is limited by the influence of conditions such as image definition and the like, so that the trace analysis can be completed by performing auxiliary selection operation by manpower when the trace analysis is performed. In addition, this analysis method has a problem that the analysis process is time-consuming when a plurality of targets are processed at the same time.
Based on this, it is necessary to develop and design an activity trajectory determination method.
Disclosure of Invention
The embodiment of the invention provides a method, a device, a terminal and a storage medium for determining an activity track, which are used for solving the problem of high resource consumption in the prior art when the activity track is analyzed.
In a first aspect, an embodiment of the present invention provides a method for determining an activity track, including:
acquiring a plurality of images, wherein the images comprise a plurality of moving targets, and the images are sequentially shot based on a plurality of time nodes;
extracting a plurality of vectors corresponding to the plurality of images according to the plurality of images, wherein the vectors comprise a plurality of elements corresponding to the positions of a plurality of moving targets in the images;
extracting a plurality of speed features corresponding to the plurality of moving targets according to the plurality of vectors;
and repeatedly iterating between planning a plurality of active tracks according to the plurality of speed features and adjusting the speed features according to the plurality of active tracks until the fluctuation amounts of the plurality of speed features and the smoothness of the plurality of active tracks are smaller than a smoothness threshold.
In one possible implementation manner, the extracting a plurality of vectors corresponding to the plurality of images according to the plurality of images includes:
For each of the plurality of images, performing the steps of:
the image is de-colored, and a gray scale image is obtained;
scaling and cutting the gray scale image according to a preset size;
the numerical values of a plurality of pixels in the gray scale image are adjusted, so that the numerical value distribution of the plurality of pixels in the gray scale image accords with a preset condition;
dividing the gray level map into a plurality of image blocks to be processed;
and (3) image verification calculation: determining a plurality of image kernels corresponding to the plurality of image blocks to be processed according to the plurality of image blocks to be processed, wherein the image kernels are the sum of the values of a plurality of pixels in the image blocks to be processed;
determining a plurality of target image blocks according to the plurality of image cores to be processed and the plurality of background cores, wherein the plurality of background cores are obtained based on image blocks obtained by dividing background images, and the deviation between the image cores of the target image blocks and the background cores at corresponding positions in the background images is larger than a picture core threshold;
if the number of pixels in the target image blocks is greater than the pixel number threshold, dividing the target image blocks, taking the image blocks obtained by dividing as a plurality of image blocks to be processed, and jumping to the image verification calculation step;
Otherwise, the positions of the target image blocks in the image are extracted as a plurality of elements of the vector.
In one possible implementation manner, the adjusting the values of the plurality of pixels in the gray scale map so that the numerical distribution of the plurality of pixels in the gray scale map meets a preset condition includes:
and a primary adjustment step: and adjusting a plurality of pixel values in the gray scale map once according to the first formula, wherein the first formula is as follows:
where p' (i) is the pixel value after the ith one-time adjustment, a is the pixel value interval difference, p "(i) is the pixel value before the ith one-time adjustment, p" (min) is the minimum value of the plurality of pixel values before the one-time adjustment, p "(max) is the maximum value of the plurality of pixel values before the one-time adjustment, and b is the minimum value of the interval after the one-time adjustment;
counting the number of the pixel values in a plurality of preset distribution intervals after one-time adjustment;
if the number of the pixel values in the preset distribution intervals does not meet the preset condition, performing secondary adjustment on the pixel values in the gray scale image according to a second formula, and jumping to the primary adjustment step, wherein the second formula is as follows:
wherein p (i) is the pixel value after the ith secondary adjustment, k is the concave-convex adjustment coefficient, the concave-convex adjustment coefficient is negative when the number statistical curves of the pixel values in the preset distribution intervals are convex, the concave-convex adjustment coefficient is positive when the number statistical curves of the pixel values in the preset distribution intervals are concave, e is a natural constant, c is a central coefficient, and d is an expansion coefficient.
In one possible implementation, the extracting a plurality of speed features corresponding to the plurality of moving targets according to the plurality of vectors includes:
acquiring a first image, a second image, a first vector and a second vector from the plurality of images, wherein the first image and the second image are shot based on two adjacent time nodes, and the first vector and the second vector respectively correspond to the first image and the second image;
acquiring a time difference between the first image shooting time node and the second image shooting time node;
determining a plurality of distance sets corresponding to a plurality of moving targets according to the first vector and the second vector, wherein the distance sets comprise distances from the moving targets in the first image to the plurality of moving targets in the second image;
selecting a distance with the smallest value from the plurality of distance sets as a distance characteristic of the plurality of moving targets;
and determining a plurality of speed characteristics corresponding to the plurality of moving targets according to the distance characteristics of the plurality of moving targets and the time difference.
In one possible implementation, the step of repeatedly iterating between planning a plurality of active trajectories according to the plurality of velocity features and adjusting the velocity features according to the plurality of active trajectories until the fluctuation amounts of the plurality of velocity features and the smoothness of the plurality of active trajectories are less than a smoothness threshold includes:
For each of the plurality of activity targets, performing the steps of:
acquiring a first position of a moving target, wherein the first position is determined based on an image shot by a first time node;
and (3) image searching: obtaining a second image in the order of time nodes, wherein the shooting time nodes of the second image are close to the shooting time nodes of the first image,
finding a second position from the vector of the second image according to the first position, wherein the estimated speed of the moving target from the first position to the second position is closer to the speed characteristic of the moving target than the estimated speed to other positions in the second image;
adding the first position to a track vector, and taking the second position as the first position;
if the second image is not the last image in the plurality of images, jumping to the image searching step;
otherwise, adding the second location to the trajectory vector;
track smoothness determining step: determining smoothness of the moving target according to the track vector;
if the smoothness is greater than a threshold value, finding a position of track mutation, modifying the moving track, and jumping to the track smoothness determining step.
In one possible implementation manner, the determining the smoothness of the moving target according to the trajectory vector includes:
extracting a plurality of fluctuation features of the moving track according to a third formula and the track vector, wherein the third formula is as follows:
wherein Wfeature (2 n) is the 2 n-th fluctuation feature of the plurality of fluctuation features, M is the total number of elements in the Track vector, track x (m) is the x coordinate of the mth element of the Track vector, track y (m) is the y-coordinate of the m-th element of the trajectory vector, e is a natural constant, j is an imaginary unit, ω0 is a double of the frequency at which a plurality of images are taken;
determining smoothness of the moving target according to a fourth formula and the fluctuation features, wherein the fourth formula is as follows:
where smooths is smoothness and N is the total number of fluctuation features.
In one possible implementation manner, the finding the location of the track mutation, modifying the activity track, includes:
determining a plurality of track abrupt changes according to the track vector and a fifth formula, wherein the fifth formula is as follows:
wherein Sch (M) is the mth trace mutation amount, trackx (M) is the x coordinate of the mth element of the trace vector, and Tracky (M) is the y coordinate of the mth element of the trace vector;
Selecting a track vector element corresponding to a track abrupt change quantity with the minimum absolute value as a target element;
and modifying the track vector according to the vector and the speed characteristic of the image corresponding to the target element, wherein the speed characteristic corresponding to the target element after modification is lower than the speed characteristic corresponding to the target element before modification.
In a second aspect, an embodiment of the present invention provides an activity track determining apparatus, configured to implement the activity track determining method according to the first aspect or any one of the possible implementation manners of the first aspect, where the activity track determining apparatus includes:
the image acquisition module is used for acquiring a plurality of images, wherein the images comprise a plurality of moving targets, and the images are sequentially shot based on a plurality of time nodes;
a position vector extraction module, configured to extract a plurality of vectors corresponding to the plurality of images according to the plurality of images, where the vectors include a plurality of elements corresponding to positions of a plurality of moving targets in the images;
the speed feature extraction module is used for extracting a plurality of speed features corresponding to the plurality of moving targets according to the plurality of vectors;
the method comprises the steps of,
the track determining module is used for repeatedly iterating between planning a plurality of moving tracks according to the plurality of speed features and adjusting the speed features according to the plurality of moving tracks until the fluctuation amount of the plurality of speed features and the smoothness of the plurality of moving tracks are smaller than a smoothness threshold value.
In a third aspect, an embodiment of the present invention provides a terminal, including a memory and a processor, where the memory stores a computer program executable on the processor, and where the processor implements the steps of the method according to the first aspect or any one of the possible implementations of the first aspect when the processor executes the computer program.
In a fourth aspect, embodiments of the present invention provide a computer readable storage medium storing a computer program which, when executed by a processor, implements the steps of the method as described above in the first aspect or any one of the possible implementations of the first aspect.
Compared with the prior art, the embodiment of the invention has the beneficial effects that:
the embodiment of the invention discloses a moving track determining method, which comprises the steps of firstly, acquiring a plurality of images, wherein the images comprise a plurality of moving targets, and the images are sequentially shot based on a plurality of time nodes; then, extracting a plurality of vectors corresponding to the plurality of images according to the plurality of images, wherein the vectors comprise a plurality of elements corresponding to the positions of a plurality of moving targets in the images; then, extracting a plurality of speed features corresponding to the plurality of moving targets according to the plurality of vectors; finally, by iterating between planning a plurality of activity trajectories according to the plurality of speed features and adjusting the speed features according to the plurality of activity trajectories, until the amount of fluctuation of the plurality of speed features and the smoothness of the plurality of activity trajectories are less than a smoothness threshold. The method and the device are based on the speed planning track, and do not need to identify the characteristics of the movable main body, so that the method and the device have low calculation cost, consume less calculation resources and human resources, and consume less analysis time when a plurality of targets are used. After the track is planned based on the speed, the accuracy of the track is verified through the track smoothness, the possibility of track misjudgment is reduced, and the track planning is more accurate.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings used in the description of the embodiments or the prior art will be briefly described below, it being obvious that the drawings in the following description are only some embodiments of the present invention, and that other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
FIG. 1 is a flowchart of a method for determining an activity trajectory according to an embodiment of the present invention;
FIG. 2 is a schematic diagram of an activity trajectory provided by an embodiment of the present invention;
FIG. 3 is a functional block diagram of an activity trajectory determination device provided by an embodiment of the present invention;
fig. 4 is a functional block diagram of a terminal according to an embodiment of the present invention.
Detailed Description
In the following description, for purposes of explanation and not limitation, specific details are set forth such as the particular system architecture, techniques, etc., in order to provide a thorough understanding of the embodiments of the present invention. It will be apparent, however, to one skilled in the art that the present invention may be practiced in other embodiments that depart from these specific details. In other instances, detailed descriptions of well-known systems, devices, and methods are omitted so as not to obscure the description of the present invention with unnecessary detail.
For the purpose of making the objects, technical solutions and advantages of the present invention more apparent, the following description will be made with reference to the accompanying drawings.
The following describes in detail the embodiments of the present invention, and the present embodiment is implemented on the premise of the technical solution of the present invention, and a detailed implementation manner and a specific operation procedure are given, but the protection scope of the present invention is not limited to the following embodiments.
Fig. 1 is a flowchart of an activity track determining method according to an embodiment of the present invention.
As shown in fig. 1, a flowchart of an implementation of the method for determining an activity track according to an embodiment of the present invention is shown, and the details are as follows:
in step 101, a plurality of images are acquired, wherein the images include a plurality of moving objects, and the plurality of images are sequentially captured based on a plurality of time nodes.
In step 102, a plurality of vectors corresponding to the plurality of images are extracted from the plurality of images, wherein the vectors include a plurality of elements corresponding to the positions of a plurality of moving objects in the images.
In some embodiments, the step 102 includes:
for each of the plurality of images, performing the steps of:
the image is de-colored, and a gray scale image is obtained;
Scaling and cutting the gray scale image according to a preset size;
the numerical values of a plurality of pixels in the gray scale image are adjusted, so that the numerical value distribution of the plurality of pixels in the gray scale image accords with a preset condition;
dividing the gray level map into a plurality of image blocks to be processed;
and (3) image verification calculation: determining a plurality of image kernels corresponding to the plurality of image blocks to be processed according to the plurality of image blocks to be processed, wherein the image kernels are the sum of the values of a plurality of pixels in the image blocks to be processed;
determining a plurality of target image blocks according to the plurality of image cores to be processed and the plurality of background cores, wherein the plurality of background cores are obtained based on image blocks obtained by dividing background images, and the deviation between the image cores of the target image blocks and the background cores at corresponding positions in the background images is larger than a picture core threshold;
if the number of pixels in the target image blocks is greater than the pixel number threshold, dividing the target image blocks, taking the image blocks obtained by dividing as a plurality of image blocks to be processed, and jumping to the image verification calculation step;
otherwise, the positions of the target image blocks in the image are extracted as a plurality of elements of the vector.
In some embodiments, the adjusting the values of the plurality of pixels in the gray scale map so that the numerical distribution of the plurality of pixels in the gray scale map meets a preset condition includes:
and a primary adjustment step: and adjusting a plurality of pixel values in the gray scale map once according to the first formula, wherein the first formula is as follows:
where p' (i) is the pixel value after the ith one-time adjustment, a is the pixel value interval difference, p "(i) is the pixel value before the ith one-time adjustment, p" (min) is the minimum value of the plurality of pixel values before the one-time adjustment, p "(max) is the maximum value of the plurality of pixel values before the one-time adjustment, and b is the minimum value of the interval after the one-time adjustment;
counting the number of the pixel values in a plurality of preset distribution intervals after one-time adjustment;
if the number of the pixel values in the preset distribution intervals does not meet the preset condition, performing secondary adjustment on the pixel values in the gray scale image according to a second formula, and jumping to the primary adjustment step, wherein the second formula is as follows:
wherein p (i) is the pixel value after the ith secondary adjustment, k is the concave-convex adjustment coefficient, the concave-convex adjustment coefficient is negative when the number statistical curves of the pixel values in the preset distribution intervals are convex, the concave-convex adjustment coefficient is positive when the number statistical curves of the pixel values in the preset distribution intervals are concave, e is a natural constant, c is a central coefficient, and d is an expansion coefficient.
For example, the moving track is extracted based on the images, and the images are preprocessed to ensure that the sizes and colors of the images are consistent as much as possible, so that the moving targets in the images are found by comparing the moving targets with the background images, which is usually required for improving the recognition of the moving targets in the images.
In the preprocessing, after an image is de-colored to form a gray scale image and scaled and cut to a preset size, gray values in the image are subjected to curve processing, and the final result of curve processing is that the distribution interval of pixel values in the image meets preset conditions and the distribution of a plurality of pixel values in the image meets preset conditions.
The preprocessing to the preset interval and distribution is that firstly, the distribution interval of a plurality of pixel values accords with preset conditions according to a first formula, wherein the first formula is as follows:
where p' (i) is the pixel value after the ith one-time adjustment, a is the pixel value interval difference, p "(i) is the pixel value before the ith one-time adjustment, p" (min) is the minimum value of the plurality of pixel values before the one-time adjustment, p "(max) is the maximum value of the plurality of pixel values before the one-time adjustment, and b is the minimum value of the interval after the one-time adjustment;
then, if the distribution of the plurality of pixel values does not meet the predetermined condition, the distribution of the plurality of pixel values is adjusted by a second formula, wherein the adjustment is mainly performed according to the convexity of the distribution, if the distribution of the intermediate values is more than the predetermined condition, the distribution is indicated to be convex, if the distribution of the intermediate values is less than the predetermined condition, the distribution is indicated to be concave, and the distribution of the plurality of pixel values is adjusted according to the convexity and the second formula, wherein the second formula is:
Wherein p (i) is the pixel value after the ith secondary adjustment, k is the concave-convex adjustment coefficient, the concave-convex adjustment coefficient is negative when the number statistical curves of the pixel values in the preset distribution intervals are convex, the concave-convex adjustment coefficient is positive when the number statistical curves of the pixel values in the preset distribution intervals are concave, e is a natural constant, C is a central coefficient, and d is an expansion coefficient.
After the image preprocessing is performed, different points in the image and the background image can be found according to the mode of calculating the image kernel and comparing the image kernel, wherein the image kernel is the sum of pixel values in the image blocks in one implementation mode, the image blocks are obtained by separation based on the original image, when the image kernel deviation of the image kernel and the background image is larger than a threshold value, the existence of a target image in the image block can be indicated, the image block can be further subdivided into smaller image blocks, more detailed image kernel comparison is performed, and finally the positioning of the target in the image is completed.
The above steps can extract the positions of the plurality of targets in the images, the positions of the plurality of targets in each image constituting a vector of the image.
In step 103, a plurality of speed features corresponding to the plurality of moving objects are extracted from the plurality of vectors.
In some embodiments, the step 103 includes:
acquiring a first image, a second image, a first vector and a second vector from the plurality of images, wherein the first image and the second image are shot based on two adjacent time nodes, and the first vector and the second vector respectively correspond to the first image and the second image;
acquiring a time difference between the first image shooting time node and the second image shooting time node;
determining a plurality of distance sets corresponding to a plurality of moving targets according to the first vector and the second vector, wherein the distance sets comprise distances from the moving targets in the first image to the plurality of moving targets in the second image;
selecting a distance with the smallest value from the plurality of distance sets as a distance characteristic of the plurality of moving targets;
and determining a plurality of speed characteristics corresponding to the plurality of moving targets according to the distance characteristics of the plurality of moving targets and the time difference.
Illustratively, in general, the location mapping of multiple targets in multiple images can be performed according to a speed principle, so that the speed of extracting a moving target is one of the steps of performing trajectory division, and in the embodiment of the present invention, two targets with the closest locations are found in two images (the reason why two locations closest to each other are selected for correspondence in two images is that in general, the time interval between image capturing is small, only tens of milliseconds, and in most cases, the moving distance of the same moving target in this interval is smaller than the distance of two different targets, so that the correspondence of finding targets in two images is reliable based on the distance principle), and the quotient of the distance between the two and the time difference between two images is calculated as a speed feature.
In step 104, by iterating between planning a plurality of activity trajectories according to the plurality of speed features and adjusting the speed features according to the plurality of activity trajectories, until the amounts of fluctuation of the plurality of speed features and the smoothness of the plurality of activity trajectories are less than a smoothness threshold.
In some embodiments, the step 104 includes:
for each of the plurality of activity targets, performing the steps of:
acquiring a first position of a moving target, wherein the first position is determined based on an image shot by a first time node;
and (3) image searching: obtaining a second image in the order of time nodes, wherein the shooting time nodes of the second image are close to the shooting time nodes of the first image,
finding a second position from the vector of the second image according to the first position, wherein the estimated speed of the moving target from the first position to the second position is closer to the speed characteristic of the moving target than the estimated speed to other positions in the second image;
adding the first position to a track vector, and taking the second position as the first position;
If the second image is not the last image in the plurality of images, jumping to the image searching step;
otherwise, adding the second location to the trajectory vector;
track smoothness determining step: determining smoothness of the moving target according to the track vector;
if the smoothness is greater than a threshold value, finding a position of track mutation, modifying the moving track, and jumping to the track smoothness determining step.
In some embodiments, the determining the smoothness of the moving object according to the trajectory vector includes:
extracting a plurality of fluctuation features of the moving track according to a third formula and the track vector, wherein the third formula is as follows:
wherein Wfeature (2 n) is the 2 n-th fluctuation feature of the plurality of fluctuation features, M is the total number of elements in the Track vector, track x (m) is the x coordinate of the mth element of the Track vector, track y (m) is the y-coordinate of the mth element of the trajectory vector, e is a natural constant, j is an imaginary unit, ω 0 Is twice the frequency at which multiple images are taken;
determining smoothness of the moving target according to a fourth formula and the fluctuation features, wherein the fourth formula is as follows:
Where smooths is smoothness and N is the total number of fluctuation features.
In some embodiments, the locating the location of the track mutation, modifying the activity track, includes:
determining a plurality of track abrupt changes according to the track vector and a fifth formula, wherein the fifth formula is as follows:
wherein Sch (m) is the mth trace mutation amount, track x (m) is the x coordinate of the mth element of the Track vector, track y (m) is the y-coordinate of the mth element of the trajectory vector;
selecting a track vector element corresponding to a track abrupt change quantity with the minimum absolute value as a target element;
and modifying the track vector according to the vector and the speed characteristic of the image corresponding to the target element, wherein the speed characteristic corresponding to the target element after modification is lower than the speed characteristic corresponding to the target element before modification.
Illustratively, while the determination of the trajectory based on the speed principle is reliable in most cases, there are exceptions, such as trajectory confusion when two moving objects are moving at a fast speed and are so close to be indistinguishable at a certain moment. As shown in fig. 2, the real track of the first moving object 201 is the right turning track 203, and the real track of the second moving object 202 is the straight track 204, if based on the speed principle, when the moving object 201 moves to the first position 2011 at the first moment, the track of the second moving object 202 is "spliced" to the track of the first moving object 201, that is, the left turning track 205, because the position of the second moving object 202 is too close to the first position 2011 at the next moment and the speed is usually slow when the moving object 201 turns, based on the speed principle, so that the track misjudgment is caused.
The method for identifying the track misjudgment provided by the embodiment of the invention is used for judging the smoothness of the track, specifically, after the track is identified according to the speed principle, the possibility of track error is judged according to the smoothness of the track, when a problem occurs, an unsmooth point is found, the range of speed fluctuation is enlarged, track adjustment is carried out, after repeated iteration, a track with smaller speed fluctuation and smoothness can be found, and the track is obviously more reliable.
For the aspect of extracting the smoothness of the track, one way is to extract the fluctuation characteristics of the moving track, and the application formula is as follows:
wherein Wfeature (2 n) is the 2 n-th fluctuation feature of the plurality of fluctuation features, M is the total number of elements in the trajectory vector, traCk x (m) is the x coordinate of the mth element of the Track vector, track y (m) is the y-coordinate of the mth element of the trajectory vector, e is a natural constant, j is an imaginary unit, ω 0 For shootingA frequency of the plurality of images is doubled;
and calculating the fluctuation characteristics again to obtain the overall smoothness, and applying a fourth formula:
where smooths is smoothness and N is the total number of fluctuation features.
In this formula, the smaller the smoothness value, the smoother the description. If the smoothness value is greater than the threshold value, a track mutation point needs to be found, and the moving track from the mutation point is modified.
One way to identify the track mutation is to decompose the track into a plurality of track segments, and express the track segments as a plurality of vectors, when the included angle between two adjacent track segments is relatively sharp, it is indicated that there is a very large risk of misjudgment in this track segment, and the above judgment process is expressed by applying a fifth formula:
wherein Sch (m) is the mth trace mutation amount, track x (m) is the x coordinate of the mth element of the Track vector, track y (m) is the y-coordinate of the mth element of the trajectory vector.
In the above formula, when the included angle between the two track sections is relatively sharp, the absolute value of the track abrupt change amount is relatively small, and the track abrupt change position can be found based on the threshold value judgment.
The position at and after the mutation position needs to be planned again, and the speed characteristic is usually reduced at the mutation position, so that a corrected position is found.
By iterating between planning the trajectory based on speed and identifying the trajectory anomalies based on smoothness, a more accurate trajectory can be identified.
The method for determining the moving track comprises the steps of firstly, acquiring a plurality of images, wherein the images comprise a plurality of moving targets, and the images are sequentially shot based on a plurality of time nodes; then, extracting a plurality of vectors corresponding to the plurality of images according to the plurality of images, wherein the vectors comprise a plurality of elements corresponding to the positions of a plurality of moving targets in the images; then, extracting a plurality of speed features corresponding to the plurality of moving targets according to the plurality of vectors; finally, by iterating between planning a plurality of activity trajectories according to the plurality of speed features and adjusting the speed features according to the plurality of activity trajectories, until the amount of fluctuation of the plurality of speed features and the smoothness of the plurality of activity trajectories are less than a smoothness threshold. The method and the device are based on the speed planning track, and do not need to identify the characteristics of the movable main body, so that the method and the device have low calculation cost, consume less calculation resources and human resources, and consume less analysis time when a plurality of targets are used. After the track is planned based on the speed, the accuracy of the track is verified through the track smoothness, the possibility of track misjudgment is reduced, and the track planning is more accurate.
It should be understood that the sequence number of each step in the foregoing embodiment does not mean that the execution sequence of each process should be determined by the function and the internal logic, and should not limit the implementation process of the embodiment of the present invention.
The following are device embodiments of the invention, for details not described in detail therein, reference may be made to the corresponding method embodiments described above.
Fig. 3 is a functional block diagram of an activity trajectory determining device according to an embodiment of the present invention, and referring to fig. 3, the activity trajectory determining device 3 includes: an image acquisition module 301, a position vector extraction module 302, a velocity feature extraction module 303, and a trajectory determination module 304, wherein:
an image acquisition module 301, configured to acquire a plurality of images, where the images include a plurality of moving objects, and the plurality of images are sequentially captured based on a plurality of time nodes;
a position vector extraction module 302, configured to extract a plurality of vectors corresponding to the plurality of images according to the plurality of images, where a vector includes a plurality of elements corresponding to positions of a plurality of moving targets in the images;
a speed feature extraction module 303, configured to extract a plurality of speed features corresponding to the plurality of moving targets according to the plurality of vectors;
The track determining module 304 is configured to repeatedly iterate between planning a plurality of active tracks according to the plurality of speed features and adjusting the speed features according to the plurality of active tracks until the fluctuation amounts of the plurality of speed features and the smoothness of the plurality of active tracks are less than a smoothness threshold.
Fig. 4 is a functional block diagram of a terminal according to an embodiment of the present invention. As shown in fig. 4, the terminal 4 of this embodiment includes: a processor 400 and a memory 401, said memory 401 having stored therein a computer program 402 executable on said processor 400. The processor 400 implements the steps of the respective activity trajectory determining methods and embodiments described above, such as steps 101 to 104 shown in fig. 1, when executing the computer program 402.
By way of example, the computer program 402 may be partitioned into one or more modules/units that are stored in the memory 401 and executed by the processor 400 to accomplish the present invention.
The terminal 4 may be a computing device such as a desktop computer, a notebook computer, a palm computer, a cloud server, etc. The terminal 4 may include, but is not limited to, a processor 400, a memory 401. It will be appreciated by those skilled in the art that fig. 4 is merely an example of the terminal 4 and is not limiting of the terminal 4, and may include more or fewer components than shown, or may combine some components, or different components, e.g., the terminal 4 may further include input-output devices, network access devices, buses, etc.
The processor 400 may be a central processing unit (Central Processing Unit, CPU), but may also be other general purpose processors, digital signal processors (Digital Signal Processor, DSP), application specific integrated circuits (Application Specific Integrated Circuit, ASIC), field programmable gate arrays (Field-Programmable Gate Array, FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, or the like. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
The storage 401 may be an internal storage unit of the terminal 4, for example, a hard disk or a memory of the terminal 4. The memory 401 may also be an external storage device of the terminal 4, such as a plug-in hard disk, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash memory Card (Flash Card) or the like, which are provided on the terminal 4. Further, the memory 401 may also include both an internal storage unit and an external storage device of the terminal 4. The memory 401 is used for storing the computer program 402 and other programs and data required by the terminal 4. The memory 401 may also be used to temporarily store data that has been output or is to be output.
It will be apparent to those skilled in the art that, for convenience and brevity of description, only the above-described division of the functional units and modules is illustrated, and in practical application, the above-described functional distribution may be performed by different functional units and modules according to needs, i.e. the internal structure of the apparatus is divided into different functional units or modules to perform all or part of the above-described functions. The functional units and modules in the embodiment may be integrated in one processing unit, or each unit may exist alone physically, or two or more units may be integrated in one unit, where the integrated units may be implemented in a form of hardware or a form of a software functional unit. In addition, specific names of the functional units and modules are only for convenience of distinguishing from each other, and are not used for limiting the protection scope of the present application. The specific working process of the units and modules in the above system may refer to the corresponding process in the foregoing method embodiment, and will not be described herein again.
In the foregoing embodiments, the descriptions of the embodiments are focused on, and the details or descriptions of other embodiments may be referred to for those parts of an embodiment that are not described in detail or are described in detail.
Those of ordinary skill in the art will appreciate that the elements and algorithm steps described in connection with the embodiments disclosed herein can be implemented as electronic hardware, or combinations of computer software and electronic hardware. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the solution. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present invention.
In the embodiments provided in the present invention, it should be understood that the disclosed apparatus/terminal and method may be implemented in other manners. For example, the apparatus/terminal embodiments described above are merely illustrative, e.g., the division of the modules or units is merely a logical function division, and there may be additional divisions when actually implemented, e.g., multiple units or components may be combined or integrated into another system, or some features may be omitted or not performed. Alternatively, the coupling or direct coupling or communication connection shown or discussed may be an indirect coupling or communication connection via interfaces, devices or units, which may be in electrical, mechanical or other forms.
The units described as separate units may or may not be physically separate, and units shown as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the embodiment.
In addition, each functional unit in each embodiment of the present invention may be integrated in one processing unit, each unit may exist alone physically, or two or more units may be integrated in one unit. The integrated units may be implemented in hardware or in software functional units.
The integrated modules/units, if implemented in the form of software functional units and sold or used as stand-alone products, may be stored in a computer readable storage medium. Based on this understanding, the present invention may also be implemented by implementing all or part of the procedures in the methods of the above embodiments, or by instructing the relevant hardware by a computer program, where the computer program may be stored in a computer readable storage medium, and the computer program may be implemented by implementing the steps of the embodiments of the methods and apparatuses described above when executed by a processor. Wherein the computer program comprises computer program code which may be in source code form, object code form, executable file or some intermediate form etc. The computer readable medium may include: any entity or device capable of carrying the computer program code, a recording medium, a U disk, a removable hard disk, a magnetic disk, an optical disk, a computer Memory, a Read-Only Memory (ROM), a random access Memory (Random Access Memory, RAM), an electrical carrier signal, a telecommunications signal, a software distribution medium, and so forth.
The above embodiments are only for illustrating the technical solution of the present invention, and are not limited thereto; although the invention has been described in detail with reference to the foregoing embodiments, it will be understood by those of ordinary skill in the art that: the technical scheme described in the foregoing embodiments can be modified or some technical features thereof can be replaced by equivalents; such modifications and substitutions do not depart from the spirit and scope of the technical solutions of the embodiments of the present invention, and they should be included in the protection scope of the present invention.
Claims (10)
1. A method for determining an activity trajectory, comprising:
acquiring a plurality of images, wherein the images comprise a plurality of moving targets, and the images are sequentially shot based on a plurality of time nodes;
extracting a plurality of vectors corresponding to the plurality of images according to the plurality of images, wherein the vectors comprise a plurality of elements corresponding to the positions of a plurality of moving targets in the images;
extracting a plurality of speed features corresponding to the plurality of moving targets according to the plurality of vectors;
and repeatedly iterating between planning a plurality of active tracks according to the plurality of speed features and adjusting the speed features according to the plurality of active tracks until the fluctuation amounts of the plurality of speed features and the smoothness of the plurality of active tracks are smaller than a smoothness threshold.
2. The activity trajectory determination method according to claim 1, wherein the extracting a plurality of vectors corresponding to the plurality of images from the plurality of images includes:
for each of the plurality of images, performing the steps of:
the image is de-colored, and a gray scale image is obtained;
scaling and cutting the gray scale image according to a preset size;
the numerical values of a plurality of pixels in the gray scale image are adjusted, so that the numerical value distribution of the plurality of pixels in the gray scale image accords with a preset condition;
dividing the gray level map into a plurality of image blocks to be processed;
and (3) image verification calculation: determining a plurality of image kernels corresponding to the plurality of image blocks to be processed according to the plurality of image blocks to be processed, wherein the image kernels are the sum of the values of a plurality of pixels in the image blocks to be processed;
determining a plurality of target image blocks according to the plurality of image cores to be processed and the plurality of background cores, wherein the plurality of background cores are obtained based on image blocks obtained by dividing background images, and the deviation between the image cores of the target image blocks and the background cores at corresponding positions in the background images is larger than a picture core threshold;
if the number of pixels in the target image blocks is greater than the pixel number threshold, dividing the target image blocks, taking the image blocks obtained by dividing as a plurality of image blocks to be processed, and jumping to the image verification calculation step;
Otherwise, the positions of the target image blocks in the image are extracted as a plurality of elements of the vector.
3. The method for determining an activity trajectory according to claim 2, wherein the adjusting the values of the plurality of pixels in the gray scale map so that the distribution of the values of the plurality of pixels in the gray scale map meets a preset condition includes:
and a primary adjustment step: and adjusting a plurality of pixel values in the gray scale map once according to the first formula, wherein the first formula is as follows:
where p' (i) is the pixel value after the ith one-time adjustment, a is the pixel value interval difference, p "(i) is the pixel value before the ith one-time adjustment, p" (min) is the minimum value of the plurality of pixel values before the one-time adjustment, p "(max) is the maximum value of the plurality of pixel values before the one-time adjustment, and b is the minimum value of the interval after the one-time adjustment;
counting the number of the pixel values in a plurality of preset distribution intervals after one-time adjustment;
if the number of the pixel values in the preset distribution intervals does not meet the preset condition, performing secondary adjustment on the pixel values in the gray scale image according to a second formula, and jumping to the primary adjustment step, wherein the second formula is as follows:
Wherein p (i) is the pixel value after the ith secondary adjustment, k is the concave-convex adjustment coefficient, the concave-convex adjustment coefficient is negative when the number statistical curves of the pixel values in the preset distribution intervals are convex, the concave-convex adjustment coefficient is positive when the number statistical curves of the pixel values in the preset distribution intervals are concave, e is a natural constant, c is a central coefficient, and d is an expansion coefficient.
4. The activity trajectory determination method according to claim 1, wherein the extracting a plurality of speed features corresponding to the plurality of activity targets from the plurality of vectors includes:
acquiring a first image, a second image, a first vector and a second vector from the plurality of images, wherein the first image and the second image are shot based on two adjacent time nodes, and the first vector and the second vector respectively correspond to the first image and the second image;
acquiring a time difference between the first image shooting time node and the second image shooting time node;
determining a plurality of distance sets corresponding to a plurality of moving targets according to the first vector and the second vector, wherein the distance sets comprise distances from the moving targets in the first image to the plurality of moving targets in the second image;
Selecting a distance with the smallest value from the plurality of distance sets as a distance characteristic of the plurality of moving targets;
and determining a plurality of speed characteristics corresponding to the plurality of moving targets according to the distance characteristics of the plurality of moving targets and the time difference.
5. The activity trajectory determination method according to any one of claims 1 to 4, wherein the step of repeatedly iterating between planning a plurality of activity trajectories from the plurality of speed features and adjusting the speed features from the plurality of activity trajectories until the amounts of fluctuation of the plurality of speed features and the smoothness of the plurality of activity trajectories are less than a smoothness threshold value, comprises:
for each of the plurality of activity targets, performing the steps of:
acquiring a first position of a moving target, wherein the first position is determined based on an image shot by a first time node;
and (3) image searching: obtaining a second image in the order of time nodes, wherein the shooting time nodes of the second image are close to the shooting time nodes of the first image,
finding a second position from the vector of the second image according to the first position, wherein the estimated speed of the moving target from the first position to the second position is closer to the speed characteristic of the moving target than the estimated speed to other positions in the second image;
Adding the first position to a track vector, and taking the second position as the first position;
if the second image is not the last image in the plurality of images, jumping to the image searching step;
otherwise, adding the second location to the trajectory vector;
track smoothness determining step: determining smoothness of the moving target according to the track vector;
if the smoothness is greater than a threshold value, finding a position of track mutation, modifying the moving track, and jumping to the track smoothness determining step.
6. The activity trajectory determination method of claim 5, wherein the determining smoothness of the activity target from the trajectory vector comprises:
extracting a plurality of fluctuation features of the moving track according to a third formula and the track vector, wherein the third formula is as follows:
wherein Wfeature (2 n) is the 2 n-th fluctuation feature of the plurality of fluctuation features, M is the total number of elements in the Track vector, track x (m) is the x coordinate of the mth element of the Track vector, track y (m) is the y-coordinate of the m-th element of the trajectory vector, e is a natural constant, j is an imaginary unit, ω0 is a double of the frequency at which a plurality of images are taken;
Determining smoothness of the moving target according to a fourth formula and the fluctuation features, wherein the fourth formula is as follows:
where smooths is smoothness and N is the total number of fluctuation features.
7. The activity trajectory determination method of claim 5, wherein the locating the location of the trajectory mutation, modifying the activity trajectory, comprises:
determining a plurality of track abrupt changes according to the track vector and a fifth formula, wherein the fifth formula is as follows:
wherein Sch (m) is the mth trace mutation amount, track x (m) is the x coordinate of the mth element of the Track vector, track y (m) is the y-coordinate of the mth element of the trajectory vector;
selecting a track vector element corresponding to a track abrupt change quantity with the minimum absolute value as a target element;
and modifying the track vector according to the vector and the speed characteristic of the image corresponding to the target element, wherein the speed characteristic corresponding to the target element after modification is lower than the speed characteristic corresponding to the target element before modification.
8. An activity trajectory determining device for implementing the activity trajectory determining method according to any one of claims 1 to 7, comprising:
The image acquisition module is used for acquiring a plurality of images, wherein the images comprise a plurality of moving targets, and the images are sequentially shot based on a plurality of time nodes;
a position vector extraction module, configured to extract a plurality of vectors corresponding to the plurality of images according to the plurality of images, where the vectors include a plurality of elements corresponding to positions of a plurality of moving targets in the images;
the speed feature extraction module is used for extracting a plurality of speed features corresponding to the plurality of moving targets according to the plurality of vectors;
the method comprises the steps of,
the track determining module is used for repeatedly iterating between planning a plurality of moving tracks according to the plurality of speed features and adjusting the speed features according to the plurality of moving tracks until the fluctuation amount of the plurality of speed features and the smoothness of the plurality of moving tracks are smaller than a smoothness threshold value.
9. A terminal comprising a memory and a processor, the memory having stored therein a computer program executable on the processor, characterized in that the processor implements the steps of the method according to any of the preceding claims 1 to 7 when the computer program is executed.
10. A computer readable storage medium storing a computer program, characterized in that the computer program when executed by a processor implements the steps of the method according to any of the preceding claims 1 to 7.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202310123621.8A CN116152293A (en) | 2023-02-09 | 2023-02-09 | Activity track determining method, activity track determining device, activity track determining terminal and storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202310123621.8A CN116152293A (en) | 2023-02-09 | 2023-02-09 | Activity track determining method, activity track determining device, activity track determining terminal and storage medium |
Publications (1)
Publication Number | Publication Date |
---|---|
CN116152293A true CN116152293A (en) | 2023-05-23 |
Family
ID=86340326
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202310123621.8A Pending CN116152293A (en) | 2023-02-09 | 2023-02-09 | Activity track determining method, activity track determining device, activity track determining terminal and storage medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN116152293A (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN118366227A (en) * | 2024-06-20 | 2024-07-19 | 河北科曼信息技术有限公司 | Action track recognition method and device, electronic equipment and storage medium |
-
2023
- 2023-02-09 CN CN202310123621.8A patent/CN116152293A/en active Pending
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN118366227A (en) * | 2024-06-20 | 2024-07-19 | 河北科曼信息技术有限公司 | Action track recognition method and device, electronic equipment and storage medium |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
JP7236545B2 (en) | Video target tracking method and apparatus, computer apparatus, program | |
CN107944020B (en) | Face image searching method and device, computer device and storage medium | |
CN109886997B (en) | Identification frame determining method and device based on target detection and terminal equipment | |
CN110020592B (en) | Object detection model training method, device, computer equipment and storage medium | |
CN110245579B (en) | People flow density prediction method and device, computer equipment and readable medium | |
US20240257423A1 (en) | Image processing method and apparatus, and computer readable storage medium | |
CN110689043A (en) | Vehicle fine granularity identification method and device based on multiple attention mechanism | |
CN111914908A (en) | Image recognition model training method, image recognition method and related equipment | |
CN114170558B (en) | Method, system, apparatus, medium, and article for video processing | |
CN115690545B (en) | Method and device for training target tracking model and target tracking | |
CN116152293A (en) | Activity track determining method, activity track determining device, activity track determining terminal and storage medium | |
CN111753736A (en) | Human body posture recognition method, device, equipment and medium based on packet convolution | |
CN111738319A (en) | Clustering result evaluation method and device based on large-scale samples | |
CN111950507B (en) | Data processing and model training method, device, equipment and medium | |
CN117036392A (en) | Image detection method and related device | |
CN111914809A (en) | Target object positioning method, image processing method, device and computer equipment | |
CN111104965A (en) | Vehicle target identification method and device | |
CN116433722A (en) | Target tracking method, electronic device, storage medium, and program product | |
CN113361511B (en) | Correction model establishing method, device, equipment and computer readable storage medium | |
CN114627534A (en) | Living body discrimination method, electronic device, and storage medium | |
CN113378608A (en) | Crowd counting method, device, equipment and storage medium | |
CN112749625B (en) | Time sequence behavior detection method, time sequence behavior detection device and terminal equipment | |
CN116434316B (en) | Identity recognition method, device, equipment and medium based on X86 industrial control main board | |
CN113658101B (en) | Method and device for detecting landmark points in image, terminal equipment and storage medium | |
CN118037738B (en) | Asphalt pavement crack pouring adhesive bonding performance detection method and equipment |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination |