Construction reference line continuous identification and displacement monitoring method based on image processing
Patent Information
- Application Number
- CN202611068082.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-07-17
- Publication Date
- 2026-10-23
AI Technical Summary
[0003]现有线性特征识别与监测方法多基于单帧图像分析;然而,施工现场存在光照多变、背景杂乱、设备振动移位、局部遮挡、干扰线段较多等干扰因素,对单帧图像进行单帧检测或单次拟合,难以应对由干扰因素引起的特征局部缺失、边缘对比度不足等问题,易造成边缘识别失效
1、本发明通过相位相关预对齐补偿了成像设备扰动引起的帧间图像整体漂移,解决了现有方法因缺乏帧间漂移补偿机制而导致的直线预测偏差逐帧累积问题,显著提升了位移监测的长期稳定性。
Smart Images

Figure CN122966547A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of image processing and visual measurement technology, specifically a method for continuous identification and displacement monitoring of construction baselines based on image processing. Background Technology
[0002] Currently, non-contact structural displacement monitoring technology based on machine vision is gradually being applied in the field of engineering construction. It relies on image recognition technology to capture the positional changes of linear reference features on the structural surface, thereby calculating structural displacement and evaluating construction safety and forming quality.
[0003] Existing linear feature recognition and monitoring methods are mostly based on single-frame image analysis; however, construction sites are subject to various interference factors such as variable lighting, cluttered backgrounds, equipment vibration and displacement, partial occlusion, and numerous interfering line segments. Performing single-frame detection or single-time fitting on a single-frame image is difficult to address issues such as local feature loss and insufficient edge contrast caused by interference factors, which can easily lead to edge recognition failure. Summary of the Invention
[0004] The purpose of this invention is to provide a method for continuous identification and displacement monitoring of construction baselines based on image processing, so as to solve the problems raised in the prior art.
[0005] To achieve the above objectives, the present invention provides the following technical solution: a method for continuous identification and displacement monitoring of construction baselines based on image processing, the method comprising: Acquire the image sequence continuously captured by the imaging equipment during the construction period, and establish a timeline with the first frame as the zero point of time; On the first frame image, an initial reference line is selected through interactive operation, and a target area covering the entire range of motion of the initial reference line is selected; wherein, the initial reference line is represented by a normalized straight line equation and remains unchanged throughout the entire processing; In the image sequence, phase correlation operation is performed between the target region of the current frame image and the previous frame image to obtain the inter-frame translation estimate and the correlation peak intensity; the correlation peak intensity is judged according to a preset threshold, and the translation estimate is selectively used to compensate the line intercept of the previous frame according to the judgment result to obtain the line prediction parameters of the current frame image. Based on the line prediction parameters, sampling centers are set up along the tangential direction of the line within the target area, and edge points are extracted in the normal neighborhood of each sampling center by gradient directionality scoring. The extracted edge points are then aggregated to form a candidate point set. A hierarchical random sampling strategy is used to fit the candidate point set to a straight line; wherein, the first level uses a precise fitting condition, and when the fitting fails, it switches to the second level to use a robust fitting condition to obtain the fitted straight line of the current frame; Calculate the difference between the fitted line and the initial reference line and the first angle, as well as the difference between the fitted line and the line in the previous frame. Determine whether the fitted line is valid based on the first angle difference and the second angle difference. Update the line parameters based on the determination results. The line parameters and validity markers are output frame by frame, and the structural normal displacement time history is extracted based on the change of the line intercept of each frame relative to the reference, using the intercept of the valid line in the first frame as the reference.
[0006] Furthermore, establishing a timeline with the first frame as the zero point includes: When the image filenames in the image sequence contain timestamp information, the timestamp field in the image filename is parsed to obtain the absolute time corresponding to each frame image; the absolute time of the first frame image is taken as the zero point, and the difference between the absolute time of each of the remaining frames image and the absolute time of the first frame image is calculated to obtain the relative time corresponding to each frame image; when the timestamp field in the image filename cannot be parsed, the relative time of each frame image is calculated by dividing the frame number by the frame rate; the relative times corresponding to all frames image are arranged in order of frame number to obtain the time axis with the first frame as the zero point of time.
[0007] Furthermore, selecting the initial reference line on the first frame image through interactive operations includes: In the first frame, two pixels are selected interactively, and their image coordinates P1(x1,y1) and P2(x2,y2) are recorded. Interactive operations include, for example, selecting pixels using the mouse. The image coordinates refer to the original image resolution coordinates. Initial linear coefficients and normalization factors are calculated based on the image coordinates of the two pixels, letting a0 = y1 - y2, b0 = x2 - x1, c0 = x1y2 - x2y1, and the normalization factor... The initial straight line coefficients are divided by a normalization factor to obtain the normalized normalized straight line parameters; where the normalized normalized straight line parameters are a=a0 / n, b=b0 / n, c=-c0 / n; where (a,b) is the unit normal vector and (b,-a) is the unit tangent vector; the line ax+by=c corresponding to the normalized straight line parameters is used as the initial reference line; where the sum of the squares of the unit normal vectors is 1, the normalized normalized straight line parameters remain unchanged throughout the entire process and serve as the benchmark for calculating the first angle difference in the subsequent dual angle constraints.
[0008] Furthermore, the target area that covers the entire range of motion of the initial reference line includes: A reference region is obtained on the first frame image through interactive selection, for example, by selecting a rectangular area on the first frame image with the mouse as the reference region. The boundary coordinates and size parameters of the reference region at the display resolution are recorded. The current display scaling ratio is obtained, and the boundary coordinates and size parameters are converted to the resolution coordinates of the first frame image according to the display scaling ratio. The converted reference region is then cropped to remove the area that exceeds the range of the first frame image. The cropped reference region is the target region. The target region needs to have sufficient redundancy in the normal direction of the initial reference line to cover the movement range of the reference line in all monitoring frames.
[0009] Furthermore, in the image sequence, phase correlation operations are performed between the target region of the current frame image and the previous frame image to obtain the inter-frame translation estimate and the correlation peak intensity, including: The target regions of the current frame image and the previous frame image are extracted, and Gaussian smoothing is applied to both target regions respectively. Fourier transform is performed on the two smoothed target regions to obtain their normalized cross-power spectra. Inverse Fourier transform is performed on the cross-power spectra to obtain the phase correlation surface. The peak position of the phase correlation surface corresponds to the inter-frame translation estimate (Δx, Δy), which includes a horizontal translation Δx and a vertical translation Δy, and the peak amplitude is the correlation peak intensity resp. The horizontal and vertical translations are truncated to limit them from exceeding a preset upper limit.
[0010] Furthermore, the relevant peak intensity is judged based on a preset threshold, and the translation estimate is selectively used to compensate for the line intercept of the previous frame based on the judgment result, to obtain the line prediction parameters of the current frame image, including: Assuming the line parameters of the previous frame are known, where the normal vector components of the line in the previous frame are a and b, and the intercept is c0; when the correlation peak intensity is not lower than the preset minimum response threshold, i.e., resp≥respmin, the horizontal translation is multiplied by a, the vertical translation is multiplied by b, and the two are added together and superimposed on c0 to obtain the line prediction intercept of the current frame, i.e., cpred=c0+a·Δx+b·Δy; when the correlation peak intensity is lower than the minimum response threshold, i.e., resp<respmin, cpred=c0 is directly taken as the line prediction intercept of the current frame; the prediction intercept and the normal vector components (a,b) of the previous frame together constitute the line prediction parameters of the current frame.
[0011] Furthermore, based on the line prediction parameters, sampling centers are deployed along the tangential direction of the line within the target area, and edge points are extracted in the normal neighborhood of each sampling center through gradient directionality scoring. The extracted edge points are then aggregated to form a candidate point set, including: Calculate the two intersection points between the predicted line of the current frame image and the boundary of the target region to obtain an intersection line segment located within the target region; if the length of the intersection line segment is less than the preset minimum length threshold, skip the current frame image and do not extract candidate points; if the length of the intersection line segment is greater than the preset minimum length threshold, set multiple sampling centers at equal intervals from one end to the other on the intersection line segment, and the number of sampling centers is the preset number of tangential sampling points; For each sampling center, a point-by-point search is performed along the direction of the preset straight line normal vector within a preset normal search radius, with a step size of a single pixel. For each search position, the gradient horizontal component and gradient vertical component of the search position are obtained from the gradient map of the image through bilinear interpolation. The gradient horizontal component is multiplied by the horizontal component of the normal vector, and the gradient vertical component is multiplied by the vertical component of the normal vector to obtain the gradient normal projection value. The score is determined based on the preset polarity parameters. When the polarity is bidirectional, the score is the absolute value of the gradient normal projection value; when the polarity is positive, the score is the positive projection value of the gradient normal projection value; when the polarity is negative, the score is the negative projection value of the gradient normal projection. When the score is not lower than the preset gradient projection threshold, the search position is recorded as a candidate point; for all candidate points obtained from each sampling center, sort them from high to low score, take the first preset number of candidate points, and remove candidate points whose normal distance exceeds the sum of the normal search radius and bandwidth margin; summarize the remaining candidate points to form the candidate point set of the current frame image.
[0012] Furthermore, the linear fitting of the candidate point set using a hierarchical random sampling strategy includes: The first-level fitting parameters and the second-level fitting parameters are preset. The first-level fitting parameters and the second-level fitting parameters both include the number of tangential sampling points, the normal search radius, the gradient projection threshold, the number of candidate points retained by the sampling center, the inlier distance threshold, and the minimum inlier ratio. In addition, all parameters in the first-level fitting parameters except for the gradient projection threshold, the inlier distance threshold, and the minimum inlier ratio are smaller than all parameters in the second-level fitting parameters. The first-level fitting parameters are precision-level parameters, including fewer tangential sampling points, a smaller normal search radius, a higher gradient projection threshold, a maximum number of candidates per point k = 1, a stricter interior distance threshold, and a higher proportion of the lowest interior point. The second-level fitting parameters are robust-level parameters, including more tangential sampling points, a larger normal search radius, a lower gradient projection threshold, a maximum number of candidates per point k = 3, a more lenient interior distance threshold, and a lower proportion of the lowest interior point. The first-level fitting parameters are used to perform random sampling consistency line fitting on the candidate point set. If an effective line cannot be obtained due to insufficient candidate points or fitting failure, the system automatically switches to the second-level fitting parameters, uses the second-level fitting parameters to re-extract candidate points and perform random sampling consistency line fitting. During the fitting process, two candidate points are randomly selected within a preset number of iterations to construct a virtual straight line. The number of interior points of each virtual straight line is counted using a preset interior point distance threshold as a screening condition. After the iteration is completed, the virtual straight line with the most interior points is selected, and the set of interior points of the virtual straight line is fitted using the least squares method to obtain the normalized straight line parameters. When the maximum number of interior points is lower than the preset minimum number of interior points threshold, the fitting is deemed to have failed.
[0013] Furthermore, the first angle difference between the fitted line and the initial reference line, and the second angle difference between the fitted line and the line in the previous frame are calculated respectively. Based on the first angle difference and the second angle difference, it is determined whether the fitted line is valid. The line parameters are updated according to the determination result, including: Calculate the absolute value of the difference between the direction angle of the fitted line and the direction angle of the initial reference line, and record it as the first absolute value; subtract the first absolute value from 180 degrees to obtain the first difference value, and take the minimum value between the first difference value and the first absolute value as the first angle difference; Calculate the absolute value of the difference between the direction angle of the fitted line and the direction angle of the line in the previous frame image, and record it as the second absolute value; subtract the second absolute value from 180 degrees to obtain the second difference value, and take the minimum value between the second difference value and the second absolute value as the second angle difference; When the first angle difference does not exceed the first preset angle threshold and the second angle difference does not exceed the second preset angle threshold, the fitting result is received, the straight line parameters of the current frame image are updated to the fitted straight line parameters, and the validity flag of the current frame image is set to valid. When the first angle difference exceeds the first preset angle threshold or the second angle difference exceeds the second preset angle threshold, the straight line parameter of the previous frame image is used as the output straight line parameter of the current frame image, and the validity flag of the current frame image is set to invalid. At the same time, the failure cause and related index values are recorded in the diagnostic information.
[0014] Furthermore, the line parameters and validity markers are output frame by frame, and the structural normal displacement time history is extracted based on the change in the line intercept of each frame relative to the reference, using the intercept of the valid line in the first frame as a reference. The effective linear intercept of the first frame is used as the reference intercept; the linear intercept of each frame is obtained, and the difference between the linear intercept of each frame and the reference intercept is calculated to obtain the normal displacement value; the scaling factor determined in advance by camera parameters and shooting distance calibration is obtained, and the scaling factor represents the actual physical length corresponding to each pixel; the normal displacement value in pixels is multiplied by the scaling factor to obtain the engineering displacement; the engineering displacement values of all frames are arranged in chronological order and output as the structural normal displacement time history.
[0015] Compared with the prior art, the beneficial effects of the present invention are: 1. This invention compensates for the overall image drift between frames caused by imaging device disturbances through phase correlation pre-alignment, solving the problem of cumulative straight line prediction deviation frame by frame caused by the lack of an inter-frame drift compensation mechanism in existing methods, and significantly improving the long-term stability of displacement monitoring.
[0016] 2. This invention employs tangential sampling and normal local search to limit candidate point extraction to the neighborhood of the reference line. It also combines gradient normal projection scoring to distinguish real edges from background noise using gradient directionality, effectively suppressing interfering line segments in complex construction backgrounds and improving the recognition success rate under weak edge and discontinuous conditions.
[0017] 3. This invention introduces a two-level RANSAC hierarchical fitting strategy. When the imaging quality is good, it prioritizes the output of high-precision fitting results. Under difficult conditions, it switches to robust parameters to provide usable fitting as much as possible, thus balancing recognition accuracy and adaptability under harsh working conditions.
[0018] 4. This invention prevents large-scale angular drift and inter-frame mutations in the straight line recognition results through a dual angle constraint and failure retention mechanism. When fitting fails, it automatically uses the parameters of the previous frame, ensuring the continuity and integrity of the displacement time sequence output and providing traceable data support for construction safety assessment. Attached Figure Description
[0019] Figure 1 This is a schematic diagram of the method flow for a construction baseline continuous identification and displacement monitoring method based on image processing according to the present invention; Figure 2 This is a schematic diagram illustrating the initial reference line and target region (ROI) selection process of a construction baseline continuous identification and displacement monitoring method based on image processing according to the present invention. Figure 3 This is a schematic diagram illustrating the phase correlation pre-alignment principle of a construction baseline continuous identification and displacement monitoring method based on image processing according to the present invention. Figure 4 This is a schematic diagram illustrating the preprocessing, tangential sampling, normal search, and gradient normal projection scoring principles of a construction baseline continuous identification and displacement monitoring method based on image processing according to the present invention. Figure 5 This is a schematic diagram of a two-stage linear fitting process for a construction baseline continuous identification and displacement monitoring method based on image processing according to the present invention. Detailed Implementation
[0020] Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0021] Example: Figure 1-5 As shown, the present invention provides a technical solution: a method for continuous identification and displacement monitoring of construction baselines based on image processing, the method comprising: Acquire the image sequence continuously captured by the imaging equipment during the construction period, and establish a timeline with the first frame as the zero point of time; On the first frame image, an initial reference line is selected through interactive operation, and a target area covering the entire range of motion of the initial reference line is selected; wherein, the initial reference line is represented by a normalized straight line equation and remains unchanged throughout the entire processing; In the image sequence, phase correlation operation is performed between the target region of the current frame image and the previous frame image to obtain the inter-frame translation estimate and the correlation peak intensity; the correlation peak intensity is judged according to a preset threshold, and the translation estimate is selectively used to compensate the line intercept of the previous frame according to the judgment result to obtain the line prediction parameters of the current frame image. Based on the line prediction parameters, sampling centers are set up along the tangential direction of the line within the target area, and edge points are extracted in the normal neighborhood of each sampling center by gradient directionality scoring. The extracted edge points are then aggregated to form a candidate point set. A hierarchical random sampling strategy is used to fit the candidate point set to a straight line; wherein, the first level uses a precise fitting condition, and when the fitting fails, it switches to the second level to use a robust fitting condition to obtain the fitted straight line of the current frame; Calculate the difference between the fitted line and the initial reference line and the first angle, as well as the difference between the fitted line and the line in the previous frame. Determine whether the fitted line is valid based on the first angle difference and the second angle difference. Update the line parameters based on the determination results. The line parameters and validity markers are output frame by frame, and the structural normal displacement time history is extracted based on the change of the line intercept of each frame relative to the reference, using the intercept of the first valid line as the reference. The establishment of a timeline with the first frame as the zero point includes: When the image filenames in the image sequence contain timestamp information, the timestamp field in the image filename is parsed to obtain the absolute time corresponding to each frame; the absolute time of the first frame is taken as the zero point, and the difference between the absolute time of each of the remaining frames and the absolute time of the first frame is calculated to obtain the relative time of each frame; when the timestamp field in the image filename cannot be parsed, the relative time of each frame is calculated by dividing the frame number by the frame rate; the relative times corresponding to all frames are arranged in order of frame number to obtain the time axis with the first frame as the zero point. In an embodiment of the present invention, the image sequence during construction is obtained in chronological order. If the image file name contains a 17-bit timestamp field, for example, a timestamp field in the format YYYYMMDDHHMMSSmmm, then the absolute time of each frame is parsed and a relative time axis is established with the first frame as the zero point. For example, if the absolute time obtained from the parsing of the i-th frame is converted to seconds and denoted as ti, and the absolute time of the first frame is t0, then the relative time of the i-th frame is tsec(i) = ti - t0. If the timestamp cannot be parsed, then the image frame number is divided by the estimated frame rate f0 for approximate calculation, tsec(i) = i ÷ f0. Selecting an initial reference line on the first frame image through interactive operations includes: Two pixels are selected on the first frame image through interactive operation, and the image coordinates of the two pixels are recorded. The initial straight line coefficient and normalization factor are calculated based on the image coordinates of the two pixels. The initial straight line coefficient is divided by the normalization factor to obtain the normalized normalized straight line parameter. The straight line corresponding to the normalized straight line parameter is used as the initial reference line. In an embodiment of the present invention, two pixels P1(x1,y1) and P2(x2,y2) are selected on the first frame image by using a mouse to draw a bounding box; the initial linear coefficient and normalization factor are calculated based on the image coordinates of the two pixels, and a0=y1-y2, b0=x2-x1, c0=x1y2-x2y1, and the normalization factor is... Then the normalized normal line parameters are a=a0 / n, b=b0 / n, c=-c0 / n; the line ax+by=c corresponding to the normal line parameters is taken as the initial reference line. The target area that covers the entire range of motion of the initial reference line includes: A reference region is obtained on the first frame image through interactive selection, and the boundary coordinates and size parameters of the reference region at the display resolution are recorded; the current display scaling ratio is obtained, and the boundary coordinates and size parameters are converted to the resolution coordinates of the first frame image according to the display scaling ratio; the converted reference region is cropped to remove the area that exceeds the range of the first frame image, and the cropped reference region is the target region. In an embodiment of the present invention, the reference area is determined by mouse selection. The boundary coordinates and size parameters of the selected rectangular reference area, such as the top-left corner coordinates (rx, ry), and the size parameters width rw and height rh, are converted back to the original image coordinates according to the display scaling ratio s, and then out-of-bounds cropping is performed. ; Where XROL,0 represents the left boundary x-coordinate of the target region, i.e., the minimum value in the x-direction; xROL,1 represents the right boundary x-coordinate of the target region, i.e., the maximum value in the x-direction; yROL,0 represents the upper boundary y-coordinate of the target region, i.e., the minimum value in the y-direction; yROL,1 represents the lower boundary y-coordinate of the target region, i.e., the maximum value in the y-direction; W and H are the width and height of the original image, respectively. Specifically, in the image sequence, performing phase correlation operations between the target region of the current frame image and the previous frame image to obtain the inter-frame translation estimate and correlation peak intensity includes: The target regions of the current frame image and the previous frame image are extracted, and Gaussian smoothing is applied to both target regions. Fourier transforms are then performed on the smoothed target regions to obtain their normalized cross-power spectra. Inverse Fourier transforms are then performed on the cross-power spectra to obtain a phase-correlated surface. The peak position of the phase-correlated surface corresponds to the inter-frame translation estimate, which includes horizontal and vertical translations, and the peak amplitude is the correlation peak intensity. The horizontal and vertical translations are truncated to limit them from exceeding a preset upper limit. In an embodiment of the present invention, let the previous frame image be Iprev and the current frame image be Icurr; perform two-dimensional discrete Fourier transforms on the two frames respectively, and calculate the normalized cross-power spectrum: ; Where F(·) represents the two-dimensional discrete Fourier transform, the superscript * indicates conjugate, and R(u,v) is the normalized cross power spectrum; Taking the inverse transform of R(u,v), the peak position corresponds to the inter-frame translation estimate (Δx, Δy), and the corresponding peak amplitude is the related peak intensity resp. To prevent outlier interference, truncation restrictions are applied to Δx and Δy respectively, with a priority upper limit of 250 pixels. The process involves determining the relevant peak intensity based on a preset threshold, and selectively using the translation estimate to compensate for the line intercept of the previous frame based on the determination result, to obtain the line prediction parameters for the current frame image, including: Assuming the line parameters of the previous frame are known, where the normal vector components of the line in the previous frame are a and b, and the intercept is c0; when the correlation peak intensity is not lower than the preset minimum response threshold, the horizontal translation is multiplied by a, the vertical translation is multiplied by b, and the two are added together and superimposed on c0 to obtain the line prediction intercept of the current frame; when the correlation peak intensity is lower than the minimum response threshold, c0 is directly taken as the line prediction intercept of the current frame; the prediction intercept and the normal vector components (a, b) of the previous frame together constitute the line prediction parameters of the current frame; In an embodiment of the present invention, the linear parameters of the previous frame image are known as (a, b, c0); then when resp ≥ respmin, Cpred = c0 + a·Δx + b·Δy; when resp < respmin, Cpred = c0; in an embodiment of the present invention, respmin is taken as 0.1. Specifically, based on the line prediction parameters, sampling centers are deployed along the tangential direction of the line within the target area, and edge points are extracted in the normal neighborhood of each sampling center through gradient directionality scoring. The extracted edge points are then aggregated to form a candidate point set, including: Calculate the two intersection points between the predicted line of the current frame image and the boundary of the target region to obtain an intersection line segment located within the target region; if the length of the intersection line segment is less than the preset minimum length threshold, skip the current frame image and do not extract candidate points; if the length of the intersection line segment is greater than the preset minimum length threshold, set multiple sampling centers at equal intervals from one end to the other on the intersection line segment, and the number of sampling centers is the preset number of tangential sampling points; In an embodiment of the present invention, the endpoints of the intersection line segment between the line prediction parameters (a, b, cpred) and the target region are calculated. If the length of the intersection line segment is less than 20 pixels, the current frame is skipped. Nt sampling centers (xc, yc) are uniformly set on the intersection line segment at equal intervals, for example, α∈[0.05,0.95]. For each sampling center, a point-by-point search is performed along the direction of the preset straight line normal vector within a preset normal search radius, with a step size of a single pixel. For each search position, the gradient horizontal component and gradient vertical component of the search position are obtained from the gradient map of the image through bilinear interpolation. The gradient horizontal component is multiplied by the horizontal component of the normal vector, and the gradient vertical component is multiplied by the vertical component of the normal vector to obtain the gradient normal projection value. In an embodiment of the present invention, for each sampling center, a point-by-point search is performed along the normal vector direction within the symmetrical range [—Hn, Hn], and gradient values are sampled by bilinear interpolation. The gradient normal projection gn is calculated based on the gradient values. Bilinear interpolation includes: Take the lower integer coordinates (x0, y0) of the search position (x, y), where , Given the decimal offsets dx = x - x0 and dy = y - y0, the gradient level component at this search position is obtained by linearly weighting four integer neighboring grid points; where the gradient level component is: The vertical component of the gradient is: ; Wherein, the gradient normal projection is: gn = Gx·a + Gy·b; Where gn is the gradient normal projection, Gx is the gradient horizontal component, Gy is the gradient vertical component, a is the horizontal component of the normal vector, and b is the vertical component of the normal vector. The score is determined based on the preset polarity parameters. When the polarity is bidirectional, the score is the absolute value of the gradient normal projection value; when the polarity is positive, the score is the positive projection value of the gradient normal projection value; when the polarity is negative, the score is the negative projection value of the gradient normal projection. When the score is not lower than the preset gradient projection threshold, the search position is recorded as a candidate point; for all candidate points obtained from each sampling center, sort them from high to low score, take the first preset number of candidate points, and remove candidate points whose normal distance exceeds the sum of the normal search radius and bandwidth margin; summarize the remaining candidate points to form the candidate point set of the current frame image. In an embodiment of the present invention, the preset gradient projection threshold is Tg, and the score is score; when score ≥ Tg, the search position is recorded as a candidate point, and the first k candidate points of each sampling center are selected in descending order of score, and candidate points with normal distances exceeding Hn + ΔH are filtered out, and the remaining candidate points are added to the candidate point set; The method of using a hierarchical random sampling strategy to perform linear fitting on the candidate point set includes: The first-level fitting parameters and the second-level fitting parameters are preset; wherein, the first-level fitting parameters and the second-level fitting parameters both include the number of tangential sampling points, the normal search radius, the gradient projection threshold, the number of candidate points retained by the sampling center, the inlier distance threshold, and the minimum inlier ratio; and all parameters in the first-level fitting parameters except for the minimum inlier ratio are smaller than all parameters in the second-level fitting parameters. In an embodiment of the present invention, the first-level parameters are: number of tangential sampling points Nt = 30, normal search radius Hn = 80 pixels, bandwidth margin ΔH = 6 pixels, gradient projection threshold Tg = 7, maximum number of candidates per point k = 1, interior point distance threshold ε = 2.8 pixels, and minimum interior point ratio 60%; the second-level parameters are: number of tangential sampling points Nt = 36, normal search radius Hn = 140 pixels, bandwidth margin ΔH = 10 pixels, gradient projection threshold Tg = 5.5, maximum number of candidates per point k = 3, interior point distance threshold ε = 5 pixels, and minimum interior point ratio 45%. The first-level fitting parameters are used to perform random sampling consistency line fitting on the candidate point set. If an effective line cannot be obtained due to insufficient candidate points or fitting failure, the system automatically switches to the second-level fitting parameters, uses the second-level fitting parameters to re-extract candidate points and perform random sampling consistency line fitting. During the fitting process, two candidate points are randomly selected within a preset number of iterations to construct a virtual straight line. The number of interior points of each virtual straight line is counted using a preset interior point distance threshold as a screening condition. After the iteration is completed, the virtual straight line with the most interior points is selected. The set of interior points of the virtual straight line is fitted using the least squares method to obtain the normalized straight line parameters. When the maximum number of interior points is lower than the preset minimum number of interior points threshold, the fitting is deemed to have failed. In an embodiment of the present invention, the L2 norm least squares method is used with the objective of minimizing the sum of squared perpendicular distances from interior points to the fitted line: ; Where st represents the constraint, M represents the number of interior points, and (xi,yi) represents the coordinates of the i-th interior point; The solution process involves calculating the mean of the interior point coordinates: ; Construct a decentralized coordinate matrix P, where each row of P is a coordinate matrix. Perform singular value decomposition on P, and take the right singular vector (vx, vy) corresponding to the largest singular value as the unit tangent vector of the line. Let a = -vy, b = vx, and the intercept parameter... We obtain the normalized normal form line parameters that satisfy a² + b² = 1; Specifically, the first angle difference between the fitted line and the initial reference line, and the second angle difference between the fitted line and the line in the previous frame are calculated respectively. Based on the first angle difference and the second angle difference, it is determined whether the fitted line is valid. The line parameters are updated according to the determination result, including: Calculate the absolute value of the difference between the direction angle of the fitted line and the direction angle of the initial reference line, and record it as the first absolute value; subtract the first absolute value from 180 degrees to obtain the first difference value, and take the minimum value between the first difference value and the first absolute value as the first angle difference; Calculate the absolute value of the difference between the direction angle of the fitted line and the direction angle of the line in the previous frame image, and record it as the second absolute value; subtract the second absolute value from 180 degrees to obtain the second difference value, and take the minimum value between the second difference value and the second absolute value as the second angle difference; When the first angle difference does not exceed the first preset angle threshold and the second angle difference does not exceed the second preset angle threshold, the fitting result is received, the straight line parameters of the current frame image are updated to the fitted straight line parameters, and the validity flag of the current frame image is set to valid. When the first angle difference exceeds the first preset angle threshold or the second angle difference exceeds the second preset angle threshold, the line parameter of the previous frame image is used as the output line parameter of the current frame image, and the validity flag of the current frame image is set to invalid. In an embodiment of the present invention, the first preset angle threshold is preferably 20°, and the second preset angle threshold is preferably 12°; the validity flag is set to 1, and the invalidity flag is set to 0. The process involves outputting straight line parameters and validity markers frame by frame, and using the intercept of the valid straight line in the first frame as a reference, extracting the structural normal displacement time history based on the change in the straight line intercept of each frame relative to the reference, including: The effective linear intercept of the first frame is used as the reference intercept; the linear intercept of each frame image is obtained, and the difference between the linear intercept of each frame image and the reference intercept is calculated to obtain the normal displacement value; the scaling factor determined in advance by camera parameters and shooting distance calibration is obtained, and the scaling factor represents the actual physical length corresponding to each pixel; the normal displacement value in pixels is multiplied by the scaling factor to obtain the engineering displacement; the engineering displacement values of all frames are arranged in chronological order and output as the structural normal displacement time history; In an embodiment of the present invention, the image file name, relative time tsec(i), line parameters (a, b, c), line direction angle θ, validity flag, diagnostic information, recognition level, total number of edge candidate points, number of interior points, phase-related horizontal translation Δx, vertical translation Δy, and related peak intensity resp are written to a CSV format output file frame by frame. Taking the effective intercept parameter c0 of the first frame as the reference, the normal displacement of the i-th frame is Δd(i) = c(i) - c0. This value reflects the position change of the baseline along the normal direction, and the unit is pixels. In the construction of large-span steel structure roof lifting, the baseline is usually a near-horizontal structural edge line. At this time, the normal vector is approximately vertical, and Δd(i) is approximately equal to the vertical displacement pixel value of the structure. Multiplying the vertical displacement pixel value by the actual scaling factor λ, the vertical displacement Δdmm(i) of the project can be obtained. In other application scenarios, Δd(i) represents the displacement component of the structure along the straight normal direction.
[0022] Finally, it should be noted that the above descriptions are merely preferred embodiments of the present invention and are not intended to limit the present invention. Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art can still modify the technical solutions described in the foregoing embodiments or make equivalent substitutions for some of the technical features. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the protection scope of the present invention.
Claims
1. A method for continuous identification and displacement monitoring of construction baselines based on image processing, characterized in that: The method includes: Acquire the image sequence continuously captured by the imaging equipment during the construction period, and establish a timeline with the first frame as the zero point of time; On the first frame image, an initial reference line is selected through interactive operation, and a target area covering the entire range of motion of the initial reference line is selected; wherein, the initial reference line is represented by a normalized straight line equation and remains unchanged throughout the entire processing; In the image sequence, phase correlation operation is performed between the target region of the current frame image and the previous frame image to obtain the inter-frame translation estimate and the correlation peak intensity; the correlation peak intensity is judged according to a preset threshold, and the translation estimate is selectively used to compensate the line intercept of the previous frame according to the judgment result to obtain the line prediction parameters of the current frame image. Based on the line prediction parameters, sampling centers are set up along the tangential direction of the line within the target area, and edge points are extracted in the normal neighborhood of each sampling center by gradient directionality scoring. The extracted edge points are then aggregated to form a candidate point set. A hierarchical random sampling strategy is used to fit the candidate point set to a straight line; wherein, the first level uses a precise fitting condition, and when the fitting fails, it switches to the second level to use a robust fitting condition to obtain the fitted straight line of the current frame; Calculate the difference between the fitted line and the initial reference line and the first angle, as well as the difference between the fitted line and the line in the previous frame. Determine whether the fitted line is valid based on the first angle difference and the second angle difference. Update the line parameters based on the determination results. The line parameters and validity markers are output frame by frame, and the structural normal displacement time history is extracted based on the change of the line intercept of each frame relative to the reference, using the intercept of the valid line in the first frame as the reference.
2. The method for continuous identification and displacement monitoring of construction baselines based on image processing according to claim 1, characterized in that, Establishing a timeline with the first frame as the zero point includes: When the image filenames in the image sequence contain timestamp information, the timestamp field in the image filename is parsed to obtain the absolute time corresponding to each frame. Taking the absolute time of the first frame as the zero point, the difference between the absolute time of each of the remaining frames and the absolute time of the first frame is calculated to obtain the relative time of each frame. When the timestamp field in the image filename cannot be parsed, the relative time of each frame is calculated by dividing the frame number by the frame rate. The relative times corresponding to all frames are arranged in order of frame number to obtain the time axis with the first frame as the zero point.
3. The method for continuous identification and displacement monitoring of construction baselines based on image processing according to claim 1, characterized in that, Selecting an initial reference line on the first frame image via interactive operations includes: Two pixels are selected on the first frame image through interactive operation, and the image coordinates of the two pixels are recorded. The initial straight line coefficient and normalization factor are calculated based on the image coordinates of the two pixels. The initial straight line coefficient is divided by the normalization factor to obtain the normalized normalized straight line parameter. The straight line corresponding to the normalized straight line parameter is used as the initial reference line.
4. The method for continuous identification and displacement monitoring of construction baselines based on image processing according to claim 1, characterized in that, The target area that covers the entire range of motion of the initial reference line includes: A reference region is obtained on the first frame image through interactive selection, and the boundary coordinates and size parameters of the reference region at the display resolution are recorded. The current display scaling ratio is obtained, and the boundary coordinates and size parameters are converted to the resolution coordinates of the first frame image according to the display scaling ratio. The converted reference region is cropped to remove the area that exceeds the range of the first frame image. The cropped reference region is the target region.
5. The method for continuous identification and displacement monitoring of construction baselines based on image processing according to claim 1, characterized in that: In an image sequence, performing phase correlation operations between the target region of the current frame image and the previous frame image to obtain the inter-frame translation estimate and correlation peak intensity includes: The target regions of the current frame image and the previous frame image are extracted, and Gaussian smoothing is applied to both target regions respectively. Fourier transform is performed on the two smoothed target regions to obtain their normalized cross-power spectra. Inverse Fourier transform is performed on the cross-power spectra to obtain the phase correlation surface. The peak position of the phase correlation surface corresponds to the translation estimate between frames. The translation estimate includes horizontal translation and vertical translation, and the peak amplitude is the correlation peak intensity. The horizontal translation and vertical translation are truncated to limit the horizontal translation and vertical translation to not exceed a preset upper limit.
6. The method for continuous identification and displacement monitoring of construction baselines based on image processing according to claim 5, characterized in that, The relevant peak intensity is judged based on a preset threshold, and the translation estimate is selectively used to compensate for the line intercept of the previous frame based on the judgment result, to obtain the line prediction parameters of the current frame image, including: Assume the line parameters of the previous frame are known, where the normal vector components of the line in the previous frame are a and b, and the intercept is c0. When the correlation peak intensity is not lower than the preset minimum response threshold, the horizontal translation is multiplied by a, the vertical translation is multiplied by b, and the two are added together and superimposed on c0 to obtain the line prediction intercept of the current frame. When the correlation peak intensity is lower than the minimum response threshold, c0 is directly taken as the line prediction intercept of the current frame. The prediction intercept and the normal vector components (a, b) of the previous frame together constitute the line prediction parameters of the current frame.
7. The method for continuous identification and displacement monitoring of construction baselines based on image processing according to claim 1, characterized in that, Based on the line prediction parameters, sampling centers are deployed along the tangential direction of the line within the target area. Edge points are extracted in the normal neighborhood of each sampling center using gradient directionality scoring. The extracted edge points are then aggregated to form a candidate point set, including: Calculate the two intersection points between the predicted line of the current frame image and the boundary of the target region to obtain an intersection line segment located within the target region; if the length of the intersection line segment is less than the preset minimum length threshold, skip the current frame image and do not extract candidate points; if the length of the intersection line segment is greater than the preset minimum length threshold, set multiple sampling centers at equal intervals from one end to the other on the intersection line segment, and the number of sampling centers is the preset number of tangential sampling points; For each sampling center, a point-by-point search is performed along the direction of the preset straight line normal vector within a preset normal search radius, with a step size of a single pixel. For each search position, the horizontal and vertical components of the gradient at the search position are obtained from the gradient map of the image through bilinear interpolation. The horizontal component of the gradient is multiplied by the horizontal component of the normal vector, and the vertical component of the gradient is multiplied by the vertical component of the normal vector to obtain the gradient normal projection value. The score is determined based on the preset polarity parameters. When the polarity is bidirectional, the score is the absolute value of the gradient normal projection value; when the polarity is positive, the score is the positive projection value of the gradient normal projection value; when the polarity is negative, the score is the negative projection value of the gradient normal projection. When the score is not lower than the preset gradient projection threshold, the search position is recorded as a candidate point; for all candidate points obtained from each sampling center, sort them from high to low score, take the first preset number of candidate points, and remove candidate points whose normal distance exceeds the sum of the normal search radius and bandwidth margin; summarize the remaining candidate points to form the candidate point set of the current frame image.
8. The method for continuous identification and displacement monitoring of construction baselines based on image processing according to claim 1, characterized in that, The method of performing linear fitting on the candidate point set using a hierarchical random sampling strategy includes: The first-level fitting parameters and the second-level fitting parameters are preset; wherein, the first-level fitting parameters and the second-level fitting parameters both include the number of tangential sampling points, the normal search radius, the gradient projection threshold, the number of candidate points retained by the sampling center, the inlier distance threshold, and the minimum inlier ratio; and all parameters in the first-level fitting parameters except for the minimum inlier ratio are smaller than all parameters in the second-level fitting parameters. The first-level fitting parameters are used to perform random sampling consistency line fitting on the candidate point set. If an effective line cannot be obtained due to insufficient candidate points or fitting failure, the system automatically switches to the second-level fitting parameters, uses the second-level fitting parameters to re-extract candidate points and perform random sampling consistency line fitting. During the fitting process, two candidate points are randomly selected within a preset number of iterations to construct a virtual straight line. The number of interior points of each virtual straight line is counted using a preset interior point distance threshold as a screening condition. After the iteration is completed, the virtual straight line with the most interior points is selected, and the set of interior points of the virtual straight line is fitted using the least squares method to obtain the normalized straight line parameters. When the maximum number of interior points is lower than the preset minimum number of interior points threshold, the fitting is deemed to have failed.
9. The method for continuous identification and displacement monitoring of construction baselines based on image processing according to claim 1, characterized in that, Calculate the first angle difference between the fitted line and the initial reference line, and the second angle difference between the fitted line and the line in the previous frame. Based on the first and second angle differences, determine whether the fitted line is valid. Update the line parameters based on the determination results, including: Calculate the absolute value of the difference between the direction angle of the fitted line and the direction angle of the initial reference line, and record it as the first absolute value; subtract the first absolute value from 180 degrees to obtain the first difference value, and take the minimum value between the first difference value and the first absolute value as the first angle difference; Calculate the absolute value of the difference between the direction angle of the fitted line and the direction angle of the line in the previous frame image, and record it as the second absolute value; subtract the second absolute value from 180 degrees to obtain the second difference value, and take the minimum value between the second difference value and the second absolute value as the second angle difference; When the first angle difference does not exceed the first preset angle threshold and the second angle difference does not exceed the second preset angle threshold, the fitting result is received, the straight line parameters of the current frame image are updated to the fitted straight line parameters, and the validity flag of the current frame image is set to valid. When the first angle difference exceeds the first preset angle threshold or the second angle difference exceeds the second preset angle threshold, the line parameter of the previous frame image is used as the output line parameter of the current frame image, and the validity flag of the current frame image is set to invalid.
10. The method for continuous identification and displacement monitoring of construction baselines based on image processing according to claim 1, characterized in that, The line parameters and validity markers are output frame by frame. Using the intercept of the valid line in the first frame as a reference, the structural normal displacement time history is extracted based on the change in the line intercept of each frame relative to the reference, including: The effective linear intercept of the first frame is used as the reference intercept; the linear intercept of each frame image is obtained, and the difference between the linear intercept of each frame image and the reference intercept is calculated to obtain the normal displacement value; the scaling factor determined in advance by camera parameters and shooting distance calibration is obtained, and the scaling factor represents the actual physical length corresponding to each pixel; the normal displacement value in pixels is multiplied by the scaling factor to obtain the engineering displacement; the engineering displacement values of all frames are arranged in chronological order and output as the structural normal displacement time history.