Structure displacement monitoring method and device, electronic equipment and storage medium
By employing homography matrix correction and multi-mode similarity fusion, the error problem in structural displacement monitoring under sudden changes in illumination was solved, achieving high-precision displacement monitoring under complex illumination conditions.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- CCCC HIGHWAY CONSULTANTS CO LTD
- Filing Date
- 2026-01-27
- Publication Date
- 2026-06-12
AI Technical Summary
Existing structural displacement monitoring methods suffer from low accuracy in complex lighting scenarios where sudden changes in illumination can disrupt the assumption of grayscale consistency, leading to significant errors in displacement data.
By acquiring the image to be processed containing the target, the image is corrected using the homography matrix. The target center coordinates are determined by combining the pixel similarity and frequency domain similarity between the target region and the pre-constructed template. The target is then accurately located using an edge-constrained centroid model. The displacement data is optimized by combining light intensity adjustment and confidence level judgment.
Accurately locate the target center coordinates when illumination changes, improve the accuracy and reliability of structural displacement monitoring, and meet the requirements of sub-millimeter accuracy and real-time tracking of dynamic displacement.
Smart Images

Figure CN122199607A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of displacement monitoring technology, and in particular to a method, device, electronic equipment, and storage medium for monitoring the displacement of structures. Background Technology
[0002] In the field of critical infrastructure safety assurance, structural health monitoring has become a core means of full life-cycle management for projects such as bridges and slopes, especially displacement monitoring. With accelerating urbanization and frequent extreme weather events, monitoring systems need to meet increasingly stringent technical requirements: sub-millimeter accuracy (±0.2mm) to capture early micro-deformations, 24-hour continuous operation to cope with alternating day and night lighting and rain / fog interference, and high-frequency sampling capabilities above 25Hz to track dynamic displacements such as traffic loads and wind vibrations in real time. These requirements stem from rigid constraints in engineering practice—for example, railway bridges need to monitor instantaneous flexural deformation when trains pass, and high-risk landslide areas need to continuously capture millimeter-level displacement accumulation trends.
[0003] Existing methods for monitoring structural displacement typically employ optical flow. Under the assumption of grayscale consistency (the grayscale of pixels remains unchanged between two consecutive image frames), these methods estimate pixel motion vectors using the spatiotemporal gradient of the image to be processed, thereby enabling structural displacement monitoring. However, in complex lighting scenarios, sudden changes in illumination can disrupt the grayscale consistency assumption, leading to significant errors in the displacement data and resulting in low accuracy in structural displacement monitoring. Summary of the Invention
[0004] This invention provides a method, device, electronic device, and storage medium for monitoring structural displacement, in order to solve the technical problem in the prior art where sudden changes in illumination under complex lighting conditions can destroy the assumption of grayscale consistency, leading to significant errors in displacement data and resulting in low accuracy of structural displacement monitoring.
[0005] This invention provides a method for monitoring structural displacement, comprising: Acquire an image to be processed containing a target; wherein the target is set on the structure to be monitored; The homography matrix is determined based on the center coordinates of the target in the reference image, and the image to be processed is corrected using the homography matrix to obtain the corrected image. The target center coordinates are determined based on the similarity between the target region in the corrected image and the pre-constructed template. The displacement data of the structure to be monitored is determined based on the coordinates of the target center.
[0006] According to a structural displacement monitoring method provided by the present invention, determining the target center coordinates based on the similarity between the target region in the corrected image and the pre-constructed template includes: The target center coordinates are determined by fusing the pixel similarity and frequency domain similarity between the target region and the pre-constructed target template in the corrected image.
[0007] According to a structural displacement monitoring method provided by the present invention, the step of determining the target center coordinates by fusing the pixel similarity and frequency domain similarity between the target region and the pre-constructed target template in the corrected image includes: A sub-region image in the corrected image is determined by using a preset pixel step size. The pixel similarity and frequency domain similarity between the sub-region image and the pre-constructed target template are fused to determine the initial target center coordinates. Based on the initial target center, an edge-constrained centroid model is constructed, and the target center coordinates are obtained by solving the edge-constrained centroid model.
[0008] According to a structural displacement monitoring method provided by the present invention, the step of determining a sub-region image in the corrected image with a preset pixel step size, fusing the pixel similarity and frequency domain similarity between the sub-region image and a pre-constructed target template, and determining the initial target center coordinates includes: The sub-images of interest in the corrected image are determined by a first preset pixel step size. The first pixel similarity and the first frequency domain similarity of the sub-images of interest are weighted and combined with the first pixel similarity and the first frequency domain similarity of the pre-target template to obtain the first multi-mode similarity. The sub-image of interest corresponding to the first multi-mode similarity with the maximum value is determined as the candidate image. The sub-candidate images in the candidate images are determined by the second preset pixel step size. The second pixel similarity and the second frequency domain similarity of the sub-candidate images and the pre-target template are weighted and combined to obtain the second multi-mode similarity. The position coordinates of the sub-candidate images corresponding to the maximum second multi-mode similarity are used to determine the initial target center coordinates.
[0009] According to the structural displacement monitoring method provided by the present invention, the weight allocation in the weighted combination is determined based on the real-time signal-to-noise ratio.
[0010] According to the present invention, a method for monitoring structural displacement, wherein constructing an edge-constrained centroid model based on the initial target center includes: A confidence weight is constructed using the gradient magnitude of the corrected image, a spatial prior weight is constructed using the initial target center coordinates, and an edge-constrained centroid model is constructed based on the confidence weight and the spatial prior weight.
[0011] According to the present invention, a method for monitoring structural displacement, wherein constructing a confidence weight based on the gradient magnitude of the corrected image includes: Calculate the gradient values in the horizontal direction and the gradient values in the vertical direction of the image to be corrected. The gradient magnitude of the corrected image is calculated based on the gradient values in the horizontal direction and the gradient values in the vertical direction. A gradient activation function is used to map the gradient magnitude to a confidence weight.
[0012] According to a structural displacement monitoring method provided by the present invention, before determining the sub-region image in the corrected image with a preset pixel step size, the method further includes: Calculate the sharpness of the corrected image, and determine the sharpness deviation based on the sharpness and a preset sharpness threshold; The intensity adjustment amount is determined based on the sharpness deviation and controller parameters, and the adjusted intensity is applied to the corrected image using the intensity adjustment amount.
[0013] According to a structural displacement monitoring method provided by the present invention, the step of determining the homography matrix based on the center coordinates of the target in a reference image includes: Obtain a reference image containing the target; Construct a homography matrix equation based on the center coordinates of the target in the reference image and the corresponding physical plane coordinates of the center coordinates; An adaptive weight allocation strategy based on the Laplacian response is introduced to determine the weight of each feature point in the reference image; The homography matrix is obtained by iteratively solving based on the homography matrix and the weights.
[0014] According to a structural displacement monitoring method provided by the present invention, the construction of the pre-constructed target template includes: The homography matrix is used to correct the image to be processed, generating a pre-constructed target template.
[0015] According to a structural displacement monitoring method provided by the present invention, the step of determining the displacement data of the structure to be monitored based on the target center coordinates includes: The coordinate difference between the final target center coordinates and the target center reference coordinates is converted into physical displacement to obtain the displacement data of the structure to be monitored.
[0016] According to a structural displacement monitoring method provided by the present invention, after determining the displacement data of the structure to be monitored based on the target center coordinates, the method further includes: When the confidence level of the displacement data is greater than or equal to a preset confidence threshold, the displacement data is determined to be valid data. When the confidence level of the displacement data is less than the preset confidence threshold, the displacement data is determined to be invalid data, and the valid data that is closest in time to the invalid data is selected.
[0017] According to a structural displacement monitoring method provided by the present invention, after determining the displacement data of the structure to be monitored based on the target center coordinates, the method further includes: Based on the displacement data, the real-time center coordinates of the target in each frame are determined, wherein the real-time center coordinates include the real-time center coordinates of the moving target and the real-time center coordinates of the reference target. The relative displacement of the moving target and the relative displacement of the reference target are determined using the real-time center coordinates and the initial center coordinates of the corresponding target. When the relative displacement of the reference target is non-zero, the relative displacement of the moving target is compensated according to the preset compensation coefficient and the relative displacement of the target to obtain the optimized displacement data of the structure to be monitored.
[0018] According to a structural displacement monitoring method provided by the present invention, after determining the displacement data of the structure to be monitored based on the target center coordinates, the method further includes: Obtain displacement data of m data points, perform moving average filtering on the displacement data to obtain the final displacement data of the m-th data point, where m is greater than or equal to a preset threshold.
[0019] The present invention also provides a structural displacement monitoring device, comprising: The image acquisition module is used to acquire an image containing a target; wherein the target is set on the structure to be monitored. An image correction module is used to determine a homography matrix based on the center coordinates of the target in a reference image, and to correct the image to be processed using the homography matrix to obtain a corrected image. The target center determination module is used to determine the target center coordinates based on the similarity between the target region in the corrected image and the pre-constructed template. The displacement data determination module is used to determine the displacement data of the structure to be monitored based on the target center coordinates.
[0020] The present invention also provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the structural displacement monitoring method as described above.
[0021] The present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the structural displacement monitoring method as described above.
[0022] The present invention also provides a computer program product, including a computer program that, when executed by a processor, implements the structural displacement monitoring method as described above.
[0023] This invention corrects the image to be processed using a homography matrix, which can eliminate target deformation caused by tilted shooting angle or perspective distortion. This maps the target area of the corrected image to a standard plane viewpoint, keeping the geometric shape of the target area stable. This effectively reduces the dependence on grayscale consistency and enables accurate positioning of the target center coordinates when the illumination changes, thus improving the accuracy and reliability of structural displacement monitoring.
[0024] Furthermore, this invention determines the target center coordinates by fusing the pixel similarity and frequency domain similarity between the target region and the pre-constructed target template in the corrected image. Pixel similarity can eliminate the influence of illumination changes on pixel intensity, while frequency domain similarity focuses on the phase information of the image rather than grayscale values. By comprehensively considering pixel similarity and frequency domain similarity under the condition of sudden illumination changes, the pixel intensity distribution of the image to be processed and the target template can be kept consistent, and the frequency domain similarity can still accurately reflect the degree of matching between the image to be processed and the target template. This can avoid significant errors in displacement data caused by sudden illumination changes, thereby effectively improving the accuracy of structural displacement monitoring.
[0025] Furthermore, the present invention first performs a coarse search with a larger first preset pixel step size to quickly identify candidate images containing the target; then, it performs a fine search within the candidate images with a smaller second preset pixel step size to further accurately determine the position of the target center. This hierarchical search strategy can effectively improve positioning accuracy and ensure accurate positioning of the target center in complex environments. Moreover, by combining pixel similarity and frequency domain similarity, it can maintain high robustness under different lighting and noise conditions, thereby effectively improving the accuracy of structural displacement monitoring. Attached Figure Description
[0026] To more clearly illustrate the technical solutions in this invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of this invention. For those skilled in the art, other drawings can be obtained from these drawings without creative effort.
[0027] Figure 1 This is one of the flowcharts of the structural displacement monitoring method provided by the present invention.
[0028] Figure 2 This is a schematic diagram comparing the dynamic displacement curves of the structural displacement monitoring method provided by this invention with those of a rope displacement meter.
[0029] Figure 3 This is the second flowchart of the structural displacement monitoring method provided by the present invention.
[0030] Figure 4 This is a schematic diagram of the structure displacement monitoring device provided by the present invention.
[0031] Figure 5 This is a schematic diagram of the structure of the electronic device provided by the present invention. Detailed Implementation
[0032] To make the objectives, technical solutions, and advantages of this invention clearer, the technical solutions of this invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of this invention. All other embodiments obtained by those skilled in the art based on the embodiments of this invention without creative effort are within the scope of protection of this invention.
[0033] Figure 1 This is one of the flowcharts illustrating the structural displacement monitoring method provided by the present invention, such as... Figure 1 As shown, the method includes the following: S1. Obtain an image to be processed containing a target; wherein the target is set on the structure to be monitored; In this embodiment of the invention, a global shutter CMOS camera can be used to continuously acquire images containing the target at a preset sampling frequency (e.g., 25Hz). The camera is equipped with a zoom lens, capable of covering a monitoring range of 0.5-100 meters. The structures to be monitored are various civil engineering structures that require displacement monitoring. These structures may be affected by factors such as the natural environment, geological conditions, or operating loads during long-term use, resulting in displacement, deformation, or other structural changes. The structures to be monitored can be bridges, dams, and slopes, etc.
[0034] In this embodiment of the invention, the target can be installed at key locations on the structure to be monitored, such as bridges and slopes, to ensure clear imaging from different perspectives.
[0035] In this embodiment of the invention, during the initialization phase, a region of interest (ROI) containing the target can be selected via a graphical interface, and the coordinate information of that region can be saved. In subsequent image processing, only that ROI region is processed, reducing computational load and improving processing efficiency.
[0036] S2. Determine the homography matrix based on the center coordinates of the target in the reference image, and use the homography matrix to correct the image to be processed to obtain the corrected image; S3. Determine the target center coordinates based on the similarity between the target region in the corrected image and the pre-constructed template; S4. Determine the displacement data of the structure to be monitored based on the target center coordinates.
[0037] In this embodiment of the invention, the coordinate difference between the final target center coordinates and the target center reference coordinates can be converted into a physical displacement, and the displacement data with a timestamp can be output. The target center reference coordinates are the initial coordinates of the target's center position when it is installed, i.e., the target center coordinates before the structure under test undergoes displacement.
[0038] This invention uses a homography matrix to correct the image to be processed, which can eliminate target deformation caused by tilted shooting angle or perspective distortion. This maps the target area of the corrected image to a standard plane viewpoint, keeping the geometric shape of the target area stable. This effectively reduces the dependence on grayscale consistency and enables accurate positioning of the target center coordinates when the illumination changes. It can also avoid significant errors in displacement data caused by sudden changes in illumination, thus improving the accuracy and reliability of structural displacement monitoring.
[0039] In one embodiment, step S2, determining the homography matrix based on the center coordinates of the target in the reference image, includes: S21. Obtain a reference image containing the target; S22. Construct a homography matrix equation based on the center coordinates of the target in the reference image and the physical plane coordinates corresponding to the center coordinates; In this embodiment of the invention, a homography matrix equation is constructed based on the center coordinates, the physical plane coordinates, and the Huber loss function; In this embodiment of the invention, the coordinates of the center of the four small circles at the corners of the target in the reference image are: ( ), whose corresponding physical plane coordinates are (Fixed spacing is 51cm). Homography matrix Describe the projection relationship from the physical plane to the image plane: in, This represents the scale equivalence relation in homogeneous coordinates.
[0040] Introducing the Huber loss function To enhance robustness, the following homography matrix equation is constructed: The Huber loss function is defined as: in, The pixel error in the residual vector. The threshold parameter (empirical value set to 1.0 pixel) is used. When the error is small, the function uses a quadratic term to ensure optimization efficiency, and when the error is large, it switches to linear growth to suppress the influence of outliers.
[0041] S23. Introduce an adaptive weight allocation strategy based on Laplacian response to determine the weight of each feature point in the reference image; Under long-distance or adverse weather conditions, the sharpness of different regions in an image may vary significantly. For example, if a feature point is located in a blurred region, its positioning accuracy will drop sharply, directly affecting the calibration accuracy of the homography matrix. To suppress errors caused by blurred regions and improve overall calibration robustness, this invention introduces an adaptive weight allocation strategy based on the Laplacian response. The core principle is: the higher the local sharpness of a feature point, the greater its weight should be in the reprojection error optimization. The response amplitude of the Laplacian operator... It is an effective indicator for measuring local sharpness; the higher the value, the richer the edge and detail information in that area, and the more reliable the feature point detection results. Therefore, weighting... It is designed to be positively correlated with the amplitude of the Laplace response. The embodiments of this invention use the following normalization function for weight allocation: in, Indicates at feature points Laplace operator calculated at point Norm (i.e., the absolute value or sum of squares of the response).
[0042] Discrete Laplacian convolution kernels use standard template: Through the above-described method, the embodiments of the present invention can achieve a Laplace response in the clear region. Large, corresponding to weight Larger features contribute more to the optimization process, thus anchoring the solution benchmark on high-quality feature points; in fuzzy regions, the Laplace response... Small, corresponding weight The small size effectively reduces the negative impact of low-quality feature points on the overall optimization objective and avoids skewing the homography matrix.
[0043] The weight allocation mechanism and Huber loss function in this invention form the core of adaptive homography optimization, enabling it to maintain high-precision spatial mapping calibration even when image quality is uneven, thus laying a solid mathematical foundation for subsequent sub-pixel displacement monitoring.
[0044] S24. Iteratively solve the homography matrix based on the homography matrix and the weights to obtain the homography matrix.
[0045] This invention employs the Levenberg-Marquardt algorithm for iterative solution, utilizing direct linear transformation (DLT) for computation. Then iterative updates are performed: Where J is the Jacobian matrix; ; r is the residual vector; λ is the damping factor.
[0046] End the iteration. Perform closed-loop verification after optimization is complete; Back projection error verification: Pixels; Template clarity verification: .
[0047] In this embodiment of the invention, recalibration is performed when the calibration fails, so as to ensure that the reprojection error RMSE is reduced to 0.3 pixels in the 100-meter distance test, thereby meeting the sub-millimeter level monitoring requirements.
[0048] In one embodiment, the construction of the pre-built target template includes: The reference image is corrected using the homography matrix to generate a pre-constructed target template.
[0049] In this embodiment of the invention, the reference image can be a rectangular region image surrounding the reflective target. This embodiment utilizes a homography matrix. The described projection relationship from the physical plane to the image plane, through its inverse... The reference image taken from an oblique perspective is "pulled back" to a frontal view parallel to the physical plane.
[0050] The specific correction process is as follows: For each pixel in the reference image... The ideal coordinates corresponding to it on the physical front view plane are calculated by inverse transformation. : In practical scenarios, to avoid redundant calculations and meet the 25Hz real-time requirement, this embodiment of the invention employs inverse mapping and bilinear interpolation techniques: the corresponding position of each pixel in the corrected front view in the reference image is pre-calculated, and its grayscale value is obtained through bilinear interpolation, thereby generating a target front view without perspective distortion. The front view of the target can be used as a target template.
[0051] This invention, through perspective correction, unifies target images acquired from different viewpoints into a standard front view, effectively eliminating perspective distortion caused by non-orthogonal camera mounting. High-precision measurements can be completed without directly facing the target. Furthermore, it can dynamically limit the subsequent calculation area to the range of interest, greatly reducing computational complexity and meeting the real-time processing requirements of different processing scenarios.
[0052] In one embodiment, step S3, determining the target center coordinates based on the similarity between the target region in the corrected image and the pre-constructed template, includes: S31. The target center coordinates are determined by fusing the pixel similarity and frequency domain similarity between the target region and the pre-constructed target template in the corrected image.
[0053] This invention determines the target center coordinates by fusing the pixel similarity and frequency domain similarity between the target region and the pre-constructed target template in the corrected image. Pixel similarity eliminates the influence of illumination changes on pixel intensity, while frequency domain similarity focuses on the phase information of the image rather than grayscale values. By comprehensively considering pixel similarity and frequency domain similarity under sudden illumination changes, the pixel intensity distribution of the image to be processed and the target template can be kept consistent, and the frequency domain similarity can still accurately reflect the degree of matching between the image to be processed and the target template. This avoids significant errors in displacement data caused by sudden illumination changes, thereby effectively improving the accuracy of structural displacement monitoring.
[0054] In one embodiment, step S31, determining the target center coordinates by fusing the pixel similarity and frequency domain similarity between the target region and the pre-constructed target template in the corrected image, includes: S311. Determine the sub-region image in the corrected image with a preset pixel step size, fuse the pixel similarity and frequency domain similarity between the sub-region image and the pre-constructed target template, and determine the initial target center coordinates; In this embodiment of the invention, step S311 further includes: S3111. Determine the sub-image of interest in the corrected image with a first preset pixel step size, and perform a weighted combination of the sub-image of interest with the first pixel similarity and the first frequency domain similarity of the pre-target template to obtain a first multi-mode similarity, and determine the sub-image of interest corresponding to the first multi-mode similarity with the maximum value as a candidate image. In this embodiment of the invention, in complex environments such as rain and changing light conditions, a single template matching algorithm cannot simultaneously guarantee robustness and accuracy.
[0055] In this embodiment of the invention, the normalized cross-correlation method can be used to calculate pixel similarity, and the phase correlation method can be used to calculate frequency domain similarity.
[0056] In this embodiment of the invention, after determining the image to be processed, the sub-images of interest can be determined by adjusting the light intensity of the image to be processed; alternatively, the sub-images of interest can be determined by correcting the image to be processed; or the sub-images of interest can be determined directly based on the image to be processed. This embodiment of the invention takes determining the sub-images of interest directly based on the image to be processed as an example. Candidate images are determined based on a weighted combination of multiple similarities. This process can be called a coarse search. The first preset pixel step size can be set to 4 pixels, 5 pixels, or 6 pixels, etc., to divide the image to be processed into multiple sub-images to be processed.
[0057] S3112. Determine the sub-candidate images in the candidate images with the second preset pixel step size, and perform a weighted combination of the second pixel similarity and the second frequency domain similarity of the sub-candidate images and the pre-target template to obtain the second multi-mode similarity. Determine the initial target center coordinates by taking the position coordinates of the sub-candidate image corresponding to the maximum value of the second multi-mode similarity.
[0058] In this embodiment of the invention, the second preset pixel step size is smaller than the first preset pixel step size. The second preset pixel step size can be 1 pixel. By progressively searching with a 1-pixel step size, the position of the determined sub-candidate image can be used as the initial target center coordinates.
[0059] In this embodiment of the invention, the expression for multimodal similarity is as follows: in, For multi-modal similarity, For the target template (size M × N); The image to be processed; For An M × N sub-image centered on the image; These represent the mean and standard deviation of the target template, respectively. These are the mean and standard deviation of the sub-images, respectively. It is a two-dimensional Fourier transform; For complex conjugate operators; These are adaptive weights for pixel similarity and frequency domain similarity, respectively.
[0060] In this embodiment of the invention, the weight allocation in the weighted combination is determined based on the real-time signal-to-noise ratio, specifically: In the formula, noise variance It can be estimated through dark field: in, This represents the background region without a target. Images acquired with the fill light off during calibration; for The global mean.
[0061] When high signal-to-noise ratio conditions It mainly relies on pixel similarity matching, utilizing its illumination invariance to determine the initial target center; under low signal-to-noise ratio conditions ( It mainly relies on frequency domain similarity matching and utilizes frequency domain noise resistance characteristics to determine the initial target center.
[0062] The embodiments of the present invention first perform a coarse search with a large first preset pixel step size to quickly identify candidate images containing the target; then, a fine search is performed within the candidate images with a smaller second preset pixel step size to further accurately determine the position of the target center. This hierarchical search strategy can effectively improve positioning accuracy and ensure accurate positioning of the target center in complex environments. Furthermore, by combining pixel similarity and frequency domain similarity, it can maintain high robustness under different lighting and noise conditions, thereby effectively improving the accuracy of structural displacement monitoring.
[0063] S312. Construct an edge constraint centroid model based on the initial target center, and solve the edge constraint centroid model to obtain the target center coordinates.
[0064] In this embodiment of the invention, step S312 further includes the following sub-steps: S3121. Construct confidence weights using the gradient magnitude of the corrected image, construct spatial prior weights using the initial target center coordinates, and construct an edge-constrained centroid model based on the confidence weights and the spatial prior weights.
[0065] In this embodiment of the invention, a confidence weight can be constructed based on the gradient magnitude. The larger the gradient magnitude, the higher the weight, indicating that the edge information of the pixel is more reliable. Spatial prior weights are constructed with the initial target center coordinates as the center. The closer to the center, the higher the weight.
[0066] This invention combines confidence weights and spatial prior weights to construct an edge-constrained centroid model for accurately locating the target center.
[0067] The embodiments of the present invention construct weights by gradient magnitude, which can effectively enhance the anti-interference ability against changes in illumination and noise. Furthermore, by combining spatial prior weights to construct an edge-constrained centroid model to locate the target center, the positioning accuracy can be effectively improved.
[0068] In one embodiment, step S3121, constructing confidence weights based on the gradient magnitude of the corrected image, includes: S31211. Calculate the gradient value of the image to be corrected in the horizontal direction and the gradient value in the vertical direction, respectively. In this embodiment of the invention, the expression for the gradient value is as follows: in, This represents the gradient of the image in the x-direction (horizontal direction); This represents the gradient of the image in the y-direction (vertical direction). This is a convolution operation.
[0069] S31212. Calculate the gradient magnitude of the corrected image based on the gradient value in the horizontal direction and the gradient value in the vertical direction. In this embodiment of the invention, the expression for the gradient magnitude is as follows: in, For in pixels The gradient magnitude at that point.
[0070] S31213. Use a gradient activation function to map the gradient magnitude to a confidence weight.
[0071] In this embodiment of the invention, the credibility weight The expression is as follows: Where x is the input value, and here x is the gradient magnitude. ; The parameter controlling the shape of the function is set to 15 here.
[0072] The gradient activation function satisfies the following property: when hour, ;when hour, This enables a smooth transition from low-gradient regions to high-gradient regions.
[0073] In this embodiment of the invention, the expression for the spatial prior weights is as follows: in, Spatial prior weights; These are the initial position coordinates, which are the initial target center coordinates determined in step S2; The parameter for controlling spatial weights can be set as the estimated radius of the target's center circle.
[0074] In this embodiment of the invention, spatial prior weights ensure that the positioning result is reasonably constrained by the initial position. Combining gradient confidence and spatial prior constraints, an edge-constrained centroid model is established: in, For pixels The overall weight, The coordinates of the target center; The corrected ROI image; These are the initial position coordinates, i.e., the initial target center coordinates determined in step S2; For The search area established around the target is slightly larger than the theoretical size of the target.
[0075] The edge-constrained centroid model in this invention effectively strengthens the contribution of edge pixels in centroid calculation through a weighted mechanism, while effectively suppressing interference from internal regions and regions far from the initial position. When the target is partially occluded, the gradient magnitude of the occluded region decreases significantly, leading to a corresponding weight... These unreliable pixels, approaching zero, are automatically ignored during computation. Meanwhile, unoccluded areas retain clear edge features, and their high gradient weights dominate the localization process, ensuring accurate positioning of the geometric center.
[0076] In the actual process of center of gravity positioning, it is necessary to obtain the initial position. And the image to be processed, which can undergo preprocessing such as correction and light intensity adjustment. Then with Establish a search area slightly larger than the theoretical size of the target, centered on it. Then apply the Sobel operator to calculate the region. gradient magnitude within Then calculate the gradient weights. Spatial weights This generates a comprehensive weight. The target center coordinates are calculated using the weighted center formula.
[0077] In this embodiment of the invention, the gradient magnitude can effectively reflect the intensity of edge information in the image. By calculating the gradient values in the horizontal and vertical directions, the edge features in the image can be fully captured. The impact of illumination changes on edge information is relatively small. By using the gradient magnitude as a weight, more attention can be paid to edge information, thereby reducing the impact of illumination changes on positioning accuracy.
[0078] In one embodiment, before determining the sub-region in the corrected image with a preset pixel step size, the method further includes: Calculate the sharpness of the corrected image, and determine the sharpness deviation based on the sharpness and a preset sharpness threshold; In this embodiment of the invention, the expression for sharpness is as follows: In the formula, This represents the image to be processed; W and H are the image width and height, and the function values. It is positively correlated with the high-frequency components of the image.
[0079] The intensity adjustment amount is determined based on the sharpness deviation and controller parameters, and the adjusted intensity is applied to the corrected image using the intensity adjustment amount.
[0080] In this embodiment of the invention, the current frame can be automatically captured every 10 minutes and the light intensity adjustment amount can be calculated. The intensity of the red supplementary light can be dynamically adjusted through a PID controller. in, Indicates the light intensity level; These are the proportional coefficient, integral coefficient, and derivative coefficient in the PID parameters; sharpness deviation. 1200 is the preset resolution threshold, which can be set and adjusted according to actual needs.
[0081] In an embodiment of the present invention, It is converted into an analog current signal, which linearly controls the fill light drive circuit, so that the drive current of the fill light changes steplessly within a preset range, thereby achieving stable and precise adjustment of light intensity.
[0082] In this embodiment of the invention, the light intensity adjustment amount is determined based on the sharpness deviation and controller parameters. The corrected image is then subjected to light intensity adjustment using the light intensity adjustment amount. The brightness is automatically adjusted by the supplementary light to achieve the required image sharpness, thereby solving the problem of image sharpness variation caused by environmental factors such as day and night, foggy days and rainy days.
[0083] In one embodiment, after determining the displacement data of the structure to be monitored based on the target center coordinates, the method further includes: S5. Optimize the displacement data based on confidence level, including: S51. When the confidence level of the displacement data is greater than or equal to a preset confidence threshold, the displacement data is determined to be valid data. In this embodiment of the invention, a confidence criterion mechanism is established to ensure the validity of the displacement data: In this embodiment of the invention, the confidence threshold C can be set to 0.9. The threshold setting is the result of a trade-off between data integrity and measurement accuracy: setting the threshold too high will discard too much valid data, leading to a decrease in data integrity; setting the threshold too low will retain more outliers, reducing overall measurement accuracy. Based on previous testing and engineering experience, C is set to 0.9 here.
[0084] In this embodiment of the invention, when the confidence level of the data point When the data is deemed valid: .
[0085] in, For data points, For valid data, the data points can be the displacement data of the structure to be monitored.
[0086] S52. When the confidence level of the displacement data is less than the preset confidence threshold, the displacement data is determined to be invalid data, and the valid data that is closest to the invalid data in time is selected.
[0087] In an embodiment of the present invention, when In cases where rain or fog obscures the data, the most recent valid data will be used as a replacement. The embodiments of the present invention can ensure that the data stream will not jump or be interrupted due to brief interference, thereby effectively maintaining the continuity of data.
[0088] In one embodiment, after determining the displacement data of the structure to be monitored based on the target center coordinates, the method further includes: S6. Optimize the displacement data based on the benchmark target, including: S61. Based on the displacement data, determine the real-time center coordinates of the target in each frame, wherein the real-time center coordinates include the real-time target center coordinates of the moving target and the real-time target center coordinates of the reference target. S62. Using the real-time center coordinates and the initial center coordinates of the corresponding target, determine the relative displacement of the moving target and the relative displacement of the reference target; S63. When the relative displacement of the reference target is non-zero, the relative displacement of the moving target is compensated according to the preset compensation coefficient and the relative displacement of the target to obtain the optimized displacement data of the structure to be monitored.
[0089] In this embodiment of the invention, the original Y coordinate can be determined based on the real-time center coordinate, and the displacement data can be optimized based on the original Y coordinate and the corresponding initial Y coordinate.
[0090] in, For the first The original Y coordinate of the moving target in the frame (i.e., the actual target to be monitored); For the first The original Y coordinate of the reference target in the frame, the reference target is fixed on a stable reference point.
[0091] , These are the initial Y coordinates of the moving target and the reference target recorded during system initialization (at the start); The relative displacement of the moving target with respect to its initial position; This represents the relative displacement of the reference target with respect to its initial position. Theoretically, if the reference point is absolutely stable, this value should always be 0. A non-zero value indicates that the camera has shaken.
[0092] This invention eliminates the effects of slight camera shake by using a reference target: Wherein, κ is the compensation coefficient, which is a scaling factor used to represent the degree of influence of camera shake on the measured value of the moving target. It is usually determined through calibration and is ideally close to 1. This is the final displacement value after compensation and correction to the reference target. It represents the relative displacement from the moving target. In the middle, subtract the camera shake displacement reflected by the benchmark target. , so that the obtained It approximately eliminates the influence of the camera's own motion, retaining only the true relative displacement of the measured object.
[0093] In one embodiment, after determining the displacement data of the structure to be monitored based on the target center coordinates, the method further includes: S7. Perform moving average filtering on the displacement data, including: S71. Obtain displacement data of m data points, perform moving average filtering on the displacement data to obtain the final displacement data of the mth data point, where m is greater than or equal to a preset threshold.
[0094] In this embodiment of the invention, a moving average filtering process using an equally weighted 5-point moving window can be employed to suppress high-frequency noise. in, The index of the current data point (requirement) ≥5, so that there is enough historical data); For the first The final output displacement value after the data points are filtered by moving average.
[0095] Take the current point Calculate the arithmetic mean of the displacement values of the current point and its preceding four points (a total of five points, within a fixed window), and use this average as the current point's displacement value. The final output value.
[0096] When processing the next point At this point, the window slides one position to the right, and the average of the new five points is calculated again. This "sliding window" method can suppress noise while maintaining a certain real-time response capability to actual displacement changes.
[0097] In one embodiment, the accuracy of the present invention at different monitoring distances is verified by the following method.
[0098] Using a high-precision dial indicator as a reference, standard displacement tests of 1mm, 5mm, 10mm, and 15mm were conducted within a range of 10 meters to 100 meters. For each test, data was taken 10 times using both methods, and the average value was calculated. The difference between the visual system measurement and the dial indicator reading is shown in Table 1 below.
[0099] Table 1. Displacement measurement error at different monitoring distances (unit: mm) Set displacement 10 meters 20 meters 30 meters 50 meters 80 meters 100 meters 1mm +0.05 +0.06 -0.10 +0.12 -0.15 -0.19 5mm -0.06 -0.12 -0.10 +0.18 +0.17 -0.18 10mm -0.08 -0.11 +0.18 +0.15 -0.13 -0.19 15mm +0.04 +0.04 -0.15 -0.15 -0.18 +0.14 Based on the above experiments, the displacement monitoring accuracy is better than ±0.2mm across the entire range of 0.5–100 meters, meeting the sub-millimeter level monitoring requirements. The error increases slightly with distance, but the maximum error at 100 meters remains within 0.2mm.
[0100] In this embodiment of the invention, dynamic data consistency testing can also be performed, specifically as follows: The consistency between a vision system and a drawstring displacement meter was evaluated by simultaneously acquiring displacement data under dynamic structural vibration. The test platform was moved vertically at a distance of 30 meters. The vision system sampled at 25Hz, and the drawstring displacement meter sampled at 100Hz. The data were compared after synchronization and downsampling.
[0101] Please see Figure 2 The paper presents a comparison of the displacement time history curves of the embodiments of the present invention and the draw-wire displacement meter within 10 seconds, wherein... Figure 2 The above is a schematic diagram of the displacement curve of the structural displacement monitoring method provided in an embodiment of the present invention. It can be observed that the two curves are highly consistent in terms of peaks, troughs, and phase. To quantify the accuracy of the proposed method, normalized root mean square error (NRMSE) is used for error analysis. The formula is as follows: in, This represents the total number of data points. Specifically, it represents the total number of sample pairs of visual system data and reference device data acquired synchronously during a single dynamic test. For indexes of data points; For the first Each data point represents a displacement value measured in an embodiment of the present invention. For the first Each data point represents a displacement value measured by a reference device. The reference device recorded the maximum displacement value during this dynamic test. This refers to the minimum displacement value recorded by the reference device during this dynamic test.
[0102] The calculated NRMSE = % (<2.5%) indicates that the embodiments of the present invention have extremely high consistency with professional dynamic sensors in dynamic measurement, and can meet the needs of dynamic characteristic analysis of engineering structures.
[0103] In this embodiment of the invention, multi-scenario robustness testing can also be performed, specifically as follows: At a monitoring distance of 30 meters, a high-precision dial gauge was used as a benchmark. Tests were conducted in three typical scenarios: daytime, nighttime, and rainy weather, to evaluate the robustness and accuracy stability of the system under different environmental conditions. For each test, 10 data points were collected for each method, and the average value was calculated. The difference between the visual system measurement and the dial gauge reading is shown in Table 1 below.
[0104] Table 2 Displacement measurement errors under various scenarios (unit: mm) Set displacement daytime at night rain 1mm +0.03 +0.10 -0.19 5mm +0.10 +0.12 -0.18 10mm -0.16 -0.12 -0.19 15mm -0.09 +0.16 +0.10 The results show that the maximum absolute error is less than 0.2 mm in all four complex scenarios, demonstrating excellent all-weather environmental adaptability.
[0105] Please see Figure 3 This is a second schematic flowchart of a structural displacement monitoring method provided in an embodiment of the present invention. Figure 3 As shown, the structure displacement monitoring method includes an initialization configuration stage, a real-time displacement calculation stage, and a data optimization stage. The initialization configuration stage includes: the user selecting the ROI (Region of Interest), and labeling the target corner points based on the image to be processed, i.e., the coordinates of the center positions of the small circles at the four corners of the reflective target. The configuration file is generated. Then, the lower-level machine restarts and loads the data. Based on the physical distance between the four corner centers, the correction matrix is calculated and corrected to obtain the target's front view. This target front view is saved as a target template, which is then verified. If verification is successful, the process moves to the real-time displacement calculation stage. The real-time displacement calculation stage of this embodiment includes acquiring the image to be processed containing the target, cropping the image, performing correction, template matching, and centroid positioning, then performing coordinate transformation and outputting the final target center coordinates. Then, the process moves to the data optimization stage. The data optimization stage includes confidence pre-screening, dynamic zeroing, and moving average filtering. Finally, the final result is output, yielding the final displacement data of the monitored structure.
[0106] In one embodiment, the structural displacement monitoring method provided by this invention can be executed in a structural displacement monitoring system. This system includes an optical-computational collaborative architecture, comprising a reflective target, an imaging unit, and a computing unit. The reflective target can be designed as a five-circle structure based on diamond-grade microprism material. The imaging unit is equipped with a global shutter CMOS camera and a 5-100mm zoom lens for image acquisition, and works with an infrared LED array to provide long-distance supplementary lighting, thus meeting the requirements for all-weather detection. The computing unit uses an embedded NPU processor to solve the edge-constrained centroid model constructed in this embodiment, achieving all-weather displacement monitoring with real-time sampling at 25Hz under power consumption of less than 15W. Furthermore, this embodiment can upload displacement data to a cloud platform in real time via a 4G wireless network, enabling remote monitoring and data analysis, effectively improving the reliability of structural displacement monitoring.
[0107] Implementing the embodiments of the present invention has the following beneficial effects: This invention corrects the image to be processed using a homography matrix, which can eliminate target deformation caused by tilted shooting angle or perspective distortion. This maps the target area of the corrected image to a standard plane viewpoint, keeping the geometric shape of the target area stable. This effectively reduces the dependence on grayscale consistency and enables accurate positioning of the target center coordinates when the illumination changes, thus improving the accuracy and reliability of structural displacement monitoring.
[0108] Furthermore, in this embodiment of the invention, the target center coordinates are determined by fusing the pixel similarity and frequency domain similarity between the target region and the pre-constructed target template in the corrected image. Pixel similarity can eliminate the influence of illumination changes on pixel intensity, while frequency domain similarity focuses on the phase information of the image rather than grayscale values. By comprehensively considering pixel similarity and frequency domain similarity under the condition of sudden illumination changes, the pixel intensity distribution of the image to be processed and the target template can be kept consistent, and the frequency domain similarity can still accurately reflect the degree of matching between the image to be processed and the target template. This can avoid significant errors in displacement data caused by sudden illumination changes, thereby effectively improving the accuracy of structural displacement monitoring.
[0109] Furthermore, in this embodiment of the invention, a coarse search is first performed with a larger first preset pixel step size to quickly identify candidate images containing the target; then, a fine search is performed within the candidate images with a smaller second preset pixel step size to further accurately determine the position of the target center. This hierarchical search strategy can effectively improve positioning accuracy and ensure accurate positioning of the target center in complex environments. Moreover, by combining pixel similarity and frequency domain similarity, it can maintain high robustness under different lighting and noise conditions, thereby effectively improving the accuracy of structural displacement monitoring.
[0110] The structural displacement monitoring device provided by the present invention is described below. The structural displacement monitoring device described below can be referred to in correspondence with the structural displacement monitoring method described above.
[0111] Please see Figure 4 One embodiment of the present invention provides a structural displacement monitoring device, comprising: The image acquisition module 410 is used to acquire an image to be processed containing a target; wherein the target is set on the structure to be monitored. The image correction module 420 is used to determine the homography matrix based on the center coordinates of the target in the reference image, and to correct the image to be processed using the homography matrix to obtain the corrected image. The target center determination module 430 is used to determine the target center coordinates based on the similarity between the target region in the corrected image and the pre-constructed template. The displacement data determination module 440 is used to determine the displacement data of the structure to be monitored based on the target center coordinates.
[0112] In one embodiment, determining the target center coordinates by fusing the pixel similarity and frequency domain similarity between the target region and the pre-constructed target template in the corrected image includes: A sub-region image in the corrected image is determined by using a preset pixel step size. The pixel similarity and frequency domain similarity between the sub-region image and the pre-constructed target template are fused to determine the initial target center coordinates. Based on the initial target center, an edge-constrained centroid model is constructed, and the target center coordinates are obtained by solving the edge-constrained centroid model.
[0113] In one embodiment, determining the target center coordinates based on the similarity between the target region in the corrected image and the pre-constructed template includes: The target center coordinates are determined by fusing the pixel similarity and frequency domain similarity between the target region and the pre-constructed target template in the corrected image.
[0114] In one embodiment, determining the sub-region image in the corrected image with a preset pixel step size, fusing the pixel similarity and frequency domain similarity between the sub-region image and the pre-constructed target template, and determining the initial target center coordinates includes: The sub-images of interest in the corrected image are determined by a first preset pixel step size. The first pixel similarity and the first frequency domain similarity of the sub-images of interest are weighted and combined with the first pixel similarity and the first frequency domain similarity of the pre-target template to obtain the first multi-mode similarity. The sub-image of interest corresponding to the first multi-mode similarity with the maximum value is determined as the candidate image. The sub-candidate images in the candidate images are determined by the second preset pixel step size. The second pixel similarity and the second frequency domain similarity of the sub-candidate images and the pre-target template are weighted and combined to obtain the second multi-mode similarity. The position coordinates of the sub-candidate images corresponding to the maximum second multi-mode similarity are used to determine the initial target center coordinates.
[0115] In one embodiment, the weight allocation in the weighted combination is determined based on the real-time signal-to-noise ratio.
[0116] In one embodiment, constructing the edge-constrained centroid model based on the initial target center includes: A confidence weight is constructed using the gradient magnitude of the corrected image, a spatial prior weight is constructed using the initial target center coordinates, and an edge-constrained centroid model is constructed based on the confidence weight and the spatial prior weight.
[0117] In one embodiment, constructing the confidence weights using the gradient magnitude of the corrected image includes: Calculate the gradient values in the horizontal direction and the gradient values in the vertical direction of the image to be corrected. The gradient magnitude of the corrected image is calculated based on the gradient values in the horizontal direction and the gradient values in the vertical direction. A gradient activation function is used to map the gradient magnitude to a confidence weight.
[0118] In one embodiment, before determining the sub-region image in the corrected image with a preset pixel step size, the method further includes: Calculate the sharpness of the corrected image, and determine the sharpness deviation based on the sharpness and a preset sharpness threshold; The intensity adjustment amount is determined based on the sharpness deviation and controller parameters, and the adjusted intensity is applied to the corrected image using the intensity adjustment amount.
[0119] In one embodiment, determining the homography matrix based on the center coordinates of the target in the reference image includes: Obtain a reference image containing the target; Construct a homography matrix equation based on the center coordinates of the target in the reference image and the corresponding physical plane coordinates of the center coordinates; An adaptive weight allocation strategy based on the Laplacian response is introduced to determine the weight of each feature point in the reference image; The homography matrix is obtained by iteratively solving based on the homography matrix and the weights.
[0120] In one embodiment, the construction of the pre-built target template includes: The homography matrix is used to correct the image to be processed, generating a pre-constructed target template.
[0121] In one embodiment, determining the homography matrix based on the center coordinates of the target in the reference image and the corresponding physical plane coordinates of the center coordinates includes: Construct a homography matrix equation based on the center coordinates, the physical plane coordinates, and the Huber loss function; An adaptive weight allocation strategy based on the Laplacian response is introduced to determine the weight of each feature point in the reference image; The homography matrix is obtained by iteratively solving based on the homography matrix and the weights.
[0122] In one embodiment, determining the displacement data of the structure to be monitored based on the target center coordinates includes: The coordinate difference between the final target center coordinates and the target center reference coordinates is converted into physical displacement to obtain the displacement data of the structure to be monitored.
[0123] In one embodiment, after determining the displacement data of the structure to be monitored based on the target center coordinates, the method further includes: When the confidence level of the displacement data is greater than or equal to a preset confidence threshold, the displacement data is determined to be valid data. When the confidence level of the displacement data is less than the preset confidence threshold, the displacement data is determined to be invalid data, and the valid data that is closest in time to the invalid data is selected.
[0124] In one embodiment, after determining the displacement data of the structure to be monitored based on the target center coordinates, the method further includes: Based on the displacement data, the real-time center coordinates of the target in each frame are determined, wherein the real-time center coordinates include the real-time center coordinates of the moving target and the real-time center coordinates of the reference target. The relative displacement of the moving target and the relative displacement of the reference target are determined using the real-time center coordinates and the initial center coordinates of the corresponding target. When the relative displacement of the reference target is non-zero, the relative displacement of the moving target is compensated according to the preset compensation coefficient and the relative displacement of the target to obtain the optimized displacement data of the structure to be monitored.
[0125] In one embodiment, after determining the displacement data of the structure to be monitored based on the target center coordinates, the method further includes: Obtain displacement data of m data points, perform moving average filtering on the displacement data to obtain the final displacement data of the m-th data point, where m is greater than or equal to a preset threshold.
[0126] Figure 5 An example is a schematic diagram of the physical structure of an electronic device, such as... Figure 5 As shown, the electronic device may include: a processor 510, a communication interface 520, a memory 530, and a communication bus 540, wherein the processor 510, the communication interface 520, and the memory 530 communicate with each other via the communication bus 540. The processor 510 can call logical instructions in the memory 530 to execute a structural displacement monitoring method, which includes: Acquire an image to be processed containing a target; wherein the target is set on the structure to be monitored; The homography matrix is determined based on the center coordinates of the target in the reference image, and the image to be processed is corrected using the homography matrix to obtain the corrected image. The target center coordinates are determined based on the similarity between the target region in the corrected image and the pre-constructed template. The displacement data of the structure to be monitored is determined based on the coordinates of the target center.
[0127] Furthermore, the logical instructions in the aforementioned memory 530 can be implemented as software functional units and, when sold or used as independent products, can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art, or a part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0128] On the other hand, the present invention also provides a computer program product, the computer program product comprising a computer program that can be stored on a non-transitory computer-readable storage medium, wherein when the computer program is executed by a processor, the computer is able to execute a structural displacement monitoring method provided by the above methods, the method comprising: Acquire an image to be processed containing a target; wherein the target is set on the structure to be monitored; The homography matrix is determined based on the center coordinates of the target in the reference image, and the image to be processed is corrected using the homography matrix to obtain the corrected image. The target center coordinates are determined based on the similarity between the target region in the corrected image and the pre-constructed template. The displacement data of the structure to be monitored is determined based on the coordinates of the target center.
[0129] In another aspect, the present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, is implemented to perform a structural displacement monitoring method provided by the methods described above, the method comprising: Acquire an image to be processed containing a target; wherein the target is set on the structure to be monitored; The homography matrix is determined based on the center coordinates of the target in the reference image, and the image to be processed is corrected using the homography matrix to obtain the corrected image. The target center coordinates are determined based on the similarity between the target region in the corrected image and the pre-constructed template. The displacement data of the structure to be monitored is determined based on the coordinates of the target center.
[0130] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs. Those skilled in the art can understand and implement this without any creative effort.
[0131] Through the above description of the embodiments, those skilled in the art can clearly understand that each embodiment can be implemented by means of software plus necessary general-purpose hardware platforms, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solutions, in essence or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, magnetic disk, optical disk, etc., and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute the methods described in the various embodiments or some parts of the embodiments.
[0132] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, and not to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features; and these modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A method for monitoring structural displacement, characterized in that, include: Acquire an image to be processed containing a target; wherein the target is set on the structure to be monitored; The homography matrix is determined based on the center coordinates of the target in the reference image, and the image to be processed is corrected using the homography matrix to obtain the corrected image. The target center coordinates are determined based on the similarity between the target region in the corrected image and the pre-constructed template. The displacement data of the structure to be monitored is determined based on the coordinates of the target center.
2. The structural displacement monitoring method as described in claim 1, characterized in that, Determining the target center coordinates based on the similarity between the target region in the corrected image and the pre-constructed template includes: The target center coordinates are determined by fusing the pixel similarity and frequency domain similarity between the target region and the pre-constructed target template in the corrected image.
3. The structural displacement monitoring method as described in claim 2, characterized in that, The step of determining the target center coordinates by fusing the pixel similarity and frequency domain similarity between the target region and the pre-constructed target template in the corrected image includes: A sub-region image in the corrected image is determined by using a preset pixel step size. The pixel similarity and frequency domain similarity between the sub-region image and the pre-constructed target template are fused to determine the initial target center coordinates. Based on the initial target center, an edge-constrained centroid model is constructed, and the target center coordinates are obtained by solving the edge-constrained centroid model.
4. The structural displacement monitoring method as described in claim 3, characterized in that, The step of determining a sub-region image in the corrected image using a preset pixel step size, fusing the pixel similarity and frequency domain similarity between the sub-region image and the pre-constructed target template, and determining the initial target center coordinates includes: The sub-images of interest in the corrected image are determined by a first preset pixel step size. The first pixel similarity and the first frequency domain similarity of the sub-images of interest are weighted and combined with the first pixel similarity and the first frequency domain similarity of the pre-target template to obtain the first multi-mode similarity. The sub-image of interest corresponding to the first multi-mode similarity with the maximum value is determined as the candidate image. The sub-candidate images in the candidate images are determined by the second preset pixel step size. The second pixel similarity and the second frequency domain similarity of the sub-candidate images and the pre-target template are weighted and combined to obtain the second multi-mode similarity. The position coordinates of the sub-candidate images corresponding to the maximum second multi-mode similarity are used to determine the initial target center coordinates.
5. The structural displacement monitoring method as described in claim 4, characterized in that, The weight allocation in the weighted combination is determined based on the real-time signal-to-noise ratio.
6. The structural displacement monitoring method as described in claim 3, characterized in that, The construction of the edge-constrained centroid model based on the initial target center includes: A confidence weight is constructed using the gradient magnitude of the corrected image, a spatial prior weight is constructed using the initial target center coordinates, and an edge-constrained centroid model is constructed based on the confidence weight and the spatial prior weight.
7. The structural displacement monitoring method as described in claim 6, characterized in that, The construction of confidence weights based on the gradient magnitude of the corrected image includes: Calculate the gradient values in the horizontal direction and the gradient values in the vertical direction of the image to be corrected. The gradient magnitude of the corrected image is calculated based on the gradient values in the horizontal direction and the gradient values in the vertical direction. A gradient activation function is used to map the gradient magnitude to a confidence weight.
8. The structural displacement monitoring method according to claim 3, characterized in that, Before determining the sub-region image in the corrected image with a preset pixel step size, the method further includes: Calculate the sharpness of the corrected image, and determine the sharpness deviation based on the sharpness and a preset sharpness threshold; The intensity adjustment amount is determined based on the sharpness deviation and controller parameters, and the adjusted intensity is applied to the corrected image using the intensity adjustment amount.
9. The structural displacement monitoring method as described in claim 1, characterized in that, Determining the homography matrix based on the center coordinates of the target in the reference image includes: Obtain a reference image containing the target; Construct a homography matrix equation based on the center coordinates of the target in the reference image and the corresponding physical plane coordinates of the center coordinates; An adaptive weight allocation strategy based on the Laplacian response is introduced to determine the weight of each feature point in the reference image; The homography matrix is obtained by iteratively solving based on the homography matrix and the weights.
10. The structural displacement monitoring method as described in claim 9, characterized in that, The construction of the pre-built target template includes: The reference image is corrected using the homography matrix to generate a pre-constructed target template.
11. The structural displacement monitoring method as described in claim 1, characterized in that, After determining the displacement data of the structure to be monitored based on the target center coordinates, the method further includes: When the confidence level of the displacement data is greater than or equal to a preset confidence threshold, the displacement data is determined to be valid data. When the confidence level of the displacement data is less than the preset confidence threshold, the displacement data is determined to be invalid data, and the valid data that is closest in time to the invalid data is selected.
12. The structural displacement monitoring method as described in claim 1, characterized in that, After determining the displacement data of the structure to be monitored based on the target center coordinates, the method further includes: Based on the displacement data, the real-time center coordinates of the target in each frame are determined, wherein the real-time center coordinates include the real-time center coordinates of the moving target and the real-time center coordinates of the reference target. The relative displacement of the moving target and the relative displacement of the reference target are determined using the real-time center coordinates and the initial center coordinates of the corresponding target. When the relative displacement of the reference target is non-zero, the relative displacement of the moving target is compensated according to the preset compensation coefficient and the relative displacement of the target to obtain the optimized displacement data of the structure to be monitored.
13. The structural displacement monitoring method as described in claim 1, characterized in that, After determining the displacement data of the structure to be monitored based on the target center coordinates, the method further includes: Obtain displacement data of m data points, perform moving average filtering on the displacement data to obtain the final displacement data of the m-th data point, where m is greater than or equal to a preset threshold.
14. A structural displacement monitoring device, characterized in that, include: The image acquisition module is used to acquire an image containing a target; wherein the target is set on the structure to be monitored. An image correction module is used to determine a homography matrix based on the center coordinates of the target in a reference image, and to correct the image to be processed using the homography matrix to obtain a corrected image. The target center determination module is used to determine the target center coordinates based on the similarity between the target region in the corrected image and the pre-constructed template. The displacement data determination module is used to determine the displacement data of the structure to be monitored based on the target center coordinates.
15. An electronic device comprising a memory, a processor, and a computer program stored in the memory and running on the processor, characterized in that, When the processor executes the computer program, it implements the structural displacement monitoring method as described in any one of claims 1 to 13.
16. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, it implements the structural displacement monitoring method as described in any one of claims 1 to 13.