Intelligent bridge linear detection method, device, equipment and medium

By using a generative adversarial network to correct the distortion of the bridge deck images captured by drones, combined with the mark detection model and ellipse detection algorithm, the efficiency and accuracy of bridge alignment detection are achieved, and the tedious operation, high cost and safety of traditional methods are solved. Risk issues, meeting the needs for large-scale component detection.

CN118628479BActive Publication Date: 2024-10-15HUNAN UNIV
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411089789.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-08-09
Publication Date
2024-10-15
Estimated Expiration
2044-08-09

AI Technical Summary

Technical Problem

Traditional bridge alignment detection methods are cumbersome, costly, and involve safety risks at complex construction sites, making it difficult to meet the needs for large-scale component and overall alignment detection.

Method used

A generative adversarial network is used to correct the distortion of the bridge deck image captured by the drone-mounted camera, and the three-dimensional physical coordinates are determined through the mark detection model and ellipse detection algorithm to achieve efficient and accurate detection of the alignment of the prefabricated bridge.

Benefits of technology

It reduces the overall cost of the system, improves detection efficiency and accuracy, meets the detection needs of large-scale components and overall linear shapes of bridges, and provides high flexibility and safety.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118628479B_ABST
    Figure CN118628479B_ABST
Patent Text Reader

Abstract

The present application discloses an intelligent bridge linear detection method, device, equipment and medium, which relates to the field of bridge detection, including: obtaining a bridge deck image obtained by photographing a plurality of groups of markers preset on a prefabricated bridge from different directions by a camera carried by a drone; inputting the bridge deck image and camera distortion parameters into a preset generative adversarial network to generate a corrected image; using a marker detection model to mark the target marker in the corrected image with a detection frame, determining the two-dimensional image coordinates of the center of the target marker in the marked image based on an ellipse detection algorithm, and using the principle of binocular stereo vision to transform the two-dimensional image coordinates of the center of the same target marker at different directions to obtain the three-dimensional physical coordinates of the center of the target marker; analyzing the three-dimensional physical coordinates based on the preset reference point coordinates and the size information of the prefabricated bridge to determine the linear deviation of the prefabricated bridge. The present application realizes intelligent linear detection of prefabricated bridges, with high detection efficiency and accuracy.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of bridge detection, and in particular to an intelligent bridge linear detection method, device, equipment and medium. Background Art

[0002] Prefabricated bridges are a method of bridge construction that uses prefabricated components for assembly. Through the precise manufacture of prefabricated components and rapid on-site assembly, construction efficiency and quality control are improved, and overall costs are reduced. This has become a highly-regarded innovation direction in modern bridge engineering. As an important quality indicator for the acceptance of prefabricated bridges, bridge alignment directly affects the stability and operational safety of the bridge structure, and is a key structural parameter in bridge construction control.

[0003] Traditional bridge alignment detection is mainly completed by leveling instruments and total stations. However, the operation of leveling instruments and total stations is relatively cumbersome, requiring operations such as moving and setting up stations, and the measurement process is troublesome and takes a long time. In addition, the purchase and maintenance costs of leveling instruments and total stations are relatively high, requiring expensive instruments and equipment as well as professional maintenance personnel. Moreover, in complex construction sites, operators may need to conduct measurements in dangerous environments such as high altitudes and cliffs, which increases the safety risks of operations. In view of this, although the structural information extraction technology based on laser point clouds can achieve high-precision data collection, the equipment is expensive and requires powerful computing resources. Although ground fixed detection can provide stable measurement and monitoring data, it is limited by the viewing angle and is difficult to meet the detection needs of large-scale components and overall alignment of bridges. Summary of the invention

[0004] In view of this, the purpose of the present invention is to provide a method, device, equipment and medium for detecting the linear shape of an intelligent bridge, which can correct the distortion of an image through a generative adversarial network, so that the corrected image is closer to the real image. By subsequently detecting the corrected image, the linear shape detection of the prefabricated bridge can be realized, thereby improving the efficiency and accuracy of the linear shape detection of the intelligent bridge. The specific scheme is as follows:

[0005] In a first aspect, the present application provides an intelligent bridge alignment detection method, comprising:

[0006] Acquire a bridge deck image; the bridge deck image is an image obtained by photographing a plurality of groups of markers preset on the prefabricated bridge from different directions using a camera mounted on a drone;

[0007] Inputting the bridge deck image and the camera distortion parameters into a preset generative adversarial network to generate a corrected image; the preset generative adversarial network includes a preset generator and a plurality of preset discriminators connected to the preset generator for discriminating images of different resolutions;

[0008] The target marker in the corrected image is marked with a detection frame using a marker detection model, and the two-dimensional image coordinates of the center of the target marker in the marked image are determined based on an ellipse detection algorithm, and the two-dimensional image coordinates of the same target marker center at different orientations are transformed using the binocular stereo vision principle to obtain the three-dimensional physical coordinates of the target marker center;

[0009] The three-dimensional physical coordinates are analyzed based on the preset reference point coordinates and the size information of the prefabricated bridge to determine the linear deviation of the prefabricated bridge.

[0010] Optionally, inputting the bridge deck image and the camera distortion parameters into a preset generative adversarial network to generate a corrected image includes:

[0011] Inputting the bridge deck image and the camera distortion parameters into the preset generator to convert the camera distortion parameters into a distortion feature vector, and fusing the distortion feature vector with a feature map of the bridge deck image to generate a corrected image based on the fused feature map;

[0012] The corrected image is discriminated using a preset discriminator corresponding to the resolution of the corrected image, and when the discrimination rate is not less than a preset discrimination threshold, the step of using the marker detection model to mark the target marker in the corrected image with a detection box is triggered.

[0013] Optionally, before inputting the bridge deck image and the camera distortion parameters into a preset generative adversarial network, the method further includes:

[0014] Obtain several distorted images and corresponding distortion parameters and normal images to construct a training data set;

[0015] The training data set is input into an initial generative adversarial network, so as to train the initial generative adversarial network using an adversarial training method and based on a pre-constructed target loss function, thereby obtaining a trained preset generative adversarial network.

[0016] Optionally, before training the initial generative adversarial network using the adversarial training method and based on a pre-constructed target loss function, the method further includes:

[0017] Constructing a target loss function based on a preset edge loss function, a preset structural similarity loss function, an adversarial loss function corresponding to the initial generative adversarial network, and a reconstruction loss function;

[0018] Among them, the preset edge loss function is a function used to calculate the difference between the edge information of the normal image and the adversarial image; the preset structural similarity loss function is a function used to calculate the similarity between the normal image and the adversarial image; the adversarial image is an image generated by the initial generative adversarial network based on the distorted image and the corresponding distortion parameters.

[0019] Optionally, the preset edge loss function is expressed as:

[0020] ;

[0021] Among them, L edge represents edge loss; N represents the total number of image pixels; Represents the edge value of the normal image at the i-th pixel; Represents the edge value of the adversarial image at the i-th pixel;

[0022] Correspondingly, the preset structural similarity loss function is expressed as:

[0023] ;

[0024] in, represents the structural similarity loss; M represents the total number of image windows obtained after window segmentation of the normal image x or the adversarial image y; x i represents the image area of ​​the normal image on the i-th image window; y i represents the image area of ​​the adversarial image on the i-th image window; SSIM represents the structural similarity loss function.

[0025] Optionally, a group of markers includes a first-category marker and a plurality of second-category markers; wherein the size of the first-category marker is larger than the size of the second-category marker;

[0026] Correspondingly, the method of using the marker detection model to mark the target marker in the corrected image with a detection frame, and determining the two-dimensional image coordinates of the center of the target marker in the marked image based on an ellipse detection algorithm, includes:

[0027] Using a marker detection model to identify all markers in the corrected image, so as to mark the first category of markers in the corrected image as target markers for detection frame marking, and classifying the target markers according to the number of second category markers in the corrected image corresponding to the target markers, so as to obtain a marked image with a marked detection frame and the category of the target marker;

[0028] Based on an ellipse detection algorithm, edge detection is performed on the target mark located in the detection frame in the annotated image to obtain a binary ellipse contour image, and the edge points in the ellipse contour image are grouped into arcs of different quadrants to determine the two-dimensional image coordinates of the center of the target mark based on the arcs of different quadrants.

[0029] Optionally, the analyzing the three-dimensional physical coordinates based on the preset reference point coordinates and the size information of the prefabricated bridge to determine the linear deviation of the prefabricated bridge includes:

[0030] The expected physical coordinates of the center of the target mark are determined based on the preset reference point coordinates and the size information of the prefabricated bridge, and the three-dimensional physical coordinates are analyzed using the expected physical coordinates to determine the plane linear deviation and elevation deviation of the prefabricated bridge.

[0031] In a second aspect, the present application provides an intelligent bridge linear detection device, comprising:

[0032] An image acquisition module is used to acquire a bridge deck image; the bridge deck image is an image obtained by photographing a plurality of groups of markers preset on the prefabricated bridge from different directions using a camera mounted on a drone;

[0033] An image distortion correction module, used for inputting the bridge deck image and camera distortion parameters into a preset generative adversarial network to generate a corrected image; the preset generative adversarial network includes a preset generator and a plurality of preset discriminators connected to the preset generator for discriminating images of different resolutions;

[0034] A coordinate determination module is used to mark the target mark in the corrected image with a detection frame using a mark detection model, determine the two-dimensional image coordinates of the center of the target mark in the marked image based on an ellipse detection algorithm, and transform the two-dimensional image coordinates of the same target mark center at different orientations using the principle of binocular stereo vision to obtain the three-dimensional physical coordinates of the center of the target mark;

[0035] The deviation determination module is used to analyze the three-dimensional physical coordinates based on the preset reference point coordinates and the size information of the prefabricated bridge to determine the linear deviation of the prefabricated bridge.

[0036] In a third aspect, the present application provides an electronic device, including:

[0037] Memory, used to store computer programs;

[0038] A processor is used to execute the computer program to implement the aforementioned intelligent bridge line shape detection method.

[0039] In a fourth aspect, the present application provides a computer-readable storage medium for storing a computer program, which, when executed by a processor, implements the aforementioned intelligent bridge linearity detection method.

[0040] In the present application, a bridge deck image is obtained; the bridge deck image is an image obtained by photographing several groups of markers preset on the prefabricated bridge from different orientations using a camera mounted on an unmanned aerial vehicle; the bridge deck image and camera distortion parameters are input into a preset generative adversarial network to generate a corrected image; the preset generative adversarial network includes a preset generator and several preset discriminators connected to the preset generator for discriminating images of different resolutions; a marker detection model is used to mark the target marker in the corrected image with a detection frame, and the two-dimensional image coordinates of the center of the target marker in the marked image are determined based on an ellipse detection algorithm, and the two-dimensional image coordinates of the center of the same target marker at different orientations are transformed using the principle of binocular stereo vision to obtain the three-dimensional physical coordinates of the center of the target marker; the three-dimensional physical coordinates are analyzed based on the preset reference point coordinates and the size information of the prefabricated bridge to determine the linear deviation of the prefabricated bridge. It can be seen that the present application uses a drone-mounted camera to photograph the assembled bridge. Compared with sensors such as laser radar, the camera cost is relatively low, and the hardware requirements for image processing technology are relatively low, thereby reducing the overall cost of the system. At the same time, the use of drone-mounted cameras to photograph bridges also has the advantages of high flexibility, high mobility and high safety, which can meet the detection requirements of large-scale components and overall linearity of bridges. Further, the present application uses a generative adversarial network to perform distortion correction on the bridge deck image taken by the drone-mounted camera, so that the corrected image is closer to the real image; wherein, the generative adversarial network uses several preset discriminators for discriminating images of different resolutions, so as to select a suitable discriminator according to the resolution of the corrected image, thereby more comprehensively evaluating the authenticity of the corrected image. In addition, the present application automatically detects the corrected image that is closer to the real image to realize the intelligent linearity detection of the assembled bridge, while ensuring the efficiency of the bridge linearity detection and improving the accuracy of the bridge linearity detection. BRIEF DESCRIPTION OF THE DRAWINGS

[0041] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, 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 embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without paying creative work.

[0042] Figure 1 A flow chart of an intelligent bridge linear detection method disclosed in this application;

[0043] Figure 2 A schematic diagram of a bridge marking disclosed in this application;

[0044] Figure 3 A schematic diagram of the shooting orientation of a camera mounted on a drone disclosed in this application;

[0045] Figure 4 A schematic diagram of arcs in different quadrants disclosed in the present application;

[0046] Figure 5 A generative adversarial network training flow chart disclosed in this application;

[0047] Figure 6 This is a schematic diagram of the structure of an intelligent bridge linear detection device disclosed in this application;

[0048] Figure 7 This is a structural diagram of an electronic device disclosed in this application. DETAILED DESCRIPTION

[0049] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0050] Prefabricated bridges are a method of building bridges using prefabricated components. The construction of bridges is completed through the precise manufacture of prefabricated components and rapid on-site assembly. The bridge alignment, as an important quality indicator for the acceptance of prefabricated bridges, directly affects the stability and operational safety of the bridge structure, and is a key structural parameter in bridge construction control. To this end, the present application provides an intelligent bridge alignment detection method, which uses a generative adversarial network to correct image distortion so that the corrected image is closer to the real image. Subsequently, by detecting the corrected image, the alignment detection of the prefabricated bridge can be achieved, thereby improving the efficiency and accuracy of bridge alignment detection.

[0051] See also Figure 1 As shown, an embodiment of the present invention discloses an intelligent bridge line shape detection method, comprising:

[0052] Step S11, obtaining a bridge deck image; the bridge deck image is an image obtained by photographing a plurality of groups of markers preset on the prefabricated bridge from different directions using a camera mounted on an unmanned aerial vehicle.

[0053] In this embodiment, Figure 2As shown, several groups of marks are pre-set on the upper surface of the prefabricated bridge, wherein one group of marks may include a first-class mark and several second-class marks, the size of the first-class mark is larger than the size of the second-class mark; the mark may be a circular mark; the first-class mark is used for subsequent measurement of the precise coordinates of the mark center, and the second-class mark is used for classifying and numbering the first-class mark. It should be noted that the number of second-class marks in a group of marks can be set arbitrarily, and the number of second-class marks in a group of marks is at least 1 and at most 6. Further, the specific setting of several groups of marks on the upper surface of the prefabricated bridge can be: two groups of marks are set horizontally at one end of the prefabricated bridge, and the two groups of marks are separated by a first preset distance, such as 1m, and this is used as a starting point, and the marks are continued to be set longitudinally at a second preset distance, and the second preset distance can be 1.5m, thereby forming a series of 1m×1.5m mark rectangles, and 3 groups of auxiliary marks are set in the middle of each mark rectangle.

[0054] In this embodiment, a drone equipped with a high-precision camera is used to shoot several groups of pre-set marks on the prefabricated bridge from different directions to obtain a bridge deck image, and the bridge deck image is transmitted to the ground control console in real time so that the ground control console can detect the bridge deck image to determine the linear deviation of the prefabricated bridge. Figure 3 As shown, the drone equipped with a high-precision camera can not only take pictures of each set of marks on the prefabricated bridge in four directions, but also take pictures of each 1m×1.5m mark rectangle on the prefabricated bridge in four directions.

[0055] Among them, the drone equipped with a high-precision camera can use the cruise technology to shoot several groups of pre-set marks on the prefabricated bridge in different directions. That is, the drone flies autonomously according to the pre-set route, and after reaching the set path point, it shoots the marks on the prefabricated bridge. The shooting height can be 3.5m, the camera gimbal inclination angle can be 65 degrees, and there can be 4 shooting positions for each group of marks or each mark rectangle, and each position takes 4 photos continuously.

[0056] Step S12: input the bridge deck image and camera distortion parameters into a preset generative adversarial network to generate a corrected image; the preset generative adversarial network includes a preset generator and a plurality of preset discriminators connected to the preset generator for discriminating images of different resolutions.

[0057] In this embodiment, the bridge deck image and the camera distortion parameters are input into the preset generator to convert the camera distortion parameters into distortion feature vectors, and the distortion feature vectors are fused with the feature map of the bridge deck image to obtain a fused feature map, and then a corrected image is generated based on the fused feature map. The camera distortion parameters include radial distortion parameters, tangential distortion parameters, etc.

[0058] After the corrected image is generated by the preset generator, the corrected image is input into the preset discriminator corresponding to the resolution of the corrected image, so as to discriminate the corrected image by the preset discriminator corresponding to the resolution of the corrected image to obtain the discrimination rate; wherein the discrimination rate is used to characterize the probability that the corrected image is a real image. If the discrimination rate is not less than the preset discrimination threshold, it indicates that the corrected image generated by the preset generator is close to the real image, and triggers the step of using the marker detection model to mark the target marker in the corrected image with a detection frame in step S13. If the discrimination rate is less than the preset discrimination threshold, the preset generator is reused to generate the corrected image based on the bridge deck image and the camera distortion parameter, and the preset discriminator corresponding to the resolution of the corrected image is reused to discriminate the corrected image to obtain the discrimination rate, and then the discrimination rate is re-compared with the preset discrimination threshold. It should be noted that if the discrimination rate of the corrected image is less than the preset discrimination threshold for the same bridge deck image multiple times, it indicates that there may be certain problems with the preset generative adversarial network. The preset generative adversarial network can be optimized and trained by adjusting the model parameters of the preset generative adversarial network and / or re-collecting training data to improve the performance of the generative adversarial network.

[0059] Step S13, use the marker detection model to mark the target marker in the corrected image with a detection frame, and determine the two-dimensional image coordinates of the center of the target marker in the marked image based on the ellipse detection algorithm, and use the binocular stereo vision principle to transform the two-dimensional image coordinates of the same target marker center in different orientations to obtain the three-dimensional physical coordinates of the target marker center.

[0060] In this embodiment, all the markers in the corrected image are identified using the marker detection model, so that the first category of markers in the corrected image are used as target markers to mark the detection frame, and the target markers are classified and numbered using the number of second category markers corresponding to the target markers in the corrected image to obtain a labeled image with the detection frame and the category of the target marker. If the number of second category markers corresponding to the target marker is 5, the category of the target marker is determined to be 5.

[0061] In this embodiment, after obtaining the annotated image, edge detection is performed on the target mark in the detection frame in the annotated image based on an ellipse detection algorithm to obtain a binary ellipse contour image, and the edge points in the ellipse contour image are grouped into arcs of different quadrants to determine the two-dimensional image coordinates of the center of the target mark based on the arcs of different quadrants. Specifically, Figure 4As shown in FIG. 1 , the target mark in the detection frame in the annotated image is edge detected based on the ellipse detection algorithm to obtain a binary ellipse contour map, and then the edge points in the ellipse contour map are grouped into multiple arcs, and the gradient phase θ of each arc is calculated by the Sobel operator. i , and by comparing the area below and above the arc to obtain the convexity δ, the arcs are classified into different quadrants based on the gradient phase and convexity corresponding to each arc, thereby obtaining arcs in different quadrants. For example, if the gradient phase of an arc is less than 0 and the convexity is less than 0, the arc belongs to the first quadrant. Further, after obtaining arcs in different quadrants, the geometric properties of the ellipse are used and based on the arcs in different quadrants to estimate the two-dimensional image coordinates of the center of the ellipse, that is, the two-dimensional image coordinates of the center of the target mark.

[0062] Taking the example of the geometric property of an ellipse that the midpoints of parallel chords are collinear, considering that when the edge points in the ellipse contour map are grouped into arcs of different quadrants, there may be a problem that the arc grouping is not very accurate. If only two arcs of different quadrants are selected to estimate the two-dimensional image coordinates of the center of the target marker, there may be a large error. Therefore, by selecting three arcs of different quadrants to draw at least three groups of parallel chords, and drawing the connecting lines of the midpoints of each group of parallel chords, the two-dimensional image coordinates of the intersection points of multiple connecting lines are calculated, and the two-dimensional image coordinates of the intersection points of multiple connecting lines are combined to obtain the two-dimensional image coordinates of the center of the ellipse, that is, the two-dimensional image coordinates of the center of the target marker.

[0063] Furthermore, after obtaining the two-dimensional image coordinates of the center of the target mark, the two-dimensional image coordinates of the center of the same target mark at different orientations are transformed using the principle of binocular stereo vision to obtain the three-dimensional physical coordinates of the center of the target mark. Specifically, for the same target mark, the two-dimensional image coordinates of the center of the target mark at a first orientation and the two-dimensional image coordinates of the center of the target mark at a second orientation are obtained, and the two-dimensional image coordinates of the center of the target mark at the first orientation and the two-dimensional image coordinates of the center of the target mark at the second orientation are transformed using the principle of binocular stereo vision to obtain the three-dimensional physical coordinates of the center of the target mark. Among them, the coordinate transformation using the principle of binocular stereo vision includes the transformation between the world coordinate system and the camera coordinate system, the transformation between the camera coordinate system and the image coordinate system, and the transformation between the image coordinate system and the pixel coordinate system.

[0064] Step S14: analyzing the three-dimensional physical coordinates based on the preset reference point coordinates and the dimension information of the prefabricated bridge to determine the linear deviation of the prefabricated bridge.

[0065] In this embodiment, after determining the three-dimensional physical coordinates of the center of the target mark, the expected physical coordinates of the center of the target mark are determined based on the preset reference point coordinates and the size information of the prefabricated bridge; wherein the preset reference point coordinates may be the center coordinates of the first type of mark in the two groups of marks at one end of the prefabricated bridge measured by a total station or a level or other means. Then, the three-dimensional physical coordinates of the center of the target mark are analyzed using the expected physical coordinates of the center of the target mark to determine the plane linear deviation and elevation deviation of the prefabricated bridge.

[0066] It can be seen that the present application uses a drone-mounted camera to photograph the assembled bridge. Compared with sensors such as laser radar, the camera cost is relatively low, and the hardware requirements for image processing technology are relatively low, thereby reducing the overall cost of the system. At the same time, the use of drone-mounted cameras to photograph bridges also has the advantages of high flexibility, high mobility and high safety, which can meet the detection requirements of large-scale components and overall linearity of bridges. Further, the present application uses a generative adversarial network to perform distortion correction on the bridge deck image taken by the drone-mounted camera, so that the corrected image is closer to the real image; wherein, the generative adversarial network uses several preset discriminators for discriminating images of different resolutions, so as to select a suitable discriminator according to the resolution of the corrected image, thereby more comprehensively evaluating the authenticity of the corrected image. In addition, the present application automatically detects the corrected image that is closer to the real image to realize the intelligent linearity detection of the assembled bridge, while ensuring the efficiency of the bridge linearity detection and improving the accuracy of the bridge linearity detection.

[0067] Based on the previous embodiment, it can be seen that the present application needs to generate a corrected image based on the bridge deck image through a preset generative adversarial network. Next, the present application will elaborate on how to train the preset generative adversarial network. Figure 5 As shown, an embodiment of the present invention discloses a process of training a generative adversarial network, including:

[0068] Step S21: Acquire a number of distorted images and corresponding distortion parameters and normal images to construct a training data set.

[0069] In this embodiment, several distorted images and corresponding distortion parameters and normal images are collected to obtain several sets of training data, and data preprocessing, such as cropping, scaling, etc., is performed on each set of training data to obtain several sets of processed data with uniform size and resolution, thereby constructing a training data set based on the several sets of processed data. Among them, for the distorted images and corresponding distortion parameters and normal images, a camera can be used to shoot distorted images and normal images in the same scene and obtain the distortion parameters of the camera; or a normal image can be distorted by simulation software to generate a corresponding distorted image and obtain the corresponding distortion parameters; this is not limited here.

[0070] Step S22: construct a target loss function based on a preset edge loss function, a preset structural similarity loss function, an adversarial loss function corresponding to the initial generative adversarial network, and a reconstruction loss function.

[0071] In this embodiment, the preset edge loss function is a function used to calculate the difference between the edge information of the normal image and the adversarial image. By adopting the preset edge loss function, the clarity of the image edge can be maintained; wherein, the adversarial image is an image generated by the initial generative adversarial network based on the distorted image and the corresponding distortion parameters. The preset structural similarity loss function is a function used to calculate the similarity between the normal image and the adversarial image. By adopting the preset structural similarity loss function, the structural similarity between the image generated by the generative adversarial network and the real image can be ensured. The adversarial loss function can use the cross entropy loss function to train the adversarial nature of the generator and the discriminator in the generative adversarial network; the reconstruction loss function can use the L1 or L2 loss function to ensure the similarity between the image generated by the generative adversarial network and the real image at the pixel level.

[0072] In this embodiment, the preset edge loss function is expressed as:

[0073] ;

[0074] Among them, L edge represents edge loss; N represents the total number of image pixels; Represents the edge value of the normal image at the i-th pixel; Represents the edge value of the adversarial image at the i-th pixel; it should be noted that the edge value can be obtained by extracting the image based on the edge extraction operator through the edge extraction algorithm; the edge extraction operator includes the Sobel operator, the Canny operator, the Roberts operator, etc.

[0075] In this embodiment, the preset structural similarity loss function is expressed as:

[0076] ;

[0077] in, represents the structural similarity loss; M represents the total number of image windows obtained after window segmentation of the normal image x or the adversarial image y; x i represents the image area of ​​the normal image on the i-th image window; y i represents the image area of ​​the adversarial image on the i-th image window; SSIM (Structural Similarity) represents the structural similarity loss function, which is used to calculate x i With y iIt should be noted that in order to more carefully evaluate the structural similarity between the normal image and the adversarial image, this embodiment performs window segmentation on the normal image and the adversarial image to calculate the structural similarity between the image regions on the local image window, and averages the structural similarities of all image windows to obtain the final structural similarity loss. Moreover, the closer the structural similarity loss is to 1, the more similar the normal image and the adversarial image are; conversely, the closer the structural similarity loss is to 0, the greater the difference between the normal image and the adversarial image.

[0078] In this embodiment, the target loss function is constructed based on the preset edge loss function, the preset structural similarity loss function, the adversarial loss function corresponding to the initial generative adversarial network, and the reconstruction loss function, as well as the weight parameters corresponding to each loss function. Through this design, not only can the generative adversarial network be better trained, but also the images generated by the generative adversarial network can be closer to the real image in terms of edge and texture details, and the images generated by the generative adversarial network can be closer to the real image in terms of structure, thereby improving the effect of the generative adversarial network on distortion correction of distorted images.

[0079] Step S23: input the training data set into the initial generative adversarial network, so as to train the initial generative adversarial network using the adversarial training method and based on the pre-constructed target loss function, and obtain a trained preset generative adversarial network.

[0080] In this embodiment, the training data set is input into the initial generative adversarial network, wherein the initial generative adversarial network includes a generator and multiple discriminators, and different discriminators are used to discriminate images of different resolutions to more accurately evaluate the authenticity of the images generated by the generator. Then, the initial generative adversarial network is trained using the adversarial training method and based on the pre-constructed target loss function, that is, the loss value between the real image and the image generated by the generator is calculated by the target loss function to adjust the model parameters of the initial generative adversarial network, thereby obtaining a trained preset generative adversarial network. It should be noted that the training end condition for the generative adversarial network can be that the current training round of the generative adversarial network reaches the preset training round, or that the model accuracy of the generative adversarial network is greater than the preset accuracy threshold. In this way, by adopting the adversarial training method, the generator can generate more and more realistic distortion-corrected images, and the discriminator can better distinguish between true and false images.

[0081] It should be noted that the generator includes an input layer, a conditional encoder, a feature extraction layer, an intermediate layer, a decoder and an output layer. Specifically, the input layer is used to receive the bridge deck image taken by the camera mounted on the drone. The conditional encoder includes a distortion parameter encoding layer, a feature fusion layer, a feature extraction layer and a pooling layer; wherein the distortion parameter encoding layer is used to convert the distortion parameter into a distortion feature vector of a fixed length; the feature fusion layer is used to fuse the feature map of the bridge deck image with the distortion feature vector in the channel dimension to obtain a fused feature map, for example, the fusion can be performed by a splicing operation; the feature extraction layer includes multiple convolutional layers for extracting features from the fused feature map, and each convolutional layer is usually followed by a batch normalization (BN) and an activation function, such as a ReLU (Rectified Linear Unit) activation function; the pooling layer is used to reduce the spatial dimension of the feature map and increase the receptive field. The feature extraction layer includes multiple convolutional layers for extracting image features, and each convolutional layer is usually followed by a batch normalization and a ReLU activation function. The middle layer includes several residual blocks and attention modules; among them, several residual blocks are used to deepen the network without causing the gradient vanishing problem. Each residual block contains two convolutional layers, and there is a jump connection between the two convolutional layers; the attention module is used to highlight the features of the distorted area. The decoder includes upsampling layers and convolutional layers; among them, the upsampling layers (such as transposed convolutions) are used to gradually increase the spatial dimensions of the feature map and restore the image size; the convolutional layers are used to reconstruct the distortion-corrected image, and the last convolution layer usually uses a linear activation function or a tanh activation function. The output layer is used to output the distortion-corrected image.

[0082] It should be noted that the discriminator includes an input layer, a feature extraction layer, a fully connected layer, and an output layer. Specifically, the input layer is used to receive a real image and / or a corrected image generated by the generator. The feature extraction layer includes multiple convolutional layers for extracting image features, and each convolutional layer is usually followed by batch normalization and a Leaky ReLU activation function. The fully connected layer is used to flatten the feature map and output a discrimination rate. The output layer is used to output a scalar, namely the discrimination rate, which indicates the probability that the input image is a real image.

[0083] It can be seen that the present application constructs a target loss function based on a preset edge loss function, a preset structural similarity loss function, an adversarial loss function corresponding to the initial generative adversarial network, and a reconstruction loss function, which can not only better train the generative adversarial network, but also make the images generated by the generative adversarial network closer to the real image in terms of edge and texture details, and at the same time make the images generated by the generative adversarial network closer to the real image in structure, thereby improving the effect of the generative adversarial network in correcting the distortion of distorted images. In addition, the present application adopts a generator and multiple discriminators in the generative adversarial network, wherein different discriminators are used to discriminate images of different resolutions, so as to more accurately and comprehensively evaluate the authenticity of the images generated by the generator.

[0084] See also Figure 6 As shown, an embodiment of the present invention discloses an intelligent bridge linear detection device, comprising:

[0085] The image acquisition module 11 is used to acquire a bridge deck image; the bridge deck image is an image obtained by photographing a plurality of groups of markers preset on the prefabricated bridge from different directions using a camera mounted on a drone;

[0086] An image distortion correction module 12 is used to input the bridge deck image and camera distortion parameters into a preset generative adversarial network to generate a corrected image; the preset generative adversarial network includes a preset generator and a plurality of preset discriminators connected to the preset generator for discriminating images of different resolutions;

[0087] A coordinate determination module 13 is used to mark the target mark in the corrected image with a detection frame using a mark detection model, determine the two-dimensional image coordinates of the center of the target mark in the marked image based on an ellipse detection algorithm, and transform the two-dimensional image coordinates of the same target mark center at different orientations using the binocular stereo vision principle to obtain the three-dimensional physical coordinates of the target mark center;

[0088] The deviation determination module 14 is used to analyze the three-dimensional physical coordinates based on the preset reference point coordinates and the size information of the prefabricated bridge to determine the linear deviation of the prefabricated bridge.

[0089] It can be seen that the present application uses a drone-mounted camera to photograph the assembled bridge. Compared with sensors such as laser radar, the camera cost is relatively low, and the hardware requirements for image processing technology are relatively low, thereby reducing the overall cost of the system. At the same time, the use of drone-mounted cameras to photograph bridges also has the advantages of high flexibility, high mobility and high safety, which can meet the detection requirements of large-scale components and overall linearity of bridges. Further, the present application uses a generative adversarial network to perform distortion correction on the bridge deck image taken by the drone-mounted camera, so that the corrected image is closer to the real image; wherein, the generative adversarial network uses several preset discriminators for discriminating images of different resolutions, so as to select a suitable discriminator according to the resolution of the corrected image, thereby more comprehensively evaluating the authenticity of the corrected image. In addition, the present application automatically detects the corrected image that is closer to the real image to realize the intelligent linearity detection of the assembled bridge, while ensuring the efficiency of the bridge linearity detection and improving the accuracy of the bridge linearity detection.

[0090] In some specific embodiments, the image distortion correction module 12 includes:

[0091] An image generating unit, configured to input the bridge deck image and camera distortion parameters into the preset generator to convert the camera distortion parameters into a distortion feature vector, and fuse the distortion feature vector with a feature map of the bridge deck image to generate a corrected image based on the fused feature map;

[0092] An image discrimination unit is used to discriminate the corrected image using a preset discriminator corresponding to the resolution of the corrected image, and when the discrimination rate is not less than a preset discrimination threshold, trigger the step of using the marker detection model to mark the target marker in the corrected image with a detection box.

[0093] In some specific embodiments, the intelligent bridge linear detection device further includes:

[0094] A data set construction unit, used to obtain a number of distorted images and corresponding distortion parameters and normal images to construct a training data set;

[0095] A network training unit is used to input the training data set into an initial generative adversarial network, so as to train the initial generative adversarial network using an adversarial training method and based on a pre-constructed target loss function to obtain a trained preset generative adversarial network.

[0096] In some specific embodiments, the intelligent bridge linear detection device further includes:

[0097] A loss function construction unit, used to construct a target loss function based on a preset edge loss function, a preset structural similarity loss function, an adversarial loss function corresponding to the initial generative adversarial network, and a reconstruction loss function;

[0098] Among them, the preset edge loss function is a function used to calculate the difference between the edge information of the normal image and the adversarial image; the preset structural similarity loss function is a function used to calculate the similarity between the normal image and the adversarial image; the adversarial image is an image generated by the initial generative adversarial network based on the distorted image and the corresponding distortion parameters.

[0099] In some specific embodiments, the preset edge loss function is expressed as:

[0100] ;

[0101] Among them, L edge represents edge loss; N represents the total number of image pixels; Represents the edge value of the normal image at the i-th pixel; Represents the edge value of the adversarial image at the i-th pixel;

[0102] Correspondingly, the preset structural similarity loss function is expressed as:

[0103] ;

[0104] in, represents the structural similarity loss; M represents the total number of image windows obtained after window segmentation of the normal image x or the adversarial image y; x i represents the image area of ​​the normal image on the i-th image window; y i represents the image area of ​​the adversarial image on the i-th image window; SSIM represents the structural similarity loss function.

[0105] In some specific embodiments, a group of markers includes a first type of marker and a plurality of second type of markers; wherein the size of the first type of marker is larger than the size of the second type of marker;

[0106] Accordingly, the coordinate determination module 13 includes:

[0107] A marker recognition unit, configured to recognize all markers in the corrected image using a marker detection model, so as to mark the first category of markers in the corrected image as target markers for detection frame marking, and to classify the target markers using the number of second category markers in the corrected image corresponding to the target markers, so as to obtain a marked image with a marked detection frame and a category of the target marker;

[0108] A two-dimensional coordinate determination unit is used to perform edge detection on the target mark located in the detection frame in the annotated image based on an ellipse detection algorithm to obtain a binary ellipse contour image, and group the edge points in the ellipse contour image into arcs of different quadrants to determine the two-dimensional image coordinates of the center of the target mark based on the arcs of different quadrants.

[0109] In some specific embodiments, the deviation determination module 14 includes:

[0110] A deviation determination unit is used to determine the expected physical coordinates of the center of the target mark based on the preset reference point coordinates and the size information of the prefabricated bridge, and use the expected physical coordinates to analyze the three-dimensional physical coordinates to determine the plane linear deviation and elevation deviation of the prefabricated bridge.

[0111] Furthermore, the present application also discloses an electronic device. Figure 7 This is a structural diagram of an electronic device 20 according to an exemplary embodiment. The content in the diagram cannot be regarded as any limitation on the scope of use of the present application.

[0112] Figure 7 The present invention provides a schematic diagram of the structure of an electronic device 20 provided in an embodiment of the present application. The electronic device 20 may specifically include: at least one processor 21, at least one memory 22, a power supply 23, a communication interface 24, an input / output interface 25, and a communication bus 26. The memory 22 is used to store a computer program, which is loaded and executed by the processor 21 to implement the relevant steps in the intelligent bridge linear detection method disclosed in any of the aforementioned embodiments. In addition, the electronic device 20 in this embodiment may specifically be an electronic computer.

[0113] In this embodiment, the power supply 23 is used to provide working voltage for each hardware device on the electronic device 20; the communication interface 24 can create a data transmission channel between the electronic device 20 and the external device, and the communication protocol it follows is any communication protocol that can be applied to the technical solution of the present application, and is not specifically limited here; the input and output interface 25 is used to obtain external input data or output data to the outside world, and its specific interface type can be selected according to specific application needs and is not specifically limited here.

[0114] In addition, the memory 22, as a carrier for storing resources, can be a read-only memory, a random access memory, a disk or an optical disk, etc. The resources stored thereon can include an operating system 221, a computer program 222, etc., and the storage method can be temporary storage or permanent storage.

[0115] The operating system 221 is used to manage and control the hardware devices and computer programs 222 on the electronic device 20, which can be Windows Server, Netware, Unix, Linux, etc. In addition to the computer program that can be used to complete the intelligent bridge linear detection method performed by the electronic device 20 disclosed in any of the aforementioned embodiments, the computer program 222 can further include computer programs that can be used to complete other specific tasks.

[0116] Furthermore, the present application also discloses a computer-readable storage medium for storing a computer program; wherein the computer program, when executed by a processor, implements the aforementioned disclosed intelligent bridge linearity detection method. The specific steps of the method may refer to the corresponding contents disclosed in the aforementioned embodiments, and will not be described in detail here.

[0117] In this specification, each embodiment is described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the embodiments can be referred to each other. For the device disclosed in the embodiment, since it corresponds to the method disclosed in the embodiment, the description is relatively simple, and the relevant parts can be referred to the method part.

[0118] Professionals may further appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described in the above description according to function. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professionals and technicians may use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.

[0119] The steps of the method or algorithm described in conjunction with the embodiments disclosed herein may be implemented directly using hardware, a software module executed by a processor, or a combination of the two. The software module may be placed in a random access memory (RAM), a memory, a read-only memory (ROM), an electrically programmable ROM, an electrically erasable programmable ROM, a register, a hard disk, a removable disk, a CD-ROM, or any other form of storage medium known in the art.

[0120] Finally, it should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the presence of other identical elements in the process, method, article or device including the elements.

[0121] The technical solution provided by the present application is introduced in detail above. Specific examples are used in this article to illustrate the principles and implementation methods of the present application. The description of the above embodiments is only used to help understand the method of the present application and its core idea. At the same time, for general technicians in this field, according to the idea of ​​the present application, there will be changes in the specific implementation methods and application scope. In summary, the content of this specification should not be understood as a limitation on the present application.

Claims

1. A smart bridge linear detection method, characterized in that: include: Acquire bridge deck images; The bridge deck image is an image obtained by photographing a plurality of groups of markers preset on the prefabricated bridge from different directions using a camera mounted on a drone; Inputting the bridge deck image and camera distortion parameters into a preset generative adversarial network to generate a corrected image; The preset generative adversarial network includes a preset generator and a plurality of preset discriminators connected to the preset generator for discriminating images of different resolutions; The target marker in the corrected image is marked with a detection frame using a marker detection model, and the two-dimensional image coordinates of the center of the target marker in the marked image are determined based on an ellipse detection algorithm, and the two-dimensional image coordinates of the same target marker center at different orientations are transformed using the binocular stereo vision principle to obtain the three-dimensional physical coordinates of the target marker center; Analyzing the three-dimensional physical coordinates based on the preset reference point coordinates and the dimension information of the prefabricated bridge to determine the linear deviation of the prefabricated bridge; The step of inputting the bridge deck image and the camera distortion parameters into a preset generative adversarial network to generate a corrected image includes: Inputting the bridge deck image and the camera distortion parameters into the preset generator to convert the camera distortion parameters into a distortion feature vector, and fusing the distortion feature vector with a feature map of the bridge deck image to generate a corrected image based on the fused feature map; The corrected image is discriminated by using a preset discriminator corresponding to the resolution of the corrected image, and when the discrimination rate is not less than a preset discrimination threshold, the step of using the marker detection model to mark the target marker in the corrected image with a detection frame is triggered; Before inputting the bridge deck image and the camera distortion parameters into a preset generative adversarial network, the method further includes: Obtain several distorted images and corresponding distortion parameters and normal images to construct a training data set; Inputting the training data set into an initial generative adversarial network, so as to train the initial generative adversarial network using an adversarial training method and based on a pre-constructed target loss function, and obtain a trained preset generative adversarial network; Wherein, before training the initial generative adversarial network using the adversarial training method and based on the pre-constructed target loss function, the method further includes: Constructing a target loss function based on a preset edge loss function, a preset structural similarity loss function, an adversarial loss function corresponding to the initial generative adversarial network, and a reconstruction loss function; The preset edge loss function is a function for calculating the difference between the edge information of the normal image and the adversarial image; the preset structural similarity loss function is a function for calculating the similarity between the normal image and the adversarial image; the adversarial image is an image generated by the initial generative adversarial network based on the distorted image and the corresponding distortion parameters; Wherein, the preset edge loss function is expressed as: ; Among them, L edge represents edge loss; N represents the total number of image pixels; Represents the edge value of the normal image at the i-th pixel; Represents the edge value of the adversarial image at the i-th pixel; Correspondingly, the preset structural similarity loss function is expressed as: ; in, Represents the structural similarity loss; M represents the total number of image windows obtained after window segmentation of the normal image x or the adversarial image y; x i Indicates that the normal image is i An image area on an image window; y i Denotes the adversarial image in i The image region on the image window; SSIM represents the structural similarity loss function.

2. The intelligent bridge linearity detection method according to claim 1 is characterized in that: A group of marks includes a first-class mark and a plurality of second-class marks; wherein the size of the first-class mark is larger than the size of the second-class mark; Correspondingly, the method of using the marker detection model to mark the target marker in the corrected image with a detection frame, and determining the two-dimensional image coordinates of the center of the target marker in the marked image based on an ellipse detection algorithm, includes: Using a marker detection model to identify all markers in the corrected image, so as to mark the first category of markers in the corrected image as target markers for detection frame marking, and classifying the target markers according to the number of second category markers in the corrected image corresponding to the target markers, so as to obtain a marked image with a marked detection frame and the category of the target marker; Based on an ellipse detection algorithm, edge detection is performed on the target mark located in the detection frame in the annotated image to obtain a binary ellipse contour image, and the edge points in the ellipse contour image are grouped into arcs of different quadrants to determine the two-dimensional image coordinates of the center of the target mark based on the arcs of different quadrants.

3. The intelligent bridge linearity detection method according to claim 1 or 2, characterized in that: The analyzing the three-dimensional physical coordinates based on the preset reference point coordinates and the size information of the prefabricated bridge to determine the linear deviation of the prefabricated bridge includes: The expected physical coordinates of the center of the target mark are determined based on the preset reference point coordinates and the size information of the prefabricated bridge, and the three-dimensional physical coordinates are analyzed using the expected physical coordinates to determine the plane linear deviation and elevation deviation of the prefabricated bridge.

4. An intelligent bridge linear detection device, characterized in that: include: An image acquisition module, used for acquiring a bridge deck image; The bridge deck image is an image obtained by photographing a plurality of groups of markers preset on the prefabricated bridge from different directions using a camera mounted on a drone; An image distortion correction module, used for inputting the bridge deck image and camera distortion parameters into a preset generative adversarial network to generate a corrected image; The preset generative adversarial network includes a preset generator and a plurality of preset discriminators connected to the preset generator for discriminating images of different resolutions; A coordinate determination module is used to mark the target mark in the corrected image with a detection frame using a mark detection model, determine the two-dimensional image coordinates of the center of the target mark in the marked image based on an ellipse detection algorithm, and transform the two-dimensional image coordinates of the same target mark center at different orientations using the principle of binocular stereo vision to obtain the three-dimensional physical coordinates of the center of the target mark; A deviation determination module, used for analyzing the three-dimensional physical coordinates based on preset reference point coordinates and the dimension information of the prefabricated bridge to determine the linear deviation of the prefabricated bridge; Wherein, the image distortion correction module includes: An image generating unit, configured to input the bridge deck image and camera distortion parameters into the preset generator to convert the camera distortion parameters into a distortion feature vector, and fuse the distortion feature vector with a feature map of the bridge deck image to generate a corrected image based on the fused feature map; An image discrimination unit, configured to discriminate the corrected image using a preset discriminator corresponding to the resolution of the corrected image, and trigger the step of marking a detection frame for a target marker in the corrected image using a marker detection model when a discrimination rate is not less than a preset discrimination threshold; Wherein, the intelligent bridge linear detection device further includes: A data set construction unit, used to obtain a number of distorted images and corresponding distortion parameters and normal images to construct a training data set; A network training unit, configured to input the training data set into an initial generative adversarial network, so as to train the initial generative adversarial network using an adversarial training method and based on a pre-constructed target loss function, and obtain a trained preset generative adversarial network; Wherein, the intelligent bridge linear detection device further includes: A loss function construction unit, used to construct a target loss function based on a preset edge loss function, a preset structural similarity loss function, an adversarial loss function corresponding to the initial generative adversarial network, and a reconstruction loss function; The preset edge loss function is a function for calculating the difference between the edge information of the normal image and the adversarial image; the preset structural similarity loss function is a function for calculating the similarity between the normal image and the adversarial image; the adversarial image is an image generated by the initial generative adversarial network based on the distorted image and the corresponding distortion parameters; Wherein, the preset edge loss function is expressed as: ; Among them, L edge represents edge loss; N represents the total number of image pixels; Represents the edge value of the normal image at the i-th pixel; Represents the edge value of the adversarial image at the i-th pixel; Correspondingly, the preset structural similarity loss function is expressed as: ; in, Represents the structural similarity loss; M represents the total number of image windows obtained after window segmentation of the normal image x or the adversarial image y; x i Indicates that the normal image is i An image area on an image window; y i Denotes the adversarial image in i The image region on the image window; SSIM represents the structural similarity loss function.

5. An electronic device, characterized in that: include: Memory, used to store computer programs; A processor is used to execute the computer program to implement the intelligent bridge line shape detection method according to any one of claims 1 to 3.

6. A computer-readable storage medium, characterized in that: Used to store a computer program, which, when executed by a processor, implements the intelligent bridge linear detection method as described in any one of claims 1 to 3.