Three-dimensional measurement method, device and equipment based on structured light projection and medium

By using preset binary codes for three-dimensional reconstruction in structured light projection three-dimensional measurement technology, the problems of complex focal length adjustment and insufficient noise resistance are solved, and efficient and low-cost three-dimensional reconstruction effect is achieved.

CN118936335APending Publication Date: 2024-11-12BEIJING BOVISION TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411032578.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-07-30
Publication Date
2024-11-12

AI Technical Summary

Technical Problem

In the existing three-dimensional measurement technology of structured light projection, focal length adjustment is complex and laborious, and the noise resistance of phase shifted stripes is poor, which affects the three-dimensional reconstruction effect.

Method used

Three-dimensional reconstruction is carried out using preset binary codes generated based on preset encoding rules. By obtaining multiple images with preset stripe patterns on the objects to be measured, the target decoding results are determined and the object height is calculated, which reduces the calculation complexity and improves efficiency. .

Benefits of technology

It realizes that while ensuring accuracy, it reduces labor and equipment costs, improves three-dimensional reconstruction efficiency, simplifies the focal length adjustment process, and enhances noise resistance.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118936335A_ABST
    Figure CN118936335A_ABST
Patent Text Reader

Abstract

The invention discloses a three-dimensional measurement method and device based on structured light projection, equipment and a medium. The method comprises the following steps: acquiring a plurality of to-be-processed images with preset stripe pattern projections on a to-be-measured object; determining a target decoding result corresponding to the to-be-detected object according to the plurality of to-be-processed images; wherein the target decoding result comprises target decoding values corresponding to a plurality of target pixel points; for each target pixel point in the target decoding result, determining a height value corresponding to the target pixel point according to a target decoding value corresponding to the target pixel point, a preset initial calibration decoding value and a preset calibration model corresponding to the target pixel point; and determining the object height corresponding to the to-be-measured object according to the height value corresponding to each target pixel point. According to the technical scheme, three-dimensional reconstruction is carried out by adopting the preset binary code generated based on the preset coding rule, so that the effects of reducing the calculation complexity and further improving the three-dimensional reconstruction efficiency are achieved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of three-dimensional measurement technology, and in particular to a three-dimensional measurement method, device, equipment and medium based on structured light projection. Background Art

[0002] The three-dimensional object contour measurement technology is an important research hotspot in the current machine vision field. As an advanced non-contact measurement method, it can achieve high-precision measurement of the shape and size of an object by obtaining its contour information without damaging the object. At present, three-dimensional measurement technologies mainly include structured light projection measurement, laser scanning measurement, and stereo vision measurement. Structured light projection measurement encodes the projected image, projects these encoded images or stripes onto the surface of the object, and then decodes the image captured by the camera to accurately calculate the shape and depth of the object surface.

[0003] In the related art, phase shift fringes are usually used for 3D reconstruction. However, when using this method for 3D reconstruction, the focal length of the optical machine needs to be adjusted multiple times to complete the reconstruction. The focal length adjustment process is relatively complicated and time-consuming. In addition, the anti-noise ability of phase shift fringes is poor, which in turn affects the 3D reconstruction effect. Summary of the invention

[0004] The present invention provides a three-dimensional measurement method, device, equipment and medium based on structured light projection, which uses a preset binary code generated based on a preset coding rule to perform three-dimensional reconstruction, thereby reducing the computational complexity and improving the efficiency of three-dimensional reconstruction. In addition, it achieves the effect of reducing labor costs and equipment costs while ensuring accuracy.

[0005] According to one aspect of the present invention, a three-dimensional measurement method based on structured light projection is provided, the method comprising:

[0006] Acquire multiple images to be processed with a preset stripe pattern projected on the object to be tested; wherein the preset stripe pattern corresponding to the object to be tested in each of the images to be processed is different; the preset stripe pattern is generated based on a preset binary code; the different preset binary codes are all encoded and generated according to the same preset encoding rule; the preset encoding rule at least includes a code length of a preset code length and at least a continuous preset number of code values ​​being a first preset code value;

[0007] Determine a target decoding result corresponding to the object to be tested according to the multiple images to be processed; wherein the target decoding result includes target decoding values ​​corresponding to multiple target pixels; the target decoding value corresponding to each target pixel is determined based on the grayscale value corresponding to the corresponding pixel in the multiple images to be processed;

[0008] For each target pixel in the target decoding result, determine a height value corresponding to the target pixel according to a target decoding value corresponding to the target pixel, a preset initial calibration decoding value, and a preset calibration model corresponding to the target pixel; wherein the image acquisition height corresponding to the target decoding value is the same as the image acquisition height corresponding to the preset calibration decoding value;

[0009] The object height corresponding to the object to be measured is determined according to the height value corresponding to each of the target pixel points.

[0010] According to another aspect of the present invention, a three-dimensional measurement device based on structured light projection is provided, the device comprising:

[0011] An image acquisition module, used for acquiring a plurality of images to be processed with a preset stripe pattern projected on the object to be tested; wherein the preset stripe pattern corresponding to the object to be tested in each of the images to be processed is different; the preset stripe pattern is generated based on a preset binary code; the different preset binary codes are all encoded and generated according to the same preset encoding rule; the preset encoding rule at least includes a code length of a preset code length and at least a continuous preset number of code values ​​as a first preset code value;

[0012] A decoding result determination module, used to determine a target decoding result corresponding to the object to be tested according to the multiple images to be processed; wherein the target decoding result includes a target decoding value corresponding to a plurality of target pixels; the target decoding value corresponding to each target pixel is determined based on the grayscale value corresponding to the corresponding pixel in the multiple images to be processed;

[0013] A pixel height determination module, for each target pixel in the target decoding result, determining a height value corresponding to the target pixel according to a target decoding value corresponding to the target pixel, a preset initial calibration decoding value, and a preset calibration model corresponding to the target pixel; wherein the image acquisition height corresponding to the target decoding value is the same as the image acquisition height corresponding to the preset calibration decoding value;

[0014] The object height determination module is used to determine the object height corresponding to the object to be measured according to the height value corresponding to each target pixel point.

[0015] According to another aspect of the present invention, an electronic device is provided, the electronic device comprising:

[0016] at least one processor; and

[0017] a memory communicatively connected to the at least one processor; wherein,

[0018] The memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can execute the three-dimensional measurement method based on structured light projection described in any embodiment of the present invention.

[0019] According to another aspect of the present invention, a computer-readable storage medium is provided, wherein the computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a processor to implement the three-dimensional measurement method based on structured light projection described in any embodiment of the present invention when executed.

[0020] The technical solution of the embodiment of the present invention is to obtain multiple images to be processed with a preset stripe pattern projection on the object to be tested; wherein the preset stripe pattern corresponding to the object to be tested in each image to be processed is different; the preset stripe pattern is generated based on a preset binary code; different preset binary codes are all encoded and generated according to the same preset coding rule. Further, the target decoding result corresponding to the object to be tested is determined according to the multiple images to be processed; wherein the target decoding value corresponding to each target pixel in the target decoding result is determined based on the grayscale value corresponding to the corresponding pixel in the multiple images to be processed, further, for each target pixel in the target decoding result, the height value corresponding to the target pixel is determined according to the target decoding value corresponding to the target pixel, the preset initial calibration decoding value and the preset calibration model corresponding to the target pixel, further, the object height corresponding to the object to be tested is determined according to the height value corresponding to each target pixel, so as to solve the problem that the focal length adjustment process in the related art is relatively complicated and laborious, and the stripe anti-noise ability adopted is poor, and the three-dimensional reconstruction is performed by using the preset binary code generated based on the preset coding rule, so as to reduce the computational complexity, thereby improving the efficiency of three-dimensional reconstruction. Moreover, it achieves the effect of reducing labor costs and equipment costs while ensuring accuracy.

[0021] It should be understood that the contents described in this section are not intended to identify the key or important features of the embodiments of the present invention, nor are they intended to limit the scope of the present invention. Other features of the present invention will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS

[0022] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.

[0023] Figure 1 is a flow chart of a three-dimensional measurement method based on structured light projection provided according to Embodiment 1 of the present invention;

[0024] Figure 2 This is a schematic diagram of the structure of a three-dimensional measurement module provided according to the first embodiment of the present invention;

[0025] Figure 3 is a flow chart of a three-dimensional measurement method based on structured light projection provided according to Embodiment 2 of the present invention;

[0026] Figure 4 is a schematic structural diagram of a three-dimensional measurement device based on structured light projection provided according to Embodiment 3 of the present invention;

[0027] Figure 5 It is a schematic diagram of the structure of an electronic device for implementing the three-dimensional measurement method based on structured light projection according to an embodiment of the present invention. DETAILED DESCRIPTION

[0028] In order to enable those skilled in the art to better understand the scheme of the present invention, the technical scheme in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present invention.

[0029] It should be noted that the terms "first", "second", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.

[0030] Embodiment 1

[0031] Figure 1 This is a flow chart of a three-dimensional measurement method based on structured light projection provided in the first embodiment of the present invention. This embodiment is applicable to the case of three-dimensional measurement of an object to be measured based on structured light projection. The method can be executed by a three-dimensional measurement device based on structured light projection. The three-dimensional measurement device based on structured light projection can be implemented in the form of hardware and / or software. The three-dimensional measurement device based on structured light projection can be configured in a terminal and / or a server. Figure 1As shown, the method includes:

[0032] S110, acquiring a plurality of images to be processed with a preset stripe pattern projected on the object to be measured.

[0033] Among them, the object to be measured may be a three-dimensional object to be measured in height. The object to be measured may be any three-dimensional object. The object to be measured may be a regular three-dimensional object, such as a standard cylinder, a standard cube or other standard three-dimensional body. The object to be measured may also be an irregular three-dimensional object, such as a non-standard cylinder, a non-standard cube or other non-standard three-dimensional body. The preset stripe pattern may be understood as a pattern composed of black and white stripes, and the black and white stripes are arranged according to a preset rule. The image to be processed may be an image including the object to be measured and projected with a preset stripe pattern on the object to be measured. In this embodiment, the preset stripe pattern corresponding to the object to be measured in each image to be processed is different. The number of preset stripe patterns is consistent with the number of images to be processed. It can be understood that a preset number of different preset stripe patterns can be predetermined, and these preset stripe patterns can be deployed in the projection light machine. Afterwards, the object to be measured can be placed in the field of view corresponding to the shooting device and in the projection area of ​​the projection light machine. Furthermore, the deployed preset stripe pattern can be projected onto the surface of the object to be measured in sequence by a projection optical machine, and the object to be measured including the projection of the preset stripe pattern can be photographed by a shooting device, and the photographed image can be used as the image to be processed. It should be noted that when performing the projection, the object to be measured can be placed on a preset calibration plane, which is a calibration plane set during the calibration stage of the three-dimensional measurement module. Among them, the three-dimensional measurement module may include a projection optical machine, a shooting device and a translation stage. The projection optical machine can be any projection device, and optionally, it can be a digital light processing (DLP) optical machine. The shooting device can be any device capable of shooting, and optionally, it can be a high-speed industrial camera equipped with a telecentric lens. The translation stage can be used to adjust the distance between the preset calibration plane and the shooting device. Exemplarily, Figure 2 A schematic diagram of the structure of the three-dimensional measurement module provided in this embodiment. Figure 2 As shown, the three-dimensional measurement module includes a high-speed industrial camera 21 equipped with a telecentric lens, a DLP projection optical machine 22 and a translation stage 23. When performing three-dimensional measurement on an object to be measured, the object to be measured can be placed on the translation stage 23, and the preset stripe pattern deployed can be projected onto the object to be measured by the DLP projection optical machine 22. Then, the object to be measured with the projection can be photographed by the high-speed industrial camera 21, and the photographed image can be used as the image to be processed.

[0034] The preset stripe pattern may be generated based on a preset binary code. That is, each number in the preset binary code occupies one pixel in the preset stripe pattern. The preset binary code may be understood as binary data (0 and 1) arranged according to a preset rule. In other words, the preset binary code may be a code obtained by arranging 0 and 1 according to a preset rule. In this embodiment, different preset stripe patterns correspond to different preset binary codes.

[0035] In practical applications, Gray code is widely used as a binary code value in the field of 3D reconstruction. However, the thinnest stripe of Gray code has only two pixels, that is, at least two consecutive code values ​​in Gray code are 1. In this case, when adjusting the focal length of the projection light machine during 3D reconstruction based on Gray code, it may not be possible to adjust the light and dark changes clearly, resulting in unclear projection on the object to be measured.

[0036] In view of the above situation, in this embodiment, different preset binary codes are all binary codes with preset coding lengths, and at least the first preset number of consecutive code values ​​are binary codes with preset values. In addition, the number of preset binary codes is a second preset number. That is to say, binary coding is performed under the condition that the preset coding length is met and at least the first preset number of consecutive code values ​​are preset values, and a second preset number of different preset binary codes are obtained. The preset coding length can be any value, and optionally, it can be 128 numbers or 96 numbers, etc. The first preset number can be any value, and optionally, it can be 4. The preset value can be any code value, and optionally, it can be 1 or 0. The second preset number can be any value, and optionally, it can be 7. It should be noted that for each preset stripe pattern, the width of the preset stripe pattern can be determined based on the code value length of the corresponding preset binary code; the length of the preset stripe pattern can be determined based on the projection parameters of the projection light machine. In general, the length of the preset stripe pattern can be determined based on the projection parameters of the projection light machine, that is, the number of coding rows corresponding to the preset stripe pattern is determined. Furthermore, the preset binary code can be used as the first row code of the preset stripe pattern, and the preset binary code can be arranged in sequence according to the determined number of code rows, so that the code of each row is the preset binary code. Further, the preset stripe pattern can be generated based on the arranged binary code code. The advantage of such a setting is that it can not only be adjusted to a state where the light and dark changes are clear when adjusting the focal length of the projection light machine, but also has a better improvement effect on the poor effect of short-range effects (subsurface reflections and translucent glass products) encountered in the three-dimensional reconstruction process than the Gray code.

[0037] Exemplarily, it is assumed that the preset encoding length of the preset binary code is 128, and at least 4 consecutive code values ​​are 1. In addition, the number of different preset binary codes is 7. Further, the 7 different preset binary codes are:

[0038] The first preset binary code is: 00000000000000000000000000001111111111111111111111111111111111111111111111111111111111111111111111111111111111110000;

[0040] The second preset binary code is: 0000000000011111111111111111111111111111111110000000000000000000 001111111111111111100000000000000000000000000000000111111111111111111100;

[0042] The third preset binary code is: 0000111111111111111110000000000000000011111111111111111000000000 00000000111111111111111110000000000000011111111111111110000000000000;

[0044] The fourth preset binary code is: 111111110000000001111111100000000011111111100000 00001111111110000000001111111110000000001111111100000000011111111000000000;

[0046] The fifth preset binary code is: 0011110000111100001111000011110000111100001111000011 111111000011110000111100001111000011110000111100001111000011110000011110000001111;

[0048] The sixth preset binary code is: 0001111000011110000111100001111000011110000111100001111000001 1110000111100001111000011110000111100001111000011110000111100001111000011110;

[0050] The seventh preset binary code is:

[0051] 011110000111100001111000011110000111100001111000011110000111 10000111100001111000011110000111100001111000011110000111100001111000011110000.

[0052] Further, 7 preset stripe patterns can be generated according to the above 7 preset binary codes. Then, the 7 preset stripe patterns are deployed in the projection light machine. The object to be tested is placed in the preset calibration area. Further, for the 7 preset stripe patterns, the preset stripe patterns can be projected onto the surface of the object to be tested by the projection light machine, and the object to be tested is photographed by the shooting device to obtain the image to be processed. Then, 7 images to be processed with different preset stripe patterns projected on the object to be tested can be obtained.

[0053] S120, determining a target decoding result corresponding to the object to be measured according to the multiple images to be processed; wherein the target decoding result includes target decoding values ​​corresponding to multiple target pixels.

[0054] Among them, the target decoding result can be understood as the decoding result obtained after pixel-by-pixel decoding processing is performed on each pixel in multiple images to be processed. Each target pixel in the target decoding result corresponds to a target decoding value, and the target decoding value corresponding to each target pixel is determined by the grayscale value corresponding to the corresponding pixel in the multiple images to be processed. In other words, for each target pixel in the target decoding result, the grayscale value corresponding to the pixel at the same position as the target pixel in each image to be processed can be determined respectively. Furthermore, the target decoding value corresponding to the target pixel can be determined based on these multiple grayscale values. Exemplarily, for the first target pixel ranked first in the target decoding result, the grayscale value of the first pixel ranked first in each image to be processed can be determined respectively. Further, the target decoding value corresponding to the first target pixel can be determined based on the grayscale values ​​of these multiple pixels.

[0055] In this embodiment, the object to be tested included in the image to be processed is projected with a preset stripe pattern, and the preset stripe pattern is generated based on a preset binary code. Then, after obtaining multiple images to be processed, the preset binary code corresponding to the image to be processed can be decoded. Furthermore, the multiple images to be processed can be processed pixel by pixel, and the target decoding value corresponding to the corresponding target pixel in the target decoding result can be determined according to the gray value corresponding to each pixel in the multiple images to be processed.

[0056] As an optional implementation of this embodiment, a blank decoding map can be generated according to the pixel association information corresponding to the pixel in the image to be processed, and the decoding value corresponding to each blank pixel in the blank decoding map is 0. Afterwards, for each blank pixel in the blank decoding map, the grayscale value of the pixel at the same position as the blank pixel in each image to be processed can be obtained respectively. Furthermore, the target decoding value corresponding to the blank pixel can be determined according to the multiple grayscale values ​​obtained. Furthermore, the decoding value of the corresponding blank pixel is updated based on the target decoding value corresponding to each blank pixel, and the image obtained after the decoding value is updated is used as the target decoding result. Among them, the pixel association information may include the number of pixels and / or the arrangement position of the pixels, etc.

[0057] S130. For each target pixel in the target decoding result, determine a height value corresponding to the target pixel according to a target decoding value corresponding to the target pixel, a preset initial calibration decoding value, and a preset calibration model corresponding to the target pixel.

[0058] Among them, the image acquisition height corresponding to the target decoding value is the same as the image acquisition height corresponding to the initial calibration decoding value; the image acquisition height is used to indicate the distance between the shooting device and the preset calibration plane. The shooting device can be used to shoot an image with a pattern projection. The shooting device can be a device for shooting an image to be processed. The preset calibration plane can be a pre-set calibration area plane. The distance represented by the image acquisition height can be the distance between the lower end of the lens of the shooting device and the preset calibration plane. In this embodiment, the object to be measured can be placed on the preset calibration plane, and then, the object to be measured with the preset stripe pattern projection can be photographed by the set shooting device, and the image to be processed can be obtained. Then, the target decoding value corresponding to the target pixel point can be determined based on the image to be processed. In the module calibration stage, the deployed preset stripe pattern can be projected to the preset calibration plane by a projection optical machine. Further, the preset calibration plane with the preset stripe pattern projection can be photographed by the set shooting device to obtain a calibration image. Then, the initial calibration decoding value corresponding to the target pixel point can be determined based on the calibration image.

[0059] The preset calibration model can be understood as a predetermined function model used to characterize the functional relationship between the target decoded value, the calibrated decoded value and the height value. It should be noted that the preset calibration model can correspond to the target pixel point, and different target pixels can correspond to different preset calibration models. Exemplarily, the preset calibration model can be a nonlinear polynomial model. Among them, H represents the height value; A, B and C represent parameters, which are known parameters; Indicates the difference between the target decoded value and the calibrated decoded value.

[0060] In this embodiment, for each target pixel in the target decoding result, a preset initial calibration decoding value corresponding to the target pixel can be obtained, and then, the target decoding value and the initial calibration decoding value corresponding to the target pixel can be processed based on the preset calibration model to determine the height value corresponding to the target pixel.

[0061] Optionally, the height value corresponding to the target pixel point is determined based on the target decoding value corresponding to the target pixel point, the preset initial calibration decoding value and the preset calibration model, including: determining the difference between the target decoding value and the preset initial calibration decoding value to obtain the code value difference; inputting the code value difference into the preset calibration model to obtain the height value corresponding to the target pixel point.

[0062] As an optional implementation of this embodiment, a preset calibration decoded value corresponding to the target pixel point can be obtained. Then, the difference between the target decoded value and the initial calibration decoded value can be determined, and the obtained difference can be used as the code value difference. Furthermore, the code value difference can be input into a preset calibration model, and the value output by the model can be used as the height value corresponding to the target pixel point.

[0063] It should be noted that before applying the preset calibration model provided in this embodiment, the preset calibration model can be determined in the module calibration stage. Optionally, the process of determining the preset calibration model can be: obtaining calibration image groups with preset stripe patterns projected on multiple preset calibration planes; wherein the multiple calibration image groups include an initial calibration image group and at least one moving calibration image group; the calibration image group includes multiple calibration images; each calibration image group corresponds to a different image acquisition height; for each calibration image group, based on the multiple calibration images included in the calibration image group, determine the calibration decoding result corresponding to the calibration image group; wherein the calibration decoding result includes an initial calibration decoding result and a moving calibration decoding result; the initial calibration decoding result includes initial calibration decoding values ​​corresponding to multiple initial calibration pixel points; the moving calibration decoding result includes moving calibration decoding values ​​corresponding to multiple moving calibration pixel points; for the initial calibration decoding result, For each initial calibration pixel point, based on at least one mobile calibration decoding result, a mobile calibration decoding value corresponding to at least one mobile calibration pixel point matching the initial calibration pixel point is determined, and a difference between the initial calibration decoding value corresponding to the initial calibration pixel point and at least one determined mobile calibration decoding value is determined to obtain at least one calibration decoding offset value corresponding to the initial calibration pixel point; based on an image acquisition height corresponding to a mobile calibration image group and an image acquisition height corresponding to at least one initial calibration image group, at least one calibration height difference value corresponding to the initial calibration pixel point is determined; based on at least one calibration decoding offset value corresponding to the initial calibration pixel point, at least one calibration height difference value and a pre-constructed polynomial model, a preset calibration model corresponding to the initial calibration pixel point is determined.

[0064] In this embodiment, the initial calibration image group can be understood as an image group obtained after the preset calibration plane is projected and photographed for the first time. The moving calibration image group can be understood as an image group obtained after the preset calibration plane is adjusted in height and then the adjusted preset calibration plane is projected and photographed. The image acquisition height corresponding to each calibration image group is different. That is, in the case of obtaining the initial calibration image group, the image acquisition height can be adjusted by adjusting the preset calibration plane. Then, the image group acquisition can be performed again to obtain the corresponding moving calibration image group at the current image acquisition height. After that, the image acquisition height can be adjusted again by adjusting the preset calibration plane, and then, the image group acquisition can be performed again to obtain the corresponding moving calibration image group at the current image acquisition height. Further, the above operation is repeated for multiple times until the preset calibration end condition is reached. Then, multiple calibration image groups including an initial calibration image group and at least one moving calibration image group can be obtained. It should be noted that adjusting the preset calibration plane may include moving the preset calibration plane up by a preset distance; or moving the preset calibration plane down by a preset distance, etc. The preset calibration end condition may be that the number of times the preset calibration plane is adjusted reaches a preset number threshold; or, it may be that the adjusted image acquisition height reaches a preset height threshold, etc. The pre-built polynomial model may be a nonlinear polynomial model, for example, Among them, k1, k2, k3, …, k n Indicates unknown parameters; H indicates the moving calibration height; Indicates the calibration decoding offset value.

[0065] In this embodiment, the calibration decoding result can be understood as the decoding result obtained after decoding multiple calibration images with preset stripe pattern projections included in the calibration image group. The calibration decoding result may include calibration decoding values ​​corresponding to multiple calibration pixels. The calibration decoding result corresponding to the initial calibration image group includes initial calibration decoding values ​​corresponding to multiple initial calibration pixels; the calibration decoding result corresponding to the moving calibration image group includes moving calibration decoding values ​​corresponding to multiple moving calibration pixels. It should be noted that the number and arrangement position of the calibration pixels included in the calibration decoding result are consistent with the number and arrangement position of the target pixels included in the target decoding result.

[0066] As an optional implementation of this embodiment, multiple calibration images with a preset stripe pattern projected on a preset calibration plane can be obtained to obtain an initial calibration image group. Afterwards, the preset calibration plane is moved up by a preset distance to reduce the distance between the preset calibration plane and the shooting device, the current image acquisition height is determined, and multiple calibration images with a preset stripe pattern projected on the preset calibration plane are obtained to obtain a moving calibration image group. Afterwards, the preset calibration plane is moved up by a preset distance again to reduce the distance between the preset calibration plane and the shooting device again, the current image acquisition height is determined again, and multiple calibration images with a preset stripe pattern projected on the preset calibration plane are obtained to obtain a moving calibration image group. Afterwards, the above operation is repeatedly performed multiple times until the preset calibration end condition is reached. Then, multiple calibration image groups including an initial calibration image group and at least one moving calibration image group can be obtained. Further, for each calibration image group, a calibration decoding result corresponding to the calibration image group can be determined based on the multiple calibration images included in the calibration image group. Among them, the calibration decoding result corresponding to the initial calibration image group includes initial calibration decoding values ​​corresponding to multiple initial calibration pixel points; the calibration decoding result corresponding to the moving calibration image group includes moving calibration decoding values ​​corresponding to multiple moving calibration pixel points.

[0067] Further, for each initial calibration pixel in the initial calibration decoding result, a mobile calibration decoding value corresponding to at least one mobile calibration pixel matching the initial calibration pixel is determined based on at least one mobile calibration decoding result, and the difference between the initial calibration decoding value corresponding to the initial calibration pixel and the at least one determined mobile calibration decoding value is determined to obtain at least one calibration decoding offset value corresponding to the initial calibration pixel, and the image acquisition height corresponding to the at least one mobile calibration pixel can be determined as at least one mobile calibration height corresponding to the initial calibration pixel. Further, for each initial calibration pixel in the initial calibration decoding result, when at least one calibration decoding offset value and at least one mobile calibration height corresponding to the initial calibration pixel are obtained, a data set can be constructed based on the at least one calibration decoding offset value and at least one mobile calibration height according to the mobile calibration image group corresponding thereto, so as to obtain at least one calibration data set corresponding to the initial calibration pixel, and each calibration data set includes the calibration decoding offset value and the mobile calibration height corresponding to the corresponding mobile calibration image group. Afterwards, at least one calibration data set can be input into a pre-constructed polynomial model. Furthermore, the polynomial model of the input data is solved by constructing an overdetermined set of equations to determine the unknown parameters in the polynomial model. Furthermore, when each unknown parameter in the polynomial model is determined, the polynomial model after updating the unknown parameters is used as the preset calibration model corresponding to the initial calibration pixel point.

[0068] S150 , determining the object height corresponding to the object to be measured according to the height value corresponding to each target pixel point.

[0069] In this embodiment, the number and arrangement position of the target pixel points are matched with the image to be processed, and then, the pixel points corresponding to the bottom and the pixel points corresponding to the top of the object to be measured can be determined based on the image to be processed. Then, the height value corresponding to the bottom and the height value corresponding to the top can be determined according to the matching relationship between the pixel points in the image to be processed and the target pixel points and the height value corresponding to the target pixel points. Furthermore, the height value corresponding to the top and the height value corresponding to the bottom can be subtracted to obtain the object height of the object to be measured.

[0070] The technical solution of the embodiment of the present invention is to obtain multiple images to be processed with preset stripe patterns projected on the object to be tested; wherein the preset stripe patterns corresponding to the object to be tested in each image to be processed are different; the preset stripe patterns are generated based on preset binary codes; different preset binary codes are all encoded and generated according to the same preset coding rule. Further, the target decoding result corresponding to the object to be tested is determined according to the multiple images to be processed; wherein the target decoding result includes target decoding values ​​corresponding to multiple target pixels, further, for each target pixel in the target decoding result, the height value corresponding to the target pixel is determined according to the target decoding value corresponding to the target pixel, the preset initial calibration decoding value and the preset calibration model corresponding to the target pixel, further, the object height corresponding to the object to be tested is determined according to the height value corresponding to each target pixel, which solves the problem that the focal length adjustment process in the related art is relatively complicated and laborious, and the stripe anti-noise ability adopted is poor, and the preset binary code generated based on the preset coding rule is used for three-dimensional reconstruction, thereby reducing the computational complexity and thus improving the efficiency of three-dimensional reconstruction. In addition, the effect of reducing labor costs and equipment costs under the premise of ensuring accuracy is achieved.

[0071] Embodiment 2

[0072] Figure 3 This is a flow chart of a three-dimensional measurement method based on structured light projection provided in the second embodiment of the present invention. Based on the above embodiment, S120 is refined. The specific implementation method can refer to the technical solution of this embodiment. Among them, the technical terms that are the same or similar to the above embodiment are not repeated here.

[0073] like Figure 3 As shown, the method includes:

[0074] S210, obtaining a plurality of images to be processed with a preset stripe pattern projected on the object to be measured.

[0075] S220 , determining an intermediate decoding result corresponding to the object to be measured according to the multiple images to be processed, wherein the intermediate decoding result includes an intermediate decoding value corresponding to each target pixel.

[0076] The intermediate decoded value corresponding to the target pixel is determined by the grayscale values ​​of the corresponding pixels in the multiple images to be processed.

[0077] In this embodiment, the intermediate decoding result can be understood as an intermediate result obtained in the decoding process of multiple images to be processed. In other words, the intermediate decoding result needs to be further decoded to obtain the target decoding result.

[0078] In this embodiment, after acquiring multiple images to be processed, the preset binary code corresponding to the images to be processed can be decoded according to the grayscale value corresponding to each pixel in the multiple images to be processed. The intermediate decoding value corresponding to the corresponding target pixel is determined according to the grayscale value corresponding to each pixel in the multiple images to be processed, and then the intermediate decoding result corresponding to the object to be tested can be obtained.

[0079] Optionally, an intermediate decoding result corresponding to the object to be tested is determined based on multiple images to be processed, including: determining a blank decoding map based on pixel association information corresponding to the image to be processed; for each target pixel in the blank decoding map, respectively obtaining the grayscale value corresponding to the pixel matching the target pixel in each image to be processed, and determining the intermediate decoding value corresponding to the target pixel based on the multiple grayscale values ​​obtained; and determining the intermediate decoding result based on the intermediate decoding value corresponding to each target pixel.

[0080] The pixel association information includes the number of pixels and the position of the pixels. The decoding value corresponding to each target pixel in the blank decoding map is a null value. In this embodiment, the number of target pixels included in the blank decoding map is consistent with the number of pixels included in the image to be processed. Moreover, the arrangement position of each target pixel included in the blank decoding map is consistent with the arrangement position of each pixel included in the image to be processed.

[0081] As an optional implementation of this embodiment, a blank decoding map can be generated according to the number of pixels and pixel positions corresponding to the image to be processed, and the blank decoding map is composed of multiple target pixels, and the number and arrangement positions of the target pixels are consistent with the number and arrangement positions of the pixels included in the image to be processed. In addition, the decoding value corresponding to each target pixel in the blank decoding map is a null value. Further, for each target pixel in the blank decoding map, the pixel at the same pixel position as the target pixel in each image to be processed can be determined respectively, and the grayscale value of each determined pixel can be obtained respectively. Afterwards, the intermediate decoding value corresponding to the target pixel can be determined based on the multiple grayscale values ​​that have been obtained. Further, the intermediate decoding result can be determined based on the intermediate decoding values ​​corresponding to the multiple target pixels.

[0082] It should be noted that the image to be processed is an image with a preset stripe pattern projected on the object to be tested, although the preset stripe pattern is an image composed of two grayscale values, that is, the grayscale value corresponding to each pixel in the preset stripe pattern is a first grayscale value or a second grayscale value. However, the grayscale value corresponding to each pixel in the image to be processed obtained by projecting the preset stripe pattern onto the object to be tested can be any grayscale value. Furthermore, in order to more quickly determine the intermediate decoding value of the target pixel based on the grayscale values ​​of the pixels in multiple images to be processed, the grayscale values ​​can be converted into code values ​​for the multiple grayscale values ​​corresponding to the target pixel. Furthermore, the intermediate decoding value corresponding to the target pixel can be constructed based on the multiple code values.

[0083] Optionally, an intermediate decoding value corresponding to the target pixel point is determined based on multiple grayscale values ​​that have been acquired, including: for multiple pixel points that match the target pixel point, when the grayscale value corresponding to the pixel point is greater than or equal to a preset grayscale value threshold, the decoding value corresponding to the pixel point is determined as a first decoding value; when the grayscale value corresponding to the pixel point is less than a preset grayscale value threshold, the decoding value corresponding to the pixel point is determined as a second decoding value; the decoding values ​​corresponding to the multiple pixel points are arranged according to a preset arrangement order, and the decoding values ​​obtained after the arrangement are used as the intermediate decoding values ​​corresponding to the target pixel point.

[0084] Among them, the preset gray value threshold may be a gray value threshold corresponding to the target pixel point for which the intermediate decoded value is to be determined. That is, each target pixel point corresponds to a preset gray value threshold. In this embodiment, a first reference image with a black image projection on the object to be tested and a second reference image with a white projection on the object to be tested may be obtained. Further, for each target pixel point in the blank decoded image, a first gray value of a pixel point matching the target pixel point in the first reference image and a second gray value of a pixel point matching the target pixel point in the second reference image may be obtained. Further, the first gray value and the second gray value may be averaged, and the obtained average may be used as the preset gray value threshold corresponding to the target pixel point. The first decoded value may be any binary code value, optionally, 1 or 0. The second decoded value may be any binary code value, optionally, 1 or 0. The preset arrangement order may be an arrangement order determined according to the sequence number of the current image to be processed in the multiple images to be processed, the number of images to be processed, and the binary representation rule. In this embodiment, the intermediate decoded value may be a binary code value composed of multiple decoded values. For example, assuming that the decoded value corresponding to the corresponding pixel in the first image to be processed is 0, 0 can be shifted left by (Ni) bits, where N represents the number of images to be processed and i represents the sequence number of the current image to be processed (the sequence number of the image starts from 1). For example, when N is 7, 0 can be shifted left by 6 bits.

[0085] As an optional implementation of the present embodiment, for a plurality of pixel points that match the target pixel point, a preset gray value threshold corresponding to the target pixel point can be obtained. Further, the gray value of the pixel point can be compared with the preset gray value threshold. Then, when the gray value is greater than or equal to the preset gray value threshold, the code value corresponding to the pixel point can be determined as the first decoding value. When the gray value is less than the preset gray value threshold, the code value corresponding to the pixel point can be determined as the second decoding value. Further, when the decoding values ​​corresponding to the plurality of pixel points that match the target pixel point are obtained, the plurality of gray values ​​can be arranged according to a preset arrangement order, and then, the decoding value obtained after the arrangement can be used as the intermediate decoding value corresponding to the target pixel point.

[0086] Exemplarily, assuming that the number of images to be processed is 7, for the 7 pixels corresponding to the target pixel, the decoding value corresponding to the corresponding pixel in the first image to be processed (image number 1) is 0, the decoding value corresponding to the corresponding pixel in the second image to be processed (image number 2) is 0, the decoding value corresponding to the corresponding pixel in the third image to be processed (image number 3) is 0, the decoding value corresponding to the corresponding pixel in the fourth image to be processed (image number 4) is 0, the decoding value corresponding to the corresponding pixel in the fifth image to be processed (image number 5) is 0, the decoding value corresponding to the corresponding pixel in the sixth image to be processed (image number 6) is 0, and the decoding value corresponding to the corresponding pixel in the seventh image to be processed (image number 7) is 1. Furthermore, after arranging the decoding values ​​corresponding to the multiple pixels according to the preset arrangement order, the decoding value obtained is 0000001, which can be used as the intermediate decoding value corresponding to the target pixel.

[0087] In this embodiment, after the intermediate decoding value corresponding to each target pixel is obtained, the intermediate decoding result corresponding to the object to be measured can be determined based on the intermediate decoding values ​​corresponding to the multiple target pixels.

[0088] S230. For each target pixel in the intermediate decoding result, determine a target decoding value corresponding to the target pixel according to the intermediate decoding value corresponding to the target pixel and a preset code value table corresponding to a preset encoding rule based on the preset binary code.

[0089] The preset code value table may be a predetermined code value comparison table used in the decoding process. It should be noted that the preset code value table is determined based on a preset coding rule. When the preset coding rule is different, the preset code value table used in the decoding process is also different.

[0090] Exemplarily, assuming that the preset coding rule includes a coding length of 128 bits and at least 4 consecutive code values ​​are 1, the corresponding preset code value table may be:

[0091] "127,90,126,91,88,89,61,60,0,1,85,84,87,2,86,3,8,9,77,76,79,10,78,11,7,82,6,83,80,81,5,4,24,25,125,124,63,26,62,27,23,66,22,67,64,65,21,20,15,74,14,75,72,73,13,12,16,17,69,68,71,18,70,19,56,57,93,92,95, 58,94,59,55,98,54,99,96,97,53,52,47,106,46,107,104,105,45,44,48,49,101,100,103,50,102,51,31,122,30,123,120,121,29,28,32,33,117,116,119,34,118,35,40,41,109,108,111,42,110,43,39,114,38,115,112,113,37,36";

[0092] Assuming that the preset coding rule includes a coding length of 96 bits and at least 4 consecutive code values ​​are 1, the corresponding preset code value table can be:

[0093] “95,12,0,11,24,35,23,36,72,83,71,84,47,60,48,59,26,13,1,38,25,14,2,37,73,62,50,85,74,61,49,86,-10,-10,-10,-10,-10,-10,-10,-10,-10,-10,-10,-10,-10,-10,-10,-10,-10,-10,-10,27,64,52,39,76,15,3,88,28,63,51,40,75,16,4,87, 94,81,69,10,93,34,22,57,45,82,70,9,46,33,21,58,-10,-10,-10,-10,-10,-10,-10,-10,-10,-10,-10,-10,-10,-10,-10,-10,-10,-10,-10,-10,-10,67,80,68,55,92,79,91,56,44,31,43,8,19,32,20,7,66,65,53,54,77,78,90,89,29,30,42,41,18,17,5,6”.

[0094] The target decoding value may be a code value that ultimately meets the decoding standard.

[0095] In this embodiment, when an intermediate decoding result is obtained, for each target pixel in the intermediate decoding result, the intermediate decoding value corresponding to the target pixel is a code value expressed in binary form. In order to improve the readability and calculation convenience of the data, the intermediate decoding value can be further decoded according to a predetermined preset code value table to obtain the target decoding value corresponding to the target pixel.

[0096] Optionally, the target decoding value corresponding to the target pixel point is determined based on the intermediate decoding value corresponding to the target pixel point and the preset code value table corresponding to the preset encoding rule based on the preset binary code, including: performing decimal conversion on the intermediate decoding value corresponding to the target pixel point to obtain a decimal code value corresponding to the target pixel point; determining the target code value sequence number based on the decimal code value, determining the target code value corresponding to the target code value sequence number from the preset code value table, and using the target code value as the target decoding value corresponding to the target pixel point.

[0097] The target code value sequence number may be a code value sequence number determined when the decimal code value is used as the sequence number. For example, assuming that the decimal code value obtained is 1, its corresponding target code value sequence number may be 1. It should be noted that the code value sequence numbers in the preset code value table are arranged starting from 0.

[0098] As an optional implementation of this embodiment, when the intermediate decoded value corresponding to the target pixel point is obtained, the intermediate decoded value can be converted into a decimal code value to obtain the decimal code value corresponding to the target pixel point. Further, the decimal code value can be used as the target code value sequence number, and the code value corresponding to the target code value sequence number is determined from the preset code value table according to the target code value sequence number. Then, the code value can be used as the target decoded value corresponding to the target pixel point.

[0099] Exemplarily, continue to refer to the above example, assuming that the intermediate decoded value corresponding to the target pixel is 0000001, and the preset code value table used is a code value table corresponding to a code value length of 128 bits. Then, the intermediate decoded value is converted to decimal, and the decimal code value obtained is 1. Further, it can be determined that the target code value sequence number is 1, and then, it can be determined from the corresponding preset code value table in the above example that the code value corresponding to the target code value sequence number 1 is 90. Then, 90 can be used as the target decoded value corresponding to the target pixel.

[0100] S240: Determine a target decoding result based on a target decoding value corresponding to each target pixel point.

[0101] In this embodiment, when the target decoding value corresponding to each target pixel point is obtained, the target decoding result can be determined according to the target decoding values ​​corresponding to the plurality of target pixel points.

[0102] S250. For each target pixel in the target decoding result, determine a height value corresponding to the target pixel according to a target decoding value corresponding to the target pixel, a preset initial calibration decoding value, and a preset calibration model corresponding to the target pixel.

[0103] S260: Determine the object height corresponding to the object to be measured according to the height value corresponding to each target pixel point.

[0104] The technical solution of the embodiment of the present invention is to obtain multiple images to be processed with a preset stripe pattern projection on the object to be tested; wherein the preset stripe pattern corresponding to the object to be tested in each image to be processed is different; the preset stripe pattern is generated based on a preset binary code; and different preset binary codes are all encoded and generated according to the same preset coding rule. Further, the intermediate decoding result corresponding to the object to be tested is determined according to the multiple images to be processed, and then, for each target pixel in the intermediate decoding result, the target decoding value corresponding to the target pixel is determined according to the intermediate decoding value corresponding to the target pixel and the preset code value table corresponding to the preset coding rule based on the preset binary code, and then the target decoding result is determined based on the target decoding value corresponding to each target pixel. Further, for each target pixel in the target decoding result, the height value corresponding to the target pixel is determined according to the target decoding value corresponding to the target pixel, the preset initial calibration decoding value and the preset calibration model corresponding to the target pixel, and then the object height corresponding to the object to be tested is determined according to the height value corresponding to each target pixel, and the preset binary code generated based on the preset coding rule is used for three-dimensional reconstruction, thereby reducing the computational complexity and improving the efficiency of three-dimensional reconstruction. Moreover, it achieves the effect of reducing labor costs and equipment costs while ensuring accuracy.

[0105] Embodiment 3

[0106] Figure 4 Schematic diagram of a three-dimensional measurement device based on structured light projection provided by the third embodiment of the present invention. Figure 4 As shown, the device includes: an image acquisition module 310, a decoding result determination module 320, a pixel height determination module 330 and an object height determination module 340.

[0107] Among them, the image acquisition module 310 is used to acquire a plurality of images to be processed with a preset stripe pattern projected on the object to be tested; wherein the preset stripe pattern corresponding to the object to be tested in each of the images to be processed is different; the preset stripe pattern is generated based on a preset binary code; the different preset binary codes are all encoded and generated according to the same preset encoding rule; the preset encoding rule at least includes a coding length of a preset coding length and at least a continuous preset number of code values ​​as a first preset code value; the decoding result determination module 320 is used to determine the target decoding result corresponding to the object to be tested based on the plurality of images to be processed; wherein the target decoding result includes a target decoding value corresponding to a plurality of target pixel points ; The target decoding value corresponding to each of the target pixel points is determined based on the grayscale values ​​corresponding to the corresponding pixel points in the multiple images to be processed; a pixel height determination module 330 is used to determine the height value corresponding to the target pixel point for each target pixel point in the target decoding result according to the target decoding value corresponding to the target pixel point, a preset initial calibration decoding value and a preset calibration model corresponding to the target pixel point; wherein the image acquisition height corresponding to the target decoding value is the same as the image acquisition height corresponding to the preset calibration decoding value; an object height determination module 340 is used to determine the object height corresponding to the object to be measured according to the height value corresponding to each of the target pixel points.

[0108] The technical solution of the embodiment of the present invention is to obtain multiple images to be processed with a preset stripe pattern projection on the object to be tested; wherein the preset stripe pattern corresponding to the object to be tested in each image to be processed is different; the preset stripe pattern is generated based on a preset binary code; different preset binary codes are all encoded and generated according to the same preset coding rule. Further, the target decoding result corresponding to the object to be tested is determined according to the multiple images to be processed; wherein the target decoding value corresponding to each target pixel in the target decoding result is determined based on the grayscale value corresponding to the corresponding pixel in the multiple images to be processed, further, for each target pixel in the target decoding result, the height value corresponding to the target pixel is determined according to the target decoding value corresponding to the target pixel, the preset initial calibration decoding value and the preset calibration model corresponding to the target pixel, further, the object height corresponding to the object to be tested is determined according to the height value corresponding to each target pixel, so as to solve the problem that the focal length adjustment process in the related art is relatively complicated and laborious, and the stripe anti-noise ability adopted is poor, and the three-dimensional reconstruction is performed by using the preset binary code generated based on the preset coding rule, so as to reduce the computational complexity, thereby improving the efficiency of three-dimensional reconstruction. Moreover, it achieves the effect of reducing labor costs and equipment costs while ensuring accuracy.

[0109] Optionally, the decoding result determination module 320 includes: an intermediate decoding result determination submodule, a target decoding value determination submodule and a target decoding result determination submodule.

[0110] An intermediate decoding result determination submodule is used to determine an intermediate decoding result corresponding to the object to be measured according to the multiple images to be processed; wherein the intermediate decoding result includes intermediate decoding values ​​corresponding to multiple target pixel points;

[0111] a target decoding value determination submodule, configured to determine, for each target pixel in the intermediate decoding result, a target decoding value corresponding to the target pixel according to the intermediate decoding value corresponding to the target pixel and a preset code value table corresponding to a preset coding rule based on the preset binary code;

[0112] The target decoding result determination submodule is used to determine the target decoding result based on the target decoding value corresponding to each target pixel point.

[0113] Optionally, the intermediate decoding result determination submodule includes: a blank decoding map generation unit, an intermediate decoding value determination unit and an intermediate decoding result determination unit.

[0114] A blank decoding map generating unit is used to generate a blank decoding map according to the pixel association information corresponding to the image to be processed; wherein the pixel association information includes the number of pixels and the positions of pixels; and the decoding value corresponding to each target pixel in the blank decoding map is a null value;

[0115] An intermediate decoding value determination unit is used to obtain, for each target pixel in the blank decoding image, the grayscale value corresponding to the pixel matching the target pixel in each of the to-be-processed images, and determine the intermediate decoding value corresponding to the target pixel according to the multiple grayscale values ​​obtained;

[0116] The intermediate decoding result determining unit is used to determine the intermediate decoding result based on the intermediate decoding value corresponding to each of the target pixels.

[0117] Optionally, the intermediate decoding value determining unit includes: a first decoding value determining subunit, a second decoding value determining subunit and an intermediate decoding value determining subunit.

[0118] a first decoding value determining subunit, for determining, for a plurality of pixel points matching the target pixel point, a decoding value corresponding to the pixel point as a first decoding value when the grayscale value corresponding to the pixel point is greater than or equal to a preset grayscale value threshold corresponding to the target pixel point;

[0119] a second decoding value determining subunit, configured to determine the decoding value corresponding to the pixel point as a second decoding value when the gray value corresponding to the pixel point is less than a preset gray value threshold corresponding to the target pixel point;

[0120] The intermediate decoding value determination subunit is used to arrange the decoding values ​​corresponding to the multiple pixel points according to a preset arrangement order, and use the decoding value obtained after the arrangement as the intermediate decoding value corresponding to the target pixel point.

[0121] Optionally, the target decoding value determination submodule includes: a decimal conversion unit and a target decoding value determination unit.

[0122] A decimal conversion unit, used to perform decimal conversion on the intermediate decoded value corresponding to the target pixel point to obtain a decimal code value corresponding to the target pixel point;

[0123] The target decoding value determination unit is used to determine the target code value sequence number according to the decimal code value, determine the code value corresponding to the target code value sequence number from a preset code value table, and use the code value as the target decoding value corresponding to the target pixel point.

[0124] Optionally, the pixel height determination module 330 includes: a code value difference determination unit and a pixel height determination unit.

[0125] A code value difference determination unit, used to determine the difference between the target decoding value and a preset calibration decoding value to obtain a code value difference;

[0126] The pixel point height determination unit is used to input the code value difference into a preset calibration model function to obtain a height value corresponding to the target pixel point.

[0127] Optionally, the device further includes: a calibration image group acquisition module, a calibration decoding result determination module, a decoding difference result determination module and a preset calibration model determination module.

[0128] A calibration image group acquisition module, used to acquire calibration image groups with preset stripe patterns projected on multiple preset calibration planes; wherein the multiple calibration image groups include an initial calibration image group and at least one moving calibration image group; the calibration image group includes multiple calibration images; and each calibration image group corresponds to a different image acquisition height;

[0129] A calibration decoding result determination module, configured to determine, for each calibration image group, a calibration decoding result corresponding to the calibration image group based on a plurality of calibration images included in the calibration image group; wherein the calibration decoding result includes an initial calibration decoding result and a moving calibration decoding result; the initial calibration decoding result includes initial calibration decoding values ​​corresponding to a plurality of initial calibration pixels; the moving calibration decoding result includes moving calibration decoding values ​​corresponding to a plurality of moving calibration pixels;

[0130] A decoding offset value determination module, configured to determine, for each initial calibration pixel point in the initial calibration decoding result, a moving calibration decoding value corresponding to at least one moving calibration pixel point matching the initial calibration pixel point based on at least one of the moving calibration decoding results, determine a difference between the initial calibration decoding value corresponding to the initial calibration pixel point and at least one of the determined moving calibration decoding values ​​to obtain at least one calibration decoding offset value corresponding to the initial calibration pixel point, and determine an image acquisition height corresponding to at least one of the moving calibration pixel points as at least one moving calibration height corresponding to the initial calibration pixel point;

[0131] The preset calibration model determination module is used to determine the preset calibration model corresponding to the initial calibration pixel point based on at least one calibration decoding offset value corresponding to the initial calibration pixel point, at least one moving calibration height and a pre-constructed polynomial model.

[0132] The three-dimensional measurement device based on structured light projection provided in the embodiment of the present invention can execute the three-dimensional measurement method based on structured light projection provided in any embodiment of the present invention, and has the corresponding functional modules and beneficial effects of the execution method.

[0133] Embodiment 4

[0134] Figure 5 A schematic diagram of the structure of an electronic device 10 that can be used to implement an embodiment of the present invention is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices (such as helmets, glasses, watches, etc.) and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present invention described and / or required herein.

[0135] like Figure 5As shown, the electronic device 10 includes at least one processor 11, and a memory connected to the at least one processor 11, such as a read-only memory (ROM) 12, a random access memory (RAM) 13, etc., wherein the memory stores a computer program that can be executed by at least one processor, and the processor 11 can perform various appropriate actions and processes according to the computer program stored in the read-only memory (ROM) 12 or the computer program loaded from the storage unit 18 to the random access memory (RAM) 13. In the RAM 13, various programs and data required for the operation of the electronic device 10 can also be stored. The processor 11, the ROM 12, and the RAM 13 are connected to each other through a bus 14. An input / output (I / O) interface 15 is also connected to the bus 14.

[0136] A number of components in the electronic device 10 are connected to the I / O interface 15, including: an input unit 16, such as a keyboard, a mouse, etc.; an output unit 17, such as various types of displays, speakers, etc.; a storage unit 18, such as a disk, an optical disk, etc.; and a communication unit 19, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 19 allows the electronic device 10 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks.

[0137] The processor 11 may be a variety of general and / or special processing components with processing and computing capabilities. Some examples of the processor 11 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, a digital signal processor (DSP), and any appropriate processor, controller, microcontroller, etc. The processor 11 executes the various methods and processes described above, such as a three-dimensional measurement method based on structured light projection.

[0138] In some embodiments, the three-dimensional measurement method based on structured light projection can be implemented as a computer program, which is tangibly contained in a computer-readable storage medium, such as a storage unit 18. In some embodiments, part or all of the computer program can be loaded and / or installed on the electronic device 10 via the ROM 12 and / or the communication unit 19. When the computer program is loaded into the RAM 13 and executed by the processor 11, one or more steps of the three-dimensional measurement method based on structured light projection described above can be performed. Alternatively, in other embodiments, the processor 11 can be configured to perform the three-dimensional measurement method based on structured light projection in any other appropriate manner (for example, by means of firmware).

[0139] Various implementations of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), load programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various implementations can include: being implemented in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.

[0140] Computer programs for implementing the methods of the present invention may be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, so that when the computer program is executed by the processor, the functions / operations specified in the flow chart and / or block diagram are implemented. The computer program may be executed entirely on the machine, partially on the machine, partially on the machine and partially on a remote machine as a stand-alone software package, or entirely on a remote machine or server.

[0141] In the context of the present invention, a computer-readable storage medium may be a tangible medium that may contain or store a computer program for use by or in combination with an instruction execution system, device or equipment. A computer-readable storage medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, devices or equipment, or any suitable combination of the foregoing. Alternatively, a computer-readable storage medium may be a machine-readable signal medium. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.

[0142] To provide interaction with a user, the systems and techniques described herein may be implemented on an electronic device having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and a pointing device (e.g., a mouse or trackball) through which the user can provide input to the electronic device. Other types of devices may also be used to provide interaction with the user; for example, the feedback provided to the user may be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user may be received in any form (including acoustic input, voice input, or tactile input).

[0143] The systems and techniques described herein may be implemented in a computing system that includes backend components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes frontend components (e.g., a user computer with a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such backend components, middleware components, or frontend components. The components of the system may be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: a local area network (LAN), a wide area network (WAN), a blockchain network, and the Internet.

[0144] A computing system may include a client and a server. The client and the server are generally remote from each other and usually interact through a communication network. The client and server relationship is generated by computer programs running on the corresponding computers and having a client-server relationship with each other. The server may be a cloud server, also known as a cloud computing server or cloud host, which is a host product in the cloud computing service system to solve the defects of difficult management and weak business scalability in traditional physical hosts and VPS services.

[0145] It should be understood that the various forms of processes shown above can be used to reorder, add or delete steps. For example, the steps described in the present invention can be executed in parallel, sequentially or in different orders, as long as the desired results of the technical solution of the present invention can be achieved, and this document does not limit this.

[0146] The above specific implementations do not constitute a limitation on the protection scope of the present invention. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions can be made according to design requirements and other factors. Any modification, equivalent substitution and improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.

Claims

1. A three-dimensional measurement method based on structured light projection, characterized in that: include: Acquire multiple images to be processed with a preset stripe pattern projected on the object to be tested; wherein the preset stripe pattern corresponding to the object to be tested in each of the images to be processed is different; the preset stripe pattern is generated based on a preset binary code; the different preset binary codes are all encoded and generated according to the same preset encoding rule; the preset encoding rule at least includes a code length of a preset code length and at least a continuous preset number of code values ​​being a first preset code value; Determine a target decoding result corresponding to the object to be tested according to the multiple images to be processed; wherein the target decoding result includes target decoding values ​​corresponding to multiple target pixels; the target decoding value corresponding to each target pixel is determined based on the grayscale value corresponding to the corresponding pixel in the multiple images to be processed; For each target pixel in the target decoding result, determine a height value corresponding to the target pixel according to a target decoding value corresponding to the target pixel, a preset initial calibration decoding value, and a preset calibration model corresponding to the target pixel; wherein the image acquisition height corresponding to the target decoding value is the same as the image acquisition height corresponding to the preset calibration decoding value; The object height corresponding to the object to be measured is determined according to the height value corresponding to each target pixel point.

2. The three-dimensional measurement method based on structured light projection according to claim 1, characterized in that: The step of determining a target decoding result corresponding to the object to be detected according to the plurality of images to be processed includes: Determine an intermediate decoding result corresponding to the object to be measured according to the multiple images to be processed; wherein the intermediate decoding result includes intermediate decoding values ​​corresponding to multiple target pixel points; For each target pixel in the intermediate decoding result, determine a target decoding value corresponding to the target pixel according to the intermediate decoding value corresponding to the target pixel and a preset code value table corresponding to a preset coding rule based on the preset binary code; A target decoding result is determined based on the target decoding value corresponding to each of the target pixels.

3. The three-dimensional measurement method based on structured light projection according to claim 2, characterized in that: The step of determining the intermediate decoding result corresponding to the object to be detected according to the plurality of images to be processed includes: Generate a blank decoding map according to the pixel association information corresponding to the image to be processed; wherein the pixel association information includes the number of pixels and the positions of pixels; the decoding value corresponding to each target pixel in the blank decoding map is a null value; For each target pixel in the blank decoding image, respectively obtain the grayscale value corresponding to the pixel matching the target pixel in each of the to-be-processed images, and determine the intermediate decoding value corresponding to the target pixel according to the multiple grayscale values ​​obtained; An intermediate decoding result is determined based on the intermediate decoding value corresponding to each of the target pixels.

4. The three-dimensional measurement method based on structured light projection according to claim 3, characterized in that: The determining the intermediate decoding value corresponding to the target pixel point according to the acquired multiple grayscale values ​​includes: For a plurality of pixel points that match the target pixel point, when the grayscale value corresponding to the pixel point is greater than or equal to a preset grayscale value threshold corresponding to the target pixel point, determining the decoded value corresponding to the pixel point as a first decoded value; When the grayscale value corresponding to the pixel point is less than a preset grayscale value threshold corresponding to the target pixel point, determining the decoded value corresponding to the pixel point as a second decoded value; The decoded values ​​corresponding to the plurality of pixels are arranged according to a preset arrangement order, and the decoded values ​​obtained after the arrangement are used as the intermediate decoded values ​​corresponding to the target pixel.

5. The three-dimensional measurement method based on structured light projection according to claim 2, characterized in that: The determining the target decoding value corresponding to the target pixel point according to the intermediate decoding value corresponding to the target pixel point and the preset code value table corresponding to the preset coding rule based on the preset binary code includes: Performing decimal conversion on the intermediate decoded value corresponding to the target pixel point to obtain a decimal code value corresponding to the target pixel point; A target code value sequence number is determined according to the decimal code value, a code value corresponding to the target code value sequence number is determined from a preset code value table, and the code value is used as a target decoding value corresponding to the target pixel point.

6. The three-dimensional measurement method based on structured light projection according to claim 1, characterized in that: The determining the height value corresponding to the target pixel point according to the target decoded value corresponding to the target pixel point, the preset initial calibration decoded value and the preset calibration model includes: Determining a difference between the target decoding value and a preset initial calibration decoding value to obtain a code value difference; The code value difference is input into a preset calibration model to obtain a height value corresponding to the target pixel point.

7. The three-dimensional measurement method based on structured light projection according to claim 1, characterized in that: Also includes: Acquire a plurality of calibration image groups with a preset fringe pattern projection on a preset calibration plane; wherein the plurality of calibration image groups include an initial calibration image group and at least one moving calibration image group; the calibration image group includes a plurality of calibration images; and each calibration image group corresponds to a different image acquisition height; For each calibration image group, a calibration decoding result corresponding to the calibration image group is determined based on a plurality of calibration images included in the calibration image group; wherein the calibration decoding result includes an initial calibration decoding result and a moving calibration decoding result; the initial calibration decoding result includes initial calibration decoding values ​​corresponding to a plurality of initial calibration pixels; the moving calibration decoding result includes moving calibration decoding values ​​corresponding to a plurality of moving calibration pixels; For each initial calibration pixel point in the initial calibration decoding result, determine a moving calibration decoding value corresponding to at least one moving calibration pixel point matching the initial calibration pixel point based on at least one of the moving calibration decoding results, determine a difference between the initial calibration decoding value corresponding to the initial calibration pixel point and at least one of the determined moving calibration decoding values ​​to obtain at least one calibration decoding offset value corresponding to the initial calibration pixel point, and determine an image acquisition height corresponding to at least one of the moving calibration pixel points as at least one moving calibration height corresponding to the initial calibration pixel point; Based on at least one calibration decoding offset value corresponding to the initial calibration pixel point, at least one movement calibration height, and a pre-constructed polynomial model, a preset calibration model corresponding to the initial calibration pixel point is determined.

8. A three-dimensional measurement device based on structured light projection, characterized in that: include: An image acquisition module, used for acquiring a plurality of images to be processed with a preset stripe pattern projected on the object to be tested; wherein the preset stripe pattern corresponding to the object to be tested in each of the images to be processed is different; the preset stripe pattern is generated based on a preset binary code; the different preset binary codes are all encoded and generated according to the same preset encoding rule; the preset encoding rule at least includes a code length of a preset code length and at least a continuous preset number of code values ​​as a first preset code value; A decoding result determination module, used to determine a target decoding result corresponding to the object to be tested according to the multiple images to be processed; wherein the target decoding result includes a target decoding value corresponding to a plurality of target pixels; the target decoding value corresponding to each target pixel is determined based on the grayscale value corresponding to the corresponding pixel in the multiple images to be processed; A pixel height determination module, for each target pixel in the target decoding result, determining a height value corresponding to the target pixel according to a target decoding value corresponding to the target pixel, a preset initial calibration decoding value, and a preset calibration model corresponding to the target pixel; wherein the image acquisition height corresponding to the target decoding value is the same as the image acquisition height corresponding to the preset calibration decoding value; The object height determination module is used to determine the object height corresponding to the object to be measured according to the height value corresponding to each target pixel point.

9. An electronic device, characterized in that: The electronic device comprises: at least one processor; and a memory communicatively connected to the at least one processor; wherein, The memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can execute the three-dimensional measurement method based on structured light projection according to any one of claims 1 to 7.

10. 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 implement the three-dimensional measurement method based on structured light projection according to any one of claims 1 to 7 when executed.