CN108898605B - Grid map segmentation method based on map - Google Patents

Grid map segmentation method based on map Download PDF

Info

Publication number
CN108898605B
CN108898605B CN201810823381.1A CN201810823381A CN108898605B CN 108898605 B CN108898605 B CN 108898605B CN 201810823381 A CN201810823381 A CN 201810823381A CN 108898605 B CN108898605 B CN 108898605B
Authority
CN
China
Prior art keywords
node
map
nodes
class
clustering
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201810823381.1A
Other languages
Chinese (zh)
Other versions
CN108898605A (en
Inventor
刘炳锐
刘宇
左琳
张昌华
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
University of Electronic Science and Technology of China
Original Assignee
University of Electronic Science and Technology of China
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by University of Electronic Science and Technology of China filed Critical University of Electronic Science and Technology of China
Priority to CN201810823381.1A priority Critical patent/CN108898605B/en
Publication of CN108898605A publication Critical patent/CN108898605A/en
Application granted granted Critical
Publication of CN108898605B publication Critical patent/CN108898605B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/10Segmentation; Edge detection
    • G06T7/11Region-based segmentation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/23Clustering techniques

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Data Mining & Analysis (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Artificial Intelligence (AREA)
  • Bioinformatics & Cheminformatics (AREA)
  • Bioinformatics & Computational Biology (AREA)
  • Evolutionary Biology (AREA)
  • Evolutionary Computation (AREA)
  • General Engineering & Computer Science (AREA)
  • Image Analysis (AREA)

Abstract

The invention discloses a grid map segmentation method based on a graph, aiming at the condition that the segmentation of a corridor is inconsistent with a real map in the existing segmentation map algorithm, the invention fully utilizes the obstacle information in a map constructed by a real environment to acquire information with semantic properties from the grid map, and mainly comprises two parts of free area clustering and area merging based on the graph; the free area clustering is specifically ISODATA combined with a light throwing algorithm, so that the clustering algorithm can ensure that a clustering result cannot cross an obstacle, and meanwhile, the clustering algorithm can effectively remove noise in a map; the region merging based on the map specifically comprises the steps of effectively utilizing barrier information in the map, establishing and optimizing the map according to the connectivity of the classes, and then merging the classes to obtain complete corridors and rooms.

Description

Grid map segmentation method based on map
Technical Field
The invention belongs to the field of computer vision, and particularly relates to a map segmentation technology.
Background
Human dependence on the visual system in understanding the world is self-evident, and similarly, machines view computer vision as the basis for recognizing the world. Computer vision is one of the most important artificial intelligence technologies and widely applied to the technologies of robot vision navigation, face recognition, image recognition, unmanned driving and the like. In the field of robotics, maps are one of the main tools that help robots describe the environment and pinpoint location. The most common type of map used in robotic autonomous positioning navigation technology is a grid map. The free area in the grid map represents the area through which the robot can pass. The free area of the grid map is divided to obtain the area with semantic information, so that the robot is favorable for establishing a topological map and a semantic map, and realizing global positioning and path planning. Therefore, the study on the grid map segmentation method has great significance. The grid map segmentation algorithm research work is mainly divided into several methods:
(1) the key idea of the map segmentation method based on distance transformation is to perform distance transformation on a grid map first, a local maximum of the distance transformation is always located in the center of a room, and a local maximum of the distance transformation in a corridor or a doorway is usually smaller than that in the center of the room, so that a set of distance threshold values at the center of the room and at the doorway can be obtained. Cycling through all possible thresholds in descending order, the grid in the map is continually assigned to the nearest center of the room according to its distance transformed value, and is no longer assigned when the threshold equals the threshold for the distance of the doorway. Then, the interconnected room centers are merged, and finally grids distributed to the same room center are considered to belong to the same room, so that the map segmentation is realized.
(2) A map segmentation method based on a Voronoi diagram has the key idea that the Voronoi diagram is generated according to a grid map, and a method for effectively generating the Voronoi diagram in practical application is to perform skeleton extraction (Skeletonization) on the basis of Euclidean distance transformation of the grid map. Critical Points (Critical Points) are extracted from the graph, then, according to a heuristic method, a grid map is divided at the intersection of each Critical point to obtain a division unit, and finally, a combination unit obtains a division area.
(3) The key idea of the feature-based map segmentation method is to learn the features of each grid through local observation and mark labels, and then obtain a segmentation area according to the labels of adjacent grids. One feature-based room segmentation algorithm proposed by Mozos et al first simulates a laser rangefinder emitting laser light at 360 ° at each free grid in a grid map, and each simulated laser beam can measure the distance between the laser rangefinder and an obstacle. For a simulated laser rangefinder, the grid is characterized by the length of the average simulated light. And classifying the characteristics of all grids by an AdaBoost classifier, marking the characteristics as different labels, and finally merging the adjacent grids with the same label to realize map segmentation.
(4) A Graph Partitioning (Graph Partitioning) based segmentation method. Zivkovic et al apply this type of segmentation method in building Hierarchical maps (Hierarchical maps) and path planning. First, the base layer map is represented as a graph, the nodes represent map points of the reachable area, and the edges represent the transition relationship between the two nodes. And then, cutting the Graph at the weak connection position by using a Normalized Graph Cut algorithm (Normalized Graph Cut), thereby realizing map segmentation and establishing a high-level map.
(5) Morphological segmentation method. Buschka et al apply morphological processing to room segmentation, first building a fuzzy grid map to describe the likelihood of a grid being occupied. Performing a fuzzy morphological opening operation on the fuzzy grid map may separate regions connected by narrow channels. And (3) determining grids belonging to the same room by using a watershed algorithm from seeds in each region, so as to realize room segmentation.
The map segmentation algorithm can effectively segment the grid map to obtain an interested area, but still has many limitations, which are mainly shown in that:
(1) existing map segmentation methods do not make efficient use of obstacle information in the map. In the real indoor environment, messy objects inevitably exist, and the indoor environment is not only an empty room structure, and is simple like a building plan. Therefore, an irregularly shaped obstacle exists in the grid map constructed in the real environment, and appears as an occupied grid. The objects placed in the room add a lot of information to the map, but most of the existing methods regard the objects as noise, and the noise is removed before segmentation. If the segmented areas are obtained according to the method, then a topological map and a path plan are constructed, and the knowledge of one autonomous mobile robot on the environment only stays at the level of an independent room.
(2) The existing method is inconsistent with the segmentation result of the manually marked real map on the long straight corridor. The above-mentioned distance transform-based segmentation method, Voronoi diagram-based segmentation method, and feature-based segmentation method have segmentation results of segmenting a long straight corridor into incomplete segments. The reason is that the three methods need to calculate the distance from the idle grid to the nearest obstacle before the next operation is performed. Since the free grid located in the corridor closest to the obstacle is no longer the boundary of the corridor, near the door, there is a change in the calculated distance, resulting in three ways that divide a corridor into several segments. Morphological segmentation there is a segmentation result that merges the corridor with other regions because, after iteratively performing the morphological opening operation, the corridor and the neighboring regions are merged in the search and merging of regions.
According to the method, the situation that the segmentation of the corridor is inconsistent with the real map exists in the segmented map, and no scheme in the prior art can well solve the technical problem.
Disclosure of Invention
In order to solve the technical problems, the invention provides a grid map segmentation method based on a graph, which fully utilizes barrier information in a map constructed by a real environment to acquire information with semantic properties from the grid map, realizes effective segmentation and has a better effect on the segmentation of a long straight corridor.
The technical scheme adopted by the invention is as follows: a grid map segmentation method based on a graph comprises the following steps:
s1, initializing parameters, including: initial cluster center number K0The minimum number of samples N contained in each class0The merging coefficient theta0Threshold value sigma of degree of dispersion of cluster samples0Maximum iteration number N of clustering algorithmmaxThreshold value of connectivity thetac
S2, map preprocessing is carried out after the grid map is read, and image data of the grid map are normalized to obtain a cluster data set D formed by free areas;
s3, clustering the D in the step S2 by adopting an iterative self-organizing data analysis algorithm combined with a ray casting algorithm according to the initialization parameters in the step S1;
s4, establishing an undirected graph according to the clustering result of the step S3;
s5, calculating the degrees of all nodes in the undirected graph, and dividing isolated regions according to the degrees of the nodes;
s6, constructing a connected graph for all the non-isolated nodes to obtain a segmentation area set to be optimized;
and S7, calculating connectivity between the nodes of the connected graph and all the nodes in each partition area to be optimized, optimizing the partition areas to be optimized according to the calculated connectivity to obtain the partition areas, and obtaining a grid map partition result according to the partition areas and the isolated areas.
Further, step S2 is specifically: the gray value of the occupied grid is 0, the gray value of the undetected grid is 204, and the gray value of the idle grid is 254; cutting an undetected area of the edge of the grid map; carrying out denoising processing on the map by using median filtering to obtain a map I; and acquiring a free area from the map I to form a cluster data set D.
Further, step S3 includes the following substeps:
s31, randomly generating K0An initial cluster center, denoted as
Figure BDA0001741870090000031
And each cluster center c is expressed by pixel coordinatesmAnd D;
s32, calculating the city block distance between each cluster sample in the step D and all cluster centers, and then distributing the cluster samples to corresponding classes;
s33, if the number of samples in a certain class is less than N0Reassigning the samples in the class to the closest class;
s34, recalculating the clustering centers of all the classes to obtain a current clustering center set;
s35, if the current clustering number K is less than K0Performing class splitting processing; if the current clustering number K is more than 2K0Executing class merging processing; otherwise, executing step S36;
s36, judging whether the maximum iteration number N is reachedmaxAnd if so, terminating the clustering algorithm to obtain a clustering result of the free area of the grid map, otherwise, returning to the step S32.
Further, the class splitting treatment process is as follows:
a1, respectively calculating Euclidean distances and standard deviations of all samples and class centers in each cluster under a two-dimensional coordinate to obtain the standard deviation of two dimensions corresponding to each cluster; note class C'mThe maximum of the two standard deviations is
Figure BDA0001741870090000041
A2, if
Figure BDA0001741870090000042
Exceeding a threshold value sigma0And the number of samples contained
Figure BDA0001741870090000043
Over 2N0Then a3 is executed; otherwise, executing S36;
a3, will be C'mSplitting into two categories, respectively calculating clustering centers of the two categories, and then calculating the class C'mDistance of sample in (1) to two cluster centers, class C'mThe sample in (1) is classified as the one closest to the sample.
Further, the class merging processing process specifically includes:
b1, calculating the distance l between the centers of every two classes;
b2, judging whether l is less than a threshold value theta0If yes, go to step B3; otherwise, step S39 is executed.
B3, will be C'm1And C'm2Merging into a new category, and calculating the center c 'of the new category'mnewI.e. by
Figure BDA0001741870090000044
Will be C'm1And C'm2All samples in (c ') are assigned to the new class center c'mnew
Further, step S32 is specifically: when clustering sample snWith a certain cluster center cmThe distance between the two is minimum, and a clustering sample s is obtained through a fiber throwing algorithmnAnd a distance class center cmWhen passing through the free area only; will snIs assigned to cmCorresponding class CmPerforming the following steps; otherwise, s is used in all iterations before the last iterationnAssigning the class corresponding to the cluster center point with the closest distance, and assigning s in the last iterationnAnd (4) removing the noise points from the D.
Further, step S6 specifically includes the following sub-steps:
s61, constructing a graph G ' ═ V ', E ', where the node of G ' is composed of all non-isolated nodes in the undirected graph, and the edge in G ' indicates that the two connected nodes are communicated;
s62, selecting a node in G' to doAn initial parent node for breadth-first search; the method specifically comprises the following steps: degree d 'of a node in G'iThe highest frequency of occurrence among the degrees of all nodes; and the node is nearest to the center of the read grid map; the node is selected as the initial parent node for breadth first search.
S63, using father node as starting point to search breadth first, if the searched node degree
Figure BDA0001741870090000045
If the degree of the node is less than that of the father node, the node and the father node are not in the same area; otherwise, classifying the node according to the leaf node and the bifurcation node; merging the father node with all the leaf node sets and the bifurcation node sets to obtain an initial segmentation area;
the degrees of the leaf nodes and the father nodes are equal, and the degree of the bifurcation node is greater than that of the father node.
S64, selecting a new parent node from G ', and returning to the step S63 until all nodes in G' are traversed, thereby obtaining an initial set of divided regions.
Further, the specific process of selecting a new parent node from G' is as follows:
when v 'is node'pjAnd when the following conditions are met, selecting the node as a new breadth-first search parent node:
condition 1: v'pjCommunicating with at least any one of the bifurcate nodes of the current parent node;
condition 2: v 'of all nodes in communication with any one of the diverging nodes of the current parent node'pjDegree d ofbiThe frequency of occurrence is highest;
condition 3: v 'of all nodes in communication with any one of the diverging nodes of the current parent node'pjDegree d ofbiAnd max.
Further, step S7 specifically includes the following sub-steps:
s71, calculating the city block distance between every two nodes in G ', and dis (i, j) represents v'iAnd v'jThe distance of (c).
S72, calculating a weighted adjacency matrix W of G';
s73, calculating the connectivity Con (v'i,Rk);
Wherein, v'iDenotes any node in G', RkRepresenting any initial segmented region in the initial segmented region set;
s74, if Con (v'i,Rk) Greater than 1, then v'iIs of the formula RkV 'will be'iAnd RkMerging; otherwise, v'iNot being part of Rk(ii) a When all nodes of G' are traversed, obtaining a segmentation region R; according to R and isolated region RIAnd obtaining a grid map segmentation result.
Further, the adjacency matrix is specifically: v 'is judged'iAnd v'jIf yes, making side e'ijW (i, j) ═ Wi,jDis (i, j); otherwise, W (i, j) ═ Wi,j=0。
The invention has the beneficial effects that: the method mainly comprises two parts of free area clustering and area merging based on a graph; the free area clustering is specifically ISODATA combined with a light throwing algorithm, so that the clustering algorithm can ensure that a clustering result cannot cross an obstacle, and meanwhile, the clustering algorithm can effectively remove noise in a map; the region merging based on the map specifically comprises the steps of effectively utilizing barrier information in the map, establishing and optimizing the map according to the connectivity of the classes, and then merging the classes to obtain complete corridors and rooms. Therefore, compared with the real map marked manually, the segmentation result of the algorithm designed by the invention is more consistent. The segmentation result of the invention can be used for establishing a topological map, and meanwhile, the invention has a promoting effect on the research of the global positioning of the robot, the map segmentation result represents all the regions of the robot which are possible to appear currently, and the re-estimation of the current pose of the robot can be accelerated after the global positioning of the robot is failed.
Drawings
FIG. 1 is a flow chart of a graph-based grid map segmentation algorithm provided by the present invention;
FIG. 2 is a flow chart of an ISODATA clustering algorithm combined with a ray casting algorithm provided by the present invention;
FIG. 3 is a grid map to be segmented according to an embodiment of the present invention;
wherein, fig. 3(a) the original grid map to be segmented; FIG. 3(b) is a partially enlarged schematic view;
FIG. 4 is a diagram illustrating the effect of map preprocessing performed according to the embodiment of the present invention;
FIG. 5 is a diagram illustrating the effect of clustering free areas by using the ISODATA clustering algorithm in combination with the ray casting algorithm in the embodiment of the present invention;
fig. 6 is a map segmentation effect graph obtained by using a grid map segmentation algorithm based on a graph according to an embodiment of the present invention.
Detailed Description
In order to facilitate the understanding of the technical contents of the present invention by those skilled in the art, the present invention will be further explained with reference to the accompanying drawings.
The grid map adopted by the embodiment of the invention is constructed by a HUSKY A200 robot through a Gmapping algorithm in a real office environment, the resolution is 0.05m, and the area of a free area is about 505m2. An industrial personal computer, a motion control module, an information acquisition module and the like of the ROS system are arranged in the robot, and sensors such as a two-dimensional laser radar, a speedometer and an inertia measurement unit of the LMS151 are also carried. As shown in fig. 3, in a real office environment, there are a large number of obstacles so that the map contour does not have a regular geometric shape. The grid map segmentation method based on the graph is used for carrying out multiple experiments, and the grid map segmentation algorithm based on the graph provided by the invention can be used for effectively segmenting the grid map with a large amount of noise and obstacles.
As shown in fig. 1, the method comprises the following specific steps:
s1, setting algorithm parameters including initial clustering center number K0The minimum number of samples N contained in each class0The merging coefficient theta0Threshold value sigma of degree of dispersion of cluster samples0Maximum iteration number N of clustering algorithmmaxThreshold value of connectivity thetacSpecific values of the parameters are shown in table 1.
TABLE 1 initial parameters
Parameter(s) K0 N0 θ0 σ0 Nmax θc
Value taking 150 1200 100 0.01 50 0.8
Wherein the merging coefficient theta0Representing a threshold of distance between cluster centers, a threshold of degree of cluster sample dispersion σ0A standard deviation threshold representing the distance of samples in the same cluster.
S2, map preprocessing is carried out after the grid map is read, image data of the grid map are normalized, the gray value of the occupied grid is 0, the gray value of the undetected grid is 204, and the gray value of the idle grid is 254; cutting an image of the map, and cutting an undetected area at the edge of the grid map; denoising the map by using 3 x 3 median filtering to obtain a map I; and acquiring a free area from the map I to form a cluster data set D.
S3, according to the initialization parameters of the step S1, clustering the D in the step S2 by using ISODATA (Iterative Self-Organizing Data Analysis Algorithm) combined with a ray casting Algorithm; the clustering result contains KcAnd (4) a class.
In the present invention, reference may be made to: ball and D.Hall, "ISODATA, a novel method of data analysis and pattern classification," Stanford Research Institute, Menlo Park, CA, 1965
As shown in fig. 2, the method specifically comprises the following steps:
s31, randomly generating K0An initial cluster center, denoted as
Figure BDA0001741870090000071
Representing each cluster center c by pixel coordinatesmAnd D. K0The remainder of the division of the total sample data amount by 160, the total sample data amount ≈ K0*N0
S32, calculating the city block distance between each sample in the D and all the clustering centers; sample snTo the cluster center cmCorresponding class CmTwo conditions need to be met:
condition 1: snAnd cmIs minimal;
condition 2: judging s by the Ray casting algorithm (Ray casting algorithm reference: S.D. Roth, "Ray casting for modeling solutions," Computer Graphics and Image Processing, vol.18, No.2, pp.109-144, February 1982.)nAnd cmOnly through the free area.
When both conditions are satisfied, the sample s is samplednTo the cluster center cmCorresponding class CmPerforming the following steps; if two conditions are not satisfied simultaneously, the first Nmax1 iteration of snAssigned to the class corresponding to the nearest center point, at NthmaxIn the point of sub-iteration snAnd (4) removing the noise points from the D.
S33, judging whether the class needs to be redistributed according to the sample number of the class, class CmThe number of samples in (1) is expressed as
Figure BDA0001741870090000072
If it is not
Figure BDA0001741870090000073
Less than N0The class is discarded and the samples in the class are reassigned to the closest class.
S34, recalculating the clustering centers of all classes, class CmNew cluster center of (a) is represented as c'mI.e. by
Figure BDA0001741870090000081
Obtaining a new cluster center set C '═ { C'1,c′2,...,c′m,...c′k}。
S35, if the current clustering number K is less than K0Performing splitting treatment; if the current clustering number K is more than 2K0If yes, executing merging processing; the current clustering number K satisfies K0/2≤K≤2K0Then, step S36 is executed;
the splitting operation process specifically comprises the following steps:
a1, respectively calculating Euclidean distances and standard deviations of all samples and class centers in each cluster under a two-dimensional coordinate, wherein two standard deviations can be respectively calculated for each cluster because a grid map is a two-dimensional image; note class C'mThe maximum of the two standard deviations is
Figure BDA0001741870090000082
A2, judging whether the condition is satisfied
Figure BDA0001741870090000083
Exceeding a threshold value sigma0And the number of samples contained
Figure BDA0001741870090000084
Over 2N0If yes, A3; otherwise S39;
a3, will be C'mSplit into two categories, compute center c 'of the new category'm1And c'm2I.e. by
Figure BDA0001741870090000085
Figure BDA0001741870090000086
Reallocating samples, specifically: will be C'mSample and c'm1And c'm2The center closest to the middle is classified as one.
The merging process specifically comprises the following steps:
b1, calculating the distance l between the centers of every two classes;
b2, judging whether l is less than a threshold value theta0If yes, go to step B3; otherwise, step S39 is executed.
B3, will be C'm1And C'm2Merging into a new category, and calculating the center c 'of the new category'mnewI.e. by
Figure BDA0001741870090000087
Will be C'm1And C'm2All samples in (c ') are assigned to the new class center c'mnew
S36, judging whether the maximum iteration number N is reachedmaxAnd if so, terminating the clustering algorithm to obtain a clustering result of the free area of the grid map, otherwise, returning to the step S32.
After the clustering result of the free area of the grid map is obtained, the grids belonging to the same area are endowed with the same gray scale for visualization, and the segmentation effect shown in fig. 5 can be obtained.
S4, establishing an undirected graph G (V, E) according to the clustering result of the free areas, wherein the node V in GiRepresented as class i; using a ray casting algorithm, projecting rays from the center of class i to the center of class j, by whether the rays pass through a non-null spaceIdle grid judgment node viAnd vjWhether the two nodes are communicated or not, if the two nodes pass through the non-idle area, the two nodes are not communicated; otherwise, the two nodes are communicated; g middle edge ejConnecting node viAnd vjRepresents that two nodes are connected, i, j belongs to [1, K ]c]。
And S5, dividing the isolated region according to the node degree. Calculate degrees of all nodes in G, node viDegree of (D) is represented byi(ii) a Judgment of diIf it is 0, if it is zero, viIs an isolated node; each isolated node is an isolated region R obtained by a grid map segmentation algorithmI
S6, constructing a connected graph G ' (V ', E ') for all non-isolated nodes, and selecting a parent node V ' in G 'piSearching for v 'by breadth-first search'piLeaf node and bifurcation node in connectivity, will v'piAnd its leaf node set V'LiAnd a set of diverging nodes V'BiMerging to obtain an initial segmentation area; and continuously selecting a new father node for searching until all nodes are traversed to obtain a segmented region set R to be optimized1,R2,…,Rk,...RS}。
The method specifically comprises the following steps:
and S61, constructing a graph G ' ═ V ', E ', wherein the nodes of G ' are composed of all non-isolated nodes in the graph G, and edges in G ' represent that two connected nodes are communicated.
S62, selecting a node v 'in G'iThe initial parent node as the breadth-first search needs to satisfy two conditions:
condition 1: node v'iDegree d 'of'iThe highest frequency of occurrence among the degrees of all nodes;
condition 2: node v'iClosest to the center of the grid map being read. For example, the original grid map of 2000 x 2000, the center (1000 ) of the original grid map is the center of the read grid map.
When both conditions are satisfied, node v 'is selected'iInitial parent node v 'as breadth-first search'pi
S63, carrying out breadth-first search by taking the father node as a starting point, namely searching all nodes communicated with the father node; judging the searched node v'jDegree of (1)
Figure BDA0001741870090000091
Whether the degree of the parent node is less than that of the parent node or not, and if the degree of the parent node is less than that of the parent node, considering v'jNot in the same area as the parent node; if it is
Figure BDA0001741870090000092
Not less than degree of parent node, will v'jClassifying according to leaf nodes and bifurcation nodes, wherein the degrees of the leaf nodes are equal to those of father nodes, and the degree of the bifurcation nodes is greater than that of the father nodes; set parent node with all its leaf nodes V'LiAnd a set of node branches V'BiAnd merging to obtain an initial segmentation area.
S64, selecting a new parent node v 'from G'pjNew parent node v'pjThe following three conditions need to be satisfied simultaneously:
condition 1: v'pjAt least with the current parent node v'piAny one of the forked nodes v'BiCommunicating;
condition 2: and current parent node v'piAny one of the forked nodes v'BiV 'in all nodes connected'pjDegree d ofbiThe frequency of occurrence is highest;
condition 3: and current parent node v'piAny one of the forked nodes v'BiV 'in all nodes connected'pjDegree d ofbiMaximum;
when all three conditions are met, selecting node v'pjAs a breadth-first search for a new parent node, step S63 is executed to continue the search until all nodes are traversed, and an initial set of divided regions R ═ R is obtained1,R2,…,Rk,...RS}。
S7, calculating node v 'of G'iAnd region RkCon (v ') connectivity of all nodes therein'i,Rk) (ii) a Optimizing and dividing the region R according to the connectivity of the nodes and the region; finally, R and isolated region RISegmentation results { R, R collectively constituting a grid map segmentation algorithmI}. The method comprises the following steps:
s71, calculating the city block distance between every two nodes in G ', and dis (i, j) represents v'iAnd v'jThe distance of (c).
S72, calculating a weighted adjacent matrix W of G ', and judging v'iAnd v'jIf yes, making side e'ijW (i, j) ═ Wi,jDis (i, j); otherwise, W (i, j) ═ Wi,j=0。
S73, calculating a node v 'in G'iAnd region RkCon (v)'i,Rk)=∑wi,j/(θc∑dis(i,j)),j∈Rk
S74, judging Con (v'i,Rk) Whether is greater than 1 or not, if yes, v'iIs of the formula RkV 'will be'iAnd RkMerging; otherwise, v'iNot being part of Rk. Optimizing all nodes G' to obtain a segmentation region R; finally, R and isolated region RIJointly form a grid map segmentation algorithm segmentation result { R, RI}。
After the segmentation result of the free area of the grid map is obtained, the grids belonging to the same area are endowed with the same gray value by using a backtracking method, and then are converted into a pseudo color image for visualization, so that the segmentation effect shown in fig. 6 can be obtained.
Since the invention mainly performs segmentation on the grid map established for the real environment, the segmentation result should have semantic properties, that is, areas such as rooms, complete corridors and the like are obtained to represent the areas where the robot may appear. Fig. 3(a) shows that the grid map to be segmented according to the embodiment of the present invention shows that the undetected area in the original map occupies most of the grid, and therefore, the grid map needs to be cropped in the map preprocessing process, so that the unnecessary calculation amount is reduced. Fig. 3(b) is a partially enlarged schematic view. Fig. 4 is an effect diagram after map preprocessing, in which clipping and median filtering in image processing are utilized in the map preprocessing process according to the embodiment of the present invention. Due to the measurement error of the sensor, the robot mapping algorithm and other reasons, a large amount of noise inevitably exists in the map, and the median filtering can be used for effectively carrying out denoising processing. Fig. 5 is a diagram illustrating the effect of clustering free areas by using the ISODATA clustering algorithm combined with the ray casting algorithm according to the embodiment of the present invention, wherein each plaque is a clustering result. Fig. 6 is a map segmentation effect graph obtained by using a grid map segmentation algorithm based on a graph in the embodiment of the present invention, and it is found out that noise screened by a clustering algorithm is around a map contour in fig. 6 by combining fig. 5. Comparing the positions of the corridors in fig. 4 and 6, the long straight corridor is completely divided. Meanwhile, as can be seen from fig. 6, different rooms are effectively divided according to the connectivity of the graph, and are consistent with the real environment.
It will be appreciated by those of ordinary skill in the art that the embodiments described herein are intended to assist the reader in understanding the principles of the invention and are to be construed as being without limitation to such specifically recited embodiments and examples. Various modifications and alterations to this invention will become apparent to those skilled in the art. Any modification, equivalent replacement, or improvement made within the spirit and principle of the present invention should be included in the scope of the claims of the present invention.

Claims (10)

1. A grid map segmentation method based on a graph is characterized by comprising the following steps:
s1, initializing parameters, including: initial cluster center number K0The minimum number of samples N contained in each class0The merging coefficient theta0Threshold value sigma of degree of dispersion of cluster samples0Maximum iteration number N of clustering algorithmmaxThreshold value of connectivity thetac
S2, map preprocessing is carried out after the grid map is read, and image data of the grid map are normalized to obtain a cluster data set D formed by free areas;
s3, clustering the D in the step S2 by adopting an iterative self-organizing data analysis algorithm combined with a ray casting algorithm according to the initialization parameters in the step S1;
s4, establishing an undirected graph according to the clustering result of the step S3;
s5, calculating the degrees of all nodes in the undirected graph, and dividing isolated regions according to the degrees of the nodes;
s6, constructing a connected graph for all the non-isolated nodes to obtain a segmentation area set to be optimized;
and S7, calculating connectivity between the nodes of the connected graph and all the nodes in each partition area to be optimized, optimizing the partition areas to be optimized according to the calculated connectivity to obtain the partition areas, and obtaining a grid map partition result according to the partition areas and the isolated areas.
2. The method for grid map segmentation based on map according to claim 1, wherein step S2 specifically includes: the gray value of the occupied grid is 0, the gray value of the undetected grid is 204, and the gray value of the idle grid is 254; cutting an undetected area of the edge of the grid map; carrying out denoising processing on the map by using median filtering to obtain a map I; and acquiring a free area from the map I to form a cluster data set D.
3. The method of claim 1, wherein the step S3 comprises the following sub-steps:
s31, randomly generating K0An initial cluster center, denoted as
Figure FDA0002684724420000011
And each cluster center c is expressed by pixel coordinatesmAnd D;
s32, calculating the city block distance between each cluster sample in the step D and all cluster centers, and then distributing the cluster samples to corresponding classes;
s33, if the number of samples in a certain class is less than N0Reassigning the samples in the class to the closest class;
s34, recalculating the clustering centers of all the classes to obtain a current clustering center set;
s35, if the current clustering number K is less than K0Performing class splitting processing; if the current clustering number K is more than 2K0Executing class merging processing; otherwise, executing step S36;
s36, judging whether the maximum iteration number N is reachedmaxAnd if so, terminating the clustering algorithm to obtain a clustering result of the free area of the grid map, otherwise, returning to the step S32.
4. The graph-based grid map segmentation method according to claim 3, wherein the class splitting process is:
a1, respectively calculating Euclidean distances and standard deviations of all samples and class centers in each cluster under a two-dimensional coordinate to obtain the standard deviation of two dimensions corresponding to each cluster; note class C'mThe maximum of the two standard deviations is
Figure FDA0002684724420000021
A2, if
Figure FDA0002684724420000022
Exceeding a threshold value sigma0And the number of samples contained
Figure FDA0002684724420000023
Over 2N0Then a3 is executed; otherwise, executing S36;
a3, will be C'mSplitting into two categories, respectively calculating clustering centers of the two categories, and then calculating the class C'mDistance of sample in (1) to two cluster centers, class C'mThe sample in (1) is classified as the one closest to the sample.
5. The grid map segmentation method based on graph as claimed in claim 4, wherein the class merging process specifically comprises:
b1, calculating the distance l between the centers of every two classes;
b2, judging whether l is less than a threshold value theta0If yes, go to step B3; otherwise, executing step S39;
b3, will be C'm1And C'm2Merging into a new category, and calculating the center c 'of the new category'mnewI.e. by
Figure FDA0002684724420000024
Will be C'm1And C'm2All samples in (c ') are assigned to the new class center c'mnew
6. The method for grid map segmentation based on map as claimed in claim 5, wherein step S32 specifically comprises: when clustering sample snWith a certain cluster center cmThe distance between the two is minimum, and a cluster sample s is obtained through a ray casting algorithmnAnd a distance class center cmWhen passing through the free area only; will snIs assigned to cmCorresponding class CmPerforming the following steps; otherwise, s is used in all iterations before the last iterationnAssigning the class corresponding to the cluster center point with the closest distance, and assigning s in the last iterationnAnd (4) removing the noise points from the D.
7. The method of claim 6, wherein the step S6 specifically comprises the following steps:
s61, constructing a graph G ' ═ V ', E ', where the node of G ' is composed of all non-isolated nodes in the undirected graph, and the edge in G ' indicates that the two connected nodes are communicated;
s62, selecting a certain node in G' as an initial father node of breadth-first search; the method specifically comprises the following steps: degree d of a node in Gi' the highest frequency of occurrence among degrees of all nodes; and the node is nearest to the center of the read grid map; selecting the node as an initial father node of breadth-first search;
s63, using father node as starting point to search breadth first, if the searched node degree
Figure FDA0002684724420000031
If the degree of the node is less than that of the father node, the node and the father node are not in the same area; otherwise, classifying the node according to the leaf node and the bifurcation node; merging the father node with all the leaf node sets and the bifurcation node sets to obtain an initial segmentation area;
the degrees of the leaf nodes and the father nodes are equal, and the degree of the bifurcation node is greater than that of the father node;
s64, selecting a new parent node from G ', and returning to the step S63 until all nodes in G' are traversed, thereby obtaining an initial set of divided regions.
8. The graph-based grid map segmentation method according to claim 7, wherein the specific process of selecting a new parent node from G' is as follows:
when v 'is node'pjAnd when the following conditions are met, selecting the node as a new breadth-first search parent node:
condition 1: v'pjCommunicating with at least any one of the bifurcate nodes of the current parent node;
condition 2: v 'of all nodes in communication with any one of the diverging nodes of the current parent node'pjDegree d ofbiThe frequency of occurrence is highest;
condition 3: v 'of all nodes in communication with any one of the diverging nodes of the current parent node'pjDegree d ofbiAnd max.
9. The method of claim 8, wherein the step S7 specifically includes the following sub-steps:
s71, calculating the city block distance between every two nodes in G ', and dis (i, j) represents v'iAnd v'jThe distance of (d);
s72, calculating a weighted adjacency matrix W of G';
s73, calculating the connectivity Con (v'i,Rk);
Wherein, v'iDenotes any node in G', RkRepresenting any initial segmented region in the initial segmented region set;
s74, if Con (v'i,Rk) Greater than 1, then v'iIs of the formula RkV 'will be'iAnd RkMerging; otherwise, v'iNot being part of Rk(ii) a When all nodes of G' are traversed, obtaining a segmentation region R; according to R and isolated region RIAnd obtaining a grid map segmentation result.
10. The grid map segmentation method based on graph as claimed in claim 9, wherein the adjacency matrix is specifically: v 'is judged'iAnd v'jIf yes, making side e'ijW (i, j) ═ Wi,jDis (i, j); otherwise, W (i, j) ═ Wi,j=0。
CN201810823381.1A 2018-07-25 2018-07-25 Grid map segmentation method based on map Active CN108898605B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201810823381.1A CN108898605B (en) 2018-07-25 2018-07-25 Grid map segmentation method based on map

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810823381.1A CN108898605B (en) 2018-07-25 2018-07-25 Grid map segmentation method based on map

Publications (2)

Publication Number Publication Date
CN108898605A CN108898605A (en) 2018-11-27
CN108898605B true CN108898605B (en) 2021-01-05

Family

ID=64352570

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810823381.1A Active CN108898605B (en) 2018-07-25 2018-07-25 Grid map segmentation method based on map

Country Status (1)

Country Link
CN (1) CN108898605B (en)

Families Citing this family (14)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110335282B (en) * 2018-12-25 2023-04-18 广州启明星机器人有限公司 Contour line segment feature extraction method based on grids
CN109541634B (en) * 2018-12-28 2023-01-17 歌尔股份有限公司 Path planning method and device and mobile device
CN110222761B (en) * 2019-05-31 2023-01-17 中国民航大学 Indoor positioning system and indoor positioning method based on digital landmark map
CN111708357B (en) * 2019-09-17 2023-07-18 深圳银星智能集团股份有限公司 Cleaning end condition identification method and device and sweeping robot
CN110716568A (en) * 2019-10-30 2020-01-21 深圳市银星智能科技股份有限公司 Camera shooting control system and method and mobile robot
CN110702120A (en) * 2019-11-06 2020-01-17 小狗电器互联网科技(北京)股份有限公司 Map boundary processing method, system, robot and storage medium
CN111144228B (en) * 2019-12-05 2023-09-12 超越科技股份有限公司 Obstacle identification method based on 3D point cloud data and computer equipment
CN110956161B (en) * 2019-12-17 2024-05-10 中新智擎科技有限公司 Autonomous mapping method and device and intelligent robot
CN111681246B (en) * 2020-04-27 2024-01-23 珠海一微半导体股份有限公司 Region segmentation method of laser map
CN111681250B (en) * 2020-05-16 2023-04-07 珠海一微半导体股份有限公司 Segmentation method based on laser grid map
CN113749585B (en) * 2020-05-28 2022-10-21 宁波方太厨具有限公司 Semantic-based self-adaptive sweeping method for sweeping robot
CN113160235B (en) * 2021-05-31 2024-06-11 南通大学 Room segmentation method based on internal circle and adjacency graph
CN113483749B (en) * 2021-07-06 2024-06-18 京东城市(北京)数字科技有限公司 Road network construction method and device, navigation equipment and robot
CN115373399A (en) * 2022-09-13 2022-11-22 中国安全生产科学研究院 Ground robot path planning method based on air-ground cooperation

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8577538B2 (en) * 2006-07-14 2013-11-05 Irobot Corporation Method and system for controlling a remote vehicle
US20080209480A1 (en) * 2006-12-20 2008-08-28 Eide Kurt S Method for enhanced video programming system for integrating internet data for on-demand interactive retrieval
CN104898660B (en) * 2015-03-27 2017-10-03 中国科学技术大学 A kind of indoor map construction method for improving robot path planning's efficiency
CN107833230B (en) * 2017-11-09 2020-08-11 北京进化者机器人科技有限公司 Generation method and device of indoor environment map
CN107817802B (en) * 2017-11-09 2021-08-20 北京进化者机器人科技有限公司 Construction method and device of hybrid double-layer map

Also Published As

Publication number Publication date
CN108898605A (en) 2018-11-27

Similar Documents

Publication Publication Date Title
CN108898605B (en) Grid map segmentation method based on map
US11816907B2 (en) Systems and methods for extracting information about objects from scene information
CN111091105B (en) Remote sensing image target detection method based on new frame regression loss function
CN112288857A (en) Robot semantic map object recognition method based on deep learning
Ushani et al. A learning approach for real-time temporal scene flow estimation from lidar data
CN107292234B (en) Indoor scene layout estimation method based on information edge and multi-modal features
Zhu et al. Segmentation and classification of range image from an intelligent vehicle in urban environment
Zivkovic et al. Hierarchical map building and planning based on graph partitioning
CN103258203B (en) The center line of road extraction method of remote sensing image
CN111986322B (en) Point cloud indoor scene layout reconstruction method based on structural analysis
Xu et al. Unsupervised segmentation of point clouds from buildings using hierarchical clustering based on gestalt principles
Posner et al. A generative framework for fast urban labeling using spatial and temporal context
Poux et al. Unsupervised segmentation of indoor 3D point cloud: Application to object-based classification
Song et al. Classifying 3D objects in LiDAR point clouds with a back-propagation neural network
CN110807774B (en) Point cloud classification and semantic segmentation method
Ranganathan et al. Visual place categorization in maps
Yang et al. Automated semantics and topology representation of residential-building space using floor-plan raster maps
Mehranfar et al. A hybrid top-down, bottom-up approach for 3D space parsing using dense RGB point clouds
CN112987720A (en) Multi-scale map construction method and construction device for mobile robot
Rituerto et al. Label propagation in videos indoors with an incremental non-parametric model update
Luperto et al. Completing robot maps by predicting the layout of rooms behind closed doors
Luo et al. Real-Time Hierarchical Map Segmentation for Coordinating Multirobot Exploration
Chen et al. DORF: A dynamic object removal framework for robust static LiDAR mapping in urban environments
Wigness et al. Reducing adaptation latency for multi-concept visual perception in outdoor environments
Kaleci et al. Plane segmentation of point cloud data using split and merge based method

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant