Variable frequency fringe encoding and decoding method and device for fast three-dimensional measurement and medium
By employing a frequency-varying stripe encoding and decoding method, and utilizing system calibration and geometrically constrained phase unfolding, the problem of depth range imbalance in 3D measurement is solved, achieving high-precision and rapid 3D topography recovery, applicable to various measurement scenarios.
Patent Information
- Application Number
- CN202410146829.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-02-01
- Publication Date
- 2025-11-04
- Estimated Expiration
- 2044-02-01
AI Technical Summary
In existing 3D measurement methods, phase unfolding methods based on geometric constraints suffer from an imbalance in the measurement depth range, leading to measurement failures. Furthermore, traditional methods cannot achieve high-speed and high-precision phase unfolding.
The variable frequency stripe encoding and decoding method is adopted. The imaging model is obtained through system calibration, the reference plane and the maximum target plane are determined, the optimal encoding pixel offset is obtained according to the target depth range, the stripe frequency and phase are calculated, and a lookup table is established for pixel matching to restore the three-dimensional shape.
It achieves a large measurement range, high accuracy, and high speed, solves the problem of unbalanced depth range, adapts to different equipment and measurement scenarios, and improves measurement stability and automation.
Smart Images

Figure CN118225001B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of computer vision technology, and in particular to a variable frequency stripe encoding and decoding method, apparatus and medium for rapid 3D measurement. Background Technology
[0002] Digital fringe projection profilometry is widely used in industrial inspection, intelligent manufacturing, reverse engineering, and cultural relic preservation. Its basic process involves a computer-controlled projector projecting a series of structured periodic fringe patterns (usually sinusoidal fringes) onto the surface of the object being measured. The fringe patterns deform on the surface, and the deformed fringes are photographed by a camera. The phase information is then calculated and matched with the original fringe phase in the projector. Triangulation is then used to obtain the three-dimensional shape of the object. However, because fringe decoding requires the use of the arctangent function, only the phase between (-π, π) can be obtained, leading to phase truncation. This phenomenon is called phase wrapping or phase entanglement. The process of recovering the untruncation absolute phase from the wrapped phase is called phase unwrapping (or phase unwinding, phase unwrapping).
[0003] Currently used phase unwrapping methods mainly include spatial phase unwrapping methods, temporal phase unwrapping methods, and methods based on composite fringes. However, these methods struggle to simultaneously achieve high-speed and high-precision phase unwrapping. Geometric constraint-based methods, on the other hand, require no continuity assumptions, do not require projecting additional fringes, and do not affect fringe quality; they unwrap the phase solely through the geometric constraints of the digital fringe projection system itself. For example... Figure 1 As shown, based on the known reference phase plane Φ ref For the phase to be unfolded, φ, simply calculate the difference between the two and add the corresponding 2π to unfold the phase. This method has advantages in both speed and accuracy, but it can only recover the depth range corresponding to the 2π phase range. Since existing methods generally use sinusoidal fringes of constant frequency, and due to the "nearer is larger, farther is smaller" imaging characteristic of common lenses, using geometric constraint methods will result in an imbalance in the measured depth range, such as... Figure 2 As shown, the reference plane and the maximum measurement plane are not parallel, resulting in an imbalance in the actual measurement range. This can lead to unexpected phase unfolding failures, resulting in erroneous measurement results, such as... Figure 3 As shown, a correct measurement can only be performed if and only if the entire object is below the maximum measurement plane. Summary of the Invention
[0004] In order to at least partially solve one of the technical problems existing in the prior art, the purpose of this invention is to provide a variable frequency stripe encoding and decoding method, device and medium for rapid three-dimensional measurement.
[0005] The technical solution adopted in this invention is:
[0006] A variable frequency fringe encoding and decoding method for fast three-dimensional measurement, comprising the following steps:
[0007] In the fringe encoding stage, the optimal encoding pixel offset is obtained according to the target depth range, the fringe frequency and the corresponding phase are determined, the optimal fringe encoding is obtained, and the phase is stored in a lookup table;
[0008] In the fringe decoding stage, the encoded fringe pattern is emitted to the surface of the object to be measured, the fringe is deformed, the deformed fringe sequence is obtained, the absolute phase is obtained by using the existing geometric constraint phase unwrapping method, the pixel matching is performed through the lookup table established in the fringe encoding stage, and the three-dimensional shape of the object to be measured is restored.
[0009] Further, the variable frequency fringe encoding and decoding method further comprises the steps of system calibration and parameter initialization:
[0010] The intrinsic and extrinsic parameters of the projector and the camera are obtained through system calibration, and a structured light system imaging model is obtained;
[0011] The reference plane and the maximum target plane are determined.
[0012] Further, the expression of the structured light system imaging model is:
[0013] s c [u c v c 1] T =P c [x w y w z w 1] T
[0014] s p [u p v p 1] T =P p [x w y w z w 1] T (1)
[0015] Wherein, s c and s p are scale factors, u c ,v c are camera pixel coordinates, u p ,v p are projection pixel coordinates, x w ,y w ,z w are three-dimensional space coordinates to be solved, P c ,P vis a projection matrix of the camera and the projector;
[0016] The determining the reference plane and the maximum target plane comprises:
[0017] A coordinate system is established with the camera optical center as the coordinate axis origin, wherein the horizontal direction is the x-axis, the vertical direction is the y-axis, and the optical axis direction is the z-axis;
[0018] A plane perpendicular to the z-axis is used as the reference plane and the maximum target plane, respectively denoted as z=z ref and z=z obj At this time, there are:
[0019] Δz=z {obj} -z {ref} (2)
[0020] Wherein, Δz is the maximum measurement depth range.
[0021] Further, the obtaining the optimal encoding pixel offset according to the target depth range comprises:
[0022] For any camera pixel (u c ,v c ), the reference plane and the maximum target plane are substituted into the structured light system imaging model to obtain the projector pixels corresponding to the reference plane and the maximum target plane respectively and
[0023] Further, the determining the fringe frequency and the corresponding phase comprises:
[0024] According to the property that the phase difference between the reference plane and the maximum target plane is 2π, the following can be obtained:
[0025]
[0026] Suppose that the u p direction of the projector is used for fringe encoding, that is, the phase only changes with the u p coordinate, then formula (3) can be transformed into:
[0027]
[0028] According to the relationship between the phase and the frequency, the following can be obtained:
[0029]
[0030] Formula (4) is further transformed into:
[0031]
[0032] Considering the monotonicity and continuity of the phase, it is expressed as a polynomial, denoted as:
[0033]
[0034] For each pair of and , equation (7) holds, so the phase curve can be obtained by using polynomial fitting method.
[0035] Substitute the polynomial in equation (7) into equation (4), and perform polynomial fitting on the obtained projector pixels and corresponding to the reference plane and the maximum target plane respectively, to obtain the mapping relationship between the projector pixels and the phase, thereby obtaining the relative phase between pixels and , where and represent the minimum and maximum values among all and pixels respectively; calculate the fringe frequency between p and by taking the derivative of , and calculate the absolute phase of the fringe pattern coding according to equation (5). In order to facilitate decoding, a lookup table is established to save each phase value. Moreover, according to the obtained projector pixels corresponding to the reference plane, the phase ref (u c ,v c ) can be obtained, which is the phase of the reference plane. The above calculation process is exemplified in the case of u p direction encoding of the projector, but the same applies to the v p direction or oblique direction encoding of the projector.
[0036] Further, the optimal fringe coding is obtained, including:
[0037] The intensity of each pixel point in the coded fringe is expressed as:
[0038] I n (u p ,v p ) = I' + I" cos [Φ(u p ,v p ) + 2πn / N], n = 0, 1, 2, … N-1
[0039] where I' and I" represent the intensity offset and fringe amplitude respectively, and N is the number of phase shift steps.
[0040] Further, the encoded fringe pattern is emitted to the surface of the object to be measured, the fringe is deformed, the deformed fringe sequence is acquired, the absolute phase is acquired by using a geometric constraint phase unwrapping method, and the method comprises the following steps:
[0041] The encoded fringe pattern is emitted to the surface of the object to be measured by a projector, the fringe is deformed, the deformed fringe sequence is photographed by a camera controlled by a computer, and the wrapped phase is calculated by the following formula:
[0042]
[0043] Wherein, represents the gray value of the nth photographed picture (u c ,v c ) pixel, after the wrapped phase is obtained, the phase order is calculated pixel by pixel according to the reference phase plane, and is represented as:
[0044]
[0045] Wherein, Φ ref (u c ,v c ) represents the reference phase, and floor represents the down rounding function, that is, the maximum integer not exceeding the input value is returned;
[0046] Phase unwrapping is carried out by the following formula:
[0047] Φ(u c ,v c ) = φ(u c ,v c ) + 2πk(u c ,v c )
[0048] Absolute phase is obtained.
[0049] Further, the pixel matching is carried out by using the look-up table established in the fringe encoding stage, and the three-dimensional shape of the object to be measured is restored, and the method comprises the following steps:
[0050] According to the obtained absolute phase and the look-up table established in the fringe encoding stage, the corresponding projector pixel (u p ,v p ) of each camera pixel (u c ,v c ) is calculated, the projector pixel (u p ,v p ) is substituted into the structured light system imaging model, and the three-dimensional shape of the object to be measured is obtained.
[0051] Another technical scheme adopted by the present application is:
[0052] A variable frequency fringe encoding and decoding device for rapid three-dimensional measurement, comprising:
[0053] At least one processor;
[0054] At least one memory for storing at least one program;
[0055] When the at least one program is executed by the at least one processor, the at least one processor implements the above method.
[0056] Another technical solution adopted by the present application is:
[0057] A storage medium having processor executable instructions stored therein, the processor executable instructions being used to execute the above method when executed by a processor.
[0058] The beneficial effects of the present application are: the fringe encoding method proposed by the present application uses the geometric constraint of the measurement system for phase unwrapping, solves the problem that the depth range is difficult to quantitatively calculate in the traditional geometric constraint method, and the depth imbalance leads to measurement failure, and has the advantages of high precision, fast speed, large range, etc. BRIEF DESCRIPTION OF DRAWINGS
[0059] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the prior art, the following introduces the drawings of the related technical solutions in the embodiments of the present application or the prior art. It should be understood that the drawings in the following introduction are only for the convenience of clearly describing part of the embodiments in the technical solutions of the present application, and for those skilled in the art, other drawings can also be obtained from these drawings without creative labor.
[0060] Figure 1 is a geometric constraint phase unwrapping schematic diagram in the existing phase unwrapping method;
[0061] Figure 2 is a schematic diagram of the depth range imbalance problem of the geometric constraint phase unwrapping;
[0062] Figure 3 is a schematic diagram of measurement failure caused by the depth range imbalance problem;
[0063] Figure 4 is a step flowchart of the variable frequency fringe encoding and decoding method for rapid three-dimensional measurement in the embodiment of the present application;
[0064] Figure 5 is a variable frequency fringe encoding pattern generated in the embodiment of the present application. DETAILED DESCRIPTION
[0065] The embodiments of the present application are described below in detail with examples shown in the drawings, wherein the same or similar notations represent the same or similar elements or elements having the same or similar functions throughout. The embodiments described below by referring to the drawings are exemplary only, for the purpose of explaining the present application, and should not be understood as a limitation of the present application. For the step numbers in the following embodiments, they are only set for the convenience of illustrating the description, and any limitation is not made on the order between the steps, and the execution order of each step in the embodiments can be adaptively adjusted according to the understanding of those skilled in the art.
[0066] In the description of the present application, it should be understood that the orientation description, such as the orientation or position relationship indicated by the upper, lower, front, rear, left, right, etc., is based on the orientation or position relationship shown in the drawings, and is only for the convenience of describing the present application and simplifying the description, and therefore cannot be understood as a limitation of the present application.
[0067] In the description of the present application, one or more is meant by several, more than two is meant by multiple, greater than, less than, more than, etc. are understood as not including the number, above, below, etc. are understood as including the number. If the first, second is described, it is only for the purpose of distinguishing technical features, and cannot be understood as indicating or implying relative importance or implicitly indicating the number of indicated technical features or the order of indicated technical features.
[0068] In the description of the present application, unless otherwise explicitly limited, the words such as setting, installing, connecting, etc. should be understood in a broad sense, and those skilled in the art can reasonably determine the specific meaning of the above words in the present application in combination with the specific content of the technical solution.
[0069] In view of the existing technical problems, the present application proposes a variable frequency fringe encoding and decoding method for rapid three-dimensional measurement. Based on the proposed fringe encoding method, the phase unwrapping is performed using the geometric constraints of the measurement system, which solves the problem that the depth range is difficult to quantitatively calculate in the traditional geometric constraint method, and the depth imbalance leads to measurement failure, and has the advantages of high precision, fast speed, large range, etc. Unlike the existing method of setting the fringe frequency to a certain fixed value, the fringe frequency in the proposed method is determined by the encoding pixel position, and changes with the pixel position. In the fringe encoding stage, the proposed method first obtains the optimal encoding pixel offset according to the target depth range, thereby determining the fringe frequency and the corresponding phase, obtaining the optimal fringe encoding, and storing the phase in the lookup table. In the decoding stage, the proposed method uses the existing geometric constraint phase unwrapping method to obtain the absolute phase, and performs pixel matching through the lookup table established in the encoding stage, thereby recovering the three-dimensional shape of the object to be measured.
[0070] As Figure 4As shown, the embodiment provides a variable frequency fringe encoding and decoding method for fast three-dimensional measurement, specifically including the following steps:
[0071] S1, system calibration and parameter initialization.
[0072] Step S1 mainly determines the geometric parameters of the imaging system, including the internal and external parameters of the camera and the projector, and the reference plane and depth range parameters for phase unwrapping, specifically including:
[0073] S11, obtain the internal and external parameters of the projector and the camera through system calibration. Since the calibration method of the structured light system is already mature, the specific details are not repeated here. According to the internal and external parameters obtained by calibration, the imaging model of the structured light system can be obtained:
[0074] s c [u c v c 1] T =P c [x w y w z w 1] T
[0075] s p [u p v p 1] T =P p [x w y w z w 1] T (1)
[0076] Where s c and s p are scale factors, u c , v c are camera pixel coordinates, u p , v p are projection pixel coordinates, x w , y w , z w are three-dimensional space coordinates to be solved, P c , P v are projection matrices of the camera and the projector, both containing 3 rows and 4 columns of elements, which are obtained by calibration.
[0077] S12, determine the reference plane and the maximum target plane. For convenience of representation, a coordinate system is established with the camera optical center as the origin of the coordinate axis, where the horizontal direction is the x-axis, the vertical direction is the y-axis, and the optical axis direction is the z-axis. A plane perpendicular to the z-axis is used as the reference plane and the maximum target plane, respectively denoted as z ref and z objAt this time, there are:
[0078] Δz = z {obj} -z {ref} (2)
[0079] where Δz is the maximum measurement depth range.
[0080] S2, in the fringe encoding stage, the optimal encoding pixel offset is obtained according to the target depth range, the fringe frequency and the corresponding phase are determined, the optimal fringe encoding is obtained, and the phase is stored in the lookup table.
[0081] Step S2 determines the encoding of the fringe sequence used by the projector for projection, specifically comprising:
[0082] S21, pixel offset calculation. For any camera pixel (u c ,v c ), substitute z = z ref and z = z obj into equation 1, and by solving the equation set, the projector pixels corresponding to the reference plane and the maximum target plane of the camera pixel respectively and
[0083] S22, phase calculation. According to the property that the phase difference between the reference plane and the maximum target plane is 2π, the following can be obtained:
[0084]
[0085] Assuming that the fringe is encoded in the u p direction of the projector, that is, the phase only changes with the u p coordinate, then equation (3) can be transformed into:
[0086]
[0087] According to the relationship between the phase and the frequency, the following can be obtained:
[0088]
[0089] Equation (4) is further transformed into:
[0090]
[0091] Considering the monotonicity and continuity of the phase, it is represented as a polynomial, denoted as:
[0092]
[0093] For each pair and Equations (7) are all true, so the phase curve can be obtained by using least square fitting. Note that only the relative phase between pixels can be obtained from equation (7) and , where and represent the minimum and maximum values in all and pixels, respectively. The derivative of Φ(u p ) is calculated to obtain the fringe frequency between pixels and , and the frequencies of all coded pixels are completed according to the following equation:
[0094]
[0095] The coded phase of all pixels can be calculated according to equation 8. To facilitate decoding, a lookup table is established to save each phase value. Since the projection pixel coordinates of the reference plane are all known, the reference phase plane, denoted as Φ ref (u p ,v p ), can be calculated pixel by pixel according to the lookup table. The above calculation process is exemplified in the case of u p direction encoding of the projector, but the cases of v p direction or oblique direction encoding of the projector are also applicable.
[0096] S23, fringe encoding. The intensity of each pixel point in the encoded fringe can be expressed as:
[0097] I n (u p ,v p ) = I' + I" cos [Φ(u p ,v p ) + 2πn / N], n = 0, 1, 2, … N-1 (9)
[0098] where I' and I" represent the intensity offset and fringe amplitude, respectively, both of which are set to 127.5 for common 8-bit encoding, and N is the number of phase shift steps, N is not less than 3. Figure 5 The optimal variable-frequency fringe calculated by the above method is shown in the schematic diagram, and it can be seen that the fringe frequency (or fringe period) changes in the encoding direction, so it is called variable-frequency fringe.
[0099] S3, in the fringe decoding stage, the encoded fringe pattern is emitted to the surface of the object to be measured, the fringe is deformed, the deformed fringe sequence is obtained, the absolute phase is obtained by using the geometric constraint phase unwrapping method, the pixel matching is performed through the lookup table established in the fringe encoding stage, and the three-dimensional shape of the object to be measured is restored.
[0100] The coded fringe pattern is emitted to the surface of the object to be measured by a projector, and the fringe is deformed, and the deformed fringe sequence is photographed by a camera controlled by a computer, and the wrapping phase is calculated by the following formula:
[0101]
[0102] wherein, represents the gray value of the nth photographed picture (u c ,v c ) pixel, after the wrapping phase is obtained, the phase order is calculated pixel by pixel according to the reference phase plane, and is represented as:
[0103]
[0104] The phase unwrapping is carried out by the following formula:
[0105] Φ(u c ,v c ) = φ(u c ,v c ) + 2πk(u c ,v c ) (12)
[0106] After the absolute phase is obtained, the projector pixel (u c ,v c ) corresponding to each camera pixel (u p ,v p ) is calculated according to the look-up table established in step S22, and then the three-dimensional coordinates are calculated by substituting formula (1), and the solution of the multivariate linear equation set is not described here.
[0107] In general, the conventional phase unwrapping method usually uses a constant frequency sinusoidal coded fringe, and the frequency selection of the fringe depends on the experience of the user, lacks a quantitative estimation method, and cannot determine whether the fringe frequency is optimal. When the geometric constraint of the imaging system is used for phase unwrapping, the fixed frequency fringe will cause the problem of unbalanced measurement depth range, and simple adjustment of the fringe frequency cannot solve this problem. The coded fringe method provided by the present application does not need to rely on manual participation, but automatically calculates the optimal coded fringe according to the system measurement requirement. Specifically, the method of the present application first obtains the imaging model parameters through the system calibration process, and then determines two virtual planes in the three-dimensional space according to the measurement depth range requirement, and obtains the final coded pattern according to the pixel relationship and coded phase relationship corresponding to the projector coordinates of the two virtual planes.
[0108] In summary, the method of the present application has at least the following advantages and beneficial effects compared with the prior art:
[0109] (1) Measurement range and measurement accuracy maximization. The traditional method has the problem of unbalanced measurement depth range. The area with narrow depth range is easy to cause measurement failure due to out-of-bounds, and the area with wide depth range has low depth utilization and high stripe width, so the measurement accuracy cannot be maximized. The method of the present application solves the problem of unbalanced depth measurement range by using variable frequency stripe coding, has higher measurement stability, and realizes the maximization of measurement range and measurement accuracy.
[0110] (2) The traditional method needs to manually specify the stripe frequency and cannot be applied to different devices and measurement scenes. When switching devices or measurement requirements, repeated debugging is needed to determine the stripe frequency, and the effect is not necessarily optimal. The method of the present application can adaptively calculate the optimal stripe coding according to different devices and measurement requirements to ensure measurement effect.
[0111] (3) In order to avoid the conflict between the actual height of the object and the effective depth range, the traditional method needs to manually adjust the position and angle of the object to be measured to make the measured object as much as possible to be covered by the effective depth range. The method of the present application does not need to consider this problem and can be automatically adjusted according to the measurement requirements. Therefore, the method of the present application has a significant advantage in a wide range of automated measurement scenes (such as production line defect detection).
[0112] The embodiment also provides a variable frequency stripe coding and decoding device for fast three-dimensional measurement, comprising:
[0113] At least one processor;
[0114] At least one memory for storing at least one program;
[0115] When the at least one program is executed by the at least one processor, the at least one processor implements Figure 1 The method shown.
[0116] The variable frequency stripe coding and decoding device for fast three-dimensional measurement of the embodiment can execute the variable frequency stripe coding and decoding method for fast three-dimensional measurement provided by the method embodiment, and can execute the steps of any combination of the method embodiment, and has the corresponding functions and advantages of the method.
[0117] The embodiment of the present application also discloses a computer program product or computer program, which comprises computer instructions stored in a computer readable storage medium. The processor of the computer device can read the computer instructions from the computer readable storage medium, and the processor executes the computer instructions to make the computer device execute Figure 1 The method shown.
[0118] The embodiment also provides a storage medium, which stores instructions or programs of a variable frequency stripe encoding and decoding method for fast three-dimensional measurement, and when the instructions or programs are run, any combination of the method embodiments can be executed to implement the steps, and the corresponding functions and advantages of the method are achieved.
[0119] In some alternative embodiments, the functions / operations mentioned in the block diagrams can not occur in the order mentioned in the operation diagrams. For example, depending on the functions / operations involved, two blocks shown in succession can actually be executed substantially concurrently or the blocks can sometimes be executed in reverse order. Furthermore, the embodiments presented and described in the flow diagrams of the application are provided by way of example only. The disclosed methods are not limited by the illustrated and described operations and logic flows. Alternative embodiments are contemplated in which the order of various operations is changed and in which sub-operations described as part of a larger operation are executed independently.
[0120] Furthermore, although the present application is described in the context of functional modules, it is to be understood that one or more of the functions and / or features described can be integrated in a single physical device and / or software module, or one or more functions and / or features can be implemented in separate physical devices or software modules. It is also to be understood that detailed discussion of the actual implementation of each module is unnecessary to an understanding of the present application. Rather, the actual implementation is to be understood in terms of the properties, functions and internal relationships of the various functional modules disclosed in the devices disclosed herein, which are to be understood within the context of the engineering arts. Thus, those skilled in the art using ordinary skill will be able to implement the present application as set forth in the claims without undue experimentation. It is also to be understood that the particular concepts disclosed are merely illustrative and are not intended to limit the scope of the present application, which is to be determined by the full scope of the claims and equivalents thereof.
[0121] If the functions are implemented in the form of software function units and sold or used as independent products, they can be stored in a computer readable storage medium. Based on this understanding, the technical solutions of the present application or the parts of the technical solutions that essentially contribute to the prior art or the parts of the technical solutions can be embodied in the form of a software product. The computer software product is stored in a storage medium and includes a plurality of instructions for causing a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present application. The aforementioned storage medium includes: a U disk, a mobile hard disk, a read-only memory (ROM, Read-Only Memory), a random access memory (RAM, Random Access Memory), a magnetic disk or an optical disk, and various media that can store program codes.
[0122] The logic and / or steps represented in the flowcharts or otherwise described herein, for example, can be considered as a list of executable instructions for implementing logic functions, which can be embodied in any computer-readable medium for use by or in connection with an instruction execution system, apparatus or device, such as a computer-based system, a system including a processor or other system that can fetch the instructions from the instruction execution system, apparatus or device and execute the instructions, or in conjunction with these instructions execution systems, apparatus or devices. For the purpose of this specification, the "computer-readable medium" can be any device that can contain, store, communicate, propagate or transport programs for use by or in connection with an instruction execution system, apparatus or device, or in conjunction with these instruction execution systems, apparatus or devices.
[0123] More specific examples (a non-exhaustive list) of the computer-readable medium include the following: an electrical connection having one or more wires (electrical devices), a portable computer diskette (magnetic devices), a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber device, and a portable compact disc read-only memory (CDROM). In addition, the computer-readable medium can even be paper or other suitable medium on which the program can be printed, because the program can be electronically obtained, for example, by optical scanning of the paper or other medium, followed by editing, interpreting or otherwise processing, if necessary, in other suitable ways, to be electronically obtained and then stored in the computer memory.
[0124] It should be understood that various parts of the present application can be implemented in hardware, software, firmware or a combination thereof. In the above embodiments, various steps or methods can be implemented in software or firmware that is stored in memory and executed by a suitable instruction execution system. For example, if implemented in hardware, as in another embodiment, any of the following technologies, known in the art, or their equivalents, can be employed for implementation: discrete logic circuitry having logic gates for implementing logic functions upon data signals, application specific integrated circuits having appropriate combinational logic gates, programmable gate arrays (PGA), field programmable gate arrays (FPGA), and the like.
[0125] In the above description of the present specification, the description of the terms "one embodiment / one example", "another embodiment / another example", or "certain embodiments / certain examples" and the like means that the specific features, structures, materials or characteristics described in connection with the embodiments or examples are included in at least one embodiment or example of the present application. In the present specification, the illustrative expressions of the above terms do not necessarily refer to the same embodiment or example. Also, the specific features, structures, materials or characteristics described can be combined in any one or more embodiments or examples in a suitable manner.
[0126] Although the embodiments of the present application have been shown and described, it will be understood by those skilled in the art that various changes, modifications, substitutions and variations can be made thereto without departing from the principles and spirit of the present application, the scope of which is defined by the claims and their equivalents.
[0127] The above is a specific description of the preferred embodiments of the present application, but the present application is not limited to the above-described embodiments, and those skilled in the art can make various equivalent modifications or substitutions without departing from the spirit of the present application, and these equivalent modifications or substitutions are included in the scope defined by the claims of the present application.
Claims
1. A variable frequency fringe encoding and decoding method for fast 3D measurement, characterized in that, The method comprises the following steps: In the fringe encoding stage, the optimal encoding pixel offset is obtained according to the target depth range, the fringe frequency and the corresponding phase are determined, the optimal fringe encoding is obtained, and the phase is stored in a lookup table; In the fringe decoding stage, the encoded fringe pattern is emitted to the surface of the object to be measured, the fringe is deformed, the deformed fringe sequence is obtained, the absolute phase is obtained by using a geometric constraint phase unwrapping method, pixel matching is performed through the lookup table established in the fringe encoding stage, and the three-dimensional shape of the object to be measured is restored; The variable-frequency fringe encoding and decoding method further comprises the steps of system calibration and parameter initialization: The internal and external parameters of the projector and the camera are obtained through system calibration, and a structured light system imaging model is obtained; A reference plane and a maximum target plane are determined; The expression of the structured light system imaging model is: s c [u c v c 1] T = c [x w y w z w 1] T s p [u p v p 1] T =P p [x w y w z w 1] T (1) where s c and s p are scale factors, u c ,v c are camera pixel coordinates, u p ,v p are projected pixel coordinates, x w ,y w ,z w are three-dimensional space coordinates to be solved, P c ,P v are projection matrices of the camera and the projector; The determination of the reference plane and the maximum target plane comprises: A coordinate system is established with the camera optical center as the coordinate axis origin, wherein the horizontal direction is the x-axis, the vertical direction is the y-axis, and the optical axis direction is the z-axis; Using the plane perpendicular to the z-axis as the reference plane and the maximum target plane, respectively denoted as z = z ref and z = z obj At this time, there is: Δz = z {obj} - z {ref} (2) Wherein, Δz is the maximum measurement depth range; The optimal encoding pixel offset is obtained according to the target depth range, comprising: For any camera pixel (u c ,v c ), the reference plane and the maximum target plane are substituted into the structured light system imaging model to obtain the projector pixels corresponding to the camera pixel respectively and The fringe frequency and the corresponding phase are determined, comprising: According to the property that the phase difference between the reference plane and the maximum target plane is 2π, the following can be obtained: Assume that the u p direction is encoded with a stripe, i.e. the phase only changes with u p coordinate, then equation (3) can be transformed into: From the relationship between phase and frequency, we have: Formula (4) is further converted to: Considering the monotonicity and continuity of the phase, it is represented as a polynomial, denoted as: Substitute the polynomial in equation (7) into equation (4), and obtain the projector pixels and perform polynomial fitting to obtain the mapping relationship between the projector pixels and the phase, thereby obtaining the relative phase of the pixels between and , wherein and respectively represent the minimum value and the maximum value in all and pixels; calculate the derivative of p and the pixel fringe frequency between and calculate the absolute phase of the fringe pattern coding according to equation (5); The optimal fringe encoding is obtained, comprising: The intensity of each pixel point in the encoded fringe is represented as: I n (u p ,v p ) = I' + I" cos [Φ(u p ,v p ) + 2πn / N], n = 0, 1, 2,... N-1 Wherein, I' and I'' respectively represent the intensity offset and the fringe amplitude, and N is the number of phase shift steps.
2. The method according to claim 1, characterized in that, The encoded fringe pattern is emitted to the surface of the object to be measured, the fringe is deformed, the deformed fringe sequence is obtained, the absolute phase is obtained by using a geometric constraint phase unwrapping method, comprising: The encoded fringe pattern is emitted to the surface of the object to be measured by the projector, the fringe is deformed, the deformed fringe sequence is photographed by the camera controlled by the computer, and the wrapped phase is calculated by the following formula: wherein, represents the gray value of the nth captured picture (u c ,v c ) pixel, after the winding phase is obtained, the phase series is calculated pixel by pixel according to the reference phase plane, which is represented as: where Φ ref (u c ,v c ) denotes the reference phase, and floor denotes the floor function, i.e. returns the largest integer not exceeding the input value. The phase is unwrapped by the following formula: Φ(u c ,v c ) = φ(u c ,v c ) + 2πk(u c ,v c ) The absolute phase is obtained.
3. The method according to claim 2, wherein, The three-dimensional shape of the object to be measured is restored by pixel matching through the lookup table established in the fringe encoding stage, comprising: According to the obtained absolute phase and the look-up table established in the fringe encoding stage, the corresponding projector pixel (u p ,v p ) of each camera pixel (u c ,v c ) is calculated, the projector pixel (u p ,v p ) is substituted into the structured light system imaging model, and the three-dimensional shape of the measured object is obtained.
4. A variable frequency fringe encoding and decoding apparatus for fast three-dimensional measurement, characterized by, Comprising: At least one processor; At least one memory for storing at least one program; When the at least one program is executed by the at least one processor, the at least one processor implements the method of any one of claims 1-3.
5. An apparatus for automatic generation of computer code, characterized in that Comprising a memory and a processor, the memory is used to store at least one program, and the processor is used to load the at least one program to execute the method of any one of claims 1-3.
Citation Information
Patent Citations
Binocular stereoscopic vision three-dimensional measurement method and system, server and storage medium
CN110567398A
Phase decoding method for fringe projection and computer readable storage medium
CN116558445A