Structural three-dimensional vibration measurement method based on binocular stereo vision
By using a sphere target and white background plate combined with chromatic aberration method and RANSAC algorithm, the influence of ambient light and background interference on three-dimensional vibration measurement is solved, and a high-precision structural three-dimensional vibration measurement is achieved.
Patent Information
- Application Number
- CN202510485838.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-17
- Publication Date
- 2025-07-11
AI Technical Summary
The existing structural three-dimensional vibration measurement technology based on binocular stereo vision has problems such as measurement instability and insufficient accuracy in terms of ambient light changes, background interference and marker design, especially in dynamic scenarios, it is difficult to accurately identify and reconstruct the three-dimensional vibration of the target structure.
The spherical target design and white background plate were combined with the chromatic aberration method and the RANSAC algorithm to perform binocular vision system calibration and image correction. The target area was extracted through the chromatic aberration method and the target center positioning was optimized by RANSAC to realize three-dimensional reconstruction and displacement calculation.
It improves the accuracy and stability of the three-dimensional vibration measurement of the structure, can accurately detect the target center point in complex environments, overcome light changes and background interference, and is suitable for three-dimensional vibration measurement of any surface structure.
Smart Images

Figure BDA0005364100970000031 
Figure BDA0005364100970000051 
Figure BDA0005364100970000061
Abstract
Description
Technical Field
[0001] The present invention relates to the field of measurement, and in particular to a three-dimensional vibration measurement method for structures based on binocular stereo vision. Background Art
[0002] With the rapid development of science and technology, three-dimensional vibration measurement technology plays a crucial role in fields such as structural health monitoring, precision manufacturing, and aerospace. Traditional three-dimensional vibration measurement of structures mostly relies on contact sensors, such as laser rangefinders, grating rangefinders, etc. Although these methods have high measurement accuracy, due to their contact measurement characteristics, they often have the disadvantages of complex installation, high maintenance costs, and inability to meet the requirements of dynamic measurement. In recent years, non-contact three-dimensional measurement technology has developed rapidly, and among them, the measurement technology based on binocular stereo vision has received extensive attention due to its high flexibility, low cost, and strong adaptability. Binocular stereo vision technology uses two cameras to simulate human vision. By obtaining images of the target object from different perspectives with two cameras, it uses parallax information to calculate the three-dimensional geometric information of the object, which is suitable for dynamic scenes, especially for three-dimensional vibration measurement tasks of structures.
[0003] Existing three-dimensional vibration measurement technologies for structures based on binocular stereo vision mainly include: ① Vibration measurement method based on feature points ② Vibration measurement method using artificial markers ③ Vibration measurement method based on active light projection, etc. Among them, the vibration measurement method based on artificial markers is one of the most commonly used binocular vision vibration measurement methods. It enhances the recognizability of target features in images by attaching markers (such as reflective points, QR codes, barcodes, etc.) to the surface of the target object, thereby achieving high-precision vibration measurement. Therefore, it is widely used in fields such as structural health monitoring, industrial robot positioning, and dynamic scene tracking. The existing technical solutions of this method are as follows:
[0004] (1) Marker design: Select a suitable type of artificial marker according to the measurement requirements, such as reflective points, geometric shape markers, QR codes, or barcodes.
[0005] (2) Marker arrangement: Paste or install artificial markers on the surface of the target structure to ensure that the markers have high contrast and detectability, and at the same time, try to avoid mutual occlusion between markers.
[0006] (3) Calibration of the binocular vision system: Install two cameras, adjust the viewing angles so that they can cover the target area simultaneously, and ensure that there is a certain baseline distance between the cameras. Use a calibration board to perform internal and external parameter calibration to obtain the internal parameters (focal length, optical center position, distortion coefficient) and external parameters (rotation and translation relationship between the cameras) of the cameras, providing accurate parameter support for subsequent stereo matching and three-dimensional reconstruction.
[0007] (4) Image acquisition and marker detection: Use binocular cameras to synchronously acquire images from different perspectives, and utilize image processing algorithms to extract the positions of artificial markers in the images.
[0008] (5) Stereo matching and 3D reconstruction: Identify the positions of the same marker in the two images through feature matching algorithms for binocular images (such as SIFT, SURF, or pixel gray-level-based matching methods). Calculate the disparity based on the pixel coordinate differences of the matched marker points in the left and right images. Utilize the principle of binocular stereo vision (based on camera calibration parameters and disparity) to calculate the spatial three-dimensional coordinates of the marker.
[0009] (6) Displacement calculation: Calculate the spatial three-dimensional displacement of the marker based on its spatial three-dimensional coordinates, and obtain the three-dimensional vibration data of the target structure based on this displacement.
[0010] In summary, the method for three-dimensional vibration measurement of structures based on binocular stereo vision has become a research hotspot due to its high precision and high flexibility. Among them, the vibration measurement method based on artificial markers has become one of the most widely used solutions at present due to its significant feature recognition advantages and high-precision measurement capabilities. However, the following problems also exist in this existing technology:
[0011] (1) The lighting conditions of the environment are not constant and are changing all the time. On the one hand, the lighting change directly causes the overall brightness of the image to change. For example, high exposure in a bright environment or low exposure in a dark environment. Feature point extraction algorithms (such as SIFT, SURF, etc.) are sensitive to brightness. In high-brightness or low-brightness areas, the number of extracted feature points decreases. On the other hand, the change in the direction of the environmental light source will change the light and dark distribution on the surface of the object, resulting in a change in the imaging of the target object in the image. For example, the shadow caused by the light source shining from the side. The shadow and light source change affect the shape recognition algorithm, especially having a significant impact on methods based on edge and contour extraction (such as Canny edge detection), resulting in unstable recognition results.
[0012] (2) In dynamic scenarios such as industrial production (such as robot movement or mechanical operating environment) or natural environment, the background may contain a large number of similar features (such as textures, light spots, reflective points, etc.) or interference objects. On the one hand, background interference is easily confused with markers, resulting in misidentification by the system. On the other hand, when the contrast between the marker and the background interference in the image is low, traditional detection methods are difficult to effectively distinguish the target, resulting in the failure of feature extraction and marker recognition, and also affecting the measurement accuracy.
[0013] (3) Traditional two-dimensional markers (such as QR codes, planar barcodes, planar geometric shape markers, etc.) are planar and have high requirements on the surface flatness of the target structure. The recognition effect depends on the camera viewing angle. When the viewing angle deviation between the camera and the marker is large, the imaging of the marker will be deformed due to perspective distortion. Especially in dynamic scenes, the target structure may rotate or tilt. The recognition of two-dimensional markers is significantly affected by the camera viewing angle. The viewing angle deviation may lead to feature extraction and matching failure.
[0014] (4) Since the important basis for ensuring the effect of structural 3D vibration measurement is the accurate detection of markers, and marker detection relies on a series of image processing and image recognition technologies, the imaging quality of markers on the image is particularly important. Therefore, environmental lighting changes, background interference, marker design, etc. will have a key impact on the effect of binocular vision structural 3D vibration measurement, which are the main limiting factors of structural 3D vibration measurement technology based on artificial markers. Summary of the invention
[0015] The purpose of the present invention is to provide a method for measuring three-dimensional vibration of a structure based on binocular stereo vision to solve the above technical problems.
[0016] In order to solve the above technical problems, the present invention adopts the following technical solutions:
[0017] A method for measuring three-dimensional vibration of a structure based on binocular stereo vision comprises the following steps:
[0018] Step (1): Design and installation of spherical target:
[0019] The target is a three-dimensional sphere with a bright color (blue). The surface of the sphere is made of matte material. The target and the structure to be measured are connected by a card sleeve. At the same time, the contact part between the clamping mechanism and the structure to be measured uses a non-slip rubber pad to increase the friction. In addition, in order to remove the interference of other objects in the background during the target recognition process as much as possible, a white background board is placed behind the target so that the target is facing the binocular camera in front of it and is within the field of view of the binocular camera, not at the edge of the field of view.
[0020] Step (2): Calibration and image correction of binocular vision system:
[0021] Carry out binocular camera calibration and image correction. The system's binocular camera calibration includes single-target calibration of the left and right cameras and binocular calibration between the left and right cameras. The single-target calibration of the left and right cameras selects the calibration method based on the homography matrix: Zhang Zhengyou calibration method, to calibrate the system;
[0022] After the individual calibration of the left and right cameras, the internal and external parameters of each camera can be obtained, and then the conversion of coordinate points from the three-dimensional world coordinate system to the pixel coordinate system can be realized, and at the same time, distortion can be removed;
[0023] Perform binocular rectification on the left and right images containing the target. Use the binocular rectification method based on Bouguet in OpenCV. Before rectification, due to the misalignment of the optical centers of the left and right cameras and the difference in viewing angles, the corresponding objects in the left and right images are located at different positions, resulting in differences in the geometric structure of stereo imaging; after rectification, the corresponding pixels in the left and right images are aligned on the horizontal line, making the geometric structures of the left and right images exactly the same.
[0024] Step (3): 3D reconstruction and displacement calculation of the target based on binocular vision:
[0025] Use the color difference method combined with the RANSAC algorithm to detect and center-locate the target object. First, use the detection result of the color difference method to extract the region of interest (ROI) region, and then optimize the center-location of the target according to this region to ensure the positioning accuracy of the center point and achieve an improved effect.
[0026] Preferably, the step (3) further includes:
[0027] Target detection based on the color difference method:
[0028] In a color image, color is represented by the combination of brightness values of three different channels: red (R), green (G), and blue (B); it is known that the color of the target is selected as a brightly colored blue sphere, and the target can be quickly located by decomposing the RGB image channels according to the strong color;
[0029] After channel decomposition, to extract only the blue target ball information, subtract the G channel and the R channel from the B channel. This processing method is called the "color difference method"; reduce the color information of non-blue parts in the image and emphasize the blue component, thereby highlighting the blue feature, and the information highlighting the blue feature in the original image can be obtained; in this solution, the left camera (3 targets) is taken as an example here and hereafter:
[0030] B′ = B - G - R
[0031] Then focus on processing the image with only the B′ channel. Adopt the image binaryzation processing method to convert the target ball area in the image into a bright white area, and other parts into black areas for subsequent image processing and recognition. The image binaryzation processing formula is as follows:
[0032]
[0033] where \(f(x, y)\) is the initial image, \(b(x, y)\) is the binary image, and \(t\) is the pixel threshold;
[0034] After binarization, there are only two gray values (0 and 255) on the image. However, there are still many noise points and stray pixels in the image, which will affect subsequent processing and analysis. Therefore, a mean filtering operation is used to remove these noises, improve the image quality, and make the image smoother. After binarization and filtering image preprocessing, edge detection for the target ball can be performed. A contour extraction method based on pixel-by-pixel comparison is adopted, specifically using the findcounters interface based on OpenCV to determine the attribution of each pixel in the image, that is, the target detection based on the color difference method is completed, and finally the coordinates of all contours are obtained, laying a foundation for the subsequent optimization of the target center positioning based on RANSAC.
[0035] Preferably, the step (3) further includes: optimization of the target center positioning based on RANSAC:
[0036] Use the calculation result of the color difference method for "rough positioning", intercept the ROI region image on the image with the calculation result of the color difference method as the center. This image contains the target ball and shadows. Perform contour detection on this ROI region. It can be seen that the contour is irregular due to the influence of shadows. Then, the Random Sample Consensus (RANSAC) algorithm is used for the optimization processing of the target center positioning.
[0037] Finally, through camera calibration, target detection, and three-dimensional reconstruction, the three-dimensional coordinate information of the target under each frame of the camera can be obtained, including the coordinate information of the x, y, and z axes. Then, the displacement of the target can be calculated according to actual requirements (such as according to the image acquisition timing sequence), and further the three-dimensional vibration information of the measured structure can be obtained.
[0038] The beneficial effects of the present invention are:
[0039] (1) The innovative use of a spherical target can well meet the target detection and center point positioning in the case of motion, ensuring the accuracy of the three-dimensional vibration measurement of the structure. In addition, the white background board can better overcome the influence of background interference on target detection, and the spherical target can be applied to any surface or scene, without the need for flat pasting, and there are no special requirements for the surface state of the measured structure.
[0040] (2) An innovative three-dimensional vibration measurement algorithm combining the color difference method and RANSAC is proposed. This algorithm uses RANSAC to optimize the target detection result of the color difference method, can well overcome the influence of changes in environmental illumination conditions on the target center point positioning, obtain accurate three-dimensional reconstruction results of the target, and ensure the accuracy of the three-dimensional vibration measurement of the structure. Detailed implementation mode
[0041] In order to make the technical means, creative features, objectives and effects achieved by the present invention easy to understand, the present invention is further described below in conjunction with specific embodiments, but the following embodiments are only preferred embodiments of the present invention, not all. Based on the embodiments in the implementation mode, other embodiments obtained by those skilled in the art without creative work all belong to the protection scope of the present invention. The experimental methods in the following embodiments, unless otherwise specified, are conventional methods, and the materials, reagents, etc. used in the following embodiments, unless otherwise specified, can all be obtained from commercial channels.
[0042] This technical solution is based on binocular vision technology to measure the three-dimensional vibration information of the structure. The binocular vision system uses a high-precision industrial camera, and the camera's maximum acquisition frequency can reach 40 frames per second. The highest measurement accuracy of this technical solution can be better than 1mm. The three-dimensional vibration information of the structure is essentially the displacement information of the structure. This solution arranges a binocular vision measurement system, places a spherical target on the structure to be measured, realizes three-dimensional reconstruction of the target based on binocular vision technology, and solves the three-dimensional displacement of the target, thereby replacing the three-dimensional vibration information of the structure with the displacement of the target:
[0043] (1) Design and installation of spherical targets
[0044] Since the core idea of this technical solution for the three-dimensional vibration measurement of structures is to use the displacement of the center point of the spherical target to be equivalent to the three-dimensional vibration of the structure, the design and layout of the target becomes the focus. In order to overcome the influence of factors such as changes in lighting conditions and background interference, this technical solution adopts the following target design and layout method:
[0045] It is known that the target structure and the target are in a moving state during measurement, and the position and angle of the target relative to the camera are constantly changing. In order to facilitate accurate identification and positioning of the target, the target is a three-dimensional sphere with a bright color (blue). Regardless of the camera's viewing angle, the design can ensure that the target presents a consistent geometric shape, and the shape of the spherical target is regular. Even in a complex dynamic environment, its shape characteristics are still easy to detect, which is conducive to the identification and positioning of the target. Furthermore, the surface of the sphere is a matte material to reduce the impact of changes in the direction of illumination and improve the robustness of recognition. Secondly, in order to ensure the relative stillness between the target and the object being measured, the target and the structure being measured are connected using a ferrule type, and the contact part of the clamping mechanism with the structure being measured uses a non-slip rubber pad to increase the friction. In addition, in order to remove the interference of other objects in the background during target recognition as much as possible, a white background board is placed behind the target. Make the target face the binocular camera in front of it, and both are within the field of view of the binocular camera, not at the edge of the field of view.
[0046] (2) Calibration and image correction of binocular vision system
[0047] To ensure that the system can effectively perform coordinate system conversion and remove distortion, calibration of the binocular cameras and image correction are required. The calibration of the binocular cameras in the system includes the individual calibration of the left and right cameras and the stereo calibration between the left and right cameras. For the individual calibration of the left and right cameras in this solution, the calibration method based on the homography matrix: Zhang Zhengyou calibration method, is selected to calibrate the system.
[0048] After the individual calibration of the left and right cameras, the internal and external parameters of each camera can be obtained, and thus the conversion of coordinate points from the three-dimensional world coordinate system to the pixel coordinate system can be achieved, and distortion can be removed at the same time. In the stereo matching algorithm based on binocular vision, the matching process is usually calculated based on the pixel distance in the horizontal direction of the left and right images. Therefore, it is also necessary to ensure that the corrected camera views are aligned in the horizontal direction, which means that the rotation and translation relationships between the left and right cameras need to be obtained.
[0049] For binocular correction of the left and right images containing the target, the binocular correction method based on Bouguet in OpenCV is adopted in this solution, which is a classic camera correction method. Before correction, due to the misalignment of the optical centers of the left and right cameras and the difference in viewing angles, the corresponding objects in the left and right images are located at different positions, resulting in differences in the geometric structure of stereo imaging. After correction, the corresponding pixels in the left and right images are aligned on the horizontal line, making the geometric structures of the left and right images completely consistent, thereby eliminating the radial distortion and tangential distortion introduced by the camera lens, ensuring the geometric accuracy and shape authenticity of the images, and improving the matching quality of the images.
[0050] (3) 3D reconstruction and displacement calculation of the target based on binocular vision
[0051] The core idea of this solution for the 3D reconstruction of the target is to use the color difference method combined with the RANSAC algorithm to detect and center-locate the target object. First, the region of interest (ROI) region is extracted using the detection result of the color difference method, and then the center-location of the target is optimized based on this region to ensure the positioning accuracy of the center point and achieve an improved effect.
[0052] ① Target detection based on the color difference method
[0053] In a color image, color is represented by the combination of brightness values of three different channels: red (R), green (G), and blue (B). Given that the color of the target is selected as a brightly colored blue sphere, the target can be quickly located by decomposing the RGB image channels according to the strong color. RGB channel decomposition is a common image processing operation used to separate the information of each color channel for further processing or analysis.
[0054] After channel decomposition, to separately extract the information of the blue target ball, the B channel is subtracted from the G channel and the R channel. This processing method is called the "chromatic aberration method". This method actually reduces the color information of non-blue parts in the image, emphasizes the blue component, and thus highlights the blue feature, and the information with prominent blue features in the original image can be obtained. In this solution, the left camera (3 targets) is taken as an example here and in the following text.
[0055] B′ = B - G - R
[0056] Next, focus on processing the image with only the B′ channel. Using the method of image binarization, the target ball area in the image is converted into a bright white area, and other parts are converted into black areas to facilitate subsequent image processing and recognition. The image binarization processing formula is as follows:
[0057]
[0058] Where f(x, y) is the original image, b(x, y) is the binary image, and t is the pixel threshold.
[0059] After binarization processing, there are only two gray values (0 and 255) in the image. However, there are still many noise points and stray pixels in the image, which will affect subsequent processing and analysis. Therefore, it is necessary to consider using mean filtering operation to remove these noises, improve the image quality, and make the image smoother. After image preprocessing such as binarization and filtering, edge detection for the target ball can be carried out. This solution adopts a contour extraction method based on the per-pixel comparison method, and specifically, the findcounters interface based on OpenCV can be used to determine the attribution of each pixel in the image, that is, the target detection based on the chromatic aberration method is completed, and the coordinates of all contours are finally obtained, laying a foundation for the subsequent optimization of the target center positioning based on RANSAC.
[0060] ② Optimization of target center positioning based on RANSAC
[0061] Since the center point coordinates of the target on the two-dimensional plane of the image serve as the pixel coordinates for parallax calculation and three-dimensional reconstruction, the accurate calculation of pixel coordinates directly affects the accuracy of the three-dimensional vibration measurement algorithm for the structure in this solution. Although the color difference method can better complete the work of target detection, in the actual application process, factors such as image noise and ambient light conditions may have a certain impact on this method, resulting in inaccurate target coordinate positioning and thus affecting the measurement accuracy. Therefore, this solution considers further improving the target detection results based on the color difference method. The implementation idea is as follows: Use the calculation results of the color difference method for "coarse positioning", intercept the ROI region image on the image with the calculation results of the color difference method as the center. This image contains the target ball and the shadow. Perform contour detection on this ROI region. It can be seen that the contour presents an irregular shape due to the influence of the shadow. Then, use the Random Sample Consensus (RANSAC) algorithm to optimize the target center positioning. RANSAC is a method commonly used to handle outliers in data and can be used to handle the noise and outliers in images. Taking the target center positioning in this article as an example, it is essentially a circle fitting problem. Using the RANSAC algorithm can still fit an accurate circle from the dataset containing noise and interference and obtain accurate center coordinate results.
[0062] Finally, through camera calibration, target detection, and three-dimensional reconstruction, the three-dimensional coordinate information of the target in each frame of the camera can be obtained, including the coordinate information of the x, y, and z axes. Then, the displacement of the target can be calculated according to actual requirements (such as according to the image acquisition time sequence), and further the three-dimensional vibration information of the measured structure can be obtained.
[0063] To quantitatively analyze and verify the improvement effect of the target center positioning optimization in this solution, experimental comparative analysis is carried out for the two methods before and after the improvement. Specifically, the displacements of the target in the three-dimensional space are measured using the two methods respectively. The displacement is obtained by calculating the Euclidean distance of the three-dimensional coordinates of the target in the front and rear two frames of images, and then the error e is calculated with the actual result of the grating ruler rangefinder. In the process of this comparative experiment, a grating ruler is used to verify the improvement effect of the target center positioning optimization. The target is fixed on the ruler to ensure that there is no relative movement between the two. In this way, the measured value of the grating ruler represents the true value L0(X0, Y0, Z0) of the displacement of the target in the three-dimensional space. The accuracy of the grating ruler is 0.01 mm, and the measuring range is 20 cm. The specific experimental process is as follows:
[0064] (1) Fix the target on the grating ruler and zero the grating ruler;
[0065] (2) The binocular camera collects the images of the target before displacement and calculates the three-dimensional coordinates using the two methods respectively;
[0066] (3) Move the target;
[0067] (4) The binocular camera captures the images after the target displacement, and calculates the three-dimensional coordinates by using two methods respectively;
[0068] (5) Calculate the Euclidean distance L(X, Y, Z) of the three-dimensional coordinates before and after the movement respectively;
[0069] (6) Calculate the measurement error ei with the true value respectively;
[0070] (7) Repeat the above operations for multiple experiments;
[0071] (8) Calculate the average measurement errors of the two methods respectively for effect comparison.
[0072] After multiple measurement experiments, the data are recorded in Table 1 and Table 2. Through statistics, it can be known that the average absolute error of only using the color difference method for measurement reaches 1.27 mm, while the average absolute error of the improved algorithm is 0.38 mm, which can show that the effect of the improved three-dimensional vibration measurement algorithm of the structure is better and the positioning optimization effect is achieved.
[0073] Table 1 Measurement by the algorithm before improvement
[0074]
[0075]
[0076] Table 2 Measurement by the improved algorithm
[0077]
[0078] The above shows and describes the basic principles, main features and advantages of the present invention. Those skilled in the art should understand that the present invention is not limited by the above embodiments. The above embodiments and the descriptions in the specification are only preferred examples of the present invention and are not used to limit the present invention. Without departing from the spirit and scope of the present invention, the present invention will have various changes and improvements, and these changes and improvements all fall within the scope of the present invention claimed. The scope of the present invention claimed is defined by the appended claims and their equivalents.
Claims
1. A three-dimensional vibration measurement method for structures based on binocular stereo vision, characterized in that: The steps include: Step (1): Design and installation of spherical target: The target is a three-dimensional sphere with a bright color (blue). The surface of the sphere is made of matte material. The target and the structure to be measured are connected by a card sleeve. At the same time, the contact part between the clamping mechanism and the structure to be measured uses a non-slip rubber pad to increase the friction. In addition, in order to remove the interference of other objects in the background during the target recognition process as much as possible, a white background board is placed behind the target so that the target is facing the binocular camera in front of it and is within the field of view of the binocular camera, not at the edge of the field of view. Step (2): Calibration and image correction of binocular vision system: Carry out binocular camera calibration and image correction. The system's binocular camera calibration includes single-target calibration of the left and right cameras and binocular calibration between the left and right cameras. The single-target calibration of the left and right cameras selects the calibration method based on the homography matrix: Zhang Zhengyou calibration method, to calibrate the system; After the left and right cameras are calibrated with their own single targets, the internal and external parameters of each camera can be obtained, and then the coordinate points can be converted from the three-dimensional world coordinate system to the pixel coordinate system, and the distortion can be removed at the same time; Binocular correction is performed on the left and right images containing the target, using the Bouguet-based binocular correction method in OpenCV. Before correction, due to the misalignment of the optical centers of the left and right cameras and the difference in viewing angles, the corresponding objects in the left and right images are located in different positions, resulting in differences in the geometric structure of the stereoscopic imaging; after correction, the corresponding pixels in the left and right images are aligned on the horizontal line, making the geometric structures of the left and right images completely consistent. Step (3): 3D reconstruction and displacement calculation of the target based on binocular vision: The color difference method combined with the RANSAC algorithm is used to detect and locate the target object. First, the region of interest (ROI) area is extracted using the color difference method detection results, and then the target center positioning is optimized based on this area to ensure the positioning accuracy of the center point and achieve improved results.
2. The three-dimensional vibration measurement method of a structure based on binocular stereo vision according to claim 1, wherein: The step (3) further comprises: Target detection based on color difference method: In color images, color is represented by the combination of brightness values of three different channels: red (R), green (G), and blue (B). The color of the known target is selected as a bright blue sphere. The RGB image channel decomposition can be used to quickly locate the target based on the strong color. After channel decomposition, in order to extract the blue target ball information alone, the B channel is subtracted from the G channel and the R channel. This processing method is called "color difference method". In the image, the color information of the non-blue part is reduced, the blue component is emphasized, and the blue feature is highlighted. The information of the prominent blue feature in the original image can be obtained. This scheme takes the left camera (3 targets) as an example here and in the following text: B′=BGR Next, we focus on processing the image with only the B′ channel. We use the image binarization method to convert the target ball area in the image into a bright white area, and the other parts into a black area, so as to facilitate subsequent image processing and recognition. The image binarization processing formula is as follows: where f(x, y) is the original image, b(x, y) is the binary image, and t is the pixel threshold; After binarization, there are only two gray values (0 and 255) on the image. However, there are still many noise points and stray pixels in the image, which will affect subsequent processing and analysis. Therefore, mean filtering operation is used to remove these noises, improve the image quality, and make the image smoother. After binarization and filtering image preprocessing, edge detection for the target ball can be carried out. A contour extraction method based on pixel-by-pixel comparison is adopted, specifically using the findcounters interface based on OpenCV to determine the attribution of each pixel in the image, that is, the target detection based on the color difference method is completed, and finally the coordinates of all contours are obtained, laying a foundation for the subsequent optimization of the target center positioning based on RANSAC.
3. The three-dimensional vibration measurement method of a structure based on binocular stereo vision according to claim 2, characterized in that: Step (3) further includes: optimization of the target center positioning based on RANSAC: Use the calculation result of the color difference method for "coarse positioning". An ROI region image is intercepted on the image with the calculation result of the color difference method as the center. This image contains the target ball and shadows. Contour detection is carried out for this ROI region. It can be seen that the contour is irregular due to the influence of shadows. Then, the Random Sample Consensus (RANSAC) algorithm is used for the optimization processing of the target center positioning; Finally, through camera calibration, target detection and three-dimensional reconstruction, the three-dimensional coordinate information of the target under each frame of the camera can be obtained, including the coordinate information of the x, y, and z axes. Then, the displacement of the target can be calculated according to actual requirements (such as according to the image acquisition time sequence), and further the three-dimensional vibration information of the measured structure can be obtained.