CN102324099B - Step edge detection method oriented to humanoid robot - Google Patents

Step edge detection method oriented to humanoid robot Download PDF

Info

Publication number
CN102324099B
CN102324099B CN 201110260352 CN201110260352A CN102324099B CN 102324099 B CN102324099 B CN 102324099B CN 201110260352 CN201110260352 CN 201110260352 CN 201110260352 A CN201110260352 A CN 201110260352A CN 102324099 B CN102324099 B CN 102324099B
Authority
CN
China
Prior art keywords
image
edge
gradient
detection method
edge detection
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.)
Expired - Fee Related
Application number
CN 201110260352
Other languages
Chinese (zh)
Other versions
CN102324099A (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.)
Guangdong University of Technology
Original Assignee
Guangdong University of Technology
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 Guangdong University of Technology filed Critical Guangdong University of Technology
Priority to CN 201110260352 priority Critical patent/CN102324099B/en
Publication of CN102324099A publication Critical patent/CN102324099A/en
Application granted granted Critical
Publication of CN102324099B publication Critical patent/CN102324099B/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Image Processing (AREA)

Abstract

本发明是一种面向仿人机器人的台阶边缘检测方法,包括如下步骤:1)对待检测的图像预处理;2)对图像进行判断;3)对图像进行形态学处理;4)处理图像得到向光台阶的边缘;5)求取阈值并将图像转化为二值图像从而得到背光台阶的边缘;6)用步骤5中的边缘线将步骤2中的图像进行分割,将灰度值高的部分进行灰度拉伸得到新的图像;7)根据步骤6中得到的新的图像经过梯度变换得到梯度图像;8)根据步骤6中得到的新的图像经过反色变换再进行梯度变换得到另一个梯度图像;9)将步骤7与步骤8中得到的两个梯度图像的相应像素点进行相加得到图像的边缘;10)将步骤5中的边缘与步骤9中的边缘融合在一幅图像里。本发明的边缘检测方法符合机器人视觉中的适时性和精确性的要求。

Figure 201110260352

The invention is a step edge detection method for a humanoid robot, comprising the following steps: 1) preprocessing the image to be detected; 2) judging the image; 3) performing morphological processing on the image; 4) processing the image to obtain The edge of the light step; 5) Calculate the threshold and convert the image into a binary image to obtain the edge of the backlight step; 6) Use the edge line in step 5 to segment the image in step 2, and divide the part with high gray value Perform grayscale stretching to obtain a new image; 7) According to the new image obtained in step 6, undergo gradient transformation to obtain a gradient image; 8) According to the new image obtained in step 6, perform inverse color transformation and then perform gradient transformation to obtain another Gradient image; 9) Add the corresponding pixels of the two gradient images obtained in step 7 and step 8 to obtain the edge of the image; 10) merge the edge in step 5 and the edge in step 9 into one image . The edge detection method of the invention meets the requirements of timeliness and accuracy in robot vision.

Figure 201110260352

Description

一种面向仿人机器人的台阶边缘检测方法A Step Edge Detection Method for Humanoid Robot

技术领域 technical field

本发明属于图像检测和分割技术领域,尤其涉及一种面向仿人机器人的台阶边缘检测方法。 The invention belongs to the technical field of image detection and segmentation, and in particular relates to a step edge detection method for humanoid robots.

背景技术 Background technique

机器人视觉技术主要研究用计算机来模拟人的视觉功能从客观事物的图像中提取信息,进行处理并加以理解,最终用于实际检测、测量和控制。它是多学科的交叉与结合,不少学科的研究目标与机器人视觉技术相近或与此有关。这些学科包括图像处理、模式识别或图像识别、景物分析、图像理解等。而图像处理是视觉技术的基础,处理的图像是自然景物的客观反映,是感知周围环境的重要途径。 Robot vision technology mainly studies the use of computers to simulate human visual functions to extract information from images of objective things, process and understand them, and finally use them in actual detection, measurement and control. It is the intersection and combination of multiple disciplines, and the research goals of many disciplines are similar to or related to robot vision technology. These disciplines include image processing, pattern recognition or image recognition, scene analysis, image understanding, etc. Image processing is the basis of visual technology. The processed image is an objective reflection of natural scenery and an important way to perceive the surrounding environment.

而图像中的形状特性是特征提取的重要指标,很多情况下,只有知道了图像的形状特征才能定量地对图像作进一步分析,而边界轮廓(即边缘)的确定又是研究形状特征的前提,也是计算机对图像自动识别的前提,它对特征描述、识别和理解等高层次的处理有着重大的影响。 The shape characteristic in the image is an important indicator of feature extraction. In many cases, only by knowing the shape characteristic of the image can the image be further analyzed quantitatively, and the determination of the boundary contour (ie edge) is the premise of studying the shape characteristic. It is also the premise of computer automatic recognition of images, and it has a significant impact on high-level processing such as feature description, recognition and understanding.

图像的边缘是图像的最基本特征,所谓边缘是指其周围像素灰度有阶跃变化或屋顶变化的那些像素的集合。边缘广泛存在于物体和背景之间、物体和物体之间、基元与基元之间。由于图像的边缘通常含有大量重要信息,因此,边缘检测成为图像处理的一个重要环节,其检测算法也获得了广泛的研究。 The edge of the image is the most basic feature of the image, and the so-called edge refers to the collection of those pixels whose gray level has a step change or a roof change. Edges widely exist between objects and backgrounds, between objects and objects, and between primitives. Because the edges of images usually contain a lot of important information, edge detection has become an important part of image processing, and its detection algorithms have also been extensively studied.

在一幅图像中,边缘有方向和幅度两个特性。沿边缘走向的灰度变化平缓,而垂直于边缘走向的灰度变化剧烈。边缘检测是对灰度变化的度量与定位,灰度变化的显著程度可以通过导数来度量,即函数导数能够反映图像灰度变化的显著程度,因此边缘检测的一个基本思想就是通过求一阶导数的局部极大值,二阶导数的过零点来体现出来的。利用梯度最大值提取边缘点的这种思想产生了许多经典的边缘检测方法如:Sobel算法、Log算法、Canny算法等。但是普通的算法在机器人视觉中会受到客观环境的影响而发挥不了很好的效果,还会在处理具体问题时会受到限制,如在机器视觉中采集到的台阶图像在不同的环境和光照情况下会有很大的不同,若采用一种方法可能达不到想要的效果。而且,如果统一采取一种比较复杂的算法,又会增加了处理得时间,达不到机器人视觉中实时性的要求。 In an image, edges have two properties, direction and magnitude. The gray scale along the edge changes gently, while the gray scale perpendicular to the edge changes sharply. Edge detection is the measurement and positioning of grayscale changes. The significance of grayscale changes can be measured by derivatives, that is, the function derivative can reflect the significance of image grayscale changes. Therefore, a basic idea of edge detection is to obtain the first derivative The local maximum value of , and the zero-crossing point of the second derivative are reflected. The idea of using the maximum gradient to extract edge points has produced many classic edge detection methods such as: Sobel algorithm, Log algorithm, Canny algorithm, etc. However, the ordinary algorithm will be affected by the objective environment in robot vision and will not play a good role, and will be limited when dealing with specific problems, such as step images collected in machine vision in different environments and lighting conditions There will be a big difference under the circumstances, and if one method is used, the desired effect may not be achieved. Moreover, if a more complex algorithm is uniformly adopted, the processing time will be increased, which cannot meet the real-time requirements of robot vision.

发明内容 Contents of the invention

针对上述上述机器人视觉技术中所存在的问题,本发明利用分别处理的思想提出了一种面向仿人机器人的台阶边缘检测方法,即先判断图像采集的环境,然后根据不同的环境状况分别处理的方法,在图像不复杂的情况下采用简单的处理方法而在图像复杂时采用分割处理的方法,这样既保证了处理的速度,又保证了处理的精度,从而符合机器视觉中的适时性和精确性的要求。 In view of the problems existing in the above-mentioned robot vision technology, the present invention uses the idea of separate processing to propose a step edge detection method for humanoid robots, that is, first judge the environment of image acquisition, and then process it separately according to different environmental conditions The method adopts a simple processing method when the image is not complex and adopts a segmentation processing method when the image is complex, which not only ensures the processing speed, but also ensures the processing accuracy, thus conforming to the timeliness and accuracy of machine vision. sexual demands.

本发明的技术方案包括以下步骤: Technical scheme of the present invention comprises the following steps:

 步骤1:对待检测的台阶灰度图像进行预处理; Step 1: Preprocessing the step grayscale image to be detected;

 步骤2:对预处理后的图像进行判断,如果台阶灰度图像为正对着光或侧对着光,则转向步骤3,如果台阶灰度图像为背对着光,则转向步骤5; Step 2: Judging the preprocessed image, if the grayscale image of the step is facing the light or side facing the light, then go to step 3, if the grayscale image of the step is facing away from the light, then go to step 5;

 步骤3:对台阶灰度图像进行形态学处理,即对台阶灰度图像分别进行膨胀和腐蚀操作,然后将膨胀和腐蚀后所得到的两幅图像相减,得到边缘信息增强的图像,转到步骤4;  Step 3: Perform morphological processing on the step grayscale image, that is, perform expansion and erosion operations on the step grayscale image respectively, and then subtract the two images obtained after expansion and erosion to obtain an image with enhanced edge information, go to Step 4;

步骤4:用sobel边缘检测算子处理台阶灰度图像得到向光台阶的边缘; Step 4: use the sobel edge detection operator to process the step grayscale image to obtain the edge of the light step;

 步骤5:直接用Otsu法求取阈值并将图像转化为二值图像从而得到背光台阶的边缘,转到步骤6; Step 5: directly use the Otsu method to obtain the threshold value and convert the image into a binary image to obtain the edge of the backlight step, go to step 6;

步骤6:用步骤5中的边缘线将步骤2中的图像进行分割,将灰度值高的部分进行灰度拉伸得到新的图像转到步骤7; Step 6: Segment the image in step 2 with the edge line in step 5, stretch the part with high gray value to get a new image and go to step 7;

步骤7:根据步骤6中得到的新的图像经过梯度变换得到梯度图像; Step 7: Obtain a gradient image through gradient transformation according to the new image obtained in step 6;

步骤8:根据步骤6中得到的新的图像经过反色变换在进行梯度变换得到另一个梯度图像; Step 8: Perform gradient transformation according to the new image obtained in step 6 through inverse color transformation to obtain another gradient image;

步骤9:将步骤7与步骤8中得到的两个梯度图像的相应像素点进行相加得到一个新的梯度图像然后由新的梯度图像得到图像的边缘。 Step 9: Add the corresponding pixels of the two gradient images obtained in step 7 and step 8 to obtain a new gradient image, and then obtain the edge of the image from the new gradient image.

步骤10:将步骤5中的边缘与步骤9中的边缘融合在一幅图像里就得到了背光的台阶的边缘。 Step 10: Merge the edge in step 5 with the edge in step 9 in one image to get the edge of the backlit steps.

上述步骤1中的预处理采用中值滤波将图像中的噪声去除,同时保存图像中的边缘信息。所述预处理采用可分离的二值中值滤波来处理图像。  The preprocessing in the above step 1 adopts median filtering to remove the noise in the image and preserve the edge information in the image at the same time. The preprocessing uses a separable binary median filter to process the image. the

所述步骤2中的对预处理后的图像进行判断的方法为根据图像中像素点灰度值的方差和概率统计来判断,先对图像像素点的灰度值的方差进行计算,当方差大于604-608时,就判定它为背光的台阶,否则就为向光的和测光的台阶。 The method for judging the preprocessed image in said step 2 is to judge according to the variance and probability statistics of the pixel gray value in the image, first calculate the variance of the gray value of the image pixel, when the variance is greater than When it is 604-608, it is judged to be a backlit step, otherwise it is a light-oriented and photometric step.

所述步骤3中,选取一个3x3的子图像模版,模板中每个位置取相同的灰度值,然后利用这个模板从左到右,从上到下遍历图像中每一个像素并进行形态学操作。 In the step 3, select a 3x3 sub-image template, each position in the template takes the same gray value, and then use this template to traverse each pixel in the image from left to right and from top to bottom and perform morphological operations .

所述步骤4中,sobel算法的阈值采用迭代式阈值选择法。 In the step 4, the threshold of the sobel algorithm adopts an iterative threshold selection method.

所述步骤1中对待检测的台阶灰度图像进行预处理包括滤波去噪处理。 The preprocessing of the step grayscale image to be detected in the step 1 includes filtering and denoising processing.

本发明对不同光照情况下的台阶图像不同,从而采取一种更优更适合的边缘检测方法,同时在对图像进行边缘检测之前做了很好的前奏处理,增加了检测的精确度,从而符合机器人视觉中的适时性和精确性的要求。 The present invention has different step images under different lighting conditions, thereby adopting a better and more suitable edge detection method. Timeliness and accuracy requirements in robot vision.

附图说明 Description of drawings

   图1为本发明检测方法的流程图; Fig. 1 is the flowchart of detection method of the present invention;

 图2为本发明实施例结构元素图;  Fig. 2 is a diagram of structural elements of an embodiment of the present invention;

图3为Roberts算子模板图。    Figure 3 is a template diagram of the Roberts operator. the

具体实施方式 Detailed ways

   一种面向仿人机器人的台阶边缘检测方法,包括以下步骤: A step edge detection method for humanoid robots, comprising the following steps:

步骤1:对待检测的台阶灰度图像进行预处理,该预处理采用中值滤波将图像中的噪声去除,同时保存图像中的边缘信息,所述预处理采用可分离的二值中值滤波来处理图像。 Step 1: Preprocessing the step grayscale image to be detected, the preprocessing uses median filtering to remove the noise in the image, and at the same time preserves the edge information in the image, the preprocessing uses separable binary median filtering to Process images.

步骤2:对预处理后的图像进行判断,如果台阶灰度图像为正对着光,则转向步骤3,如果台阶灰度图像为背对着光,则转向步骤5;对预处理后的图像进行判断的方法为根据图像中像素点灰度值的方差和概率统计来判断,先对图像像素点的灰度值的方差进行计算,当方差大于604-608时,就判定它为背光的台阶,否则就为向光的和测光的台阶。本步骤是本发明的关键步骤,针对不同性质的图像处理得方法有所差别,因此要先对图像进行判别分类。具体方法为根据图像中像素点灰度值的方差和概率统计来判断,先对图像像素点的灰度值的方差进行计算,因为背光的台阶会产生阴影,导致图像像素灰度值的差异比较大,方差也会比较大,当方差大于某个值时,就可以判定它为背光的台阶。否则就为向光的台阶。 Step 2: Judging the preprocessed image, if the step grayscale image is facing the light, go to step 3, if the step grayscale image is facing away from the light, go to step 5; for the preprocessed image The method of judgment is based on the variance and probability statistics of the gray value of the pixel in the image. First, calculate the variance of the gray value of the pixel in the image. When the variance is greater than 604-608, it is judged to be a backlight step , otherwise it is phototropic and photometric steps. This step is a key step of the present invention, and the methods for image processing of different properties are different, so the images must be discriminated and classified first. The specific method is to judge according to the variance and probability statistics of the gray value of the pixel in the image. First, calculate the variance of the gray value of the pixel in the image, because the steps of the backlight will produce shadows, resulting in the comparison of the difference in the gray value of the image pixel. When the variance is large, the variance will be relatively large. When the variance is greater than a certain value, it can be judged as a backlit step. Otherwise, it is a step toward the light.

 步骤3:对台阶灰度图像进行形态学处理,即对台阶灰度图像分别进行膨胀和腐蚀操作,然后将膨胀和腐蚀后所得到的两幅图像相减,得到边缘信息增强的图像,转到步骤4;该步骤具体为:选取一个结构元素,如图1所示,即一个3x3的子图像模版,模板中每个位置取相同的灰度值,然后利用这个模板从左到右,从上到下遍历图像中每一个像素并进行形态学操作。具体来说,对于图像中坐标是(x,y)的像素,在膨胀处理是需要对模板范围内每一个像素加上结构元素中对应像素的灰度值,然后寻找模板内的最大灰度值并作为像素(x,y)的灰度值。在腐蚀处理实则是对模板范围内每一个像素减去结构元素中对应像素的灰度值,然后寻找模版内的最小灰度值并作为像素(x,y)的灰度值。这样就会从原图像中得到两幅不同的图像,然后将这两幅图像对应位置的像素相减,即得到边缘信息已增强的图像。  Step 3: Perform morphological processing on the step grayscale image, that is, perform expansion and erosion operations on the step grayscale image respectively, and then subtract the two images obtained after expansion and erosion to obtain an image with enhanced edge information, go to Step 4; this step is specifically: select a structural element, as shown in Figure 1, that is, a 3x3 sub-image template, each position in the template takes the same gray value, and then use this template from left to right, from top to bottom Go down to traverse each pixel in the image and perform morphological operations. Specifically, for a pixel whose coordinates are (x, y) in the image, in the expansion process, it is necessary to add the gray value of the corresponding pixel in the structural element to each pixel within the template range, and then find the maximum gray value in the template And as the gray value of the pixel (x, y). In the corrosion process, the gray value of the corresponding pixel in the structural element is subtracted from each pixel in the template range, and then the minimum gray value in the template is found and used as the gray value of the pixel (x, y). In this way, two different images will be obtained from the original image, and then the pixels at the corresponding positions of the two images will be subtracted to obtain an image with enhanced edge information. the

步骤4:用sobel边缘检测算子处理台阶灰度图像得到向光台阶的边缘;所述sobel算法的阈值采用迭代式阈值选择法,具体为:开始时选择一个阈值作为初始值,然后按照一种策略不断改进这一估计值,直到满足给定的准则为止。该策略应该具备两个特征:①快速收敛②每一个迭代过程中,新产生的阈值优于上次的阈值。 Step 4: use the sobel edge detection operator to process the step grayscale image to obtain the edge of the light step; the threshold of the sobel algorithm adopts an iterative threshold selection method, specifically: select a threshold as the initial value at the beginning, and then use a The policy keeps improving this estimate until a given criterion is met. The strategy should have two characteristics: ① fast convergence; ② in each iteration process, the newly generated threshold is better than the last threshold.

    步骤5:直接用Otsu法求取阈值并将图像转化为二值图像从而得到背光台阶的边缘,转到步骤6;所述Otsu法是一种使类间方差最大的自动确定阈值的方法,由于背光的台阶产生的阴影与台阶之间有足够的对比度故采用此法。 Step 5: directly use the Otsu method to obtain the threshold value and convert the image into a binary image to obtain the edge of the backlight step, and then go to step 6; the Otsu method is a method for automatically determining the threshold value that maximizes the variance between classes, because This method is used because there is sufficient contrast between the shadows produced by the backlit steps and the steps.

     步骤6:用步骤5中的边缘线将步骤2中的图像进行分割,将灰度值高的部分进行灰度拉伸得到新的图像转到步骤7;所述灰度拉伸是为了增强阴影部分的对比度,可以通过改进直方图均衡化所用到的方法来增加灰度值的动态范围,从而达到增强图像整体对比度的效果。 Step 6: Segment the image in step 2 with the edge line in step 5, and perform gray scale stretching on the part with high gray value to obtain a new image Go to step 7; the gray scale stretching is to enhance the shadow Part of the contrast, the dynamic range of the gray value can be increased by improving the method used in histogram equalization, so as to achieve the effect of enhancing the overall contrast of the image.

     步骤7:根据步骤6中得到的新的图像经过梯度变换得到梯度图像; Step 7: According to the new image obtained in step 6, the gradient image is obtained through gradient transformation;

     步骤8:根据步骤6中得到的新的图像经过反色变换在进行梯度变换得到另一个梯度图像; Step 8: According to the new image obtained in step 6, undergo inverse color transformation and perform gradient transformation to obtain another gradient image;

     所述步骤7与步骤8中所用的梯度算子都为Roberts算子,如图2所示。所述步骤8中的反色处理即将灰度级范围是[0,L]的图像求反。 The gradient operators used in Step 7 and Step 8 are both Roberts operators, as shown in Figure 2. The color inversion processing in step 8 is to invert the image whose gray scale range is [0, L].

     步骤9:将步骤7与步骤8中得到的两个梯度图像的相应像素点进行相加得到一个新的梯度图像然后由新的梯度图像得到图像的边缘,在该步骤中将两梯度图相加的实质是将原图像的边缘与反色后检测的边缘求交集,即两次检测均为边缘点的才被确定为边缘点,这个过程中又消除了一些噪声的影响。 Step 9: Add the corresponding pixels of the two gradient images obtained in step 7 and step 8 to obtain a new gradient image and then obtain the edge of the image from the new gradient image, and add the two gradient images in this step The essence is to intersect the edge of the original image with the edge detected after inversion, that is, the edge point is determined as the edge point when both detections are edge points, and some noise effects are eliminated in this process.

步骤10:将步骤5中的边缘与步骤9中的边缘融合在一幅图像里就得到了背光的台阶的边缘。 Step 10: Merge the edge in step 5 with the edge in step 9 in one image to get the edge of the backlit steps.

下面结合附图和具体实施方式对本发明做进一步详细的说明。 The present invention will be described in further detail below in conjunction with the accompanying drawings and specific embodiments.

1.图像预处理。为了保存图像中的边缘信息,使用中直滤波来去除图像中的噪声。同时为了降低处理时间,采用可分离的二维中直滤波来进行操作,其具体步骤如下: 1. Image preprocessing. In order to preserve the edge information in the image, use the straight filter to remove the noise in the image. At the same time, in order to reduce the processing time, a separable two-dimensional median filter is used for operation. The specific steps are as follows:

确定一个一维中直滤波模版大小,如1 x 3,沿着水平方向对图像中每一行进行中值滤波,即对模版内的像素按灰度值大小进行排序,选择位于中间的灰度值作为结果。沿着垂直方向对图像的每一列进行中值滤波,方法同上。 Determine the size of a one-dimensional median filtering template, such as 1 x 3, and perform median filtering on each line in the image along the horizontal direction, that is, sort the pixels in the template according to the gray value, and select the gray value in the middle as a result. Perform median filtering on each column of the image along the vertical direction, the method is the same as above.

2.对预处理后的图像的像素灰度值作为样本数据,根据如下公式                                                

Figure 453421DEST_PATH_IMAGE001
即可得到图像灰度值的方差,当
Figure 720454DEST_PATH_IMAGE002
Figure 355572DEST_PATH_IMAGE003
Figure 962134DEST_PATH_IMAGE004
时,可判定台阶为背光的;否则为测光或正光的。其中,
Figure 830864DEST_PATH_IMAGE005
为图像灰度值的期望,P为一先验值,在本次实验中若灰度值得平均值在180~200时,先验值P为24.6。 2. The pixel gray value of the preprocessed image is used as sample data, according to the following formula
Figure 453421DEST_PATH_IMAGE001
The variance of the gray value of the image can be obtained, when
Figure 720454DEST_PATH_IMAGE002
Figure 355572DEST_PATH_IMAGE003
Figure 962134DEST_PATH_IMAGE004
, it can be determined that the steps are backlit; otherwise, they are photometric or positive. in,
Figure 830864DEST_PATH_IMAGE005
is the expectation of the gray value of the image, and P is a prior value. In this experiment, if the average value of the gray value is between 180 and 200, the prior value P is 24.6.

3.对预处理后的图像采用形态学处理操作——膨胀和腐蚀,并将结果相减。首先选择结构元素——3x3的子图像模板,结构元素中各个位置的灰度相同,记为b(x,y)。 3. Morphological processing operations - dilation and erosion - are applied to the preprocessed image and the results are subtracted. First select the structural element—the 3x3 sub-image template. The gray scale of each position in the structural element is the same, which is recorded as b(x, y).

     用结构元素b(x,y)对图像I进行灰度膨胀表示为:

Figure 24341DEST_PATH_IMAGE006
,定义为: The grayscale expansion of the image I with the structural element b(x, y) is expressed as:
Figure 24341DEST_PATH_IMAGE006
,defined as:

用结构元素b(x,y)对图像I进行灰度腐蚀表示为:

Figure 699036DEST_PATH_IMAGE008
,定义为: The grayscale erosion of the image I with the structuring element b(x, y) is expressed as:
Figure 699036DEST_PATH_IMAGE008
,defined as:

Figure DEST_PATH_IMAGE009
Figure DEST_PATH_IMAGE009

其中

Figure 97788DEST_PATH_IMAGE010
Figure DEST_PATH_IMAGE011
分别是图像I和结构元素
Figure 901533DEST_PATH_IMAGE012
的定义域。 in
Figure 97788DEST_PATH_IMAGE010
and
Figure DEST_PATH_IMAGE011
are the image I and the structural element
Figure 901533DEST_PATH_IMAGE012
domain of definition.

在图像上分别按上式进行了膨胀和腐蚀操作之后,将两幅图像相减,得到边缘信息增强的图像。 After the expansion and erosion operations are performed on the image according to the above formula, the two images are subtracted to obtain an image with enhanced edge information.

4.用sobel算子模板对图像进行操作计算出各像素点的梯度值

Figure DEST_PATH_IMAGE013
,如果
Figure 457673DEST_PATH_IMAGE014
则认为该点是边缘点。 4. Use the sobel operator template to operate the image to calculate the gradient value of each pixel
Figure DEST_PATH_IMAGE013
,if
Figure 457673DEST_PATH_IMAGE014
The point is considered to be an edge point.

确定阈值T的具体步骤如下: The specific steps for determining the threshold T are as follows:

(1)选择梯度图像灰度的中值作为初始阈值

Figure DEST_PATH_IMAGE015
。 (1) Select the median of the grayscale of the gradient image as the initial threshold
Figure DEST_PATH_IMAGE015
.

(2)利用阈值T把梯度图像分割成两个区域——

Figure 545846DEST_PATH_IMAGE016
Figure DEST_PATH_IMAGE017
,用下式计算区域
Figure 563218DEST_PATH_IMAGE016
Figure 836068DEST_PATH_IMAGE017
的灰度均值
Figure 502672DEST_PATH_IMAGE018
: (2) Use the threshold T to divide the gradient image into two regions——
Figure 545846DEST_PATH_IMAGE016
and
Figure DEST_PATH_IMAGE017
, use the following formula to calculate the area
Figure 563218DEST_PATH_IMAGE016
and
Figure 836068DEST_PATH_IMAGE017
gray value of
Figure 502672DEST_PATH_IMAGE018
and :

Figure 20635DEST_PATH_IMAGE020
Figure DEST_PATH_IMAGE021
Figure 20635DEST_PATH_IMAGE020
,
Figure DEST_PATH_IMAGE021

(3)计算出后,用下式计算出新的阈值(3) Calculated and After that, the new threshold is calculated by the following formula :

Figure DEST_PATH_IMAGE023
 
Figure DEST_PATH_IMAGE023
 

(4)重复步骤2~3,直到

Figure 248037DEST_PATH_IMAGE022
Figure 600521DEST_PATH_IMAGE024
的差小于某个给定的值。 (4) Repeat steps 2~3 until
Figure 248037DEST_PATH_IMAGE022
and
Figure 600521DEST_PATH_IMAGE024
The difference is less than a given value.

5. Otsu法的具体步骤为:  5. The specific steps of the Otsu method are:

1):计算每个灰度级的像素出现的几率: 1): Calculate the probability of each gray level pixel appearing:

Figure DEST_PATH_IMAGE025
,      i=0,1,2,…,L-1
Figure DEST_PATH_IMAGE025
, i=0,1,2,…,L-1

其中N为图像的像素数,[0,L-1] 为灰度范围。 Where N is the number of pixels in the image, and [0, L-1] is the grayscale range.

2):按照如下公式: 2): according to the following formula:

Figure 908181DEST_PATH_IMAGE026
Figure 908181DEST_PATH_IMAGE026

其中

Figure DEST_PATH_IMAGE027
 ,
Figure 283799DEST_PATH_IMAGE028
Figure DEST_PATH_IMAGE029
Figure 579782DEST_PATH_IMAGE030
。 in
Figure DEST_PATH_IMAGE027
,
Figure 283799DEST_PATH_IMAGE028
,
Figure DEST_PATH_IMAGE029
,
Figure 579782DEST_PATH_IMAGE030
.

让T在[0,L-1]范围内依次取值,使得

Figure DEST_PATH_IMAGE031
最大的T值就是最佳的阈值。 Let T take values sequentially in the range [0, L-1], so that
Figure DEST_PATH_IMAGE031
The largest T value is the best threshold.

6.灰度拉伸的具体步骤: 6. Specific steps of grayscale stretching:

1):先计算出每个灰度级的概率:

Figure 488570DEST_PATH_IMAGE032
其中
Figure DEST_PATH_IMAGE033
为灰度级为k的像素的个数,n像素的总个数。 1): First calculate the probability of each gray level:
Figure 488570DEST_PATH_IMAGE032
in
Figure DEST_PATH_IMAGE033
is the number of pixels with a gray level of k, and the total number of n pixels.

2):然后利用计算出变换函数值: 2): Then use to calculate the transformation function value:

,k=0,1,2,…,L-1 , k=0, 1, 2,...,L-1

3)利用公式

Figure DEST_PATH_IMAGE035
Figure 402617DEST_PATH_IMAGE036
扩展到[0,L-1]范围内并取整得到不同灰度级的变换函数然后将相同值归并起来,就得到修正后的灰度级变换函数 3) Using the formula
Figure DEST_PATH_IMAGE035
Will
Figure 402617DEST_PATH_IMAGE036
Extend to the range of [0, L-1] and round to obtain the transformation functions of different gray levels, and then merge the same values to get the modified gray level transformation function

4)把相应的原灰度级的像素数相加得到新灰度级的像素数,即得到新的对比度较高的图像。 4) Add the number of pixels of the corresponding original gray level to get the number of pixels of the new gray level, that is, get a new image with higher contrast.

7.用2x2的Roberts算子模板对图像进行操作,得到梯度图。 7. Use the 2x2 Roberts operator template to operate on the image to obtain a gradient map.

8.对图像进行取反就是将灰度从[0,L-1]变换到[L-1,0],可用公式

Figure DEST_PATH_IMAGE037
。s为原图像的灰度值,t为变换后图像的灰度值。 8. Inverting the image is to transform the grayscale from [0, L-1] to [L-1, 0]. The formula can be used
Figure DEST_PATH_IMAGE037
. s is the gray value of the original image, and t is the gray value of the transformed image.

9.具体做法就是将检测到的边缘像素点进行位与操作。 9. The specific method is to perform a bit-AND operation on the detected edge pixels.

10.将两幅图像边缘点的像素在一幅图中显示出来就可以得到整个图像的边缘。  10. The edge of the entire image can be obtained by displaying the pixels of the edge points of the two images in one image. the

Claims (7)

1.一种面向仿人机器人的台阶边缘检测方法,其特征在于包括以下步骤: 1. a step edge detection method for humanoid robot, it is characterized in that comprising the following steps:  步骤1:对待检测的台阶灰度图像进行预处理; Step 1: Preprocessing the step grayscale image to be detected;  步骤2:对预处理后的图像进行判断,如果台阶灰度图像为正对着光或侧对着光,则转向步骤3,如果台阶灰度图像为背对着光,则转向步骤5; Step 2: Judging the preprocessed image, if the grayscale image of the step is facing the light or side facing the light, then go to step 3, if the grayscale image of the step is facing away from the light, then go to step 5;  步骤3:对台阶灰度图像进行形态学处理,即对台阶灰度图像分别进行膨胀和腐蚀操作,然后将膨胀和腐蚀后所得到的两幅图像相减,得到边缘信息增强的图像,转到步骤4;  Step 3: Perform morphological processing on the step grayscale image, that is, perform expansion and erosion operations on the step grayscale image respectively, and then subtract the two images obtained after expansion and erosion to obtain an image with enhanced edge information, go to Step 4; 步骤4:用sobel边缘检测算子处理台阶灰度图像得到向光台阶的边缘,方法结束; Step 4: Process the step grayscale image with the sobel edge detection operator to obtain the edge of the light step, and the method ends;  步骤5:直接用Otsu法求取阈值并将预处理后的图像转化为二值图像从而得到背光台阶的边缘,转到步骤6; Step 5: directly use the Otsu method to obtain the threshold value and convert the preprocessed image into a binary image to obtain the edge of the backlight step, go to step 6; 步骤6:用步骤5中的边缘线将步骤2中的图像进行分割,将灰度值高的部分进行灰度拉伸得到新的图像转到步骤7; Step 6: Segment the image in step 2 with the edge line in step 5, stretch the part with high gray value to get a new image and go to step 7; 步骤7:根据步骤6中得到的新的图像经过梯度变换得到梯度图像; Step 7: Obtain a gradient image through gradient transformation according to the new image obtained in step 6; 步骤8:根据步骤6中得到的新的图像经过反色变换再进行梯度变换得到另一个梯度图像; Step 8: According to the new image obtained in step 6, undergo inverse color transformation and then perform gradient transformation to obtain another gradient image; 步骤9:将步骤7与步骤8中得到的两个梯度图像的相应像素点进行相加得到一个新的梯度图像然后由新的梯度图像得到图像的边缘; Step 9: Add the corresponding pixels of the two gradient images obtained in step 7 and step 8 to obtain a new gradient image, and then obtain the edge of the image from the new gradient image; 步骤10:将步骤5中的边缘与步骤9中的边缘融合在一幅图像里就得到了背光的台阶的边缘。 Step 10: Merge the edge in step 5 with the edge in step 9 in one image to get the edge of the backlit steps. 2.根据权利要求1所述的面向仿人机器人的台阶边缘检测方法,其特征在于:所述步骤1中的预处理采用中值滤波将图像中的噪声去除,同时保存图像中的边缘信息。 2. The step edge detection method for humanoid robots according to claim 1, characterized in that: the preprocessing in the step 1 adopts median filtering to remove the noise in the image, while preserving the edge information in the image. 3.根据权利要求2所述的面向仿人机器人的台阶边缘检测方法,其特征在于:所述步骤1中的预处理采用可分离的二值中值滤波来处理图像。 3. The step edge detection method oriented to humanoid robot according to claim 2, characterized in that: the preprocessing in the step 1 adopts separable binary median filter to process the image. 4. 根据权利要求1所述的面向仿人机器人的台阶边缘检测方法,其特征在于:所述步骤2中的对预处理后的图像进行判断的方法为根据图像中像素点灰度值的方差和概率统计来判断,先对图像像素点的灰度值的方差进行计算,当方差大于方差阈值时,就判定它为背光的台阶,否则就为向光和侧光的台阶,其中方差阈值取604-608。 4. the step edge detection method facing humanoid robot according to claim 1, it is characterized in that: the method for judging the preprocessed image in the said step 2 is according to the variance of pixel point gray value in the image To judge with probability and statistics, first calculate the variance of the gray value of the image pixel. When the variance is greater than the variance threshold, it is judged to be a backlight step, otherwise it is a step towards the light and side light, where the variance threshold is taken as 604-608. 5.根据权利要求1所述的面向仿人机器人的台阶边缘检测方法,其特征在于:所述步骤3中,选取一个3x3的子图像模版,模板中每个位置取相同的灰度值,然后利用这个模板从左到右,从上到下遍历图像中每一个像素并进行形态学操作。 5. the step edge detection method facing humanoid robot according to claim 1, is characterized in that: in described step 3, choose the sub-image template of a 3x3, each position gets identical gray scale value in the template, then Use this template to traverse each pixel in the image from left to right and top to bottom and perform morphological operations. 6.根据权利要求1所述的面向仿人机器人的台阶边缘检测方法,其特征在于:所述步骤4中,sobel算法的阈值采用迭代式阈值选择法。 6. The step edge detection method for humanoid robots according to claim 1, characterized in that: in the step 4, the threshold of the sobel algorithm adopts an iterative threshold selection method. 7.根据权利要求1所述的面向仿人机器人的台阶边缘检测方法,其特征在于:所述步骤1中对待检测的台阶灰度图像进行预处理包括滤波去噪处理。 7. The step edge detection method for humanoid robots according to claim 1, characterized in that: in step 1, the preprocessing of the step grayscale image to be detected includes filtering and denoising processing.
CN 201110260352 2011-09-05 2011-09-05 Step edge detection method oriented to humanoid robot Expired - Fee Related CN102324099B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN 201110260352 CN102324099B (en) 2011-09-05 2011-09-05 Step edge detection method oriented to humanoid robot

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN 201110260352 CN102324099B (en) 2011-09-05 2011-09-05 Step edge detection method oriented to humanoid robot

Publications (2)

Publication Number Publication Date
CN102324099A CN102324099A (en) 2012-01-18
CN102324099B true CN102324099B (en) 2013-07-03

Family

ID=45451838

Family Applications (1)

Application Number Title Priority Date Filing Date
CN 201110260352 Expired - Fee Related CN102324099B (en) 2011-09-05 2011-09-05 Step edge detection method oriented to humanoid robot

Country Status (1)

Country Link
CN (1) CN102324099B (en)

Families Citing this family (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102789234B (en) * 2012-08-14 2015-07-08 广东科学中心 Robot navigation method and system based on color-coded identification
CN102903340B (en) * 2012-11-12 2015-11-04 中航华东光电有限公司 Liquid crystal display is based on the LED dynamic backlight control method of dynamic threshold
CN104656676B (en) * 2014-12-25 2017-11-07 北京理工大学 A kind of servo-controlled apparatus and method of anthropomorphic robot hand leg eye
CN105437768A (en) * 2015-09-13 2016-03-30 常州大学 Machine-vision-based intelligent artistic paint robot
CN106127757B (en) * 2016-06-21 2018-10-23 鲁东大学 Night safety monitoring methods of video segmentation based on improved adaptive GA-IAGA and device
CN109145689A (en) * 2017-06-28 2019-01-04 南京理工大学 A kind of robot fire detection method
CN108230320A (en) * 2018-01-18 2018-06-29 上海爱优威软件开发有限公司 Number of staircases statistical method and system
CN108665440A (en) * 2018-03-14 2018-10-16 重庆邮电大学 A kind of irregular cigarette packet image co-registration edge detection algorithm based on improved sobel method
CN111652897A (en) * 2020-06-10 2020-09-11 北京云迹科技有限公司 A method and device for edge localization based on robot vision
CN111862128B (en) * 2020-06-12 2024-04-16 广州市申迪计算机系统有限公司 Image segmentation method and device
CN112102347B (en) * 2020-11-19 2021-02-12 之江实验室 Step detection and single-stage step height estimation method based on binocular vision

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
GB0301434D0 (en) * 2003-01-22 2003-02-19 Univ Brunel A new automatic thresholding algorithm based on multi-thresholds
CN100550037C (en) * 2007-11-23 2009-10-14 重庆大学 A Method of Using Improved Hausdorff Distance to Extract and Recognize Human Ear Features
CN101604446B (en) * 2009-07-03 2011-08-31 清华大学深圳研究生院 Lip image segmenting method and system for fatigue detection

Also Published As

Publication number Publication date
CN102324099A (en) 2012-01-18

Similar Documents

Publication Publication Date Title
CN102324099B (en) Step edge detection method oriented to humanoid robot
CN113435460B (en) A recognition method for bright crystal granular limestone images
CN106093066B (en) A kind of magnetic tile surface defect detection method based on improved machine vision attention mechanism
CN105261017B (en) The method that image segmentation based on road surface constraint extracts pedestrian's area-of-interest
CN103048329B (en) A kind of road surface crack detection method based on active contour model
CN103955949B (en) Moving target detecting method based on Mean-shift algorithm
CN111833366A (en) An Edge Detection Method Based on Canny Algorithm
CN100544446C (en) Real-time Motion Detection Method for Video Surveillance
CN110569782A (en) A target detection method based on deep learning
CN102930576A (en) Feature flow-based method for generating abstract line drawing
CN110570442A (en) Method for contour detection under complex background, terminal equipment and storage medium
CN117557765B (en) Small-target water-float garbage detection method based on APM-YOLOv7
CN106530271A (en) Infrared image significance detection method
CN104766344B (en) Vehicle checking method based on movement edge extractor
CN111369570A (en) Multi-target detection tracking method for video image
CN112288726A (en) Method for detecting foreign matters on belt surface of underground belt conveyor
CN105787912A (en) Classification-based step type edge sub pixel localization method
CN111539980A (en) Multi-target tracking method based on visible light
CN118552746A (en) Image edge detection method based on Canny algorithm
CN103914829A (en) Method for detecting edge of noisy image
Li et al. Wafer crack detection based on yolov4 target detection method
CN105930793A (en) Human body detection method based on SAE characteristic visual learning
CN106446832B (en) Video-based pedestrian real-time detection method
Yang et al. Research and analysis of Image edge detection algorithm Based on the MATLAB
Cheng et al. Power pole detection based on graph cut

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C14 Grant of patent or utility model
GR01 Patent grant
CF01 Termination of patent right due to non-payment of annual fee

Granted publication date: 20130703

Termination date: 20140905

EXPY Termination of patent right or utility model