Specific embodiment
In order to make the object, technical scheme and advantages of the embodiment of the invention clearer, below in conjunction with the embodiment of the present invention
In attached drawing, technical scheme in the embodiment of the invention is clearly and completely described, it is clear that described embodiment is
A part of the embodiment of the present invention, instead of all the embodiments.Based on the embodiments of the present invention, those of ordinary skill in the art
Every other embodiment obtained without creative efforts, shall fall within the protection scope of the present invention.
Autonomous positioning provided by the invention and map method for building up and device are suitable for application scenarios shown in FIG. 1, described
Application scenarios include robot 10, wherein robot 10 is mobile robot, and the robot refers to certain artificial intelligence
The machine of energy, for example, sweeping robot, anthropomorphic robot, autonomous driving vehicle etc..Robot 10 is in times in order to complete user
Business or other in the case of, need to move in circumstances not known.During the motion in order to realize autonomous positioning and navigation, need
Increment type map is constructed, while estimating self-position.
For convenience, referring to figure 2., one section of robot 10 is continuously moved and is divided into discrete instants t=1 ... k,
Each moment uses xnIndicate the self-position of robot 10, i.e. x1, x2…xk, it constitutes the motion profile of robot 10.It is false
If map is made of many a road signs, such as the y in figure1、y2And y3, 10 can observe a part in each robot at moment
Road sign, obtain they apart from observation z (i.e. the distance between x and y).The positioning of robot 10 estimates robot 10 on ground
Position (x) in figure, robot 10 can estimate the position locating for itself by satisfying the need target apart from observation in existing map
It sets.Map establishes i.e. estimation map Road target position (y), the position (y) of road sign can according to the position (x) of robot 10 and
It is obtained apart from observation (z).The positioning of robot 10 and to build figure be a constantly lasting process, with the position of robot 10
Variation, robot 10 can observe new road sign, while constantly new road sign being added in map.
Wherein, the road sign for example metope, window, pillar, trees, building, desk, cabinet, flowers and plants, Sign Board, people,
Pet, vehicle etc..It in some embodiments, can be by the mobile attribute definition of metope, window, pillar, trees and building etc.
Be " loose impediment " by the mobile attribute definition of desk, cabinet, flowers and plants, Sign Board etc. for " fixed object ", by people, pet,
The mobile attribute definition of vehicle etc. is " mobile object ".Only the road sign for belonging to fixed object is added in map for robot 10, by
It is not susceptible to change in these road signs, road sign variation, energy can occur when referring to rout marking allocation to avoid robot 10
Ambient enviroment is reduced to robot localization and establishes the influence of map, so that the positioning of robot and map Road target be made to calculate
It is more acurrate.It should be noted that the definition of above-mentioned mobile attribute can be according to the application scenarios predefined of robot 10, not
Absolute, the same object mobile attribute in application scenes is " loose impediment ", in other application scenarios then
May be " fixed object ".
Fig. 3 is the flow diagram of autonomous positioning provided in an embodiment of the present invention and map method for building up, and the method can
It is executed by the robot 10 in Fig. 1, as shown in Figure 3, which comprises
101: obtain the robot satisfy the need punctuate apart from observation.
Wherein, robot 10 satisfy the need target distance observation can be in the method for view-based access control model, such as pass through binocular camera or depth
The image in front of the acquisition robot vision such as camera is spent, is then obtained by obtaining the depth information of each pixel in described image
Obtain the distance between robot 10 and each road sign.In further embodiments, robot can also pass through other methods measuring machine
The distance between device people 10 and road sign.
By taking the binocular camera of view-based access control model method is obtained apart from observation as an example, referring to figure 4., the robot 10 is obtained
Target satisfy the need apart from observation, comprising:
1011: obtaining the first image and the second image in visual range respectively by binocular camera shooting device.
The first image is obtained by being located at the camera in 10 left side of robot, the camera by being located at 10 right side of robot obtains
Obtain the second image, wherein the camera in left side and the camera on right side can be separately positioned at the left eye and right eye of robot 10.
1012: image recognition being carried out to the first image and second image respectively, identifies each area in image
The classification in domain simultaneously determines mobile attribute according to the classification, is classification and the mobile attribute described in each zone marker, described
Mobile attribute includes mobile object, loose impediment and fixed object.
Specifically, image recognition is carried out to the first image and the second image, it can be using for example based on the mind of deep learning
It is identified through network model, identifies the classification of each object in image.It simultaneously can be according to object category predefined
Mobile attribute determines the mobile attribute of each object in image, and marks generic and shifting for the pixel of object corresponding region
Dynamic attribute (such as mobile object, loose impediment and fixed object).For example, being identified in the first image by image recognition
Object category is respectively desk, people, wall etc., and according to the definition to desk, people and wall in advance, movement attribute is respectively removable
Object, mobile object and fixed object then mark classification and mobile attribute for the corresponding pixel in the region of desk in the picture
It is that the corresponding pixel in the region of people in the picture marks classification and movement attribute is " people " for " desk " and " loose impediment "
" mobile object ", is the corresponding pixel label classification in the region of wall in the picture and mobile attribute is " wall " and " fixture
Body ".It will be appreciated by persons skilled in the art that being used when in practical applications to pixel label classification with mobile attribute
May be to represent the computer symbols of concrete class and practical mobile attribute, and not concrete class and practical mobile attribute sheet
Body.Wherein, the mobile attribute of each object can be defined according to the application scenarios of robot 10 in advance.
1013: being based on the first image and the second image zooming-out characteristic point, and remove the spy for belonging to mobile object
Sign point.
Specifically, extract characteristic point from each pixel of the first image and the second image, can using such as SIFT or
ORB scheduling algorithm.Characteristic point is usually some " stable points " in image, will not be because of the change at visual angle, the variation of illumination, noise
Interference and disappear, such as the bright spot and the dim spot of bright area etc. of angle point, marginal point, dark areas.It, can after feature point extraction
To remove the characteristic point for marking in characteristic point and being.Because it is larger that mobile probability occurs for mobile object, if machine
The position position inaccurate of robot 10 will lead to refer to the object of these movements when device people 10 positions.Therefore, in the step
In rapid, the road sign that mobile attribute is mobile object can be rejected.
In some other embodiment, after identifying each region in image, directly mobile attribute can also be belonged to
The region of mobile object is shielded.When carrying out feature point extraction in this way, the characteristic point positioned at shielding area would not be extracted,
So as to not include the characteristic point that mobile attribute is mobile object in the characteristic point extracted.
1014: described based on the first image and second image progress Feature Points Matching after removal characteristic point
Feature Points Matching carries out between the identical characteristic point of classification, to obtain the road sign point that mobile attribute in image is non-moving object
Apart from observation.
Specifically, Feature Points Matching can be carried out based on such as Stereo Matching Algorithm, between the identical characteristic point of classification
It is matched.Such as Feature Points Matching is carried out between the characteristic point that classification belongs to " desk ", or belong to " wall in classification
It is matched between the characteristic point in face ".It can reduce matching range in this way, improve the validity of matching result.Feature Points Matching it
Afterwards, it can use matching result, according to principle of triangulation, calculate an o'clock parallax on the first image and the second image
Determine the depth of this feature point, i.e. distance of the robot 10 away from this feature point.
102: obtaining position of the robot in map.
103: the new road sign point that will belong to fixed object in the road sign point is added the map, and according to the position and
The pose that the new road sign point is obtained apart from observation.
Referring to figure 2., when robot 10 starts one section of movement, the starting point (x that robot 10 can be moved1) be set as
Dot, robot can observe road sign y in this position1And y2, it is assumed that road sign y1And y2Mobile attribute be fixed object,
By road sign y1And y2It is added in map.Because robot 10 is in dot at this time, according to robot here to road sign y1And y2's
Apart from observation z1And z2It can be obtained road sign y1And y2Pose in map.
When robot 10 moves to position x2When, robot 10 is to road sign y1And y2Apart from observation be z1' and z2', root
According to z1' and z2' in map (x1The map that position obtains) in carry out location finding (position).It is a certain in map when searching
When position, which is known as orientation distance at a distance from road sign each in map, robot 10 is practical to each corresponding road sign
It is known as observed range apart from observation, if the matching degree that the orientation distance meets the observed range is greater than default threshold
Value, then it is assumed that the position is x2The estimated location of position.
Road sign y is illustrated only in Fig. 21And y2, practical each road sign includes multiple characteristic points (road sign point).It calculates above-mentioned
Matching degree actually calculates in the position, the orientation distance of each road sign point meets robot 10 to each right in map
Answer the degree of the actual observation distance of road sign point.For example, it is assumed that preset threshold is 70, orientation distance meets the road sign of observed range
Point is denoted as 1, and the road sign point that orientation distance does not meet observed range is denoted as 0.If there is determining for more than 70 road sign points and the position
Position distance meets actual observation distance, it may be considered that the position is exactly position of the robot 10 in map.Otherwise, weight is needed
The new position of new search.
Wherein, judge whether the orientation distance of road sign point meets observed range and need based on corresponding road sign point, therefore,
Before calculating the matching degree, the corresponding relationship of the road sign point in the road sign point and map of the observation of robot 10 need to be matched.It can
Feature Points Matching is carried out with the road sign point in the road sign point and map observed robot 10, to determine the road sign of robot observation
Point corresponding road sign point in map.It wherein, in some embodiments, can also be each when each road sign point being added in map
Road sign point marks generic, and the matching of features described above point can carry out between the characteristic point of the same category, to reduce matching model
It encloses, improves the validity of matching result.
In some embodiments, when each road sign point being added in map, mobile weighted value can also be marked for each road sign point.
Although for example, as in map road sign trees and the mobile attribute of building be all fixed object, comparatively, building
Object is less susceptible to move, and therefore, the mobile weighted value of building can be set greater than to the mobile weighted value of trees.Example
Such as, 3 are set by the mobile weighted value of building, sets 2 for the mobile weighted value of trees.It is corresponding, above-mentioned matching degree
It can also be obtained in conjunction with the corresponding mobile weighted value of road sign point each in map.In some embodiments, the matching degree and
Mobile weighted value is positive correlation.The also above example explanation, it is assumed that road sign y1Mobile weighted value be 3, road sign y2Mobile weight
Value is 1, preset threshold or 70.If road sign y1In there are 20 orientation distances to meet observed range characteristic point, road sign y2In have
15 orientation distances meet the characteristic point of observed range, then matching degree is 20*3+15*1=75 > 70, this position positions successfully.
If road sign y1In there are 8 orientation distances to meet observed range characteristic point, road sign y2In have 45 orientation distances meet observation away from
From characteristic point, then matching degree is 8*3+45*1=69 < 70, and the positioning failure of this position needs to search in map again new
Position.
Wherein, in some embodiments, in order to reduce search range, operand is reduced.Sensor etc. can also be first passed through
Detection device estimates the displacement of robot 10, and then estimates the position of robot 10, then the estimation position in map
It sets in a certain range nearby and carries out location finding.Specifically, displacement of the estimation robot 10 between the first moment and the second moment,
The road sign point depth map that can be obtained to the first moment and the second moment carries out Feature Points Matching, by same characteristic point in difference
Depth in depth map obtains the displacement of robot 10.The displacement can also further with Inertial Measurement Unit (IMU,
Inertial measurement unit) provide posture information be filtered fusion.
When robot 10 moves to position x4When, robot is in this position detection to new road sign y3If road sign y3It also belongs to
Fixed object, then by road sign y3It is added in map.Road sign y3The x that pose in map is obtained according to positioning4The position at place and
Robot 10 is in this position to road sign y3Apart from observation obtain.
Because each road sign is by multiple feature point groups at being added in map is also the corresponding multiple features of road sign
Point spells i.e. composition map these characteristic point clouds.
Only the road sign point for belonging to fixed object is added for autonomous positioning provided in an embodiment of the present invention and map method for building up
In map, road sign variation occurs when referring to road sign to avoid robot, reduce ambient enviroment to robot localization with
The influence that map is established, so that it is more acurrate to calculate the positioning of robot and map Road target.
In further embodiments, referring to figure 5., the autonomous positioning and map method for building up, in addition to step 101-103
Except, further include step 104:
If the position is overlapped with historical position, institute is corrected according to the road sign point pose obtained in the historical position
Rheme set and the historical position and the position between the road sign point pose that obtains.
In order to correct the error as caused by drift, the consistent map of information is obtained.Robot 10 can periodically detect current
Whether position is the historical position accessed before, i.e. progress winding detection.If current location is overlapped with historical position, root
The map correcting current location according to the map obtained in historical position and being obtained between historical position to current location.By
The influence of road sign variation is eliminated when robot 10 positions, therefore robot 10 is easier to find history bit in winding detection
It sets.
Correspondingly, establish device the embodiment of the invention also provides a kind of autonomous positioning and map, the autonomous positioning and
Map establishes device for robot 10 shown in FIG. 1, as shown in fig. 6, the autonomous positioning and map establish the packet of device 600
It includes:
Observed range obtain module 601, for obtain the robot satisfy the need punctuate apart from observation;
Locating module 602, for obtaining position of the robot in map;
Module 603 is built, for the map, and root to be added in the new road sign point for belonging to fixed object in the road sign point
According to the position and the pose for obtaining the new road sign point apart from observation.
Autonomous positioning provided in an embodiment of the present invention and map establish device, are only added ground for the road sign for belonging to fixed object
In figure, to avoid robot, there is a situation where road signs to change when referring to road sign, reduces ambient enviroment to robot localization and ground
The influence established is schemed, so that it is more acurrate to calculate the positioning of robot and map Road target.
In some embodiments that autonomous positioning and map establish device 600, observed range obtains module 601 and specifically uses
In:
Obtain the first image and the second image in visual range respectively by binocular camera shooting device;
Image recognition is carried out to the first image and second image respectively, identifies the class of each region in image
It and according to the classification does not determine mobile attribute, is classification and the mobile attribute described in each zone marker, the movement belongs to
Property includes mobile object, loose impediment and fixed object;
Based on the first image and the second image zooming-out characteristic point, and remove the characteristic point for belonging to mobile object;
Based on the first image and second image progress Feature Points Matching after removal characteristic point, the characteristic point
Matching carries out between the identical characteristic point of classification, to obtain the distance for the road sign point that mobile attribute in image is non-moving object
Observation.
Specifically, building module 603 in wherein some embodiments and being specifically used for:
The map is added in the new road sign point for belonging to fixed object in the road sign point, and is the new road sign point label
Generic and mobile weighted value.
Specifically, locating module 602 is specifically used in wherein some embodiments:
Road sign point in the road sign point and the first moment map of the observation of second moment robot is subjected to Feature Points Matching, really
The road sign o'clock of fixed second moment robot observation corresponding road sign point in the first moment map, the Feature Points Matching is in classification
It is carried out between identical characteristic point;
According to robot described in second moment satisfy the need punctuate apart from observation in the map at first moment
Carry out location finding;
In conjunction with the mobile weighted value of map Road punctuate, the robot is obtained in the map when a certain position
The position is positioned as institute if the matching degree is more than preset threshold by the matching degree of orientation distance and observed range
Position of the robot in map is stated, the orientation distance is that the position is at a distance from each road sign point in the map, the sight
Ranging is from being the robot to observation with a distance from each corresponding road sign point.
In the other embodiments that autonomous positioning and map establish device 600, Fig. 7 described device is please referred to further include:
Winding detection module 604, if be overlapped for the position with historical position, basis is obtained in the historical position
The road sign point pose obtained corrects the road sign point pose obtained between the position and the historical position and the position.
It can be performed provided by the embodiment of the present invention independently it should be noted that above-mentioned autonomous positioning and map establish device
Positioning and map method for building up, have the corresponding functional module of execution method and beneficial effect.It is not built in autonomous positioning and map
The technical detail of detailed description in vertical Installation practice, reference can be made to autonomous positioning provided by the embodiment of the present invention and map are established
Method.
Fig. 8 is the hardware structural diagram of robot 10 provided in an embodiment of the present invention, as shown in figure 8, the robot 10
Include:
One or more processors 11 and memory 12, in Fig. 8 by taking a processor 11 as an example.
Processor 11 can be connected with memory 12 by bus or other modes, to be connected as by bus in Fig. 8
Example.
Memory 12 is used as a kind of non-volatile computer readable storage medium storing program for executing, can be used for storing non-volatile software journey
Sequence, non-volatile computer executable program and module, such as the autonomous positioning and map method for building up in the embodiment of the present invention
Corresponding program instruction/module is (for example, attached observed range shown in fig. 6 obtains module 601, locating module 602 and builds module
603).Non-volatile software program, instruction and module of the processor 11 by operation storage in memory 12, thereby executing
The various function application and data processing of robot, the i.e. autonomous positioning of realization above method embodiment and map foundation side
Method.
Memory 12 may include storing program area and storage data area, wherein storing program area can storage program area,
Application program required at least one function;Storage data area can store the use that device is established according to autonomous positioning and map
The data etc. created.In addition, memory 12 may include high-speed random access memory, it can also include non-volatile memories
Device, for example, at least a disk memory, flush memory device or other non-volatile solid state memory parts.In some embodiments
In, optional memory 12 includes the memory remotely located relative to processor 11, these remote memories can pass through network
It is connected to autonomous positioning and map establishes device.The example of above-mentioned network includes but is not limited to internet, intranet, local
Net, mobile radio communication and combinations thereof.
One or more of modules are stored in the memory 12, when by one or more of processors 11
When execution, the autonomous positioning and map method for building up in above-mentioned any means embodiment are executed, for example, executing figure described above
Method and step 101 in 3 is to step 103, method and step 1011 in Fig. 4 to step 1014, the method and step 101 in Fig. 5 to
Step 104,;Realize the function of module 601-604 in module 601-603, Fig. 7 in Fig. 6.
Method provided by the embodiment of the present invention can be performed in the said goods, has the corresponding functional module of execution method and has
Beneficial effect.The not technical detail of detailed description in the present embodiment, reference can be made to method provided by the embodiment of the present invention.
The embodiment of the invention provides a kind of non-volatile computer readable storage medium storing program for executing, the computer-readable storage mediums
Matter is stored with computer executable instructions, which is executed by one or more processors, such as in Fig. 8
One processor 11, may make said one or multiple processors can be performed the autonomous positioning in above-mentioned any means embodiment and
Map method for building up, for example, the method and step for executing method and step 101 in Fig. 3 described above to step 103, in Fig. 4
1011 to step 1014, the method and step 101 in Fig. 5 to step 104,;Realize module in module 601-603, Fig. 7 in Fig. 6
The function of 601-604.
The apparatus embodiments described above are merely exemplary, wherein described, unit can as illustrated by the separation member
It is physically separated with being or may not be, component shown as a unit may or may not be physics list
Member, it can it is in one place, or may be distributed over multiple network units.It can be selected according to the actual needs
In some or all of the modules achieve the purpose of the solution of this embodiment.
Through the above description of the embodiments, those of ordinary skill in the art can be understood that each embodiment
The mode of general hardware platform can be added to realize by software, naturally it is also possible to pass through hardware.Those of ordinary skill in the art can
With understand all or part of the process realized in above-described embodiment method be can be instructed by computer program it is relevant hard
Part is completed, and the program can be stored in a computer-readable storage medium, the program is when being executed, it may include as above
State the process of the embodiment of each method.Wherein, the storage medium can be magnetic disk, CD, read-only memory (Read-
Only Memory, ROM) or random access memory (RandomAccessMemory, RAM) etc..
Finally, it should be noted that the above embodiments are merely illustrative of the technical solutions of the present invention, rather than its limitations;At this
It under the thinking of invention, can also be combined between the technical characteristic in above embodiments or different embodiment, step can be with
It is realized with random order, and there are many other variations of different aspect present invention as described above, for simplicity, they do not have
Have and is provided in details;Although the present invention is described in detail referring to the foregoing embodiments, the ordinary skill people of this field
Member is it is understood that it is still possible to modify the technical solutions described in the foregoing embodiments, or to part of skill
Art feature is equivalently replaced;And these are modified or replaceed, each reality of the present invention that it does not separate the essence of the corresponding technical solution
Apply the range of a technical solution.