A bridge crack identification method and system
By preprocessing, segmenting and feature extraction and fusion processing on the bridge image, the problem of low recognition accuracy in the prior art is solved, and higher crack recognition accuracy and detail retention are achieved.
Patent Information
- Application Number
- CN202510134559.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-02-07
- Publication Date
- 2025-05-16
- Estimated Expiration
- 2045-02-07
AI Technical Summary
The existing bridge crack identification method is not very accurate in identifying structures due to image noise interference, and it is impossible to accurately identify cracks in bridges, affecting bridge safety.
By obtaining the image data of the target bridge, preprocessing and foreground segmentation, the first and second feature images are extracted, and the fusion process is performed, and the fusion image is finally input into the preset crack recognition model for identification.
It improves the accuracy of foreground segmentation, effectively avoids noise interference, improves the accuracy of crack recognition, and retains the detailed information of the image.
Smart Images

Figure CN119580105B_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of bridge crack identification, and in particular relates to a bridge crack identification method and system. Background Art
[0002] As an important part of the transportation network, the safety and stability of bridges are very important. However, as time goes by, many bridge structures will inevitably develop cracks and other hazards due to long-term vehicle loads, environmental erosion and other factors. Therefore, it is necessary to monitor the cracks of bridges in order to actually repair the cracks in bridges.
[0003] Traditional bridge crack recognition methods usually use drones to take images of bridges and perform a series of processing on the images to identify cracks in the images. However, for existing recognition methods, due to the interference of noise in the images, the final recognition structure is not accurate enough and cracks in the bridge cannot be accurately identified, affecting bridge safety. Summary of the invention
[0004] In order to solve the above technical problems, the present invention provides a bridge crack identification method and system, which are used to solve the technical problems in the prior art.
[0005] On the one hand, the present invention provides the following technical solution, a bridge crack identification method, comprising:
[0006] Acquire image data of a target bridge, pre-process the image data of the target bridge to obtain a processed image, and perform foreground segmentation processing on the processed image to obtain a segmented image;
[0007] Performing a first feature extraction on the segmented image to obtain a first feature image;
[0008] Performing a second feature extraction on the segmented image to obtain a second feature image;
[0009] Fusing the first feature image with the second feature image to obtain a fused image;
[0010] A bridge training image is obtained, the bridge training image is input into a preset crack recognition model for training, and the fused image is input into the trained preset crack recognition model for crack recognition to obtain a crack recognition result.
[0011] Compared with the prior art, the beneficial effects of the present invention are as follows: the present invention first obtains image data of the target bridge, pre-processes the image data of the target bridge to obtain a processed image, performs foreground segmentation processing on the processed image to obtain a segmented image; then performs a first feature extraction on the segmented image to obtain a first feature image; then performs a second feature extraction on the segmented image to obtain a second feature image; then performs a fusion processing on the first feature image and the second feature image to obtain a fused image; finally, obtains a bridge training image, inputs the bridge training image into a preset crack recognition model for training, and inputs the fused image into the trained preset crack recognition model for crack recognition to obtain a crack recognition result. The present invention first segments the image to improve the accuracy of foreground segmentation, and then performs feature extraction and fusion on the image, thereby effectively avoiding noise interference with the image, with low distortion and able to effectively retain detail information in the image, so as to improve the accuracy of subsequent model crack recognition.
[0012] Preferably, the step of preprocessing the image data of the target bridge to obtain a processed image is specifically as follows:
[0013] The image data of the target bridge is subjected to image cropping, rotation, and smoothing filtering in sequence to obtain a processed image.
[0014] Preferably, the step of performing foreground segmentation processing on the processed image to obtain a segmented image includes:
[0015] Obtaining the grayscale level of each pixel in the processed image and the grayscale mean within the neighborhood of each pixel;
[0016] Calculate pixel probability based on the gray level of each pixel and the gray mean value within the neighborhood of each pixel :
[0017] ;
[0018] In the formula, Indicates the number of pixels in the processed image. Indicates the gray level is And the grayscale mean within its neighborhood is The number of pixels;
[0019] Based on the pixel probability Calculate segmentation probability :
[0020] ;
[0021] In the formula, Respectively represent the first preset threshold and the second preset threshold, Indicates the neighborhood range;
[0022] Based on the segmentation probability Calculate the pending partition function :
[0023] ;
[0024] In the formula, , They are background proportion and foreground proportion respectively;
[0025] Based on the undetermined partition function Determine the final split function :
[0026] ;
[0027] The final segmentation function is solved to obtain an optimal first preset threshold and an optimal second preset threshold, and a foreground segmentation process is performed on the processed image based on the optimal first preset threshold and the optimal second preset threshold to obtain a segmented image.
[0028] Preferably, the step of performing first feature extraction on the segmented image to obtain a first feature image comprises:
[0029] Calculate the segmented image The first gradient value in the x direction The second gradient value in the y direction :
[0030] ;
[0031] ;
[0032] In the formula, represents the x direction and the scale is The dyadic wavelet transform of represents the y direction and the scale is The dyadic wavelet transform of represents the x direction and the scale is The dyadic wavelet transform of represents the y direction and the scale is Dyadic wavelet transform of ;
[0033] Based on the first gradient value With the second gradient value Calculate the gradient magnitude The gradient direction angle :
[0034] ; ;
[0035] Based on the gradient modulus The gradient direction angle A first feature image is determined.
[0036] Preferably, the gradient modulus value The gradient direction angle The step of determining the first feature image comprises:
[0037] Determine the segmented image The gradient modulus of any two adjacent pixels with the same gradient direction angle, and the pixel with the larger gradient modulus is stored in the point set to be extracted;
[0038] Calculate the first scale factor in the x direction The second scale factor in the y direction :
[0039] ; ;
[0040] In the formula, is a smooth function;
[0041] Based on the first scale coefficient With the second scale coefficient Calculate the first scale factor in the x direction The second scale factor in the y direction :
[0042] ;
[0043] Based on the first scale coefficient , the second scale coefficient , the first scale factor and the second scale factor Calculating the screening threshold :
[0044] ;
[0045] In the formula, is the adjustment coefficient, is a constant, The scales are The first scale coefficient and the second scale coefficient of is the noise variance;
[0046] The gradient modulus of the points to be extracted is less than the screening threshold The pixel points are eliminated to obtain a eliminated pixel set, and the points in the eliminated pixel set are combined to obtain a first feature image.
[0047] Preferably, the step of performing second feature extraction on the segmented image to obtain a second feature image comprises:
[0048] Determine the square matrix And the first angle matrix , the second angle matrix , the third angle matrix , the fourth angle matrix :
[0049] ; ; ;
[0050] ; ;
[0051] Based on square matrix And the first angle matrix , the second angle matrix , the third angle matrix , the fourth angle matrix Calculate the first adjustment value With the second adjustment value :
[0052] ;
[0053] ;
[0054] In the formula, , , , They represent expansion, corrosion, opening and closing operations respectively. Indicates Angle matrix, , To segment the image;
[0055] Calculate an adjusted image based on the first adjustment value and the second adjustment value :
[0056] ;
[0057] In the formula, is the adjustment factor;
[0058] Determine the pixel distances of the pixel points in the segmented image at the first angle, the second angle, the third angle, and the fourth angle, respectively, and calculate the first weight according to the pixel distances , second weight , the third weight , the fourth weight :
[0059] ; ;
[0060] ; ;
[0061] In the formula, are the pixel distances corresponding to the first angle, the second angle, the third angle, and the fourth angle respectively;
[0062] Based on the first weight , second weight , the third weight , the fourth weight Adjust the image Determine the second feature image :
[0063] ;
[0064] In the formula, For the Weight.
[0065] Preferably, the step of fusing the first feature image with the second feature image to obtain a fused image comprises:
[0066] Performing wavelet decomposition on the first characteristic image to obtain first high-frequency data and first low-frequency data;
[0067] Performing wavelet decomposition on the second characteristic image to obtain second high-frequency data and second low-frequency data;
[0068] The first high-frequency data is fused with the second high-frequency data to obtain fused high-frequency data, and the first low-frequency data is fused with the second low-frequency data to obtain fused low-frequency data;
[0069] The fused high-frequency data and the fused low-frequency data are weightedly fused to obtain a fused image.
[0070] In a second aspect, the present invention provides the following technical solution, a bridge crack identification system, the system comprising:
[0071] A processing module, used for acquiring image data of a target bridge, preprocessing the image data of the target bridge to obtain a processed image, and performing foreground segmentation processing on the processed image to obtain a segmented image;
[0072] A first extraction module, used for performing a first feature extraction on the segmented image to obtain a first feature image;
[0073] A second extraction module, used for performing second feature extraction on the segmented image to obtain a second feature image;
[0074] A fusion module, used for fusing the first feature image with the second feature image to obtain a fused image;
[0075] The recognition module is used to obtain a bridge training image, input the bridge training image into a preset crack recognition model for training, and input the fused image into the trained preset crack recognition model for crack recognition to obtain a crack recognition result.
[0076] In a third aspect, the present invention provides the following technical solution: a computer comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the bridge crack identification method as described above when executing the computer program.
[0077] In a fourth aspect, the present invention provides the following technical solution: a storage medium having a computer program stored thereon, wherein the computer program, when executed by a processor, implements the bridge crack identification method as described above. BRIEF DESCRIPTION OF THE DRAWINGS
[0078] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0079] Figure 1 A flow chart of a bridge crack identification method provided in Embodiment 1 of the present invention;
[0080] Figure 2 A structural block diagram of a bridge crack identification system provided in Embodiment 2 of the present invention;
[0081] Figure 3 A schematic diagram of the hardware structure of a computer provided in another embodiment of the present invention.
[0082] The embodiments of the present invention will be further described below with reference to the accompanying drawings. DETAILED DESCRIPTION
[0083] Embodiments of the present invention are described in detail below, examples of which are shown in the accompanying drawings, wherein the same or similar reference numerals throughout represent the same or similar elements or elements having the same or similar functions. The embodiments described below with reference to the accompanying drawings are exemplary and are intended to be used to explain the embodiments of the present invention, and should not be construed as limiting the present invention.
[0084] In the description of the embodiments of the present invention, it should be understood that the terms "length", "width", "up", "down", "front", "back", "left", "right", "vertical", "horizontal", "top", "bottom", "inside" and "outside" etc., indicating orientations or positional relationships, are based on the orientations or positional relationships shown in the accompanying drawings, and are only for the convenience of describing the embodiments of the present invention and simplifying the description, and do not indicate or imply that the referred device or element must have a specific orientation, be constructed and operated in a specific orientation, and therefore should not be understood as a limitation on the present invention.
[0085] In addition, the terms "first" and "second" are used for descriptive purposes only and should not be understood as indicating or implying relative importance or implicitly indicating the number of the indicated technical features. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of the features. In the description of the embodiments of the present invention, the meaning of "plurality" is two or more, unless otherwise clearly and specifically defined.
[0086] In the embodiments of the present invention, unless otherwise clearly specified and limited, the terms "installed", "connected", "connected", "fixed" and the like should be understood in a broad sense, for example, it can be a fixed connection, a detachable connection, or an integral connection; it can be a mechanical connection or an electrical connection; it can be a direct connection or an indirect connection through an intermediate medium, it can be the internal connection of two elements or the interaction relationship between two elements. For ordinary technicians in this field, the specific meanings of the above terms in the embodiments of the present invention can be understood according to specific circumstances.
[0087] Embodiment 1
[0088] In the first embodiment of the present invention, Figure 1 As shown, a bridge crack identification method includes:
[0089] S1, acquiring image data of a target bridge, preprocessing the image data of the target bridge to obtain a processed image, and performing foreground segmentation processing on the processed image to obtain a segmented image;
[0090] The image data of the target bridge here can be obtained by taking images of the target bridge at different angles and positions by a drone, and the steps of preprocessing the image data of the target bridge are specifically as follows:
[0091] The image data of the target bridge is subjected to image cropping, rotation, and smoothing filtering in sequence to obtain a processed image;
[0092] The above preprocessing process is a commonly used image processing method in the prior art, so it will not be described in detail here.
[0093] The step of performing foreground segmentation processing on the processed image to obtain a segmented image specifically includes:
[0094] S11, obtaining the gray level of each pixel in the processed image and the gray mean value within the neighborhood of each pixel.
[0095] S12: Calculate pixel probability based on the gray level of each pixel and the gray mean within the neighborhood of each pixel. :
[0096] ;
[0097] In the formula, Indicates the number of pixels in the processed image. Indicates the gray level is And the grayscale mean within its neighborhood is The number of pixels;
[0098] S13, based on the pixel probability Calculate segmentation probability :
[0099] ;
[0100] In the formula, Respectively represent the first preset threshold and the second preset threshold, Indicates the neighborhood range;
[0101] Specifically, the first preset threshold and the second preset threshold here are actually a segmentation threshold group. The first preset threshold and the second preset threshold here are preset values, and in subsequent steps, they need to be optimized.
[0102] S14, based on the segmentation probability Calculate the pending partition function :
[0103] ;
[0104] In the formula, , They are background proportion and foreground proportion respectively;
[0105] Specifically, the undetermined segmentation function here is specifically an objective function related to the first preset threshold and the second preset threshold.
[0106] S15, based on the undetermined segmentation function Determine the final split function :
[0107] ;
[0108] Specifically, the purpose of the objective function is to solve the optimal first preset threshold and the optimal second preset threshold so that the function value of the objective function is maximized.
[0109] S16, solving the final segmentation function to obtain an optimal first preset threshold and an optimal second preset threshold, and performing foreground segmentation processing on the processed image based on the optimal first preset threshold and the optimal second preset threshold to obtain a segmented image;
[0110] Specifically, a genetic algorithm can be used here to solve the final segmentation function. The genetic algorithm here is a commonly used algorithm in the prior art, so it will not be elaborated here. When the function value of the final segmentation function is the largest, the optimal first preset threshold and the optimal second preset threshold can be output, that is, the optimal first preset threshold and the optimal second preset threshold. After that, the pixel points whose grayscale levels are between the optimal first preset threshold and the optimal second preset threshold are retained to obtain a segmented image.
[0111] S2, performing a first feature extraction on the segmented image to obtain a first feature image;
[0112] Wherein, the step S2 comprises:
[0113] S21, calculating the segmented image The first gradient value in the x direction The second gradient value in the y direction :
[0114] ;
[0115] ;
[0116] In the formula, represents the x direction and the scale is The dyadic wavelet transform of represents the y direction and the scale is The dyadic wavelet transform of represents the x direction and the scale is The dyadic wavelet transform of represents the y direction and the scale is The dyadic wavelet transform of .
[0117] S22, based on the first gradient value With the second gradient value Calculate the gradient magnitude The gradient direction angle :
[0118] ; .
[0119] S23, based on gradient modulus The gradient direction angle determining a first feature image;
[0120] Wherein, the step S23 comprises:
[0121] S231, determine the segmented image The gradient modulus of any two adjacent pixels with the same gradient direction angle, and the pixel with the larger gradient modulus is stored in the point set to be extracted;
[0122] Specifically, for the pixel points in the segmented image, if their gradient direction angles are the same, it means that the pixel points are in the same direction. Then, the gradient modulus values of two adjacent pixel points in the same direction are compared, and the pixel point with the larger gradient modulus value among the two adjacent pixel points is taken as the point in the point set to be extracted, so as to obtain the point set to be extracted.
[0123] S232, calculate the first scale coefficient in the x direction The second scale factor in the y direction :
[0124] ; ;
[0125] In the formula, is a smooth function.
[0126] S233, based on the first scale coefficient With the second scale coefficient Calculate the first scale factor in the x direction The second scale factor in the y direction :
[0127] .
[0128] S234, based on the first scale coefficient , the second scale coefficient , the first scale factor and the second scale factor Calculating the screening threshold :
[0129] ;
[0130] In the formula, is the adjustment coefficient, is a constant, The scales are The first scale coefficient and the second scale coefficient of is the noise variance;
[0131] Specifically, the adjustment coefficient here is 0.8 and the constant is 20.
[0132] S235: The points to be extracted have a concentrated gradient modulus value less than the screening threshold value. The pixel points are eliminated to obtain a eliminated pixel set, and the points in the eliminated pixel set are combined to obtain a first feature image.
[0133] S3, performing second feature extraction on the segmented image to obtain a second feature image;
[0134] Wherein, the step S3 comprises:
[0135] S31. Determine the square matrix And the first angle matrix , the second angle matrix , the third angle matrix , the fourth angle matrix :
[0136] ; ; ;
[0137] ; ;
[0138] Specifically, the first angle, the second angle, the third angle, and the fourth angle here are 0°, 45°, 90°, and 135°, respectively.
[0139] S32, based on square matrix And the first angle matrix , the second angle matrix , the third angle matrix , the fourth angle matrix Calculate the first adjustment value With the second adjustment value :
[0140] ;
[0141] ;
[0142] In the formula, , , , They represent expansion, corrosion, opening and closing operations respectively. Indicates Angle matrix, , To segment the image;
[0143] Specifically, each angle has a corresponding first adjustment value and a second adjustment value.
[0144] S33: Calculate an adjusted image based on the first adjustment value and the second adjustment value :
[0145] ;
[0146] In the formula, is the adjustment factor;
[0147] Specifically, each angle has a corresponding adjustment image;
[0148] S34, determining pixel distances of the pixel points in the segmented image at the first angle, the second angle, the third angle, and the fourth angle, respectively, and calculating a first weight according to the pixel distances , second weight , the third weight , the fourth weight :
[0149] ; ;
[0150] ; ;
[0151] In the formula, are the pixel distances corresponding to the first angle, the second angle, the third angle, and the fourth angle respectively;
[0152] Specifically, the pixel distance is calculated as follows: first, a sub-image of size 3×3 is randomly selected from the segmented image, and the central pixel point of the sub-image is determined as , starting from the pixel at the upper left corner of the central pixel, and recording the eight pixels adjacent to the central pixel in a clockwise direction as , and the distance between the center pixel and the remaining pixels is ,therefore , , , .
[0153] S35, based on the first weight , second weight , the third weight , the fourth weight Adjust the image Determine the second feature image :
[0154] ;
[0155] In the formula, For the Weight.
[0156] S4, fusing the first feature image with the second feature image to obtain a fused image;
[0157] Wherein, the step S4 comprises:
[0158] S41. Perform wavelet decomposition on the first characteristic image to obtain first high-frequency data and first low-frequency data.
[0159] S42: Perform wavelet decomposition on the second characteristic image to obtain second high-frequency data and second low-frequency data.
[0160] S43, fusing the first high-frequency data with the second high-frequency data to obtain fused high-frequency data, and fusing the first low-frequency data with the second low-frequency data to obtain fused low-frequency data;
[0161] Specifically, the sub-image obtained by wavelet decomposition is translation invariant, and the image of low-frequency data is the same size as the image of high-frequency data. The fusion between high-frequency data adopts the absolute maximum method, and the fusion between low-frequency data adopts the mean method.
[0162] S44, performing weighted fusion on the fused high-frequency data and the fused low-frequency data to obtain a fused image.
[0163] S5, obtaining a bridge training image, inputting the bridge training image into a preset crack recognition model for training, and inputting the fused image into the trained preset crack recognition model for crack recognition, so as to obtain a crack recognition result;
[0164] Specifically, the preset crack recognition model here is the YOLOv5 model. The model is first trained using bridge training images, and then the fused image is input into the trained model. The model here can then output the corresponding crack recognition results.
[0165] The bridge crack recognition method provided in the first embodiment of the present invention first obtains the image data of the target bridge, pre-processes the image data of the target bridge to obtain a processed image, performs foreground segmentation processing on the processed image to obtain a segmented image; then performs a first feature extraction on the segmented image to obtain a first feature image; then performs a second feature extraction on the segmented image to obtain a second feature image; then performs a fusion processing on the first feature image and the second feature image to obtain a fused image; finally, obtains a bridge training image, inputs the bridge training image into a preset crack recognition model for training, and inputs the fused image into the trained preset crack recognition model for crack recognition to obtain a crack recognition result. The present invention first segments the image to improve the segmentation accuracy of the foreground, and then performs feature extraction and fusion on the image, thereby effectively avoiding the interference of noise on the image, with low distortion and able to effectively retain the detail information in the image, so as to improve the accuracy of subsequent model recognition of cracks.
[0166] Embodiment 2
[0167] like Figure 2 As shown, in the second embodiment of the present invention, a bridge crack identification system is provided, and the system includes:
[0168] Processing module 1, used for acquiring image data of a target bridge, preprocessing the image data of the target bridge to obtain a processed image, and performing foreground segmentation processing on the processed image to obtain a segmented image;
[0169] A first extraction module 2, used for performing a first feature extraction on the segmented image to obtain a first feature image;
[0170] A second extraction module 3, used for performing second feature extraction on the segmented image to obtain a second feature image;
[0171] A fusion module 4, configured to fuse the first feature image with the second feature image to obtain a fused image;
[0172] The recognition module 5 is used to obtain a bridge training image, input the bridge training image into a preset crack recognition model for training, and input the fused image into the trained preset crack recognition model for crack recognition to obtain a crack recognition result;
[0173] The processing module 1 is specifically used for:
[0174] The image data of the target bridge is subjected to image cropping, rotation, and smoothing filtering in sequence to obtain a processed image.
[0175] The processing module 1 comprises:
[0176] An acquisition submodule, used to acquire the gray level of each pixel in the processed image and the gray mean value within the neighborhood of each pixel;
[0177] The probability submodule is used to calculate the pixel probability based on the gray level of each pixel and the gray mean value within the neighborhood of each pixel. :
[0178] ;
[0179] In the formula, Indicates the number of pixels in the processed image. Indicates the gray level is And the grayscale mean within its neighborhood is The number of pixels;
[0180] The segmentation probability submodule is used to segment the pixels based on the probability of Calculate segmentation probability :
[0181] ;
[0182] In the formula, Respectively represent the first preset threshold and the second preset threshold, Indicates the neighborhood range;
[0183] The first function submodule is used to divide the Calculate the pending partition function :
[0184] ;
[0185] In the formula, , They are background proportion and foreground proportion respectively;
[0186] The second function submodule is used to split the function based on the undetermined Determine the final split function :
[0187] ;
[0188] The solving submodule is used to solve the final segmentation function to obtain an optimal first preset threshold and an optimal second preset threshold, and perform foreground segmentation processing on the processed image based on the optimal first preset threshold and the optimal second preset threshold to obtain a segmented image.
[0189] The first extraction module 2 comprises:
[0190] Gradient submodule, used to calculate the segmented image The first gradient value in the x direction The second gradient value in the y direction :
[0191] ;
[0192] ;
[0193] In the formula, represents the x direction and the scale is The dyadic wavelet transform of represents the y direction and the scale is The dyadic wavelet transform of represents the x direction and the scale is The dyadic wavelet transform of represents the y direction and the scale is Dyadic wavelet transform of ;
[0194] Direction submodule, used to With the second gradient value Calculate the gradient magnitude The gradient direction angle :
[0195] ; ;
[0196] Determine the submodule for gradient modulus The gradient direction angle A first feature image is determined.
[0197] The determination submodule comprises:
[0198] Comparison submodule, used to determine the segmented image The gradient modulus of any two adjacent pixels with the same gradient direction angle, and the pixel with the larger gradient modulus is stored in the point set to be extracted;
[0199] Coefficient submodule, used to calculate the first scale coefficient in the x direction The second scale factor in the y direction :
[0200] ; ;
[0201] In the formula, is a smooth function;
[0202] Factor submodule for the first scale coefficients With the second scale coefficient Calculate the first scale factor in the x direction The second scale factor in the y direction :
[0203] ;
[0204] Threshold submodule for the first scale coefficient , the second scale coefficient , the first scale factor and the second scale factor Calculating the screening threshold :
[0205] ;
[0206] In the formula, is the adjustment coefficient, is a constant, The scales are The first scale coefficient and the second scale coefficient of is the noise variance;
[0207] The elimination submodule is used to collect the points to be extracted whose gradient modulus is less than the screening threshold. The pixel points are eliminated to obtain a eliminated pixel set, and the points in the eliminated pixel set are combined to obtain a first feature image.
[0208] The second extraction module 3 comprises:
[0209] Matrix submodule, used to determine the square matrix And the first angle matrix , the second angle matrix , the third angle matrix , the fourth angle matrix :
[0210] ; ; ;
[0211] ; ;
[0212] Adjustment submodule for square matrix based And the first angle matrix , the second angle matrix , the third angle matrix , the fourth angle matrix Calculate the first adjustment value With the second adjustment value :
[0213] ;
[0214] ;
[0215] In the formula, , , , They represent expansion, corrosion, opening and closing operations respectively. Indicates Angle matrix, , To segment the image;
[0216] An image adjustment submodule, configured to calculate an adjusted image based on the first adjustment value and the second adjustment value :
[0217] ;
[0218] In the formula, is the adjustment factor;
[0219] A weight submodule is used to determine the pixel distances of the pixel points in the segmented image at the first angle, the second angle, the third angle, and the fourth angle, and calculate the first weight according to the pixel distances. , second weight , the third weight , the fourth weight :
[0220] ; ;
[0221] ; ;
[0222] In the formula, are the pixel distances corresponding to the first angle, the second angle, the third angle, and the fourth angle respectively;
[0223] The image output submodule is used to output the image based on the first weight , second weight , the third weight , the fourth weight Adjust the image Determine the second feature image :
[0224] ;
[0225] In the formula, For the Weight.
[0226] The fusion module 4 includes:
[0227] A first decomposition submodule, used for performing wavelet decomposition on the first feature image to obtain first high-frequency data and first low-frequency data;
[0228] A second decomposition submodule, used for performing wavelet decomposition on the second characteristic image to obtain second high-frequency data and second low-frequency data;
[0229] A first fusion submodule, configured to fuse the first high-frequency data with the second high-frequency data to obtain fused high-frequency data, and to fuse the first low-frequency data with the second low-frequency data to obtain fused low-frequency data;
[0230] The second fusion submodule is used to perform weighted fusion on the fused high-frequency data and the fused low-frequency data to obtain a fused image.
[0231] In some other embodiments of the present invention, the embodiments of the present invention provide the following technical solutions: a computer, comprising a memory 102, a processor 101, and a computer program stored in the memory 102 and executable on the processor 101; the processor 101 implements the bridge crack identification method as described above when executing the computer program.
[0232] Specifically, the processor 101 may include a central processing unit (CPU), or an application specific integrated circuit (ASIC), or may be configured to implement one or more integrated circuits of the embodiment of the present invention.
[0233] Among them, the memory 102 may include a large-capacity memory for data or instructions. By way of example and not limitation, the memory 102 may include a hard disk drive (HDD), a floppy disk drive, a solid state drive (SSD), a flash memory, an optical disk, a magneto-optical disk, a magnetic tape, or a universal serial bus (USB) drive, or a combination of two or more of these. Where appropriate, the memory 102 may include a removable or non-removable (or fixed) medium. Where appropriate, the memory 102 may be inside or outside the data processing device. In a specific embodiment, the memory 102 is a non-volatile memory. In a specific embodiment, the memory 102 includes a read-only memory (ROM) and a random access memory (RAM). Where appropriate, the ROM may be a mask-programmed ROM, a programmable ROM (PROM), an erasable PROM (EPROM), an electrically erasable PROM (EEPROM), an electrically alterable ROM (EAROM) or a flash memory (FLASH), or a combination of two or more of these. Under appropriate circumstances, the RAM can be a static random access memory (SRAM) or a dynamic random access memory (DRAM), wherein the DRAM can be a fast page mode dynamic random access memory (FPMDRAM), an extended data output dynamic random access memory (EDODRAM), a synchronous dynamic random access memory (SDRAM), etc.
[0234] The memory 102 may be used to store or cache various data files that need to be processed and / or used for communication, as well as possible computer program instructions executed by the processor 101 .
[0235] The processor 101 implements the above-mentioned bridge crack identification method by reading and executing the computer program instructions stored in the memory 102 .
[0236] In some embodiments, the computer may further include a communication interface 103 and a bus 100. Figure 3 As shown, the processor 101, the memory 102, and the communication interface 103 are connected via a bus 100 and communicate with each other.
[0237] The communication interface 103 is used to implement communication between the modules, devices, units and / or equipment in the embodiment of the present invention. The communication interface 103 can also implement data communication with other components such as: external devices, image / data acquisition equipment, databases, external storage, and image / data processing workstations.
[0238] The bus 100 includes hardware, software or both, and couples the components of the computer device to each other. The bus 100 includes but is not limited to at least one of the following: a data bus, an address bus, a control bus, an expansion bus, and a local bus. By way of example and not limitation, bus 100 may include an Accelerated Graphics Port (AGP) or other graphics bus, an Extended Industry Standard Architecture (EISA) bus, a Front Side Bus (FSB), a Hyper Transport (HT) interconnect, an Industry Standard Architecture (ISA) bus, an InfiniBand interconnect, a Low Pin Count (LPC) bus, a memory bus, a Micro Channel Architecture (MCA) bus, a Peripheral Component Interconnect (PCI) bus, a PCI-Express (PCI-X) bus, a Serial Advanced Technology Attachment (SATA) bus, a Video Electronics Standards Association Local Bus (VLB) bus, or other suitable buses or a combination of two or more of these. Where appropriate, bus 100 may include one or more buses. Although embodiments of the present invention describe and illustrate a particular bus, the present invention contemplates any suitable bus or interconnect.
[0239] The computer can execute the bridge crack identification method of the present invention based on the acquired bridge crack identification system, thereby realizing bridge crack identification.
[0240] In some further embodiments of the present invention, in combination with the above-mentioned bridge crack identification method, the embodiments of the present invention provide the following technical solutions: a storage medium having a computer program stored thereon, and the computer program implements the above-mentioned bridge crack identification method when executed by a processor.
[0241] Those skilled in the art will appreciate that the logic and / or steps represented in the flowchart or otherwise described herein, for example, may be considered as an ordered list of executable instructions for implementing logical functions, and may be specifically implemented in any computer-readable medium for use by an instruction execution system, device or apparatus (such as a computer-based system, a system including a processor, or other system that can fetch instructions from an instruction execution system, device or apparatus and execute instructions), or in conjunction with such instruction execution systems, devices or apparatuses. For purposes of this specification, "computer-readable medium" may be any device that can contain, store, communicate, propagate or transmit a program for use by an instruction execution system, device or apparatus, or in conjunction with such instruction execution systems, devices or apparatuses.
[0242] More specific examples of readable media (a non-exhaustive list) include the following: an electrical connection with one or more wires (electronic device), a portable computer disk case (magnetic device), a random access memory (RAM), a read-only memory (ROM), an erasable and programmable read-only memory (EPROM or flash memory), an optical fiber device, and a portable compact disk read-only memory (CDROM). In addition, the computer-readable medium may even be a paper or other suitable medium on which the program is printed, since the program may be obtained electronically, for example, by optically scanning the paper or other medium, followed by editing, deciphering or, if necessary, processing in another suitable manner, and then stored in a computer memory.
[0243] It should be understood that the various parts of the present invention can be implemented by hardware, software, firmware or a combination thereof. In the above-mentioned embodiments, multiple steps or methods can be implemented by software or firmware stored in a memory and executed by a suitable instruction execution system. For example, if implemented by hardware, as in another embodiment, it can be implemented by any one of the following technologies known in the art or a combination thereof: a discrete logic circuit having a logic gate circuit for implementing a logic function for a data signal, a dedicated integrated circuit having a suitable combination of logic gate circuits, a programmable gate array (PGA), a field programmable gate array (FPGA), etc.
[0244] The technical features of the above-described embodiments may be arbitrarily combined. To make the description concise, not all possible combinations of the technical features in the above-described embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0245] The above-mentioned embodiments only express several implementation methods of the present invention, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the invention patent. It should be pointed out that, for ordinary technicians in this field, several variations and improvements can be made without departing from the concept of the present invention, and these all belong to the protection scope of the present invention. Therefore, the protection scope of the patent of the present invention shall be subject to the attached claims.
Claims
1. A bridge crack identification method, characterized in that: include: Acquire image data of a target bridge, pre-process the image data of the target bridge to obtain a processed image, and perform foreground segmentation processing on the processed image to obtain a segmented image; Performing a first feature extraction on the segmented image to obtain a first feature image; Performing second feature extraction on the segmented image to obtain a second feature image; Fusing the first feature image with the second feature image to obtain a fused image; Acquire a bridge training image, input the bridge training image into a preset crack recognition model for training, and input the fused image into the trained preset crack recognition model for crack recognition to obtain a crack recognition result; The step of extracting the first feature from the segmented image to obtain the first feature image comprises: calculating the segmented image The first gradient value in the x direction The second gradient value in the y direction ; Based on the first gradient value With the second gradient value Calculate the gradient magnitude The gradient direction angle ; Determine the segmented image The gradient modulus of any two adjacent pixels with the same gradient direction angle is calculated, and the pixels with larger gradient modulus are stored in the point set to be extracted; the pixels with gradient modulus less than the screening threshold are stored in the point set to be extracted. , removing pixel points to obtain a removed pixel set, and combining points in the removed pixel set to obtain a first feature image; The step of extracting the second feature from the segmented image to obtain the second feature image comprises: Determine the square matrix And the first angle matrix , the second angle matrix , the third angle matrix , the fourth angle matrix : ; ; ; ; ; Based on square matrix And the first angle matrix , the second angle matrix , the third angle matrix , the fourth angle matrix Calculate the first adjustment value With the second adjustment value : ; ; In the formula, , , , They represent expansion, corrosion, opening and closing operations respectively. Indicates Angle matrix, , To segment the image; Calculate an adjusted image based on the first adjustment value and the second adjustment value : ; In the formula, is the adjustment factor; Determine the pixel distances of the pixel points in the segmented image at the first angle, the second angle, the third angle, and the fourth angle, respectively, and calculate the first weight according to the pixel distances , second weight , the third weight , the fourth weight ; Based on the first weight , second weight , the third weight , the fourth weight Adjusting the image Determine the second feature image .
2. The bridge crack identification method according to claim 1, characterized in that: The step of preprocessing the image data of the target bridge to obtain a processed image is specifically as follows: The image data of the target bridge is subjected to image cropping, rotation, and smoothing filtering in sequence to obtain a processed image.
3. The bridge crack identification method according to claim 1, characterized in that: The step of performing foreground segmentation processing on the processed image to obtain a segmented image comprises: Obtaining the grayscale level of each pixel in the processed image and the grayscale mean within the neighborhood of each pixel; Calculate pixel probability based on the gray level of each pixel and the gray mean value within the neighborhood of each pixel : ; In the formula, Indicates the number of pixels in the processed image. Indicates the gray level is And the grayscale mean within its neighborhood is The number of pixels; Based on the pixel probability Calculate segmentation probability : ; In the formula, Respectively represent the first preset threshold and the second preset threshold, Indicates the neighborhood range; Based on the segmentation probability Calculate the pending partition function : ; In the formula, , They are background proportion and foreground proportion respectively; Based on the undetermined partition function Determine the final split function : ; The final segmentation function is solved to obtain an optimal first preset threshold and an optimal second preset threshold, and a foreground segmentation process is performed on the processed image based on the optimal first preset threshold and the optimal second preset threshold to obtain a segmented image.
4. The bridge crack identification method according to claim 1, characterized in that: The second gradient value for: ; ; In the formula, represents the x direction and the scale is The dyadic wavelet transform of represents the y direction and the scale is The dyadic wavelet transform of represents the x direction and the scale is The dyadic wavelet transform of represents the y direction and the scale is Dyadic wavelet transform of ; The gradient modulus With the gradient direction angle They are: ; 。 5. The bridge crack identification method according to claim 1, characterized in that: The screening threshold for: ; ; ; ; In the formula, , , , They represent the first scale factor in the x direction, the second scale factor in the y direction, the first scale factor in the x direction, and the second scale factor in the y direction, respectively. is a smooth function, is the adjustment coefficient, is a constant, The scales are The first scale coefficient and the second scale coefficient of is the noise variance.
6. The bridge crack identification method according to claim 1, characterized in that: The first weight The second weight , the third weight , the fourth weight They are: ; ; ; ; In the formula, are the pixel distances corresponding to the first angle, the second angle, the third angle, and the fourth angle respectively; The second feature image for: ; In the formula, For the Weight.
7. The bridge crack identification method according to claim 1, characterized in that: The step of fusing the first feature image with the second feature image to obtain a fused image comprises: Performing wavelet decomposition on the first characteristic image to obtain first high-frequency data and first low-frequency data; Performing wavelet decomposition on the second characteristic image to obtain second high-frequency data and second low-frequency data; The first high-frequency data is fused with the second high-frequency data to obtain fused high-frequency data, and the first low-frequency data is fused with the second low-frequency data to obtain fused low-frequency data; The fused high-frequency data and the fused low-frequency data are weightedly fused to obtain a fused image.
8. A bridge crack identification system, the system adopting the bridge crack identification method according to claim 1, characterized in that: The system comprises: A processing module, used for acquiring image data of a target bridge, preprocessing the image data of the target bridge to obtain a processed image, and performing foreground segmentation processing on the processed image to obtain a segmented image; A first extraction module, used for performing a first feature extraction on the segmented image to obtain a first feature image; A second extraction module, used for performing second feature extraction on the segmented image to obtain a second feature image; A fusion module, used for fusing the first feature image with the second feature image to obtain a fused image; The recognition module is used to obtain a bridge training image, input the bridge training image into a preset crack recognition model for training, and input the fused image into the trained preset crack recognition model for crack recognition to obtain a crack recognition result.
9. A computer comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the bridge crack identification method according to any one of claims 1 to 7 is implemented.
10. A storage medium, characterized in that: The storage medium stores a computer program, and when the computer program is executed by a processor, the bridge crack identification method according to any one of claims 1 to 7 is implemented.
Citation Information
Patent Citations
MRF sample image restoring method based on required directional structural feature statistics
CN105957027A
Optical lens defect detection method and system
CN118587175A
Cited By
Unmanned aerial vehicle image recognition method based on neural network model
CN122336601A