CN117058036A - Road crack image preprocessing method based on LSD and FLD fusion - Google Patents
Road crack image preprocessing method based on LSD and FLD fusion Download PDFInfo
- Publication number
- CN117058036A CN117058036A CN202311062662.7A CN202311062662A CN117058036A CN 117058036 A CN117058036 A CN 117058036A CN 202311062662 A CN202311062662 A CN 202311062662A CN 117058036 A CN117058036 A CN 117058036A
- Authority
- CN
- China
- Prior art keywords
- image
- line segment
- straight line
- algorithm
- line
- 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.)
- Pending
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
- G06T7/0004—Industrial image inspection
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T2207/00—Indexing scheme for image analysis or image enhancement
- G06T2207/10—Image acquisition modality
- G06T2207/10004—Still image; Photographic image
Landscapes
- Engineering & Computer Science (AREA)
- Quality & Reliability (AREA)
- Computer Vision & Pattern Recognition (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Theoretical Computer Science (AREA)
- Image Processing (AREA)
Abstract
本发明属于图像处理领域,具体涉及一种基于LSD(Line Segment Detector)和FLD(Fast Line Detector)融合的道路裂缝图像预处理方法,具体技术方案包括:通过LSD算法和FLD算法对裂缝图像中的直线类干扰物(路标,路沿等)进行检测,并获取这些干扰物的线段坐标;根据直线检测算法返回的线段坐标值进行断线重连,解决了直线检测算法提取线段不连续的问题;根据前面获取的干扰物的线段坐标,生成只有干扰物的掩模图;利用掩模图和原图通过FMM(Fast Marching Method)算法,将原图中的干扰物替代为周围像素,达到消除干扰物的目的;本发明将道路裂缝图像中最容易被误识别为裂缝的干扰项消除,极大地提高了裂缝识别的准确度,同时实现方法与平台简单,执行效率高。
The invention belongs to the field of image processing, and specifically relates to a road crack image preprocessing method based on the fusion of LSD (Line Segment Detector) and FLD (Fast Line Detector). The specific technical solution includes: using the LSD algorithm and the FLD algorithm to detect the crack images in the crack image. Detect straight line interference objects (road signs, curbs, etc.) and obtain the line segment coordinates of these interference objects; disconnect and reconnect based on the line segment coordinate values returned by the straight line detection algorithm, solving the problem of discontinuous line segment extraction by the straight line detection algorithm; Based on the line segment coordinates of the distractors obtained previously, a mask image with only the distractors is generated; using the mask image and the original image through the FMM (Fast Marching Method) algorithm, the distractors in the original image are replaced with surrounding pixels to eliminate interference. The purpose of this invention is to eliminate interference items in road crack images that are most likely to be misidentified as cracks, greatly improving the accuracy of crack identification, and at the same time, the implementation method and platform are simple and the execution efficiency is high.
Description
技术领域Technical field
本发明属于图像处理领域,涉及一种道路裂缝图像干扰物消除的方法。The invention belongs to the field of image processing and relates to a method for eliminating interference objects in road crack images.
背景技术Background technique
裂缝类破损是公路最常见的病害之一,它会致使路面结构遭到损坏,从而降低路面整体性能和寿命,随着路面养护需求的增强,裂缝自动检测系统对路面养护极为重要,路面裂缝的参数信息有:种类、位置、损害程度和长宽深度等信息。由于路面的状况是复杂多变的,故检测路面裂缝信息仍有如下挑战:(1)难以迅速、正确、完整且平稳地识别路面裂缝;(2)裂缝识别算法的评价机制不够健全;(3)缺乏对路面裂缝种类和严重程度进行自动判别的成熟的系统。其中,难以迅速、正确、完整且平稳地识别路面裂缝是道路病害治理的重中之重,降低裂缝图像中非裂缝目标的干扰可有效提高裂缝识别的准确性。Crack damage is one of the most common road diseases. It will cause damage to the pavement structure, thereby reducing the overall performance and life of the pavement. As the demand for pavement maintenance increases, the automatic crack detection system is extremely important for pavement maintenance. The detection of pavement cracks Parameter information includes: type, location, damage extent, length, width, depth and other information. Since the condition of the road surface is complex and changeable, there are still the following challenges in detecting pavement crack information: (1) It is difficult to identify pavement cracks quickly, correctly, completely and smoothly; (2) The evaluation mechanism of the crack identification algorithm is not sound enough; (3) ) lacks a mature system for automatically identifying the types and severity of pavement cracks. Among them, it is difficult to quickly, correctly, completely and smoothly identify pavement cracks, which is the top priority in road disease management. Reducing the interference of non-crack targets in crack images can effectively improve the accuracy of crack identification.
发明内容Contents of the invention
3.1发明目的3.1 Purpose of invention
为解决裂缝检测中干扰物影响裂缝识别问题,本发明提出了一种基于LSD(LineSegment Detector)和FLD(Fast Line Detector)融合的道路裂缝图像预处理方法,用于消除道路裂缝图像中的直线类干扰物,提高道路裂缝检测的准确率,具体技术方案包括以下4个部分:In order to solve the problem of interference objects affecting crack recognition in crack detection, the present invention proposes a road crack image preprocessing method based on the fusion of LSD (Line Segment Detector) and FLD (Fast Line Detector), which is used to eliminate straight lines in road crack images. interference objects to improve the accuracy of road crack detection. The specific technical solution includes the following four parts:
(1)直线检测:通过LSD算法和FLD算法对裂缝图像中的直线类干扰物(路标,路沿等)进行检测,并获取其线段坐标;(1) Straight line detection: Use the LSD algorithm and FLD algorithm to detect straight line interference objects (road signs, curbs, etc.) in the crack image, and obtain their line segment coordinates;
(2)断线重连:根据获取的线段坐标进行断线重连,解决提取线段不连续问题;(2) Disconnection and reconnection: Disconnection and reconnection are performed based on the obtained line segment coordinates to solve the problem of discontinuous line segment extraction;
(3)获取掩模图:根据前面获取的干扰物的线段坐标,生成只有干扰物的掩模图;(3) Obtain the mask image: Based on the line segment coordinates of the interference object obtained previously, generate a mask image with only the interference object;
(4)消除干扰物:利用掩模图和原图通过FMM(FastMarching Method)算法,将原图中的干扰物替代为周围像素,达到消除干扰物的目的;(4) Eliminate interference objects: Use the mask image and the original image to use the FMM (Fast Marching Method) algorithm to replace the interference objects in the original image with surrounding pixels to achieve the purpose of eliminating interference objects;
3.2技术方案3.2 Technical solutions
本发明提出了一种基于LSD和FLD融合的道路裂缝图像预处理方法,以下就其具体技术方案进行详细的描述,其主要流程如图1所示:The present invention proposes a road crack image preprocessing method based on the fusion of LSD and FLD. The specific technical solution is described in detail below. The main process is shown in Figure 1:
直线检测阶段:LSD是一种直线检测算法,该算法是基于目标梯度的运算,能快速地检测出图像上亚像素级精度的直线特征;FLD直线检测算法是一种基于边缘检测的直线检测算法,其原理是通过对图像边缘进行分析,找到其中的直线特征。Straight line detection stage: LSD is a straight line detection algorithm, which is based on the operation of target gradient and can quickly detect straight line features with sub-pixel accuracy on the image; FLD straight line detection algorithm is a straight line detection algorithm based on edge detection. , its principle is to find the straight line features in the image edges by analyzing them.
本发明是关于裂缝图像的直线检测,所以在检测的过程中还要考虑不能将裂缝检测为直线。针对此问题,结合滤波、膨胀等传统预处理方法,提出了基于灰度级直方图自适应的结合不同阈值的LSD算法和FLD算法,来进行识别裂缝图像中的直线型干扰物。具体实现方法为:结合图像的灰度级直方图,统计获取裂缝图像中直线所占灰度级的具体范围以及该灰度级范围所占像素的总数,根据输入图像的不同自适应地使用LSD算法和FLD算法。首先,用labelme标注出粗细直线,生成mask图;其次,根据mask图和原图结合,生成直方图,可得直线的灰度级范围为0~60(如图2所示);然后,将所有图像分为细直线和粗直线两组,分别统计每张图像灰度级在0~60的像素值,获得粗线的像素值最小值min_pixel和细线像素值最大值max_pixel;最后,根据min_pixel和max_pixel使用LSD算法和FLD算法检测裂缝图像中的直线。在对道路裂缝图像进行预处理时,需要既快速又高效的方法,因此本发明运用自适应的方法来进行直线检测。不使用自适应的情况下进行本发明的预处理工作(流程图如图3所示),会因为每张图像都经过三次直线检测和三次直线消除工作而造成处理时间变长;使用自适应的方法后,图像灰度级在0~60的像素值高于130000的不经过FLD直线处理,低于10000的不经过LSD直线处理(如图4所示),在不降低直线检测率的情况下,大大的节省了预处理的时间。根据图像灰度值的不同使用不同的直线检测算法,FLD算法检测长细类直线,LSD算法检测长粗类直线和短直线。The present invention is about the straight line detection of crack images, so in the detection process, it is also necessary to consider that the cracks cannot be detected as straight lines. To address this problem, combined with traditional preprocessing methods such as filtering and dilation, an LSD algorithm and FLD algorithm based on grayscale histogram adaptation and combined with different thresholds are proposed to identify linear interference objects in crack images. The specific implementation method is: combined with the gray level histogram of the image, statistically obtains the specific range of gray levels occupied by the straight lines in the crack image and the total number of pixels occupied by the gray level range, and adaptively uses LSD according to the different input images. algorithm and the FLD algorithm. First, use labelme to mark straight lines of thickness to generate a mask image; secondly, based on the combination of the mask image and the original image, a histogram is generated, and the gray level range of the straight line is 0 to 60 (as shown in Figure 2); then, All images are divided into two groups: thin straight lines and thick straight lines. The pixel values of the gray level of each image between 0 and 60 are respectively counted to obtain the minimum pixel value min_pixel of the thick line and the maximum pixel value max_pixel of the thin line; finally, according to min_pixel and max_pixel use LSD algorithm and FLD algorithm to detect straight lines in crack images. When preprocessing road crack images, a fast and efficient method is needed, so the present invention uses an adaptive method to perform straight line detection. If the preprocessing work of the present invention is performed without using adaptive technology (the flow chart is shown in Figure 3), the processing time will become longer because each image has to undergo three straight line detection and three straight line elimination tasks; using adaptive After the method, the pixel values of the image gray level between 0 and 60 that are higher than 130,000 do not undergo FLD straight line processing, and those that are lower than 10,000 do not undergo LSD straight line processing (as shown in Figure 4), without reducing the straight line detection rate. , which greatly saves preprocessing time. Different straight line detection algorithms are used according to the different gray values of the image. The FLD algorithm detects long and thin straight lines, and the LSD algorithm detects long and thick straight lines and short straight lines.
断线重连阶段:根据直线的不同所用的算法和算法的阈值不同,但部分直线会出现识别断续的情况,如图5所示,因此本发明利用直线检测返回的直线坐标列表进行断线重连的工作,主要流程如下:Disconnection and reconnection stage: The algorithm used and the threshold of the algorithm are different depending on the straight line, but some straight lines will be recognized intermittently, as shown in Figure 5. Therefore, the present invention uses the straight line coordinate list returned by the straight line detection to perform disconnection. The main process of reconnection is as follows:
(1)创建空数组X1[],Y1[],X2[],Y2[],用于存放线段的首尾坐标值;(1) Create empty arrays X1[], Y1[], X2[], Y2[] to store the first and last coordinate values of the line segment;
(2)遍历当前图像直线检测算法返回的线段坐标列表,根据需求返回长度在阈值范围内的线段首尾坐标(x1,y1),(x2,y2),并将其分别存放在预先创建好的数组中;(2) Traverse the list of line segment coordinates returned by the straight line detection algorithm of the current image, return the first and last coordinates (x1, y1), (x2, y2) of the line segments whose length is within the threshold range according to requirements, and store them in pre-created arrays respectively. middle;
(3)通过双重遍历X1[],Y1[],X2[],Y2[],计算当前线段的斜率k1,截距d1;根据待比较线段的首尾坐标(x3,y3),(x4,y4)计算其斜率k2,截距d2;再计算两条线段的距离dis;(3) Calculate the slope k1 and intercept d1 of the current line segment by double traversing X1[], Y1[], ) Calculate its slope k2 and intercept d2; then calculate the distance dis between the two line segments;
(4)由于裂缝图像中直线基本上是水平和竖直的,所以需要分情况来连接新直线:如果k1=k2=∞,则计算x1与x3的差值的绝对值,若小于3且dis小于500,则将当前线段的尾坐标和待比较的线段的首坐标连接成一条新的直线;如果k1=∞,x3与x4差值的绝对值小于5,或者k2=∞,x1与x2差值的绝对值小于5,且dis小于500,则将当前线段的尾坐标和待比较的线段的首坐标连接成一条新的直线;如果k1=k2=0,则计算y1与y3的差值的绝对值,若小于3且dis小于500,则将当前线段的尾坐标和待比较的线段的首坐标连接成一条新的直线;如果k1,k2都小于-1,或者都大于1,则若d1与d2差值的绝对值小于10且dis小于500,则将当前线段的尾坐标和待比较的线段的首坐标连接成一条新的直线;如果k1,k2都在-1到1之间(包括-1,1,但不包括0),若k1和k2差值的绝对值小于0.1,d1与d2差值绝对值在5,dis小于500,则将当前线段的尾坐标和待比较的线段的首坐标连接成一条新的直线。(4) Since the straight lines in the crack image are basically horizontal and vertical, it is necessary to connect the new straight lines according to the situation: if k1=k2=∞, then calculate the absolute value of the difference between x1 and x3. If it is less than 3 and dis If it is less than 500, connect the tail coordinate of the current line segment and the first coordinate of the line segment to be compared to form a new straight line; if k1=∞, the absolute value of the difference between x3 and x4 is less than 5, or k2=∞, the difference between x1 and x2 The absolute value of the value is less than 5, and dis is less than 500, then connect the tail coordinate of the current line segment and the first coordinate of the line segment to be compared to form a new straight line; if k1=k2=0, calculate the difference between y1 and y3 Absolute value, if it is less than 3 and dis is less than 500, connect the tail coordinate of the current line segment and the first coordinate of the line segment to be compared to form a new straight line; if k1 and k2 are both less than -1, or both are greater than 1, then if d1 If the absolute value of the difference from d2 is less than 10 and dis is less than 500, connect the tail coordinate of the current line segment and the first coordinate of the line segment to be compared to form a new straight line; if k1 and k2 are both between -1 and 1 (including -1, 1, but not including 0), if the absolute value of the difference between k1 and k2 is less than 0.1, the absolute value of the difference between d1 and d2 is 5, and dis is less than 500, then the tail coordinate of the current line segment and the line segment to be compared are The first coordinates are connected to form a new straight line.
斜率公式:Slope formula:
截距公式:Intercept formula:
距离公式:Distance formula:
(5)重复步骤(3)(4),直到图像中每一条直线都相互比较完成。(5) Repeat steps (3) (4) until every straight line in the image is compared with each other.
不连续线段的重连机制,解决了直线不连续的问题,使得直线的消除工作更彻底,同时也降低了裂缝检测的误识别率。The reconnection mechanism of discontinuous line segments solves the problem of discontinuous straight lines, making the elimination of straight lines more thorough and reducing the false recognition rate of crack detection.
消除干扰物阶段:FMM算法是基于快速行进的方法,考虑图像中要修复的区域,算法从该区域的边界开始,并进入该区域内部;首先逐渐填充边界中的所有内容,在要修复的邻域像素周围挖掘一个小的邻域;然后该像素被附近所有已知像素的归一化加权总和所代替,因此权重的选择很重要,那些位于该点附近,边界法线附近的像素和那些位于边界轮廓线上的像素将获得更大的权重;最后,修复该像素后,将使用快速行进方法将其移动到下一个最近的像素,以此往复。本发明则是先通过直线检测算法对图像中的直线类干扰物进行检测,然后生成仅有直线类干扰物的mask图,再根据mask图对原图进行FMM算法进行处理,其结果如图6所示。Interference elimination stage: The FMM algorithm is based on a fast marching method. Considering the area to be repaired in the image, the algorithm starts from the boundary of the area and enters the interior of the area; first, it gradually fills in all the content in the boundary, and then gradually fills in all the content in the boundary to be repaired. A small neighborhood is mined around the domain pixel; that pixel is then replaced by the normalized weighted sum of all nearby known pixels, so the choice of weights is important, those pixels located near the point, near the boundary normal and those located near Pixels on the boundary outline will be given greater weight; finally, once the pixel is fixed, it will be moved to the next closest pixel using the fast march method, and so on. The present invention first detects straight-line interference objects in the image through a straight-line detection algorithm, then generates a mask diagram with only straight-line interference objects, and then uses the FMM algorithm to process the original image based on the mask diagram. The result is shown in Figure 6 shown.
3.3有益效果3.3 Beneficial effects
根据道路裂缝检测场景的复杂性,为了验证本发明算法在不同场景下的适用性,将道路分为3类不同场景:接缝类,斑马线、箭头等路标类,路沿线类。使用本发明的算法分别对不同场景的裂缝图像进行处理。According to the complexity of road crack detection scenarios, in order to verify the applicability of the algorithm of the present invention in different scenarios, roads are divided into three different scenarios: seam category, zebra crossing, arrow and other road sign categories, and roadside line category. The algorithm of the present invention is used to process crack images of different scenes respectively.
(1)接缝类场景下的预处理实验结果(1) Preprocessing experimental results in joint scenarios
接缝是一条很细并且颜色比较深的一条直线,而裂缝也是比较细,颜色比较深的线,两者的区别就是裂缝是不规则有分支的纹路,接缝是比较笔直的没有分支的线,所以本发明结合直线检测算法可以有效去除这类干扰,裂缝检测实验结果如图7所示。The seam is a very thin straight line with a darker color, while the crack is also a thinner line with a darker color. The difference between the two is that the crack has irregular branching lines, while the seam is a relatively straight line without branches. , so the present invention combined with the straight line detection algorithm can effectively remove this type of interference. The crack detection experimental results are shown in Figure 7.
(2)路标线类场景下的预处理实验结果(2) Preprocessing experimental results in road marking scenarios
地面路标是由油漆刷的,时间久了就会出现开裂的情况,但这并不属于沥青路面的裂缝,而这种线条是最接近裂缝的线条,因此机器识别时候也特别容易将其识别为裂缝,造成误识别率提高。通过本发明进行消除,裂缝检测实验结果如图8所示。Ground road signs are painted with paint, and they will crack over time. However, these are not cracks in the asphalt pavement. This kind of line is the line closest to the crack, so it is particularly easy for the machine to identify it as a crack. cracks, resulting in an increase in misrecognition rate. Eliminated by the present invention, the crack detection experimental results are shown in Figure 8.
(3)路沿线类场景下的预处理实验结果(3) Preprocessing experimental results in roadside scenarios
在进行裂缝图像数据采集时,会出现道路两边是地砖铺成的道路,而这种道路会有规则的砖缝线条,而在后期进行裂缝识别时,这类线条也是很容易被误识别为裂缝的,因此也可以通过直线检测将其去除。裂缝检测实验结果如图9所示。When collecting crack image data, there will be roads paved with floor tiles on both sides, and such roads will have regular brick lines. When crack recognition is performed later, such lines can easily be mistakenly recognized as cracks, so they can also be removed by straight line inspection. The results of the crack detection experiment are shown in Figure 9.
同时为验证本发明直线检测算法比其它直线检测算法检测效果更优,将本发明算法与其他算法检测直线结果进行对比,效果图如图10所示。At the same time, in order to verify that the straight line detection algorithm of the present invention has a better detection effect than other straight line detection algorithms, the straight line detection results of the algorithm of the present invention and other algorithms are compared. The effect diagram is shown in Figure 10.
综上所述两种对比实验结果显示,本发明的优点体现在以下几点:1.该方法将道路裂缝图像中最容易被误识别为裂缝的干扰项消除,极大地提高裂缝识别的准确度;2.运用断线重连机制,提高直线检测的完整度,消除干扰线更彻底;3.实现方法与平台简单,执行效率高。In summary, the two comparative experimental results show that the advantages of the present invention are reflected in the following points: 1. This method eliminates interference items that are most easily mistakenly identified as cracks in road crack images, greatly improving the accuracy of crack identification. ; 2. Use the disconnection and reconnection mechanism to improve the integrity of linear detection and eliminate interference lines more thoroughly; 3. The implementation method and platform are simple and the execution efficiency is high.
附图说明Description of the drawings
图1为本发明所涉一种基于LSD和FLD融合的道路裂缝图像预处理方法整体流程图Figure 1 is the overall flow chart of a road crack image preprocessing method based on the fusion of LSD and FLD involved in the present invention.
图2为粗线和细线各自的灰度直方图Figure 2 shows the grayscale histograms of thick lines and thin lines respectively.
(a)为粗线灰度直方图(a) is a thick line grayscale histogram
(b)为细线灰度直方图(b) is a thin line grayscale histogram
图3为LSD和FLD串联系统Figure 3 shows the LSD and FLD series system
图4为LSD和FLD并联系统Figure 4 shows the parallel system of LSD and FLD
图5为断线重连前后对比图Figure 5 shows the comparison before and after disconnection and reconnection.
(a)为重连前(a) Before reconnection
(b)为重连后(b) After reconnection
图6为FMM算法消除干扰物对前后比图Figure 6 shows the comparison before and after the FMM algorithm eliminates interference objects.
(a)为原图(a) is the original picture
(b)为掩码图(b) is the mask image
(c)为消除后的图像(c) is the image after elimination
图7为接缝类干扰物在传统预处理和本发明方法处理后裂缝识别对比图Figure 7 is a comparison chart of crack identification after traditional pretreatment and treatment by the method of the present invention on joint interference objects.
(a)为原图(a) is the original picture
(b)为传统预处理后裂缝识别情况(b) Identification of cracks after traditional pretreatment
(c)为本文算法处理后裂缝识别情况(c) Crack identification after processing by this algorithm
图8为路标类干扰物在传统预处理和本发明方法处理后裂缝识别对比图Figure 8 is a comparison chart of crack identification of road sign interference objects after traditional preprocessing and processing by the method of the present invention.
(a)为原图(a) is the original picture
(b)为传统预处理后裂缝识别情况(b) Identification of cracks after traditional pretreatment
(c)为本文算法处理后裂缝识别情况(c) Crack identification after processing by this algorithm
图9为路沿类干扰物在传统预处理和本发明方法处理后裂缝识别对比图Figure 9 is a comparison chart of crack recognition of roadside interference objects after traditional pretreatment and treatment by the method of the present invention.
(a)为原图(a) is the original picture
(b)为传统预处理后裂缝识别情况(b) Identification of cracks after traditional pretreatment
(c)为本文算法处理后裂缝识别情况(c) Crack identification after processing by this algorithm
图10为常见直线检测算法与本发明直线检测算法效果对比图Figure 10 is a comparison chart of the effects of common straight line detection algorithms and the straight line detection algorithm of the present invention.
(a)为Hough_line算法检测图(a) is the Hough_line algorithm detection map
(b)为HoughP_line算法检测图(b) Detection diagram for HoughP_line algorithm
(c)为FLD算法检测图(c) is the detection diagram of FLD algorithm
(d)为结合Canny算子的LSD算法检测图(d) is the detection diagram of LSD algorithm combined with Canny operator
(e)为LSD算法检测图(e) is the detection diagram of LSD algorithm
(f)为本文算法检测图(f) Detection diagram for the algorithm of this article
具体实施方式Detailed ways
本发明提出一种基于LSD和FLD融合的道路裂缝图像预处理方法,为了使本发明的技术方案及流程更加清晰、明确,下面结合附图1,对本发明的具体实施方式进行详细描述。The present invention proposes a road crack image preprocessing method based on the fusion of LSD and FLD. In order to make the technical solution and process of the present invention clearer, the specific implementation of the present invention will be described in detail below with reference to Figure 1.
(1)将图片进行灰度化处理:与彩色图像相比,灰度图占内存小,运算速度快;灰度化后,可在视觉上增加对比,突出目标区域。(1) Grayscale the image: Compared with color images, grayscale images occupy less memory and are faster in operation. After grayscale, visual contrast can be increased and the target area can be highlighted.
(2)获取图像灰度级直方图:一幅图像由不同灰度值的像素组成,图像中灰度的分布情况是该图像的一个重要特征。首先获取图像的灰度直方图,就能得到图像中具有该灰度级的像素的个数:其中,横坐标是灰度级,纵坐标是该灰度级出现的频次。前期通过数据统计,得到的直线型接缝的灰度级范围为0~60,粗直线的最小像素值min_pixel为10000,细线的最大像素值max_pixel为130000。(2) Obtain the image gray level histogram: An image is composed of pixels with different gray values. The distribution of gray levels in the image is an important feature of the image. First, obtain the grayscale histogram of the image, and you can get the number of pixels with this grayscale in the image: where the abscissa is the grayscale, and the ordinate is the frequency of occurrence of the grayscale. Through data statistics in the early stage, the gray level range of the linear joints obtained is 0 to 60, the minimum pixel value min_pixel of the thick straight line is 10000, and the maximum pixel value max_pixel of the thin line is 130000.
(3)进行FLD直线检测:获取每张图像中灰度级在0~60的像素个数的总数,该区间像素总数低于130000的图像就进行FLD检测,高于该值的图像则不经过FLD检测,这一步主要消除细直类直线干扰物,多为接缝。本发明FLD直线检测主要流程为:第一步对上一轮获得的图像进行归一化、直方图均衡、高斯滤波等操作,使细直类直线特征更加明显,有利于FLD的检测。第二步生成图像阈值图,快速的到线条图。第三步进行FLD直线检测。第四步将FLD检测的直线绘制在3846*1000的掩膜图上,然后结合掩膜图与上一轮得到的图像进行图像修复处理,即可消除细直的直线干扰物。(3) Perform FLD straight line detection: Obtain the total number of pixels with a gray level between 0 and 60 in each image. Images with a total number of pixels in this interval lower than 130,000 will be subjected to FLD detection. Images higher than this value will not be passed. FLD inspection, this step mainly eliminates thin and straight straight line interference objects, mostly seams. The main process of FLD straight line detection in the present invention is: the first step is to perform normalization, histogram equalization, Gaussian filtering and other operations on the image obtained in the previous round to make the thin and straight straight line features more obvious, which is beneficial to FLD detection. The second step generates an image threshold map and quickly produces a line map. The third step is to perform FLD linear detection. The fourth step is to draw the straight lines detected by FLD on the 3846*1000 mask image, and then perform image repair processing by combining the mask image with the image obtained in the previous round to eliminate thin and straight straight line interference.
(4)进行第一轮LSD检测:虽然LSD算法有无参输入的优点,但针对本发明的裂缝图像中的直线检测,阈值的设定不同,其所识别的效果也不相同。所以本发明将直线型干扰物分为接缝和非接缝,然后根据输入图像中干扰物的不同,LSD算法自动设置不同的阈值,最终达到消除各种直线型干扰物且不会误消除裂缝的目的。同样根据前面获取的0~60的像素个数的总数,该区间像素高于10000的图像进行本轮LSD检测:第一步将图片的尺寸由3846*1000降为1000*500,可以增加LSD对长粗直线的识别率,同时避免对裂缝的误识别(LSD算法将输入图像源缩小至原图像的80%,这样减弱或消除图像中的锯齿效应,利用高斯下采样的方式对输入图像进行操作。但由于本发明所使用的数据是高分辨率数据,所以再对原图进行缩放增加长粗直线的识别率)。第二步对图片进行双边滤波(Bilateralfilter)处理(双边滤波是一种非线性的滤波方法,是结合图像的空间邻近度和像素值相似度的一种折中处理,同时考虑空域信息和灰度相似性,达到保边去噪的目的,有效避免了将部分裂缝误识别为直线)。第三步对图像进行LSD直线检测,倾斜角度公差为70度,其对直线的覆盖率更广,对边缘不太平滑的直线也能进行检测,所以在进行直线绘制时,设置直线长度阈值为500,排除短的直线,避免将裂缝识别为直线。最后一步,将LSD检测的直线绘制在1000*500的掩膜图上,然后结合掩膜图与resize后的图像进行图像修复处理,即可消除长粗类直线干扰物,再将图像尺寸还原。(4) Carry out the first round of LSD detection: Although the LSD algorithm has the advantage of no parameter input, for the straight line detection in the crack image of the present invention, the threshold settings are different, and the recognition effects are also different. Therefore, this invention divides linear interference objects into seams and non-seams, and then the LSD algorithm automatically sets different thresholds according to the differences in interference objects in the input image, ultimately eliminating various linear interference objects without mistakenly eliminating cracks. the goal of. Similarly, based on the total number of pixels from 0 to 60 obtained previously, images with pixels higher than 10,000 in this interval are subjected to this round of LSD detection: the first step is to reduce the size of the image from 3846*1000 to 1000*500, and the LSD detection can be increased The recognition rate of long and thick straight lines while avoiding misidentification of cracks (LSD algorithm reduces the input image source to 80% of the original image, thus weakening or eliminating the aliasing effect in the image, and uses Gaussian downsampling to operate the input image . However, since the data used in this invention is high-resolution data, the original image is then scaled to increase the recognition rate of long and thick straight lines). The second step is to perform Bilateral filtering on the image (Bilateral filtering is a non-linear filtering method, which is a compromise process that combines the spatial proximity and pixel value similarity of the image, taking into account spatial domain information and grayscale. similarity to achieve the purpose of edge preservation and denoising, effectively avoiding the misidentification of some cracks as straight lines). The third step is to perform LSD straight line detection on the image. The tilt angle tolerance is 70 degrees. It has wider coverage of straight lines and can also detect straight lines with less smooth edges. Therefore, when drawing straight lines, set the straight line length threshold to 500, short straight lines are excluded to avoid identifying cracks as straight lines. The last step is to draw the straight lines detected by LSD on a 1000*500 mask image, and then perform image repair processing by combining the mask image and the resized image to eliminate long and thick straight line interference, and then restore the image size.
(5)进行第二轮LSD检测:本轮检测主要是检测接缝以外的其他类型直线干扰物,比如油漆线等,这些干扰物的特点是短,同时又要避免将跟其相似的裂缝误识别为直线,所以其阈值的设置和识别接缝这类的直线不同,因此需要单独识别。第一步进行均值滤波。第二步进行倾斜角度公差为22度、限定在梯度范数上的量化误差为2的LSD直线检测,该参数对直线的边缘平滑度和直线的笔直度要求更高。第三步是进行断线重连;最后一步将LSD检测的直线绘制在3846*1000的掩膜图上,然后结合掩膜图与resize后的图像进行图像修复处理,即可消除短直的直线干扰物。(5) Conduct the second round of LSD inspection: This round of inspection is mainly to detect other types of linear interference objects other than seams, such as paint lines, etc. These interference objects are characterized by being short, and at the same time, it is necessary to avoid mistaking cracks similar to them. It is recognized as a straight line, so its threshold setting is different from that of identifying straight lines such as seams, so it needs to be identified separately. The first step is to perform mean filtering. The second step is to perform LSD straight line detection with an inclination angle tolerance of 22 degrees and a quantization error limited to the gradient norm of 2. This parameter requires higher edge smoothness and straightness of the straight line. The third step is to disconnect and reconnect; the last step is to draw the straight lines detected by LSD on the 3846*1000 mask map, and then combine the mask map and the resized image for image repair processing to eliminate short straight lines Disturbance.
(6)最后输出保存直线干扰物消除后的图像。(6) Finally, the image after eliminating straight line interference is output and saved.
Claims (4)
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202311062662.7A CN117058036A (en) | 2023-08-23 | 2023-08-23 | Road crack image preprocessing method based on LSD and FLD fusion |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202311062662.7A CN117058036A (en) | 2023-08-23 | 2023-08-23 | Road crack image preprocessing method based on LSD and FLD fusion |
Publications (1)
| Publication Number | Publication Date |
|---|---|
| CN117058036A true CN117058036A (en) | 2023-11-14 |
Family
ID=88665945
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| CN202311062662.7A Pending CN117058036A (en) | 2023-08-23 | 2023-08-23 | Road crack image preprocessing method based on LSD and FLD fusion |
Country Status (1)
| Country | Link |
|---|---|
| CN (1) | CN117058036A (en) |
Cited By (1)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN119444822A (en) * | 2024-10-22 | 2025-02-14 | 河海大学 | A method for detecting texture direction angle of river surface spatiotemporal image based on spectrum adaptive mask |
Citations (3)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US20040037465A1 (en) * | 2002-08-21 | 2004-02-26 | Krause Larry G. | System and method for detection of image edges using a polar algorithm process |
| CN106373134A (en) * | 2016-09-18 | 2017-02-01 | 武汉武大卓越科技有限责任公司 | Road index line detection method based on linear structured light three-dimensional measurement |
| CN115035141A (en) * | 2022-06-13 | 2022-09-09 | 长安大学 | Tunnel crack remote monitoring and early warning method based on image processing |
-
2023
- 2023-08-23 CN CN202311062662.7A patent/CN117058036A/en active Pending
Patent Citations (3)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US20040037465A1 (en) * | 2002-08-21 | 2004-02-26 | Krause Larry G. | System and method for detection of image edges using a polar algorithm process |
| CN106373134A (en) * | 2016-09-18 | 2017-02-01 | 武汉武大卓越科技有限责任公司 | Road index line detection method based on linear structured light three-dimensional measurement |
| CN115035141A (en) * | 2022-06-13 | 2022-09-09 | 长安大学 | Tunnel crack remote monitoring and early warning method based on image processing |
Non-Patent Citations (1)
| Title |
|---|
| 陈昌川: "基于LSD和FLD融合的道路裂缝图像预处理方法研究", 《半导体光电》, 15 February 2024 (2024-02-15) * |
Cited By (1)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN119444822A (en) * | 2024-10-22 | 2025-02-14 | 河海大学 | A method for detecting texture direction angle of river surface spatiotemporal image based on spectrum adaptive mask |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| US11922615B2 (en) | Information processing device, information processing method, and storage medium | |
| CN109784344B (en) | Image non-target filtering method for ground plane identification recognition | |
| CN110678901B (en) | Information processing equipment, information processing method and computer-readable storage medium | |
| Mammeri et al. | A real-time lane marking localization, tracking and communication system | |
| CN107045634B (en) | Text positioning method based on maximum stable extremum region and stroke width | |
| CN113610774B (en) | Glass scratch defect detection method, system, device and storage medium | |
| CN110288571B (en) | High-speed rail contact net insulator abnormity detection method based on image processing | |
| CN111814686A (en) | A vision-based transmission line identification and foreign object intrusion online detection method | |
| CN110210451B (en) | A zebra crossing detection method | |
| CN115082466B (en) | PCB surface welding spot defect detection method and system | |
| CN107895492A (en) | A kind of express highway intelligent analysis method based on conventional video | |
| CN108280450A (en) | A kind of express highway pavement detection method based on lane line | |
| CN108171695A (en) | A kind of express highway pavement detection method based on image procossing | |
| Yang et al. | Multiple object tracking with kernelized correlation filters in urban mixed traffic | |
| CN110276787B (en) | Conductor galloping monitoring method based on marker image detection | |
| CN110427979B (en) | Identification method of road puddles based on K-Means clustering algorithm | |
| Wang et al. | High-speed acquisition and intelligent tunnel surface defects recognition | |
| CN106097368A (en) | A kind of recognition methods in veneer crack | |
| CN106295528A (en) | A kind of vehicle checking method based on multi-part spatial relation GMM modeling | |
| CN105335688B (en) | A kind of aircraft model recognition methods of view-based access control model image | |
| CN119624876A (en) | A method for identifying impurities and bubbles in wine bottles based on multi-feature comprehensive judgment | |
| CN105447489B (en) | A kind of character of picture OCR identifying system and background adhesion noise cancellation method | |
| CN118823034A (en) | Automatic detection method, device, electronic equipment and storage medium for tunnel water seepage | |
| Heidarizadeh | Preprocessing methods of lane detection and tracking for autonomous driving | |
| CN117058036A (en) | Road crack image preprocessing method based on LSD and FLD fusion |
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 |