CN117994222B - Straight line segment detection method and system based on prediction correction mechanism - Google Patents
Straight line segment detection method and system based on prediction correction mechanism Download PDFInfo
- Publication number
- CN117994222B CN117994222B CN202410134046.6A CN202410134046A CN117994222B CN 117994222 B CN117994222 B CN 117994222B CN 202410134046 A CN202410134046 A CN 202410134046A CN 117994222 B CN117994222 B CN 117994222B
- Authority
- CN
- China
- Prior art keywords
- line segment
- image
- scale
- gradient
- edge
- 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
Links
Classifications
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T7/00—Image analysis
- G06T7/0002—Inspection of images, e.g. flaw detection
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T7/00—Image analysis
- G06T7/10—Segmentation; Edge detection
- G06T7/13—Edge detection
Landscapes
- Engineering & Computer Science (AREA)
- Computer Vision & Pattern Recognition (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Theoretical Computer Science (AREA)
- Quality & Reliability (AREA)
- Image Analysis (AREA)
Abstract
Description
技术领域Technical Field
本发明涉及线段检测技术领域,尤其涉及一种基于预测校正机制的直线段检测方法及系统。The present invention relates to the technical field of line segment detection, and in particular to a straight line segment detection method and system based on a prediction correction mechanism.
背景技术Background Art
直线段(简称线段)在现实世界的场景中传达了大量的几何和拓扑信息,使其广泛应用于各种计算机视觉任务,例如三维重建,同时定位与建图,姿态估计,消失点检测和无人机图像中的电力线提取等。Straight line segments (line segments for short) convey a wealth of geometric and topological information in real-world scenes, making them widely used in various computer vision tasks such as 3D reconstruction, simultaneous localization and mapping, pose estimation, vanishing point detection, and power line extraction in drone imagery.
现有的基于边缘点的直线段检测技术主要包括以下几个步骤:(1)对图像进行高斯平滑以抑制噪声;(2)计算梯度幅值和梯度方向;(3)计算锚点,即梯度幅值的局部极大值;(4)边缘绘制,利用路由方法链接边缘点进行线段拟合;(5)对线段进行验证。该类方法大体流程如图1所示。The existing edge point-based straight line segment detection technology mainly includes the following steps: (1) Gaussian smoothing of the image to suppress noise; (2) calculation of gradient magnitude and gradient direction; (3) calculation of anchor points, i.e., local maximum values of gradient magnitude; (4) edge drawing, using routing methods to link edge points for line segment fitting; (5) verification of line segments. The general process of this type of method is shown in Figure 1.
对于上述的步骤(1)、(2)很好理解,与绝大多数图像处理方法一致。步骤(3)则是先对图像的梯度幅值施加一个阈值过滤部分像素,然后进行非极大值抑制,即沿着每个像素的梯度方向判断其梯度幅值是否是最大。如果是,则该像素为锚点。步骤(4)则是利用锚点的梯度方向寻找其邻域内满足一定条件的其他锚点,依次进行下去,将这些锚点构成一个像素链。若像素链满足一定规模,则对该像素链使用最小二乘法进行线段拟合,得到线段所在直线的参数方程和线段的端点坐标。步骤(5)则是利用图像的梯度信息进行进一步的验证以控制假阳性。The above steps (1) and (2) are easy to understand and consistent with most image processing methods. Step (3) is to first apply a threshold to the gradient amplitude of the image to filter some pixels, and then perform non-maximum suppression, that is, to determine whether the gradient amplitude of each pixel is the maximum along the gradient direction of each pixel. If so, the pixel is an anchor point. Step (4) is to use the gradient direction of the anchor point to find other anchor points that meet certain conditions in its neighborhood, and then proceed in sequence to form a pixel chain with these anchor points. If the pixel chain meets a certain scale, the least squares method is used to fit the pixel chain to obtain the parametric equation of the straight line where the line segment is located and the coordinates of the endpoints of the line segment. Step (5) is to use the gradient information of the image for further verification to control false positives.
综上,现有线段检测方法存在以下缺点:In summary, the existing line segment detection methods have the following disadvantages:
缺点1:现有方法在计算图像梯度步骤中,对图像的梯度幅值施加预设阈值以抑制假阳性,但这个阈值同时也将用于生成线段的一部分像素过滤掉。因此,现有方法检测到的线段的完整性不高。Disadvantage 1: In the step of calculating the image gradient, the existing method applies a preset threshold to the image gradient amplitude to suppress false positives, but this threshold also filters out some pixels used to generate line segments. Therefore, the integrity of the line segments detected by the existing method is not high.
缺点2:现有方法在计算图像梯度步骤中所施加的梯度幅值是固定的,而图像低对比度区域的像素的梯度幅值通常低于这个阈值。因此,现有方法对于低对比度区域的线段往往检测不到。Disadvantage 2: The gradient amplitude applied by the existing methods in the step of calculating the image gradient is fixed, and the gradient amplitude of pixels in the low-contrast area of the image is usually lower than this threshold. Therefore, the existing methods often fail to detect line segments in low-contrast areas.
缺点3:现有方法在锚点选取步骤中,通常直接对梯度幅值进行非极大值抑制,但这样通常会将噪声点也算作锚点。因此,现有方法的检测效率不高。Disadvantage 3: In the anchor point selection step, the existing methods usually directly perform non-maximum suppression on the gradient amplitude, but this usually counts noise points as anchor points. Therefore, the detection efficiency of the existing methods is not high.
缺点4:基于计算图像梯度步骤和锚点选取步骤中所述的缺点,现有方法去除了对线段有用的像素,且引入了噪声影响。因此,现有方法无法全面提取图像中有关线段的所有细节。Disadvantage 4: Based on the disadvantages described in the steps of calculating image gradients and selecting anchor points, the existing methods remove pixels that are useful for line segments and introduce noise effects. Therefore, the existing methods cannot fully extract all the details of the line segments in the image.
缺点5:现有方法在边缘绘制步骤中,通常选取一个锚点作为开始点,然后根据该锚点的梯度方向寻找邻域内满足一定条件的下一个锚点,这种寻找方式严重依赖所计算的梯度方向。因此,现有方法通过这种链接方式所提取的用于拟合线段的像素链通常质量都不高,导致检测的线段的方向和位置的准确度不高。Disadvantage 5: In the edge drawing step, the existing methods usually select an anchor point as the starting point, and then search for the next anchor point that meets certain conditions in the neighborhood according to the gradient direction of the anchor point. This search method is heavily dependent on the calculated gradient direction. Therefore, the pixel chain extracted by the existing methods for fitting the line segment through this linking method is usually of low quality, resulting in low accuracy in the direction and position of the detected line segment.
发明内容Summary of the invention
为此,本发明实施例提供了一种基于预测校正机制的直线段检测方法及系统,用于解决现有技术中现有方法检测的线段的完整性不高、检测不到低对比度区域的线索、检测效率不高、无法提取图像中有关线段的所有细节以及检测的线段的方向和位置的准确度不高等问题。To this end, an embodiment of the present invention provides a straight line segment detection method and system based on a prediction and correction mechanism, which is used to solve the problems in the prior art that the integrity of the line segments detected by the existing methods is not high, the clues of low contrast areas cannot be detected, the detection efficiency is low, all the details about the line segments in the image cannot be extracted, and the direction and position of the detected line segments are not accurate.
为了解决上述问题,本发明实施例提供一种基于预测校正机制的直线段检测方法,该方法包括:In order to solve the above problem, an embodiment of the present invention provides a straight line segment detection method based on a prediction correction mechanism, the method comprising:
步骤S1:计算输入图像的梯度幅值和梯度方向;Step S1: Calculate the gradient magnitude and gradient direction of the input image;
步骤S2:基于提前设计好的多尺度自适应Canny边缘检测器预测图像中的线段,具体包括:首先基于多尺度自适应Canny边缘检测器,通过设置三个尺度参数对输入图像进行边缘检测;然后将来自这三个不同尺度信息的边缘融合成最终的边缘;最后对边缘执行非极大值抑制并使用最小二乘法进行线段拟合,得到线段所在直线的方程表达式以及线段的端点坐标,即得到预测线段;Step S2: predicting line segments in the image based on a pre-designed multi-scale adaptive Canny edge detector, specifically comprising: firstly, performing edge detection on the input image based on the multi-scale adaptive Canny edge detector by setting three scale parameters; then fusing the edges from the three different scale information into the final edge; finally, performing non-maximum suppression on the edge and using the least squares method to perform line segment fitting, obtaining the equation expression of the straight line where the line segment is located and the coordinates of the endpoints of the line segment, that is, obtaining the predicted line segment;
步骤S3:采用定向路由方法对预测出的线段进行校正;Step S3: Correcting the predicted line segment using a directional routing method;
步骤S4:对校正后的线段进行验证,输出最终的线段。Step S4: Verify the corrected line segment and output the final line segment.
优选地,在步骤S1中,计算输入图像的梯度幅值和梯度方向,具体包括:Preferably, in step S1, calculating the gradient magnitude and gradient direction of the input image specifically includes:
首先,将输入的彩色图像转变为灰度图像I(x,y);其次,对灰度图像I(x,y)进行高斯平滑减少噪声影响;然后,利用Sobel算子计算高斯平滑后的灰度图像的梯度其中gx和gy分别是关于x和y的导数,梯度方向Gθ的计算公式为:First, the input color image is converted into a grayscale image I(x,y); secondly, the grayscale image I(x,y) is Gaussian smoothed to reduce the influence of noise; then, the Sobel operator is used to calculate the gradient of the grayscale image after Gaussian smoothing. Where gx and gy are the derivatives with respect to x and y respectively, and the calculation formula for the gradient direction Gθ is:
Gθ=arctan(gy/gx); Gθ =arctan( gy / gx );
梯度幅值Gm的计算公式为:The calculation formula of the gradient amplitude Gm is:
Gm=|gx|+|gy|G m = |g x |+|g y |
式中,|·|表示L1范数。In the formula, |·| represents the L1 norm.
优选地,单个尺度下自适应Canny边缘检测器的检测流程包括以下步骤:Preferably, the detection process of the adaptive Canny edge detector at a single scale includes the following steps:
步骤一:设置尺度参数α=α1,α2,α3,将输入图像基于α等分,即分成α2个子图,每个子图的大小为其中h,w分别表示原图像的长和宽;Step 1: Set the scale parameter α = α 1 , α 2 , α 3 , and divide the input image into α 2 sub-images based on α. The size of each sub-image is Where h and w represent the length and width of the original image respectively;
步骤二:基于亥姆霍兹原理计算各个子图Ii对应的对线段检测有意义的最小梯度幅值,计算公式如下:Step 2: Based on the Helmholtz principle, the minimum gradient amplitude that is meaningful for line segment detection corresponding to each sub-image I i is calculated. The calculation formula is as follows:
ei,mi=CannyL(Ii)e i ,m i =CannyL(I i )
式中,CannyL(·)表示CannyLines的边缘检测方法;ei表示该子图Ii的自适应边缘检测结果;mi表示子图Ii中对检测线段有意义的最小梯度幅值;Where, CannyL(·) represents the edge detection method of CannyLines; e i represents the adaptive edge detection result of the sub-image I i ; mi represents the minimum gradient amplitude meaningful for detecting line segments in sub-image I i ;
步骤三:拼接各个子图Ii的边缘结果ei,并计算各个子图的mi的均值,于是,得到在尺度α下的图像I的边缘检测结果Eα:Step 3: Concatenate the edge results e i of each sub-image I i and calculate the mean of each sub-image mi . Then, the edge detection result E α of image I at scale α is obtained:
以及对检测线段有意义的最小梯度幅值Mα:And the minimum gradient magnitude M α that is meaningful for detecting line segments:
式中,Concat(·)表示拼接函数;Avg(·)表示均值函数; In the formula, Concat(·) represents the concatenation function; Avg(·) represents the mean function;
步骤四:输出尺度α下的边缘检测结果Eα及对检测线段有意义的最小梯度幅值Mα。Step 4: Output the edge detection result E α under scale α and the minimum gradient amplitude M α that is meaningful for detecting line segments.
优选地,多尺度自适应Canny边缘检测结果表示为:Preferably, the multi-scale adaptive Canny edge detection result is expressed as:
式中,E(x,y)表示多尺度自适应Canny边缘检测结果;表示在尺度α=αi下的图像I的边缘检测结果;Avg(·)表示均值函数;M表示图像I中对检测线段有意义的最小梯度幅值;表示在尺度α=αi下的图像I中对检测线段有意义的最小梯度幅值。Where E(x,y) represents the multi-scale adaptive Canny edge detection result; represents the edge detection result of image I at scale α=α i ; Avg(·) represents the mean function; M represents the minimum gradient amplitude in image I that is meaningful for detecting line segments; It represents the minimum gradient magnitude meaningful for detecting line segments in image I at scale α= αi .
优选地,在步骤S3中,采用定向路由方法对预测出的线段进行校正,具体包括:Preferably, in step S3, a directional routing method is used to correct the predicted line segment, specifically including:
在预测线段的端点附近寻找具有以下属性的像素延伸线段:(a)、具有局部最大梯度幅值,并且Gm≥M,其中Gm表示梯度幅值,M表示对线段检测有意义的最小梯度幅值;(b)、距离线段所在直线足够近,即点到直线的距离小于一定阈值;(c)、与线段的大致方向一致,即像素的二值化的梯度方向与线段所属线段类型一致,线段类型包括水平线段和垂直线段;Find pixel extension segments with the following properties near the endpoints of the predicted line segment: (a) having a local maximum gradient amplitude and G m ≥ M, where G m represents the gradient amplitude and M represents the minimum gradient amplitude meaningful for line segment detection; (b) being close enough to the line where the line segment is located, that is, the distance from the point to the line is less than a certain threshold; (c) being consistent with the general direction of the line segment, that is, the binary gradient direction of the pixel is consistent with the line segment type to which the line segment belongs, and the line segment types include horizontal line segments and vertical line segments;
使用深度优先策略尽可能进行线段延伸,即沿着当前方向添加尽可能多的像素;当遇到不同的方向时,在搜索树中创建一个同级分支,即以当前搜索到的像素为起点,所遇到的不同方向为初始方向进行新的线段延伸。Use the depth-first strategy to extend the line segment as much as possible, that is, add as many pixels as possible along the current direction; when encountering different directions, create a sibling branch in the search tree, that is, use the currently searched pixel as the starting point and the different directions encountered as the initial direction to extend the new line segment.
优选地,每次延伸线段时,均需要对线段进行再次拟合。Preferably, each time a line segment is extended, the line segment needs to be fitted again.
优选地,在步骤S4中,对校正后的线段进行验证,输出最终的线段,具体包括:Preferably, in step S4, the corrected line segment is verified and the final line segment is output, which specifically includes:
对校正后的线段采用后验证策略:对于用于拟合线段的每个像素(x,y),首先将其投影到线段上,然后使用双线性插值计算该投影点的梯度方向,并将其与线段的法线方向进行比较,以得出角度误差θE;A post-verification strategy is adopted for the corrected line segment: for each pixel (x, y) used to fit the line segment, it is first projected onto the line segment, and then the gradient direction of the projected point is calculated using bilinear interpolation and compared with the normal direction of the line segment to obtain the angle error θ E ;
基于角度误差θE,计算校正后的线段的置信度S,根据置信度S的大小去除不可信的线段,即只有S>0.5的线段才作为最终的线段输出。Based on the angle error θ E , the confidence S of the corrected line segment is calculated, and unreliable line segments are removed according to the size of the confidence S, that is, only line segments with S>0.5 are output as the final line segments.
优选地,所述校正后的线段的置信度S计算公式为:Preferably, the confidence S of the corrected line segment is calculated as follows:
式中,L表示用于拟合线段的像素集合;I{·}表示指示函数;τθ表示阈值,根据经验设定为0.15。Where L represents the pixel set used to fit the line segment; I {·} represents the indicator function; τ θ represents the threshold value, which is set to 0.15 based on experience.
本发明实施例还提供了一种基于预测校正机制的直线段检测系统,该系统用于实现上述所述的基于预测校正机制的直线段检测方法,具体包括:The embodiment of the present invention further provides a straight line segment detection system based on a prediction and correction mechanism, which is used to implement the above-mentioned straight line segment detection method based on the prediction and correction mechanism, and specifically includes:
计算模块,用于计算输入图像的梯度幅值和梯度方向;A calculation module, used for calculating the gradient magnitude and gradient direction of the input image;
预测模块,用于基于提前设计好的多尺度自适应Canny边缘检测器预测图像中的线段,具体包括:首先基于多尺度自适应Canny边缘检测器,通过设置三个尺度参数对输入图像进行边缘检测;然后将来自这三个不同尺度信息的边缘融合成最终的边缘;最后对边缘执行非极大值抑制并使用最小二乘法进行线段拟合,得到线段所在直线的方程表达式以及线段的端点坐标,即得到预测线段;The prediction module is used to predict the line segments in the image based on the pre-designed multi-scale adaptive Canny edge detector, specifically including: firstly, based on the multi-scale adaptive Canny edge detector, edge detection is performed on the input image by setting three scale parameters; then, the edges from the three different scale information are fused into the final edge; finally, non-maximum suppression is performed on the edge and the least squares method is used to perform line segment fitting to obtain the equation expression of the straight line where the line segment is located and the endpoint coordinates of the line segment, that is, the predicted line segment is obtained;
校正模块,用于采用定向路由方法对预测出的线段进行校正;A correction module, used for correcting the predicted line segments using a directional routing method;
验证模块,用于对校正后的线段进行验证,输出最终的线段。The verification module is used to verify the corrected line segments and output the final line segments.
本发明实施例还提供了一种计算机存储介质,所述计算机存储介质存储有计算机软件产品,所述计算机软件产品包括的若干指令,用以使得一台计算机设备执行上述所述的基于预测校正机制的直线段检测方法。An embodiment of the present invention further provides a computer storage medium storing a computer software product. The computer software product includes several instructions for enabling a computer device to execute the above-mentioned straight line segment detection method based on the prediction and correction mechanism.
从以上技术方案可以看出,本发明申请具有以下有益效果:It can be seen from the above technical solutions that the present invention has the following beneficial effects:
(1)针对现有方法检测的线段的完整性不高的问题,本发明并未直接在计算图像梯度步骤施加阈值以控制假阳性,而是设计多尺度自适应Canny边缘检测器,其能提取出图像中所有与线段有关的边缘特征,将所有对检测线段有益的像素都考虑在内。(1) To address the problem of low integrity of line segments detected by existing methods, the present invention does not directly apply a threshold in the step of calculating image gradients to control false positives, but instead designs a multi-scale adaptive Canny edge detector that can extract all edge features related to line segments in the image and take into account all pixels that are beneficial to detecting line segments.
(2)针对现有方法检测不到低对比度区域的线索的问题,本发明设计了预测校正方法,首先根据多尺度自适应Canny边缘检测器提供的边缘特征与自适应梯度阈值,有效地预测出图像任何区域所包含的线段,然后利用定向路由方法不断地校正预测的线段,通过这样两步走的方式能够有效地检测低对比度区域的线段。(2) To address the problem that existing methods cannot detect clues in low-contrast areas, the present invention designs a prediction and correction method. First, based on the edge features and adaptive gradient threshold provided by the multi-scale adaptive Canny edge detector, the line segments contained in any area of the image are effectively predicted. Then, the predicted line segments are continuously corrected using a directed routing method. This two-step approach can effectively detect line segments in low-contrast areas.
(3)针对现有方法的检测效率不高的问题,本发明直接在多尺度自适应Canny边缘检测器所提取的边缘上进行非极大值抑制,很大程度上减少了计算量,且进一步地将噪声因素排除在外,可以提取高质量的锚点用于拟合预测线段,在提升效率的同时还为后续检测步骤提供了坚实的基础。(3) In order to address the problem of low detection efficiency of existing methods, the present invention directly performs non-maximum suppression on the edges extracted by the multi-scale adaptive Canny edge detector, which greatly reduces the amount of calculation and further excludes noise factors. It can extract high-quality anchor points for fitting predicted line segments, which not only improves efficiency but also provides a solid foundation for subsequent detection steps.
(4)针对现有方法无法提取图像中有关线段的所有细节的问题,本发明中设计的多尺度自适应Canny边缘检测器在多个不同的图像尺度下捕捉并整合有关线段的细节,同时考虑了图像整体和局部的线段细节。因此能够捕获图像中所有有关线段的细节。(4) In view of the problem that existing methods cannot extract all details of line segments in an image, the multi-scale adaptive Canny edge detector designed in the present invention captures and integrates the details of line segments at multiple different image scales, while considering the overall and local line segment details of the image. Therefore, it is possible to capture all details of line segments in an image.
(5)针对现有检测的线段的方向和位置的准确度不高的问题,本发明设计了定向路由方法,其能够利用线段的方向和位置寻找符合条件的下一个锚点,减少了对梯度方向的依赖,且该方法还会将对检测线段有益的像素添加到对应的链表中进行线段延伸操作。每次延伸都会对线段进行再拟合以达到纠正该线段的方向和位置,不断地提高其方向和位置的准确度。(5) In view of the problem that the direction and position of the existing detected line segments are not accurate, the present invention designs a directional routing method, which can use the direction and position of the line segment to find the next anchor point that meets the conditions, reducing the dependence on the gradient direction. In addition, the method will add pixels that are beneficial to the detected line segment to the corresponding linked list for line segment extension. Each extension will refit the line segment to correct the direction and position of the line segment, continuously improving the accuracy of its direction and position.
附图说明BRIEF DESCRIPTION OF THE DRAWINGS
为了更清楚地说明本发明实施案例或现有技术中的技术方案,下边将对实施例中所需要使用的附图做简单说明,通过参考附图会更清楚的理解本发明的特征和优点,附图是示意性的而不应该理解为对本发明进行任何限制,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,可以根据这些附图获得其他的附图。其中:In order to more clearly illustrate the implementation cases of the present invention or the technical solutions in the prior art, the following is a brief description of the drawings required for use in the embodiments. By referring to the drawings, the features and advantages of the present invention will be more clearly understood. The drawings are schematic and should not be understood as limiting the present invention in any way. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work. Among them:
图1背景技术中现有的基于边缘点的直线段检测方法的流程图;FIG1 is a flowchart of an existing edge point based straight line segment detection method in the background art;
图2为实施例中提供的一种基于预测校正机制的直线段检测方法的流程图;FIG2 is a flow chart of a straight line segment detection method based on a prediction correction mechanism provided in an embodiment;
图3为实施例中提供的一种基于预测校正机制的直线段检测方法的简要流程图;FIG3 is a simplified flow chart of a straight line segment detection method based on a prediction and correction mechanism provided in an embodiment;
图4为实施例中单个尺度下自适应Canny边缘检测器的检测流程图;FIG4 is a detection flow chart of an adaptive Canny edge detector at a single scale in an embodiment;
图5为实施例中不同边缘检测方法的主观比较图;FIG5 is a subjective comparison diagram of different edge detection methods in the embodiment;
图6为实施例中不同方法的主观比较图;FIG6 is a subjective comparison diagram of different methods in the embodiment;
图7为实施例中提供的一种基于预测校正机制的直线段检测系统的框图。FIG. 7 is a block diagram of a straight line segment detection system based on a prediction and correction mechanism provided in an embodiment.
具体实施方式DETAILED DESCRIPTION
为使本发明实施例的目的、技术方案与优点更加清楚,下面将结合本发明实施例中的附图,对本发明实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例是本发明一部分实施例,而不是全部的实施例。基于本发明中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都属于本发明保护的范围。In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
实施例一Embodiment 1
如图2、图3所示,本发明实施例提出一种基于预测校正机制的直线段检测方法,该方法包括:As shown in FIG. 2 and FIG. 3 , an embodiment of the present invention proposes a straight line segment detection method based on a prediction correction mechanism, the method comprising:
步骤S1:计算输入图像的梯度幅值和梯度方向;Step S1: Calculate the gradient magnitude and gradient direction of the input image;
步骤S2:基于提前设计好的多尺度自适应Canny边缘检测器预测图像中的线段,具体包括:首先基于多尺度自适应Canny边缘检测器,通过设置三个尺度参数对输入图像进行边缘检测;然后将来自这三个不同尺度信息的边缘融合成最终的边缘;最后对边缘执行非极大值抑制并使用最小二乘法进行线段拟合,得到线段所在直线的方程表达式以及线段的端点坐标,即得到预测线段;Step S2: predicting line segments in the image based on a pre-designed multi-scale adaptive Canny edge detector, specifically comprising: firstly, performing edge detection on the input image based on the multi-scale adaptive Canny edge detector by setting three scale parameters; then fusing the edges from the three different scale information into the final edge; finally, performing non-maximum suppression on the edge and using the least squares method to perform line segment fitting, obtaining the equation expression of the straight line where the line segment is located and the coordinates of the endpoints of the line segment, that is, obtaining the predicted line segment;
步骤S3:采用定向路由方法对预测出的线段进行校正;Step S3: Correcting the predicted line segment using a directional routing method;
步骤S4:对校正后的线段进行验证,输出最终的线段。Step S4: Verify the corrected line segment and output the final line segment.
从上述技术方案可知,本发明提出一种基于预测校正机制的直线段检测方法,首先计算输入图像的梯度幅值和梯度方向;然后基于提前设计好的多尺度自适应Canny边缘检测器预测图像中的线段,利用设计的多尺度自适应Canny边缘检测器能够捕获图像中所有有关线段的细节,同时,基于本发明设计的多尺度自适应Canny边缘检测器所提取的边缘进行锚点提取,能够显著地提高线段检测效率,且进一步地减少噪声干扰;其次,本发明利用定向路由方法能够提升线段的完整性,提出的线段检测的预测校正机制能够不断地校正线段的方向和位置,提高了最终线段的方向和位置的准确度;最后,本发明设计的线段校正后验证策略可以移除低置信度的线段,从而有效地控制了假阳性。It can be seen from the above technical scheme that the present invention proposes a straight line segment detection method based on a prediction and correction mechanism, which first calculates the gradient amplitude and gradient direction of the input image; then, based on the pre-designed multi-scale adaptive Canny edge detector, the line segments in the image are predicted, and the designed multi-scale adaptive Canny edge detector can capture all the details of the relevant line segments in the image. At the same time, anchor point extraction is performed based on the edges extracted by the multi-scale adaptive Canny edge detector designed by the present invention, which can significantly improve the efficiency of line segment detection and further reduce noise interference; secondly, the present invention can improve the integrity of the line segment by using a directional routing method, and the proposed prediction and correction mechanism for line segment detection can continuously correct the direction and position of the line segment, thereby improving the accuracy of the direction and position of the final line segment; finally, the line segment correction verification strategy designed by the present invention can remove low-confidence line segments, thereby effectively controlling false positives.
在本实施例中,在步骤S1中,计算输入图像的梯度幅值和梯度方向,具体包括:In this embodiment, in step S1, the gradient magnitude and gradient direction of the input image are calculated, which specifically includes:
首先,将输入的彩色图像转变为灰度图像I(x,y);其次,对灰度图像I(x,y)进行高斯平滑减少噪声影响;然后,利用Sobel算子计算高斯平滑后的灰度图像的梯度其中gx和gy分别是关于x和y的导数,梯度方向Gθ的计算公式为:First, the input color image is converted into a grayscale image I(x,y); secondly, the grayscale image I(x,y) is Gaussian smoothed to reduce the influence of noise; then, the Sobel operator is used to calculate the gradient of the grayscale image after Gaussian smoothing. Where gx and gy are the derivatives with respect to x and y respectively, and the calculation formula for the gradient direction Gθ is:
Gθ=arctan(gy/gx); Gθ =arctan( gy / gx );
梯度幅值Gm的计算公式为:The calculation formula of the gradient amplitude Gm is:
Gm=|gx|+|gy|G m = |g x |+|g y |
式中,|·|表示L1范数。这里使用L1范数来计算梯度幅值是考虑到其较低的计算成本。为了便于后续的定向路由步骤,梯度方向Gθ按如下方式进行了二值化:如果一个像素的|gx|≥|gy|,则该像素是垂直定向的;否则它是水平定向的。简单来说,就是提前判断像素属于垂直线段还是水平线段。Here, |·| represents the L1 norm. The L1 norm is used here to calculate the gradient magnitude because of its lower computational cost. To facilitate the subsequent directional routing step, the gradient direction Gθ is binarized as follows: if | gx |≥| gy | of a pixel, the pixel is vertically oriented; otherwise, it is horizontally oriented. In simple terms, it is to determine in advance whether the pixel belongs to a vertical line segment or a horizontal line segment.
在本实施例中,在步骤S2中,基于提前设计好的多尺度自适应Canny边缘检测器预测图像中的线段,具体包括:首先基于多尺度自适应Canny边缘检测器,通过设置三个尺度参数对输入图像进行边缘检测;然后将来自这三个不同尺度信息的边缘融合成最终的边缘;最后对边缘执行非极大值抑制并使用最小二乘法进行线段拟合,得到线段所在直线的方程表达式以及线段的端点坐标,即得到预测线段。In this embodiment, in step S2, line segments in the image are predicted based on a pre-designed multi-scale adaptive Canny edge detector, specifically including: first, based on the multi-scale adaptive Canny edge detector, edge detection is performed on the input image by setting three scale parameters; then, the edges from the three different scale information are fused into the final edge; finally, non-maximum suppression is performed on the edge and the least squares method is used to perform line segment fitting to obtain the equation expression of the straight line where the line segment is located and the endpoint coordinates of the line segment, that is, the predicted line segment is obtained.
具体地,CannyLines基于亥姆霍兹原理提出了求Canny边缘的双阈值方法,该方法是自适应的,其能够针对不同的图像提供对检测线段有意义的最小梯度幅值。此外,CannyLines对边缘进行了优化,使得检测的边缘能够符合线段特征,即局部边缘像素的梯度方向几乎一致。但是,CannyLines只考虑了图像的单一尺度,丢失了部分细节。为了获取更为鲁棒且准确的边缘信息,对图像进行了3个不同尺度的边缘检测(利用第一自适应Canny边缘检测器、第二自适应Canny边缘检测器、第三自适应Canny边缘检测器)。Specifically, CannyLines proposed a dual threshold method for finding Canny edges based on the Helmholtz principle. This method is adaptive and can provide the minimum gradient amplitude that is meaningful for detecting line segments for different images. In addition, CannyLines optimizes the edges so that the detected edges can conform to the line segment characteristics, that is, the gradient directions of local edge pixels are almost consistent. However, CannyLines only considers a single scale of the image and loses some details. In order to obtain more robust and accurate edge information, edge detection is performed on the image at three different scales (using the first adaptive Canny edge detector, the second adaptive Canny edge detector, and the third adaptive Canny edge detector).
进一步地,如图4所示,单个尺度下自适应Canny边缘检测器的检测流程包括以下步骤:Further, as shown in FIG4 , the detection process of the adaptive Canny edge detector at a single scale includes the following steps:
步骤一:设置尺度参数α=α1,α2,α3,将输入图像基于α等分,即分成α2个子图,每个子图的大小为其中h,w分别表示原图像的长和宽;Step 1: Set the scale parameter α = α 1 , α 2 , α 3 , and divide the input image into α 2 sub-images based on α. The size of each sub-image is Where h and w represent the length and width of the original image respectively;
步骤二:基于亥姆霍兹原理计算各个子图Ii对应的对线段检测有意义的最小梯度幅值,计算公式如下:Step 2: Based on the Helmholtz principle, the minimum gradient amplitude that is meaningful for line segment detection corresponding to each sub-image I i is calculated. The calculation formula is as follows:
ei,mi=CannyL(Ii)e i ,m i =CannyL(I i )
式中,CannyL(·)表示CannyLines的边缘检测方法;ei表示该子图Ii的自适应边缘检测结果;mi表示子图Ii中对检测线段有意义的最小梯度幅值;Where, CannyL(·) represents the edge detection method of CannyLines; e i represents the adaptive edge detection result of the sub-image I i ; mi represents the minimum gradient amplitude meaningful for detecting line segments in sub-image I i ;
步骤三:拼接各个子图Ii的边缘结果ei,并计算各个子图的mi的均值,于是,得到在尺度α下的图像I的边缘检测结果Eα:Step 3: Concatenate the edge results e i of each sub-image I i and calculate the mean of each sub-image mi . Then, the edge detection result E α of image I at scale α is obtained:
以及对检测线段有意义的最小梯度幅值Mα:And the minimum gradient magnitude M α that is meaningful for detecting line segments:
式中,Concat(·)表示拼接函数;Avg(·)表示均值函数; In the formula, Concat(·) represents the concatenation function; Avg(·) represents the mean function;
步骤四:输出尺度α下的边缘检测结果Eα及对检测线段有意义的最小梯度幅值Mα。Step 4: Output the edge detection result E α under scale α and the minimum gradient amplitude M α that is meaningful for detecting line segments.
进一步地,多尺度自适应Canny边缘检测结果表示为:Furthermore, the multi-scale adaptive Canny edge detection result is expressed as:
式中,E(x,y)表示多尺度自适应Canny边缘检测结果;表示在尺度α=αi下的图像I的边缘检测结果;Avg(·)表示均值函数;M表示图像I中对检测线段有意义的最小梯度幅值;表示在尺度α=αi下的图像I中对检测线段有意义的最小梯度幅值。Where E(x,y) represents the multi-scale adaptive Canny edge detection result; represents the edge detection result of image I at scale α=α i ; Avg(·) represents the mean function; M represents the minimum gradient amplitude in image I that is meaningful for detecting line segments; It represents the minimum gradient magnitude meaningful for detecting line segments in image I at scale α= αi .
基于这些边缘,可以很容易地预测线段:定义一条边缘段为e,对于每个像素(x,y)∈e,如果它的梯度幅值是局部最大值,则它是锚点。属于该边缘的锚点集合即为一个线段预测,接着基于最小二乘法拟合这些锚点集合,即为线段预测(包括线段所在直线的方程表达式和线段的端点坐标)。Based on these edges, it is easy to predict line segments: define an edge segment as e, and for each pixel (x, y)∈e, if its gradient magnitude is a local maximum, it is an anchor point. The set of anchor points belonging to the edge is a line segment prediction, and then these anchor point sets are fitted based on the least squares method, which is the line segment prediction (including the equation expression of the line where the line segment is located and the coordinates of the endpoints of the line segment).
本发明利用自适应Canny边缘检测方法,分别针对图像的全局和局部(即多尺度)特征进行边缘检测,并将这些信息融合以获取更为鲁棒且准确的符合线段特征的边缘细节。实验证明,该边缘检测器能够有效且全面地提取和整合符合线段特征的图像边缘。基于这些边缘可以给出图像中所有有意义的且高质量的线段预测,因此能够提升整体线段检测性能。The present invention uses the adaptive Canny edge detection method to perform edge detection on the global and local (i.e., multi-scale) features of the image, and fuses this information to obtain more robust and accurate edge details that conform to line segment features. Experiments have shown that the edge detector can effectively and comprehensively extract and integrate image edges that conform to line segment features. Based on these edges, all meaningful and high-quality line segment predictions in the image can be given, thereby improving the overall line segment detection performance.
在本实施例中,在步骤S3中,采用定向路由方法对预测出的线段进行校正。In this embodiment, in step S3, a directional routing method is used to correct the predicted line segment.
具体地,由于预测线段只是给出了图像中线段的大致位置和方法,可能有着较大的误差,且线段完整性不高。为此,我们设计了一个定向路由方法用于校正线段。按照以下步骤实施:Specifically, since the predicted line segment only gives the approximate position and method of the line segment in the image, there may be a large error and the integrity of the line segment is not high. Therefore, we designed a directional routing method for correcting the line segment. Follow the steps below to implement it:
在预测线段的端点附近寻找具有以下属性的像素延伸线段:(a)、具有局部最大梯度幅值,并且Gm≥M,其中Gm表示梯度幅值,M表示对线段检测有意义的最小梯度幅值;(b)、距离线段所在直线足够近,即点到直线的距离小于一定阈值;(c)、与线段的大致方向一致,即像素的二值化的梯度方向与线段所属线段类型一致,线段类型包括水平线段和垂直线段;Find pixel extension segments with the following properties near the endpoints of the predicted line segment: (a) having a local maximum gradient amplitude and G m ≥ M, where G m represents the gradient amplitude and M represents the minimum gradient amplitude meaningful for line segment detection; (b) being close enough to the line where the line segment is located, that is, the distance from the point to the line is less than a certain threshold; (c) being consistent with the general direction of the line segment, that is, the binary gradient direction of the pixel is consistent with the line segment type to which the line segment belongs, and the line segment types include horizontal line segments and vertical line segments;
使用深度优先策略尽可能进行线段延伸,即沿着当前方向添加尽可能多的像素;当遇到不同的方向时,在搜索树中创建一个同级分支,即以当前搜索到的像素为起点,所遇到的不同方向为初始方向进行新的线段延伸。Use the depth-first strategy to extend the line segment as much as possible, that is, add as many pixels as possible along the current direction; when encountering different directions, create a sibling branch in the search tree, that is, use the currently searched pixel as the starting point and the different directions encountered as the initial direction to extend the new line segment.
需要注意的是,每次延伸线段时,都需要对线段进行再拟合以提高线段的方向和位置的准确性。此外,在延伸过程中可能会发现新的线段,这将被定向路由方法所记录以便后续的线段检测。It should be noted that each time a line segment is extended, it needs to be refitted to improve the accuracy of the direction and position of the line segment. In addition, new line segments may be found during the extension process, which will be recorded by the directional routing method for subsequent line segment detection.
本发明首次将预测校正方法应用于线段检测,利用多尺度自适应Canny边缘检测器捕捉图像中符合线段特征的所有边缘细节进行线段预测,然后利用定向路由方法对这些预测线段进行校正以提高其完整性及其位置和方向的准确性。实验证明该方法可以有效检测低对比度区域中的线段,这是现有方法所无法实现的。这将对进一步的图像任务,例如3D重建,提供更好的底层技术支持。This paper applies the prediction correction method to line segment detection for the first time, using a multi-scale adaptive Canny edge detector to capture all edge details that meet the line segment characteristics in the image for line segment prediction, and then uses a directional routing method to correct these predicted line segments to improve their integrity and the accuracy of their position and direction. Experiments have shown that this method can effectively detect line segments in low-contrast areas, which is impossible with existing methods. This will provide better underlying technical support for further image tasks, such as 3D reconstruction.
在本实施例中,在步骤S4中,对校正后的线段进行验证,输出最终的线段。In this embodiment, in step S4, the corrected line segment is verified and the final line segment is output.
具体地,经过定向路由方法校正的线段可能有许多误报,主要发生在边缘像素密度高的区域,例如树叶、草丛等。为了确保最终输出线段的置信度,对校正后的线段采用后验证策略:对于用于拟合线段的每个像素(x,y),首先将其投影到线段上,然后使用双线性插值计算该投影点的梯度方向,并将其与线段的法线方向进行比较,以得出角度误差θE。Specifically, the line segments corrected by the directional routing method may have many false positives, which mainly occur in areas with high edge pixel density, such as leaves, grass, etc. In order to ensure the confidence of the final output line segments, a post-verification strategy is adopted for the corrected line segments: for each pixel (x, y) used to fit the line segment, it is first projected onto the line segment, and then the gradient direction of the projected point is calculated using bilinear interpolation, and compared with the normal direction of the line segment to obtain the angle error θ E .
进一步地,基于角度误差θE,计算校正后的线段的置信度S,根据置信度S的大小去除不可信的线段,即只有S>0.5的线段才作为最终的线段输出。实验证明,该策略可以移除低置信度的线段,从而有效地控制了假阳性。Furthermore, based on the angle error θ E , the confidence S of the corrected line segment is calculated, and unreliable line segments are removed according to the size of the confidence S, that is, only line segments with S>0.5 are output as the final line segments. Experiments have shown that this strategy can remove low-confidence line segments, thereby effectively controlling false positives.
其中校正后的线段的置信度S计算公式为:The confidence S of the corrected line segment is calculated as follows:
式中,L表示用于拟合线段的像素集合;I{·}表示指示函数;τθ表示阈值,根据经验设定为0.15。Where L represents the pixel set used to fit the line segment; I {·} represents the indicator function; τ θ represents the threshold value, which is set to 0.15 based on experience.
表1展示了本发明与现有的线段检测方法关于客观测评指标的结果,对比方法包含了最新的经典方法和深度学习方法。客观测评指标分别为:精确率和召回率的算术平均值(APR),精确率和召回率的调和平均值(F-score)和交并比(IoU)。Con1和Con2分别表示宽松和严格的测评环境。可以看到,本发明在绝大多数情况下都取得了最好的成绩。Table 1 shows the results of the objective evaluation indicators of the present invention and the existing line segment detection methods. The comparison methods include the latest classical methods and deep learning methods. The objective evaluation indicators are: the arithmetic mean of precision and recall (APR), the harmonic mean of precision and recall (F-score) and the intersection over union (IoU). Con 1 and Con 2 represent loose and strict evaluation environments, respectively. It can be seen that the present invention achieves the best results in most cases.
表1Table 1
图5是本发明设计的多尺度自适应Canny边缘检测器与CannyLines的边缘检测方法和最新的现有深度边缘检测器的边缘检测结果对比,可以看到本设计的检测效果更好,可以全面地捕获符合线段特征的边缘细节。FIG5 is a comparison of the edge detection results of the multi-scale adaptive Canny edge detector designed by the present invention, the CannyLines edge detection method, and the latest existing deep edge detector. It can be seen that the detection effect of the present design is better and the edge details that conform to the line segment features can be fully captured.
图6展示了本发明与现有的线段检测方法的主观测评,可以看到本发明能够有效地检测低对比度区域的线段,且检测到的线段的完整性更高,与实际线段之间的角度和位置误差更小。由客观和主观的比较,可以得出我们的方法能够有效地解决现有方法的缺点,因此取得了最好的检测性能。Figure 6 shows the subjective evaluation of the present invention and the existing line segment detection method. It can be seen that the present invention can effectively detect line segments in low-contrast areas, and the detected line segments are more complete, and the angle and position errors between the actual line segments are smaller. From the objective and subjective comparison, it can be concluded that our method can effectively solve the shortcomings of the existing methods, and thus achieve the best detection performance.
实施例二Embodiment 2
如图7所示,本发明提供一种基于预测校正机制的直线段检测系统,该系统用于实现上述实施例一的基于预测校正机制的直线段检测方法,具体包括:As shown in FIG. 7 , the present invention provides a straight line segment detection system based on a prediction correction mechanism, which is used to implement the straight line segment detection method based on a prediction correction mechanism of the first embodiment, and specifically includes:
计算模块10,用于计算输入图像的梯度幅值和梯度方向;A calculation module 10, used to calculate the gradient magnitude and gradient direction of the input image;
预测模块20,用于基于提前设计好的多尺度自适应Canny边缘检测器预测图像中的线段,具体包括:首先基于多尺度自适应Canny边缘检测器,通过设置三个尺度参数对输入图像进行边缘检测;然后将来自这三个不同尺度信息的边缘融合成最终的边缘;最后对边缘执行非极大值抑制并使用最小二乘法进行线段拟合,得到线段所在直线的方程表达式以及线段的端点坐标,即得到预测线段;The prediction module 20 is used to predict the line segments in the image based on the pre-designed multi-scale adaptive Canny edge detector, specifically comprising: firstly, based on the multi-scale adaptive Canny edge detector, edge detection is performed on the input image by setting three scale parameters; then, the edges from the three different scale information are merged into the final edge; finally, non-maximum suppression is performed on the edge and the line segment is fitted using the least squares method to obtain the equation expression of the straight line where the line segment is located and the endpoint coordinates of the line segment, that is, the predicted line segment is obtained;
校正模块30,用于采用定向路由方法对预测出的线段进行校正;A correction module 30, for correcting the predicted line segment using a directional routing method;
验证模块40,用于对校正后的线段进行验证,输出最终的线段。The verification module 40 is used to verify the corrected line segment and output the final line segment.
本实施例的一种基于预测校正机制的直线段检测系统,用于实现前述的基于预测校正机制的直线段检测方法,因此基于预测校正机制的直线段检测系统中的具体实施方式可见前文基于预测校正机制的直线段检测方法的实施例部分,例如,计算模块10,预测模块20,校正模块30,验证模块40,分别用于实现上述基于预测校正机制的直线段检测方法中步骤S1,S2,S3,S4,所以,其具体实施方式可以参照相应的各个部分实施例的描述,为了避免冗余,在此不再赘述。A straight line segment detection system based on a prediction and correction mechanism in this embodiment is used to implement the aforementioned straight line segment detection method based on a prediction and correction mechanism. Therefore, the specific implementation method of the straight line segment detection system based on the prediction and correction mechanism can be seen in the embodiment part of the straight line segment detection method based on the prediction and correction mechanism in the previous text. For example, the calculation module 10, the prediction module 20, the correction module 30, and the verification module 40 are respectively used to implement steps S1, S2, S3, and S4 in the above-mentioned straight line segment detection method based on the prediction and correction mechanism. Therefore, its specific implementation method can refer to the description of the corresponding embodiments of each part. In order to avoid redundancy, it will not be repeated here.
实施例三Embodiment 3
本发明实施例还提供了一种计算机存储介质,所述计算机存储介质存储有计算机软件产品,所述计算机软件产品包括的若干指令,用以使得一台计算机设备执行上述所述的基于预测校正机制的直线段检测方法。An embodiment of the present invention further provides a computer storage medium storing a computer software product. The computer software product includes several instructions for enabling a computer device to execute the above-mentioned straight line segment detection method based on the prediction and correction mechanism.
本领域内的技术人员应明白,本申请的实施例可提供为方法、系统、或计算机程序产品。因此,本申请可采用完全硬件实施例、完全软件实施例、或结合软件和硬件方面的实施例的形式。而且,本申请可采用在一个或多个其中包含有计算机可用程序代码的计算机可用存储介质(包括但不限于磁盘存储器、CD-ROM、光学存储器等)上实施的计算机程序产品的形式。Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment in combination with software and hardware. Moreover, the present application may adopt the form of a computer program product implemented in one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that include computer-usable program code.
本申请是参照根据本申请实施例的方法、设备(系统)、和计算机程序产品的流程图和/或方框图来描述的。应理解可由计算机程序指令实现流程图和/或方框图中的每一流程和/或方框、以及流程图和/或方框图中的流程和/或方框的结合。可提供这些计算机程序指令到通用计算机、专用计算机、嵌入式处理机或其他可编程数据处理设备的处理器以产生一个机器,使得通过计算机或其他可编程数据处理设备的处理器执行的指令产生用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的装置。The present application is described with reference to the flowchart and/or block diagram of the method, device (system) and computer program product according to the embodiment of the present application. It should be understood that each process and/or box in the flowchart and/or block diagram, and the combination of the process and/or box in the flowchart and/or block diagram can be realized by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device produce a device for realizing the function specified in one process or multiple processes in the flowchart and/or one box or multiple boxes in the block diagram.
这些计算机程序指令也可存储在能引导计算机或其他可编程数据处理设备以特定方式工作的计算机可读存储器中,使得存储在该计算机可读存储器中的指令产生包括指令装置的制造品,该指令装置实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能。这些计算机程序指令也可装载到计算机或其他可编程数据处理设备上,使得在计算机或其他可编程设备上执行一系列操作步骤以产生计算机实现的处理,从而在计算机或其他可编程设备上执行的指令提供用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的步骤。These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce a manufactured product including an instruction device that implements the functions specified in one or more processes of the flowchart and/or one or more blocks of the block diagram. These computer program instructions may also be loaded onto a computer or other programmable data processing device so that a series of operating steps are performed on the computer or other programmable device to produce a computer-implemented process, so that the instructions executed on the computer or other programmable device provide steps for implementing the functions specified in one or more processes of the flowchart and/or one or more blocks of the block diagram.
显然,上述实施例仅仅是为清楚地说明所作的举例,并非对实施方式的限定。对于所属领域的普通技术人员来说,在上述说明的基础上还可以做出其它不同形式变化或变动。这里无需也无法对所有的实施方式予以穷举。而由此所引申出的显而易见的变化或变动仍处于本发明创造的保护范围之中。Obviously, the above embodiments are merely examples for clear explanation and are not intended to limit the implementation methods. For those skilled in the art, other different forms of changes or modifications can be made based on the above description. It is not necessary and impossible to list all the implementation methods here. The obvious changes or modifications derived from these are still within the protection scope of the invention.
Claims (8)
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202410134046.6A CN117994222B (en) | 2024-01-31 | 2024-01-31 | Straight line segment detection method and system based on prediction correction mechanism |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202410134046.6A CN117994222B (en) | 2024-01-31 | 2024-01-31 | Straight line segment detection method and system based on prediction correction mechanism |
Publications (2)
| Publication Number | Publication Date |
|---|---|
| CN117994222A CN117994222A (en) | 2024-05-07 |
| CN117994222B true CN117994222B (en) | 2025-05-30 |
Family
ID=90894728
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| CN202410134046.6A Active CN117994222B (en) | 2024-01-31 | 2024-01-31 | Straight line segment detection method and system based on prediction correction mechanism |
Country Status (1)
| Country | Link |
|---|---|
| CN (1) | CN117994222B (en) |
Citations (2)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN110288624A (en) * | 2019-06-28 | 2019-09-27 | 苏州大学 | Method, device and related equipment for detecting straight line segment in image |
| CN111652825A (en) * | 2020-08-06 | 2020-09-11 | 上海海栎创微电子有限公司 | Edge tracking straight line segment rapid detection device and method based on gradient direction constraint |
Family Cites Families (4)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| AT505631B1 (en) * | 2007-06-28 | 2009-03-15 | Advanced Comp Vision Gmbh Acv | PROCESS FOR EXTRACTION OF EDGES |
| CN109816674A (en) * | 2018-12-27 | 2019-05-28 | 北京航天福道高技术股份有限公司 | An edge extraction method of registration map based on Canny operator |
| CN111080661B (en) * | 2019-12-09 | 2023-12-22 | Oppo广东移动通信有限公司 | Image-based straight line detection method and device and electronic equipment |
| CN111985329B (en) * | 2020-07-16 | 2024-03-29 | 浙江工业大学 | Remote sensing image information extraction method based on FCN-8s and improved Canny edge detection |
-
2024
- 2024-01-31 CN CN202410134046.6A patent/CN117994222B/en active Active
Patent Citations (2)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN110288624A (en) * | 2019-06-28 | 2019-09-27 | 苏州大学 | Method, device and related equipment for detecting straight line segment in image |
| CN111652825A (en) * | 2020-08-06 | 2020-09-11 | 上海海栎创微电子有限公司 | Edge tracking straight line segment rapid detection device and method based on gradient direction constraint |
Non-Patent Citations (1)
| Title |
|---|
| 张辉,罗林,王黎.基于改进多尺度小波的受电弓滑板边缘检测.信息技术.2015,194-196页. * |
Also Published As
| Publication number | Publication date |
|---|---|
| CN117994222A (en) | 2024-05-07 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| EP3620981B1 (en) | Object detection method, device, apparatus and computer-readable storage medium | |
| CN110458772B (en) | Point cloud filtering method and device based on image processing and storage medium | |
| CN114529459A (en) | Method, system and medium for enhancing image edge | |
| CN108961291A (en) | A kind of method of Image Edge-Detection, system and associated component | |
| JP2018520428A5 (en) | ||
| CN107169489B (en) | Method and apparatus for tilt image correction | |
| WO2020107326A1 (en) | Lane line detection method, device and computer readale storage medium | |
| CN110892255B (en) | Image processing apparatus, method and storage medium for detecting defect from image | |
| JP5728080B2 (en) | Wrinkle detection device, wrinkle detection method and program | |
| CN112149672B (en) | Image processing method and device, electronic equipment and storage medium | |
| WO2014129018A1 (en) | Character recognition device, character recognition method, and recording medium | |
| EP2536123A1 (en) | Image processing method and image processing apparatus | |
| CN113963010B (en) | Object contour line extraction method and system | |
| CN117994222B (en) | Straight line segment detection method and system based on prediction correction mechanism | |
| JP5761353B2 (en) | Ridge direction extraction device, ridge direction extraction method, ridge direction extraction program | |
| CN111192216B (en) | Lane line smoothing method and system | |
| US20170262963A1 (en) | Image processing method and image processing program | |
| CN114648751A (en) | Method, device, terminal and storage medium for processing video subtitles | |
| CN117994223A (en) | Image ellipse detection method and system based on contrast guidance | |
| CN116453063A (en) | Target detection and recognition method and system based on fusion of DR image and projection image | |
| CN112257710B (en) | A method and device for detecting the tilt of a picture with text plane | |
| CN108345893B (en) | Straight line detection method and device, computer storage medium and terminal | |
| US10839540B2 (en) | Apparatus and method for generating intermediate view image | |
| JP2013214132A (en) | Feature point information setting device, feature point information setting method, and feature point information setting program | |
| JP7024401B2 (en) | Information processing equipment, programs, and information processing methods |
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 |