Invention content
Based on this, it is necessary to be directed to when the size of target following object and smaller deviation post, traditional target following
Technology is difficult to realize the problem of being accurately located target object, provides a kind of target and follows localization method and system a little.
A kind of target follows localization method a little, includes the following steps:
It obtains the first point cloud data of the target object at the first moment and target follows the first coordinate a little, wherein institute
The coordinate that point cloud data includes multiple appearance millet cake on the target object is stated, the target, which follows, is a little located at the target pair
As upper;
According to first point cloud data and first coordinate calculate separately each appearance millet cake to the target with
With the distance value of point;
The second point cloud data for obtaining the target object at the second moment, according to first point cloud data and described
The position offset of each appearance millet cake of second point cloud data acquisition;
The distance value selected, the position offset of each appearance millet cake are followed according to each appearance millet cake to the target
And first coordinate obtains the target and follows the second coordinate a little.
Above-mentioned target follows localization method a little, when by the point cloud data of the first moment target object of acquisition and second
After the point cloud data for carving target object, the offset of former and later two moment target objects is calculated by point cloud data, to root
Distance a little is followed to target according to the position offset and target object appearance millet cake of target object, target is estimated and follows a little
In the coordinate position at the second moment, realize that target follows accurate positionin a little, it can be accurate when target object position sends and changes
True follows click-through line trace to target.
It is described in one of the embodiments, that each institute is calculated separately according to first point cloud data and first coordinate
The step of appearance millet cake follows distance value a little to the target is stated, is included the following steps:
If the target object is divided into according to the structure feature of the target object and first point cloud data
Dry region, obtains the first nodal point coordinate of the regional center point in each region;
Each regional center point is calculated to the target according to each first nodal point coordinate and first coordinate
Follow distance value a little;
The position according to first point cloud data and each appearance millet cake of the second point cloud data acquisition
The step of offset, includes the following steps:
The target object is divided into several identical regions according to second point cloud data, and is obtained each described
Second center point coordinate of the regional center point in region;
Each first nodal point coordinate and each second center point coordinate correspondence are subtracted each other, each region is obtained
The position offset of central point;
It is described to follow the distance value selected, the position of each appearance millet cake inclined according to each appearance millet cake to the target
Shifting amount and first coordinate obtain the step of target follows the second coordinate a little, include the following steps:
Follow distance value a little, the position of each regional center point inclined according to each regional center point to the target
Shifting amount and first coordinate obtain the target and follow the second coordinate a little.
It is described in one of the embodiments, that distance value a little, each is followed according to each appearance millet cake to the target
The position offset of the appearance millet cake and first coordinate obtain the step of target follows the second coordinate a little, packet
Include following steps:
Each appearance millet cake to the target is followed to the position of the inverse ratio and each appearance millet cake of the distance value selected
Offset, which corresponds to be multiplied, obtains corresponding target offset amount;
The target, which is obtained, according to each target offset amount and first coordinate follows the second coordinate a little.
It is described in one of the embodiments, that distance value a little, each is followed according to each appearance millet cake to the target
The position offset of the appearance millet cake and first coordinate obtain the step of target follows the second coordinate a little, packet
Include following steps:
The distance value selected, the position offset of each appearance millet cake are followed according to each appearance millet cake to the target
And first coordinate calculates the target using following formula and follows the second coordinate a little
In formula,For the first coordinate of the target object;For the second coordinate of the target object;
For the position offset of each appearance millet cake, whereinenx、eny、enzThe respectively described appearance millet cake
Component of the position offset on x, y, z axis;Distance value a little is followed to the target for each appearance millet cake,
Wherein,dnx、dny、dnzThe respectively described appearance millet cake to the target follow distance value a little x,
Y, the component in z-axis.
In one of the embodiments, it is described obtain the first moment target object the first point cloud data and target with
With point the first coordinate the step of, include the following steps:
The first point cloud data and the institute of the target object at first moment are obtained by binocular structure electro-optical device
It states target and follows the first coordinate a little.
A kind of target follows positioning system a little, including:
Coordinate information acquisition module, the first point cloud data and target of the target object for obtaining for the first moment follow
First coordinate of point, the point cloud data includes the coordinate of multiple appearance millet cake on the target object;
Distance value acquisition module, it is each described outer for being calculated separately according to first point cloud data and first coordinate
Surface point follows distance value a little to the target, wherein the target, which follows, to be a little located on the target object;
Offset information acquisition module, the second point cloud data of the target object for obtaining for the second moment, according to institute
State the position offset of the first point cloud data and each appearance millet cake of the second point cloud data acquisition;
Second coordinate obtaining module, for following distance value a little, each institute according to each appearance millet cake to the target
It states the position offset of appearance millet cake and first coordinate obtains the target and follows the second coordinate a little.
Above-mentioned target follows positioning system a little, is obtained by coordinate information acquisition module and offset information acquisition module
After the point cloud data of the point cloud data of first moment target object and the second moment target object, former and later two moment are calculated
The offset of target object, the target to be calculated according to the position offset and distance value acquisition module of target object
Objects looks millet cake follows distance a little to target, estimates target and follows coordinate position o'clock at the second moment, realizes target
Accurate positionin a little is followed, can click-through line trace accurately be followed to target when target object position sends variation.
The second coordinate obtaining module includes target offset amount acquiring unit and the second coordinate in one of the embodiments,
Computing unit;
The target offset amount acquiring unit, for each appearance millet cake to be followed distance value a little to the target
Inverse ratio multiplication corresponding with each position offset of appearance millet cake obtains corresponding target offset amount;
Second coordinate calculating unit, for obtaining the mesh according to each target offset amount and first coordinate
Mark follows the second coordinate a little.
Second coordinate obtaining module calculates the second coordinate using following formula in one of the embodiments,;
In formula,For the first coordinate of the target object;For the second coordinate of the target object;
For the position offset of each appearance millet cake, whereinenx、eny、enzThe respectively described appearance millet cake
Component of the position offset on x, y, z axis;Distance value a little is followed to the target for each appearance millet cake,
Wherein,dnx、dny、dnzThe respectively described appearance millet cake to the target follow distance value a little x,
Y, the component in z-axis.
A kind of mechanical arm, including robot body, moxibustion head, binocular add structure electro-optical device, controller and storage
On the controller and the computer program that can be run on the controller;The binocular adds structure electro-optical device and the Chinese mugwort
Moxibustion head is fixed on the robot body, and the binocular adds structure electro-optical device to be fixed with the moxibustion head relative position;
The binocular adds point cloud data and mesh of the structure electro-optical device for obtaining target object to follow the first coordinate a little
Data;
It is realized when the controller executes the computer program as above-mentioned target follows localization method a little.
Above-mentioned mechanical arm realizes target and follows a little accurate by the computer program run on the controller
Positioning, when target object position sends and changes, mechanical arm accurately can follow click-through line trace to target.
A kind of computer storage media, is stored thereon with computer program, is realized when which is executed by processor as above
It states target and follows localization method a little.
Above computer storage medium realizes target and follows accurate positionin a little by the computer program of its storage,
Can click-through line trace accurately be followed to target when target object position sends variation.
Specific implementation mode
In order to make the purpose , technical scheme and advantage of the present invention be clearer, with reference to the accompanying drawings and embodiments, right
The present invention is further elaborated.It should be appreciated that the specific embodiments described herein are merely illustrative of the present invention, and
It is not intended to limit the scope of the invention.
Referring to Fig. 1, Fig. 1 is the flow chart that target follows localization method a little in one embodiment of the invention, the embodiment
Middle target follows localization method a little, includes the following steps:
Step S110:It obtains the first point cloud data of the target object at the first moment and target follows a little first to sit
Mark, wherein point cloud data includes the coordinate of multiple appearance millet cake on target object, and target, which follows, to be a little located on target object.
In this step, point cloud data is the set of one group of vector in a three-dimensional system of coordinate, and vector set can indicate
The location information of the external surface shape of target object and target object in spatial distribution;Target, which follows, is a little located at target object
On, it is a certain fixed point or the fixed position on target object;First coordinate is that target follows a little same with point cloud data
One group in a three-dimensional system of coordinate vector represents target and follows location information a little.
Specifically, obtaining T1First point cloud data Q of moment target object1And target follow the first coordinate of object to
Measure P1(x1, y1, z1), wherein the first point cloud data Q1It is the set of one group of vector, including the first multiple appearances of moment target object
The coordinate vector of point on face.
Step S120:Appearance millet cake is calculated separately according to the first point cloud data with the first coordinate to follow at a distance from a little to target
Value.
Pass through the coordinate vector of each appearance millet cake in the first point cloud data and the first coordinate vector P1(x1, y1, z1) calculate
Each point follows distance a little to target on target object outer surface
Step S130:The second point cloud data for obtaining the target object at the second moment, according to the first point cloud data and
Two point cloud datas obtain the position offset of appearance millet cake.
In this step, the second moment was a certain moment after the first moment, can be and the first time at intervals certain time
At the time of, it can also the position of target object at the time of shift;Second point cloud data is used with the first point cloud data
The same three-dimensional system of coordinate, it is same in the second point cloud data and the first point cloud data when the position of target object shifts
The coordinate data of a appearance millet cake is different.
Step S140:According to each appearance millet cake to target follow the distance value selected, the position offset of each appearance millet cake with
And first coordinate obtain target follow the second coordinate a little.
In above-described embodiment, the point cloud data of the first moment target object and the point cloud of the second moment target object are obtained
After data, the offset of former and later two moment target objects is calculated by point cloud data, to according to the position of target object
Offset and target object appearance millet cake follow distance a little to target, estimate target and follow o'clock coordinate at the second moment
Position is realized that target follows accurate positionin a little, can accurately be followed a little to target when target object position sends variation
Into line trace.
The point cloud data and mesh of target object can be obtained by binocular structure electro-optical device in one of the embodiments,
Mark follows coordinate a little.
Step S140 follows distance value a little, each appearance according to each appearance millet cake to target in one of the embodiments,
The position offset of millet cake and the first coordinate obtain the step of target follows the second coordinate a little, include the following steps:
Each appearance millet cake to target is followed into the inverse ratio for the distance value selected phase corresponding with each position offset of appearance millet cake
Multiply and obtains corresponding target offset amount;Target, which is obtained, according to each target offset amount and the first coordinate follows the second coordinate a little.
In the present embodiment, the target that converts in proportion of distance value a little is followed to follow by target object appearance millet cake and target
The offset target offset amount of point calculates acquisition target further according to target offset amount and the first coordinate and follows the second coordinate a little.
Distance objective follows the proportion shared by the offset for selecting remoter appearance millet cake smaller, conversely, proportion is bigger, passes through target
Offset acquires more accurately the second coordinate, is followed a little so as to be accurately tracked by target.
Further, distance value a little, each appearance are followed according to each appearance millet cake to target in one of the embodiments,
The position offset of millet cake and the first coordinate obtain the step of target follows the second coordinate a little, include the following steps:
The distance value selected, the position offset and the first coordinate of each appearance millet cake are followed according to each appearance millet cake to target
Target, which is calculated, using following formula (1) follows the second coordinate a little;
In formula,For the first coordinate of target object;For the second coordinate of target object;For each outer surface
The position offset of point, whereinenx、eny、enzRespectively the position offset of appearance millet cake is in x, y, z axis
On component;For each appearance millet cake distance value a little is followed to target, whereindnx、
dny、dnzRespectively appearance millet cake follows the component on x, y, z axis of distance value a little to target.
Specifically, each appearance millet cake to be followed to the inverse ratio of component of the distance value a little in x-axis to target, with each outer surface
The position offset of point corresponds to be multiplied in the component of x-axis obtains the target offset amount of target object in the direction of the x axis, according to each mesh
The target offset amount of mark object in the direction of the x axis and the x values of the first coordinate obtain the x values that target follows the second coordinate a little, lead to
Cross y values and z values that same method obtains the second coordinate.
In view of point cloud data includes usually hundreds of thousands point up to a million, and operation is all carried out to all the points in point cloud data
Processing often results in that processing operand is huge, and processing speed is greatly reduced, and difficulty of matching is big between point cloud data, for this purpose, can be with
According to the structure feature of point cloud data and target object, the outer surface point of target object is divided into multiple regions, obtains this
The central point in a little regions, using the equivalent point cloud data of center point coordinate, to reduce data processing operation amount and point cloud significantly
Difficulty of matching between data improves processing speed so that can quickly be followed to target when target object position sends variation
Point is repositioned.
Referring to Fig. 2, Fig. 2 is the flow chart that target follows localization method a little in another embodiment of the present invention.In this reality
It applies in example, target follows localization method a little, includes the following steps:
Step S210:It obtains the first point cloud data of the target object at the first moment and target follows a little first to sit
Mark, wherein point cloud data includes the coordinate of multiple appearance millet cake on target object, and target, which follows, to be a little located on target object.
In this step, T is obtained1First point cloud data Q of moment target object1And target follows the first coordinate of object
Vectorial P1(x1, y1, z1), wherein the first point cloud data Q1It is the set of one group of vector, including the first moment target object is multiple outer
The coordinate vector of point on surface.
Step S220:Target object is divided into several according to the structure feature of target object and the first point cloud data
Region obtains the first nodal point coordinate of the regional center point in each region.
Point cloud data indicate target object external surface shape and target object spatial distribution location information, according to
The outer surface point of target object is divided into multiple regions, for example, Fig. 3 is by the structure feature of point cloud data and target object
Target object is divided into the schematic diagram in several regions, according to the structure of target object in Fig. 3 in one embodiment of the invention
Feature, target object are divided into region 310, region 320, region 330, region 340, region 350 and region 360.
Regional center point is to be divided into multiple regions, physical centre's point in each region in target object;First center
Point coordinates is in the first moment, coordinate position data of the regional center point in three-dimensional system of coordinate.
In this step, in T1Moment obtains the point cloud data Q of target object1Afterwards, according to the structure feature of target object and
T1The point cloud data Q at moment1, target object is divided into n region, n>=2, and obtain first physical centre in each region
Point q11、q12、…、q1n, and obtain the coordinate vector of these the first physical centre points.
Step S230:Each regional center point is calculated according to each first nodal point coordinate and the first coordinate to follow a little to target
Distance value.
According to the physical centre in each region point q11、q12、…、q1nCoordinate vector and the first coordinate vector P1(x1, y1,
z1), calculate separately these physical centre point q11、q12、…、q1nTo the first coordinate P1Distance
Step S240:The second point cloud data for obtaining the target object at the second moment, according to the second point cloud data by target
Object is divided into several identical regions, and obtains the second center point coordinate of the regional center point in each region.
In this step, the second center point coordinate is in the second moment, coordinate bit of the regional center point in three-dimensional system of coordinate
Set data.
Obtain T2Second point cloud data Q of moment target object2, the second point cloud data Q2Include in T2Moment target pair
As the coordinate vector put on outer surface.After target object is divided into several identical regions, according to the second point cloud data Q2
Obtain the second physical centre point q in each region21、q22、…、q2n, and obtain the coordinate vector of these the second physical centre points.
Step S250:Each first nodal point coordinate and each second center point coordinate correspondence are subtracted each other, obtained in each region
The position offset of heart point.
It is poor to make to the coordinate vector correspondence of physical centre's point of each region obtained twice, to obtain each region
The position offset that physical centre's point is fastened in three-dimensional coordinate
Step S260:The position offset of distance value a little, each regional center point is followed according to each regional center point to target
Amount and the first coordinate obtain target and follow the second coordinate a little.
In the present embodiment, according to the structure feature of point cloud data and target object, by the outer surface click and sweep of target object
It is divided into multiple regions, and obtains physical centre's point in these regions and the coordinate of physical centre's point, using in several each physics
The equivalent point cloud data of heart point coordinates calculates the offset of former and later two moment target objects by each physical centre's point coordinates,
To follow distance a little to target according to the position offset and each physical centre point of target object, estimates target and follow
Coordinate position o'clock at the second moment realizes that target follows accurate positionin a little, and significantly reduction data processing operation amount and
Difficulty of matching between point cloud data improves processing speed so that can be quickly and accurately when target object position sends and changes
Target is followed and is a little repositioned.
Further, in one of the embodiments, step S360 according to each regional center point to target follow a little away from
It is obtained in the step of target follows the second coordinate a little from value, the position offset of each regional center point and the first coordinate, it can
Target, which is calculated, using following formula (2) follows the second coordinate a little:
In formula,For the first coordinate of target object;For the second coordinate of target object;For each region
The position offset of central point, whereinenx、eny、enzRespectively the position offset of regional center point x,
Y, the component in z-axis;For each regional center point distance value a little is followed to target, whereindnx、dny、dnzRespectively each regional center point to target follow distance value a little on x, y, z axis
Component.
In the present embodiment, the target that converts in proportion of distance value a little is followed to follow a little by each regional center point and target
Offset target offset amount calculates acquisition target further according to target offset amount and the first coordinate and follows the second coordinate a little.Distance
Target follows the proportion shared by the offset of a little remoter each regional center point smaller, conversely, proportion is bigger, passes through target
Offset acquires more accurately the second coordinate, is followed a little so as to be accurately tracked by target.
Localization method a little is followed according to above-mentioned target, the present invention also provides a kind of targets to follow positioning system a little, with
The target of the lower just present invention follows the embodiment of positioning system to be a little described in detail.
Referring to Fig. 4, Fig. 4 is the structural schematic diagram that target follows positioning system a little in one embodiment of the invention.This reality
It applies in example, target follows positioning system a little, including:
Coordinate information acquisition module 410, the first point cloud data and target of the target object for obtaining for the first moment
Follow the first coordinate a little, wherein point cloud data includes the coordinate of multiple appearance millet cake on target object, and target follows point
In on target object;
Distance value acquisition module 420 is arrived for calculating separately each appearance millet cake with the first coordinate according to the first point cloud data
Target follows distance value a little;
Offset information acquisition module 430, the second point cloud data of the target object for obtaining for the second moment, according to first
The position offset of point cloud data and each appearance millet cake of second point cloud data acquisition;
Second coordinate obtaining module 440, for following the distance value selected, each appearance millet cake according to each appearance millet cake to target
Position offset and the first coordinate obtain target follow the second coordinate a little.
Above-mentioned target follows positioning system a little, passes through coordinate information acquisition module 410 and offset information acquisition module
After 430 obtain the point cloud data of the point cloud data of the first moment target object and the second moment target object, calculate front and back
The offset of two moment target objects, to be counted according to the position offset and distance value acquisition module 420 of target object
Obtained target object appearance millet cake follows distance a little to target, estimates target and follows o'clock coordinate bit at the second moment
It sets, realizes that target follows accurate positionin a little, can click-through accurately be followed to target when target object position sends variation
Line trace.
Distance value acquisition module 420 is according to the structure feature of target object and first point in one of the embodiments,
Target object is divided into several regions by cloud data, obtains the first nodal point coordinate of the regional center point in each region;According to
Each first nodal point coordinate and the first coordinate calculate each regional center point and follow distance value a little to target;
Target object is divided into several identical regions by offset information acquisition module 430 according to the second point cloud data,
And obtain the second center point coordinate of the regional center point in each region;Each first nodal point coordinate and each second central point are sat
Mark correspondence is subtracted each other, and the position offset of each regional center point is obtained.
Second coordinate obtaining module 440 follows distance value, each regional center point a little according to each regional center point to target
Position offset and the first coordinate obtain target follow the second coordinate a little
It is the structural schematic diagram of coordinate information acquisition module in one embodiment of the invention referring to Fig. 5, Fig. 5.The present embodiment
In, the second coordinate obtaining module 440 includes target offset amount acquiring unit 441 and the second coordinate calculating unit 442;
Target offset amount acquiring unit 441, for each appearance millet cake to target is followed the inverse ratio of distance value a little with it is each
The position offset of appearance millet cake, which corresponds to be multiplied, obtains corresponding target offset amount;
Second coordinate calculating unit 442, for according to each target offset amount and the first coordinate obtain target follow a little the
Two coordinates.
The second coordinate obtaining module 440 calculates the second coordinate using following formula (3) in one of the embodiments,;
In formula,For the first coordinate of target object;For the second coordinate of target object;For each appearance
The position offset of millet cake, whereinenx、eny、enzRespectively the position offset of appearance millet cake is in x, y, z
Component on axis;For each appearance millet cake distance value a little is followed to target, wherein
dnx、dny、dnzRespectively appearance millet cake follows the component on x, y, z axis of distance value a little to target.
The target of the present invention follows the target of positioning system and the present invention a little that localization method a little is followed to correspond,
Above-mentioned target follows the technical characteristic that the embodiment of localization method a little illustrates and advantage to be followed a little suitable for target
Positioning system embodiment in, hereby give notice that.
In one of the embodiments, the present invention also provides a kind of mechanical arm, including robot body, moxibustion head,
The computer program that binocular adds structure electro-optical device, controller and storage on the controller and can run on the controller;Binocular
Structure electro-optical device is added to be fixed on robot body with moxibustion head, and binocular adds structure electro-optical device solid with moxibustion head relative position
It is fixed;
Binocular adds point cloud data and mesh of the structure electro-optical device for obtaining target object to follow the first coordinate data a little;
Controller realizes that the target of any of the above-described embodiment follows localization method a little when executing computer program.
Specifically, when target object moves larger amplitude, target follows point location controller by realizing above-mentioned
The target of one embodiment follows localization method a little, obtains the target after target object movement and follows coordinate information a little, simultaneously
Control machinery arm moves so that moxibustion head can follow to target and follow new position a little automatically, realize that target follows a little oneself
Dynamic to follow, the mechanical arm is simple in structure, and performance is stablized, and can accurately be followed after target object moves and be moved to target
Follow new position a little.
In addition, one of ordinary skill in the art will appreciate that realize above-described embodiment method in all or part of flow,
It is that relevant hardware can be instructed to complete by computer program, which can be stored in a non-volatile computer can
It reads in storage medium, in the embodiment of the present invention, which can be stored in the storage medium of computer system, and by the meter
At least one of calculation machine system processor executes, and includes that above-mentioned each target such as follows the embodiment of localization method a little to realize
Flow.
A kind of storage medium is also provided in one of the embodiments, is stored thereon with computer program, wherein the journey
Realize that any one target in the various embodiments described above such as follows localization method a little when sequence is executed by processor.Wherein, it stores
Medium can be magnetic disc, CD, read-only memory (Read-Only Memory, ROM) or random access memory (Random
Access Memory, RAM) etc..
The computer storage media, the computer program of storage include as above-mentioned each target follows a little by realizing
The flow of the embodiment of localization method, to realize that target follows accurate positionin a little, when target object position sends and changes
Can click-through line trace accurately be followed to target.
Each technical characteristic of above example can be combined arbitrarily, to keep description succinct, not to above-described embodiment
In each technical characteristic it is all possible combination be all described, as long as however, the combination of these technical characteristics be not present lance
Shield is all considered to be the range of this specification record.
Only several embodiments of the present invention are expressed for above example, the description thereof is more specific and detailed, but can not
Therefore it is construed as limiting the scope of the patent.It should be pointed out that for those of ordinary skill in the art,
Under the premise of not departing from present inventive concept, various modifications and improvements can be made, these are all within the scope of protection of the present invention.
Therefore, the protection domain of patent of the present invention should be determined by the appended claims.