Displacement measurement method based on monocular vision
Through the non-contact displacement measurement technology based on computer vision, using multiple digital images for grayscale processing and target recognition, the problems of low efficiency and poor adaptability of traditional contact displacement monitoring methods are solved, and the displacement monitoring effect is achieved with high accuracy and adaptability to complex environments.
Patent Information
- Application Number
- CN202411943663.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-26
- Publication Date
- 2025-05-06
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
The traditional contact displacement monitoring method is inefficient, susceptible to operational errors, and cannot work effectively in bad weather or at night, which cannot meet the needs of modern construction projects for high-precision and high-efficiency monitoring.
Using contactless displacement measurement technology based on computer vision, the target area is identified through grayscale processing and advanced algorithms of multiple RGB digital images, the optimal central coordinates of the target are obtained, phased matching and contour extraction are calculated, and the displacement amount of the target and the average value of the overall displacement are calculated.
It significantly improves the accuracy of displacement monitoring, adapts to complex environments, is widely used in a variety of displacement monitoring scenarios, and meets the safety monitoring needs during construction and operation.
Smart Images

Figure CN119941643A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to a non-contact displacement measurement technology based on computer vision, which belongs to the field of displacement monitoring. This technology realizes high-precision displacement monitoring of the surface of the monitored object through digital image processing and feature extraction algorithms, ensures safety during construction and operation, and meets the needs of long-term structural health monitoring. Background Art
[0002] As the pace of urban construction accelerates, displacement monitoring has become particularly important in various construction projects, especially in the fields of high-rise buildings and underground space development. As a key link in ensuring structural safety, displacement monitoring can timely detect structural deformation, settlement or other displacement problems and prevent potential safety hazards. Displacement or deformation during construction is usually affected by many factors, such as load changes, soil settlement, temperature fluctuations, etc., which may cause structural instability or safety risks. Therefore, a high-precision displacement monitoring system is essential to ensure construction safety, especially in complex or harsh environments.
[0003] Traditional displacement monitoring methods mostly rely on contact measurement equipment, such as total stations and levels. Although these devices have advantages in accuracy, they also have many limitations. First, manual operation is inefficient and susceptible to operational errors. Second, traditional equipment has high installation and maintenance costs, and cannot work effectively in bad weather conditions or at night, and cannot meet the needs of all-weather, continuous monitoring. Therefore, traditional methods can no longer meet the requirements of modern construction projects for high-precision and high-efficiency monitoring.
[0004] To solve these problems, computer vision technology has gradually become an emerging non-contact displacement measurement method. Displacement measurement technology based on digital images has the advantages of non-destructive, remote, high-precision, and anti-electromagnetic interference, and is particularly suitable for displacement monitoring in complex environments. This technology captures digital images of the displacement area, uses image processing algorithms to extract structural features, calculates displacement, and provides real-time data support for construction safety.
[0005] However, in practical applications, the surface of the structure often lacks obvious identification features, which makes it difficult to extract and match the target in the image. In order to improve the measurement accuracy, it is usually necessary to attach a target with a clear identification on the surface of the structure, such as a cross cursor, a checkerboard, or concentric circles, so that the target information can be accurately extracted through image analysis. However, factors such as image quality, illumination changes, noise, and occlusion may affect target recognition and thus affect the accuracy of displacement calculation.
[0006] The present invention proposes a displacement measurement method based on computer vision, which uses multiple RGB digital images for grayscale processing, applies advanced algorithms to identify the target area, and obtains the optimal center coordinates of the target. The method first calculates the center coordinates of the target in the initial image through staged matching and contour extraction, and then tracks the target position in subsequent images to calculate the displacement of each target and the average value of the overall displacement. This method can not only significantly improve the accuracy of displacement monitoring, but also adapt to various complex environments and is widely applicable to a variety of displacement monitoring scenarios. Summary of the invention
[0007] The present invention provides a displacement measurement system based on computer vision, which aims to improve the accuracy of displacement monitoring and meet the safety monitoring needs of engineering structures during construction and operation. Through image processing algorithms, the present invention achieves accurate detection of targets and efficient calculation of displacement, and can adapt to the displacement monitoring needs in complex environments.
[0008] 1. Target design
[0009] By designing a target that is easy to identify and has certain known geometric constraints, the results of visual recognition can be compared and calculated with the actual geometric constraints to obtain the actual scale and obtain the true and accurate displacement change.
[0010] 2. Matching targets in stages
[0011] In order to improve the target matching accuracy, the present invention adopts a multi-scale template matching method to identify and locate the target. The method is divided into three stages: rough search, fine search and fine-tuning search. The specific process is as follows:
[0012] 1) Initialization: First check whether the input image and template image are empty. If they are empty, return an error message and stop processing. Initialize variables to record the highest similarity value during the matching process.
[0013] 2) Coarse search: Use a larger step size to scale the template image and match it with the input image. Each time the scaled template is matched with the image, the similarity is calculated and the matching position is recorded. If the current similarity is higher than the previous highest value, the best matching position and its similarity value are updated.
[0014] 3) Fine search: Based on the best match obtained from the rough search, the template image is scaled using a smaller step size to perform a more refined match search. The purpose of the fine search is to further accurately find the matching position and scale.
[0015] 4) Fine-tune search: Further reduce the step size for fine-tuning to achieve the most accurate matching effect.
[0016] 3. Determination of initial coordinates
[0017] After obtaining the best matching position through staged template matching, the image is binarized to extract the target's region of interest and perform contour detection. The specific steps are as follows:
[0018] 1) Image binarization and region selection: Binarize the input image to obtain a binary image. In this image, draw a rectangular box and determine the region of interest based on the best matching result.
[0019] 2) Extract the region of interest and invert the image: Extract the region of interest based on the position and size of the rectangular frame. Perform a color inversion operation on the extracted region of interest image to generate an inverted binary image.
[0020] 3) Contour detection: Use the contour detection algorithm in the inverted binary image to extract all possible contours.
[0021] 4) Contour screening and ratio judgment: All detected contours are screened and contours that do not meet the standards are eliminated. The contours that meet the standards are retained by calculating the aspect ratio of the contours.
[0022] 5) Fill the contour and extract the centroid: For each retained contour, create a mask image and fill the contour area. Then extract the pixel area within the contour and calculate the average coordinate of the pixel points to obtain the centroid position of the contour, that is, the center point of the target.
[0023] 6) Draw crosshairs and contours: Draw crosshairs on the image and position their center at the centroid. At the same time, draw the border of the contour for visualization.
[0024] 7) Centroid sorting and column classification: Sort the centroid coordinates of all contours according to the x-axis and y-axis respectively, and assign the centroids to different columns and rows according to the sorting results.
[0025] 8) Row and column storage: According to the x-axis and y-axis coordinates of the centroid, the centroid is stored in different columns and rows to form a two-dimensional array for subsequent processing.
[0026] 9) Calculate scaling factors: Calculate vertical and horizontal scaling factors for calculating actual displacement examples.
[0027] 4. Calculate displacement
[0028] The same method is used to calculate the center point position of the target in the subsequent images, and the actual displacement is calculated using the scaling factor. The calculation formula is as follows:
[0029] 1) Center of mass displacement
[0030] a) Calculate the average horizontal displacement of the center of mass (disp h_Avg )
[0031] b) Calculate the average vertical displacement of the center of mass (disp v_Avg )
[0032] 2) Template matching displacement correction
[0033] The correction of template matching displacement in the horizontal direction is:
[0034] disp h_MatchLoc =x best -x′ best
[0035] The vertical correction is:
[0036] disp v_MatchLoc =y best -y′ best
[0037] Among them, x best and best is the coordinate of the best matching position found by template matching in the current frame, and x′ best and y′ best are the corresponding matching coordinates in the reference frame.
[0038] 3) Total displacement formula
[0039] Horizontal displacement (h disp )’s final formula:
[0040] h disp =(disp h_Avg +disp h_MatchLoc )×m h_scalar
[0041] Where: disp h_Avg Disp represents the average value of the difference between the coordinates of each particle in the new image and the coordinates in the template image. h_MatchLoc Represents the difference between the coordinates of the best matching position of the template in the new image and the coordinates in the template image, m h_scalar Indicates the horizontal scaling factor.
[0042] Vertical displacement (v disp )’s final formula:
[0043] h disp =(disp v_Avg +disp v_MatchLoc )×m v_scalar
[0044] Among them: dispv -Avg Disp represents the average value of the difference between the coordinates of each particle in the new image and the coordinates in the template image.v_MatchLoc Represents the difference between the coordinates of the best matching position of the template in the new image and the coordinates in the template image, m v_scalar Indicates the horizontal scaling factor. BRIEF DESCRIPTION OF THE DRAWINGS
[0045] Figure 1 Technical flow chart
[0046] Figure 2 Target design example
[0047] Figure 3 , Figure 4 Indoor experimental process
[0048] Figure 5 , Figure 6 Indoor displacement measurement results at a distance of 5m and 10m
[0049] Figure 7 , Figure 8 Outdoor experiment process
[0050] Fig. 9 , Fig.10 Displacement measurement results at a distance of 5m and 10m outdoors DETAILED DESCRIPTION
[0051] The present invention relates to a displacement measurement method based on computer vision, which is used for high-precision displacement monitoring. In order to make the implementation of the invention clearer, the specific implementation method is described in detail with reference to the accompanying drawings.
[0052] Figure 1 :Technical flow chart
[0053] This implementation first extracts target information from multiple input images, and obtains the center coordinates of the target through multi-stage template matching and image processing. The specific process is as follows:
[0054] 1. Image input: Obtain multiple images of the monitoring area, including image data at different time points.
[0055] 2. Image preprocessing: Grayscale the input image and convert it into a black and white image for subsequent processing.
[0056] 3. Target matching: Through a phased template matching method, rough search, fine search and fine-tuning search are performed to determine the best matching position of the target.
[0057] 4. Center coordinate extraction: Use contour detection algorithm and center of mass calculation method to extract the center coordinates of the target.
[0058] 5. Displacement calculation: The displacement is obtained by calculating the difference between the target position in the current image and the target position in the reference image. In this step, the image coordinates are converted into actual physical displacement using the calculated scaling factor.
[0059] Figure 2 :Target design example
[0060] In order to ensure high accuracy of visual measurement, the present invention uses multiple targets for displacement calculation, and the design of the targets follows fixed rules to ensure that they have enough feature points in the image for accurate matching. Figure 2 Typical target designs are shown.
[0061] Each target is composed of multiple target points. Through known design specifications, the image scaling ratio can be reversely calculated based on the image recognition results, thereby achieving accurate calculation of the actual displacement. The displacement calculation of multiple target points can calculate an average value, further improving the accuracy of displacement measurement.
[0062] Figure 3 , Figure 4 :Indoor experimental process
[0063] During the experiment, in order to verify the effectiveness of the method of the present invention, an experiment was first conducted indoors, using targets at different distances to perform displacement measurements. Figure 3 and Figure 4 The experimental setup and process are shown. The targets are placed at different distances of 5m and 10m, simulating displacement measurement scenarios at different distances.
[0064] In the experiment, the displacement of the target ranged from 0.1cm to 5cm. The displacement of each target was calculated in real time through image analysis method, and the results were statistically analyzed.
[0065] Figure 5 , Figure 6 : Indoor 5m and 10m distance displacement measurement
[0066] Figure 5 and Figure 6 The displacement data obtained when the target moves 0.1cm, 0.5cm, 1cm and 5cm at a distance of 5m and 10m are shown. The displacement of each experimental point is calculated by an image processing algorithm, and the results show the measurement accuracy under different displacements.
[0067] Through these experiments, the measurement accuracy of the method of the present invention at different distances and displacements can be verified, and its application effect in actual engineering monitoring can be further evaluated.
[0068] Figure 7 , Figure 8 :Outdoor experimental process
[0069] Figure 7 and Figure 8 The experimental process in an outdoor environment is demonstrated to further verify the feasibility of the method in practical applications. Similar to the indoor experiment, the displacement of the target is measured at a distance of 5m and 10m outdoors, and the actual displacement of the target is calculated through real-time image analysis.
[0070] The outdoor experiment simulated different lighting conditions and environmental interference factors to test the adaptability and stability of the method of the present invention in a complex environment.
[0071] Fig. 9 , Fig.10 : Outdoor 5m and 10m distance displacement measurement
[0072] Fig. 9 and Fig.10 The displacement of the target after moving 0.1cm, 0.5cm, 1cm and 5cm respectively in the outdoor experiment is shown. By comparing the experimental results, the accuracy and stability of the method of the present invention in complex environments can be evaluated.
[0073] In each experiment, the image processing algorithm accurately calculated the displacement of the target, and the results showed that even under adverse outdoor environmental conditions, the method of the present invention can still complete the displacement measurement with high precision.
[0074] Through the above experiments and data analysis, the displacement measurement method based on computer vision proposed in this invention can complete the displacement monitoring of the monitoring area with high precision under different distances and environmental conditions. The experimental results show that the method of this invention has high anti-interference and measurement accuracy, and can be effectively applied to fields such as foundation pit monitoring.
Claims
1. A displacement measurement method based on computer vision, characterized in that: The following steps are involved: ●Target design: By designing a target that is easy to identify and has certain known geometric constraints, the results of visual recognition can be compared and calculated with the actual geometric constraints to obtain the actual scale and obtain the true and accurate displacement change. ● Template matching: Use multi-scale template matching methods to accurately locate the target in the image. The matching process includes the following stages: a. Rough search: Preliminary matching of target position through large step search; b. Fine search: Based on the rough search, a small step size is used to further optimize the matching results; c. Fine-tuning search: Based on the detailed search, use a smaller step size to further fine-tune the template matching results to obtain the most accurate matching position. ● Centroid extraction: Binarize the image, select the region, and detect the contour, and extract the centroid of the target area. The specific steps are as follows: a. Binarization processing: convert the input image into a binary image for subsequent target area extraction; b. Region of interest selection: Based on the template matching results, define a rectangular frame to select the region of interest, and perform color inversion to obtain an inverted binary image; c. Contour detection and screening: Use contour detection algorithm to extract contours in the inverted binary image and screen valid contours that meet the specified aspect ratio; d. Centroid extraction: Mask the effective contour area and extract the centroid position by calculating the centroid of the pixels in the area. ● Displacement calculation: Calculate the horizontal and vertical displacements based on the target centroid coordinates in the current image and the reference image. The specific steps include: a. Scaling factor calculation: Calculate the horizontal and vertical scaling factors based on the centroid calculation results and geometric constraints; b. Centroid extraction: Use the above method to extract the centroid coordinates of the current image and the target matching coordinates; c. Total displacement calculation: Based on the centroid displacement and matching coordinate correction, the final actual horizontal displacement h is calculated using the scaling factor. disp and vertical displacement h disp .
2. The displacement measurement method according to claim 1, characterized in that: The template matching method uses a staged matching process, including a rough search, a fine search and a fine-tuning search, to improve the matching accuracy by gradually reducing the search step size, and the matching accuracy of each stage is evaluated by a similarity value.
3. The displacement measurement method according to claim 1, characterized in that: The centroid extraction step further includes the following sub-steps: a. According to the horizontal and vertical coordinates of the centroid, all detected centroids are sorted in the order of the X axis and Y axis respectively; b. Determine the target columns and rows based on the sorted centroid coordinates and store them in a multidimensional array; c. Based on the centroid ranking of the target of interest, determine and calculate the scaling factor of the target.
4. The displacement calculation method according to claim 1, characterized in that: The scaling factor calculation method described is based on known standard target geometry and uses the following formulas to calculate the scaling factors in the horizontal and vertical directions: Horizontal scaling factor: Where: disp h_Acturl Indicates the actual distance between centroids, disp h_Pixels Represents the centroid identification distance. Vertical scaling factor: Where: disp v_Acturl Indicates the actual distance between centroids, disp v_Pixels Represents the centroid identification distance.
5. The displacement measurement method according to any one of claims 1 to 4, characterized in that: The displacement calculation formula includes the centroid displacement calculation formula and the template matching correction formula. The final displacement in the horizontal direction and the vertical direction are calculated according to the following formulas: Horizontal displacement (h dtsp ): h disp =(disp h_Avg +disp h_MatchLoc )×m h_scalar Where: disp h_Avg Disp represents the average value of the difference between the coordinates of each particle in the new image and the coordinates in the template image. h_MatchLoc Represents the difference between the coordinates of the best matching position of the template in the new image and the coordinates in the template image, m h_scalar Indicates the horizontal scaling factor. Vertical displacement (v disp ):. h disp =(disp v_Avg +disp v_MatchLoc )×m v_scalar Where: dispv_ Avg Disp represents the average value of the difference between the coordinates of each particle in the new image and the coordinates in the template image. v_MatchLoc Represents the difference between the coordinates of the best matching position of the template in the new image and the coordinates in the template image, m v_scalar Indicates the horizontal scaling factor.
Citation Information
Patent Citations
Remote displacement measurement system and method
CN103940345A
One-way vibration table test structure model displacement measurement method
CN111623942A
Displacement measurement method and system, storage medium and electronic equipment
CN115393430A
Cited By
Steel structure installation and adjustment method and system based on vertical column axis dynamic tracking
CN120429934A