Calibration method, measurement method and device for 3D structured light multi-range measurement
Patent Information
- Application Number
- CN202511561369.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-10-29
- Publication Date
- 2026-10-09
- Estimated Expiration
- 2045-10-29
AI Technical Summary
[0002]目前,相关技术提出,结构光技术已在AOI领域广泛应用,但仍存在如下问题:首先,传统结构光系统通常采用单一量程设计,而细条纹的量程较低,粗条纹的检测精度较低,因此,难以同时满足不同尺寸或不同距离目标的检测需求;此外,多量程检测需要频繁切换投影条纹,从而导致检测效率降低;同时,现有算法对多量程结构光图像的融合与处理能力较弱,从而会影响最终的检测精度与稳定性
本发明实施例提供的一种3D结构光多量程测量的标定方法、测量方法及装置,该方法在获取相机信息和DLP信息后,根据相机信息和DLP信息,确定标定用的倍频正弦条纹和倍频正弦条纹对应的格雷码,之后采集DLP在竖直方向上以预设量程移动时,对倍频正弦条纹进行投影得到的条纹图像,并根据条纹图像,以及条纹图像对应的背景光强和调制度进行多步相移计算处理,得到条纹图像的相对相位;接着通过预设倍频算法,基于调制度,从倍频正弦条纹中确定目标相对相位,并将目标相对相位与格雷码结合,确定绝对相位;最后针对绝对相位进行相位折算处理,得到目标相位,以通过目标相位确定预设相位高度对照模型的非参标定的拟合参数,并将非参标定的拟合参数保存为标定文件,本发明实施例可以显著提升3D结构光多量程测量的测量精确度和测量效率。
Smart Images

Figure CN121383898B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the technical field of AOI industrial vision inspection, and in particular to a calibration method, measurement method and device for 3D structured light multi-range measurement. Background Technology
[0002] Currently, related technologies have been proposed, and structured light technology has been widely used in the field of AOI, but the following problems still exist: First, traditional structured light systems usually adopt a single-range design, while fine stripes have a low range and coarse stripes have low detection accuracy. Therefore, it is difficult to meet the detection requirements of targets of different sizes or distances at the same time. In addition, multi-range detection requires frequent switching of projected stripes, which leads to a reduction in detection efficiency. At the same time, existing algorithms have weak ability to fuse and process multi-range structured light images, which will affect the final detection accuracy and stability. Summary of the Invention
[0003] In view of this, the purpose of the present invention is to provide a calibration method, measurement method and device for 3D structured light multi-range measurement, which can significantly improve the measurement accuracy and measurement efficiency of 3D structured light multi-range measurement.
[0004] In a first aspect, embodiments of the present invention provide a calibration method for 3D structured light multi-range measurement. The method includes: acquiring camera information and DLP information, and determining, based on the camera information and DLP information, a frequency-doubled sinusoidal fringe and the Gray code corresponding to the frequency-doubled sinusoidal fringe for calibration, wherein the camera information includes: camera pixel size information, target surface size information, and lens resolution, and the DLP information includes: DLP pixel size information and DLP lens focal length; acquiring a fringe image obtained by projecting the frequency-doubled sinusoidal fringe onto the DLP when it moves vertically at a preset range, and performing multi-step phase shift calculation processing based on the fringe image and the background light intensity and modulation degree corresponding to the fringe image to obtain the relative phase of the fringe image; determining the target relative phase from the frequency-doubled sinusoidal fringe based on the modulation degree using a preset frequency-doubled algorithm, and combining the target relative phase with the Gray code to determine the absolute phase; performing phase conversion processing on the absolute phase to obtain the target phase, and determining the fitting parameters of the non-parametric calibration of the preset phase height reference model through the target phase, and saving the fitting parameters of the non-parametric calibration as a calibration file.
[0005] In one embodiment, before the step of acquiring the stripe image obtained by projecting the frequency-doubled sinusoidal stripes onto the DLP when it moves vertically within a preset range, the method includes: acquiring a projection verification pattern obtained when the DLP projects a preset verification image, and determining the mapping relationship between the DLP's projection and grayscale based on the projection verification pattern, wherein the verification image is a single-color image with grayscale values of 100 to 150; performing grayscale compensation processing on the DLP through the mapping relationship to compensate for nonlinear errors in the DLP projection process, and using the grayscale-compensated DLP to project the frequency-doubled sinusoidal stripes.
[0006] In one embodiment, the step of performing multi-step phase shift calculation processing based on the striped image and the background light intensity and modulation degree corresponding to the striped image to obtain the relative phase of the striped image includes: acquiring the gray value and image time sequence of the striped image; sending the background light intensity, modulation degree, gray value and image time sequence to a preset multi-step phase shift calculation model to obtain the relative phase.
[0007] In one embodiment, the step of determining the target relative phase from the frequency-doubled sinusoidal stripes based on the modulation degree using a preset frequency-doubled algorithm includes: determining the modulation degree by calculating the contrast of each pixel in the stripe image; determining the optimal phase value of each pixel by comparing the modulation degree using the preset frequency-doubled algorithm; and using the optimal phase value as the target relative phase.
[0008] In one embodiment, the step of performing phase conversion processing on the absolute phase to obtain the target phase includes: obtaining the phase conversion relationship, and converting the absolute phase from the high-range phase to the low-range phase according to the phase conversion relationship to obtain the target phase.
[0009] Secondly, embodiments of the present invention also provide a measurement method for 3D structured light multi-range measurement, the method comprising: acquiring the phase shift and Gray code of the image to be measured; inputting the phase shift, Gray code and calibration file into a preset phase height comparison model to obtain the target measurement height; wherein the calibration file is obtained based on the calibration method for 3D structured light multi-range measurement according to any one of the first aspects.
[0010] Thirdly, a calibration device for 3D structured light multi-range measurement includes: a fringe setting module, which acquires camera information and DLP information, and determines the frequency-doubled sinusoidal fringes and their corresponding Gray codes based on the camera and DLP information. The camera information includes the camera's pixel size, target size, and lens resolution; the DLP information includes the DLP's pixel size and lens focal length. A phase calculation module acquires the fringes obtained by projecting the frequency-doubled sinusoidal fringes onto the DLP as it moves vertically along a preset range. The image is processed by multi-step phase shift calculation based on the striped image and the background light intensity and modulation degree corresponding to the striped image to obtain the relative phase of the striped image; the phase reduction module determines the target relative phase from the frequency-doubled sinusoidal stripes based on the modulation degree through a preset frequency doubling algorithm, and combines the target relative phase with Gray code to determine the absolute phase; the parameter calibration module performs phase conversion processing on the absolute phase to obtain the target phase, and determines the fitting parameters of the nonparametric calibration of the preset phase height comparison model through the target phase, and saves the fitting parameters of the nonparametric calibration as a calibration file.
[0011] Fourthly, a measurement device for 3D structured light multi-range measurement, the device comprising: a data acquisition module for acquiring the phase shift and Gray code of the image to be measured; and an image measurement module for inputting the phase shift, Gray code, and calibration file into a preset phase height comparison model to obtain the target measurement height; wherein the calibration file is obtained based on the calibration method for 3D structured light multi-range measurement according to any one of the first aspects.
[0012] Fifthly, embodiments of the present invention also provide a server, including a processor and a memory, the memory storing computer-executable instructions executable by the processor, the processor executing the computer-executable instructions to implement any of the methods provided in the first aspect.
[0013] In a sixth aspect, embodiments of the present invention also provide a computer-readable storage medium storing computer-executable instructions, which, when invoked and executed by a processor, cause the processor to implement any of the methods provided in the first aspect.
[0014] The embodiments of the present invention bring the following beneficial effects: This invention provides a calibration method, measurement method, and apparatus for 3D structured light multi-range measurement. After acquiring camera and DLP information, the method determines the frequency-doubled sinusoidal fringes and their corresponding Gray codes based on the camera and DLP information. Then, it acquires a fringe image obtained by projecting the frequency-doubled sinusoidal fringes onto the DLP as it moves vertically within a preset range. Based on the fringe image, the background light intensity, and the modulation index, a multi-step phase shift calculation is performed to obtain the relative phase of the fringe image. Next, using a preset frequency-doubled algorithm based on the modulation index, the target relative phase is determined from the frequency-doubled sinusoidal fringes. This target relative phase is then combined with the Gray code to determine the absolute phase. Finally, phase conversion processing is performed on the absolute phase to obtain the target phase. The target phase is used to determine the fitting parameters for the non-parametric calibration of the preset phase height reference model, and the fitting parameters are saved as a calibration file. This invention significantly improves the measurement accuracy and efficiency of 3D structured light multi-range measurement.
[0015] Other features and advantages of the invention will be set forth in the description which follows, and will be apparent in part from the description, or may be learned by practicing the invention. The objects and other advantages of the invention are realized and obtained in accordance with the structures particularly pointed out in the description, claims and drawings.
[0016] To make the above-mentioned objects, features and advantages of the present invention more apparent and understandable, preferred embodiments are described below in detail with reference to the accompanying drawings. Attached Figure Description
[0017] To more clearly illustrate the specific embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the specific embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present invention. For those skilled in the art, other drawings can be obtained from these drawings without creative effort.
[0018] Figure 1 A flowchart illustrating a calibration method for 3D structured light multi-range measurement provided in an embodiment of the present invention; Figure 2 A schematic diagram illustrating the specific process of a calibration method for 3D structured light multi-range measurement provided in an embodiment of the present invention; Figure 3 A flowchart illustrating a measurement method for 3D structured light multi-range measurement provided in an embodiment of the present invention; Figure 4 A schematic diagram illustrating the specific process of a 3D structured light multi-range measurement method provided in an embodiment of the present invention; Figure 5This is a schematic diagram of the structure of a calibration device for 3D structured light multi-range measurement provided in an embodiment of the present invention; Figure 6 A schematic diagram of the structure of a 3D structured light multi-range measurement device provided in an embodiment of the present invention; Figure 7 This is a schematic diagram of the structure of a server provided in an embodiment of the present invention. Detailed Implementation
[0019] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the present invention will be clearly and completely described below in conjunction with the embodiments. Obviously, the described embodiments are only some embodiments of the present invention, not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0020] Currently, with the rapid development of industrial manufacturing, especially in high-precision industries such as electronics manufacturing, automotive assembly, and aerospace, the requirements for product quality and production efficiency are increasing. Traditional quality inspection methods are gradually failing to meet the demands of modern industry for automation, intelligence, and high-precision inspection. Against this backdrop, the combination of computer vision and optical measurement technology has become a key means to achieve efficient and accurate inspection. Among numerous inspection methods, structured light technology, due to its advantages such as non-contact operation, high precision, and applicability to complex curved surface measurement, is widely used in fields such as 3D topography reconstruction, surface defect detection, and dimensional measurement. Especially in the inspection of precision components such as printed circuit boards (PCBs), structured light technology can provide rich depth information, thereby effectively improving inspection accuracy and robustness.
[0021] In existing technologies, non-parametric calibration using a displacement stage is a commonly used calibration method in 3D vision measurement, particularly suitable for calibrating the geometric relationship between the structured light projection system and the camera. This method does not require a standard calibration board of known dimensions (such as a checkerboard). Instead, it moves the object or structured light projector / camera by controlling a high-precision Z-axis displacement stage to acquire a series of images and corresponding positional information, thereby calculating the system's intrinsic and extrinsic parameters. Traditional calibration methods require standard calibration boards with known geometric parameters, facilitating the calculation of the camera's intrinsic and extrinsic parameters. Non-parametric calibration (or non-reference calibration) is a calibration method that does not rely on a standard calibration board. This method typically uses high-precision control equipment (such as a displacement stage) to achieve precise spatial motion, thereby establishing a mapping relationship between image pixels and spatial coordinates. Because this method has high requirements for fringe quality, the camera and projection system may passively defocus during movement as the imaging plane changes, leading to a decrease in the signal-to-noise ratio.
[0022] When using finer fringes, even minute displacements can cause fringe blurring, making accurate phase calculation difficult. While coarser fringes reduce the risk of defocusing, the accuracy of phase measurement is limited. Furthermore, different fringe frequencies correspond to different measurement ranges, requiring the selection of appropriate fringe frequencies during calibration, which is cumbersome. This limits the practical application of non-parametric calibration methods. Therefore, the calibration method, measurement method, and apparatus for 3D structured light multi-range measurement provided by this invention can significantly improve the measurement accuracy and efficiency of 3D structured light multi-range measurement.
[0023] See Figure 1 The diagram shows a calibration method for 3D structured light multi-range measurement, which mainly includes the following steps S102 to S108: Step S102: Obtain camera information and DLP information, and determine the calibration frequency-doubled sine stripe and the Gray code corresponding to the frequency-doubled sine stripe based on the camera information and DLP information. The camera information includes: camera pixel size information, target size information and lens resolution. The DLP information includes: DLP pixel size information and DLP lens focal length.
[0024] In a real-time mode, the density of the stripes can be determined based on the film size of the camera and projector. Denseer stripes have a shorter range but higher accuracy, while sparser stripes have a longer range but lower accuracy. Frequency-doubled sine stripes provide both types of stripes for subsequent selection of the most suitable stripes based on Gray code.
[0025] Step S104: Acquire the fringe image obtained by projecting the frequency-doubled sinusoidal fringes onto the DLP as it moves vertically with a preset range, and perform multi-step phase shift calculation processing based on the fringe image and the background light intensity and modulation degree corresponding to the fringe image to obtain the relative phase of the fringe image.
[0026] In one implementation, a smooth, flat calibration plate without patterns can be placed on a displacement stage. The displacement stage stops every certain distance and takes a set of stripe photos, eventually obtaining a set of data corresponding to the height and stripe photos. The subsequent multi-step phase shift calculation can be understood as taking 4-12 consecutive photos of each pixel (i.e., phase shift), and using the brightness change of the consecutive photos to deduce the current relative phase through a formula, where the relative phase ranges from 0 to 2π.
[0027] Step S106: Using a preset frequency doubling algorithm, based on the modulation index, determine the target relative phase from the frequency doubling sine fringes, and combine the target relative phase with Gray code to determine the absolute phase.
[0028] In one implementation, the modulation degree is calculated by the contrast of loudness. The more obvious the black-and-white fluctuations, the greater the modulation degree; the more blurred the stripes, the closer the modulation degree is to 0. The modulation degree is used to automatically select the stripes most suitable for the current measurement. The target relative phase refers to the optimal relative phase after selecting the best measurement stripes according to the modulation degree. The difference between the absolute phase and the target relative phase is that the target relative phase is equivalent to cycling between 0 and 2π. That is to say, the target relative phase can only represent the position at the 2π-long circle, while the absolute phase is equivalent to expanding the entire cycle. Therefore, it can be clearly defined which circle a certain position is. For example, Gray code can be understood as a floor number. After multiplying the floor number by 2π and adding the inner angle of the target relative phase circle, the absolute phase can be obtained. In this way, a larger measurement range can be expanded through the absolute phase, which is not limited by the stripe width.
[0029] Step S108: Perform phase conversion processing on the absolute phase to obtain the target phase, and use the target phase to determine the fitting parameters of the nonparametric calibration of the preset phase height comparison model, and save the fitting parameters of the nonparametric calibration as a calibration file.
[0030] In one implementation, the target phase serves the following purpose: the absolute height has been determined by the high-range fringes through the above steps. Next, it is scaled down to a small unit with a low range. After this calibration, if a low object needs to be measured in subsequent actual measurements, the calibration data obtained from the high-range calibration can be used, eliminating the need for multiple calibrations and shortening the calibration time.
[0031] The calibration method for 3D structured light multi-range measurement provided in this embodiment of the invention can improve the accuracy of phase high and low ranges by using frequency doubling stripes, avoiding the problems of low range for fine stripes and low accuracy for coarse stripes. Furthermore, by using frequency doubling stripe fusion, the calibration range distance is unified, and by phase mapping, one calibration can be performed and any stripe can be used multiple times. Combined with the real-time stripe switching function of DLP, rapid range switching can be achieved, which enhances the flexible production and intelligent detection of factories.
[0032] See Figure 2 The diagram shows a specific flowchart of a calibration method for 3D structured light multi-range measurement. This embodiment of the invention also provides an implementation method for calibration parameters, as detailed in (1) to (6) below: (1) Acquire the projection verification pattern obtained when the DLP projects the preset verification image, and determine the mapping relationship between the projection of the DLP and the grayscale based on the projection verification pattern. Then, perform grayscale compensation processing on the DLP through the mapping relationship to compensate for the nonlinear error in the DLP projection process. Use the grayscale-compensated DLP to project the frequency-doubled sine stripes. The verification image is a single color image with grayscale of 100 to 150.
[0033] In one implementation, when projecting a single-color image with a grayscale of 100-150, a camera can be used to capture the DLP projection pattern and obtain the projection-grayscale mapping relationship of the DLP. By obtaining the mapping relationship, the nonlinear error of the DLP can be compensated, and the sinusoidal nature of the projection phase can be guaranteed.
[0034] (2) After using DLP projection to preset the stripes, use a camera to collect the preset stripes of DLP projection, and move the displacement stage step by step to the preset range. Then repeat the above steps until the maximum range of stripe measurement is reached.
[0035] (3) Obtain the grayscale value and image time sequence of the stripe image, and send the background light intensity, modulation, grayscale value and image time sequence to the preset multi-step phase shift calculation model to obtain the relative phase. Specifically, the phase can be obtained by using multi-step phase shift calculation to obtain the acquired stripes. Assume that the acquired stripe image is:
[0036] in, Let be the grayscale value of the k-step phase-shifted image at coordinates (x, y). This represents the background light intensity (DC component value) of the image. The modulation index (cosine component value) of the image. The phase value of the image. Let be the phase shift component of the k-step phase shift.
[0037] Then the multi-step phase shift can be written as:
[0038] This allows us to calculate the phase value of the image.
[0039] (4) Calculate the phase selection for the frequency doubling method based on the frequency doubling algorithm and modulation degree. At the same time, obtain the maximum range phase by combining Gray code. The phase solution of the frequency doubling method is to project two different fringes. and ,in The cycle is Integer multiples of . At lower measurement ranges, higher frequency fringes are obtained to acquire more accurate height details, while at higher measurement ranges, a high-key regime with coarser fringes ensures accurate height information acquisition.
[0040] In one implementation, the modulation index can be determined by calculating the contrast of each pixel in the striped image, and the optimal phase value of each pixel can be determined by comparing the modulation index using a preset frequency doubling algorithm. The optimal phase value is then used as the target relative phase. Its fusion strategy is as follows:
[0041] Where n is the period ratio of f1 and f2, and floor is the floor function.
[0042] Gray code encoding strategy is as follows:
[0043] Where W is the pixel width and b is the number of bits in the Gray code.
[0044] The final phase, i.e., the absolute phase, is obtained by projecting Gray code and fusing the phase:
[0045] (5) Obtain the phase conversion relationship, and based on the phase conversion relationship, convert the absolute phase from the high-range phase to the low-range phase to obtain the target phase. In one embodiment, the target phase can be obtained through the maximum range phase. Due to the phase conversion relationship, only the high-range phase of the DLP projection can be converted to the low-range phase through the conversion relationship. The conversion relationship is as follows:
[0046] in, Let p be the target phase, and p be the ratio of wide stripes to narrow stripes and the number of stripe pixels. By converting the target phase to a low range, low-range Gray code and stripes can be used, reducing the use of stripes, improving projection and calculation speed, and thus improving detection efficiency.
[0047] (6) Obtain the fitting parameters for non-parametric calibration through the target phase and save them as a calibration file. In structured light measurement, the absolute phase Φ(x,y) of the object surface is usually mapped to its height Z(x,y). We can control the device to move the projector or imaging plane and acquire images at different positions to fit the functional relationship between phase and height. Ideally, when the projector and camera form a certain angle, we can assume the following linear relationship between phase Φ and height Z:
[0048] Where a is the scaling factor, which is related to the system's geometric parameters; and b is the offset term, which is related to the height of the reference plane.
[0049] By moving the imaging plane using a control device (e.g., using a displacement stage), imaging can be performed at different known heights. Multiple sets of images were acquired, and the phase of each pixel in each set of images was obtained. (x,y). This allows for the construction of multiple [x,y]. - Data pairs. For each pixel (x, y), after collecting N sets of data, the phase-height relationship of that pixel can be fitted using the least squares method:
[0050] See Figure 3 The diagram shows a calibration method for 3D structured light multi-range measurement, which mainly includes the following steps S302 to S304: Step S302: Obtain the phase shift and Gray code of the image to be tested.
[0051] In one implementation, a lookup table can be created for each pixel independently, for example, phase 1.2 rad, height 0.5 mm; phase 2.4 rad, height 1.0 mm, etc. Then, a straight line is drawn using the least squares method, with slope a and intercept b. a and b are determined by the aforementioned calibration file. After that, as long as the phase is calculated, the height can be obtained by looking up the table. The height can be determined directly without a patterned precision calibration plate, hence the name non-parametric calibration.
[0052] Step S304: Input the phase shift, Gray code, and calibration file into the preset phase height comparison model to obtain the target measurement height. The calibration file is obtained by a calibration method based on 3D structured light multi-range measurement.
[0053] The measurement method for 3D structured light multi-range measurement provided in this embodiment of the invention, based on a calibration file, can perform rapid measurements under any conditions.
[0054] In practical applications, see Figure 4The diagram shown illustrates a specific flowchart of a 3D structured light multi-range measurement method, which only requires phase shift and Gray code calculation to determine the phase of the current image. Then according to the pre-calibrated and This allows you to calculate the object height corresponding to that pixel.
[0055] In one implementation, after obtaining the measured height, stripes and Gray code can be designed according to the size of the object to be measured, the stripes can be projected, the phase can be obtained, the three-dimensional structure can be reconstructed, and noise points can be removed by statistical filtering.
[0056] In summary, this invention employs a frequency doubling strategy in stripe design to generate two different frequency calibration stripes. Through multi-step phase shifting technology, the phase information corresponding to the two frequencies is obtained respectively, and the modulation of the two stripes at each pixel is further calculated. Based on the magnitude of the modulation, it can automatically determine which frequency stripe to use for phase calculation at that position, thereby improving the robustness and adaptability of the system while ensuring accuracy.
[0057] Simultaneously, a larger range of spatial information is obtained by projecting a coarser frequency Gray code pattern. The introduction of Gray code not only helps expand the overall measurement range but also effectively assists in phase unfolding, improving the stability and accuracy of 3D reconstruction. This combination benefits the accuracy of the calibration algorithm, enabling faster convergence and enhancing calibration stability. Finally, the acquired phase data is mapped to a pre-calibrated spatial coordinate file according to the actual fringe frequencies used, achieving the goal of one-time calibration and multiple uses.
[0058] During the measurement process, users can flexibly select combinations of frequency-harmonic fringes and Gray codes of varying thicknesses as needed, or use fringes of a single frequency alone to adapt to different measurement scenarios and range requirements. By fusing multiple fringe phases through modulation, the system can integrate the advantages of each frequency, improving the overall 3D reconstruction quality while ensuring measurement accuracy, significantly enhancing measurement efficiency and applicability.
[0059] Regarding the calibration method for 3D structured light multi-range measurement provided in the foregoing embodiments, this invention provides a calibration device for 3D structured light multi-range measurement. (See attached image.) Figure 5 The diagram shows a 3D structured light multi-range measurement calibration device, which includes the following parts: The stripe setting module 502 acquires camera information and DLP information, and determines the frequency-doubled sine stripes and the Gray code corresponding to the frequency-doubled sine stripes for calibration based on the camera information and DLP information. The camera information includes: camera pixel size information, target size information and lens resolution, and the DLP information includes: DLP pixel size information and DLP lens focal length. The phase calculation module 504 acquires the stripe image obtained by projecting the frequency-doubled sinusoidal stripes onto the DLP when it moves vertically with a preset range, and performs multi-step phase shift calculation processing based on the stripe image and the background light intensity and modulation degree corresponding to the stripe image to obtain the relative phase of the stripe image. The phase reduction module 506 determines the target relative phase from the frequency-doubled sine stripes based on the modulation index using a preset frequency-doubled algorithm, and combines the target relative phase with Gray code to determine the absolute phase; The parameter calibration module 508 performs phase conversion processing on the absolute phase to obtain the target phase, and uses the target phase to determine the fitting parameters of the non-parametric calibration of the preset phase height comparison model, and saves the fitting parameters of the non-parametric calibration as a calibration file.
[0060] The calibration device for 3D structured light multi-range measurement provided in this application embodiment can improve the phase accuracy of high and low range measurements by using frequency doubling stripes, avoiding the problems of low range for fine stripes and low accuracy for coarse stripes. Furthermore, by using frequency doubling stripe fusion, the calibration range distance is unified, and by phase mapping, one calibration can be performed and any stripe can be used multiple times. Combined with the real-time stripe switching function of DLP, rapid range switching can be achieved, which enhances the flexible production and intelligent detection of factories.
[0061] In one embodiment, before the step of acquiring the stripe image obtained by projecting the frequency-doubled sinusoidal stripes onto the DLP when it moves vertically within a preset range, the phase calculation module 504 is further configured to: acquire the projection verification pattern obtained when the DLP projects a preset verification image, and determine the mapping relationship between the DLP's projection and grayscale based on the projection verification pattern, wherein the verification image is a single-color image with grayscale values of 100 to 150; perform grayscale compensation processing on the DLP through the mapping relationship to compensate for the nonlinear error in the DLP projection process, and use the grayscale-compensated DLP to project the frequency-doubled sinusoidal stripes.
[0062] In one embodiment, when performing a multi-step phase shift calculation based on the striped image and the background light intensity and modulation degree corresponding to the striped image to obtain the relative phase of the striped image, the phase calculation module 504 is further configured to: obtain the gray value and image timing of the striped image; and send the background light intensity, modulation degree, gray value and image timing to a preset multi-step phase shift calculation model to obtain the relative phase.
[0063] In one embodiment, when performing the step of determining the target relative phase from the frequency-doubled sinusoidal fringes based on the modulation index using a preset frequency-doubled algorithm, the phase reduction module 506 is further configured to: determine the target relative phase from the frequency-doubled sinusoidal fringes based on the modulation index using a preset frequency-doubled algorithm, and combine the target relative phase with Gray code to determine the absolute phase.
[0064] In one embodiment, when performing phase conversion processing on the absolute phase to obtain the target phase, the parameter calibration module 508 is further configured to: obtain the phase conversion relationship, and convert the absolute phase from the high-range phase to the low-range phase according to the phase conversion relationship to obtain the target phase.
[0065] Regarding the measurement method for 3D structured light multi-range measurement provided in the foregoing embodiments, this invention provides a measurement device for 3D structured light multi-range measurement, see [link to relevant documentation]. Figure 6 The diagram shows a structural schematic of a 3D structured light multi-range measurement device, which includes the following parts: The data acquisition module 602 acquires the phase shift and Gray code of the image under test; The image measurement module 604 inputs the phase shift, Gray code, and calibration file into a preset phase height comparison model to obtain the target measurement height; wherein, the calibration file is obtained based on the calibration method of the above-mentioned 3D structured light multi-range measurement.
[0066] The measurement device for 3D structured light multi-range measurement provided in this application embodiment can perform rapid measurements under any conditions based on calibration files.
[0067] The device provided in this embodiment of the invention has the same implementation principle and technical effect as the aforementioned method embodiment. For the sake of brevity, any parts not mentioned in the device embodiment can be referred to the corresponding content in the aforementioned method embodiment.
[0068] This invention provides a server, specifically, the server includes a processor and a storage device; the storage device stores a computer program, which, when run by the processor, executes the method described in any of the above embodiments.
[0069] Figure 7 This is a schematic diagram of the structure of a server provided in an embodiment of the present invention. The server 100 includes: a processor 70, a memory 71, a bus 72, and a communication interface 73. The processor 70, the communication interface 73, and the memory 71 are connected through the bus 72. The processor 70 is used to execute executable modules, such as computer programs, stored in the memory 71.
[0070] The memory 71 may include high-speed random access memory (RAM) or non-volatile memory, such as at least one disk storage device. Communication between this system network element and at least one other network element is achieved through at least one communication interface 73 (which can be wired or wireless), such as the Internet, wide area network, local area network, metropolitan area network, etc.
[0071] Bus 72 can be an ISA bus, PCI bus, or EISA bus, etc. The bus can be divided into address bus, data bus, control bus, etc. For ease of representation, Figure 7 The symbol is represented by a single double-headed arrow, but this does not mean that there is only one bus or one type of bus.
[0072] The memory 71 is used to store programs. After receiving an execution instruction, the processor 70 executes the programs. The method executed by the device for defining the flow process disclosed in any of the foregoing embodiments of the present invention can be applied to the processor 70 or implemented by the processor 70.
[0073] The processor 70 may be an integrated circuit chip with signal processing capabilities. In implementation, each step of the above method can be completed by the integrated logic circuitry in the hardware of the processor 70 or by instructions in software form. The processor 70 may be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it may also be a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components. It can implement or execute the methods, steps, and logic block diagrams disclosed in the embodiments of this invention. The general-purpose processor may be a microprocessor or any conventional processor. The steps of the methods disclosed in the embodiments of this invention can be directly embodied in the execution of a hardware decoding processor, or executed by a combination of hardware and software modules in the decoding processor. The software modules may reside in random access memory, flash memory, read-only memory, programmable read-only memory, electrically erasable programmable memory, registers, or other mature storage media in the art. The storage medium is located in memory 71. Processor 70 reads the information in memory 71 and, in conjunction with its hardware, completes the steps of the above method.
[0074] The computer program product of the readable storage medium provided in the embodiments of the present invention includes a computer-readable storage medium storing program code. The instructions included in the program code can be used to execute the methods described in the foregoing method embodiments. For specific implementation, please refer to the foregoing method embodiments, which will not be repeated here.
[0075] If the aforementioned functions are implemented as software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this invention, essentially, or the part that contributes to the prior art, or a portion of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0076] Finally, it should be noted that the above-described embodiments are merely specific implementations of the present invention, used to illustrate the technical solutions of the present invention, and not to limit it. The scope of protection of the present invention is not limited thereto. Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that any person skilled in the art can still modify or easily conceive of changes to the technical solutions described in the foregoing embodiments within the technical scope disclosed in the present invention, or make equivalent substitutions for some of the technical features; and these modifications, changes, or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention, and should all be covered within the scope of protection of the present invention. Therefore, the scope of protection of the present invention should be determined by the scope of the claims.
Claims
1. A calibration method for 3D structured light multi-range measurement, characterized in that, The method includes: Acquire camera information and DLP information, and determine the calibration frequency-doubled sine stripe and the Gray code corresponding to the frequency-doubled sine stripe based on the camera information and the DLP information. The camera information includes: camera pixel size information, target size information and lens resolution. The DLP information includes: DLP pixel size information and DLP lens focal length. When the DLP moves vertically with a preset range, a stripe image is obtained by projecting the frequency-doubled sinusoidal stripes. Based on the stripe image and the background light intensity and modulation degree corresponding to the stripe image, a multi-step phase shift calculation is performed to obtain the relative phase of the stripe image. Using a preset frequency doubling algorithm, based on the modulation index, the target relative phase is determined from the frequency doubling sine stripes, and the target relative phase is combined with the Gray code to determine the absolute phase; A phase conversion process is performed on the absolute phase to obtain the target phase. The non-parametric calibration fitting parameters of the preset phase height comparison model are determined by the target phase, and the non-parametric calibration fitting parameters are saved as a calibration file. Before the step of projecting the frequency-doubled sinusoidal stripes onto the stripe image obtained when the acquisition DLP moves vertically at a preset range, the method includes: acquiring a projection verification pattern obtained when the DLP projects a preset verification image, and determining the mapping relationship between the DLP's projection and grayscale based on the projection verification pattern, wherein the verification image is a single-color image with grayscale values of 100 to 150; performing grayscale compensation processing on the DLP through the mapping relationship to compensate for nonlinear errors in the DLP projection process, and using the grayscale-compensated DLP to project the frequency-doubled sinusoidal stripes; The step of determining the target relative phase from the frequency-doubled sinusoidal stripes based on the modulation degree using a preset frequency-doubled algorithm includes: determining the modulation degree by calculating the contrast of each pixel in the stripe image; determining the optimal phase value of each pixel by comparing the modulation degree using the preset frequency-doubled algorithm; and using the optimal phase value as the target relative phase. The step of performing phase conversion processing on the absolute phase to obtain the target phase includes: obtaining the phase conversion relationship, and converting the absolute phase from a high-range phase to a low-range phase according to the phase conversion relationship to obtain the target phase.
2. The calibration method for 3D structured light multi-range measurement according to claim 1, characterized in that, The step of performing multi-step phase shift calculation based on the stripe image and the corresponding background light intensity and modulation depth to obtain the relative phase of the stripe image includes: Obtain the grayscale value and image time sequence of the striped image; The background light intensity, the modulation index, the gray value, and the image timing are sent to a preset multi-step phase shift calculation model to obtain the relative phase.
3. A measurement method for 3D structured light multi-range measurement, characterized in that, The method includes: Obtain the phase shift and Gray code of the image under test; The phase shift, Gray code, and calibration file are input into a preset phase height comparison model to obtain the target measurement height; The calibration file is obtained based on the calibration method for 3D structured light multi-range measurement according to any one of claims 1-2.
4. A calibration device for 3D structured light multi-range measurement, characterized in that, The device includes: The stripe setting module acquires camera information and DLP information, and determines the calibration frequency-doubled sine stripes and the Gray code corresponding to the frequency-doubled sine stripes based on the camera information and the DLP information. The camera information includes: camera pixel size information, target surface size information and lens resolution, and the DLP information includes: DLP pixel size information and DLP lens focal length. The phase calculation module acquires a stripe image obtained by projecting the frequency-doubled sinusoidal stripes onto the DLP as it moves vertically with a preset range. Based on the stripe image and the background light intensity and modulation degree corresponding to the stripe image, it performs multi-step phase shift calculation processing to obtain the relative phase of the stripe image. The phase reduction module determines the target relative phase from the frequency-doubled sine stripes based on the modulation index using a preset frequency-doubled algorithm, and combines the target relative phase with the Gray code to determine the absolute phase; The parameter calibration module performs phase conversion processing on the absolute phase to obtain the target phase, and uses the target phase to determine the fitting parameters of the non-parametric calibration of the preset phase height comparison model, and saves the fitting parameters of the non-parametric calibration as a calibration file; Before the step of projecting the frequency-doubled sinusoidal stripes onto the stripe image obtained when the acquisition DLP moves vertically at a preset range, the method includes: acquiring a projection verification pattern obtained when the DLP projects a preset verification image, and determining the mapping relationship between the DLP's projection and grayscale based on the projection verification pattern, wherein the verification image is a single-color image with grayscale values of 100 to 150; performing grayscale compensation processing on the DLP through the mapping relationship to compensate for nonlinear errors in the DLP projection process, and using the grayscale-compensated DLP to project the frequency-doubled sinusoidal stripes; The step of determining the target relative phase from the frequency-doubled sinusoidal stripes based on the modulation degree using a preset frequency-doubled algorithm includes: determining the modulation degree by calculating the contrast of each pixel in the stripe image; determining the optimal phase value of each pixel by comparing the modulation degree using the preset frequency-doubled algorithm; and using the optimal phase value as the target relative phase. The step of performing phase conversion processing on the absolute phase to obtain the target phase includes: obtaining the phase conversion relationship, and converting the absolute phase from a high-range phase to a low-range phase according to the phase conversion relationship to obtain the target phase.
5. A measuring device for 3D structured light multi-range measurement, characterized in that, The device includes: The data acquisition module acquires the phase shift and Gray code of the image under test; The image measurement module inputs the phase shift, the Gray code, and the calibration file into a preset phase height comparison model to obtain the target measurement height; The calibration file is obtained based on the calibration method for 3D structured light multi-range measurement according to any one of claims 1-2.
6. A server, characterized in that, The method includes a processor and a memory, the memory storing computer-executable instructions executable by the processor, the processor executing the computer-executable instructions to implement the method of any one of claims 1 to 3.
7. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer-executable instructions that, when invoked and executed by a processor, cause the processor to perform the method described in any one of claims 1 to 3.
Citation Information
Patent Citations
Panoramic structured light vision measurement system and universal distortion model parameter calibration method
CN108917602A
Color structured light three-dimensional measuring method, apparatus and device, and storage medium
CN109186476A