A three-dimensional measurement method and system based on a codeable color structured light
By using a Hamming code-based color structured light method, the phase solution algorithm is simplified, enabling high-precision and low-cost 3D measurement. This method is suitable for 3D measurement of complex objects and solves the problems of expensive equipment and susceptibility to interference in existing technologies.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- ZHEJIANG CHUANGTE NEW MATERIAL TECH CO LTD
- Filing Date
- 2026-03-11
- Publication Date
- 2026-06-09
Smart Images

Figure CN122170802A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of three-dimensional measurement technology, and in particular to a three-dimensional measurement method and system based on coded color structured light. Background Technology
[0002] 3D measurement aims to acquire the three-dimensional geometric information of an object, providing raw data for subsequent inspection, design, reverse engineering, assembly simulation, and other processes. Currently, the mainstream 3D measurement solutions on the market mainly include laser line scanning, multi-lens machine vision, and traditional structured light.
[0003] Laser line scanning methods, including time-of-flight and self-mixing interferometry, offer high precision but rely on high-precision laser scanners, resulting in expensive equipment and high maintenance costs. They also require a high degree of cleanliness in the workshop environment. While multi-lens machine vision methods offer inexpensive equipment, their measurement accuracy is low, with errors reaching the millimeter level, making them unsuitable for precision measurements. Traditional structured light methods, including fast Fourier transform and phase-shifting methods, are prone to data loss or reconstruction errors with objects that have occlusions, deep grooves, or strong curvature variations. Furthermore, their measurement stability decreases significantly under conditions of highly reflective, dark, or unevenly reflective surfaces. For example, patent application CN101813461A uses sinusoidal stripes projected simultaneously into channels of different colors, making it susceptible to interference from the object's surface color. CN112923870A uses single-frame color coding to locate stripe sequences. The length of its codewords is limited, which restricts the number of stripes and measurement accuracy. It is also easily affected by object surface interference. In addition, its phase resolution process still requires comparison with the known phase of adjacent areas. Therefore, it cannot be used to measure complex object surfaces with depressions or protrusions. Summary of the Invention
[0004] To address some or all of the problems in existing technologies, and in order to achieve rapid and accurate measurement of complex three-dimensional objects while simplifying the measurement system, the first aspect of this invention provides a three-dimensional measurement method based on coded color structured light, comprising: The stripe pattern is encoded using Hamming codes, and a structured light projection sequence is generated. Structured light is projected onto the surface of the object to be tested; Acquire pattern information modulated by the surface of the object under test; and The three-dimensional spatial data of the object under test are determined based on the pattern information.
[0005] Furthermore, encoding the stripe pattern based on Hamming codes includes: Based on the required number of projected fringes and error correction capability, the length of the Hamming code is determined, and the Hamming code is obtained; and The codeword is obtained by calibrating the periodic sequence of the stripe pattern of the Hamming code.
[0006] Furthermore, the Hamming code includes information bits and redundant bits, wherein the length k of the information bits satisfies: 2 k >N, where N is the number of stripes to be projected, and the length of the redundant bits is determined based on the required error correction capability.
[0007] Furthermore, the Hamming code is a (10,5) two-dimensional linear code, wherein the length of the information bits is 5, and the minimum Hamming distance between codewords is 4.
[0008] Furthermore, generating the structured light projection sequence includes: The codeword is divided into two equal parts, the first half of which is projected through a first color channel and the second half through a second color channel; and a sinusoidal stripe pattern is projected through a third color channel; and The images projected from the three channels are combined to form a color-coded stripe pattern, thus obtaining structured light.
[0009] Further, determining the three-dimensional spatial data of the object under test based on the pattern includes: The pattern is decomposed into three color channels to obtain a sinusoidal stripe pattern and two binary coded stripe patterns. Based on the sinusoidal fringe pattern, determine the wrapping phase value; Based on the binary encoded stripe pattern, decoding is performed to obtain the sinusoidal stripe period sequence value of each pixel; and The true phase value is obtained based on the wrapped phase value and the sinusoidal fringe period sequence value.
[0010] Furthermore, determining the three-dimensional spatial data of the object under test based on the pattern also includes: Based on the true phase value and the phase value of the calibration plane on the same platform as the object under test, the distance of each point on the surface of the object under test from the calibration platform is determined, and the surface morphology of the object under test is reconstructed.
[0011] Based on the aforementioned three-dimensional measurement method, the first aspect of this invention provides a three-dimensional measurement system based on coded color structured light, comprising: The encoding module encodes the stripe pattern based on Hamming codes and generates a structured light projection sequence: Structured light projection module, which is used to project structured light onto the surface of the object to be measured; An image acquisition module is used to acquire pattern information modulated by the surface of the object under test; and The decoding module is used to determine the three-dimensional spatial data of the object under test based on the pattern information acquired by the image acquisition module.
[0012] A third aspect of the present invention also provides a three-dimensional quality inspection method, comprising: The three-dimensional data of the object to be detected are acquired using the three-dimensional measurement method described above; and Deviation analysis and error determination are performed based on the three-dimensional data.
[0013] This invention provides a 3D measurement method and system based on coded color structured light. By introducing a Hamming code encoding mechanism, the algorithm is simplified, eliminating the need for complex phase-solving algorithms and effectively improving the measurement rate. Furthermore, Hamming codes possess automatic error correction capabilities, enabling the method to automatically detect and correct measurement interference. This allows for improved anti-interference capability of phase resolution simply by increasing the frame rate without changing the hardware or algorithm. Moreover, the measurement method does not require high-end equipment; it can be implemented using only ordinary industrial cameras and projection equipment. This 3D measurement method is suitable for high-precision 3D measurement under complex lighting and surface reflection conditions, offering higher measurement accuracy for complex structures, deep holes, and curved surfaces, and significantly reducing the false alarm rate of quality inspection systems. Attached Figure Description
[0014] To further illustrate the above and other advantages and features of the various embodiments of the present invention, a more specific description of the various embodiments of the present invention will be presented with reference to the accompanying drawings. It is to be understood that these drawings depict only typical embodiments of the invention and are therefore not intended to limit its scope. In the drawings, identical or corresponding parts will be indicated by identical or similar reference numerals for clarity.
[0015] Figure 1 This diagram illustrates a flow chart of a three-dimensional measurement method based on coded color structured light according to an embodiment of the present invention. Figure 2 This diagram illustrates a process of a three-dimensional measurement method based on coded color structured light according to an embodiment of the present invention. Figure 3 A schematic diagram illustrating a synthesized structured light according to an embodiment of the present invention and its decomposed images in different color channels; and Figure 4 This diagram illustrates a three-dimensional measurement system based on coded color structured light, according to an embodiment of the present invention. Detailed Implementation
[0016] In the following description, the invention is described with reference to various embodiments. However, those skilled in the art will recognize that the embodiments may be practiced without one or more specific details or in conjunction with other alternatives and / or additional methods or components. In other instances, well-known structures or operations are not shown or described in detail so as not to obscure the inventive points of the invention. Similarly, for illustrative purposes, specific numbers and configurations are set forth to provide a comprehensive understanding of embodiments of the invention. However, the invention is not limited to these specific details. Furthermore, it should be understood that the embodiments shown in the drawings are illustrative representations and are not necessarily drawn to scale.
[0017] In this specification, references to "an embodiment" or "this embodiment" mean that a particular feature, structure, or characteristic described in connection with that embodiment is included in at least one embodiment of the invention. The phrase "in one embodiment" appearing throughout this specification does not necessarily refer to the same embodiment in all instances.
[0018] It should be noted that the embodiments of the present invention describe the method steps in a specific order; however, this is only for illustrating the specific embodiment and not for limiting the order of the steps. On the contrary, in different embodiments of the present invention, the order of the steps can be adjusted according to actual needs.
[0019] In this invention, the modules of the system according to the invention can be implemented using software, hardware, firmware, or a combination thereof. When a module is implemented using software, its function can be implemented through computer program flow. For example, the module can be implemented using code segments (such as code segments in languages like C and C++) stored in a storage device (such as a hard disk, memory, etc.), wherein the corresponding function of the module can be implemented when the code segment is executed by a processor. When a module is implemented using hardware, its function can be implemented by setting a corresponding hardware structure. For example, the module's function can be implemented by hardware programming a programmable device such as a field-programmable gate array (FPGA), or by designing an application-specific integrated circuit (ASIC) that includes multiple transistors, resistors, capacitors, and other electronic devices. When a module is implemented using firmware, the module's function can be written into a read-only memory such as an EPROM or EEPROM in the form of program code, and the corresponding function of the module can be implemented when the program code is executed by a processor. In addition, some functions of the module may need to be implemented by separate hardware or by working in cooperation with the hardware. For example, the detection function is implemented by a corresponding sensor (such as a proximity sensor, accelerometer, gyroscope, etc.), the signal transmission function is implemented by a corresponding communication device (such as a Bluetooth device, infrared communication device, baseband communication device, Wi-Fi communication device, etc.), the output function is implemented by a corresponding output device (such as a display, speaker, etc.), and so on.
[0020] When sinusoidal or cosine fringe structured light is projected onto the surface of the object under test, it will produce a corresponding degree of distortion according to the shape of the object's surface. This distortion is reflected in the phase value of the structured light fringes. Based on this, the phase value on the calibration plane of the same platform is measured. and the phase value of the object under test This allows us to determine the distance -h(x,y) from each point on the object's surface to the calibration plane, thus enabling us to reconstruct the object's surface shape. , in, , The distance between the image acquisition module and the object under test. The spacing between the image acquisition module and the projection module is a custom designation. The frequency of the stripe structure. However, in actual measurements, it is impossible to directly obtain the true phase value from the image. or It can only obtain the wrapped phase value between (-π, π] before phase unwrapping. or The relationship between the wrapped phase value and the true phase value is as follows: , , in This represents a modulo operation, limiting the result to the range (-π, π]. The true phase value must be recovered from the wrapped phase value; this process is called phase unwrapping. Since the calibration plate is planar, It is a linear function of x, therefore Within the same fringe period, the phase also varies linearly with respect to x, making its phase unfolding process relatively simple. Therefore, in three-dimensional measurement, the main consideration is... The process can be expanded. For example, phase-shifting profilometry can be used to generate sinusoidal structured light by projecting multiple sinusoidal fringes with a fixed phase difference and calculating the wrapping phase value based on the grayscale values of the fringes from the multiple images. However, existing phase unfolding methods are relatively complex and have poor accuracy. Based on this, the inventors discovered that if each projected sinusoidal fringe is sequentially calibrated, and the fringe sequence of any pixel is accurately known during image acquisition, the accuracy of recovering the true phase value can be greatly improved. Based on this, this invention proposes a three-dimensional measurement method based on coded color structured light. Hamming code is used to calibrate the periodic sequence of each sinusoidal fringe, generating a binary structured light image, which is simultaneously projected onto the object surface along with the sinusoidal fringe using different color channels. Then, by extracting and reconstructing the Hamming code value of each pixel, the accurate sinusoidal fringe periodic sequence value of the corresponding pixel is obtained. This is combined with the enveloping phase value of the sinusoidal structured light. And a sinusoidal fringe periodic sequence, thereby obtaining the true phase value. .
[0021] The technical solution of the present invention will be further described below with reference to the accompanying drawings of the embodiments.
[0022] Figure 1 The diagram illustrates a flowchart of a three-dimensional measurement method based on coded color structured light according to an embodiment of the present invention. Figure 2 This diagram illustrates a process of a three-dimensional measurement method based on coded color structured light according to an embodiment of the present invention. As shown, a three-dimensional measurement method based on coded color structured light includes: First, in step 101, the stripe recognition sequence is encoded. The stripe pattern is encoded based on Hamming codes. In one embodiment of the invention, each sinusoidal stripe periodic sequence is labeled using Hamming codes. First, the length of the Hamming code to be used needs to be determined. Hamming codes typically include two parts: information bits and redundancy bits. The information bits represent the content to be encoded, while the redundancy bits are used for verification and error correction. Therefore, in one embodiment of the invention, the length of the information bits is determined based on the number of stripes to be projected, i.e., the number of stripes to be marked. The more stripes to be projected, the longer the required information bit length. In one embodiment of the invention, the information bit length k satisfies: 2... k >N, where N is the number of stripes to be projected. Furthermore, the more stripes projected, the larger the measurement range while maintaining the same measurement accuracy. The length of the redundant bits is determined based on the required error correction capability. In one embodiment of the invention, the error correction capability mainly refers to the number of erroneous bits that can be corrected, which is typically determined by the minimum Hamming distance d between words. H It was decided that Little Hamming was far from d. H This indicates that a maximum of d can be detected. H One bit error, and can be corrected [d] H-1 / 2] bit errors. In one embodiment of the present invention, according to the requirements of conventional scenarios, the number of projected stripes is usually 20. Therefore, an information length of 5 for the codeword is sufficient to uniquely mark each stripe. Thus, a (10, 5) two-dimensional linear code can be used, that is, a two-dimensional linear code with a total codeword length n of 10 and an information length k of 5. At the same time, a minimum Hamming distance of 4 is adopted. A minimum Hamming distance of 4 can correct 1 bit error and detect 2 bit errors. That is, even if a pixel has significant interference in an image, it can still accurately recover the true phase value. Through enumeration, the combination with a minimum Hamming distance of 4 can be obtained, denoted as the (10, 5) Hamming code, which is used to mark each sinusoidal stripe periodic sequence to obtain the codeword, where the nth codeword is represented as: , Where M is the total number of projected frames. Since a Hamming code of length 10 is used, the value of M must be at least 5. If higher accuracy is required, the number of projected and captured structured light image frames can be appropriately increased, which will further increase the minimum Hamming distance, thereby significantly improving the system's anti-interference capability without changing the hardware and software conditions. Next, in step 102, a structured light projection sequence is generated. The first half of the codeword is projected through a first color channel, such as the green channel, the second half through a second color channel, such as the blue channel, and the initial sinusoidal stripe pattern is projected through a third color channel, such as the red channel. Then, using a device such as an RGB synthesizer, the three parts of the pattern can be combined to form a structured light beam for projection, resulting in a colored stripe pattern. Figure 3 As shown, the first image is a structured light pattern of a color-coded stripe pattern, and the second to fourth images are decomposed images of the structured light pattern of the color-coded stripe pattern in the red, green, and yellow color channels, respectively, i.e., sinusoidal stripes, with a stripe count of 20, a first half of binary Hamming code stripes, and a second half of binary Hamming code stripes. Next, in step 103, structured light is projected. The structured light projection sequence obtained in step 102 is projected onto the surface of the object under test; Next, in step 104, the modulated pattern information is acquired. This involves acquiring the pattern information modulated by the surface of the object under test, specifically capturing the pattern formed after the colored stripe pattern is projected onto the surface of the object under test; and... Finally, in step 105, three-dimensional spatial data is acquired. The three-dimensional spatial data of the object under test is determined based on the acquired pattern information. In one embodiment of the invention, after acquiring the pattern information, it is first decomposed into three color channels using a method such as an RGB decomposer to obtain a sinusoidal stripe pattern and two binary coded stripe patterns. Subsequently, based on the sinusoidal stripe pattern, a wrapping phase map is determined, and simultaneously, decoding is performed based on the two binary coded stripe patterns to recover the codewords. The decoder can then decode the sinusoidal fringe periodic sequence values of each pixel. Finally, based on the wrapped phase value and the sinusoidal fringe periodic sequence value, the true phase value can be obtained. After obtaining the true phase, it can be calculated with the phase value of the calibration platform to determine the distance of each point on the surface of the object under test from the calibration platform, and the surface morphology of the object under test can be reconstructed. The calibration platform and the object under test are on the same platform, and their phase values can be obtained by phase unfolding based on the obtained wrapped phase position using common methods, which will not be elaborated here.
[0023] Based on the obtained three-dimensional spatial data, further data comparison can be performed, followed by deviation analysis and error determination, thereby realizing quality inspection and analysis.
[0024] Based on the three-dimensional measurement method described above Figure 4 This diagram illustrates a structural schematic of a three-dimensional measurement system based on coded color structured light, according to an embodiment of the present invention. Figure 4 As shown, a three-dimensional measurement system based on coded color structured light includes an encoding module 401, a structured light projection module 402, an image acquisition module 403, and a decoding module 404. When quality inspection and analysis are required, a quality inspection and analysis module is further connected to realize online inspection.
[0025] The encoding module 401 is used to encode the stripe pattern based on Hamming codes according to the method described above, and generate a structured light projection sequence. The structured light projection module 402 is used to project the structured light onto the surface of the object under test. In one embodiment of the present invention, the structured light projection module 402 includes a projection device such as a color DLP projector. The image acquisition module 403 is used to acquire pattern information modulated by the surface of the object under test, and may include a conventional industrial camera such as a color CCD industrial camera, and may also include a synchronous trigger control unit. The decoding module 404 is used to determine the three-dimensional spatial data of the object under test based on the pattern information acquired by the image acquisition module, using the method described above. In one embodiment of the present invention, the encoding module 401 and the decoding module 404 can be implemented in the same terminal, such as a PC, mobile phone, tablet computer, etc.
[0026] The three-dimensional measurement method and system provided by this invention belong to non-contact, non-destructive testing. It does not contact the object being inspected. Compared to existing two-dimensional optical quality inspection methods widely used in industrial automated production, this invention can achieve three-dimensional quality inspection of objects by adding only a color projector, reducing the dependence of the three-dimensional measurement system on high-end laser equipment. Simultaneously, the method improves the measurement accuracy of objects with complex shapes, exhibiting higher accuracy for complex structures, deep holes, curved surfaces, and other morphologies, significantly reducing the false alarm rate of the quality inspection system. It can also be flexibly integrated with existing production line systems for online inspection, without requiring complex phase unfolding algorithms. It can be embedded for development, adapting to different scenarios and exhibiting good scalability, improving the system's adaptability to complex industrial environments. It is particularly suitable for measuring complex three-dimensional curved surfaces with irregular curvature, i.e., objects with detailed features such as steps, holes, grooves, and edge contours. Its measurement accuracy can reach ±10 micrometers. When using a 60FPS ordinary industrial camera and a 256GB memory Intel i7 CPU control computer, a measurement can be completed as quickly as every 0.5 seconds without the inspection stage needing to rotate or move.
[0027] Although various embodiments of the invention have been described above, it should be understood that they are presented by way of example only and not as limitations. It will be apparent to those skilled in the art that various combinations, modifications, and alterations can be made without departing from the spirit and scope of the invention. Therefore, the breadth and scope of the invention disclosed herein should not be limited by the exemplary embodiments disclosed above, but should be defined solely by the appended claims and their equivalents.
Claims
1. A three-dimensional measurement method based on coded color structured light, characterized in that, include: The stripe pattern is encoded using Hamming codes, and the corresponding structured light projection sequence is generated. Structured light is projected onto the surface of the object to be tested; Collect pattern information modulated by the surface of the object under test; as well as The pattern information is decoded and reconstructed to obtain the three-dimensional spatial data of the object under test.
2. The three-dimensional measurement method as described in claim 1, characterized in that, Encoding striped patterns based on Hamming codes includes: The length of the Hamming code is determined based on the required number of projected fringes and the error correction capability; and The periodic sequence of the stripe pattern is calibrated based on the Hamming code to obtain the codeword.
3. The three-dimensional measurement method as described in claim 2, characterized in that, The Hamming code includes information bits and redundant bits, wherein the length k of the information bits satisfies: 2 k >N, where N is the number of stripes to be projected, and the length of the redundant bits is determined based on the required error correction capability.
4. The three-dimensional measurement method as described in claim 2, characterized in that, The Hamming code is a (10,5) two-dimensional linear code, where the length of the information bits is 5 and the minimum Hamming distance between codewords is 4.
5. The three-dimensional measurement method as described in claim 2, characterized in that, The generation of the corresponding structured light projection sequence includes: The codeword is divided into two equal parts, the first half of which is projected through a first color channel and the second half through a second color channel; and a sinusoidal stripe pattern is projected through a third color channel; and The images projected from the three channels are combined to form a color-coded stripe pattern, thus obtaining structured light.
6. The three-dimensional measurement method as described in claim 5, characterized in that, Decoding and reconstructing the pattern information includes: The pattern is decomposed into three color channels to obtain a sinusoidal stripe pattern and two binary coded stripe patterns. Based on the sinusoidal fringe pattern, determine the wrapping phase value; Based on the binary encoded stripe pattern, decoding is performed to obtain the sinusoidal stripe period sequence value of each pixel; and The true phase value is obtained based on the wrapped phase value and the sinusoidal fringe period sequence value.
7. The three-dimensional measurement method as described in claim 6, characterized in that, Decoding and reconstructing the pattern information also includes: Based on the true phase value and the phase value of the calibration plane on the same platform as the object under test, the distance of each point on the surface of the object under test from the calibration platform is determined, and the surface morphology of the object under test is reconstructed.
8. A three-dimensional measurement system based on coded color structured light, characterized in that, It is configured to acquire three-dimensional data of the object to be measured by any of the three-dimensional measurement methods described in claims 1 to 7, wherein the three-dimensional measurement system comprises: The encoding module is configured to encode the stripe pattern based on Hamming codes and generate the corresponding structured light projection sequence: A structured light projection module, configured to project structured light onto the surface of the object to be measured; The image acquisition module is configured to acquire image pattern information modulated by the surface of the object under test and The decoding module is configured to decode and reconstruct the pattern information acquired by the image acquisition module to determine the three-dimensional spatial data of the object under test.
9. The three-dimensional measurement system as described in claim 8, characterized in that, The structured light projection module includes a DLP projector; and / or The image acquisition module includes a color CCD industrial camera.
10. A three-dimensional quality inspection method, characterized in that, include: The three-dimensional data of the object to be detected are obtained by the three-dimensional measurement method as described in any one of claims 1 to 7; as well as Deviation analysis and error determination are performed based on the three-dimensional data.