CN118823481A - A bridge detection image recognition method and system based on artificial intelligence - Google Patents
A bridge detection image recognition method and system based on artificial intelligence Download PDFInfo
- Publication number
- CN118823481A CN118823481A CN202411018636.9A CN202411018636A CN118823481A CN 118823481 A CN118823481 A CN 118823481A CN 202411018636 A CN202411018636 A CN 202411018636A CN 118823481 A CN118823481 A CN 118823481A
- Authority
- CN
- China
- Prior art keywords
- bridge
- image
- scale
- damage
- skeleton
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Granted
Links
- 238000000034 method Methods 0.000 title claims abstract description 60
- 238000001514 detection method Methods 0.000 title claims abstract description 41
- 238000013473 artificial intelligence Methods 0.000 title claims abstract description 12
- 238000005286 illumination Methods 0.000 claims abstract description 31
- 230000011218 segmentation Effects 0.000 claims abstract description 29
- 230000000877 morphologic effect Effects 0.000 claims abstract description 28
- 238000010606 normalization Methods 0.000 claims abstract description 26
- 238000004458 analytical method Methods 0.000 claims abstract description 22
- 238000012937 correction Methods 0.000 claims abstract description 22
- 239000011159 matrix material Substances 0.000 claims abstract description 22
- 238000010586 diagram Methods 0.000 claims abstract description 17
- 230000003044 adaptive effect Effects 0.000 claims abstract description 16
- 230000006870 function Effects 0.000 claims description 33
- 238000012545 processing Methods 0.000 claims description 23
- 239000013598 vector Substances 0.000 claims description 19
- 230000003862 health status Effects 0.000 claims description 16
- 238000000605 extraction Methods 0.000 claims description 15
- 238000012706 support-vector machine Methods 0.000 claims description 15
- 230000015556 catabolic process Effects 0.000 claims description 13
- 238000006731 degradation reaction Methods 0.000 claims description 13
- 238000002834 transmittance Methods 0.000 claims description 13
- 238000001914 filtration Methods 0.000 claims description 12
- 238000005457 optimization Methods 0.000 claims description 11
- 230000008859 change Effects 0.000 claims description 10
- 230000001186 cumulative effect Effects 0.000 claims description 9
- 230000036541 health Effects 0.000 claims description 8
- 238000003064 k means clustering Methods 0.000 claims description 8
- 230000009466 transformation Effects 0.000 claims description 8
- 238000003708 edge detection Methods 0.000 claims description 7
- 230000007246 mechanism Effects 0.000 claims description 7
- 238000005315 distribution function Methods 0.000 claims description 6
- 238000000513 principal component analysis Methods 0.000 claims description 6
- 238000000354 decomposition reaction Methods 0.000 claims description 5
- 238000011478 gradient descent method Methods 0.000 claims description 5
- 238000004364 calculation method Methods 0.000 claims description 4
- 230000006835 compression Effects 0.000 claims description 4
- 238000007906 compression Methods 0.000 claims description 4
- 238000002372 labelling Methods 0.000 claims description 4
- 238000007781 pre-processing Methods 0.000 claims description 4
- 230000001629 suppression Effects 0.000 claims description 4
- 238000012360 testing method Methods 0.000 claims description 4
- 238000005259 measurement Methods 0.000 claims description 3
- 238000012805 post-processing Methods 0.000 claims description 3
- 230000010339 dilation Effects 0.000 claims description 2
- 230000004927 fusion Effects 0.000 claims description 2
- 238000013507 mapping Methods 0.000 claims description 2
- 238000012935 Averaging Methods 0.000 claims 1
- 238000009499 grossing Methods 0.000 claims 1
- 230000000694 effects Effects 0.000 description 4
- 230000008569 process Effects 0.000 description 4
- 238000010219 correlation analysis Methods 0.000 description 2
- 238000002790 cross-validation Methods 0.000 description 2
- 238000011156 evaluation Methods 0.000 description 2
- 238000012847 principal component analysis method Methods 0.000 description 2
- 238000011524 similarity measure Methods 0.000 description 2
- 241000223602 Alternaria alternata Species 0.000 description 1
- 101001121408 Homo sapiens L-amino-acid oxidase Proteins 0.000 description 1
- 102100026388 L-amino-acid oxidase Human genes 0.000 description 1
- 230000009286 beneficial effect Effects 0.000 description 1
- 238000005516 engineering process Methods 0.000 description 1
- 230000002708 enhancing effect Effects 0.000 description 1
- 238000003384 imaging method Methods 0.000 description 1
- 230000002452 interceptive effect Effects 0.000 description 1
- 230000014759 maintenance of location Effects 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 239000002245 particle Substances 0.000 description 1
- 238000013139 quantization Methods 0.000 description 1
- 230000009467 reduction Effects 0.000 description 1
- 238000012958 reprocessing Methods 0.000 description 1
- 230000000717 retained effect Effects 0.000 description 1
- 238000012216 screening Methods 0.000 description 1
- 238000000638 solvent extraction Methods 0.000 description 1
- 230000000007 visual effect Effects 0.000 description 1
- 238000012800 visualization Methods 0.000 description 1
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06V—IMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
- G06V10/00—Arrangements for image or video recognition or understanding
- G06V10/70—Arrangements for image or video recognition or understanding using pattern recognition or machine learning
- G06V10/764—Arrangements for image or video recognition or understanding using pattern recognition or machine learning using classification, e.g. of video objects
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06N—COMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
- G06N20/00—Machine learning
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T5/00—Image enhancement or restoration
- G06T5/40—Image enhancement or restoration using histogram techniques
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T5/00—Image enhancement or restoration
- G06T5/90—Dynamic range modification of images or parts thereof
- G06T5/94—Dynamic range modification of images or parts thereof based on local image properties, e.g. for local contrast enhancement
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06V—IMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
- G06V10/00—Arrangements for image or video recognition or understanding
- G06V10/20—Image preprocessing
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06V—IMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
- G06V10/00—Arrangements for image or video recognition or understanding
- G06V10/20—Image preprocessing
- G06V10/26—Segmentation of patterns in the image field; Cutting or merging of image elements to establish the pattern region, e.g. clustering-based techniques; Detection of occlusion
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06V—IMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
- G06V10/00—Arrangements for image or video recognition or understanding
- G06V10/40—Extraction of image or video features
- G06V10/44—Local feature extraction by analysis of parts of the pattern, e.g. by detecting edges, contours, loops, corners, strokes or intersections; Connectivity analysis, e.g. of connected components
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06V—IMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
- G06V10/00—Arrangements for image or video recognition or understanding
- G06V10/40—Extraction of image or video features
- G06V10/48—Extraction of image or video features by mapping characteristic values of the pattern into a parameter space, e.g. Hough transformation
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06V—IMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
- G06V10/00—Arrangements for image or video recognition or understanding
- G06V10/70—Arrangements for image or video recognition or understanding using pattern recognition or machine learning
- G06V10/762—Arrangements for image or video recognition or understanding using pattern recognition or machine learning using clustering, e.g. of similar faces in social networks
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06V—IMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
- G06V10/00—Arrangements for image or video recognition or understanding
- G06V10/70—Arrangements for image or video recognition or understanding using pattern recognition or machine learning
- G06V10/77—Processing image or video features in feature spaces; using data integration or data reduction, e.g. principal component analysis [PCA] or independent component analysis [ICA] or self-organising maps [SOM]; Blind source separation
- G06V10/80—Fusion, i.e. combining data from various sources at the sensor level, preprocessing level, feature extraction level or classification level
- G06V10/806—Fusion, i.e. combining data from various sources at the sensor level, preprocessing level, feature extraction level or classification level of extracted features
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T2207/00—Indexing scheme for image analysis or image enhancement
- G06T2207/20—Special algorithmic details
- G06T2207/20081—Training; Learning
-
- Y—GENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
- Y02—TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
- Y02A—TECHNOLOGIES FOR ADAPTATION TO CLIMATE CHANGE
- Y02A90/00—Technologies having an indirect contribution to adaptation to climate change
- Y02A90/10—Information and communication technologies [ICT] supporting adaptation to climate change, e.g. for weather forecasting or climate simulation
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Multimedia (AREA)
- Computer Vision & Pattern Recognition (AREA)
- Software Systems (AREA)
- Evolutionary Computation (AREA)
- Computing Systems (AREA)
- Medical Informatics (AREA)
- Artificial Intelligence (AREA)
- Health & Medical Sciences (AREA)
- Databases & Information Systems (AREA)
- General Health & Medical Sciences (AREA)
- General Engineering & Computer Science (AREA)
- Mathematical Physics (AREA)
- Data Mining & Analysis (AREA)
- Image Processing (AREA)
- Image Analysis (AREA)
Abstract
本申请提供一种基于人工智能的桥梁检测图像识别方法及系统,包括:针对能见度增强后的桥梁图像,利用多尺度Retinex算法进行对比度增强,突出桥梁结构轮廓,通过自适应直方图均衡化方法平衡图像亮度分布,消除光照不均和阴影干扰,获取光照归一化后的桥梁图像;针对散射校正后的桥梁图像,通过形态学顶帽运算提取桥梁结构的多尺度特征,采用局部自相似性度量聚类桥梁表面纹理,获取尺度归一化和纹理分割后的桥梁结构图像;根据桥梁骨架结构图,通过结构张量分析确定桥梁表面各向异性区域,利用灰度共生矩阵提取各向异性区域的高阶纹理特征,构建桥梁损伤的纹理特征字典。
The present application provides an artificial intelligence-based bridge detection image recognition method and system, including: for a bridge image after visibility enhancement, using a multi-scale Retinex algorithm to enhance contrast, highlighting the outline of the bridge structure, balancing the image brightness distribution through an adaptive histogram equalization method, eliminating uneven illumination and shadow interference, and obtaining a bridge image after illumination normalization; for a bridge image after scattering correction, extracting multi-scale features of the bridge structure through a morphological top-hat operation, clustering the bridge surface texture using a local self-similarity metric, and obtaining a bridge structure image after scale normalization and texture segmentation; according to a bridge skeleton structure diagram, determining the anisotropic area of the bridge surface through a structural tensor analysis, extracting high-order texture features of the anisotropic area using a grayscale co-occurrence matrix, and constructing a texture feature dictionary of bridge damage.
Description
技术领域Technical Field
本发明涉及信息技术领域,尤其涉及一种基于人工智能的桥梁检测图像识别方法及系统。The present invention relates to the field of information technology, and in particular to an artificial intelligence-based bridge detection image recognition method and system.
背景技术Background Art
在桥梁损伤检测中,常年位于重工业区的高山桥梁雾霾环绕,能见度低,需要探索雾霾天气下的桥梁损伤检测,而雾霾天气对图像采集质量造成严重影响。雾霾导致图像对比度降低、边缘模糊,使得关键损伤特征难以识别。同时,雾霾中的悬浮颗粒会在图像上形成噪点,干扰纹理和形状特征的提取。这种情况下,传统的基于梯度和纹理分析的损伤检测方法难以奏效。另一方面,为了克服雾霾影响,可能会采用增强图像对比度和锐度的预处理。但过度增强又可能导致伪边缘和假纹理的产生,反而影响真实损伤特征的识别。此外,去雾算法在去除雾霾效果的同时,也可能模糊或去除一些细微的裂缝等损伤特征。在实际应用中,还需考虑不同程度雾霾天气下的图像质量变化。轻度雾霾可能只影响远处桥梁结构的成像,而重度雾霾则会导致整体图像模糊不清。这就要求损伤检测算法能够适应不同程度的图像质量退化,在保证检测准确性的同时不产生过多误报。因此,如何在雾霾天气条件下,准确提取桥梁损伤的特征信息,同时避免图像增强带来的负面影响,成为一个亟待解决的技术难题。这需要在图像预处理、特征提取和损伤识别等多个环节进行创新和优化。In bridge damage detection, the high mountain bridges located in heavy industrial areas are surrounded by haze all year round, with low visibility. It is necessary to explore bridge damage detection under haze weather, which has a serious impact on the quality of image acquisition. Haze reduces image contrast and blurs edges, making it difficult to identify key damage features. At the same time, suspended particles in haze will form noise on the image, interfering with the extraction of texture and shape features. In this case, traditional damage detection methods based on gradient and texture analysis are difficult to work. On the other hand, in order to overcome the influence of haze, preprocessing to enhance image contrast and sharpness may be used. However, excessive enhancement may lead to the generation of pseudo edges and false textures, which will affect the identification of real damage features. In addition, while removing the haze effect, the dehazing algorithm may also blur or remove some minor damage features such as cracks. In practical applications, it is also necessary to consider the changes in image quality under different degrees of haze weather. Mild haze may only affect the imaging of distant bridge structures, while heavy haze will cause the overall image to be blurred. This requires the damage detection algorithm to be able to adapt to different degrees of image quality degradation, while ensuring detection accuracy without generating too many false alarms. Therefore, how to accurately extract the characteristic information of bridge damage under haze weather conditions while avoiding the negative impact of image enhancement has become a technical problem that needs to be solved urgently. This requires innovation and optimization in multiple links such as image preprocessing, feature extraction and damage identification.
发明内容Summary of the invention
本发明提供了一种基于人工智能的桥梁检测图像识别方法,主要包括:The present invention provides a bridge detection image recognition method based on artificial intelligence, which mainly includes:
获取雾霾天气下拍摄的桥梁原始图像,根据图像对比度和灰度直方图分布,判断能见度是否满足桥梁识别检测要求,若不满足,则采用暗通道先验理论估计全局大气光照值,结合导向滤波算法自适应去雾,得到能见度增强后的桥梁图像;Obtain the original bridge image taken in haze weather, and judge whether the visibility meets the requirements of bridge recognition and detection based on the image contrast and grayscale histogram distribution. If not, use the dark channel prior theory to estimate the global atmospheric illumination value, and combine the guided filtering algorithm for adaptive defogging to obtain the bridge image with enhanced visibility.
针对能见度增强后的桥梁图像,利用多尺度Retinex算法进行对比度增强,突出桥梁结构轮廓,通过自适应直方图均衡化方法平衡图像亮度分布,消除光照不均和阴影干扰,获取光照归一化后的桥梁图像;For the bridge image after visibility enhancement, the multi-scale Retinex algorithm is used to enhance the contrast and highlight the outline of the bridge structure. The adaptive histogram equalization method is used to balance the image brightness distribution, eliminate uneven illumination and shadow interference, and obtain the bridge image after illumination normalization.
针对光照归一化后的桥梁图像,采用加权最小二乘法在多个尺度下拟合桥梁表面模型,通过表面重构消除雾霾引起的散射光干扰,利用退化函数估计雾霾参数,自适应补偿部分波段信息缺失,获取散射校正后的桥梁图像;For the bridge image after illumination normalization, the weighted least squares method is used to fit the bridge surface model at multiple scales. The scattered light interference caused by haze is eliminated through surface reconstruction. The haze parameters are estimated using the degradation function. The missing information of some bands is adaptively compensated to obtain the bridge image after scattering correction.
针对散射校正后的桥梁图像,通过形态学顶帽运算提取桥梁结构的多尺度特征,采用局部自相似性度量聚类桥梁表面纹理,获取尺度归一化和纹理分割后的桥梁结构图像;For the bridge image after scattering correction, the multi-scale features of the bridge structure are extracted through morphological top-hat operation, and the bridge surface texture is clustered using local self-similarity measurement to obtain the bridge structure image after scale normalization and texture segmentation.
在桥梁结构图像上应用改进的Canny算子检测边缘轮廓,通过边缘连接和闭合消除背景干扰,获取完整的桥梁结构边缘图,采用Hough变换检测桥梁结构的多尺度线特征,通过概率投票机制筛选支配性结构线,获取桥梁骨架结构图;The improved Canny operator is applied to the bridge structure image to detect the edge contour, and the background interference is eliminated by edge connection and closure to obtain a complete bridge structure edge map. The multi-scale line features of the bridge structure are detected by Hough transform, and the dominant structural lines are screened by the probabilistic voting mechanism to obtain the bridge skeleton structure map.
根据桥梁骨架结构图,通过结构张量分析确定桥梁表面各向异性区域,利用灰度共生矩阵提取各向异性区域的高阶纹理特征,构建桥梁损伤的纹理特征字典;According to the bridge skeleton structure diagram, the anisotropic area of the bridge surface is determined through structural tensor analysis, and the high-order texture features of the anisotropic area are extracted using the gray-level co-occurrence matrix to construct a texture feature dictionary of bridge damage.
在桥梁结构边缘图上应用形态学骨架提取算法获取桥梁连接部位的骨架线,通过骨架线的连通性分析判断桥梁结构是否存在断裂,若存在断裂,则根据断裂区域的边缘轮廓确定损伤位置,根据断裂长度确定损伤尺寸;The morphological skeleton extraction algorithm is applied to the edge map of the bridge structure to obtain the skeleton line of the bridge connection part. The connectivity analysis of the skeleton line is used to determine whether the bridge structure has a fracture. If there is a fracture, the damage location is determined according to the edge contour of the fracture area, and the damage size is determined according to the fracture length.
综合桥梁结构完整性、表面纹理特征和损伤定量指标,采用支持向量机回归模型对桥梁健康状态进行评估,获得桥梁各部位损伤程度预测值,将预测值映射到健康状态等级,生成桥梁健康评估报告,直观呈现桥梁损伤检测结果。The support vector machine regression model is used to evaluate the health status of the bridge based on the structural integrity, surface texture characteristics and quantitative damage indicators of the bridge. The predicted value of the damage degree of each part of the bridge is obtained, the predicted value is mapped to the health status level, and a bridge health assessment report is generated to intuitively present the bridge damage detection results.
本发明提供了一种基于人工智能的桥梁检测图像识别系统,主要包括:The present invention provides a bridge detection image recognition system based on artificial intelligence, which mainly includes:
图像预处理模块,用于对原始雾霾天气下的桥梁图像进行去雾和对比度增强处理;Image preprocessing module, used to perform defogging and contrast enhancement on the original bridge image under haze weather;
表面模型拟合和散射校正模块,用于拟合桥梁表面模型,消除散射光干扰,提升图像清晰度;Surface model fitting and scattering correction module, used to fit the bridge surface model, eliminate scattered light interference, and improve image clarity;
结构特征提取模块,用于提取桥梁结构的边缘轮廓和纹理特征,获取桥梁骨架结构图;The structural feature extraction module is used to extract the edge contour and texture features of the bridge structure and obtain the bridge skeleton structure diagram;
损伤识别和健康评估模块,用于分析桥梁结构完整性,评估桥梁的健康状态,生成损伤检测结果报告。The damage identification and health assessment module is used to analyze the structural integrity of the bridge, evaluate the health status of the bridge, and generate damage detection result reports.
本发明实施例提供的技术方案可以包括以下有益效果:The technical solution provided by the embodiment of the present invention may have the following beneficial effects:
本发明公开了一种基于人工智能的桥梁检测图像识别方法,首先通过对桥梁原始图像的评估与能见度增强,解决了雾霾天气下桥梁原始图像能见度低,难以满足桥梁识别检测要求的问题,并对能见度增强后的桥梁图像采用对比度增强、亮度均衡与散射校正,解决了桥梁图像对比度不足、亮度分布不均、光照干扰以及散射光干扰导致的结构轮廓不清晰和信息缺失的问题;其次通过结构特征提取、线特征提取与边缘检测,解决了桥梁图像的尺度归一化、纹理分割、边缘检测和结构线检测不准确的问题,并避免了纹理、形状特征与边缘模糊造成的干扰问题;此外,通过结构分析与提取异性区域,解决了桥梁损伤检测中难以确定各向异性区域的纹理特征、桥梁连接部位的结构完整性判断以及损伤位置和尺寸确定的问题,实现了准确提取桥梁损伤特征信息。The invention discloses an artificial intelligence-based bridge detection image recognition method. Firstly, by evaluating and enhancing the visibility of the original bridge image, the problem that the original bridge image has low visibility in haze weather and is difficult to meet the bridge recognition and detection requirements is solved. Contrast enhancement, brightness balance and scattering correction are used for the bridge image after visibility enhancement, so as to solve the problems of unclear structural contour and missing information caused by insufficient contrast, uneven brightness distribution, illumination interference and scattered light interference of the bridge image. Secondly, by extracting structural features, extracting line features and detecting edges, the problems of inaccurate scale normalization, texture segmentation, edge detection and structural line detection of the bridge image are solved, and the interference caused by texture, shape features and edge blur is avoided. In addition, by analyzing the structure and extracting the anisotropic region, the problem of difficulty in determining the texture features of the anisotropic region, judging the structural integrity of the bridge connection part and determining the damage position and size in bridge damage detection is solved, so as to realize accurate extraction of bridge damage feature information.
综上所述,本发明不仅显著提高了在极端环境下对桥梁结构的识别与分析能力,而且极大地增强了桥梁健康评估的准确性和可靠性,实现了准确提取桥梁损伤特征信息的同时避免了图像增强带来的负面影响。In summary, the present invention not only significantly improves the recognition and analysis capabilities of bridge structures in extreme environments, but also greatly enhances the accuracy and reliability of bridge health assessment, achieves accurate extraction of bridge damage feature information while avoiding the negative effects of image enhancement.
附图说明BRIEF DESCRIPTION OF THE DRAWINGS
图1为本发明的一种基于人工智能的桥梁检测图像识别方法的流程图。FIG1 is a flow chart of an artificial intelligence-based bridge detection image recognition method of the present invention.
图2为本发明的一种基于人工智能的桥梁检测图像识别方法及系统的示意图。FIG. 2 is a schematic diagram of an artificial intelligence-based bridge detection image recognition method and system according to the present invention.
图3为本发明的一种基于人工智能的桥梁检测图像识别方法及系统的又一示意图。FIG. 3 is another schematic diagram of an artificial intelligence-based bridge detection image recognition method and system according to the present invention.
具体实施方式DETAILED DESCRIPTION
下面将结合本发明实施例中的附图,对本发明实施例中的技术方案进行清楚、详细地描述。所描述的实施例仅仅是本发明的一部分实施例。The following will describe the technical solutions in the embodiments of the present invention in detail in conjunction with the accompanying drawings in the embodiments of the present invention. The described embodiments are only part of the embodiments of the present invention.
如图1-3,本实施例一种基于人工智能的桥梁检测图像识别方法及系统具体可以包括:As shown in Figures 1-3, the bridge detection image recognition method and system based on artificial intelligence in this embodiment may specifically include:
步骤S101,获取雾霾天气下拍摄的桥梁原始图像,根据图像对比度和灰度直方图分布,判断能见度是否满足桥梁识别检测要求,若不满足,则采用暗通道先验理论估计全局大气光照值,结合导向滤波算法自适应去雾,得到能见度增强后的桥梁图像。Step S101, obtain the original image of the bridge taken in haze weather, and judge whether the visibility meets the requirements of bridge recognition and detection based on the image contrast and grayscale histogram distribution. If not, use the dark channel prior theory to estimate the global atmospheric illumination value, and combine the guided filtering algorithm for adaptive defogging to obtain a bridge image with enhanced visibility.
获取雾霾天气下拍摄的桥梁原始图像,计算所述桥梁原始图像的局部对比度,所述局部对比度采用局部对比度计算公式得到;根据桥梁原始图像分析灰度直方图分布,计算所述灰度直方图分布的均值和方差;根据局部对比度、均值和方差,判断当前图像能见度是否满足预设的桥梁识别检测要求阈值;若所述当前图像能见度不满足预设的桥梁识别检测要求阈值,则采用暗通道先验理论对桥梁原始图像进行处理,得到去雾后的桥梁图像;对所述去雾后的桥梁图像进行对比度调整,采用线性拉伸方法得到对比度调整后的桥梁图像;对所述对比度调整后的桥梁图像进行自适应直方图均衡化处理,将所述对比度调整后的桥梁图像分成多个小块,对每个所述小块进行直方图均衡化,通过双线性插值合并处理结果,得到能见度增强后的桥梁图像。The original image of the bridge taken under haze weather is obtained, and the local contrast of the original image of the bridge is calculated, and the local contrast is obtained by using a local contrast calculation formula; the grayscale histogram distribution is analyzed according to the original image of the bridge, and the mean and variance of the grayscale histogram distribution are calculated; according to the local contrast, mean and variance, whether the visibility of the current image meets the preset bridge recognition detection requirement threshold is judged; if the visibility of the current image does not meet the preset bridge recognition detection requirement threshold, the original image of the bridge is processed by using a dark channel prior theory to obtain a defogged bridge image; the contrast of the defogged bridge image is adjusted, and a linear stretching method is used to obtain a contrast-adjusted bridge image; the contrast-adjusted bridge image is subjected to adaptive histogram equalization processing, the contrast-adjusted bridge image is divided into a plurality of small blocks, each of the small blocks is subjected to histogram equalization, and the processing results are merged by bilinear interpolation to obtain a bridge image with enhanced visibility.
具体来说,获取雾霾天气下拍摄的桥梁原始图像,计算图像局部对比度,采用局部对比度计算公式C=(I_max-I_min)/(I_max+I_min),其中I_max和I_min分别为局部区域内的最大和最小像素值。分析灰度直方图分布,计算灰度值的均值μ和方差σ^2。根据计算得到的对比度C、均值μ和方差σ^2,判断当前图像能见度是否满足桥梁识别检测要求的预设阈值T_c、T_μ和T_σ,得到能见度评估结果。若不满足桥梁识别检测要求,则采用暗通道先验理论对图像进行处理,计算暗通道图像J_dark(x)=min_c(min_y∈Ω(x)(J_c(y))),其中J_dark(x)表示所求的暗通道图像在位置x处的像素值,c代表RGB三个颜色通道即红色R、绿色G、蓝色B,min_c表示在RGB三个通道中取最小值,y是在以x为中心的局部窗口Ω(x)内的像素位置,Ω(x)表示以x为中心的局部窗口,J_c(y)表示在位置y处的颜色通道c的像素值。选取暗通道图像中前0.1%最暗的像素,计算这些像素在原始图像中对应的RGB值的最大值,作为全局大气光照值A。根据暗通道先验理论,估算透射率t(x)=1-ωmin_c(min_y∈Ω(x)(I_c(y)/A_c)),其中ω为调节参数,通常取0.95,I_c(y)表示在位置y处的颜色通道c的有雾图像的像素值,A_c表示在颜色通道c中的大气光值。基于获得的大气光照值A和透射率t(x),构建导向滤波算法的滤波核函数K(i,j)=((1+ε)/|ω|^2)∑(I_i-μ_k)(I_j-μ_k),其中I为引导图像,I_i和I_j分别表示图像中位置i和位置j处的像素值,μ_k为局部均值,|ω|为窗口大小,ε为正则化参数。对图像进行自适应去雾处理,生成去雾后的桥梁图像J(x)=(I(x)-A)/max(t(x),t_0)+A,其中t_0为下限阈值,I(x)表示原始有雾图像在位置x处的像素值,防止除零错误。对去雾后的桥梁图像进行对比度调整,采用线性拉伸方法J_out=(J_i n-J_min)(255/(J_max-J_min)),J_i n表示输入的去雾后的桥梁图像的原始像素值,J_min输入图像中的最小像素值,J_max输入图像中的最大像素值。进行自适应直方图均衡化处理,将图像分成多个小块,对每个小块进行直方图均衡化,然后使用双线性插值合并处理结果,提升图像细节表现力,得到能见度增强后的桥梁图像。获取雾霾天气下拍摄的桥梁原始图像后,计算图像局部对比度,选取10x10像素的滑动窗口,在每个窗口内应用局部对比度计算公式。如某窗口内最大像素值为200,最小像素值为50,则该窗口的局部对比度C=(200-50)/(200+50)=0.6。对整幅图像计算灰度直方图,假设得到灰度均值μ=128,方差σ^2=1600。设定预设阈值T_c=0.4,T_μ=100,T_σ=50,判断当前图像能见度是否满足要求。若不满足,则采用暗通道先验理论处理图像,计算暗通道图像时使用15x15的最小值滤波器。选取暗通道图像中最暗的0.1%像素,假设对应原始图像中RGB最大值为220,即确定全局大气光照值A=220。估算透射率时,设置调节参数ω=0.95,得到初步透射率图。构建导向滤波算法的滤波核函数,设置窗口大小|ω|=16x16,正则化参数ε=0.001,使用原始图像作为引导图像。应用导向滤波ref i ned_t=gu idedF i lter(I,rough_t,16,0.001),其中,I通常是输入的原始有雾图像,rough_t是初步估计得到的透射率,得到优化后的透射率图。进行去雾处理,设置下限阈值t_0=0.1,得到去雾后的桥梁图像。对去雾图像进行线性拉伸,假设去雾图像像素值范围为[30,220],则拉伸后的像素值J_out=(J_i n-30)*(255/(220-30))。最后进行自适应直方图均衡化,将图像分成8x8个小块,每个小块大小为32x32像素,对每个小块进行直方图均衡化,然后使用双线性插值合并处理结果,得到最终的能见度增强后的桥梁图像。Specifically, the original image of the bridge taken in haze weather is obtained, and the local contrast of the image is calculated. The local contrast calculation formula C = (I_max-I_min)/(I_max+I_min) is used, where I_max and I_min are the maximum and minimum pixel values in the local area, respectively. The grayscale histogram distribution is analyzed, and the mean μ and variance σ^2 of the grayscale value are calculated. According to the calculated contrast C, mean μ and variance σ^2, it is judged whether the visibility of the current image meets the preset thresholds T_c, T_μ and T_σ required for bridge recognition and detection, and the visibility evaluation result is obtained. If the requirements for bridge recognition and detection are not met, the dark channel prior theory is used to process the image and calculate the dark channel image J_dark(x)=min_c(min_y∈Ω(x)(J_c(y))), where J_dark(x) represents the pixel value of the dark channel image at position x, c represents the three RGB color channels, namely red R, green G, and blue B, min_c represents the minimum value among the three RGB channels, y is the pixel position within the local window Ω(x) centered on x, Ω(x) represents the local window centered on x, and J_c(y) represents the pixel value of color channel c at position y. The darkest pixels in the first 0.1% of the dark channel image are selected, and the maximum value of the RGB values corresponding to these pixels in the original image is calculated as the global atmospheric illumination value A. According to the dark channel prior theory, the transmittance t(x) = 1-ωmin_c(min_y∈Ω(x)(I_c(y)/A_c)) is estimated, where ω is a tuning parameter, usually 0.95, I_c(y) represents the pixel value of the foggy image of color channel c at position y, and A_c represents the atmospheric light value in color channel c. Based on the obtained atmospheric illumination value A and transmittance t(x), the filter kernel function K(i,j) = ((1+ε)/|ω|^2)∑(I_i-μ_k)(I_j-μ_k) of the guided filtering algorithm is constructed, where I is the guided image, I_i and I_j represent the pixel values at positions i and j in the image, respectively, μ_k is the local mean, |ω| is the window size, and ε is the regularization parameter. The image is subjected to adaptive defogging to generate the defogging bridge image J(x) = (I(x)-A)/max(t(x), t_0)+A, where t_0 is the lower threshold and I(x) represents the pixel value of the original foggy image at position x to prevent zero division errors. The contrast of the defogging bridge image is adjusted by using a linear stretching method J_out = (J_i n-J_min)(255/(J_max-J_min)), where J_i n represents the original pixel value of the input defogging bridge image, J_min is the minimum pixel value in the input image, and J_max is the maximum pixel value in the input image. Adaptive histogram equalization is performed to divide the image into multiple small blocks, and histogram equalization is performed on each small block. Then, bilinear interpolation is used to merge the processing results to improve the image detail expression and obtain the bridge image with enhanced visibility. After obtaining the original bridge image taken in haze weather, the local contrast of the image is calculated, a sliding window of 10x10 pixels is selected, and the local contrast calculation formula is applied in each window. If the maximum pixel value in a window is 200 and the minimum pixel value is 50, the local contrast of the window is C = (200-50)/(200+50) = 0.6. Calculate the grayscale histogram for the entire image, assuming that the grayscale mean μ = 128 and the variance σ^2 = 1600. Set the preset thresholds T_c = 0.4, T_μ = 100, T_σ = 50 to determine whether the visibility of the current image meets the requirements. If not, the dark channel prior theory is used to process the image, and a 15x15 minimum filter is used when calculating the dark channel image. Select the darkest 0.1% pixels in the dark channel image, assuming that the corresponding RGB maximum value in the original image is 220, that is, determine the global atmospheric illumination value A = 220. When estimating the transmittance, set the adjustment parameter ω = 0.95 to obtain a preliminary transmittance map. Construct the filter kernel function of the guided filtering algorithm, set the window size |ω| = 16x16, the regularization parameter ε = 0.001, and use the original image as the guide image. Apply the guided filter ref i ned_t = guidedFilter(I, rough_t, 16, 0.001), where I is usually the input original foggy image, rough_t is the transmittance obtained by preliminary estimation, and obtain the optimized transmittance map. Perform defogging, set the lower threshold t_0 = 0.1, and obtain the defogged bridge image. Linearly stretch the defogged image. Assuming that the pixel value range of the defogged image is [30, 220], the stretched pixel value J_out = (J_i n-30)*(255/(220-30)). Finally, adaptive histogram equalization is performed to divide the image into 8x8 small blocks, each of which is 32x32 pixels in size. Histogram equalization is performed on each small block, and then bilinear interpolation is used to merge the processing results to obtain the final bridge image with enhanced visibility.
步骤S102,针对能见度增强后的桥梁图像,利用多尺度Ret i nex算法进行对比度增强,突出桥梁结构轮廓,通过自适应直方图均衡化方法平衡图像亮度分布,消除光照不均和阴影干扰,获取光照归一化后的桥梁图像。Step S102, for the bridge image after visibility enhancement, a multi-scale Retinex algorithm is used to enhance contrast, highlight the outline of the bridge structure, balance the image brightness distribution through an adaptive histogram equalization method, eliminate uneven illumination and shadow interference, and obtain a bridge image after illumination normalization.
根据桥梁图像尺寸获取多尺度Ret i nex算法的高斯滤波器组参数,参数包括三个尺度值,分别为图像长边像素数的百分之五、百分之二十五和百分之七十五;采用所述高斯滤波器组对输入图像进行高斯模糊处理,得到三个不同尺度的模糊图像;计算输入图像与各尺度模糊图像的对数差,得到三个尺度的Ret i nex输出图像;对所述三个尺度的Reti nex输出图像进行加权平均,得到融合后的Ret i nex输出图像;针对所述融合后的Ret inex输出图像进行非线性映射,采用s i gmo i d函数进行色彩恢复和动态范围压缩,得到对比度增强的桥梁图像;将所述对比度增强的桥梁图像划分为若干子块,对每个子块计算累积分布函数,得到光照归一化后的桥梁图像;计算所述光照归一化后的桥梁图像与所述输入图像的结构相似性指数;若所述结构相似性指数低于预设阈值,则调整所述高斯滤波器组参数、s i gmo i d函数参数和累积分布函数参数,重新进行处理,直至所述结构相似性指数满足质量要求。According to the size of the bridge image, the Gaussian filter group parameters of the multi-scale Retinex algorithm are obtained, and the parameters include three scale values, which are 5%, 25% and 75% of the number of pixels on the long side of the image respectively; the Gaussian filter group is used to perform Gaussian blur processing on the input image to obtain three blurred images of different scales; the logarithmic difference between the input image and the blurred images of each scale is calculated to obtain Retinex output images of three scales; the Retinex output images of the three scales are weighted averaged to obtain a fused Retinex output image; nonlinear mapping is performed on the fused Retinex output image, and a sigmoid function is used to perform color restoration and dynamic range compression to obtain a contrast-enhanced bridge image; the contrast-enhanced bridge image is divided into a number of sub-blocks, and the cumulative distribution function is calculated for each sub-block to obtain a bridge image after illumination normalization; the structural similarity index between the bridge image after illumination normalization and the input image is calculated; if the structural similarity index is lower than a preset threshold, the Gaussian filter group parameters, sigmoid function and the input image are adjusted. d function parameters and cumulative distribution function parameters are reprocessed until the structural similarity index meets the quality requirements.
具体来说,针对能见度增强后的桥梁图像,构建多尺度Ret i nex算法的高斯滤波器组,根据图像尺寸和桥梁结构特征设置三个尺度参数,分别为图像长边像素数的5%、25%和75%。对输入图像进行高斯模糊处理,得到三个不同尺度的模糊图像。计算输入图像与各尺度模糊图像的对数差,得到三个尺度的Ret i nex输出图像,并对这三个输出图像进行加权平均,权重根据每个尺度对桥梁结构细节的保留程度设置,分别为0.3、0.4和0.3,得到融合后的Ret i nex输出图像。对融合后的Ret i nex输出图像进行非线性映射,采用s igmo i d函数f(x)=1/(1+exp(-α(x-β)))进行色彩恢复和动态范围压缩,其中α控制曲线斜率,β控制中点位置,x输入的融合后的Ret i nex输出图像的像素值,通过迭代优化确定最佳参数值,得到对比度增强的桥梁图像,突出桥梁结构轮廓。采用自适应直方图均衡化方法,将对比度增强后的桥梁图像划分为8×8个子块,对每个子块计算累积分布函数,设置对比度限制阈值为0.01,防止过度增强噪声。使用双线性插值处理块与块之间的边界,消除光照不均和阴影干扰,获取光照归一化后的桥梁图像。计算处理前后图像的结构相似性指数SSIM,若SSIM值低于预设阈值0.8,则调整前述参数重新进行处理,直至满足质量要求。针对能见度增强后的桥梁图像,假设图像尺寸为2048x1536像素,构建多尺度Ret i nex算法的高斯滤波器组,设置三个尺度参数分别为102、512和1536像素。对输入图像进行高斯模糊处理,得到三个不同尺度的模糊图像。计算输入图像与各尺度模糊图像的对数差,得到三个尺度的Ret i nex输出图像。对这三个输出图像进行加权平均,权重设置为0.3、0.4和0.3,得到融合后的Ret i nex输出图像。对融合后的Ret i nex输出图像进行非线性映射,采用sigmo id函数进行色彩恢复和动态范围压缩,初始参数设置α=5,β=0.5,通过梯度下降法迭代优化,最终得到α=4.8,β=0.52的参数值。使用优化后的参数对图像进行非线性映射,得到对比度增强的桥梁图像。采用自适应直方图均衡化方法,将对比度增强后的桥梁图像划分为8×8个子块,每个子块大小为256x192像素。对每个子块计算累积分布函数,设置对比度限制阈值为0.01。使用双线性插值处理块与块之间的边界,消除光照不均和阴影干扰,获取光照归一化后的桥梁图像。计算处理前后图像的结构相似性指数,假设得到SSIM值为0.85,高于预设阈值0.8,表明处理效果良好。Specifically, for the bridge image after visibility enhancement, a Gaussian filter group of the multi-scale Ret i nex algorithm is constructed, and three scale parameters are set according to the image size and bridge structure characteristics, which are 5%, 25% and 75% of the number of pixels on the long side of the image. The input image is Gaussian blurred to obtain three blurred images of different scales. The logarithmic difference between the input image and the blurred image of each scale is calculated to obtain the Ret i nex output images of three scales, and the three output images are weighted averaged. The weights are set according to the degree of retention of the bridge structure details at each scale, which are 0.3, 0.4 and 0.3 respectively, to obtain the fused Ret i nex output image. The fused Ret i nex output image is nonlinearly mapped, and the sigmoid function f(x) = 1/(1+exp(-α(x-β))) is used for color restoration and dynamic range compression, where α controls the slope of the curve, β controls the midpoint position, and x is the pixel value of the fused Ret i nex output image. The optimal parameter value is determined through iterative optimization to obtain a contrast-enhanced bridge image and highlight the outline of the bridge structure. The contrast-enhanced bridge image is divided into 8×8 sub-blocks using the adaptive histogram equalization method, and the cumulative distribution function is calculated for each sub-block. The contrast limit threshold is set to 0.01 to prevent excessive enhancement of noise. The boundaries between blocks are processed using bilinear interpolation to eliminate uneven illumination and shadow interference, and obtain a bridge image after illumination normalization. The structural similarity index SSIM of the image before and after processing is calculated. If the SSIM value is lower than the preset threshold of 0.8, the above parameters are adjusted and reprocessed until the quality requirements are met. For the bridge image after visibility enhancement, assuming that the image size is 2048x1536 pixels, a Gaussian filter group of the multi-scale Ret i nex algorithm is constructed, and the three scale parameters are set to 102, 512 and 1536 pixels respectively. The input image is Gaussian blurred to obtain three blurred images of different scales. The logarithmic difference between the input image and the blurred image of each scale is calculated to obtain the Ret i nex output images of three scales. The three output images are weighted averaged, and the weights are set to 0.3, 0.4 and 0.3 to obtain the fused Ret i nex output image. The fused Ret i nex output image is nonlinearly mapped, and the sigmoid function is used for color restoration and dynamic range compression. The initial parameters are set to α=5, β=0.5. The gradient descent method is used for iterative optimization, and finally the parameter values of α=4.8, β=0.52 are obtained. The image is nonlinearly mapped using the optimized parameters to obtain the bridge image with contrast enhancement. Adaptive histogram equalization is used to divide the contrast-enhanced bridge image into 8×8 sub-blocks, each with a size of 256x192 pixels. The cumulative distribution function is calculated for each sub-block, and the contrast limit threshold is set to 0.01. Bilinear interpolation is used to process the boundaries between blocks to eliminate uneven illumination and shadow interference, and obtain the bridge image after illumination normalization. The structural similarity index of the images before and after processing is calculated. It is assumed that the SSIM value is 0.85, which is higher than the preset threshold of 0.8, indicating that the processing effect is good.
步骤S103,针对光照归一化后的桥梁图像,采用加权最小二乘法在多个尺度下拟合桥梁表面模型,通过表面重构消除雾霾引起的散射光干扰,利用退化函数估计雾霾参数,自适应补偿部分波段信息缺失,获取散射校正后的桥梁图像。Step S103, for the bridge image after illumination normalization, a weighted least square method is used to fit the bridge surface model at multiple scales, scattered light interference caused by haze is eliminated through surface reconstruction, haze parameters are estimated using a degradation function, missing information of some bands is adaptively compensated, and a bridge image after scattering correction is obtained.
接收携带有光照归一化后的桥梁图像信息的处理请求,所述处理请求由图像采集设备发出;根据所述处理请求对桥梁图像进行多尺度分解,采用高斯金字塔对原始图像进行下采样,得到多个不同尺度的图像;针对所述多个不同尺度的图像,采用加权最小二乘法拟合桥梁表面模型,构建误差函数并通过梯度下降法迭代优化最小化误差函数,获取各尺度下的桥梁表面模型;根据所述桥梁表面模型计算散射光强度分布,采用大气散射模型估计初始透射率,通过交替优化求解无雾图像和透射率,得到退化函数;基于所述退化函数,对原始图像进行散射校正,采用Wiener滤波对缺失的波段信息进行自适应补偿,所述Wiener滤波器参数根据局部图像块的信噪比估计动态调整滤波强度,获取散射校正后的桥梁图像;计算所述原始图像与所述散射校正后的桥梁图像的峰值信噪比,若所述峰值信噪比小于预设阈值,则返回调整参数重新进行散射校正处理。A processing request carrying illumination-normalized bridge image information is received, the processing request being issued by an image acquisition device; the bridge image is decomposed into multiple scales according to the processing request, and the original image is downsampled using a Gaussian pyramid to obtain images of multiple scales; for the multiple images of different scales, a bridge surface model is fitted using a weighted least squares method, an error function is constructed, and the error function is iteratively optimized and minimized by a gradient descent method to obtain a bridge surface model at each scale; the scattered light intensity distribution is calculated according to the bridge surface model, an initial transmittance is estimated using an atmospheric scattering model, and a fog-free image and transmittance are solved by alternate optimization to obtain a degradation function; based on the degradation function, a scatter correction is performed on the original image, and a Wiener filter is used to adaptively compensate for missing band information, and the Wiener filter parameters dynamically adjust the filter strength according to the signal-to-noise ratio estimation of the local image block to obtain a scatter-corrected bridge image; a peak signal-to-noise ratio between the original image and the scatter-corrected bridge image is calculated, and if the peak signal-to-noise ratio is less than a preset threshold, the adjustment parameters are returned to perform scatter correction processing again.
具体来说,对输入的光照归一化后桥梁图像进行多尺度分解,采用高斯金字塔对原始图像进行下采样,根据图像最小边长动态确定金字塔层数,当最小边长大于64像素时继续下采样,生成多个不同尺度的图像。针对每个尺度的图像,采用加权最小二乘法拟合桥梁表面模型,构建误差函数Specifically, the input bridge image after illumination normalization is decomposed into multiple scales, and the original image is downsampled using a Gaussian pyramid. The number of pyramid layers is dynamically determined according to the minimum side length of the image. When the minimum side length is greater than 64 pixels, downsampling is continued to generate multiple images of different scales. For each scale image, the weighted least squares method is used to fit the bridge surface model and construct the error function
E(x)=Σw_i(f_i(x)-y_i)^2,其中w_i为基于像素梯度设置的权重,f_i(x)为拟合函数,y_i为观测值,通过梯度下降法迭代优化最小化误差函数,得到各尺度下的桥梁表面模型。利用获得的桥梁表面模型,计算散射光强度分布,根据大气散射模型I(x)=J(x)t(x)+A(1-t(x)),其中I(x)为观测图像,J(x)为无雾图像,t(x)为透射率,A为大气光值,通过暗通道先验估计初始透射率,然后交替优化求解J(x)和t(x),得到退化函数。基于退化函数,对原始图像进行散射校正,采用Wi ener滤波对缺失的波段信息进行自适应补偿,滤波器参数根据局部图像块的信噪比估计动态调整滤波强度,最终获取散射校正后的桥梁图像。计算处理前后图像的峰值信噪比PSNR,判断散射校正效果是否达到预设阈值,若未达到则返回调整参数重新进行处理。对输入的2048x1536像素桥梁图像进行多尺度分解,采用高斯金字塔进行下采样,生成3个尺度的图像2048x1536、1024x768和512x384。针对每个尺度图像,采用加权最小二乘法拟合桥梁表面模型,权重w_i基于Sobe l算子计算的像素梯度设置,梯度值越大权重越高。使用梯度下降法迭代优化,学习率设为0.01,最大迭代次数为1000,得到各尺度下的桥梁表面模型。利用获得的表面模型,计算散射光强度分布,应用大气散射模型I(x)=J(x)t(x)+A(1-t(x))。通过暗通道先验估计初始透射率,取暗通道图像中最亮的前0.1%像素点对应原图的平均值作为大气光值A。交替优化10次求解J(x)和t(x),得到退化函数。基于退化函数,对原始图像进行散射校正,采用Wi ener滤波补偿缺失的波段信息。滤波器窗口大小设为8x8,根据局部图像块的信噪比估计动态调整滤波强度,信噪比越低滤波强度越大。最终获取散射校正后的桥梁图像,计算处理前后图像的峰值信噪比PSNR。若PSNR值低于30dB,则返回调整参数重新处理,直到PSNR达到30dB以上或迭代次数超过5次。E(x)=Σw_i(f_i(x)-y_i)^2, where w_i is the weight set based on pixel gradient, f_i(x) is the fitting function, and y_i is the observed value. The gradient descent method is used to iteratively optimize and minimize the error function to obtain the bridge surface model at each scale. The obtained bridge surface model is used to calculate the scattered light intensity distribution. According to the atmospheric scattering model I(x)=J(x)t(x)+A(1-t(x)), where I(x) is the observed image, J(x) is the fog-free image, t(x) is the transmittance, and A is the atmospheric light value, the initial transmittance is estimated by dark channel priori, and then J(x) and t(x) are alternately optimized to obtain the degradation function. Based on the degradation function, the original image is scattering corrected, and the Wiener filter is used to adaptively compensate for the missing band information. The filter parameters dynamically adjust the filter strength according to the signal-to-noise ratio estimation of the local image block, and finally the bridge image after scattering correction is obtained. The peak signal-to-noise ratio (PSNR) of the image before and after processing is calculated to determine whether the scatter correction effect reaches the preset threshold. If not, the adjustment parameters are returned for reprocessing. The input 2048x1536 pixel bridge image is decomposed at multiple scales and downsampled using the Gaussian pyramid to generate three scale images of 2048x1536, 1024x768 and 512x384. For each scale image, the bridge surface model is fitted using the weighted least squares method. The weight w_i is set based on the pixel gradient calculated by the Sobel operator. The larger the gradient value, the higher the weight. The gradient descent method is used for iterative optimization. The learning rate is set to 0.01 and the maximum number of iterations is 1000. The bridge surface model at each scale is obtained. Using the obtained surface model, the scattered light intensity distribution is calculated, and the atmospheric scattering model I(x)=J(x)t(x)+A(1-t(x)) is applied. The initial transmittance is estimated by the dark channel prior, and the average value of the original image corresponding to the first 0.1% of the brightest pixels in the dark channel image is taken as the atmospheric light value A. Alternate optimization was performed 10 times to solve J(x) and t(x) to obtain the degradation function. Based on the degradation function, the original image was scatter corrected and Wiener filtering was used to compensate for the missing band information. The filter window size was set to 8x8, and the filter strength was dynamically adjusted according to the signal-to-noise ratio estimation of the local image block. The lower the signal-to-noise ratio, the greater the filter strength. Finally, the bridge image after scatter correction was obtained, and the peak signal-to-noise ratio (PSNR) of the image before and after processing was calculated. If the PSNR value is lower than 30dB, the adjustment parameters are returned and reprocessed until the PSNR reaches more than 30dB or the number of iterations exceeds 5 times.
步骤S104,针对散射校正后的桥梁图像,通过形态学顶帽运算提取桥梁结构的多尺度特征,采用局部自相似性度量聚类桥梁表面纹理,获取尺度归一化和纹理分割后的桥梁结构图像。Step S104, for the bridge image after scattering correction, multi-scale features of the bridge structure are extracted through morphological top-hat operation, and the bridge surface texture is clustered using local self-similarity measurement to obtain a bridge structure image after scale normalization and texture segmentation.
根据散射校正后的桥梁图像构建多尺度形态学结构元素集合,所述结构元素大小根据图像最小边长动态设置为预设比例;对所述桥梁图像进行形态学开运算,得到多尺度顶帽变换结果;对所述多尺度顶帽变换结果进行特征融合,采用基于信息熵的加权求和方法,得到融合后的桥梁结构特征图像;在所述融合后的桥梁结构特征图像上,通过滑动窗口计算每个像素与其邻域像素的相似度,构建多尺度相似性矩阵;基于所述多尺度相似性矩阵,采用K均值聚类算法对桥梁表面纹理进行分类,聚类数量设为预设值,使用K-means++算法选择初始中心点,迭代优化直至类中心变化小于预设阈值或达到最大迭代次数;对所述分类结果进行形态学开闭运算后处理,平滑分割边界并消除小的孤立区域,获取尺度归一化和纹理分割后的桥梁结构图像;计算分割前后的轮廓一致性指标,评估分割质量。A multi-scale morphological structural element set is constructed according to the bridge image after scattering correction, and the size of the structural element is dynamically set to a preset ratio according to the minimum side length of the image; a morphological opening operation is performed on the bridge image to obtain a multi-scale top-hat transformation result; feature fusion is performed on the multi-scale top-hat transformation result, and a weighted summation method based on information entropy is adopted to obtain a fused bridge structure feature image; on the fused bridge structure feature image, the similarity between each pixel and its neighboring pixels is calculated through a sliding window to construct a multi-scale similarity matrix; based on the multi-scale similarity matrix, the K-means clustering algorithm is used to classify the bridge surface texture, the number of clusters is set to a preset value, and the K-means++ algorithm is used to select the initial center point, and iterative optimization is performed until the change of the class center is less than the preset threshold or the maximum number of iterations is reached; the classification result is post-processed by morphological opening and closing operations, the segmentation boundary is smoothed and small isolated areas are eliminated, and the bridge structure image after scale normalization and texture segmentation is obtained; the contour consistency index before and after segmentation is calculated to evaluate the segmentation quality.
具体来说,针对散射校正后的桥梁图像,构建多尺度形态学结构元素集合,结构元素大小根据图像最小边长动态设置为1%、2%和3%,对图像进行形态学开运算,然后与原图像相减,得到多尺度顶帽变换结果。对多尺度顶帽变换结果进行特征融合,采用基于信息熵的加权求和方法,计算每个尺度特征的熵值,熵值越高权重越大,得到融合后的桥梁结构特征图像。在融合后的特征图像上,计算局部自相似性度量,选取5×5、7×7和9×9三种大小的局部窗口,通过滑动窗口计算每个像素与其邻域像素的相似度,构建多尺度相似性矩阵。基于多尺度相似性矩阵,采用K均值聚类算法对桥梁表面纹理进行分类,聚类数量设为5,使用K-means++算法选择初始中心点,迭代优化直至类中心变化小于预设阈值或达到最大迭代次数100,获取尺度归一化和纹理分割后的桥梁结构图像。对分割结果进行形态学开闭运算后处理,结构元素大小为3×3,平滑分割边界并消除小的孤立区域。计算分割前后的轮廓一致性指标,评估分割质量。针对2048x1536像素的散射校正后桥梁图像,构建多尺度形态学结构元素集合,结构元素大小分别为15x15、31x31和46x46像素。对图像进行形态学开运算,然后与原图像相减,得到多尺度顶帽变换结果。对变换结果进行特征融合,计算每个尺度特征的熵值,15x15尺度熵值为6.2,31x31尺度为5.8,46x46尺度为5.3,归一化后得到权重0.36、0.34和0.30,进行加权求和得到融合后的桥梁结构特征图像。在融合特征图像上,使用5x5、7x7和9x9三种局部窗口计算自相似性度量,采用结构相似性指数SSIM作为相似度指标,构建多尺度相似性矩阵。基于多尺度相似性矩阵,使用K均值聚类算法对桥梁表面纹理进行分类,聚类数量为5,采用K-means++算法选择初始中心点。迭代优化20次后,类中心变化小于0.001,达到收敛条件,获得纹理分割结果。对分割结果使用3x3大小的结构元素进行形态学开闭运算后处理,平滑分割边界并消除面积小于50平方像素的孤立区域。计算分割前后的轮廓一致性指标,得到0.92的一致性得分,表明分割质量良好。Specifically, for the bridge image after scattering correction, a multi-scale morphological structure element set is constructed. The size of the structure element is dynamically set to 1%, 2% and 3% according to the minimum side length of the image. The image is morphologically opened and then subtracted from the original image to obtain the multi-scale top-hat transformation result. The multi-scale top-hat transformation result is feature fused, and the weighted summation method based on information entropy is used to calculate the entropy value of each scale feature. The higher the entropy value, the greater the weight. The fused bridge structure feature image is obtained. On the fused feature image, the local self-similarity measure is calculated, and three local windows of 5×5, 7×7 and 9×9 are selected. The similarity between each pixel and its neighboring pixels is calculated through the sliding window to construct a multi-scale similarity matrix. Based on the multi-scale similarity matrix, the K-means clustering algorithm is used to classify the bridge surface texture. The number of clusters is set to 5. The initial center point is selected using the K-means++ algorithm. It is iteratively optimized until the change of the class center is less than the preset threshold or the maximum number of iterations is 100, and the bridge structure image after scale normalization and texture segmentation is obtained. The segmentation results were post-processed by morphological opening and closing operations, with a structure element size of 3×3, to smooth the segmentation boundaries and eliminate small isolated areas. The contour consistency index before and after segmentation was calculated to evaluate the segmentation quality. For the 2048x1536 pixel scatter-corrected bridge image, a multi-scale morphological structure element set was constructed, with structure element sizes of 15x15, 31x31, and 46x46 pixels, respectively. The image was morphologically opened and then subtracted from the original image to obtain the multi-scale top-hat transformation result. The transformation results were feature fused, and the entropy value of each scale feature was calculated. The entropy value of the 15x15 scale was 6.2, the 31x31 scale was 5.8, and the 46x46 scale was 5.3. After normalization, the weights were 0.36, 0.34, and 0.30, and the weighted summation was performed to obtain the fused bridge structure feature image. On the fused feature image, three local windows of 5x5, 7x7 and 9x9 were used to calculate the self-similarity measure, and the structural similarity index SSIM was used as the similarity index to construct a multi-scale similarity matrix. Based on the multi-scale similarity matrix, the K-means clustering algorithm was used to classify the bridge surface texture, with the number of clusters being 5, and the K-means++ algorithm was used to select the initial center point. After 20 iterative optimizations, the class center change was less than 0.001, reaching the convergence condition, and the texture segmentation result was obtained. The segmentation result was post-processed with a 3x3-sized structural element for morphological opening and closing operations to smooth the segmentation boundaries and eliminate isolated areas with an area of less than 50 square pixels. The contour consistency index before and after segmentation was calculated, and a consistency score of 0.92 was obtained, indicating that the segmentation quality was good.
步骤S105,在桥梁结构图像上应用改进的Canny算子检测边缘轮廓,通过边缘连接和闭合消除背景干扰,获取完整的桥梁结构边缘图,采用Hough变换检测桥梁结构的多尺度线特征,通过概率投票机制筛选支配性结构线,获取桥梁骨架结构图。Step S105, applying the improved Canny operator to the bridge structure image to detect edge contours, eliminating background interference through edge connection and closure, obtaining a complete bridge structure edge map, using Hough transform to detect multi-scale line features of the bridge structure, and screening dominant structural lines through a probabilistic voting mechanism to obtain a bridge skeleton structure map.
对桥梁结构图像应用所述改进的Canny算子,所述改进的Canny算子采用基于图像局部区域的均值和标准差动态调整阈值,通过高斯滤波消除噪声,计算图像梯度幅值和方向,进行非极大值抑制,得到初步边缘检测结果;根据所述初步边缘检测结果进行边缘连接和闭合处理,采用形态学膨胀操作连接断开的边缘,设置连接距离阈值,利用最小二乘法进行曲线拟合补全缺失边缘,通过区域生长法填充小孔洞,获取完整的桥梁结构边缘图;在所述桥梁结构边缘图上应用多尺度Hough变换,根据图像大小和预期桥梁结构尺寸设置累加器步长和极坐标分辨率,检测多个尺度下的线特征,将检测结果存储在三维数组构成的Hough空间中;根据所述Hough空间中的线段信息,实现概率投票机制筛选支配性结构线,投票权重与线段长度和梯度幅值成正比,设置投票阈值和线段长度阈值,对投票数高于阈值的线段采用DBSCAN聚类算法进行聚类,合并相近的线段,获取桥梁骨架结构图;利用主成分分析验证所述桥梁骨架结构图中提取的骨架结构的主要方向是否符合预期,计算主成分方向与预设桥梁走向的夹角,判断提取结果的准确性。The improved Canny operator is applied to the bridge structure image. The improved Canny operator dynamically adjusts the threshold based on the mean and standard deviation of the local area of the image, eliminates noise through Gaussian filtering, calculates the image gradient amplitude and direction, performs non-maximum suppression, and obtains a preliminary edge detection result; edge connection and closure processing are performed based on the preliminary edge detection result, and the morphological expansion operation is used to connect the disconnected edges, and the connection distance threshold is set. The least squares method is used to perform curve fitting to fill the missing edges, and the small holes are filled by the regional growing method to obtain a complete bridge structure edge map; multi-scale Hough transform is applied to the bridge structure edge map, and the image size and expected bridge structure are calculated according to the image size and expected bridge structure. The accumulator step size and polar coordinate resolution are set according to the structural dimensions, line features at multiple scales are detected, and the detection results are stored in the Hough space composed of a three-dimensional array; according to the line segment information in the Hough space, a probabilistic voting mechanism is implemented to screen the dominant structural lines, the voting weight is proportional to the line segment length and the gradient amplitude, the voting threshold and the line segment length threshold are set, the DBSCAN clustering algorithm is used to cluster the line segments with votes higher than the threshold, the similar line segments are merged, and the bridge skeleton structure diagram is obtained; the principal component analysis is used to verify whether the main direction of the skeleton structure extracted from the bridge skeleton structure diagram is in line with expectations, the angle between the principal component direction and the preset bridge direction is calculated, and the accuracy of the extraction result is judged.
具体来说,对桥梁结构图像应用改进的Canny算子,采用基于图像局部区域的均值和标准差动态调整阈值,通过高斯滤波消除噪声,计算图像梯度幅值和方向,进行非极大值抑制,得到初步边缘检测结果。对初步边缘检测结果进行边缘连接和闭合处理,采用形态学膨胀操作连接断开的边缘,设置连接距离阈值,利用最小二乘法进行曲线拟合补全缺失边缘,通过区域生长法填充小孔洞,种子点选择基于梯度方向一致性,生长条件考虑像素强度和方向差异,获取完整的桥梁结构边缘图。在桥梁结构边缘图上应用多尺度Hough变换,根据图像大小和预期桥梁结构尺寸设置累加器步长和极坐标分辨率,检测多个尺度下的线特征,将检测结果存储在三维数组构成的Hough空间中,记录每条线段的ρ、θ参数和投票数。基于Hough空间中的线段信息,实现概率投票机制筛选支配性结构线,投票权重与线段长度和梯度幅值成正比,设置投票阈值和线段长度阈值,对投票数高于阈值的线段采用DBSCAN聚类算法进行聚类,合并相近的线段,最终获取桥梁骨架结构图。利用主成分分析验证提取的骨架结构的主要方向是否符合预期,计算主成分方向与预设桥梁走向的夹角,判断提取结果的准确性。对2048x1536像素的桥梁结构图像应用改进的Canny算子,使用11x11像素的局部窗口计算均值和标准差,设置低阈值为μ-σ,高阈值为μ+σ。采用5x5高斯核进行滤波,σ=1.4,计算梯度幅值和方向,非极大值抑制窗口为3x3。边缘连接采用8x8膨胀核,连接距离阈值设为20像素。使用最小二乘法拟合3阶多项式曲线补全缺失边缘。区域生长法以梯度方向差异小于15°的边缘点为种子,生长条件为像素强度差异小于20,方向差异小于30°。多尺度Hough变换设置3个尺度,累加器步长分别为1、2、4像素,θ分辨率为0.5°、1°、2°。Hough空间使用1024x180xN的三维数组存储,N为检测到的线段数。概率投票中,权重w=L*G,L为线段长度,G为平均梯度幅值。投票阈值设为总投票数的5%,线段长度阈值为图像对角线长度的10%。DBSCAN聚类参数ε=20像素,M i nPts=3。主成分分析计算特征向量,判断第一主成分方向与预设桥梁走向夹角是否小于15°。Specifically, the improved Canny operator is applied to the bridge structure image, and the threshold is dynamically adjusted based on the mean and standard deviation of the local area of the image. The noise is eliminated by Gaussian filtering, the image gradient amplitude and direction are calculated, and non-maximum suppression is performed to obtain the preliminary edge detection results. The preliminary edge detection results are processed by edge connection and closure. The morphological expansion operation is used to connect the disconnected edges, and the connection distance threshold is set. The least squares method is used to perform curve fitting to complete the missing edges. The small holes are filled by the regional growing method. The seed point selection is based on the consistency of the gradient direction. The growth condition considers the pixel intensity and direction differences to obtain a complete bridge structure edge map. Multi-scale Hough transform is applied to the bridge structure edge map. The accumulator step size and polar coordinate resolution are set according to the image size and the expected bridge structure size. Line features at multiple scales are detected, and the detection results are stored in the Hough space composed of a three-dimensional array. The ρ, θ parameters and the number of votes for each line segment are recorded. Based on the line segment information in Hough space, a probabilistic voting mechanism is implemented to screen the dominant structural lines. The voting weight is proportional to the line segment length and gradient amplitude. The voting threshold and line segment length threshold are set. The DBSCAN clustering algorithm is used to cluster the line segments with votes higher than the threshold, and the similar line segments are merged to finally obtain the bridge skeleton structure diagram. The principal component analysis is used to verify whether the main direction of the extracted skeleton structure is in line with expectations. The angle between the principal component direction and the preset bridge direction is calculated to determine the accuracy of the extraction result. The improved Canny operator is applied to the 2048x1536 pixel bridge structure image, and the mean and standard deviation are calculated using a local window of 11x11 pixels. The low threshold is set to μ-σ and the high threshold is set to μ+σ. A 5x5 Gaussian kernel is used for filtering, σ=1.4, and the gradient amplitude and direction are calculated. The non-maximum suppression window is 3x3. The edge connection uses an 8x8 dilation kernel, and the connection distance threshold is set to 20 pixels. The least squares method is used to fit a third-order polynomial curve to complete the missing edges. The region growing method uses edge points with a gradient direction difference of less than 15° as seeds, and the growth conditions are that the pixel intensity difference is less than 20 and the direction difference is less than 30°. The multi-scale Hough transform sets three scales, the accumulator step size is 1, 2, and 4 pixels, and the θ resolution is 0.5°, 1°, and 2°. The Hough space is stored in a three-dimensional array of 1024x180xN, where N is the number of detected line segments. In the probability voting, the weight w=L*G, L is the line segment length, and G is the average gradient amplitude. The voting threshold is set to 5% of the total number of votes, and the line segment length threshold is 10% of the image diagonal length. The DBSCAN clustering parameters ε=20 pixels, MinPts=3. The principal component analysis calculates the eigenvector to determine whether the angle between the first principal component direction and the preset bridge direction is less than 15°.
步骤S106,根据桥梁骨架结构图,通过结构张量分析确定桥梁表面各向异性区域,利用灰度共生矩阵提取各向异性区域的高阶纹理特征,构建桥梁损伤的纹理特征字典。Step S106, according to the bridge skeleton structure diagram, the anisotropic area of the bridge surface is determined by structural tensor analysis, the high-order texture features of the anisotropic area are extracted using the gray level co-occurrence matrix, and a texture feature dictionary of bridge damage is constructed.
根据桥梁骨架结构图获取图像数据,采用Sobe l算子计算所述图像数据的梯度,构建2x2结构张量矩阵,得到局部区域的结构张量;通过对所述结构张量进行特征值分析,确定各向异性程度;若所述各向异性程度大于预设阈值,则判定为显著各向异性区域,获得桥梁表面的各向异性区域图;针对所述各向异性区域图,采用四叉树分解算法进行多尺度分割,若子区域大小小于32x32像素或区域内各向异性程度变化小于0.1,则终止分割;对所述子区域计算灰度共生矩阵,提取能量、对比度、相关性、熵等高阶纹理特征,构建子区域特征向量;采用K-means++算法初始化K-means聚类,对所述子区域特征向量进行聚类,得到聚类中心;将所述聚类中心作为代表性特征,构建桥梁损伤的纹理特征字典。Image data is acquired according to the bridge skeleton structure diagram, the gradient of the image data is calculated using the Sobel operator, a 2x2 structure tensor matrix is constructed, and the structure tensor of the local area is obtained; the degree of anisotropy is determined by performing eigenvalue analysis on the structure tensor; if the degree of anisotropy is greater than a preset threshold, it is determined to be a significant anisotropic area, and an anisotropic area map of the bridge surface is obtained; for the anisotropic area map, a quadtree decomposition algorithm is used for multi-scale segmentation, and if the size of the sub-area is less than 32x32 pixels or the change in the degree of anisotropy within the area is less than 0.1, the segmentation is terminated; the gray-level co-occurrence matrix is calculated for the sub-area, high-order texture features such as energy, contrast, correlation, and entropy are extracted, and a sub-area feature vector is constructed; the K-means++ algorithm is used to initialize K-means clustering, the sub-area feature vector is clustered, and the cluster center is obtained; the cluster center is used as a representative feature to construct a texture feature dictionary of bridge damage.
具体来说,根据桥梁骨架结构图,使用Sobe l算子计算图像梯度,构建2x2结构张量矩阵,计算局部区域的结构张量,通过特征值分析确定各向异性程度,设置阈值筛选出显著各向异性区域,得到桥梁表面的各向异性区域图。对各向异性区域图进行多尺度分割,采用四叉树分解算法,根据区域大小和各向异性程度自适应划分子区域,终止条件为子区域大小小于32x32像素或区域内各向异性程度变化小于0.1,确保捕捉不同尺度的结构特征。针对划分的子区域,计算灰度共生矩阵,设置距离为1-5像素,方向为0°、45°、90°和135°,灰度级别为32,提取能量、对比度、相关性和熵等高阶纹理特征,构建每个子区域的特征向量。利用K-means聚类算法对所有子区域的特征向量进行聚类,采用K-means++算法进行初始化,设置聚类数量为10,迭代优化直至类内距离最小化或达到最大迭代次数100,将聚类中心作为代表性特征,构建桥梁损伤的纹理特征字典。对构建的特征字典应用主成分分析进行优化,保留95%的方差信息,减少冗余并提高字典的表示能力,得到最终的桥梁损伤纹理特征字典。对2048x1536像素的桥梁骨架结构图,使用3x3Sobe l算子计算x和y方向梯度,构建2x2结构张量矩阵。在16x16像素的滑动窗口内计算局部结构张量,通过特征值分析确定各向异性度,阈值设为0.7,筛选出显著各向异性区域。采用四叉树分解算法进行多尺度分割,初始块大小为512x512像素,递归划分直至子区域小于32x32像素或各向异性度变化小于0.1。对每个子区域计算灰度共生矩阵,设置距离1-5像素,方向0°、45°、90°、135°,32级灰度量化,提取能量、对比度、相关性、熵等20个高阶纹理特征,形成特征向量。使用K-means++算法初始化10个聚类中心,对所有子区域特征向量进行K-means聚类,最大迭代次数设为100,收敛阈值为1e-4。将得到的10个聚类中心作为代表性特征,构建初始纹理特征字典。应用主成分分析对特征字典进行优化,计算特征协方差矩阵,求解特征值和特征向量,选取累积方差贡献率达95%的前N个主成分,通常N为6-8。将原始20维特征投影到N维主成分空间,得到最终的桥梁损伤纹理特征字典。Specifically, according to the bridge skeleton structure diagram, the Sobel operator is used to calculate the image gradient, a 2x2 structure tensor matrix is constructed, the structure tensor of the local area is calculated, the degree of anisotropy is determined by eigenvalue analysis, and a threshold is set to screen out significant anisotropic areas to obtain the anisotropic area map of the bridge surface. The anisotropic area map is segmented at multiple scales, and the quadtree decomposition algorithm is used to adaptively divide the sub-areas according to the area size and the degree of anisotropy. The termination condition is that the sub-area size is less than 32x32 pixels or the anisotropy degree change in the area is less than 0.1, ensuring that the structural features of different scales are captured. For the divided sub-areas, the grayscale co-occurrence matrix is calculated, the distance is set to 1-5 pixels, the direction is 0°, 45°, 90° and 135°, and the grayscale level is 32. High-order texture features such as energy, contrast, correlation and entropy are extracted to construct the feature vector of each sub-area. The K-means clustering algorithm was used to cluster the feature vectors of all sub-regions. The K-means++ algorithm was used for initialization. The number of clusters was set to 10. The iterative optimization was performed until the intra-class distance was minimized or the maximum number of iterations reached 100. The cluster center was used as the representative feature to construct the texture feature dictionary of bridge damage. The constructed feature dictionary was optimized by principal component analysis, retaining 95% of the variance information, reducing redundancy and improving the representation ability of the dictionary, and the final bridge damage texture feature dictionary was obtained. For the 2048x1536 pixel bridge skeleton structure image, the 3x3Sobel operator was used to calculate the x and y direction gradients and construct a 2x2 structure tensor matrix. The local structure tensor was calculated in a sliding window of 16x16 pixels, and the anisotropy was determined by eigenvalue analysis. The threshold was set to 0.7 to screen out the significant anisotropic areas. The quadtree decomposition algorithm was used for multi-scale segmentation. The initial block size was 512x512 pixels, and the recursive partitioning was performed until the sub-region was smaller than 32x32 pixels or the anisotropy change was less than 0.1. The grayscale co-occurrence matrix is calculated for each sub-region, and the distance is set to 1-5 pixels, the direction is 0°, 45°, 90°, 135°, and 32 levels of grayscale quantization are used to extract 20 high-order texture features such as energy, contrast, correlation, and entropy to form a feature vector. The K-means++ algorithm is used to initialize 10 cluster centers, and K-means clustering is performed on all sub-region feature vectors. The maximum number of iterations is set to 100, and the convergence threshold is 1e-4. The 10 cluster centers obtained are used as representative features to construct the initial texture feature dictionary. The principal component analysis is applied to optimize the feature dictionary, calculate the feature covariance matrix, solve the eigenvalues and eigenvectors, and select the first N principal components with a cumulative variance contribution rate of 95%, usually N is 6-8. The original 20-dimensional features are projected into the N-dimensional principal component space to obtain the final bridge damage texture feature dictionary.
步骤S107,在桥梁结构边缘图上应用形态学骨架提取算法获取桥梁连接部位的骨架线,通过骨架线的连通性分析判断桥梁结构是否存在断裂,若存在断裂,则根据断裂区域的边缘轮廓确定损伤位置,根据断裂长度确定损伤尺寸。Step S107, applying a morphological skeleton extraction algorithm to the bridge structure edge map to obtain the skeleton line of the bridge connection part, and judging whether there is a fracture in the bridge structure through the connectivity analysis of the skeleton line. If there is a fracture, the damage location is determined according to the edge contour of the fracture area, and the damage size is determined according to the fracture length.
对桥梁结构边缘图应用Zhang-Suen细化算法进行形态学骨架提取,得到桥梁连接部位的初始骨架线图像;根据所述初始骨架线图像进行后处理,采用像素连通性分析去除长度小于预设阈值的分支和孤立点,通过预定义的结构元素进行形态学开闭运算,得到优化后的桥梁骨架线图像;对所述优化后的骨架线图像进行连通性分析,采用8邻域连通区域标记算法,获取连通区域数量和各区域像素数;若所述连通区域间距离超过预设阈值,则判断存在断裂,对所述断裂区域进行定位和测量,通过Moore邻域边界跟踪算法确定损伤位置的坐标,计算骨架线断裂两端点间的最短路径长度作为损伤尺寸;根据所述断裂位置和损伤尺寸,与预设的桥梁结构模型进行比对,判断所述断裂位置和损伤尺寸是否在合理范围内,若超出预设范围,则调整参数重新进行处理。The Zhang-Suen thinning algorithm is applied to the bridge structure edge map for morphological skeleton extraction to obtain the initial skeleton line image of the bridge connection part; post-processing is performed based on the initial skeleton line image, and pixel connectivity analysis is used to remove branches and isolated points whose lengths are less than a preset threshold, and morphological opening and closing operations are performed through predefined structural elements to obtain an optimized bridge skeleton line image; connectivity analysis is performed on the optimized skeleton line image, and an 8-neighborhood connected area labeling algorithm is used to obtain the number of connected areas and the number of pixels in each area; if the distance between the connected areas exceeds the preset threshold, it is determined that there is a fracture, and the fracture area is located and measured, and the coordinates of the damage position are determined by the Moore neighborhood boundary tracking algorithm, and the shortest path length between the two end points of the skeleton line fracture is calculated as the damage size; according to the fracture position and damage size, a comparison is performed with the preset bridge structure model to determine whether the fracture position and damage size are within a reasonable range. If they exceed the preset range, the parameters are adjusted and reprocessed.
具体来说,对桥梁结构边缘图应用Zhang-Suen细化算法进行形态学骨架提取,设置像素变化数小于10或达到100次迭代作为终止条件,得到桥梁连接部位的初始骨架线图像。对初始骨架线图像进行后处理,基于像素连通性分析去除长度小于20像素的分支和孤立点,通过3x3圆形结构元素的形态学开闭运算平滑骨架线,得到优化后的桥梁骨架线图像。对优化后的骨架线图像进行连通性分析,采用8邻域连通区域标记算法,统计连通区域数量和各区域像素数,若连通区域间距离超过50像素,则判断存在断裂。若存在断裂,则对断裂区域进行定位和测量,通过Moore邻域边界跟踪算法确定损伤位置的坐标,计算骨架线断裂两端点间的最短路径长度作为损伤尺寸。通过与预设的桥梁结构模型比对,验证检测到的断裂位置和尺寸是否在合理范围内,若超出预设范围,则调整前述参数重新进行处理。对处理过程中的关键中间结果进行可视化,包括初始骨架线、优化后骨架线、连通性分析结果和断裂定位结果。对2048x1536像素的桥梁结构边缘图应用Zhang-Suen细化算法,迭代98次后像素变化数小于10,得到初始骨架线图像。对初始骨架线进行后处理,去除175个长度小于20像素的分支和23个孤立点,使用3x3圆形结构元素进行3次开运算和2次闭运算,得到优化后的桥梁骨架线图像。采用8邻域连通区域标记算法分析连通性,标记出7个连通区域,最大区域像素数为12453,最小区域像素数为89。发现2处连通区域间距离分别为62像素和78像素,超过50像素阈值,判定存在断裂。使用Moore邻域边界跟踪算法确定损伤位置坐标,第一处断裂位于(1024,768),第二处位于(1536,1152)。通过A*算法计算骨架线断裂两端点间的最短路径长度,得到损伤尺寸分别为85像素和103像素。将检测结果与预设桥梁结构模型比对,第一处断裂位置偏差3.2%,尺寸偏差2.8%,第二处断裂位置偏差4.1%,尺寸偏差3.5%,均在5%的合理范围内。生成可视化结果,包括初始骨架线图、优化后骨架线图、连通区域标记图和断裂定位图。Specifically, the Zhang-Suen thinning algorithm is applied to the edge map of the bridge structure for morphological skeleton extraction. The pixel change number is set to be less than 10 or reach 100 iterations as the termination condition to obtain the initial skeleton line image of the bridge connection. The initial skeleton line image is post-processed, and branches and isolated points with a length of less than 20 pixels are removed based on pixel connectivity analysis. The skeleton line is smoothed by morphological opening and closing operations of 3x3 circular structural elements to obtain the optimized bridge skeleton line image. The optimized skeleton line image is subjected to connectivity analysis, and the 8-neighborhood connected region labeling algorithm is used to count the number of connected regions and the number of pixels in each region. If the distance between connected regions exceeds 50 pixels, it is judged that there is a fracture. If there is a fracture, the fracture area is located and measured, and the coordinates of the damage position are determined by the Moore neighborhood boundary tracking algorithm. The shortest path length between the two end points of the skeleton line fracture is calculated as the damage size. By comparing with the preset bridge structure model, it is verified whether the detected fracture position and size are within a reasonable range. If it exceeds the preset range, the aforementioned parameters are adjusted and reprocessed. The key intermediate results in the processing process are visualized, including the initial skeleton line, the optimized skeleton line, the connectivity analysis results, and the fracture location results. The Zhang-Suen thinning algorithm is applied to the 2048x1536 pixel bridge structure edge map. After 98 iterations, the pixel change number is less than 10, and the initial skeleton line image is obtained. The initial skeleton line is post-processed to remove 175 branches with a length of less than 20 pixels and 23 isolated points. The 3x3 circular structure element is used to perform 3 opening operations and 2 closing operations to obtain the optimized bridge skeleton line image. The 8-neighborhood connected region marking algorithm is used to analyze connectivity, and 7 connected regions are marked. The maximum number of pixels in the region is 12453 and the minimum number of pixels in the region is 89. It is found that the distances between the two connected regions are 62 pixels and 78 pixels, respectively, which exceeds the 50-pixel threshold, and it is determined that there is a fracture. The Moore neighborhood boundary tracking algorithm is used to determine the coordinates of the damage location. The first fracture is located at (1024,768) and the second is located at (1536,1152). The A* algorithm was used to calculate the shortest path length between the two end points of the skeleton line fracture, and the damage sizes were 85 pixels and 103 pixels respectively. The detection results were compared with the preset bridge structure model. The first fracture position deviation was 3.2%, the size deviation was 2.8%, and the second fracture position deviation was 4.1%, and the size deviation was 3.5%, all within the reasonable range of 5%. Visual results were generated, including the initial skeleton line graph, the optimized skeleton line graph, the connected area labeling graph, and the fracture location graph.
步骤S108,综合桥梁结构完整性、表面纹理特征和损伤定量指标,采用支持向量机回归模型对桥梁健康状态进行评估,获得桥梁各部位损伤程度预测值,将预测值映射到健康状态等级,生成桥梁健康评估报告,直观呈现桥梁损伤检测结果。Step S108, comprehensively consider the structural integrity, surface texture characteristics and quantitative damage indicators of the bridge, use a support vector machine regression model to evaluate the health status of the bridge, obtain the predicted value of the damage degree of each part of the bridge, map the predicted value to the health status level, generate a bridge health assessment report, and intuitively present the bridge damage detection results.
获取桥梁结构完整性、表面纹理特征和损伤定量指标;根据所述结构完整性、表面纹理特征和损伤定量指标,采用特征级联方法将三类特征向量拼接,得到桥梁健康状态评估的特征向量;从历史数据中获取样本数据集,根据所述样本数据集构建支持向量机回归模型;通过网格搜索法确定所述支持向量机回归模型的核函数参数和惩罚因子;利用所述支持向量机回归模型对桥梁各部位的特征向量进行预测,得到损伤程度预测值;通过实地检测获取实测损伤程度值;根据所述实测损伤程度值和所述损伤程度预测值计算均方根误差;若所述均方根误差超过预设阈值,则返回调整所述支持向量机回归模型的参数。The structural integrity, surface texture characteristics and quantitative damage indicators of the bridge are obtained; based on the structural integrity, surface texture characteristics and quantitative damage indicators, the three types of feature vectors are spliced by the feature cascade method to obtain the feature vector for bridge health status assessment; a sample data set is obtained from historical data, and a support vector machine regression model is constructed based on the sample data set; the kernel function parameters and penalty factors of the support vector machine regression model are determined by the grid search method; the feature vectors of various parts of the bridge are predicted by the support vector machine regression model to obtain the predicted value of the degree of damage; the measured degree of damage value is obtained through field testing; the root mean square error is calculated based on the measured degree of damage value and the predicted value of the degree of damage; if the root mean square error exceeds the preset threshold, the parameters of the support vector machine regression model are returned to adjust.
具体来说,对桥梁结构完整性、表面纹理特征和损伤定量指标进行特征融合,采用特征级联方法将三类特征向量拼接,权重通过数据驱动的相关性分析确定,然后使用主成分分析法降维,保留累积贡献率达95%的主成分,构建桥梁健康状态评估的特征向量。根据历史数据构建支持向量机回归模型,选择径向基核函数,通过网格搜索法优化核函数参数和惩罚因子,参数C的搜索范围从2^-5到2^15,gamma从2^-15到2^3,采用10折交叉验证评估模型性能。利用训练好的支持向量机回归模型,对桥梁各部位的特征向量进行预测,得到损伤程度预测值,并采用基于预测方差的de lta方法计算预测结果的95%置信区间。设置健康状态等级划分标准,将预测值及其置信区间映射到相应的健康状态等级,将桥梁状态分为优秀0-0.2、良好0.2-0.4、一般0.4-0.6、较差0.6-0.8和危险0.8-1.0五个等级,生成包含损伤程度、健康等级和置信水平的评估报告,采用热力图形式直观呈现桥梁各部位的损伤检测结果。通过实地检测验证评估报告的准确性,计算预测值与实测值的均方根误差,若误差超过预设阈值,则返回调整模型参数重新进行训练和预测。对桥梁的结构完整性、表面纹理特征和损伤定量指标进行特征融合,采用特征级联方法将三类特征向量拼接,得到300维的原始特征向量。通过相关性分析,为结构完整性、表面纹理和损伤指标分别赋予0.4、0.3和0.3的权重。使用主成分分析法降维,保留前20个主成分,累积贡献率达到96.5%。构建支持向量机回归模型,选用RBF核函数,通过网格搜索法在C=[2^-5,2^-3,...,2^15]和gamma=[2^-15,2^-13,...,2^3]的范围内优化参数,采用10折交叉验证,最终确定最优参数C=2^7,gamma=2^-5。利用优化后的模型对1000个桥梁部位进行预测,得到损伤程度预测值,并计算95%置信区间,平均预测值为0.45,置信区间宽度为Specifically, the structural integrity, surface texture characteristics and quantitative damage indicators of the bridge are fused, and the three types of feature vectors are spliced using the feature cascade method. The weights are determined by data-driven correlation analysis, and then the principal component analysis method is used to reduce the dimension, retaining the principal components with a cumulative contribution rate of 95%, and constructing the feature vector for bridge health status assessment. The support vector machine regression model is constructed based on historical data, and the radial basis kernel function is selected. The kernel function parameters and penalty factors are optimized by the grid search method. The search range of parameter C is from 2^-5 to 2^15, and gamma is from 2^-15 to 2^3. The model performance is evaluated by 10-fold cross validation. Using the trained support vector machine regression model, the feature vectors of various parts of the bridge are predicted to obtain the predicted value of the degree of damage, and the delta method based on the prediction variance is used to calculate the 95% confidence interval of the prediction result. The health status classification standard is set, and the predicted value and its confidence interval are mapped to the corresponding health status level. The bridge status is divided into five levels: excellent 0-0.2, good 0.2-0.4, general 0.4-0.6, poor 0.6-0.8 and dangerous 0.8-1.0. An assessment report containing damage degree, health level and confidence level is generated, and the damage detection results of various parts of the bridge are intuitively presented in the form of a heat map. The accuracy of the assessment report is verified through field testing, and the root mean square error between the predicted value and the measured value is calculated. If the error exceeds the preset threshold, the model parameters are adjusted to retrain and predict. The structural integrity, surface texture characteristics and quantitative damage indicators of the bridge are fused, and the three types of feature vectors are spliced using the feature cascade method to obtain a 300-dimensional original feature vector. Through correlation analysis, weights of 0.4, 0.3 and 0.3 are assigned to the structural integrity, surface texture and damage indicators respectively. The principal component analysis method is used for dimensionality reduction, and the first 20 principal components are retained, with a cumulative contribution rate of 96.5%. The support vector machine regression model was constructed, and the RBF kernel function was selected. The parameters were optimized in the range of C = [2^-5, 2^-3, ..., 2^15] and gamma = [2^-15, 2^-13, ..., 2^3] by grid search method. The optimal parameters C = 2^7 and gamma = 2^-5 were finally determined by 10-fold cross validation. The optimized model was used to predict 1000 bridge parts, and the damage degree prediction value was obtained. The 95% confidence interval was calculated. The average prediction value was 0.45, and the confidence interval width was
±0.08。将预测结果映射到健康状态等级,其中150个部位为优秀0-0.2,30个良好0.2-0.4,350个一般0.4-0.6,150个较差0.6-0.8,50个危险0.8-1.0。生成热力图可视化评估报告,直观展示各部位损伤情况。通过实地检测对100个随机选取的部位进行验证,计算均方根误差为0.062,低于预设阈值0.1,验证模型预测精度满足要求。±0.08. The prediction results are mapped to health status levels, of which 150 parts are excellent 0-0.2, 30 are good 0.2-0.4, 350 are average 0.4-0.6, 150 are poor 0.6-0.8, and 50 are dangerous 0.8-1.0. A heat map visualization evaluation report is generated to intuitively display the damage of each part. Through field testing, 100 randomly selected parts are verified, and the calculated root mean square error is 0.062, which is lower than the preset threshold of 0.1, verifying that the prediction accuracy of the model meets the requirements.
最后应说明的是:以上各实施例仅用以说明本发明的技术方案,而非对其限制;尽管参照前述各实施例对本发明进行了详细的说明,本领域的普通技术人员应当理解:其依然可以对前述各实施例所记载的技术方案进行修改,或者对其中部分或者全部技术特征进行等同替换;而这些修改或者替换,并不使相应技术方案的本质脱离本发明各实施例技术方案的范围。Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or replace some or all of the technical features therein with equivalents. However, these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present invention.
Claims (10)
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202411018636.9A CN118823481B (en) | 2024-07-29 | 2024-07-29 | A bridge detection image recognition method and system based on artificial intelligence |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202411018636.9A CN118823481B (en) | 2024-07-29 | 2024-07-29 | A bridge detection image recognition method and system based on artificial intelligence |
Publications (2)
Publication Number | Publication Date |
---|---|
CN118823481A true CN118823481A (en) | 2024-10-22 |
CN118823481B CN118823481B (en) | 2025-02-07 |
Family
ID=93070706
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202411018636.9A Active CN118823481B (en) | 2024-07-29 | 2024-07-29 | A bridge detection image recognition method and system based on artificial intelligence |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN118823481B (en) |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN119090750A (en) * | 2024-11-07 | 2024-12-06 | 陕西省中医医院 | Image enhancement method and system for optical imaging acupoint assisted identification |
CN119600298A (en) * | 2025-02-10 | 2025-03-11 | 西安中交公路岩土工程有限责任公司 | Side slope deformation monitoring method based on image recognition |
Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20110150358A1 (en) * | 2009-12-18 | 2011-06-23 | Tandent Vision Science, Inc. | Method and system for factoring an illumination image |
CN106548463A (en) * | 2016-10-28 | 2017-03-29 | 大连理工大学 | Based on dark and the sea fog image automatic defogging method and system of Retinex |
CN111476725A (en) * | 2020-03-24 | 2020-07-31 | 广西科技大学 | Image defogging enhancement algorithm based on gradient domain oriented filtering and multi-scale Retinex theory |
WO2021000302A1 (en) * | 2019-07-03 | 2021-01-07 | 深圳大学 | Image dehazing method and system based on superpixel segmentation, and storage medium and electronic device |
CN114239099A (en) * | 2021-11-02 | 2022-03-25 | 华南理工大学 | Bridge seismic vulnerability calculation method based on piecewise linear function |
-
2024
- 2024-07-29 CN CN202411018636.9A patent/CN118823481B/en active Active
Patent Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20110150358A1 (en) * | 2009-12-18 | 2011-06-23 | Tandent Vision Science, Inc. | Method and system for factoring an illumination image |
CN106548463A (en) * | 2016-10-28 | 2017-03-29 | 大连理工大学 | Based on dark and the sea fog image automatic defogging method and system of Retinex |
WO2021000302A1 (en) * | 2019-07-03 | 2021-01-07 | 深圳大学 | Image dehazing method and system based on superpixel segmentation, and storage medium and electronic device |
CN111476725A (en) * | 2020-03-24 | 2020-07-31 | 广西科技大学 | Image defogging enhancement algorithm based on gradient domain oriented filtering and multi-scale Retinex theory |
CN114239099A (en) * | 2021-11-02 | 2022-03-25 | 华南理工大学 | Bridge seismic vulnerability calculation method based on piecewise linear function |
Non-Patent Citations (3)
Title |
---|
QINGSONG ZHU等: "A Fast Single Image Haze Removal Algorithm Using Color Attenuation Prior", IEEE TRANSACTIONS ON IMAGE PROCESSING, 16 June 2015 (2015-06-16), pages 3522 * |
孙乐乐;温常磊;张亚坤;王健;钟永元;: "雾霾天气下的桥梁裂缝检测", 交通工程, no. 01, 15 February 2020 (2020-02-15) * |
宁贝等: "基于多尺度引导滤波的实时视频去雾算法", 中北大学学报, 14 June 2024 (2024-06-14), pages 439 - 447 * |
Cited By (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN119090750A (en) * | 2024-11-07 | 2024-12-06 | 陕西省中医医院 | Image enhancement method and system for optical imaging acupoint assisted identification |
CN119090750B (en) * | 2024-11-07 | 2025-01-28 | 陕西省中医医院 | Image enhancement method and system for optical imaging acupoint assisted identification |
CN119600298A (en) * | 2025-02-10 | 2025-03-11 | 西安中交公路岩土工程有限责任公司 | Side slope deformation monitoring method based on image recognition |
Also Published As
Publication number | Publication date |
---|---|
CN118823481B (en) | 2025-02-07 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN117541588B (en) | Printing defect detection method for paper product | |
Wu et al. | An active contour model based on texture distribution for extracting inhomogeneous insulators from aerial images | |
CN110473201A (en) | A kind of automatic testing method and device of disc surface defect | |
CN111507426A (en) | No-reference image quality grading evaluation method and device based on visual fusion characteristics | |
CN116664565A (en) | Hidden crack detection method and system for photovoltaic solar cell | |
CN116818778B (en) | Rapid and intelligent detection method and system for automobile parts | |
CN118527377A (en) | Incomplete detection and removal device and method | |
CN116228780B (en) | Silicon wafer defect detection method and system based on computer vision | |
CN118644470B (en) | Ball screw thread defect detection method and system integrating computer vision | |
CN117635615B (en) | Defect detection method and system for realizing punching die based on deep learning | |
CN117764989A (en) | Visual-aided display screen defect detection method | |
Halder et al. | Edge detection: A statistical approach | |
CN117557565B (en) | Detection method and device for lithium battery pole piece | |
CN118823481A (en) | A bridge detection image recognition method and system based on artificial intelligence | |
CN117649606A (en) | Hyperspectral image shadow removing method and hyperspectral image shadow removing system based on intrinsic representation model | |
CN110263778A (en) | A kind of meter register method and device based on image recognition | |
CN113822361B (en) | SAR image similarity measurement method and system based on Hamming distance | |
CN118552550B (en) | Wear detection method, system and equipment for multi-caliper disc type elevator brake | |
CN118823588A (en) | An improved YOLOV8 method for multi-pose target recognition and positioning of chili pepper | |
CN116309561B (en) | Surface defect identification method based on anti-creeping insulating material | |
CN117952935A (en) | Photovoltaic panel shadow heating spot identification method based on visible light image threshold segmentation | |
CN117808809A (en) | Visual inspection method and system for wafer surface defects | |
CN111488811A (en) | Face recognition method and device, terminal equipment and computer readable medium | |
Shekar et al. | Edge Detection in Gray-Scale Images Using Partial Sum of Second-Order Taylor Series Expansion | |
CN111415365A (en) | Image detection method and device |
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 |