CN106292673A - A kind of method for optimizing route and system - Google Patents
A kind of method for optimizing route and system Download PDFInfo
- Publication number
- CN106292673A CN106292673A CN201610863868.3A CN201610863868A CN106292673A CN 106292673 A CN106292673 A CN 106292673A CN 201610863868 A CN201610863868 A CN 201610863868A CN 106292673 A CN106292673 A CN 106292673A
- Authority
- CN
- China
- Prior art keywords
- path
- image
- summit
- barrier
- subpath
- 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.)
- Granted
Links
- 238000000034 method Methods 0.000 title claims abstract description 29
- 238000012545 processing Methods 0.000 claims abstract description 16
- 230000009466 transformation Effects 0.000 claims abstract description 14
- 238000005457 optimization Methods 0.000 claims abstract description 13
- 230000035772 mutation Effects 0.000 claims abstract description 9
- 238000001914 filtration Methods 0.000 claims description 6
- 238000003708 edge detection Methods 0.000 claims description 5
- 238000003702 image correction Methods 0.000 claims description 3
- 230000004888 barrier function Effects 0.000 claims 18
- 238000001514 detection method Methods 0.000 claims 3
- 239000003550 marker Substances 0.000 claims 2
- 230000000452 restraining effect Effects 0.000 claims 2
- 230000008649 adaptation response Effects 0.000 claims 1
- 230000008569 process Effects 0.000 abstract description 3
- 108090000623 proteins and genes Proteins 0.000 description 14
- 238000012937 correction Methods 0.000 description 4
- 230000000694 effects Effects 0.000 description 3
- 238000010521 absorption reaction Methods 0.000 description 2
- 238000000149 argon plasma sintering Methods 0.000 description 2
- 230000005540 biological transmission Effects 0.000 description 2
- 238000010586 diagram Methods 0.000 description 2
- 230000000877 morphologic effect Effects 0.000 description 2
- 238000011160 research Methods 0.000 description 2
- 230000001629 suppression Effects 0.000 description 2
- 230000000007 visual effect Effects 0.000 description 2
- 230000007613 environmental effect Effects 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
Classifications
-
- G—PHYSICS
- G05—CONTROLLING; REGULATING
- G05D—SYSTEMS FOR CONTROLLING OR REGULATING NON-ELECTRIC VARIABLES
- G05D1/00—Control of position, course, altitude or attitude of land, water, air or space vehicles, e.g. using automatic pilots
- G05D1/02—Control of position or course in two dimensions
- G05D1/021—Control of position or course in two dimensions specially adapted to land vehicles
- G05D1/0212—Control of position or course in two dimensions specially adapted to land vehicles with means for defining a desired trajectory
- G05D1/0217—Control of position or course in two dimensions specially adapted to land vehicles with means for defining a desired trajectory in accordance with energy consumption, time reduction or distance reduction criteria
Landscapes
- Engineering & Computer Science (AREA)
- Aviation & Aerospace Engineering (AREA)
- Radar, Positioning & Navigation (AREA)
- Remote Sensing (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Automation & Control Theory (AREA)
- Management, Administration, Business Operations System, And Electronic Commerce (AREA)
- Image Analysis (AREA)
Abstract
本发明适用计算机技术领域,提供了一种路径优化方法及系统,该方法包括:利用多项式变换对图像进行校正后,对图像中障碍物的边缘进行检测;对所述障碍物的顶点进行标记,并通过选取所述障碍物的顶点形成第一路径;对所述第一路径依次通过交叉以及变异操作,形成第二路径;按照预设顶点数量,在所述第二路径中选取子路径,并判断所述子路径中的起点与终点之间能否直达,以确定优化路径。本发明通过对图像进行处理,使得图像中障碍物的轮廓更加清晰,以便于提高路径规划的精确度,在全局路径规划的基础上,依次对子路径进行处理,进一步地提高路径规划的精确度,提高机器人的工作效率。
The present invention is applicable to the field of computer technology, and provides a path optimization method and system. The method includes: after correcting the image by polynomial transformation, detecting the edge of the obstacle in the image; marking the vertex of the obstacle, and forming a first path by selecting vertices of the obstacle; sequentially performing crossover and mutation operations on the first path to form a second path; selecting a sub-path in the second path according to the preset number of vertices, and Judging whether the start point and the end point in the sub-path are directly accessible, so as to determine the optimal path. The present invention makes the outline of obstacles in the image clearer by processing the image, so as to improve the accuracy of path planning, and sequentially processes the sub-paths on the basis of global path planning, further improving the accuracy of path planning , improve the work efficiency of the robot.
Description
技术领域technical field
本发明属于计算机技术领域,尤其涉及一种路径优化方法及系统。The invention belongs to the technical field of computers, and in particular relates to a path optimization method and system.
背景技术Background technique
路径规划是智能机器人导航技术中不可缺少的重要组成部分,也是现阶段智能机器人研究的主要研究方向,良好的路径规划可以节省机器人大量的作业时间以及减少机器人的损耗,尤其是在灾后救援领域发挥更为重要的作用。影响路径规划有两个方面:一个是从空中拍摄图像,由于受限于环境和技术,拍摄的角度不能完全垂直于地面,因此拍摄角度对地面的障碍物的轮廓有着很大的影响,容易引起误判,从而影响规划效果;另一个是采用全局路径规划方法是在环境信息全部已知的情况下,通过全局路径规划找到优选地的路径,计算量太大,实时性欠佳。Path planning is an indispensable and important part of intelligent robot navigation technology, and it is also the main research direction of intelligent robot research at this stage. Good path planning can save a lot of working time and reduce the loss of robots, especially in the field of post-disaster rescue. more important role. There are two aspects that affect path planning: one is to shoot images from the air. Due to the limited environment and technology, the shooting angle cannot be completely perpendicular to the ground, so the shooting angle has a great influence on the outline of obstacles on the ground, which is easy to cause Misjudgment, thus affecting the planning effect; the other is to use the global path planning method to find the optimal path through the global path planning when all the environmental information is known, the calculation amount is too large, and the real-time performance is not good.
发明内容Contents of the invention
本发明的目的在于提供一种路径优化方法及系统,旨在解决现有技术中路径规划受限于图像质量与数据计算量,导致无法在短时间找到更加优化的路径。The purpose of the present invention is to provide a path optimization method and system, aiming at solving the limitation of image quality and data calculation amount in path planning in the prior art, which makes it impossible to find a more optimized path in a short time.
一方面,本发明提供了一种路径优化方法,所述方法包括下述步骤:On the one hand, the present invention provides a kind of path optimization method, described method comprises the following steps:
利用多项式变换对图像进行校正后,对图像中障碍物的边缘进行检测;After the image is corrected by polynomial transformation, the edge of the obstacle in the image is detected;
对所述障碍物的顶点进行标记,并通过选取所述障碍物的顶点形成第一路径;marking the vertices of the obstacle, and forming a first path by selecting the vertices of the obstacle;
对所述第一路径依次通过交叉以及变异操作,形成第二路径;sequentially performing crossover and mutation operations on the first path to form a second path;
按照预设顶点数量,在所述第二路径中选取子路径,并判断所述子路径中的起点与终点之间能否直达,以确定优化路径。Selecting a sub-path in the second path according to the preset number of vertices, and judging whether the start point and the end point in the sub-path are directly accessible, so as to determine an optimized path.
另一方面,本发明提供了一种路径优化系统,所述系统包括:In another aspect, the present invention provides a path optimization system, the system comprising:
图像处理单元,用于利用多项式变换对图像进行校正后,对图像中障碍物的边缘进行检测;The image processing unit is used to detect the edge of the obstacle in the image after correcting the image by polynomial transformation;
第一路径形成单元,用于对所述障碍物的顶点进行标记,并通过选取所述障碍物的顶点形成第一路径;a first path forming unit, configured to mark vertices of the obstacles, and form a first path by selecting vertices of the obstacles;
第二路径形成单元,用于对所述第一路径依次通过交叉以及变异操作,形成第二路径;以及The second path forming unit is configured to sequentially perform crossover and mutation operations on the first path to form a second path; and
路径优化单元,用于按照预设顶点数量,在所述第二路径中选取子路径,并判断所述子路径中的起点与终点之间能否直达,以确定优化路径。The path optimization unit is configured to select a sub-path in the second path according to the preset number of vertices, and determine whether the start point and the end point in the sub-path are directly accessible, so as to determine an optimized path.
本发明实施例通过对图像进行处理,使得图像中障碍物的轮廓更加清晰,以便于提高路径规划的精确度,在全局路径规划的基础上,依次对子路径进行处理,进一步地提高路径规划的精确度,提高机器人的工作效率。In the embodiment of the present invention, by processing the image, the outline of obstacles in the image is clearer, so as to improve the accuracy of path planning. Accuracy, improve the work efficiency of the robot.
附图说明Description of drawings
图1是本发明实施例一提供的路径优化方法的实现流程图;以及FIG. 1 is an implementation flowchart of a path optimization method provided in Embodiment 1 of the present invention; and
图2是本发明实施例二提供的路径优化系统的结构示意图;FIG. 2 is a schematic structural diagram of a path optimization system provided by Embodiment 2 of the present invention;
具体实施方式detailed description
为了使本发明的目的、技术方案及优点更加清楚明白,以下结合附图及实施例,对本发明进行进一步详细说明。应当理解,此处所描述的具体实施例仅仅用以解释本发明,并不用于限定本发明。In order to make the object, technical solution and advantages of the present invention clearer, the present invention will be further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described here are only used to explain the present invention, not to limit the present invention.
以下结合具体实施例对本发明的具体实现进行详细描述:The specific realization of the present invention is described in detail below in conjunction with specific embodiment:
实施例一:Embodiment one:
图1示出了本发明实施例一提供的路径优化方法的实现流程图,为了便于说明,仅示出了与本发明实施例相关的部分,详述如下:Fig. 1 shows the implementation flow chart of the path optimization method provided by Embodiment 1 of the present invention. For the convenience of description, only the parts related to the embodiment of the present invention are shown, and the details are as follows:
在步骤S101中,利用多项式变换对图像进行校正后,对图像中障碍物的边缘进行检测。In step S101, after the image is corrected by polynomial transformation, the edge of the obstacle in the image is detected.
在本发明实施例中,图像在生成、传输、处理、发送和接收等过程时,不可避免的会受到各种噪声的干扰和影响,比如在大气环境中,由于光线在空气中会产生散射和吸收,使得图像的有些地方可能产生灰白效应,导致图像的对比度下降严重,有时甚至会影响图像的视觉效果而无法进行下一步处理。因此,首先对空中机器人采集的图像进行预处理,优选地,可以采用的去噪方法是中值滤波法和形态学去噪。对去噪后的图像进行校正,利用坐标间的多项式变换来近似表示这种非线性的畸变,并选取一些控制点来消除畸变。In the embodiment of the present invention, images will inevitably be disturbed and affected by various noises during the process of generation, transmission, processing, sending and receiving. For example, in an atmospheric environment, due to light scattering and Absorption may cause some parts of the image to have a gray effect, resulting in a serious decrease in the contrast of the image, and sometimes even affect the visual effect of the image and cannot be processed in the next step. Therefore, firstly, the image collected by the aerial robot is preprocessed. Preferably, the denoising methods that can be used are median filtering and morphological denoising. Correct the image after denoising, use the polynomial transformation between coordinates to approximate the nonlinear distortion, and select some control points to eliminate the distortion.
具体地,对于图像上的点(x,y),利用多项式变换得到校正后的点(f,g),式1如下:Specifically, for a point (x, y) on the image, use polynomial transformation to obtain the corrected point (f, g), Equation 1 is as follows:
其中,aij,bij为多项式的系数,n为次数,利用已知的控制点进行求解。Among them, a ij and b ij are the coefficients of the polynomial, n is the degree, and the known control points are used to solve the problem.
如果控制点数目与方程组中未知数的数目相同,则可以直接求解方程组;而在一般的图像畸变校正处理中,为了获得较高的校正准确度,控制点数目会多于方程组中未知数的数目,通过求误差平方和最小准则下的最优近似解,具体做法如下:If the number of control points is the same as the number of unknowns in the equations, the equations can be solved directly; while in general image distortion correction processing, in order to obtain higher correction accuracy, the number of control points will be more than the number of unknowns in the equations Number, by seeking the optimal approximate solution under the minimum criterion of the sum of squared errors, the specific method is as follows:
对L个控制点,用多项式拟合后的误差平方和最小,即:For L control points, the sum of squared errors after polynomial fitting is the smallest, namely:
则有:Then there are:
可以得到,式2:It can be obtained, formula 2:
同理有,式3:Similarly, formula 3:
上述式子中L为控制点的个数,s=0,1,2,…,n;t=0,1,2,…,n-s;s+t≤n。In the above formula, L is the number of control points, s=0,1,2,...,n; t=0,1,2,...,n-s; s+t≤n.
在式2和式3中都包含(n+1)(n+2)/2,则可组成线性方程组,解出aij以及bij,带入式1便可求出校正后的点(f,g)。Both formula 2 and formula 3 contain (n+1)(n+2)/2, then a system of linear equations can be formed, and a ij and b ij can be solved, and put into formula 1 to obtain the corrected point ( f, g).
校正准确度与所用校正多项式次数n有关,多项式次数越高,拟合误差越小,但是随着n增加,系数数目增加,导致计算量急剧增加,对一般的非线性失真,通常采用三次多项式进行拟合,方法比较简单有效,且准确度较高,此时式1可写为:The correction accuracy is related to the degree n of the correction polynomial used. The higher the polynomial degree, the smaller the fitting error, but as n increases, the number of coefficients increases, resulting in a sharp increase in the amount of calculation. For general nonlinear distortion, cubic polynomials are usually used. Fitting, the method is relatively simple and effective, and the accuracy is high. At this time, formula 1 can be written as:
进一步地,对图像中障碍物的边缘进行检测包括:Further, detecting the edge of the obstacle in the image includes:
利用中值滤波法对所述图形进行去噪处理,除去所述图像中的噪声以及保留边缘信息;performing denoising processing on the graphics by using a median filtering method, removing noise in the image and retaining edge information;
对所述图像中每个像素点计算梯度值,分别对x方向和y方向做卷积运算,公式如下:The gradient value is calculated for each pixel in the image, and the convolution operation is performed on the x direction and the y direction respectively, and the formula is as follows:
可以计算得到: Can be calculated to get:
对所述梯度值进行非极大抑制;performing non-maximum suppression on the gradient value;
根据高阈值以及低阈值进行边缘检测,并对边缘进行连接,所述高阈值设定为所述低阈值的三倍。Edge detection is performed according to a high threshold and a low threshold, and edges are connected, and the high threshold is set to be three times the low threshold.
在步骤S102中,对障碍物的顶点进行标记,并通过选取障碍物的顶点形成第一路径。In step S102, the vertices of the obstacles are marked, and the first path is formed by selecting the vertices of the obstacles.
在本发明实施例中,将图像中的障碍物标记为Gn以及障碍物的顶点标记为Mmun,其中,Gn表示障碍物的编号,依次标记为:G0,G1,G2…Gn,Mmun表示障碍物中顶点的编号;根据所确定的起点以及终点,获取从起点到终点的所有路径,路径由障碍物的顶点组成;从路径中选取第一路径,路径被选中的概率为:In the embodiment of the present invention, the obstacles in the image are marked as G n and the vertices of the obstacles are marked as M mun , where G n represents the number of the obstacle, which are marked as: G 0 , G 1 , G 2 ... G n , M mun represent the number of vertices in the obstacle; according to the determined starting point and end point, obtain all paths from the starting point to the end point, the path is composed of the vertices of the obstacle; select the first path from the path, the path is selected The probability is:
其中,pi表示路径i被选中的概率,fi表示路径i的自适应度,N表示所有路径的总数。Among them, p i represents the probability that path i is selected, fi represents the adaptability of path i, and N represents the total number of all paths.
将路径作为种群,路径作为个体,路径中从起点到终点经过的每个顶点作为基因,从种群中选择出优良的个体,并淘汰掉不良的基因,从路径中选取第一路径的目的是把性能好的个体直接遗传给下一代。种群中个体被选中的概率与其适应度的大小成正比,若种群的大小为N,其中一个个体i的适应度为fi,适应度函数是取一个较大的值Smax减去路径长度S,路径长度S越大,适应度f越小;路径长度S越小,适应度f越大,根据适应度函数,适应度越小(路径越长)的个体被淘汰的概率越大,适应度越大(路径越短)的个体被淘汰的概率越小。用公式表示如下:Take the path as a population, the path as an individual, and each vertex in the path from the starting point to the end point as a gene, select good individuals from the population, and eliminate bad genes. The purpose of selecting the first path from the path is to Individuals with good performance are directly passed on to the next generation. The probability of an individual being selected in the population is proportional to its fitness. If the size of the population is N, the fitness of an individual i is f i , and the fitness function is to take a larger value S max minus the path length S , the greater the path length S, the smaller the fitness f; the smaller the path length S, the greater the fitness f, according to the fitness function, the smaller the fitness (the longer the path), the greater the probability of being eliminated, and the fitness The larger (shorter the path) individuals are less likely to be eliminated. The formula is as follows:
f=Smax-Sf=S max -S
其中的S表示的从起始点到当前个体之间经过的路径总长,而Smax则远大于S。从上述公式可见,当前点的到起始点之间的路径越短,适应度越大,选中进入下一代的概率与适应度成正比。Among them, S represents the total length of the path from the starting point to the current individual, and S max is much larger than S. It can be seen from the above formula that the shorter the path from the current point to the starting point, the greater the fitness, and the probability of being selected to enter the next generation is proportional to the fitness.
在步骤S103中,对第一路径依次通过交叉以及变异操作,形成第二路径。In step S103, a second path is formed by performing crossover and mutation operations on the first path in sequence.
在本发明实施例中,交叉操作是将种群中的两个父代个体的部分基因进行重组,生成新两个新的个体,在进行个体选择时是选取一个较小的概率pa,再随机选取一个概率数pb,当pb>pa时,则被选中进入交叉池中,等待进行交叉操作,例如:可以选择pa=0.2,而pb在(0,1)中随机选择一个数,这样选择的数大于0.2的概率就会比较大,可以保证大多数的个体都进行了交叉操作,进行交叉的个体越多,种群中基因的多样性就越大,越能够产生优良的基因。In the embodiment of the present invention, the crossover operation is to recombine part of the genes of the two parent individuals in the population to generate two new individuals. When selecting individuals, a small probability p a is selected, and then randomly Select a probability number p b , when p b >p a , it will be selected to enter the crossover pool, waiting for the crossover operation, for example: you can choose p a =0.2, and p b randomly selects one in (0,1) In this way, the probability that the selected number is greater than 0.2 will be relatively high, which can ensure that most individuals have carried out the crossover operation. The more individuals who perform crossover, the greater the diversity of genes in the population, and the better the genes can be produced. .
变异操作是指通过随机改变个体中的某些基因来改变个体的特性,从而形成新的个体,虽然变异的个体并一定是优良基因,但这对增加种群的多样性有非常重要的作用,因为产生优良的个体的概率较小,所以这里选取的一个较小的概率对其进行变异。例如选取一个固定的概率pc=0.8,再随机选取(0,1)中的数pd,当pd>pc时,则当前选取的个体进行变异,这样种群中发生变异的个体相对较少,这样能够既保证不产生很多不良个体,又能够保证种群的多样性。The mutation operation refers to changing the characteristics of the individual by randomly changing some genes in the individual to form a new individual. Although the mutated individual is not necessarily a good gene, it plays a very important role in increasing the diversity of the population, because The probability of producing an excellent individual is small, so a small probability is selected here to mutate it. For example, select a fixed probability p c = 0.8, and then randomly select the number p d in (0,1). When p d > p c , the currently selected individual will mutate, so that the mutated individuals in the population are relatively small This can not only ensure that many bad individuals will not be produced, but also ensure the diversity of the population.
在步骤S104中,按照预设顶点数量,在第二路径中选取子路径,并判断子路径中的起点与终点之间能否直达,以确定优化路径。In step S104, according to the preset number of vertices, a sub-path is selected in the second path, and it is judged whether the start point and the end point in the sub-path are directly accessible, so as to determine an optimal path.
在本发明实施例中,计算所述图像中每个障碍物顶点的地势值;将所述第二路径从起点开始,按照预设顶点数量,依次选取子路径;计算所述子路径的长度,以及选出地势值介于子路径的起点的地势值以及终点的地势值之间的顶点的集合。In the embodiment of the present invention, the terrain value of each obstacle vertex in the image is calculated; the second path starts from the starting point, and the sub-paths are sequentially selected according to the preset number of vertices; the length of the sub-path is calculated, And select a set of vertices whose terrain value is between the terrain value of the starting point and the terrain value of the end point of the sub-path.
若所述子路径中的起点与终点之间能直达,则将起点和终点连接的直线路径确定为优化路径;若所述子路径中的起点与终点之间不能直达,则在所述顶点的集合中查找是否存在1个或2个顶点,使得经过所述1个或2个顶点的路径长度小于所述子路径的长度,若存在所述1个或2个顶点,则将经过所述1个或2个顶点的路径。If there is direct access between the starting point and the end point in the sub-path, then the straight line path connecting the starting point and the end point is determined as an optimized path; Find whether there are 1 or 2 vertices in the set, so that the length of the path passing through the 1 or 2 vertices is less than the length of the sub-path, if there are 1 or 2 vertices, it will pass through the 1 A path with 1 or 2 vertices.
本发明实施例通过对图像进行处理,使得图像中障碍物的轮廓更加清晰,以便于提高路径规划的精确度,在全局路径规划的基础上,依次对子路径进行处理,进一步地提高路径规划的精确度,提高机器人的工作效率。In the embodiment of the present invention, by processing the image, the outline of obstacles in the image is clearer, so as to improve the accuracy of path planning. Accuracy, improve the work efficiency of the robot.
实施例二:Embodiment two:
图2示出了本发明实施例二提供的路径优化系统的结构示意图,为了便于说明,仅示出了与本发明实施例相关的部分。该路径优化系统包括:图像处理单元21、第一路径形成单元22、第二路径形成单元23以及路径优化单元24,其中:FIG. 2 shows a schematic structural diagram of a path optimization system provided by Embodiment 2 of the present invention. For ease of description, only parts related to the embodiment of the present invention are shown. The route optimization system includes: an image processing unit 21, a first route forming unit 22, a second route forming unit 23 and a route optimizing unit 24, wherein:
图像处理单元21,用于利用多项式变换对图像进行校正后,对图像中障碍物的边缘进行检测。The image processing unit 21 is configured to use polynomial transformation to correct the image, and then detect the edge of the obstacle in the image.
在本发明实施例中,图像在生成、传输、处理、发送和接收等过程时,不可避免的会受到各种噪声的干扰和影响,比如在大气环境中,由于光线在空气中会产生散射和吸收,使得图像的有些地方可能产生灰白效应,导致图像的对比度下降严重,有时甚至会影响图像的视觉效果而无法进行下一步处理。因此,首先对空中机器人采集的图像进行预处理,优选地,可以采用的去噪方法是中值滤波法和形态学去噪。对去噪后的图像进行校正,利用坐标间的多项式变换来近似表示这种非线性的畸变,并选取一些控制点来消除畸变。In the embodiment of the present invention, images will inevitably be disturbed and affected by various noises during the process of generation, transmission, processing, sending and receiving. For example, in an atmospheric environment, due to light scattering and Absorption may cause some parts of the image to have a gray effect, resulting in a serious decrease in the contrast of the image, and sometimes even affect the visual effect of the image and cannot be processed in the next step. Therefore, firstly, the image collected by the aerial robot is preprocessed. Preferably, the denoising methods that can be used are median filtering and morphological denoising. Correct the image after denoising, use the polynomial transformation between coordinates to approximate the nonlinear distortion, and select some control points to eliminate the distortion.
具体地,图像处理单元21包括:图像校正单元以及边缘检测单元,其中:Specifically, the image processing unit 21 includes: an image correction unit and an edge detection unit, wherein:
图像校正单元,用于对于所述图像上的点(x,y),利用多项式变换得到校正后的点(f,g)。The image correction unit is configured to use polynomial transformation to obtain corrected points (f, g) for the points (x, y) on the image.
边缘检测单元,具体用于:An edge detection unit, specifically for:
利用中值滤波法对所述图形进行去噪处理,除去所述图像中的噪声以及保留边缘信息;performing denoising processing on the graphics by using a median filtering method, removing noise in the image and retaining edge information;
对所述图像中每个像素点计算梯度值,分别对x方向和y方向做卷积运算;Calculate the gradient value for each pixel in the image, and perform convolution operations on the x direction and the y direction respectively;
对所述梯度值进行非极大抑制;performing non-maximum suppression on the gradient value;
根据高阈值以及低阈值进行边缘检测,并对边缘进行连接,所述高阈值设定为所述低阈值的三倍。Edge detection is performed according to a high threshold and a low threshold, and edges are connected, and the high threshold is set to be three times the low threshold.
第一路径形成单元22,用于对障碍物的顶点进行标记,并通过选取障碍物的顶点形成第一路径。The first path forming unit 22 is configured to mark the vertices of the obstacles, and form the first path by selecting the vertices of the obstacles.
第一路径形成单元包括:The first path forming unit includes:
标记单元,用于将所述图像中的障碍物标记为Gn以及所述障碍物的顶点标记为Mmun,其中,Gn表示所述障碍物的编号,依次标记为:G0,G1,G2…Gn,Mmun表示所述障碍物中顶点的编号;A marking unit, configured to mark the obstacle in the image as G n and the vertex of the obstacle as M mun , where G n represents the number of the obstacle, which are marked as: G 0 , G 1 in turn ,G 2 ...G n , M mun represents the number of vertices in the obstacle;
路径形成单元,用于根据所确定的起点以及终点,获取从起点到终点的所有路径,所述路径由所述障碍物的顶点组成;a path forming unit, configured to obtain all paths from the starting point to the ending point according to the determined starting point and the ending point, the paths are composed of vertices of the obstacles;
第一路径形成子单元,用于从所述路径中选取第一路径。The first path forms a subunit for selecting the first path from the paths.
在本发明实施例中,将图像中的障碍物标记为Gn以及障碍物的顶点标记为Mmun,其中,Gn表示障碍物的编号,依次标记为:G0,G1,G2…Gn,Mmun表示障碍物中顶点的编号;根据所确定的起点以及终点,获取从起点到终点的所有路径,路径由障碍物的顶点组成;从路径中选取第一路径,路径被选中的概率为:In the embodiment of the present invention, the obstacles in the image are marked as G n and the vertices of the obstacles are marked as M mun , where G n represents the number of the obstacle, which are marked as: G 0 , G 1 , G 2 ... G n , M mun represent the number of vertices in the obstacle; according to the determined starting point and end point, obtain all paths from the starting point to the end point, the path is composed of the vertices of the obstacle; select the first path from the path, the path is selected The probability is:
其中,pi表示路径i被选中的概率,fi表示路径i的自适应度,N表示所有路径的总数。Among them, p i represents the probability that path i is selected, fi represents the adaptability of path i, and N represents the total number of all paths.
将路径作为种群,路径作为个体,路径中从起点到终点经过的每个顶点作为基因,从种群中选择出优良的个体,并淘汰掉不良的基因,从路径中选取第一路径的目的是把性能好的个体直接遗传给下一代。种群中个体被选中的概率与其适应度的大小成正比,若种群的大小为N,其中一个个体i的适应度为fi,适应度函数是取一个较大的值Smax减去路径长度S,路径长度S越大,适应度f越小;路径长度S越小,适应度f越大,根据适应度函数,适应度越小(路径越长)的个体被淘汰的概率越大,适应度越大(路径越短)的个体被淘汰的概率越小。用公式表示如下:Take the path as a population, the path as an individual, and each vertex in the path from the starting point to the end point as a gene, select good individuals from the population, and eliminate bad genes. The purpose of selecting the first path from the path is to Individuals with good performance are directly passed on to the next generation. The probability of an individual being selected in the population is proportional to its fitness. If the size of the population is N, the fitness of an individual i is f i , and the fitness function is to take a larger value S max minus the path length S , the greater the path length S, the smaller the fitness f; the smaller the path length S, the greater the fitness f, according to the fitness function, the smaller the fitness (the longer the path), the greater the probability of being eliminated, and the fitness The larger (shorter the path) individuals are less likely to be eliminated. The formula is as follows:
f=Smax-Sf=S max -S
其中的S表示的从起始点到当前个体之间经过的路径总长,而Smax则远大于S。从上述公式可见,当前点的到起始点之间的路径越短,适应度越大,选中进入下一代的概率与适应度成正比。Among them, S represents the total length of the path from the starting point to the current individual, and S max is much larger than S. It can be seen from the above formula that the shorter the path from the current point to the starting point, the greater the fitness, and the probability of being selected to enter the next generation is proportional to the fitness.
第二路径形成单元23,用于对第一路径依次通过交叉以及变异操作,形成第二路径。The second path forming unit 23 is configured to sequentially perform crossover and mutation operations on the first path to form a second path.
在本发明实施例中,交叉操作是将种群中的两个父代个体的部分基因进行重组,生成新两个新的个体,在进行个体选择时是选取一个较小的概率pa,再随机选取一个概率数pb,当pb>pa时,则被选中进入交叉池中,等待进行交叉操作,例如:可以选择pa=0.2,而pb在(0,1)中随机选择一个数,这样选择的数大于0.2的概率就会比较大,可以保证大多数的个体都进行了交叉操作,进行交叉的个体越多,种群中基因的多样性就越大,越能够产生优良的基因。In the embodiment of the present invention, the crossover operation is to recombine part of the genes of the two parent individuals in the population to generate two new individuals. When selecting individuals, a small probability p a is selected, and then randomly Select a probability number p b , when p b >p a , it will be selected to enter the crossover pool, waiting for the crossover operation, for example: you can choose p a =0.2, and p b randomly selects one in (0,1) In this way, the probability that the selected number is greater than 0.2 will be relatively high, which can ensure that most individuals have carried out the crossover operation. The more individuals who perform crossover, the greater the diversity of genes in the population, and the better the genes can be produced. .
变异操作是指通过随机改变个体中的某些基因来改变个体的特性,从而形成新的个体,虽然变异的个体并一定是优良基因,但这对增加种群的多样性有非常重要的作用,因为产生优良的个体的概率较小,所以这里选取的一个较小的概率对其进行变异。例如选取一个固定的概率pc=0.8,再随机选取(0,1)中的数pd,当pd>pc时,则当前选取的个体进行变异,这样种群中发生变异的个体相对较少,这样能够既保证不产生很多不良个体,又能够保证种群的多样性。The mutation operation refers to changing the characteristics of the individual by randomly changing some genes in the individual to form a new individual. Although the mutated individual is not necessarily a good gene, it plays a very important role in increasing the diversity of the population, because The probability of producing an excellent individual is small, so a small probability is selected here to mutate it. For example, select a fixed probability p c = 0.8, and then randomly select the number p d in (0,1). When p d > p c , the currently selected individual will mutate, so that the mutated individuals in the population are relatively small This can not only ensure that many bad individuals will not be produced, but also ensure the diversity of the population.
路径优化单元24,用于按照预设顶点数量,在第二路径中选取子路径,并判断子路径中的起点与终点之间能否直达,以确定优化路径。The path optimization unit 24 is configured to select a sub-path in the second path according to the preset number of vertices, and determine whether the start point and the end point in the sub-path are directly accessible, so as to determine the optimized path.
在本发明实施例中,计算所述图像中每个障碍物顶点的地势值;将所述第二路径从起点开始,按照预设顶点数量,依次选取子路径;计算所述子路径的长度,以及选出地势值介于子路径的起点的地势值以及终点的地势值之间的顶点的集合。In the embodiment of the present invention, the terrain value of each obstacle vertex in the image is calculated; the second path starts from the starting point, and the sub-paths are sequentially selected according to the preset number of vertices; the length of the sub-path is calculated, And select a set of vertices whose terrain value is between the terrain value of the starting point and the terrain value of the end point of the sub-path.
若所述子路径中的起点与终点之间能直达,则将起点和终点连接的直线路径确定为优化路径;若所述子路径中的起点与终点之间不能直达,则在所述顶点的集合中查找是否存在1个或2个顶点,使得经过所述1个或2个顶点的路径长度小于所述子路径的长度,若存在所述1个或2个顶点,则将经过所述1个或2个顶点的路径。If there is direct access between the starting point and the end point in the sub-path, then the straight line path connecting the starting point and the end point is determined as an optimized path; Find whether there are 1 or 2 vertices in the set, so that the length of the path passing through the 1 or 2 vertices is less than the length of the sub-path, if there are 1 or 2 vertices, it will pass through the 1 A path with 1 or 2 vertices.
本发明实施例通过对图像进行处理,使得图像中障碍物的轮廓更加清晰,以便于提高路径规划的精确度,在全局路径规划的基础上,依次对子路径进行处理,进一步地提高路径规划的精确度,提高机器人的工作效率。In the embodiment of the present invention, by processing the image, the outline of obstacles in the image is clearer, so as to improve the accuracy of path planning. Accuracy, improve the work efficiency of the robot.
在本发明实施例中,各单元可由相应的硬件或软件单元实现,各单元可以为独立的软、硬件单元,也可以集成为一个软、硬件单元,在此不用以限制本发明。In the embodiment of the present invention, each unit can be realized by corresponding hardware or software unit, and each unit can be an independent software and hardware unit, or can be integrated into one software and hardware unit, which is not used to limit the present invention.
以上所述仅为本发明的较佳实施例而已,并不用以限制本发明,凡在本发明的精神和原则之内所作的任何修改、等同替换和改进等,均应包含在本发明的保护范围之内。The above descriptions are only preferred embodiments of the present invention, and are not intended to limit the present invention. Any modifications, equivalent replacements and improvements made within the spirit and principles of the present invention should be included in the protection of the present invention. within range.
Claims (10)
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201610863868.3A CN106292673B (en) | 2016-09-29 | 2016-09-29 | A path optimization method and system |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201610863868.3A CN106292673B (en) | 2016-09-29 | 2016-09-29 | A path optimization method and system |
Publications (2)
Publication Number | Publication Date |
---|---|
CN106292673A true CN106292673A (en) | 2017-01-04 |
CN106292673B CN106292673B (en) | 2019-02-12 |
Family
ID=57715831
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201610863868.3A Active CN106292673B (en) | 2016-09-29 | 2016-09-29 | A path optimization method and system |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN106292673B (en) |
Cited By (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN109214596A (en) * | 2018-10-23 | 2019-01-15 | 厦门大学 | Seek the grid shortest path AFW algorithm with direction constraint and obstacle limitation |
CN109917794A (en) * | 2019-04-18 | 2019-06-21 | 北京智行者科技有限公司 | Global path planning method and device |
CN111060103A (en) * | 2019-12-11 | 2020-04-24 | 安徽工程大学 | A Path Planning Method for Local Dynamic Optimization and Obstacle Avoidance |
CN113238549A (en) * | 2021-03-31 | 2021-08-10 | 珠海市一微半导体有限公司 | Path planning method and chip for robot based on direct nodes and robot |
Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101026778A (en) * | 2007-03-14 | 2007-08-29 | 北京理工大学 | Distortion measurement and correction method for CCD shooting system and comprehensive test target |
CN102156970A (en) * | 2011-04-14 | 2011-08-17 | 复旦大学 | Fisheye image correction method based on distorted straight slope calculation |
CN102298779A (en) * | 2011-08-16 | 2011-12-28 | 淮安盈科伟力科技有限公司 | Image registering method for panoramic assisted parking system |
CN104407616A (en) * | 2014-12-03 | 2015-03-11 | 沈阳工业大学 | Dynamic path planning method for mobile robot based on immune network algorithm |
CN104516350A (en) * | 2013-09-26 | 2015-04-15 | 沈阳工业大学 | Mobile robot path planning method in complex environment |
CN106441275A (en) * | 2016-09-23 | 2017-02-22 | 深圳大学 | Method and device for updating planned path of robot |
-
2016
- 2016-09-29 CN CN201610863868.3A patent/CN106292673B/en active Active
Patent Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101026778A (en) * | 2007-03-14 | 2007-08-29 | 北京理工大学 | Distortion measurement and correction method for CCD shooting system and comprehensive test target |
CN102156970A (en) * | 2011-04-14 | 2011-08-17 | 复旦大学 | Fisheye image correction method based on distorted straight slope calculation |
CN102298779A (en) * | 2011-08-16 | 2011-12-28 | 淮安盈科伟力科技有限公司 | Image registering method for panoramic assisted parking system |
CN104516350A (en) * | 2013-09-26 | 2015-04-15 | 沈阳工业大学 | Mobile robot path planning method in complex environment |
CN104407616A (en) * | 2014-12-03 | 2015-03-11 | 沈阳工业大学 | Dynamic path planning method for mobile robot based on immune network algorithm |
CN106441275A (en) * | 2016-09-23 | 2017-02-22 | 深圳大学 | Method and device for updating planned path of robot |
Non-Patent Citations (6)
Title |
---|
DANESH.M 等: "Optimize path planning of a planar parallel robot to avoid obstacle collision using genetic algorithm", 《IRANIAN CONFERENCE ON INTELLIGENT SYSTEMS》 * |
JIANQIANG LI 等: "A Hybrid Path Planning Method in Unmanned Air/Ground Vehicle (UAV/UGV) Cooperative Systems", 《IEEE TRANSACTIONS ON VEHICULAR TECHNOLOGY》 * |
严宣辉 等: "基于定长实数路径编码机制的移动机器人路径规划", 《山东大学学报》 * |
刘馨 等: "基于粒子滤波器的移动机器人轨迹预测应用", 《PROCEEDINGS OF THE 27TH CHINESE CONTROL CONFERENCE》 * |
张胜祥 等: "基于滚动时域优化的无人飞行器轨迹规划", 《计算机工程与应用》 * |
曹成才 等: "基于几何法的移动机器人路径规划", 《计算机应用研究》 * |
Cited By (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN109214596A (en) * | 2018-10-23 | 2019-01-15 | 厦门大学 | Seek the grid shortest path AFW algorithm with direction constraint and obstacle limitation |
CN109214596B (en) * | 2018-10-23 | 2022-06-03 | 厦门大学 | Method for planning shortest path of grid with direction constraint and barrier limitation |
CN109917794A (en) * | 2019-04-18 | 2019-06-21 | 北京智行者科技有限公司 | Global path planning method and device |
CN109917794B (en) * | 2019-04-18 | 2022-02-18 | 北京智行者科技有限公司 | Global path planning method and device |
CN111060103A (en) * | 2019-12-11 | 2020-04-24 | 安徽工程大学 | A Path Planning Method for Local Dynamic Optimization and Obstacle Avoidance |
CN111060103B (en) * | 2019-12-11 | 2021-12-10 | 安徽工程大学 | A Path Planning Method for Local Dynamic Optimization and Obstacle Avoidance |
CN113238549A (en) * | 2021-03-31 | 2021-08-10 | 珠海市一微半导体有限公司 | Path planning method and chip for robot based on direct nodes and robot |
Also Published As
Publication number | Publication date |
---|---|
CN106292673B (en) | 2019-02-12 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US11878433B2 (en) | Method for detecting grasping position of robot in grasping object | |
KR102337376B1 (en) | Method and device for lane detection without post-processing by using lane mask, and testing method, and testing device using the same | |
KR102326256B1 (en) | Method for auto-labeling training images for use in deep learning network to analyze images with high precision, and auto-labeling device using the same | |
CN109447994B (en) | Remote Sensing Image Segmentation Method Combining Complete Residual and Feature Fusion | |
CN111126359B (en) | High-definition image small target detection method based on self-encoder and YOLO algorithm | |
US20210248378A1 (en) | Spatiotemporal action detection method | |
CN106292673A (en) | A kind of method for optimizing route and system | |
CN116994140A (en) | Cultivated land extraction method, device, equipment and medium based on remote sensing image | |
CN110879960B (en) | Method and computing device for generating image data set for convolutional neural network learning | |
JP2020123330A (en) | Method for acquiring sample image for label acceptance inspection from among auto-labeled images utilized for neural network learning, and sample image acquisition device utilizing the same | |
CN112417926A (en) | Parking space identification method, device, computer equipment and readable storage medium | |
CN104899892B (en) | A kind of quickly star map image asterism extracting method | |
CN103279931A (en) | Defogged image denoising method based on transmissivity | |
CN107766789A (en) | A kind of vehicle detection localization method based on vehicle-mounted monocular camera | |
CN113537017B (en) | Method and device for aircraft detection in optical remote sensing images based on cascade regression correction | |
WO2022111723A1 (en) | Road edge detection method and robot | |
CN115330777B (en) | Ship detection method and system for training picture scaling size | |
CN102867174B (en) | A kind of human face characteristic positioning method and device | |
CN109993108A (en) | A kind of gesture error correction method, system and device in augmented reality environment | |
CN112446353B (en) | Video image trace line detection method based on depth convolution neural network | |
CN112883807A (en) | Lane line detection method and system | |
CN118314563A (en) | Text detection method based on rotary frame | |
CN117789148A (en) | Lane line detection method, system, equipment and storage medium | |
CN110942008A (en) | Method and system for positioning waybill information based on deep learning | |
CN116543321A (en) | A road traffic marking detection method based on vectorized aerial images |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | Publication | ||
PB01 | Publication | ||
C10 | Entry into substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |