Disclosure of Invention
Based on this, it is necessary to provide a method and a system for positioning a target following point, aiming at the problem that when the size and the offset position of the target tracking object are small, the conventional target tracking technology is difficult to accurately position the target object.
A method for positioning a target following point comprises the following steps:
acquiring first point cloud data of a target object at a first moment and first coordinates of a target following point, wherein the point cloud data comprises coordinates of a plurality of outer surface points on the target object, and the target following point is located on the target object;
respectively calculating the distance value from each outer surface point to the target following point according to the first point cloud data and the first coordinate;
acquiring second point cloud data of the target object at a second moment, and acquiring the position offset of each outer surface point according to the first point cloud data and the second point cloud data;
and acquiring a second coordinate of the target following point according to the distance value from each outer surface point to the target following point, the position offset of each outer surface point and the first coordinate.
According to the method for positioning the target following point, after point cloud data of the target object at the first moment and point cloud data of the target object at the second moment are obtained, the offset of the target object at the front moment and the offset of the target object at the rear moment are calculated through the point cloud data, so that the coordinate position of the target following point at the second moment is estimated according to the position offset of the target object and the distance between the outer surface point of the target object and the target following point, the target following point is accurately positioned, and the target following point can be accurately tracked when the position of the target object changes.
In one embodiment, the step of calculating the distance value from each outer surface point to the target following point according to the first point cloud data and the first coordinates respectively includes the following steps:
dividing the target object into a plurality of areas according to the structural features of the target object and the first point cloud data, and acquiring first center point coordinates of area center points of the areas;
calculating the distance value from the center point of each region to the target following point according to the coordinates of each first center point and the first coordinates;
the step of obtaining the position offset of each outer surface point according to the first point cloud data and the second point cloud data includes the following steps:
dividing the target object into a plurality of identical regions according to the second point cloud data, and acquiring second center point coordinates of region center points of the regions;
correspondingly subtracting the first central point coordinates and the second central point coordinates to obtain the position offset of the central point of each area;
the step of obtaining the second coordinate of the target following point according to the distance value from each outer surface point to the target following point, the position offset of each outer surface point, and the first coordinate includes the following steps:
and acquiring a second coordinate of the target following point according to the distance value from the central point of each region to the target following point, the position offset of the central point of each region and the first coordinate.
In one embodiment, the step of obtaining the second coordinate of the target following point according to the distance value from each outer surface point to the target following point, the position offset of each outer surface point, and the first coordinate includes the following steps:
correspondingly multiplying the inverse ratio of the distance value from each outer surface point to the target following point by the position offset of each outer surface point to obtain a corresponding target offset;
and acquiring a second coordinate of the target following point according to each target offset and the first coordinate.
In one embodiment, the step of obtaining the second coordinate of the target following point according to the distance value from each outer surface point to the target following point, the position offset of each outer surface point, and the first coordinate includes the following steps:
calculating a second coordinate of the target following point by using the following formula according to the distance value from each outer surface point to the target following point, the position offset of each outer surface point and the first coordinate
In the formula (I), the compound is shown in the specification,
a first coordinate of the target object;
second coordinates of the target object;
is the amount of positional offset of each of the outer surface points, wherein,
e
nx、e
ny、e
nzthe components of the position offset of the outer surface point on the x, y, z axes, respectively;
a distance value from each of the outer surface points to the target following point, wherein,
d
nx、d
ny、d
nzcomponents in the x, y, z axes of the distance values of the outer surface point to the target following point, respectively。
In one embodiment, the step of acquiring first point cloud data of the target object and first coordinates of the target following point at the first time includes the following steps:
and acquiring first point cloud data of the target object at the first moment and first coordinates of the target following points through a binocular structured light device.
A system for locating an object following point, comprising:
the coordinate information acquisition module is used for acquiring first point cloud data of a target object and first coordinates of target following points at a first moment, wherein the point cloud data comprises coordinates of a plurality of outer surface points on the target object;
a distance value obtaining module, configured to calculate, according to the first point cloud data and the first coordinate, a distance value from each outer surface point to the target following point, where the target following point is located on the target object;
the offset information acquisition module is used for acquiring second point cloud data of the target object at a second moment and acquiring the position offset of each outer surface point according to the first point cloud data and the second point cloud data;
and the second coordinate acquisition module is used for acquiring a second coordinate of the target following point according to the distance value from each outer surface point to the target following point, the position offset of each outer surface point and the first coordinate.
According to the positioning system of the target following point, after the point cloud data of the target object at the first moment and the point cloud data of the target object at the second moment are obtained through the coordinate information obtaining module and the offset information obtaining module, the offset of the target object at the front moment and the offset of the target object at the rear moment are calculated, so that the coordinate position of the target following point at the second moment is estimated according to the position offset of the target object and the distance between the outer surface point of the target object and the target following point calculated by the distance value obtaining module, the accurate positioning of the target following point is realized, and the target following point can be accurately tracked when the position of the target object changes.
In one embodiment, the second coordinate acquiring module comprises a target offset acquiring unit and a second coordinate calculating unit;
the target offset obtaining unit is used for correspondingly multiplying the inverse ratio of the distance value from each outer surface point to the target following point by the position offset of each outer surface point to obtain a corresponding target offset;
and the second coordinate calculation unit is used for acquiring a second coordinate of the target following point according to each target offset and the first coordinate.
In one embodiment, the second coordinate obtaining module calculates the second coordinate by using the following formula;
in the formula (I), the compound is shown in the specification,
a first coordinate of the target object;
second coordinates of the target object;
is the amount of positional offset of each of the outer surface points, wherein,
e
nx、e
ny、e
nzthe components of the position offset of the outer surface point on the x, y, z axes, respectively;
a distance value from each of the outer surface points to the target following point, wherein,
d
nx、d
ny、d
nzthe components on the x, y, z axes of the distance value of the outer surface point to the target following point, respectively.
A mechanical arm comprises a mechanical arm body, a moxibustion head, a binocular structured light device, a controller and a computer program which is stored on the controller and can run on the controller; the binocular structured light device and the moxibustion head are fixed on the mechanical arm body, and the relative positions of the binocular structured light device and the moxibustion head are fixed;
the binocular structured light adding device is used for acquiring point cloud data of a target object and first coordinate data of a target following point;
the controller, when executing the computer program, implements a method of locating a target following point as described above.
According to the mechanical arm, the accurate positioning of the target following point is realized through the computer program running on the controller, and the mechanical arm can accurately track the target following point when the position of the target object changes.
A computer storage medium having stored thereon a computer program which, when executed by a processor, implements a method of locating a target following point as described above.
The computer storage medium realizes accurate positioning of the target following point through the stored computer program, and can accurately track the target following point when the position of the target object changes.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention more apparent, the present invention is described in further detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the invention and do not limit the scope of the invention.
Referring to fig. 1, fig. 1 is a flowchart of a method for locating a target following point in an embodiment of the present invention, where the method for locating a target following point in the embodiment includes the following steps:
step S110: the method comprises the steps of obtaining first point cloud data of a target object at a first moment and first coordinates of target following points, wherein the point cloud data comprise coordinates of a plurality of outer surface points on the target object, and the target following points are located on the target object.
In this step, the point cloud data is a set of vectors in a three-dimensional coordinate system, and the set of vectors can represent the outer surface shape of the target object and the position information of the target object in spatial distribution; the target following point is positioned on the target object and is a certain fixed point or fixed position on the target object; the first coordinate is a group of vectors of the target following point in the same three-dimensional coordinate system with the point cloud data and represents the position information of the target following point.
Specifically, T is obtained1First point cloud data Q of time target object1And a first coordinate vector P of the target following object1(x1,y1,z1) Wherein the first point cloud data Q1Is a set of vectors comprising coordinate vectors of points on multiple external surfaces of the target object at a first instance in time.
Step S120: and respectively calculating the distance value from the outer surface point to the target following point according to the first point cloud data and the first coordinate.
Passing the coordinate vector of each outer surface point in the first point cloud data and the first coordinate vector P
1(x
1,y
1,z
1) Calculating the distance from each point on the outer surface of the target object to the target following point
Step S130: and acquiring second point cloud data of the target object at a second moment, and acquiring the position offset of the outer surface point according to the first point cloud data and the second point cloud data.
In this step, the second time is a certain time after the first time, and may be a time separated from the first time by a certain time, or a time when the position of the target object is shifted; the second point cloud data and the first point cloud data use the same three-dimensional coordinate system, and when the position of the target object is deviated, the coordinate data of the same outer surface point in the second point cloud data and the first point cloud data are different.
Obtaining T
2Second point cloud data Q of target object at any moment
2The second point cloud data comprises coordinate vectors of points on the outer surface of the target object at the second moment, and the first point cloud data Q is used for processing
1And second point cloud data Q
2Calculating the position offset of each point on the outer surface of the target object by each coordinate vector
Step S140: and acquiring a second coordinate of the target following point according to the distance value from each outer surface point to the target following point, the position offset of each outer surface point and the first coordinate.
In the above embodiment, after point cloud data of the target object at the first time and point cloud data of the target object at the second time are obtained, the offset of the target object at the first time and the offset of the target object at the second time are calculated through the point cloud data, so that the coordinate position of the target following point at the second time is estimated according to the position offset of the target object and the distance from the outer surface point of the target object to the target following point, the target following point is accurately positioned, and the target following point can be accurately tracked when the position of the target object changes.
In one embodiment, the point cloud data of the target object and the coordinates of the target following point may be acquired by a binocular structured light apparatus.
In one embodiment, the step S140 of obtaining the second coordinate of the target following point according to the distance value from each outer surface point to the target following point, the position offset of each outer surface point, and the first coordinate includes the following steps:
correspondingly multiplying the inverse ratio of the distance value from each outer surface point to the target following point by the position offset of each outer surface point to obtain a corresponding target offset; and acquiring a second coordinate of the target following point according to the target offset and the first coordinate.
In this embodiment, the offset target offset of the target following point is proportionally converted according to the distance value between the outer surface point of the target object and the target following point, and then the second coordinate of the target following point is obtained by calculation according to the target offset and the first coordinate. The proportion occupied by the offset of the outer surface point farther away from the target following point is smaller, otherwise, the proportion occupied is larger, and a more accurate second coordinate is obtained through the target offset, so that the target following point can be accurately tracked.
Further, in one embodiment, the step of obtaining the second coordinate of the target following point according to the distance value from each outer surface point to the target following point, the position offset of each outer surface point, and the first coordinate includes the following steps:
calculating a second coordinate of the target following point by using the following formula (1) according to the distance value from each outer surface point to the target following point, the position offset of each outer surface point and the first coordinate;
in the formula (I), the compound is shown in the specification,
a first coordinate of a target object;
a second coordinate of the target object;
is the amount of positional offset of each outer surface point, wherein,
e
nx、e
ny、e
nzthe components of the position offset of the outer surface points on the x, y, z axes, respectively;
the distance value from each outer surface point to the target following point, wherein,
d
nx、d
ny、d
nzthe components in the x, y, z axes of the distance value from the outer surface point to the target following point, respectively.
Specifically, the inverse ratio of the component of the distance value between each outer surface point and the target following point on the x axis is multiplied by the component of the position offset of each outer surface point on the x axis correspondingly to obtain the target offset of the target object on the x axis direction, the x value of the second coordinate of the target following point is obtained according to the target offset of each target object on the x axis direction and the x value of the first coordinate, and the y value and the z value of the second coordinate are obtained through the same method.
Considering that point cloud data often contains hundreds of thousands of millions of points, and the operation processing of all the points in the point cloud data often causes huge processing operation amount, the processing speed is greatly reduced, and the matching difficulty among the point cloud data is high, therefore, the outer surface points of a target object can be divided into a plurality of areas according to the point cloud data and the structural characteristics of the target object, the central points of the areas are obtained, and the point cloud data is equivalent by using the coordinates of the central points, so that the operation amount of data processing and the matching difficulty among the point cloud data are greatly reduced, the processing speed is improved, and the target following points can be quickly repositioned when the position of the target object changes.
Referring to fig. 2, fig. 2 is a flowchart of a method for locating a target following point according to another embodiment of the present invention. In this embodiment, the method for positioning the target following point includes the following steps:
step S210: the method comprises the steps of obtaining first point cloud data of a target object at a first moment and first coordinates of target following points, wherein the point cloud data comprise coordinates of a plurality of outer surface points on the target object, and the target following points are located on the target object.
In this step, T is obtained1First point cloud data Q of time target object1And a first coordinate vector P of the target following object1(x1,y1,z1) Wherein the first point cloud data Q1Is a set of vectors comprising coordinate vectors of points on multiple external surfaces of the target object at a first instance in time.
Step S220: dividing the target object into a plurality of areas according to the structural characteristics of the target object and the first point cloud data, and acquiring the first center point coordinates of the area center points of the areas.
The point cloud data represents the shape of the outer surface of the target object and the position information of the target object in the spatial distribution, and the outer surface point of the target object is divided into a plurality of regions according to the point cloud data and the structural features of the target object, for example, fig. 3 is a schematic diagram of the target object being divided into several regions according to an embodiment of the present invention, and in fig. 3, the target object is divided into a region 310, a region 320, a region 330, a region 340, a region 350, and a region 360 according to the structural features of the target object.
The region central point is a physical central point of each region which is divided into a plurality of regions in the target object; the first center point coordinate is coordinate position data of the area center point in the three-dimensional coordinate system at the first moment.
In this step, at T1Constantly acquiring point cloud data Q of target object1Then, according to the structural characteristics of the target object and T1Point cloud data Q of time1Dividing the target object into n regions, n>2 and obtaining a first physical center point q of each region11、q12、…、q1nAnd obtaining coordinate vectors of the first physical center points.
Step S230: and calculating the distance value from the center point of each region to the target following point according to the first center point coordinates and the first coordinates.
According to the physical centre point q of each area
11、q
12、…、q
1nAnd a first coordinate vector P
1(x
1,y
1,z
1) Separately calculating these physical center points q
11、q
12、…、q
1nTo a first coordinate P
1Is a distance of
Step S240: and acquiring second point cloud data of the target object at a second moment, dividing the target object into a plurality of identical regions according to the second point cloud data, and acquiring second center point coordinates of the region center points of the regions.
In this step, the second central point coordinate is coordinate position data of the area central point in the three-dimensional coordinate system at the second time.
Obtaining T2Second point cloud data Q of target object at any moment2Second point cloud data Q2Is included in T2A coordinate vector of a point on the outer surface of the target object at the time. Dividing the target object into a plurality of identical regions, and then according to the second point cloud data Q2Acquiring a second central point q of each area21、q22、…、q2nAnd coordinate vectors of the second central points are acquired.
Step S250: and correspondingly subtracting the coordinates of each first central point and the coordinates of each second central point to obtain the position offset of the central point of each area.
The coordinate vectors of the physical center points of the areas obtained twice are correspondingly differed, so that the position offset of the physical center point of each area on the three-dimensional coordinate system is obtained
Step S260: and acquiring a second coordinate of the target following point according to the distance value from the central point of each region to the target following point, the position offset of the central point of each region and the first coordinate.
In the embodiment, according to the point cloud data and the structural characteristics of the target object, the outer surface point of the target object is divided into a plurality of areas, the physical central points of the areas and the coordinates of the physical central points are obtained, a plurality of physical central point coordinate equivalent point cloud data are utilized, the offset of the target object at the front moment and the back moment is calculated through the physical central point coordinates, the coordinate position of the target following point at the second moment is estimated according to the position offset of the target object and the distance from each physical central point to the target following point, the accurate positioning of the target following point is realized, the data processing operand and the matching difficulty between the point cloud data are greatly reduced, the processing speed is improved, and the target following point can be quickly and accurately repositioned when the position of the target object changes.
Further, in one embodiment, in the step S360 of obtaining the second coordinate of the target following point according to the distance value from the center point of each area to the target following point, the position offset of the center point of each area, and the first coordinate, the second coordinate of the target following point may be calculated by using the following formula (2):
in the formula (I), the compound is shown in the specification,
a first coordinate of a target object;
a second coordinate of the target object;
is the position offset of the center point of each region, wherein,
e
nx、e
ny、e
nzthe components of the position offset of the central point of the area on the x, y and z axes respectively;
the distance value from the central point of each area to the target following point is obtained, wherein,
d
nx、d
ny、d
nzthe distance value between the central point of each area and the target following point is respectively the component of the distance value on the x axis, the y axis and the z axis.
In this embodiment, the offset target offset of the target following point is proportionally converted according to the distance value between the center point of each region and the target following point, and then the second coordinate of the target following point is obtained by calculation according to the target offset and the first coordinate. The proportion occupied by the offset of the central point of each region which is farther away from the target following point is smaller, otherwise, the proportion occupied is larger, and a more accurate second coordinate is obtained through the target offset, so that the target following point can be accurately tracked.
According to the method for positioning the target following point, the invention further provides a positioning system of the target following point, and the following describes an embodiment of the positioning system of the target following point in detail.
Referring to fig. 4, fig. 4 is a schematic structural diagram of a positioning system of an object following point in one embodiment of the present invention. In this embodiment, the system for positioning the target following point includes:
a coordinate information obtaining module 410, configured to obtain first point cloud data of a target object at a first time and first coordinates of a target following point, where the point cloud data includes coordinates of a plurality of outer surface points on the target object, and the target following point is located on the target object;
the distance value obtaining module 420 is configured to calculate distance values from each outer surface point to the target following point according to the first point cloud data and the first coordinate;
the offset information obtaining module 430 is configured to obtain second point cloud data of the target object at a second time, and obtain a position offset of each outer surface point according to the first point cloud data and the second point cloud data;
and a second coordinate obtaining module 440, configured to obtain a second coordinate of the target following point according to the distance value from each outer surface point to the target following point, the position offset of each outer surface point, and the first coordinate.
After the coordinate information obtaining module 410 and the offset information obtaining module 430 obtain the point cloud data of the target object at the first time and the point cloud data of the target object at the second time, the offset of the target object at the first time and the offset of the target object at the second time are calculated, so that the coordinate position of the target following point at the second time is estimated according to the position offset of the target object and the distance from the outer surface point of the target object to the target following point calculated by the distance value obtaining module 420, the target following point is accurately positioned, and the target following point can be accurately tracked when the position of the target object changes.
In one embodiment, the distance value obtaining module 420 divides the target object into a plurality of regions according to the structural features of the target object and the first point cloud data, and obtains first center point coordinates of the region center points of the regions; calculating the distance value from the center point of each region to the target following point according to the coordinates of each first center point and the first coordinates;
the offset information obtaining module 430 divides the target object into a plurality of identical regions according to the second point cloud data, and obtains second center point coordinates of the region center points of the regions; and correspondingly subtracting the coordinates of each first central point and the coordinates of each second central point to obtain the position offset of the central point of each area.
The second coordinate obtaining module 440 obtains a second coordinate of the target following point according to the distance value from the center point of each region to the target following point, the position offset of the center point of each region, and the first coordinate
Referring to fig. 5, fig. 5 is a schematic structural diagram of a coordinate information obtaining module in an embodiment of the present invention. In this embodiment, the second coordinate obtaining module 440 includes a target offset obtaining unit 441 and a second coordinate calculating unit 442;
a target offset obtaining unit 441, configured to multiply the inverse ratio of the distance value from each outer surface point to the target following point by the position offset of each outer surface point correspondingly to obtain a corresponding target offset;
the second coordinate calculating unit 442 is configured to obtain a second coordinate of the target following point according to each target offset and the first coordinate.
In one embodiment, the second coordinate obtaining module 440 calculates the second coordinate using the following formula (3);
in the formula (I), the compound is shown in the specification,
a first coordinate of a target object;
a second coordinate of the target object;
is the amount of positional offset of each outer surface point, wherein,
e
nx、e
ny、e
nzthe components of the position offset of the outer surface points on the x, y, z axes, respectively;
the distance value from each outer surface point to the target following point, wherein,
d
nx、d
ny、d
nzthe components in the x, y, z axes of the distance value from the outer surface point to the target following point, respectively.
The technical features and the advantageous effects described in the embodiments of the target following point positioning method are applicable to the embodiments of the target following point positioning system, and thus it is stated that the target following point positioning system and the target following point positioning method of the present invention correspond to each other one to one.
In one embodiment, the invention also provides a mechanical arm, which comprises a mechanical arm body, a moxibustion head, a binocular structured light device, a controller and a computer program stored on the controller and capable of running on the controller; the binocular structured light device and the moxibustion head are fixed on the mechanical arm body, and the relative positions of the binocular structured light device and the moxibustion head are fixed;
the binocular structured light adding device is used for acquiring point cloud data of a target object and first coordinate data of a target following point;
the controller, when executing the computer program, implements the method for locating a target following point of any of the above embodiments.
Specifically, when the target object moves by a relatively large amplitude, the target following point positioning controller obtains the coordinate information of the target following point of the moved target object by implementing the target following point positioning method of any one of the embodiments, and controls the mechanical arm to move at the same time, so that the moxibustion head can automatically follow the new position of the target following point, and the automatic following of the target following point is implemented.
Furthermore, it can be understood by those skilled in the art that all or part of the processes in the methods for implementing the embodiments described above can be implemented by instructing the relevant hardware through a computer program, and the program can be stored in a non-volatile computer-readable storage medium, and as in the embodiments of the present invention, the program can be stored in the storage medium of the computer system and executed by at least one processor in the computer system, so as to implement the processes of the embodiments including the positioning method for the target following points described above.
In one embodiment, a storage medium is further provided, on which a computer program is stored, wherein the program is executed by a processor to implement the method for positioning an object following point according to any one of the embodiments. The storage medium may be a magnetic disk, an optical disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), or the like.
The computer storage medium and the stored computer program realize the accurate positioning of the target following point by realizing the flow of the embodiment of the positioning method of each target following point, and can accurately track the target following point when the position of the target object changes.
The technical features of the above embodiments can be arbitrarily combined, and for the sake of brevity, all possible combinations of the technical features in the above embodiments are not described, but should be considered as the scope of the present specification as long as there is no contradiction between the combinations of the technical features.
The above examples only show some embodiments of the present invention, and the description thereof is more specific and detailed, but not construed as limiting the scope of the invention. It should be noted that, for a person skilled in the art, several variations and modifications can be made without departing from the inventive concept, which falls within the scope of the present invention. Therefore, the protection scope of the present patent shall be subject to the appended claims.