A surface structured light three-dimensional measurement method and system based on adaptive partition projection
By combining adaptive partition projection and graph coloring algorithm, the error problem caused by multiple reflections in surface structured light 3D measurement is solved, and high-precision and efficient 3D measurement effect is achieved.
Patent Information
- Application Number
- CN202410738975.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-07
- Publication Date
- 2025-09-05
- Estimated Expiration
- 2044-06-07
AI Technical Summary
Existing three-dimensional measurement technology based on surface structured light has problems with large phase calculation errors and three-dimensional calculation errors when processing multiple reflection areas of industrial metal parts. Existing methods are difficult to effectively solve these problems, and the operations are cumbersome or highly dependent.
Adopting the adaptive partition projection method, by establishing the mutual reflection surface light path model and utilizing the interactive operation of the projector and camera, reflection discrimination and adaptive partitioning are performed, and the partition projection is performed in combination with the graph coloring algorithm to obtain high-precision phase maps and three-dimensional point cloud data.
It achieves high-precision three-dimensional measurement on mutually reflective surfaces, improves measurement speed and accuracy, reduces errors, and simplifies the operation process.
Smart Images

Figure CN118746261B_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the field of three-dimensional measurement, and more specifically, relates to a surface structured light three-dimensional measurement method and system based on adaptive partition projection. Background Art
[0002] Currently, 3D measurement technology based on surface structured light has been widely used in the field of industrial part measurement due to its advantages of fast measurement speed and large data volume. However, industrial metal parts often have complex surface topography and multiple reflection areas. This phenomenon causes multiple reflections, which may lead to interference between sinusoidal structured light fringes in the image, resulting in large phase and 3D calculation errors.
[0003] To address this problem, the existing solutions mainly include the following: surface powder spraying 3D reconstruction method; complex light suppression method based on high-frequency projection; direct illumination matching method based on epipolar constraints; and regional projection method based on adaptive surface segmentation. Among them, the surface powder spraying 3D reconstruction method is highly dependent and cumbersome to operate. Some workpieces do not have the conditions for powder spraying, and the powder will affect the reconstruction accuracy. The complex light suppression method based on high-frequency projection proposes a solution to suppress reflected light based on the ideal assumption of direct illumination or complex illumination, which is difficult to cope with various complex situations in actual 3D reconstruction. The direct illumination matching method based on epipolar constraints relies on the non-epiped dominant assumption, that is, the light propagating in the epipolar plane only contributes to direct illumination, but not to reflected illumination, and cannot solve the situation where a large amount of reflected light exists in the epipolar plane. The regional projection method based on adaptive surface segmentation assumes that there is only secondary reflected light between different surfaces. It is difficult to solve the errors caused by multiple reflected light and requires 3D model data of the workpiece to be measured, which is highly dependent.
[0004] Therefore, a three-dimensional measurement technology for spray-free coating is needed, which has simpler equipment requirements, better adaptability and higher accuracy, so that the measurement speed of the interreflective workpiece surface is fast and the measurement accuracy is high. Summary of the Invention
[0005] In response to the above-mentioned defects or improvement needs of the prior art, the present invention provides a surface structured light three-dimensional measurement method and system based on adaptive partition projection, thereby solving the problems of low measurement efficiency and low measurement accuracy caused by the inaccurate and imprecise partitioning of the existing adaptive surface segmentation regional projection method and the difficulty in solving the errors caused by multiple reflected light.
[0006] To achieve the above objectives, according to a first aspect of the present invention, a surface structured light three-dimensional measurement method based on adaptive partition projection is provided, comprising:
[0007] S1, obtaining an image of the workpiece to be measured captured by the left camera and / or the right camera when the projector projects the image to be projected onto the surface of the workpiece to be measured;
[0008] S2, clear the pixel block pair set C, determine the target pixel block of the kth pixel point of the left camera and / or the right camera according to the image of the workpiece to be measured, and clear the pixel block set B k , and use the same division method to divide each target pixel block into multiple sub-pixel blocks and add B k , add B without duplication k The sub-pixel blocks in the total set of sub-pixel blocks B are converted into k The pixel block pairs consisting of any two sub-blocks in are added to the total set of pixel block pairs C without duplication; k = 1, 2, ..., N, where N is the total number of pixels of the left camera and / or the right camera;
[0009] The target pixel block of the k-th pixel point is the pixel block in the first target list and B k The target first list is a list corresponding to the projected image that makes the gray value of the k-th pixel point higher than the gray value threshold among the multiple first lists obtained in the previous iteration;
[0010] S3: Determine whether the size of each pixel block in B is less than a threshold. If so, output B and C and proceed to S4. Otherwise, use the pixel blocks in B as nodes and the pixel block pairs in C as edges to construct a graph structure and use a graph coloring algorithm to solve the problem to obtain multiple first lists. Turn on the pixel points of the corresponding areas of all pixel blocks in each first list in the full-size solid color image of the projector and turn off the other pixel points to obtain the images corresponding to each first list. Use the images corresponding to each first list as new images to be projected and return to S1 for loop iteration.
[0011] In the first iteration, the image to be projected is the full-size pure color image of the projector, B k The pixel blocks in the first list only include one full-size solid color image of the projector;
[0012] S4, using the pixel blocks in B output by S3 as nodes and the pixel block pairs in C output by S3 as edges, constructs a graph structure and applies a graph coloring algorithm to solve it to obtain multiple second lists, turns on the pixel points of the corresponding areas of all pixel blocks in each second list in the full-size structured light image of the projector, and turns off the other pixel points, to obtain the images corresponding to each second list, and uses them as the images to be projected onto the surface of the workpiece to be measured, and obtains the images of the workpiece to be measured simultaneously captured by the left and right cameras, calculates the phase maps and performs matching, reconstructs the three-dimensional point cloud of the workpiece to be measured, and fuses all the reconstructed three-dimensional point clouds to obtain the overall three-dimensional point cloud of the workpiece to be measured.
[0013] According to a second aspect of the present invention, a surface structured light 3D measurement system based on adaptive partitioned projection is provided, comprising: a projector, left and right cameras, and a computer, wherein the projector is disposed between the left and right cameras, and the optical axes of the left and right cameras are symmetrical with respect to the optical axis of the projector, and wherein the computer is configured to execute the surface structured light 3D measurement method according to the first aspect;
[0014] The computer and the projector are connected via an HDMI interface of the computer and an HDMI interface of the projector, and the computer is further used to control the projector to project the image to be projected onto the workpiece to be measured;
[0015] The left and right cameras are respectively connected to the computer, and the computer is further configured to transmit control signals to the left and right cameras after a preset delay after the projector projects the image to be projected onto the workpiece to be measured; wherein the preset delay is greater than the response time of the projector to the projection instruction;
[0016] The left and right cameras are used to capture images of the workpiece to be measured when receiving a control signal.
[0017] In general, the above technical solutions conceived by the present invention can achieve the following beneficial effects compared with the prior art:
[0018] 1. Considering that the actively projected surface structured light will be reflected multiple times on the mutually reflecting surface, thereby generating mutual interference, resulting in phase solution failure or phase calculation error, the present invention establishes a mutually reflecting surface optical path model based on the optical path characteristics, and according to the principle of multiple reflected light in the model interfering with the sinusoidal structure grating phase solution, the interaction between the projector projection and the camera capture image is used to perform reflection identification, and based on the reflection identification data, the structured light image to be projected is adaptively partitioned. Compared with the traditional partitioning method that relies on the workpiece model data, this method directly uses scene information detection to generate partitioned areas, and compared with the aforementioned traditional partitioning method, it takes into account the influence of multiple reflections, thereby realizing high-precision partitioned projection of structured light images, partitioning to obtain more accurate phase maps, partitioning to achieve precise matching of the phase points of the left and right cameras, and obtaining high-precision three-dimensional point cloud data.
[0019] 2. When detecting the mutual reflection interference area, the present invention takes into account the detection speed and efficiency, aggregates the detection areas according to the principle of no conflict within the block, and realizes parallel detection of the scene. Compared with the method of independent detection of each block, while ensuring the detection quality, it greatly improves the detection speed, thereby shortening the time required for the entire measurement. BRIEF DESCRIPTION OF THE DRAWINGS
[0020] Figure 1 A schematic flow chart of a surface structured light three-dimensional measurement method based on adaptive partition projection provided by an embodiment of the present invention;
[0021] Figure 2 (a) and (b) are the optical path diagrams from the non-interreflective surface projector to the camera surface and the optical path diagrams from the interreflective surface projector to the camera surface respectively, which are established based on the optical path characteristics.
[0022] Figure 3 A schematic diagram of a parallel detection process for scene mutual reflection areas provided by an embodiment of the present invention;
[0023] Figure 4 Schematic diagram of a partition mask provided in an embodiment of the present invention acting on a sinusoidal grating fringe pattern. DETAILED DESCRIPTION
[0024] In order to make the objectives, technical solutions and advantages of the present invention more clearly understood, the present invention is further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely for the purpose of explaining the present invention and are not intended to limit the present invention. In addition, the technical features involved in the various embodiments of the present invention described below may be combined with each other as long as they do not conflict with each other.
[0025] The embodiment of the present invention provides a surface structured light three-dimensional measurement method based on adaptive partition projection, such as Figure 1 Shown, including:
[0026] S1, obtain the image of the workpiece to be measured captured by the left camera and / or the right camera when the projector projects the image to be projected onto the surface of the workpiece to be measured; S2, clear the pixel block pair set C, determine the target pixel block of the kth pixel point of the left camera and / or the right camera based on the image of the workpiece to be measured, and clear the pixel block set B k , and use the same division method to divide each target pixel block into multiple sub-pixel blocks and add B k , add B without duplication k The sub-pixel blocks in the total set of sub-pixel blocks B are converted into k Any two sub-blocks in the pixel block pair are added to the total set of pixel block pairs C without duplication; k = 1, 2, ..., N, where N is the total number of pixels of the left camera and / or the right camera (i.e., every pixel is traversed);
[0027] The target pixel block of the k-th pixel point is the pixel block in the first target list and B k The target first list is a list corresponding to the projected image that makes the gray value of the k-th pixel point higher than the gray value threshold among the multiple first lists obtained in the previous iteration;
[0028] S3: Determine whether the size of each pixel block in B is less than a threshold. If so, output B and C and proceed to S4. Otherwise, use the pixel blocks in B as nodes and the pixel block pairs in C as edges to construct a graph structure and use a graph coloring algorithm to solve the problem to obtain multiple first lists. Turn on the pixel points of the corresponding areas of all pixel blocks in each first list in the full-size solid color image of the projector and turn off the other pixel points to obtain the images corresponding to each first list. Use the images corresponding to each first list as new images to be projected and return to S1 for loop iteration.
[0029] In the first iteration, the image to be projected is the full-size pure color image of the projector, B k Only one full-size pixel block of the projector is included, and the pixel blocks in the first list only include one full-size pixel block of the projector;
[0030] Specifically, in the above steps S1-S3, the projector projects the image to be projected onto the surface of the workpiece to be measured, the left camera and / or the right camera synchronously obtains the image of the workpiece to be measured (hereinafter also referred to as the scene image), the image of the workpiece to be measured is analyzed to generate a new image to be projected, and the image to be projected and the camera obtains the image, and the image of the workpiece to be measured obtained by the camera is analyzed in a loop until the preset conditions are met to obtain reflection recognition data.
[0031] The image projected by the projector onto the surface of the workpiece to be measured for the first time is a full-size pure color image, and the left camera and / or the right camera synchronously acquire the scene image; in the loop iteration, the image acquired by the left camera and / or the right camera in the previous iteration is analyzed, and each pixel point of the image captured by the left camera and / or the right camera is traversed to determine the target pixel block of each pixel point. It should be noted that for each pixel point, its target pixel block is the pixel block in the first list obtained in the previous iteration corresponding to the projected image that makes the grayscale value of the k-th pixel point higher than the grayscale threshold, and B k The target pixel block of each pixel point is divided into multiple sub-pixel blocks in the same way.
[0032] Clear B k , divide the target pixel block of the k-th pixel into multiple sub-pixel blocks and add them to B k , B k The pixel block pairs formed by combining two elements in are added to the total conflict block pair set C, and B is added without duplication. kThe elements in the set B are added to the total set B of sub-pixel blocks (i.e., B and C are both non-repeating sets), and a graph is constructed with the elements in set B as nodes and the elements in set C as edges. A graph coloring algorithm is applied. As known to those skilled in the art, the graph coloring algorithm is applied to a graph structure consisting of a series of nodes and edges consisting of certain node pairs. The algorithm assigns colors to all nodes of the graph using a minimum number of color types, so that the two nodes connected by each edge have different colors. Therefore, there is no edge connection between nodes assigned the same color, that is, there is no conflict relationship. A list is generated for the nodes colored by the same color, so that a series of lists of conflict-free blocks can be generated at this time. Each list includes one or more conflict-free pixel blocks, and several blocks in each list are applied to the full-size image of the projector: in the full-size image of the projector, the pixels of the corresponding areas of several blocks in each list are turned on, and the pixels of other areas are turned off, to obtain the graph corresponding to each list, which is used as the image to be projected. The series of images to be projected obtained by the above operation are projected onto the workpiece to be measured. The left camera and / or the right camera synchronously acquire the image of the workpiece to be measured, and then enter the next loop iteration until the preset conditions are met. It can be understood that a projection image can be generated according to a list.
[0033] The above steps are described below with a specific example.
[0034] First iteration: The initial image to be projected and the initial target pixel block of the kth pixel of the left camera and / or the right camera are all full-size pure color images of the projector. The initial B k Include only full-size pixel blocks of the projector, e.g. Figure 3 As shown in Level 1, the full-size pure color image (frame 1) of the projector is a full-size pure color image with all pixels of the projector lit. It is projected onto the workpiece to be measured, and the left camera and / or the right camera are used to synchronously capture the image of the workpiece to be measured;
[0035] The image analysis process shown in step S2 is used to analyze the image of the workpiece to be tested: clear C. Since the initial target pixel block of the k-th pixel point of the left camera and / or the right camera is the full-size pure color image of the projector, it is evenly divided. Taking the division into 4 sub-pixel blocks as an example, for the k-th pixel point of the left camera and / or the right camera, clear B. k , add 4 sub-pixel blocks to B k , add B without duplication kThe sub-pixel block pair consisting of any two sub-pixel blocks in the four sub-pixel blocks in B is divided into C. Since the entire projector full-size image is used as the target pixel block of the k-th pixel before division, that is, it is assumed that there is an area with lit camera pixels in the full-size projector image, so it is assumed that there is a conflict between the sub-pixel blocks obtained after the division, that is, they cannot be projected simultaneously in one frame of the projector image. Therefore, the sub-pixel pair consisting of any two sub-pixel blocks is called a conflicting block pair; assuming that the size of each pixel block in B is not less than the threshold at this time, the graph coloring algorithm shown in step S3 is executed:
[0036] With the pixel blocks in B as nodes and the pixel block pairs in C as edges, a graph structure is constructed and solved using the graph coloring algorithm to obtain four first lists, which are numbered 2, 3, 4, and 5 as shown. Each first list includes a sub-pixel block, such as Figure 3 As shown in Level 2, sub-pixel blocks 2, 3, 4, and 5 are respectively in the first lists 2, 3, 4, and 5. Therefore, the sub-pixel blocks included in the first lists 2, 3, 4, and 5 are respectively applied to the full-size image of the projector according to their numbers to obtain the images corresponding to the first lists and use them as the images to be projected (taking sub-pixel block 2 in List 2 as an example, in the full-size image of the projector, the pixels in the area corresponding to sub-pixel block 2 in List 2 are turned on, and the pixels in other areas are turned off. The obtained image is used as the image to be projected corresponding to sub-pixel block 2 in List 2). Continue the loop iteration;
[0037] The projector projects the image to be projected (frames 2-5) onto the surface of the workpiece to be measured. The left camera and / or the right camera capture the image of the workpiece to be measured. The pixel block pair set C is cleared. The four images acquired by the above-mentioned cameras are analyzed using the above-mentioned image analysis process. For the k-th pixel point, assuming that the projection image generated according to List 2 and the projection image generated according to List 4 are respectively projected onto the workpiece to be measured, and are both in the light state in the image captured by the camera, then List 2 and List 4 are respectively compared with B. k Find the intersection and get two pixel blocks marked with ×, such as Figure 3 As shown in Level 3, it is the target pixel block of the k-th pixel point, that is, there is a conflict between the two, clear B k , using the aforementioned image analysis method to subdivide it into 4 sub-blocks and add them to B k In the example, add B without duplication. k The sub-pixel blocks in the total set of sub-pixel blocks B are converted into k The pixel block pairs consisting of any two sub-blocks in are added to the total set of pixel block pairs C without duplication. Assuming that the sizes of the pixel blocks in B are not all smaller than the threshold, the above-mentioned graph coloring algorithm is used to obtain List 6-13, and a series of images to be projected (frames 6-13) are generated based on List 6-13. Among them, List 6 includes 3 pixel blocks, such as Figure 3 The pixel block with sequence number 6 in Level 3, List 7 includes 3 pixel blocks, such as Figure 3 The pixel block with sequence number 7 in Level 3 is similar to List 8-13.
[0038] According to List 6-13, 8 images to be projected (frames 6-13) are generated and projected onto the workpiece to be measured. Figure 3 The blocks with the same number as shown in Level 3 will be projected in the same image. Clear the pixel block pair set C and use the above image analysis method to analyze the 8 images captured by the camera. For the k-th pixel point, assume that the projection image generated in List 6 and the projection image generated in List 12 are projected onto the workpiece to be measured, and both are lit in the image captured by the camera. Compare List 6 and List 12 with B respectively. k Find the intersection and get the two pixel blocks marked with ×, which is the target pixel block of the k-th pixel point. That is, there is a conflict between the two, clear B k , using the aforementioned image analysis method to subdivide it into 4 sub-blocks and add them to B k .
[0039] Similarly, it can be determined that there is a conflict between the pixel block marked with # in List 8 and the pixel block marked with # in List 10. The aforementioned image analysis method is used to subdivide them into 4 sub-blocks and add them to B. k At the same time, assuming that the block 9 in the lower left corner does not light up any camera pixel, that is, it is not a target pixel block for any camera pixel, then it will be eliminated, and a series of images to be projected are obtained using the aforementioned image analysis method, such as Figure 3 Blocks with the same number as shown in Level 4 are projected in the same image and captured synchronously with the camera.
[0040] The aforementioned process is iterated until the iteration termination threshold condition is reached, and the reflection recognition data, namely, the final output B and C, are obtained.
[0041] In order to improve the calculation speed, preferably, in step S2, each target pixel block is evenly divided into a plurality of sub-pixel blocks using the same division method.
[0042] In order to improve the ability to resist interference from ambient light, preferably, the full-size pure color image is a full-size blue light image.
[0043] S4, using the pixel blocks in B output by S3 as nodes and the pixel block pairs in C output by S3 as edges, constructs a graph structure and applies a graph coloring algorithm to solve it to obtain multiple second lists, turns on the pixel points of the corresponding areas of all pixel blocks in each second list in the full-size structured light image of the projector, and turns off the other pixel points, to obtain the images corresponding to each second list, and uses them as the images to be projected onto the surface of the workpiece to be measured, and obtains the images of the workpiece to be measured simultaneously captured by the left and right cameras, calculates the phase maps and performs matching, reconstructs the three-dimensional point cloud of the workpiece to be measured, and fuses all the reconstructed three-dimensional point clouds to obtain the overall three-dimensional point cloud of the workpiece to be measured.
[0044] Specifically, based on the reflection identification data, the graph coloring algorithm is applied again to obtain a plurality of second lists, that is, a plurality of conflict-free partitions are obtained corresponding to the second lists.
[0045] That is, after the S1 process loop iteration meets the iteration termination threshold condition, the graph structure is constructed based on the reflection identification data using B and C at the time of iteration termination, and the graph coloring algorithm is run to perform regional clustering on the projection area to generate conflict-free partition areas.
[0046] Then, based on the partitioned area data, the partitioned area mask is applied to the structured light image to generate the partitioned structured light image.
[0047] like Figure 4 As shown, according to the partition area data, a partition area mask M (x, y) is obtained, which is applied to the sinusoidal grating stripe structured light image. On the top, we get the partitioned structured light image have:
[0048]
[0049] Finally, according to the partitioned structured light image data, the structured light images of each partition are projected onto the workpiece to be measured, the left and right cameras synchronously capture the image of the workpiece to be measured, reconstruct the point cloud, and finally fuse the reconstructed point clouds of each partition to obtain the overall three-dimensional point cloud.
[0050] Among them, firstly, the partition structured light images are projected The camera is used to acquire images synchronously, and the images acquired by the camera are phase-decomposed according to the multi-frequency heterodyne principle. The absolute phase image of the left camera and the absolute phase image of the right camera are subjected to distortion correction and epipolar line correction according to the pre-calibrated internal and external parameters of the camera, that is, the pre-calibrated camera parameters. The corresponding points on the absolute phase image of the left camera and the absolute phase image of the right camera of the measured object are found to achieve phase point matching. The three-dimensional point cloud is reconstructed by partitioning according to the triangulation principle. Finally, the three-dimensional point cloud reconstructed in each partition is simply fused to obtain the overall three-dimensional point cloud.
[0051] That is, based on the partitioned structured light image, the relative phase map of the left and right cameras at each frequency and the modulation map of the left and right cameras at any frequency are respectively obtained; the relative phase map at each frequency is used to dephase the relative phase map at any frequency to obtain an absolute phase map; and phase point matching is performed on the obtained absolute phase map to reconstruct a three-dimensional point cloud, and the point clouds reconstructed in each partition are fused to obtain an overall point cloud.
[0052] The above step S4 dephases the relative phase image based on the multi-frequency heterodyne principle to obtain the absolute phase image. The phase unwrapping process mainly relies on the phase principal values of the grating images of different frequencies. The calculation process is more stable, and the phase unwrapping can be performed on the grating images of any frequency. The three continuous phase values are used simultaneously for calculation at the subsequent three-dimensional reconstruction moment, thereby improving the accuracy of stereo reconstruction.
[0053] The method provided by the present invention establishes an inter-reflective surface light path model to analyze that inter-reflection occurs on the workpiece surface, resulting in multiple light beams projected by the projector pixel being captured by the same pixel of the camera, thereby causing sinusoidal structure grating phase interference or even phase resolution failure. Based on this, the present invention adopts an adaptive partitioned projection method to avoid the simultaneous projection of the above-mentioned multiple interfering light rays, thereby avoiding interference from the source. Compared with many traditional methods based on error correction, this method solves the problem from the root and is more effective and thorough.
[0054] The connection method used in traditional 3D measurement systems is as follows: the computer and projector are connected via a USB interface, and the projector is directly connected to the left and right cameras via a USB interface or a network port. The structured light image to be projected is pre-stored in the projector, and the projection command issued by the computer is transmitted to the projector via USB. After receiving the projection command, the projector projects the structured light image stored in it onto the workpiece to be measured and sends a projection completion signal to the left and right cameras to trigger the left and right cameras to capture the image of the workpiece to be measured.
[0055] The connection method of the above hardware structure means that traditional 3D measurement systems can only perform traditional structured light 3D measurement, and cannot meet the application requirements of the surface structured light 3D measurement method based on adaptive partitioned projection provided by the present invention, which requires the projector and camera to have real-time interactive functions. Based on this, an embodiment of the present invention provides a surface structured light 3D measurement system based on adaptive partitioned projection, comprising: a projector, left and right cameras, and a computer, wherein the projector is arranged between the left and right cameras, and the optical axes of the left and right cameras are symmetrical with respect to the optical axis of the projector, and the computer is used to execute the surface structured light 3D measurement method described in any of the above embodiments;
[0056] The computer and the projector are connected via an HDMI interface of the computer and an HDMI interface of the projector, and the computer is further used to control the projector to project the image to be projected onto the workpiece to be measured;
[0057] The left and right cameras are respectively connected to the computer, and the computer is further configured to transmit control signals to the left and right cameras after a preset delay after the projector projects the image to be projected onto the workpiece to be measured; wherein the preset delay is greater than the response time of the projector to the projection instruction;
[0058] The left and right cameras are used to capture images of the workpiece to be measured when receiving a control signal.
[0059] Specifically, a data cable is used to connect the computer's HDMI interface to the projector's HDMI interface, enabling HDMI protocol communication between the computer and the projector. Based on this connection, the projector is controlled as an extended screen for the computer. The computer controls the projector in the same way it controls its own screen to project the structured light image onto the workpiece to be measured.
[0060] The left and right cameras are connected to the computer via a USB interface or a network port, respectively. Based on this connection method, after the computer sends a projection command to the projector, it can simultaneously send control signals to the left and right cameras to trigger the left and right cameras to synchronously capture images of the workpiece to be measured. In addition, considering that the projector has a certain response time to the projection command and it also takes a certain amount of time for the projector to complete the projection, in order to avoid the phenomenon that the left and right cameras start capturing images before the projector completes the projection, resulting in unstable and inconsistent pixel grayscale values in the camera-captured images between multiple frames, thereby affecting the structured light three-dimensional reconstruction, the computer sends the projection command to the projector, and then after a preset delay, it sends the control signal to the left and right cameras; accordingly, the preset delay is greater than the projector's response time to the projection command.
[0061] In order to eliminate the influence of the asynchronous projector refresh and camera exposure to ensure the consistency of camera pixel grayscale values and meet the requirement of image grayscale consistency obtained by cameras in different projection frames in structured light three-dimensional measurement, preferably, the exposure time of the left and right cameras are both integer multiples of the projector refresh cycle.
[0062] In order to improve the ability to resist interference from ambient light, preferably, the camera is equipped with a blue light band pass filter adapted to the projector.
[0063] An embodiment of the present invention provides an electronic device, characterized by comprising: a computer-readable storage medium and a processor;
[0064] The computer-readable storage medium is used to store executable instructions;
[0065] The processor is configured to read the executable instructions stored in the computer-readable storage medium and execute the method described in any one of the above embodiments.
[0066] An embodiment of the present invention provides a computer-readable storage medium, characterized in that the computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a processor to execute the method described in any of the above embodiments.
[0067] It will be easily understood by those skilled in the art that the above description is merely a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of the present invention should be included in the scope of protection of the present invention.
Claims
1. A surface structured light three-dimensional measurement method based on adaptive partition projection, characterized in that: include: S1, obtaining an image of the workpiece to be measured captured by the left camera and / or the right camera when the projector projects the image to be projected onto the surface of the workpiece to be measured; S2, clear the pixel block pair set C, determine the target pixel block of the kth pixel point of the left camera and / or the right camera according to the image of the workpiece to be measured, and clear the pixel block set B k , and use the same division method to divide each target pixel block into multiple sub-pixel blocks and add B k , add B without duplication k The sub-pixel blocks in the total set of sub-pixel blocks B are converted into k The pixel block pairs consisting of any two sub-blocks in are added to the total set of pixel block pairs C without duplication; k = 1, 2, ..., N, where N is the total number of pixels of the left camera and / or the right camera; The target pixel block of the k-th pixel point is the pixel block in the first target list and B k The target first list is a list corresponding to the projected image that makes the gray value of the k-th pixel point higher than the gray value threshold among the multiple first lists obtained in the previous iteration; S3: Determine whether the size of each pixel block in B is less than a threshold. If so, output B and C and proceed to S4. Otherwise, use the pixel blocks in B as nodes and the pixel block pairs in C as edges to construct a graph structure and use a graph coloring algorithm to solve the problem to obtain multiple first lists. Turn on the pixel points of the corresponding areas of all pixel blocks in each first list in the full-size solid color image of the projector and turn off the other pixel points to obtain the images corresponding to each first list. Use the images corresponding to each first list as new images to be projected and return to S1 for loop iteration. In the first iteration, the image to be projected is the full-size pure color image of the projector, B k The pixel blocks in the first list only include one full-size solid color image of the projector; S4, using the pixel blocks in B output by S3 as nodes and the pixel block pairs in C output by S3 as edges, constructs a graph structure and applies a graph coloring algorithm to solve it to obtain multiple second lists, turns on the pixel points of the corresponding areas of all pixel blocks in each second list in the full-size structured light image of the projector, and turns off the other pixel points, to obtain the images corresponding to each second list, and uses them as the images to be projected onto the surface of the workpiece to be measured, and obtains the images of the workpiece to be measured simultaneously captured by the left and right cameras, calculates the phase maps and performs matching, reconstructs the three-dimensional point cloud of the workpiece to be measured, and fuses all the reconstructed three-dimensional point clouds to obtain the overall three-dimensional point cloud of the workpiece to be measured.
2. The method according to claim 1, wherein In step S2, each target pixel block is evenly divided into a plurality of sub-pixel blocks using the same division method.
3. The method according to claim 1 or 2, wherein: The full-size solid color image is a full-size blue-ray image.
4. A surface structured light 3D measurement system based on adaptive partition projection, comprising: A projector, left and right cameras, and a computer, wherein the projector is arranged between the left and right cameras, and the optical axes of the left and right cameras are symmetrical with respect to the optical axis of the projector, characterized in that the computer is used to execute the surface structured light three-dimensional measurement method according to any one of claims 1 to 3; The computer and the projector are connected via an HDMI interface of the computer and an HDMI interface of the projector, and the computer is further used to control the projector to project the image to be projected onto the workpiece to be measured; The left and right cameras are respectively connected to the computer, and the computer is further configured to transmit control signals to the left and right cameras after a preset delay after the projector projects the image to be projected onto the workpiece to be measured; wherein the preset delay is greater than the response time of the projector to the projection instruction; The left and right cameras are used to capture images of the workpiece to be measured when receiving a control signal.
5. The system according to claim 4, wherein: The exposure time of the left and right cameras is an integer multiple of the projector refresh cycle.
6. An electronic device, characterized in that: include: Computer-readable storage medium and processor; The computer-readable storage medium is used to store executable instructions; The processor is configured to read the executable instructions stored in the computer-readable storage medium and execute the method according to any one of claims 1 to 3.
7. A computer-readable storage medium, characterized in that The computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a processor to execute the method according to any one of claims 1 to 3.
Citation Information
Patent Citations
Regional Gamma precorrection phase error compensation method in large view field structured light vision measurement
CN105403172A
Device and method for obtaining a 3D topography
WO2009065675A1