A mobile target tracking method and related apparatus
By using simple arithmetic operations on depth parameters and center point coordinates, the linear velocity and angular velocity of the aircraft are calculated, solving the problem of insufficient computing power in intelligent following devices and improving the stability and tracking accuracy of the equipment.
Patent Information
- Application Number
- CN202211217722.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-09-30
- Publication Date
- 2026-02-13
- Estimated Expiration
- 2042-09-30
AI Technical Summary
Existing target tracking algorithms are complex, resulting in insufficient GPU and CPU computing power for intelligent following devices, leading to device instability.
Using a simple arithmetic method based on depth parameters and center point coordinates, the system acquires the straight-line distance and deviation angle of the moving target through a binocular depth camera, calculates the linear velocity and angular velocity of the target, and controls the movement of the intelligent following device.
This reduces the computational load on intelligent following devices and improves device stability and tracking accuracy.
Smart Images

Figure CN115589528B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of artificial intelligence, and in particular to a method and apparatus for tracking moving targets. Background Technology
[0002] Currently, algorithms from various subfields of Artificial Intelligence (AI) are being used in a wide range of scenarios to improve traditional algorithms or update existing ones, such as in motion control and autonomous driving. Visual AI algorithms also have numerous applications, including intelligent driving, path planning, human-computer interaction, target monitoring, and target following. In the field of vision-based target following, there are methods such as mean shift target tracking based on color features, target tracking methods based on deep learning algorithms, target tracking methods based on sub-region matching, tracking algorithms based on mainstream filtering, and tracking control based on sensors such as ultrasound, Bluetooth, and LiDAR to solve practical problems. These methods can be applied to intelligent following devices, such as robots, especially robotic dogs. Intelligent following devices equipped with these algorithms are widely used in entertainment, social services, and other fields.
[0003] However, the aforementioned vision-based target following technologies typically place high demands on the machine's graphics processing unit (GPU), especially for neural network-based target following algorithms. This is because the GPU's superior computing power is essential for running complex algorithms. Furthermore, the computing modules currently used in robots are based on 64-bit RISC Machine 64 (ARM64) architectures, and the computing power of their GPUs and CPUs does not reach the level of personal computers (PCs).
[0004] It is evident that existing target tracking algorithms are too complex and cannot match the processing power of current intelligent following devices. Consequently, in actual use, insufficient GPU and CPU computing power can lead to device instability.
[0005] Therefore, it is necessary to propose a target tracking algorithm with low computing power and high accuracy to improve the stability of intelligent following devices. Summary of the Invention
[0006] This application provides a moving target tracking method and related apparatus to improve the stability of intelligent following devices in actual use.
[0007] In a first aspect, embodiments of the present application provide a mobile target tracking method, the method comprising:
[0008] Continuously performing image acquisition, when a target image containing a mobile target is acquired, the following operations are performed:
[0009] In the currently acquired target image, an outer frame of the mobile target is labeled, and the center point coordinates of the outer frame are obtained;
[0010] The depth parameter of the mobile target is obtained, wherein the depth parameter represents the straight-line distance between the mobile target and the intelligent following device;
[0011] Based on the depth parameter and the center point coordinates, the target speed required for the intelligent following device to move to the mobile target is calculated;
[0012] Based on the target speed, the intelligent following device is controlled to move in the direction of the mobile target.
[0013] In a second aspect, embodiments of the present application also provide a mobile target tracking device, the device comprising:
[0014] The acquisition module is configured to continuously perform image acquisition.
[0015] The processing module is configured to, when the acquisition module acquires a target image containing a mobile target, perform the following operations:
[0016] In the currently acquired target image, an outer frame of the mobile target is labeled, and the center point coordinates of the outer frame are obtained;
[0017] The depth parameter of the mobile target is obtained, wherein the depth parameter represents the straight-line distance between the mobile target and the intelligent following device;
[0018] Based on the depth parameter and the center point coordinates, the target speed required for the intelligent following device to move to the mobile target is calculated;
[0019] Based on the target speed, the intelligent following device is controlled to move in the direction of the mobile target.
[0020] Optionally, when the outer frame of the mobile target is labeled in the currently acquired target image, and the center point coordinates of the outer frame are obtained, the processing module is configured to:
[0021] The target image is input into a trained target detection model, and the outer frame of the mobile target is obtained through the target detection model;
[0022] The center point coordinates of the outer frame are obtained based on the relative position of the center point of the outer frame and the origin of the target image coordinates.
[0023] Optionally, when obtaining the depth parameters of a moving target, the processing module is specifically used for:
[0024] Two initial images of the moving target are acquired using a binocular depth camera configured in the intelligent tracking device.
[0025] The straight-line distance between the moving target and the intelligent tracking device is obtained by using the parallax between two initial images; where parallax is represented by the difference in azimuth angle produced when observing the same target from two different observation points.
[0026] The straight-line distance is used as the depth parameter.
[0027] Optionally, when calculating the target speed required for the intelligent following device to move to the moving target based on the depth parameter and center point coordinates, the processing module is specifically used for:
[0028] Determine the straight-line distance represented by the depth parameter;
[0029] The deviation angle is obtained based on the x-coordinate and depth parameters of the center point coordinates. The deviation angle represents the angle that the intelligent following device needs to rotate to reach the moving target.
[0030] Based on the straight-line distance and deviation angle, the linear velocity and angular velocity of the intelligent following device at the current moment are obtained;
[0031] The current fuselage linear velocity and fuselage angular velocity are used as the target velocity.
[0032] Optionally, when obtaining the current linear velocity and angular velocity of the intelligent following device based on the straight-line distance and deviation angle, the processing module is used to:
[0033] When the straight-line distance is not greater than the first distance threshold, the fuselage linear velocity at the current moment is obtained based on the difference between the first distance threshold and the straight-line distance, and the preset penalty coefficient. The penalty coefficient is used to make the value of the fuselage linear velocity converge within a set range.
[0034] When the straight-line distance is greater than the first distance threshold but not greater than the second distance threshold, the linear velocity of the fuselage at the current moment is set to zero.
[0035] When the straight-line distance is greater than the second distance threshold, the fuselage linear velocity at the current moment is obtained based on the product of the straight-line distance and the preset penalty coefficient.
[0036] When the deviation angle is greater than the set angle threshold, the fuselage angular velocity at the current moment is obtained based on the deviation angle and pi.
[0037] When the deviation angle is not greater than the set angle threshold, the fuselage angular velocity at the current moment is set to zero.
[0038] Optionally, after obtaining the target speed, the processing module is further configured to perform the following operations for the fuselage linear speed and the fuselage angular speed contained in the target speed, respectively:
[0039] obtain a preset initial proportional coefficient, a target integral coefficient and an initial differential coefficient; wherein the target integral coefficient is set as 0;
[0040] determine a speed error of the current moment based on a difference between the target speed of the current moment and a historical target speed of a previous moment;
[0041] determine a corresponding error sum based on the historical speed error of all historical moments from a moment when the intelligent following device starts running to the moment before the current moment, and the speed error of the current moment;
[0042] determine an average error of the current moment based on the speed error of the current moment and the historical speed error of the previous moment, and a time difference between the current moment and the previous moment;
[0043] adjust the initial proportional coefficient and the initial differential coefficient based on the speed error, the target integral coefficient and the error sum, the average error, and the actual application result of the target speed, to obtain a target proportional coefficient and a target differential coefficient;
[0044] adjust the target speed of the current moment based on the target proportional coefficient and the speed error, the target integral coefficient and the error sum, the target differential coefficient and the average error.
[0045] Optionally, the target proportional coefficient is obtained by the processing module in the following manner:
[0046] set the initial differential coefficient as 0;
[0047] increase the value of the initial proportional coefficient by a first set step size, and each time the value is increased, obtain a latest target speed based on the current increased initial proportional coefficient and the speed error, the target integral coefficient and the error sum, the initial differential coefficient and the average error, and apply the latest target speed to the intelligent following device until the intelligent following device generates oscillation during running;
[0048] decrease the current value of the initial proportional coefficient by a second set step size, and each time the value is decreased, obtain a latest target speed based on the current decreased initial proportional coefficient and the speed error, the target integral coefficient and the error sum, the initial differential coefficient and the average error, until the difference between the latest obtained target speed and the previously obtained target speed is lower than a first difference threshold.
[0049] set the target proportional coefficient based on the value of the initial proportional coefficient after the last decrease.
[0050] Optionally, the target differential coefficient is obtained by the processing module in the following manner:
[0051] The value of the differential coefficient is adjusted according to a third setting step, and each time the value is adjusted, a latest target speed is obtained based on the current adjusted initial differential coefficient and the average error, the target integral coefficient and the error sum, and the target proportional coefficient and the speed error, and the latest target speed is applied to the intelligent following device until the intelligent following device generates oscillation during operation;
[0052] The current value of the initial differential coefficient is adjusted according to a fourth setting step, and each time the value is adjusted, a latest target speed is obtained based on the current adjusted initial differential coefficient and the average error, the target integral coefficient and the error sum, and the target proportional coefficient and the speed error, until the difference between the latest obtained target speed and the last obtained target speed is lower than a second difference threshold value;
[0053] The target differential coefficient is set based on the value of the initial differential coefficient after the last adjustment.
[0054] Optionally, when the target speed at the current time is adjusted based on the target proportional coefficient and the speed error, the target integral coefficient and the error sum, and the target differential coefficient and the average error, the processing module is configured to:
[0055] Obtain a first product of the target proportional coefficient and the speed error at the current time;
[0056] Obtain a second product of the target integral coefficient and the error sum;
[0057] Obtain a third product of the target differential coefficient and the average error at the current time;
[0058] Adjust the target speed at the current time based on the sum of the first product, the second product and the third product.
[0059] Optionally, when the intelligent following device is controlled to move towards the moving target based on the target speed, the processing module is specifically configured to:
[0060] Control the intelligent following device to rotate based on the body angular velocity at the current time;
[0061] Control the intelligent following device to move towards the moving target based on the body linear velocity at the current time.
[0062] In a third aspect, an embodiment of the present application provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable by the processor, and the processor implements the method of any one of the first aspect when executing the computer program.
[0063] In a fourth aspect, the embodiments of the present application provide a computer readable storage medium, which stores a computer program. The computer program is executed by a processor to implement the steps of the method according to any one of the first aspect.
[0064] In a fifth aspect, the embodiments of the present application provide a computer program product. When the computer program product is invoked by a computer, the computer is caused to perform the method according to the first aspect.
[0065] In the embodiments of the present application, the intelligent following device continuously collects images through the binocular depth camera. When a target image containing a moving target is collected, the target image is input into a target detection algorithm to obtain an external frame of the moving target and a center point coordinate of the external frame. Meanwhile, the depth parameter of the moving target is obtained through the binocular depth camera. Based on the center point coordinate and the depth parameter, the deviation angle and the straight-line distance between the moving target and the intelligent following device are calculated. The body linear speed and the body angular speed of the intelligent following device at the current time are further calculated. After adjustment, the intelligent following device is controlled to move towards the direction of the moving target.
[0066] In this way, the intelligent following device can quickly obtain the center point coordinate of the external frame of the moving target based on the pre-trained target detection algorithm, and calculate the body linear speed and the body angular speed through simple four arithmetic operations. This fast and efficient operation method reduces the operation amount of the GPU and the CPU carried by the intelligent following device, and improves the stability of the intelligent following device in actual application. BRIEF DESCRIPTION OF DRAWINGS
[0067] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings needed in the embodiment description will be briefly introduced. Obviously, the drawings in the following description are only some embodiments of the present application, and other drawings can be obtained by those skilled in the art without creative labor. In the drawings:
[0068] Figure 1 is a system architecture schematic diagram in the embodiments of the present application;
[0069] Figure 2 is a detailed flowchart of moving target tracking under the system architecture in the embodiments of the present application;
[0070] Figure 3 is a target image schematic diagram containing a moving target in the embodiments of the present application;
[0071] Figure 4 is a scene schematic diagram for obtaining a depth parameter in the embodiments of the present application;
[0072] Figure 5Figure 1 is a detailed flow chart of calculating the target speed of the intelligent following device under the system architecture in the embodiments of the present application.
[0073] Figure 6 Figure 2 is a detailed flow chart of adjusting the fuselage line speed of the intelligent following device under the system architecture in the embodiments of the present application.
[0074] Figure 7 Figure 3 is a detailed flow chart of obtaining the target proportional coefficient under the system architecture in the embodiments of the present application.
[0075] Figure 8 Figure 4 is a detailed flow chart of obtaining the target differential coefficient under the system architecture in the embodiments of the present application.
[0076] Figure 9 Figure 5 is a detailed flow chart of adjusting the fuselage line speed of the intelligent following device under the system architecture in the embodiments of the present application.
[0077] Figure 10 Figure 6 is a logic diagram of mobile tracking in a specific application scenario provided in the embodiments of the present application.
[0078] Figure 11 Figure 7 is a structural diagram of a mobile target tracking device in the embodiments of the present application.
[0079] Figure 12 Figure 8 is a structural diagram of an electronic device in the embodiments of the present application. DETAILED DESCRIPTION
[0080] In order to make the objectives, technical solutions and advantages of the embodiments of the present application clearer, the technical solutions of the present application will be described in detail below with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all the embodiments. Based on the embodiments described in the present application document, all other embodiments obtained by those of ordinary skill in the art without creative labor fall within the scope of protection of the technical solutions of the present application.
[0081] Some concepts involved in the embodiments of the present application will be introduced below.
[0082] (1) Intelligent following device: an intelligent robot, a robotic dog, and other artificial intelligence devices equipped with tracking algorithms, which can automatically identify and track mobile targets, and are widely used in entertainment, social services, and other fields.
[0083] (2) Target detection model: an important application of artificial intelligence, which is used to identify target objects in images captured by a camera and mark the relative positions of the objects in the images.
[0084] (3) Body linear velocity: The speed required for the intelligent following device to move to the moving target is calculated by the straight-line distance between the intelligent following device and the moving target. Since the camera continuously captures images of the moving target, the relative position between the moving target and the intelligent following device is continuously updated, so the body linear velocity will be updated accordingly.
[0085] (4) Body angular velocity: The rotational speed of the intelligent following device as it rotates to the direction of the moving target, calculated by the deviation angle between the intelligent following device and the moving target. Since the camera continuously captures images of the moving target, the relative position of the moving target and the intelligent following device is continuously updated, so the body linear velocity will also be updated accordingly.
[0086] The preferred embodiments of this application will now be described in detail with reference to the accompanying drawings.
[0087] See Figure 1 As shown in the embodiment of this application, it includes three main parts: an intelligent following device 100, a binocular depth camera 101, and a moving target 103. The binocular depth camera 101 configured in the intelligent following device 100 continuously acquires images. When it acquires a target image containing the moving target 103, the intelligent following device 100 inputs the target image into a trained target detection model to obtain the bounding box of the moving target 103 in the target image and the coordinates of the center point of the bounding box. At the same time, the binocular depth camera 103 acquires the straight-line distance between the moving target 103 and the intelligent following device 100. Finally, the intelligent following device 100 calculates the target speed required to move to the moving target 103 using the center point coordinates of the bounding box and the straight-line distance, and moves in the direction of the moving target 103 to complete target tracking.
[0088] Based on the above system architecture, see [link / reference] Figure 2 As shown in this embodiment, the intelligent following device continuously acquires images. When a target image containing a moving target is acquired, the detailed process of moving target tracking is as follows:
[0089] Step 201: In the currently acquired target image, mark the bounding box of the moving target and obtain the coordinates of the center point of the bounding box.
[0090] Specifically, in this embodiment, the intelligent following device inputs the acquired target image into the trained target detection model, obtains the bounding box of the moving target through the target detection model, and obtains the coordinates of the center point of the bounding box based on the relative position of the center point of the bounding box and the origin of the target image coordinates.
[0091] For example, see Figure 3As shown, the intelligent following device is equipped with a pre-trained yolo algorithm for target detection. The yolo algorithm uses a target image as the input of a neural network, performs convolution operation on the target image, obtains the bounding box of the moving target, and outputs the center point coordinates (x, y) of the bounding box based on the relative position of the center point of the bounding box to the coordinate origin of the target image, wherein the coordinate origin of the target image is the top-left corner of the target image.
[0092] Based on step 201, the target detection algorithm is pre-trained, so that the neural network does not need to be trained every time a target image is obtained, thereby speeding up the target detection of the intelligent following device.
[0093] Step 202: Obtain the depth parameter of the moving target.
[0094] Specifically, in the embodiment of the present application, the intelligent following device obtains two initial images of the moving target through the binocular depth camera configured by itself, and then obtains the straight-line distance between the moving target and the intelligent following device through the parallax between the two initial images, and takes the straight-line distance as the depth parameter.
[0095] For example, referring to Figure 4 As shown, the left and right cameras of the binocular depth camera have a distance of 6 cm, which is called the baseline. When they simultaneously shoot a moving target 1 m away from the intelligent following device, the lines connecting the moving target and the two cameras form an angle of 30°, and the straight-line distance between the moving target and the intelligent following device can be calculated through the angle and the baseline length.
[0096] Alternatively, the intelligent following device can also use a monocular depth camera to estimate the straight-line distance between the moving target and the intelligent following device through the size of the moving target in the target image.
[0097] Step 203: Calculate the target speed required for the intelligent following device to move to the moving target based on the depth parameter and the center point coordinates.
[0098] Step 204: Control the intelligent following device to move in the direction of the moving target based on the target speed.
[0099] Specifically, the intelligent following device is controlled to rotate based on the body angular velocity at the current moment, and the intelligent following device is controlled to move in the direction of the moving target based on the body linear velocity at the current moment.
[0100] For example, the intelligent following device is controlled to rotate in the direction of the moving target based on the body angular velocity w = 3 rad / s at the current moment, and the intelligent following device is controlled to move in the direction of the moving target based on the body linear velocity v = 0.8 m / s at the current moment.
[0101] In the embodiments of the present application, referring to Figure 5 When step 203 is performed, the following operations are specifically performed:
[0102] Step 2031: determining the straight line distance represented by the depth parameter.
[0103] Specifically, the intelligent following device first determines the straight line distance z represented by the depth parameter.
[0104] Step 2032: obtaining the corresponding deviation angle based on the abscissa of the center point coordinate and the depth parameter, wherein the deviation angle represents the angle that the intelligent following device needs to rotate to move to the moving target.
[0105] Specifically, the intelligent following device obtains the corresponding deviation angle θ based on the abscissa x of the center point coordinate and the depth parameter z.
[0106] For example, assuming that the center point coordinate of the moving target circumscribed frame is (2, 3) and the straight line distance represented by the depth parameter is 1 m, the intelligent following device calculates the corresponding deviation angle θ = arcsin (2 / z) according to the deviation angle calculation formula θ = arcsin (x / z), and the corresponding deviation angle θ = arcsin (2) is calculated.
[0107] Step 2033: obtaining the body linear velocity and body angular velocity of the intelligent following device at the current time based on the straight line distance and the deviation angle.
[0108] Specifically, the intelligent following device obtains the body linear velocity v and the body angular velocity w of the intelligent following device at the current time based on the straight line distance z and the deviation angle θ.
[0109] Further, when the body linear velocity and the body angular velocity are obtained, there are specifically but not limited to the following five cases:
[0110] Case 1: when the straight line distance is not greater than the first distance threshold, the body linear velocity at the current time is obtained based on the difference between the first distance threshold and the straight line distance, and a preset penalty coefficient, wherein the penalty coefficient is used to make the value of the body linear velocity converge within a set interval.
[0111] For example, assuming that the first distance threshold is 0.2 m, the straight line distance z = 0.1 m < 0.2 m, and the penalty coefficient p = 0.7 (the value of the penalty coefficient p is flexibly configured based on actual research and development experience), the body linear velocity at the current time is v = p (- (0.2 - z)). (- (0.2 - 0.1)) = -0.07 m / s, that is, the intelligent following device retreats at a body linear velocity of 0.07 m / s.
[0112] Case 2: when the straight-line distance is greater than the first distance threshold and not greater than the second distance threshold, the body linear velocity at the current time is set to zero.
[0113] For example, assuming that the second distance threshold is 0.5 m, the straight-line distance z = 0.3 m, 0.2 m < z < 0.5 m, the intelligent following device sets the body linear velocity at the current time to 0.
[0114] Case 3: when the straight-line distance is greater than the second distance threshold, the body linear velocity at the current time is obtained based on the product of the straight-line distance and a preset penalty coefficient.
[0115] For example, assuming that the straight-line distance z = 10 m > 0.5 m, the body linear velocity at the current time is v = (p z) / 100 = (0.7 10) / 100 = 0.07 m / s.
[0116] Case 4: when the deviation angle is greater than a set angle threshold, the body angular velocity at the current time is obtained based on the deviation angle and the constant pi.
[0117] For example, assuming that the set angle threshold is 10°, the deviation angle θ = 30°, the body angular velocity at the current time is w = (θ / 180) π = (30° / 180) π = π 2 / 1080 rad / s.
[0118] Case 5: when the deviation angle is not greater than the set angle threshold, the body angular velocity at the current time is set to zero.
[0119] For example, when the deviation angle θ = 8°, the intelligent following device sets the body angular velocity at the current time to 0.
[0120] In summary, when the absolute value of the straight-line distance between the intelligent following device and the moving target is greater than the first distance threshold and not greater than the second distance threshold, it means that the intelligent following device has reached the position of the moving target, so the body linear velocity is set to 0, and when the deviation angle is not greater than the set angle threshold, it means that the intelligent following device has been directed towards the direction of the moving target, so the body angular velocity is set to 0.
[0121] Based on the description in step 2033, the body linear velocity and the body angular velocity are calculated by the straight-line distance and the deviation angle, only simple four arithmetic operations are used, which greatly reduces the CPU operation amount of the intelligent following device.
[0122] Step 2034: the body linear velocity and the body angular velocity at the current time are taken as the target speed.
[0123] Specifically, based on the body angular velocity at the current moment, the intelligent following device is controlled to rotate;
[0124] Based on the body linear velocity at the current moment, the intelligent following device is controlled to move towards the moving target direction.
[0125] Further, after obtaining the body linear velocity and the body angular velocity at the current moment, the intelligent following device adjusts the body linear velocity and the body angular velocity before performing step 2034, wherein the adjustment manner of the body linear velocity and the body angular velocity is the same. Taking the body linear velocity as an example, the specific adjustment steps are shown in the following table: Figure 6
[0126] Step 601: Obtain a preset initial proportional coefficient, a target integral coefficient and an initial differential coefficient; wherein the target integral coefficient is set to 0.
[0127] Specifically, the initial proportional coefficient and the initial differential coefficient are random values, which will be adjusted to the target integral coefficient kp and the target differential coefficient kd in the process of adjusting the body linear velocity of the intelligent following device, and the target integral coefficient ki=0. The specific adjustment process of kp and kd is described below.
[0128] Step 602: Determine the linear velocity error at the current moment based on the difference between the body linear velocity at the current moment and the historical body linear velocity at the previous moment.
[0129] Specifically, the intelligent following device saves all historical linear velocities and angular velocities from the starting moment of operation, and clears all data after shutdown.
[0130] For example, assuming that the body linear velocity at the current moment is 0.8 m / s, and the historical body linear velocity at the previous moment is 0.7 m / s, then the linear velocity error Vc at the current moment is 0.8-0.7=0.1 m / s.
[0131] Step 603: Determine the corresponding linear velocity error sum based on the historical linear velocity error at all historical moments from the starting moment of operation of the intelligent following device to the current moment, and the linear velocity error at the current moment.
[0132] For example, assuming that the intelligent following device saves three historical linear velocities from the starting moment of operation to the current moment, which are 0.2 m / s, 0.5 m / s and 0.7 m / s, and the body linear velocity at the current moment is 0.8 m / s, then the corresponding linear velocity error sum is and Vs is: (0.5-0.2)+(0.7-0.5)+(0.8-0.7)=0.6.
[0133] Step 604: determining the average linear velocity error of the current moment based on the linear velocity error of the current moment and the historical linear velocity error of the previous moment, and the time difference between the current moment and the previous moment.
[0134] For example, assuming that the time difference between the current moment and the previous moment is 0.1s, the average linear velocity error Vm of the current moment is 0.1 / 0.1=1m / s.
[0135] Step 605: adjusting the initial proportional coefficient and the initial differential coefficient based on the linear velocity error, the target integral coefficient, the linear velocity error sum, and the average linear velocity error, and combining the actual application result of the body linear velocity, to obtain the target proportional coefficient and the target differential coefficient.
[0136] Specifically, when step 605 is executed, the initial proportional coefficient is adjusted first, and the adjustment process of the initial proportional coefficient is described with reference to FIG. 6B. Figure 7
[0137] Step 6051: setting the initial differential coefficient to 0.
[0138] Step 6052: increasing the value of the initial proportional coefficient by a first set step size, and each time the value is increased, based on the current increased initial proportional coefficient and the linear velocity error, the target integral coefficient and the linear velocity error sum, the initial differential coefficient and the average linear velocity error, obtaining the latest body linear velocity once, and applying the latest body linear velocity to the intelligent following device until the intelligent following device generates oscillation when running.
[0139] For example, the value of the initial proportional coefficient is increased from 0 by a step size of 0.2, and each time the value is increased, based on the current increased initial proportional coefficient and the linear velocity error Vc, the target integral coefficient ki and the linear velocity error sum Vs, the initial differential coefficient kd and the average linear velocity error Vm, obtaining the latest body linear velocity once, and applying the latest body linear velocity to the intelligent following device until the intelligent following device generates oscillation when running.
[0140] Step 6053: decreasing the current value of the initial proportional coefficient by a second set step size, and each time the value is decreased, based on the current decreased initial proportional coefficient and the linear velocity error, the target integral coefficient and the linear velocity error sum, the initial differential coefficient and the average linear velocity error, obtaining the latest body linear velocity once, until the difference between the latest obtained body linear velocity and the last obtained body linear velocity is lower than a first difference threshold.
[0141] For example, according to the initial proportional coefficient determined in step 6052, the value of the initial proportional coefficient is started to be lowered by a step of 0.1, and each time the initial proportional coefficient is lowered, the latest body linear velocity is obtained based on the current lowered initial proportional coefficient and the linear velocity error Vc, the target integral coefficient ki and the linear velocity error sum Vs, the target proportional coefficient kp and the linear velocity error Vm, and the latest body linear velocity is applied to the intelligent following device until the difference between the latest obtained body linear velocity and the last obtained body linear velocity is lower than 0.02 m / s.
[0142] Step 6054: setting the target proportional coefficient based on the value of the initial proportional coefficient after the last lowering.
[0143] For example, based on the value of the initial proportional coefficient after the last lowering, 60% of the value is taken as the final target proportional coefficient kp.
[0144] The adjustment process of the initial differential coefficient is described in detail in the following Figure 8 :
[0145] Step 6055: the value of the differential coefficient is raised by a third set step, and each time the initial differential coefficient is raised, the latest body linear velocity is obtained based on the current raised initial differential coefficient and the average linear velocity error, the target integral coefficient and the linear velocity error sum, the target proportional coefficient and the linear velocity error, and the latest body linear velocity is applied to the intelligent following device until the intelligent following device produces oscillation when running;
[0146] For example, the value of the initial differential coefficient kd is raised from 0 by a step of 0.2, and each time the initial differential coefficient is raised, the latest body linear velocity is obtained based on the current raised initial differential coefficient and the average linear velocity error Vm, the target integral coefficient ki and the linear velocity error sum Vs, the target proportional coefficient kp and the linear velocity error Vc, and the latest body linear velocity is applied to the intelligent following device until the intelligent following device produces oscillation when running.
[0147] Step 6056: the current value of the initial differential coefficient is lowered by a fourth set step, and each time the initial differential coefficient is lowered, the latest body linear velocity is obtained based on the current lowered initial differential coefficient and the average linear velocity error, the target integral coefficient and the linear velocity error sum, the target proportional coefficient and the linear velocity error, until the difference between the latest obtained body linear velocity and the last obtained body linear velocity is lower than the second difference threshold;
[0148] For example, according to the initial differential coefficient determined in step 6055, the value of the initial differential coefficient is started to be reduced by 0.1, and each time the initial differential coefficient is reduced, the latest body linear velocity is obtained based on the current reduced initial differential coefficient and the average linear velocity error Vm, the target integral coefficient ki and the linear velocity error sum Vs, and the target proportional coefficient kp and the linear velocity error Vc, and the latest body linear velocity is applied to the intelligent following device until the difference between the latest obtained body linear velocity and the last obtained body linear velocity is less than 0.02 m / s.
[0149] Step 6057: Set the target differential coefficient based on the value of the last reduced initial differential coefficient.
[0150] For example, based on the value of the last reduced initial differential coefficient, 30% of the value is taken as the final target differential coefficient kd.
[0151] Step 606: Adjust the body linear velocity at the current time based on the target proportional coefficient and the linear velocity error, the target integral coefficient and the linear velocity error sum, and the target differential coefficient and the average linear velocity error.
[0152] Specifically, the body linear velocity at the current time is adjusted based on the target proportional coefficient kp and the linear velocity error Vc, the target integral coefficient ki and the linear velocity error sum Vs, and the target differential coefficient kd and the average linear velocity error Vm.
[0153] Specifically, when step 606 is executed, the adjustment process of the body linear velocity is shown in the following figure: Figure 9
[0154] Step 6061: Obtain the first product of the target proportional coefficient and the linear velocity error at the current time.
[0155] Specifically, the first product S1 of the target proportional coefficient kp and the linear velocity error Vc at the current time is obtained.
[0156] Step 6062: Obtain the second product of the target integral coefficient and the linear velocity error sum.
[0157] Specifically, the second product S2 of the target integral coefficient ki and the linear velocity error sum Vs is obtained.
[0158] Step 6063: Obtain the third product of the target differential coefficient and the average linear velocity error at the current time.
[0159] Specifically, the third product S3 of the target differential coefficient kd and the average linear velocity error Vm at the current time is obtained.
[0160] Step 6064: Adjust the body linear velocity at the current time based on the sum of the first product, the second product and the third product.
[0161] Specifically, according to the formula v=kp Vc+ki Vs+kd Vm, the current time body line speed adjustment.
[0162] Based on the above line speed adjustment method, the current time body angular velocity can be adjusted in the same way, and details are not repeated.
[0163] The above embodiments are further described in detail below through a specific application scenario.
[0164] Referring to Figure 10 The specific process of mobile target tracking in the embodiment of the application is as follows:
[0165] The binocular depth camera configured by the intelligent following device captures a target image containing a mobile target, and then inputs the target image into a yolo target detection model. Through the operation of the yolo target detection model, the bounding box of the mobile target is obtained, and the center point coordinates (10, 4) of the bounding box of the mobile target are obtained. At the same time, the binocular depth camera measures the depth parameter of the mobile target, i.e. the straight-line distance between the mobile target and the intelligent following device is z=20m. Then, based on the horizontal coordinate of the center point coordinate and the depth parameter, the intelligent device can calculate the deviation angle between the mobile target and the intelligent following device as θ=arcsin(10 / 20)=30°. Based on the straight-line distance between the mobile target and the intelligent following device and the deviation angle, as well as the preset penalty coefficient p=0.7, the current time body line speed v=p z / 100=0.14m / s, and the current time body angular velocity w=(θ / 180) π=π 2 / 1080 rad / s.
[0166] The preset initial proportional coefficient, target integral coefficient and initial differential coefficient are obtained, the target proportional coefficient and target differential coefficient are determined based on the current time body line speed (for specific method, refer to the foregoing description), and the current time body line speed and body angular velocity are adjusted based on the target proportional coefficient, target integral coefficient and target differential coefficient (for specific adjustment method, refer to the foregoing description). The adjusted body line speed v=0.15m / s, and the adjusted body angular velocity w=π 2 / 1000 rad / s.
[0167] Based on the body angular velocity w=π 2 / 1000 rad / s, the intelligent following device is controlled to rotate to the direction of the moving target based on a body linear speed v=0.15 m / s, and the intelligent following device is controlled to move to the direction of the moving target.
[0168] Moreover, although the operations of the method of the present application are described in a particular order in the drawings, this is not required or implied in any way, and one can practice the desired results in a different order, or practice all the desired results at once. Additionally or alternatively, certain steps can be omitted, combined, performed by different components, or performed at the same time.
[0169] Based on the same technical concept, referring to Figure 11 The embodiment of the present application also provides a moving target tracking device, which comprises:
[0170] The acquisition module 1101 is used for continuously acquiring images.
[0171] The processing module 1102 is used for performing the following operations when the acquisition module acquires a target image containing a moving target:
[0172] In the currently acquired target image, an outer frame of the moving target is labeled, and the center point coordinates of the outer frame are obtained;
[0173] The depth parameter of the moving target is obtained, wherein the depth parameter represents the straight-line distance between the moving target and the intelligent following device;
[0174] Based on the depth parameter and the center point coordinates, a target speed required for the intelligent following device to move to the moving target is calculated;
[0175] Based on the target speed, the intelligent following device is controlled to move to the direction of the moving target.
[0176] Optionally, when the outer frame of the moving target is labeled in the currently acquired target image, and the center point coordinates of the outer frame are obtained, the processing module 1102 is used for:
[0177] The target image is input into the trained target detection model, and the outer frame of the moving target is obtained through the target detection model;
[0178] The center point coordinates of the outer frame are obtained based on the relative position of the center point of the outer frame and the coordinate origin of the target image.
[0179] Optionally, when the depth parameter of the moving target is obtained, the processing module 1102 is specifically used for:
[0180] The binocular depth camera configured by the intelligent following device acquires two initial images of the moving target respectively;
[0181] The straight-line distance between the moving target and the intelligent following device is obtained through the parallax between the two initial images, wherein the parallax represents the difference in the direction angle when observing the same target from two different observation points;
[0182] The straight-line distance is taken as the depth parameter.
[0183] Optionally, based on the depth parameter and the central point coordinate, the target speed required for the intelligent following device to move to the moving target is calculated, and the processing module 1102 is specifically configured to:
[0184] determine the straight-line distance represented by the depth parameter;
[0185] obtain a corresponding deviation angle based on the abscissa of the central point coordinate and the depth parameter, wherein the deviation angle represents the angle that needs to be rotated when the intelligent following device moves to the moving target;
[0186] obtain the body linear velocity and the body angular velocity of the intelligent following device at the current time based on the straight-line distance and the deviation angle;
[0187] take the body linear velocity and the body angular velocity at the current time as the target speed.
[0188] Optionally, when the body linear velocity and the body angular velocity of the intelligent following device at the current time are obtained based on the straight-line distance and the deviation angle, the processing module 1102 is configured to:
[0189] when the straight-line distance is not greater than a first distance threshold, obtain the body linear velocity at the current time based on the difference between the first distance threshold and the straight-line distance and a preset penalty coefficient, wherein the penalty coefficient is used to make the value of the body linear velocity converge within a set interval;
[0190] when the straight-line distance is greater than the first distance threshold and not greater than a second distance threshold, set the body linear velocity at the current time to zero;
[0191] when the straight-line distance is greater than the second distance threshold, obtain the body linear velocity at the current time based on the product of the straight-line distance and a preset penalty coefficient;
[0192] when the deviation angle is greater than a set angle threshold, obtain the body angular velocity at the current time based on the deviation angle and the constant pi;
[0193] when the deviation angle is not greater than the set angle threshold, set the body angular velocity at the current time to zero.
[0194] Optionally, after obtaining the target speed, the processing module 1102 is further configured to perform the following operations for the fuselage linear speed and the fuselage angular speed contained in the target speed, respectively:
[0195] obtaining a preset initial proportional coefficient, a target integral coefficient and an initial differential coefficient; wherein the target integral coefficient is set as 0;
[0196] determining a speed error of the current moment based on a difference between the target speed of the current moment and a historical target speed of a previous moment;
[0197] determining a corresponding error sum based on the historical speed error of all historical moments from a moment when the intelligent following device starts running to the moment before the current moment, and the speed error of the current moment;
[0198] determining an average error of the current moment based on the speed error of the current moment and the historical speed error of the previous moment, and a time difference between the current moment and the previous moment;
[0199] adjusting the initial proportional coefficient and the initial differential coefficient based on the speed error, the target integral coefficient and the error sum, the average error, and the actual application result of the target speed, to obtain a target proportional coefficient and a target differential coefficient;
[0200] adjusting the target speed of the current moment based on the target proportional coefficient and the speed error, the target integral coefficient and the error sum, the target differential coefficient and the average error.
[0201] Optionally, the target proportional coefficient is obtained by the processing module 1102 in the following manner:
[0202] setting the initial differential coefficient as 0;
[0203] increasing the value of the initial proportional coefficient by a first set step size, and each time the value is increased, obtaining a latest target speed based on the current increased initial proportional coefficient and the speed error, the target integral coefficient and the error sum, the initial differential coefficient and the average error, and applying the latest target speed to the intelligent following device until the intelligent following device generates oscillation during running;
[0204] decreasing the current value of the initial proportional coefficient by a second set step size, and each time the value is decreased, obtaining a latest target speed based on the current decreased initial proportional coefficient and the speed error, the target integral coefficient and the error sum, the initial differential coefficient and the average error, until the difference between the latest obtained target speed and the previously obtained target speed is lower than a first difference threshold.
[0205] setting the target proportional coefficient based on the value of the initial proportional coefficient after the last decrease.
[0206] Optionally, the target differential coefficient is obtained by the processing module 1102 in the following manner:
[0207] According to the third setting step, the value of the differential coefficient is increased, and each time the value is increased, based on the current initial differential coefficient and the average error after the increase, the target integral coefficient and the error sum, the target proportional coefficient and the speed error, a latest target speed is obtained; and the latest target speed is applied to the intelligent following device until the intelligent following device generates oscillation when running;
[0208] According to the fourth setting step, the current value of the initial differential coefficient is decreased, and each time the value is decreased, based on the current initial differential coefficient and the average error after the decrease, the target integral coefficient and the error sum, the target proportional coefficient and the speed error, a latest target speed is obtained until the difference between the target speed obtained in the latest time and the target speed obtained in the last time is lower than the second difference threshold value;
[0209] Based on the value of the initial differential coefficient after the last decrease, the target differential coefficient is set.
[0210] Optionally, when adjusting the target speed at the current time based on the target proportional coefficient and the speed error, the target integral coefficient and the error sum, and the target differential coefficient and the average error, the processing module 1102 is configured to:
[0211] obtain a first product of the target proportional coefficient and the speed error at the current time;
[0212] obtain a second product of the target integral coefficient and the error sum;
[0213] obtain a third product of the target differential coefficient and the average error at the current time;
[0214] adjust the target speed at the current time based on the sum of the first product, the second product and the third product.
[0215] Optionally, when controlling the intelligent following device to move towards the moving target based on the target speed, the processing module 1102 is specifically configured to:
[0216] control the intelligent following device to rotate based on the body angular velocity at the current time;
[0217] control the intelligent following device to move towards the moving target based on the body linear velocity at the current time.
[0218] Based on the same technical concept, the embodiments of the present application also provide an electronic device, which can implement the method flow of the mobile target tracking provided by the above-mentioned embodiments of the present application.
[0219] In an embodiment, the electronic device can be a server, a terminal device or other electronic device.
[0220] Referring to Figure 12 As shown in the figure, the electronic device can include:
[0221] At least one processor 1201, and a memory 1202 connected with the at least one processor 1201, the specific connection medium between the processor 1201 and the memory 1202 is not limited in the embodiment of the application, Figure 12 In the embodiment, the connection between the processor 1201 and the memory 1202 is taken by way of bus 1200. The bus 1200 is used to connect Figure 12 In the embodiment, the connection between the processor 1201 and the memory 1202 is taken by way of bus 1200. The bus 1200 is used to connect Figure 12 In the embodiment, the connection between the processor 1201 and the memory 1202 is taken by way of bus 1200. The bus 1200 is used to connect
[0222] In the embodiment of the application, the memory 1202 stores instructions executable by the at least one processor 1201, and the at least one processor 1201 can execute the mobile target tracking method discussed above by executing the instructions stored in the memory 1202. The processor 1201 can realize Figure 11 The functions of each module in the device shown in the figure.
[0223] Among them, the processor 1201 is the control center of the device, which can connect all parts of the control device through various interfaces and lines, and realize the functions and process data of the device by running or executing the instructions stored in the memory 1202 and calling the data stored in the memory 1202, so as to monitor the whole device.
[0224] In a possible design, the processor 1201 can include one or more processing units, and the processor 1201 can integrate an application processor and a modem processor, wherein the application processor mainly processes operating systems, user interfaces and application programs, etc., and the modem processor mainly processes wireless communication. It can be understood that the above-mentioned modem processor can also not be integrated into the processor 1201. In some embodiments, the processor 1201 and the memory 1202 can be implemented on the same chip, and in some embodiments, they can also be implemented on separate chips respectively.
[0225] The processor 1201 can be a general processor, such as a CPU, a digital signal processor, an application-specific integrated circuit, a field programmable gate array, or other programmable logic device, a discrete gate or transistor logic component, a discrete hardware component, and can implement or execute the methods, steps, and logic block diagrams disclosed in the embodiments of the present application. The general processor can be a microprocessor or any conventional processor. The steps of the mobile target tracking method disclosed in the embodiments of the present application can be directly embodied as execution completed by a hardware processor, or executed by a combination of hardware and software modules in the processor.
[0226] The memory 1202 is a non-volatile computer readable storage medium, which can be used to store non-volatile software programs, non-volatile computer executable programs, and modules. The memory 1202 can include at least one type of storage medium, such as flash memory, hard disk, multimedia card, card-type memory, random access memory (RAM), static random access memory (SRAM), programmable read-only memory (PROM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), magnetic memory, magnetic disk, optical disk, and the like. The memory 1202 is any other medium capable of carrying or storing desired program codes in the form of instructions or data structures and capable of being accessed by a computer, but is not limited thereto. The memory 1202 in the embodiments of the present application can also be a circuit or any other device capable of realizing a storage function, used to store program instructions and / or data.
[0227] By designing and programming the processor 1201, the code corresponding to the mobile target tracking method introduced in the foregoing embodiments can be fixed into the chip, so that the chip can execute the steps of the mobile target tracking method of the embodiments shown in the running time. Figure 3 How to design and program the processor 1201 is a technology known to those skilled in the art, which will not be described here.
[0228] Based on the same inventive concept, the embodiments of the present application also provide a storage medium storing computer instructions, which, when running on a computer, cause the computer to execute the mobile target tracking method discussed above.
[0229] In some possible implementation, the various aspects of the mobile target tracking method provided by the present application can also be implemented as a program product in the form of a computer program or a plurality of computer programs embodied in one or more computer-usable storage media (including, but not limited to, disk memory, CD-ROM, optical storage medium, etc.) comprising program codes to make the control device perform the steps of the mobile target tracking method according to the various exemplary embodiments of the present application described above when the program product is run on an apparatus.
[0230] It should be noted that although several units or sub-units of the apparatus are mentioned in the foregoing detailed description, such division is merely exemplary and not mandatory. Indeed, features and functions of two or more units described above can be embodied in one unit, according to the embodiments of the present application. Conversely, a feature or function of one unit described above can be further divided into several units.
[0231] Moreover, although the operations of the method(s) herein are described in a particular, sequential order, this order is not meant to be a limitation and is not intended to imply that
[0232] Those of skill in the art would understand that information and signals can be represented using any of a variety of technologies and techniques. For example, data, instructions, commands, information, signals, bits, symbols, and chips that can be referenced throughout the above description can be represented by voltages, currents, electromagnetic waves, magnetic fields or particles, optical fields or particles, or any combination thereof.
[0233] The computer program instructions can also be loaded onto a computer, other programmable data processing apparatus, or other devices to cause a series of operational steps to be performed on the computer, other programmable apparatus or other devices to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide processes for implementing the functions / acts specified in the flowchart and / or block diagram block or blocks. Figure 1 The flowchart and / or block diagram in the Figures illustrate the architecture, functionality, and operation of possible implementations of apparatuses and computer-program products according to various embodiments of the present application. In this regard, each block in the flowchart and / or block diagrams can represent a module, segment, or portion of code, which comprises one or more executable Figure 1 The computer program instructions can also be loaded onto a computer, other programmable data processing apparatus, or other devices to cause a series of operational steps to be performed on the computer, other programmable apparatus or other devices to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide processes for implementing the functions / acts specified in the flowchart and / or block diagram block or blocks.
[0234] These computer program instructions can also be stored in a computer readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer readable memory produce an article of manufacture including instructions which implement the flow Figure 1 The flow or flows and / or blocks Figure 1 The flow or flows and / or blocks
[0235] These computer program instructions can also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions that execute on the computer or other programmable apparatus provide steps for implementing the flow Figure 1 The flow or flows and / or blocks Figure 1 Figure 1 The flow or flows and / or blocks
[0236] Obviously, numerous modifications and variations of the present application are possible in light of the above teachings. It is therefore to be understood that within the scope of the appended claims and their equivalents, the application can be practiced otherwise than as specifically described.
Claims
1. A moving target tracking method characterized by, The method is applied to an intelligent following device, and comprises the following steps: Continuously collecting images, and when a target image containing a moving target is collected, the following operations are performed: In the currently collected target image, an outer frame of the moving target is marked, and a center point coordinate of the outer frame is obtained; A depth parameter of the moving target is obtained, wherein the depth parameter represents a straight-line distance between the moving target and the intelligent following device; Based on the depth parameter and the center point coordinate, a target speed required for the intelligent following device to move to the moving target is calculated; A preset initial proportional coefficient, a target integral coefficient, and an initial differential coefficient are obtained; wherein the target integral coefficient is constantly set to 0; Based on a difference between the target speed at a current moment and a historical target speed at a previous moment, a speed error at the current moment is determined; Based on historical speed errors at all historical moments from a moment when the intelligent following device starts running to a moment before the current moment and the speed error at the current moment, a corresponding error sum is determined; Based on the speed error at the current moment and the historical speed error at the previous moment and a time difference between the current moment and the previous moment, an average error at the current moment is determined; Based on the speed error, the target integral coefficient and the error sum, the average error, and in combination with an actual application result of the target speed, the initial proportional coefficient and the initial differential coefficient are adjusted to obtain a target proportional coefficient and a target differential coefficient; The target proportional coefficient is obtained in the following manner: The initial differential coefficient is set to 0; The value of the initial proportional coefficient is increased by a first set step size, and each time the value is increased, based on the current increased initial proportional coefficient and the speed error, the target integral coefficient and the error sum, the initial differential coefficient and the average error, a latest target speed is obtained, and the latest target speed is applied to the intelligent following device until the intelligent following device generates oscillation when running; The current value of the initial proportional coefficient is decreased by a second set step size, and each time the value is decreased, based on the current decreased initial proportional coefficient and the speed error, the target integral coefficient and the error sum, the initial differential coefficient and the average error, a latest target speed is obtained until a difference between the latest obtained target speed and a previously obtained target speed is lower than a first difference threshold value; based on the value of the initial proportional coefficient after the last decrease, the target proportional coefficient is set; Based on the target proportional coefficient and the speed error, the target integral coefficient and the error sum, the target differential coefficient and the average error, the target speed at the current moment is adjusted; Based on the adjusted target speed, the intelligent following device is controlled to move in the direction of the moving target.
2. The method of claim 1, wherein, The marking of the outer frame of the moving target in the currently collected target image and the obtaining of the center point coordinate of the outer frame comprise the following steps: The target image is input into a trained target detection model, and the outer frame of the moving target is obtained through the target detection model; The center point coordinate of the bounding box is obtained based on a relative position of the center point of the bounding box and an origin of the target image coordinate.
3. The method of claim 1, wherein, The depth parameter of the moving target is obtained by: Two initial images of the moving target are obtained by a binocular depth camera configured on the intelligent following device; A straight-line distance between the moving target and the intelligent following device is obtained based on a parallax between the two initial images, wherein the parallax represents a difference in a direction angle when observing the same target from two different observation points. The straight-line distance is taken as the depth parameter.
4. The method of claim 1, 2 or 3, wherein, The target speed required for the intelligent following device to move to the moving target is calculated based on the depth parameter and the center point coordinate, including: The straight-line distance represented by the depth parameter is determined; A deviation angle is obtained based on an abscissa of the center point coordinate and the depth parameter, wherein the deviation angle represents an angle by which the intelligent following device needs to be rotated to move to the moving target; A body linear speed and a body angular speed of the intelligent following device at a current time are obtained based on the straight-line distance and the deviation angle. The body linear speed and the body angular speed at the current time are taken as the target speed.
5. The method of claim 4, wherein, The body linear speed and the body angular speed of the intelligent following device at the current time are obtained based on the straight-line distance and the deviation angle, including: When the straight-line distance is not greater than a first distance threshold, a difference between the first distance threshold and the straight-line distance and a preset penalty coefficient are used to obtain the body linear speed at the current time, wherein the penalty coefficient is used to make the body linear speed converge within a set interval; When the straight-line distance is greater than the first distance threshold and not greater than a second distance threshold, the body linear speed at the current time is set to zero; When the straight-line distance is greater than the second distance threshold, a product of the straight-line distance and a preset penalty coefficient is used to obtain the body linear speed at the current time; When the deviation angle is greater than a set angle threshold, the body angular speed at the current time is obtained based on the deviation angle and a constant pi; When the deviation angle is not greater than the set angle threshold, the body angular speed at the current time is set to zero.
6. The method of claim 1, wherein, The target differential coefficient is obtained in the following manner: The value of the differential coefficient is increased by a third set step size, and each time the value is increased, a latest target speed is obtained based on a current initial differential coefficient after the increase, the average error, the target integral coefficient and the error sum, and the target proportional coefficient and the speed error; and the latest target speed is applied to the intelligent following device until the intelligent following device generates oscillation during operation. down-regulate the current value of the initial differential coefficient according to a fourth set step, and each time the initial differential coefficient is down-regulated, based on the current down-regulated initial differential coefficient and the average error, the target integral coefficient and the error sum, the target proportional coefficient and the speed error, a latest target speed is obtained until the difference between the latest target speed and the target speed obtained last time is less than a second difference threshold; based on the value of the initial differential coefficient after the last down-regulation, a target differential coefficient is set.
7. The method of claim 1, wherein, based on the target proportional coefficient and the speed error, the target integral coefficient and the error sum, the target differential coefficient and the average error, the target speed at the current time is adjusted, including: obtaining a first product of the target proportional coefficient and the speed error at the current time; obtaining a second product of the target integral coefficient and the error sum; obtaining a third product of the target differential coefficient and the average error at the current time; based on the sum of the first product, the second product and the third product, the target speed at the current time is adjusted.
8. The method of claim 1, 2, or 3, wherein, based on the adjusted target speed, the intelligent following device is controlled to move towards the moving target direction, including: based on the body angular velocity at the current time, the intelligent following device is controlled to rotate; based on the body linear velocity at the current time, the intelligent following device is controlled to move towards the moving target direction.
9. A moving target tracking apparatus characterized by comprising: including: the acquisition module is used for continuously acquiring images; the processing module is used for performing the following operations when the target image containing the moving target is acquired by the acquisition module: in the currently acquired target image, the bounding box of the moving target is labeled, and the center point coordinates of the bounding box are obtained; the depth parameter of the moving target is obtained, wherein the depth parameter represents the straight-line distance between the moving target and the intelligent following device; based on the depth parameter and the center point coordinates, the target speed required for the intelligent following device to move to the moving target is calculated; an initial proportional coefficient, a target integral coefficient and an initial differential coefficient are obtained; wherein the target integral coefficient is always set to 0; based on the difference between the target speed at the current time and the historical target speed at the previous time, the speed error at the current time is determined; based on the historical speed error at all historical times from the time when the intelligent following device starts running to the current time, and the speed error at the current time, a corresponding error sum is determined; based on the speed error at the current time and the historical speed error at the previous time, and the time difference between the current time and the previous time, the average error at the current time is determined; based on the speed error, the target integral coefficient and the error sum, the average error, and the actual application result of the target speed, the initial proportional coefficient and the initial differential coefficient are adjusted to obtain a target proportional coefficient and a target differential coefficient; wherein the target proportional coefficient is obtained in the following way: the initial differential coefficient is set to 0; adjusting the initial proportional coefficient according to a first setting step, each time of adjustment, based on the current adjusted initial proportional coefficient, the speed error, the target integral coefficient and the error sum, the initial differential coefficient and the average error, obtaining a latest target speed, and applying the latest target speed to the intelligent following device until the intelligent following device generates oscillation when running; adjusting the initial proportional coefficient according to a second setting step, each time of adjustment, based on the current adjusted initial proportional coefficient, the speed error, the target integral coefficient and the error sum, the initial differential coefficient and the average error, obtaining a latest target speed until the difference between the latest obtained target speed and the last obtained target speed is lower than a first difference threshold; and setting a target proportional coefficient based on the last adjusted initial proportional coefficient; adjusting the target speed at the current time based on the target proportional coefficient, the speed error, the target integral coefficient and the error sum, and the target differential coefficient and the average error; controlling the intelligent following device to move towards the moving target based on the adjusted target speed.
10. An electronic device comprising a memory, a processor, and a computer program stored on the memory and executable on the processor, characterized in that, The processor implements the method of any one of claims 1-8 when executing the computer program.
11. A computer readable storage medium having stored thereon a computer program, characterized in that, The computer program, when executed by the processor, implements the steps of the method of any one of claims 1-8.
12. A computer program product, characterised in that, The computer program product, when invoked by the computer, causes the computer to perform the method of any one of claims 1-8.
Citation Information
Patent Citations
Robot tracking method and device
CN113065392A
An Adaptive Following Method for Mobile Robots Based on Deep Fusion Ranging
CN114937070A