A non-contact binocular stereo vision displacement measurement method
By using two cameras for pixel matching and centrometal tracking in the binocular stereoscopic visual displacement measurement method, the problem of inefficiency in measuring multi-directional displacement in the prior art is solved, and faster and more accurate displacement measurement is achieved.
Patent Information
- Application Number
- CN202210762070.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-06-29
- Publication Date
- 2025-06-13
- Estimated Expiration
- 2042-06-29
AI Technical Summary
When measuring multi-directional displacement, the prior art cannot directly obtain depth information from the image, resulting in an increase in the calculation amount and low measurement efficiency.
The non-contact binocular stereoscopic visual displacement measurement method is used to obtain the corrected original image through two cameras for pixel matching, thereby performing centro-shaped tracking and obtaining displacement.
It improves the calculation speed, meets the real-time requirements of industrial inspection, is easy to operate, and can more accurately measure multi-directional displacement.
Smart Images

Figure CN115170499B_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the field of image processing for dynamic displacement monitoring, and particularly relates to a non-contact binocular stereo vision displacement measurement method. Background Art
[0002] Optical measurement methods, with their characteristics of high precision, non-contact, strong anti-interference ability, simple optical path and full-field measurement, have become an important part of modern measurement technologies. To achieve high precision, most methods require calibration of both the internal and external parameters of the camera. For a dual-camera three-dimensional DIC system, the imaging model of the camera relates the position of the surface points of the measured object in three-dimensional space to their positions in the camera image. Only by relying on the imaging model of the camera can three-dimensional space coordinates be established based on the positions in the image, that is, the relative position and internal parameters between the two cameras need to be calibrated simultaneously to determine the position of the measured object in space, and then full-field measurement can be achieved. Camera calibration refers to the process of obtaining the parameters of the relevant imaging model, which requires a large amount of computation. The calibration error directly determines the final measurement error, and this error cannot be overcome by improving the image matching algorithm. Using the centroid algorithm can avoid complex calibration calculations, avoid errors caused by improper calibration, reduce waste of manpower and material resources, simplify the measurement steps, and provide convenience. Among them, the image displacement measurement technology based on a single camera is widely used because of its simple equipment and convenient use. However, it is almost only applicable to measuring displacements in a plane. When it comes to measuring displacements in multiple directions, since it cannot directly obtain depth information from the image, the amount of computation increases significantly, and the measurement efficiency is low. Summary of the Invention
[0003] The purpose of the present invention is to provide a non-contact binocular stereo vision displacement measurement method. Two cameras are used. By performing pixel matching on the corrected original images of the two cameras, centroid tracking is carried out to obtain the displacement, with a faster calculation speed, better meeting the real-time requirements of industrial inspection, and being easy to operate.
[0004] To solve the above technical problems, the technical solution of the present invention is: a non-contact binocular stereo vision displacement measurement method, including the following steps:
[0005] Set two cameras in the surrounding area of the target to be measured. The installation height of the cameras is higher than the height of the plane where the target to be measured is located, and record the installation height of the cameras at this time;
[0006] Obtain the motion video of the target to be measured through the cameras, and record the actual size of the image boundary at the installation height of the cameras at this time;
[0007] The moving video of the target to be measured is frame-saved to obtain the original images, and the original images are successively denoised, color-extracted, a grayscale threshold is set and binaryzation processing is performed to obtain a binary segmentation map with connected regions and unconnected regions;
[0008] The number of pixel points of each binary segmentation map is successively obtained in chronological order and according to the preset importance degree, and the conversion coefficient between the pixel size and the actual size is calculated by combining the set height of the camera and the actual size of the captured image boundary; wherein the conversion coefficient is calculated according to the total number of pixels of the first frame of picture and the actual distance;
[0009] The centroid coordinates of the connected regions in the binary segmentation map are obtained and tracked in real time;
[0010] A time step is set, and for each frame of binary segmentation map, the centroid coordinates of the connected regions are compared and converted according to the conversion coefficient to calculate the horizontal displacement and vertical displacement of the target to be measured in each frame of binary segmentation map, and the horizontal and vertical displacement time history curves of the target to be measured at the current duration are plotted.
[0011] It further includes the following steps: according to the horizontal and vertical displacement time history curves of the target to be measured, comparing with the centroid coordinates of the first frame of picture to obtain the total displacement value of the target to be measured, and obtaining the motion law of the target to be measured.
[0012] Based on the MATLAB platform, the binary segmentation map and the centroid coordinate calculation are obtained.
[0013] The parameters of the two cameras are the same and the set distance is fixed.
[0014] It also provides a computer device, including a memory, a processor, and a computer program stored on the memory and executable on the processor, and when the processor executes the computer program, the steps of the method as described in any one of the above are implemented.
[0015] It also provides a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, the steps of the method as described in any one of the above are implemented.
[0016] Compared with the prior art, the beneficial effects of the present invention are:
[0017] The present invention uses two cameras, and through pixel matching of the corrected original images of the two cameras, centroid tracking is performed to obtain displacement, the calculation speed is faster, it can better meet the real-time requirements of industrial detection, and the operation is simple. BRIEF DESCRIPTION OF THE DRAWINGS
[0018] Figure 1 It is a schematic flowchart of an embodiment of the present invention. DETAILED DESCRIPTION OF THE EMBODIMENTS
[0019] In order to make the objectives, technical solutions and advantages of the present invention more clear and understandable, the present invention will be further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not used to limit the present invention. In addition, the technical features involved in the various embodiments of the present invention described below can be combined with each other as long as they do not conflict with each other.
[0020] In the present invention, two cameras are respectively arranged on the probe of the measuring device. These two cameras have the same parameters, are at a certain angle to each other and the distance is fixed. During measurement, the probe is placed in a suitable position and fixed, and the height of the camera at this time is recorded. Then, the camera is adjusted to be accurately focused, and the entire process of the movement of the target to be measured is recorded respectively, and the actual size of the boundary of the image taken at this height is recorded. The obtained video file is imported into the interactive user interface in MATLAB and saved frame by frame. To ensure the accuracy of the obtained displacement measurement value, MATLAB needs to preprocess the collected image first, and process the image into a binary segmentation map with connected regions (foreground) and non-connected regions (background) to facilitate obtaining the characteristic attributes at specific positions. The pictures are processed according to the time sequence and importance. For the first frame image, first, the number of pixel points contained in the entire picture needs to be obtained, and the pixel-actual conversion coefficient is obtained by combining the actual height of the imaging device and the actual size of the shot. At the same time, the size of the bounding box of this area, that is, the size of the smallest rectangle containing this area, also needs to be obtained. After the processing of the first frame image is completed, other key frames are processed; after all the picture files are processed frame by frame, according to the centroid algorithm, the centroid pixel coordinates of the connected region of the picture are obtained, and the centroid coordinates are tracked in real time. Set the time step, and according to the obtained actual conversion relationship, convert the pixel coordinates into horizontal and vertical displacement values, and draw the horizontal and vertical displacement time history curves at the current time. Compare with the initial centroid pixel coordinates of the first frame image and perform mathematical conversion to obtain the displacements in the two directions of the target movement, and the total displacement value can be further obtained according to the mathematical relationship, so as to know the movement law of the measured target.
[0021] First, embed two micro cameras into the pen-type probe at an appropriate distance and at a certain angle to each other, fix the imaging height, record the values, start shooting videos while moving the pen-type probe above the object to be measured, and upload the two obtained experimental videos to the specified folder in MATLAB for storage. Call out the written user interface, perform frame-by-frame processing on the videos, and store the frame-by-frame pictures obtained from the two videos in their respective folders. Then, preprocess the pictures in sequence to reduce the noise in the pictures, reduce interference, perform corresponding color extraction according to the measured target, use image enhancement based on gray-level transformation to make the image boundaries more obvious, strengthen the features, and then generate a certain threshold according to the pictures, and process the images into a foreground connected region with low gray level and a background unconnected region with high gray level. Process the frame-by-frame images of the two videos in sequence according to this operation. Obtain the conversion coefficient by comparing the total number of pixels of the first-frame picture with the actual distance. After processing, perform pixel matching on the corresponding images of the two videos and then calculate their centroid coordinates, draw their horizontal and vertical displacement curves, and obtain the displacement by calculating the coordinates of the first frame and the last frame.
[0022] Optical measurement methods, with their characteristics of high precision, non-contact, strong anti-interference ability, simple optical path, and full-field measurement, have become an important part of modern measurement technologies. To achieve the characteristic of high precision, most methods need to calibrate the inside and outside of the camera. For a dual-camera three-dimensional DIC system, the imaging model of the camera relates the position of the surface points of the measured object in three-dimensional space to their positions in the camera image. Only by relying on the imaging model of the camera can three-dimensional space coordinates be established through the positions in the image, that is, the relative position and internal parameters between the two cameras need to be calibrated simultaneously to determine the position of the measured object in space, and then full-field measurement can be achieved. Camera calibration refers to the process of obtaining the parameters of the relevant imaging model, which requires a large amount of computation. The calibration error directly determines the final measurement error, and this kind of error cannot be overcome by means of improving the image matching algorithm. Using the centroid algorithm can avoid complex calibration calculations, avoid errors caused by improper calibration, reduce the waste of manpower and material resources, simplify the measurement steps, and provide convenience. Among them, the image displacement measurement technology based on a single camera is widely used because of its simple equipment and convenient use, but it is almost only applicable to measuring displacements in a plane. When it comes to measuring displacements in multiple directions, because it cannot directly obtain depth information from the image, the amount of computation increases significantly, and the measurement efficiency is low. In contrast, in this design, because two cameras are used, pixel matching is performed on the corrected original images of the two cameras, so as to perform centroid tracking, obtain displacements, with a faster calculation speed, better meeting the real-time requirements of industrial inspection, and the operation is simple.
[0023] Those skilled in the art can easily understand that the above are only the preferred embodiments of the present invention and are not intended to limit the present invention. Any modifications, equivalent replacements, and improvements made within the spirit and principles of the present invention shall be included within the protection scope of the present invention.
Claims
1. A non-contact binocular stereo vision displacement measurement method, characterized in that, it includes the following steps: Set two cameras in the surrounding area of the target to be measured. The installation height of the cameras is higher than the height of the plane where the target to be measured is located, and record the installation height of the cameras at this time; Obtain the motion video of the target to be measured through the cameras, and record the actual size of the image boundary at the installation height of the cameras at this time; Save the motion video of the target to be measured frame by frame to obtain the original images, and perform denoising, color extraction, setting the gray threshold and binary processing on the original images in sequence to obtain a binary segmentation map with connected regions and non-connected regions; Obtain the number of pixel points of each binary segmentation map in chronological order and according to the preset importance degree, and calculate the conversion coefficient between the pixel size and the actual size in combination with the installation height of the cameras and the actual size of the image boundary; The conversion coefficient is calculated based on the total number of pixels of the first frame of the picture and the actual distance; Obtain the centroid coordinates of the connected regions in the binary segmentation map and perform real-time tracking on them; Set the time step, and calculate the horizontal displacement and vertical displacement of the target to be measured in each binary segmentation map according to the conversion coefficient comparison for the centroid coordinates of the connected regions in each frame of the binary segmentation map in sequence, and draw the horizontal and vertical displacement time history curves of the target to be measured at the current time duration.
2. A non-contact binocular stereo vision displacement measurement method according to claim 1, characterized in that, it further includes the following steps: According to the horizontal and vertical displacement time history curves of the target to be measured, compare the centroid coordinates of the first frame of the picture to obtain the total displacement value of the target to be measured, and obtain the motion law of the target to be measured.
3. A non-contact binocular stereo vision displacement measurement method according to claim 1, characterized in that, Obtain the binary segmentation map and calculate the centroid coordinates based on the MATLAB platform.
4. A non-contact binocular stereo vision displacement measurement method according to claim 1, characterized in that, The parameters of the two cameras are the same and the set distance is fixed.
5. A computer device, including a memory, a processor, and a computer program stored on the memory and executable on the processor, characterized in that, when the processor executes the computer program, it implements the steps of the method according to any one of claims 1-4.
6. A computer-readable storage medium, on which a computer program is stored, characterized in that, when the computer program is executed by the processor, it implements the steps of the method according to any one of claims 1-4.