Phase error correction method and device in motion scene, computer equipment and readable storage medium
By correcting and grouping phase shift relationships, merging wrapped phases for phase expansion, the problem of phase errors in moving scenes is solved, and three-dimensional data measurement accuracy and anti-interference capabilities are achieved without increasing hardware costs.
Patent Information
- Application Number
- CN202410612644.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-05-17
- Publication Date
- 2024-08-23
AI Technical Summary
When using phase-shift encoded fringe patterns to measure three-dimensional data of objects in a moving scene, traditional technology cannot achieve accurate measurement without increasing hardware costs, and the anti-interference ability and measurement accuracy are affected.
By obtaining the fringe pattern to be processed, projecting it onto the object surface, correcting the phase shift relationship, grouping the fringe pattern groups, fusing and wrapping the phase, and performing phase expansion to determine the absolute phase, the periodic phase error in the motion scene is eliminated.
Without increasing the hardware cost, the three-dimensional data of the object is accurately measured, the anti-interference ability and accuracy are maintained, and the impact of increased hardware cost and reduced number of fringe patterns is avoided.
Smart Images

Figure CN118533100A
Abstract
Description
Technical Field
[0001] The present application relates to the field of optical three-dimensional measurement technology, and in particular to a phase error correction method, device, computer equipment, computer-readable storage medium and computer program product in a motion scene. Background Art
[0002] Phase-shift coded fringe patterns used in optical 3D measurement are widely used due to their strong anti-interference and high resolution. Specifically, the phase-shift coded fringe pattern can be projected onto the surface of an object, and a camera can be used to capture an image of the deformed surface of the object, thereby restoring the 3D shape of the object based on the triangular imaging principle or phase-height mapping relationship. Figure 1 It is generally only applicable to static scenes. For dynamic scenes, it is necessary to increase the projection speed and camera acquisition speed, or reduce the number of fringe patterns in the phase-shift coded fringe pattern to increase the measurement speed and indirectly reduce the impact of the relative motion between the object and the projection point on the measurement.
[0003] However, increasing the projection speed and camera acquisition speed requires the use of hardware devices with higher projection frequency and image acquisition frame rate, which increases hardware costs, while reducing the number of fringe patterns will reduce the anti-interference ability of the phase-shift coded fringe pattern, affecting the measurement accuracy. That is, in traditional technology, when using phase-shift coded fringe patterns to measure the three-dimensional data of an object in a moving scene, it is impossible to accurately measure the three-dimensional data of the object without increasing hardware costs. Summary of the invention
[0004] Based on this, it is necessary to provide a phase error correction method, device, computer equipment, computer-readable storage medium and computer program product in a moving scene, which can accurately measure the three-dimensional data of an object in a moving scene without increasing the hardware cost when using a phase-shift coded fringe pattern to measure the three-dimensional data of an object in a moving scene in response to the above-mentioned technical problems.
[0005] In a first aspect, the present application provides a phase error correction method in a motion scene, comprising:
[0006] Acquire a fringe pattern to be processed, and project the fringe pattern to be processed onto the surface of the object to be measured based on the projection point to obtain target projection data;
[0007] When there is relative motion between the projection point and the object to be measured, the preset phase shift relationship of multiple sub-fringe patterns in the fringe pattern to be processed is corrected to obtain a correction phase shift formula for each sub-fringe pattern;
[0008] Based on the correction phase shift formula of each sub-fringe pattern, multiple sub-fringe patterns are grouped to obtain at least two fringe pattern groups; the phase error variation period of the respective wrapped phases of the at least two fringe pattern groups is the same, and the phase error variation trends are opposite;
[0009] Based on the target projection data, the wrapping phases of at least two fringe pattern groups are determined, the wrapping phases of at least two fringe pattern groups are fused to obtain a compensated wrapping phase, and the compensated wrapping phase is phase-unwrapped to obtain an absolute phase for determining the three-dimensional data of the object to be measured.
[0010] In one embodiment, when there is relative motion between the projection point and the object to be measured, the preset phase shift relationship of multiple sub-fringe patterns in the fringe pattern to be processed is corrected to obtain a correction phase shift formula for each sub-fringe pattern, including:
[0011] When there is relative motion between the projection point and the object to be measured, the phase shift between every two sub-fringe patterns is determined based on a preset phase shift relationship between multiple sub-fringe patterns in the fringe pattern to be processed;
[0012] Determine the phase error caused by the relative motion, and correct the phase shift between every two sub-fringe patterns according to the phase error to obtain a corrected phase shift relationship;
[0013] Based on the correction phase shift relationship, the correction phase shift formula of each sub-fringe pattern is obtained.
[0014] In one embodiment, obtaining a fringe image to be processed includes:
[0015] Get the standard fringe pattern;
[0016] When the phase unwrapping method is time phase unwrapping, the standard fringe pattern is converted into a fringe pattern of a first frequency and a fringe pattern of a second frequency respectively; the first frequency is lower than the second frequency;
[0017] The fringe pattern of the first frequency and the fringe pattern of the second frequency are used as the fringe patterns to be processed.
[0018] In one embodiment, projecting the fringe pattern to be processed onto the surface of the object to be measured based on the projection point to obtain target projection data includes:
[0019] Combining two sub-fringe patterns with the same phase shift value and different frequencies in the fringe pattern of the first frequency and the fringe pattern of the second frequency to obtain a plurality of projection combinations;
[0020] For each projection combination, the sub-fringe patterns in the projection combination are cross-projected onto the surface of the object to be measured based on the projection points to obtain projection data corresponding to the projection combination;
[0021] According to the projection data corresponding to each of the multiple projection combinations, target projection data is obtained.
[0022] In one embodiment, the phase unwrapping method is time phase unwrapping; the fringe pattern to be processed includes a fringe pattern of a first frequency and a fringe pattern of a second frequency; the at least two fringe pattern groups include a plurality of fringe pattern groups of the first frequency and a plurality of fringe pattern groups of the second frequency;
[0023] The wrapped phases of at least two fringe pattern groups are fused to obtain a compensated wrapped phase, and the compensated wrapped phase is phase-unwrapped to obtain an absolute phase for determining three-dimensional data of the object to be measured, including:
[0024] Fusing the wrapping phases of a plurality of fringe pattern groups of the first frequency to obtain a first frequency compensation wrapping phase, and fusing the wrapping phases of a plurality of fringe pattern groups of the second frequency to obtain a second frequency compensation wrapping phase;
[0025] Temporal phase unwrapping is performed based on the first frequency-compensated wrapped phase and the second frequency-compensated wrapped phase to obtain an absolute phase for determining three-dimensional data of the object to be measured.
[0026] In one embodiment, obtaining a fringe image to be processed includes:
[0027] Get the standard fringe pattern;
[0028] When the phase unwrapping method is spatial phase unwrapping, the standard fringe pattern is used as the fringe pattern to be processed;
[0029] Phase unwrapping is performed on the compensation wrapping phase to obtain an absolute phase for determining the three-dimensional data of the object to be measured, including:
[0030] Obtain a phase diagram corresponding to the compensation wrapping phase;
[0031] Spatial phase unwrapping is performed based on the phase difference between adjacent points in the phase diagram to obtain an absolute phase for determining three-dimensional data of the object to be measured.
[0032] In a second aspect, the present application also provides a phase error correction device in a motion scene, comprising:
[0033] A projection data acquisition module is used to acquire the fringe pattern to be processed, and project the fringe pattern to be processed onto the surface of the object to be measured based on the projection point to obtain target projection data;
[0034] A phase shift formula correction module is used to correct the preset phase shift relationship of multiple sub-fringe patterns in the fringe pattern to be processed when there is relative motion between the projection point and the object to be measured, and obtain a correction phase shift formula for each sub-fringe pattern;
[0035] A sub-fringe pattern grouping module is used to group multiple sub-fringe patterns based on the correction phase shift formula of each sub-fringe pattern to obtain at least two fringe pattern groups; the phase error change period of the wrapped phase of the at least two fringe pattern groups is the same, and the phase error change trend is opposite;
[0036] The absolute phase acquisition module is used to determine the respective wrapped phases of at least two fringe pattern groups based on the target projection data, fuse the respective wrapped phases of at least two fringe pattern groups to obtain the compensated wrapped phase, perform phase unfolding on the compensated wrapped phase, and obtain the absolute phase for determining the three-dimensional data of the object to be measured.
[0037] In a third aspect, the present application further provides a computer device, including a memory and a processor, wherein the memory stores a computer program, and the processor implements the steps in the above embodiments when executing the computer program.
[0038] In a fourth aspect, the present application further provides a computer-readable storage medium on which a computer program is stored, and when the computer program is executed by a processor, the steps in the above embodiments are implemented.
[0039] In a fifth aspect, the present application also provides a computer program product, including a computer program, which implements the steps in the above embodiments when executed by a processor.
[0040] The above-mentioned phase error correction method, device, computer equipment, computer-readable storage medium and computer program product in the motion scene project the fringe pattern to be processed onto the surface of the object to be measured based on the projection point to obtain the target projection data. When there is relative motion between the projection point and the object to be measured, the preset phase shift relationship of multiple sub-fringe patterns in the fringe pattern to be processed is corrected to obtain the correction phase shift formula of each sub-fringe pattern, that is, the error generated in the motion scene is first corrected to accurately measure the three-dimensional data of the object without increasing the hardware cost. Further, based on the correction phase shift formula of each sub-fringe pattern, the multiple sub-fringe patterns are grouped to obtain at least two fringe pattern groups, wherein the phase error change period of the respective wrapped phases of at least two fringe pattern groups is the same, and the phase error change trend is opposite, so that the periodic phase error in the motion scene can be eliminated by fusing the wrapped phase of the fringe pattern group, thereby accurately measuring the three-dimensional data of the object without increasing the hardware cost. Finally, the wrapping phase of each fringe pattern group is determined based on the target projection data, and the compensation wrapping phase is obtained by fusing the determined wrapping phase, and the compensated wrapping phase is phase-unwrapped to obtain the absolute phase that can be used to accurately determine the three-dimensional data of the object to be measured. The above method does not increase the hardware cost, nor does it reduce the number of fringe patterns, and can be combined with the correction of the phase shift formula and the fusion and complementation of the wrapping phase of the fringe pattern group to eliminate the periodic phase error in the motion scene. Therefore, based on the above method, when using the phase-shifted coded fringe pattern to measure the three-dimensional data of the object in the motion scene, the three-dimensional data of the object can be accurately measured without increasing the hardware cost. BRIEF DESCRIPTION OF THE DRAWINGS
[0041] In order to more clearly illustrate the technical solutions in the embodiments of the present application or related technologies, the drawings required for use in the embodiments of the present application or related technical descriptions will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without paying creative work.
[0042] Figure 1 is an application environment diagram of a phase error correction method in a motion scene in an embodiment;
[0043] Figure 2 is a flow chart of a phase error correction method in a motion scene in one embodiment;
[0044] Figure 3 It is a schematic diagram of a process of obtaining an absolute phase after phase error correction by time phase unwrapping in a motion scene in one embodiment;
[0045] Figure 4It is a schematic diagram of a process of obtaining an absolute phase after phase error correction by spatial phase unwrapping in a motion scene in one embodiment;
[0046] Figure 5 is a structural block diagram of a phase error correction device in a motion scene in an embodiment;
[0047] Figure 6 FIG. 4 is a diagram showing the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION
[0048] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0049] The phase error correction method in a motion scene provided in the embodiment of the present application can be applied to Figure 1 In the application environment shown. The server 102 is connected to the projection device 104 and the camera 106 respectively, and the connection methods include but are not limited to wireless network communication connection and electrical connection. The data storage system can store the data that the server 102 needs to process. The data storage system can be integrated on the server 102, or it can be placed on the cloud or other network servers.
[0050] It should be noted that the phase error correction method in the above-mentioned motion scene is implemented based on the principle of structured light three-dimensional measurement. The principle of structured light three-dimensional measurement is applied to the embodiment of the present application, specifically: structured light encoding is performed by the server (that is, the server obtains the fringe pattern to be processed), and then the encoded structured light is projected onto the surface of the object to be measured by the projection device, and the camera collects the structured light image modulated by the surface of the object to be measured (the fringe pattern projected onto the object to be measured is prevented from being distorted, which can be called the fringe pattern being modulated by the surface of the object, and the distorted fringe shape contains the three-dimensional information of the surface of the object), and the camera converts the structured light image into projection data, and transmits the projection data to the server for decoding (that is, the server determines the absolute phase based on the target projection data collected by the camera), and the server determines the three-dimensional data of the object to be measured based on the decoded information (that is, the server determines the three-dimensional data of the object to be measured based on the absolute phase).
[0051] Specifically, the server 102 may first obtain the fringe pattern to be processed, transmit the fringe pattern to be processed to the projection device 104, and control the projection device 104 (the projection device 104 may be used as a projection point) to project the fringe pattern to be processed onto the surface of the object to be measured, and then obtain the target projection data from the camera 106. When there is relative motion between the projection point (projection device 104) and the object to be measured, the server 102 may correct the preset phase shift relationship of multiple sub-fringe patterns in the fringe pattern to be processed, and obtain a correction phase shift formula for each sub-fringe pattern, thereby grouping the multiple sub-fringe patterns based on the correction phase shift formula for each sub-fringe pattern to obtain at least two fringe pattern groups, wherein the phase error change period of the respective wrapped phases of the at least two fringe pattern groups is the same, and the phase error change trends are opposite. Furthermore, the server 102 can respectively determine the calculation formulas for the wrapping phases of at least two fringe pattern groups, and determine the wrapping phases of at least two fringe pattern groups based on the target projection data and the calculation formula for the wrapping phase, thereby obtaining a compensated wrapping phase by fusing the wrapping phases of at least two fringe pattern groups, and obtaining an absolute phase for determining the three-dimensional data of the object to be measured by performing phase unfolding on the compensated wrapping phase, so that when a phase-shifted coded fringe pattern is used to measure the three-dimensional data of an object in a motion scene, the three-dimensional data of the object can be accurately restored based on the absolute phase without increasing the hardware cost, thereby achieving accurate measurement of the three-dimensional data of the object.
[0052] The relative motion between the projection point (projection device 104) and the object to be measured may refer to: during the projection process, the projection device 104 moves, but the object to be measured does not move; during the projection process, the projection device 104 does not move, but the object to be measured moves; during the projection process, both the projection device 104 and the object to be measured move, and there is relative motion between the projection device 104 and the object to be measured.
[0053] The server 102 may be an independent physical server, a server cluster or a distributed system composed of multiple physical servers, or a cloud server providing cloud computing services. The projection device 104 may project the image received from the server 102 to a designated area, for example, projecting the processed fringe pattern received from the server 102 to the surface of the object to be measured. The camera 106 may specifically be: an image sensor capable of converting an optical image into a digital signal, and the obtained digital signal may be sent to the server 102. The camera 106 includes but is not limited to a CCD (Charge coupled Device) camera.
[0054] In an exemplary embodiment, Figure 2 As shown, a phase error correction method in a motion scene is provided, and the method is applied to Figure 1The server in the example is used to illustrate, including the following steps 202 to 208. Among them:
[0055] Step 202 , obtaining a fringe pattern to be processed, and projecting the fringe pattern to be processed onto the surface of the object to be measured based on the projection point to obtain target projection data.
[0056] The fringe pattern to be processed is the phase-shift coded fringe pattern to be projected, which is obtained by encoding the structured light by the server according to actual needs. The fringe pattern to be processed may include multiple sub-fringe patterns. The fringe pattern to be processed carries the projection frequency (the number of times the projected image is refreshed per second), and the projection device (which can be used as a projection point) can project the fringe pattern to be processed onto the surface of the object to be measured according to the projection frequency carried in the fringe pattern to be processed.
[0057] Optionally, the server may first obtain the required fringe pattern to be processed, and send the fringe pattern to be processed to the projection device, and control the projection device (projection point) to project the fringe pattern to be processed onto the surface of the object to be measured according to the projection frequency carried in the fringe pattern to be processed. When the projection device is projecting, the server may control the camera to collect the projection image generated by the projection of the fringe pattern to be processed on the surface of the object to be measured, thereby obtaining the target projection data transmitted to the server by the camera. The camera may convert the optical image formed by projecting the fringe pattern to be processed onto the surface of the object to be measured into a digital signal (target projection data), and transmit the target projection data to the server.
[0058] Step 204 , when there is relative motion between the projection point and the object to be measured, the preset phase shift relationship of the plurality of sub-fringe patterns in the fringe pattern to be processed is corrected to obtain a correction phase shift formula for each sub-fringe pattern.
[0059] Specifically, the preset phase shift relationship between the multiple sub-fringe patterns is as follows: after the multiple sub-fringe patterns are sorted according to the preset phase shift relationship, a phase shift is pre-configured between every two adjacent sub-fringe patterns (which can be pre-configured during the process of encoding the structured light by the server).
[0060] Optionally, the server may first determine the preset phase shift formula corresponding to each sub-fringe pattern and the preset phase shift between every two sub-fringe patterns based on the preset phase shift relationship between the multiple sub-fringe patterns. When there is relative motion between the projection point and the object to be measured, the server may correct the preset phase shift between every two sub-fringe patterns based on the phase error (which may be represented by characters or letters) generated between the projection point and the object to be measured due to the relative motion between the projection point and the object to be measured, thereby correcting the preset phase shift relationship of the multiple sub-fringe patterns, and then correcting the preset phase shift formula corresponding to each sub-fringe pattern, and then obtaining the corrected phase shift formula for each sub-fringe pattern.
[0061] For example, the fringe pattern to be processed includes four sub-fringe patterns. At this time, the fringe pattern to be processed is a standard four-step phase-shift coded fringe pattern. The preset phase shift relationship between the four sub-fringe patterns can be: the phase shift (phase difference) between the first sub-fringe pattern and the second sub-fringe pattern is , the phase shift between the second and third sub-fringe patterns is , the phase shift between the third and fourth sub-fringe patterns is Based on this, the preset phase shift formula corresponding to the nth sub-fringe pattern can be represented as:
[0062] (1)
[0063] in, . is the pixel coordinate in the projection image corresponding to the nth sub-fringe pattern among the four sub-fringe patterns The gray value at , A is the average light intensity, B is the intensity modulation, is the pixel coordinate in the projection image corresponding to the nth sub-fringe pattern For the convenience of expression, the phase value at . On this basis, the phase shift formula of the four sub-fringe patterns in the fringe pattern to be processed can be specifically shown as formula (2):
[0064] (2)
[0065] in, is the preset phase shift formula corresponding to the first sub-fringe pattern, is the preset phase shift formula corresponding to the second sub-fringe pattern, is the preset phase shift formula corresponding to the third sub-fringe pattern, is the preset phase shift formula corresponding to the fourth sub-fringe pattern.
[0066] Furthermore, when there is a relative motion between the projection point and the object to be measured, the server can correct the preset phase shift between each two sub-fringe patterns based on the phase error (which can be represented by characters or letters) generated between each two sub-fringe patterns due to the relative motion between the projection point and the object to be measured. The phase error between the first and second sub-fringe patterns due to relative motion is characterized by The phase error between the second and third sub-fringe patterns due to relative motion is characterized by Characterize the phase error caused by relative motion between the third sub-fringe pattern and the fourth sub-fringe pattern, so as to correct the preset phase shift relationship to: the phase shift between the first sub-fringe pattern and the second sub-fringe pattern is , the phase shift between the second and third sub-fringe patterns is , the phase shift between the third and fourth sub-fringe patterns is , and then realize the correction of the preset phase shift formula corresponding to each sub-fringe pattern, and obtain the correction phase shift formula of each sub-fringe pattern, which can be specifically shown as formula (3):
[0067] (3)
[0068] in, is the correction phase shift formula corresponding to the first sub-fringe pattern, is the correction phase shift formula corresponding to the second sub-fringe pattern, is the correction phase shift formula corresponding to the third sub-fringe pattern, is the correction phase shift formula corresponding to the fourth sub-fringe pattern.
[0069] Step 206, based on the correction phase shift formula of each sub-fringe pattern, multiple sub-fringe patterns are grouped to obtain at least two fringe pattern groups; at least two fringe pattern groups have the same phase error variation period of the respective wrapped phases and opposite phase error variation trends.
[0070] Optionally, the server may perform grouping simulation based on the correction phase shift formula of each sub-fringe pattern in advance, so that the respective wrapped phases of the multiple fringe pattern groups obtained by grouping can be fused to eliminate the periodic phase error in the motion scene, that is, the server may perform grouping simulation based on the correction phase shift formula of each sub-fringe pattern to determine at least one grouping method that can eliminate the periodic phase error in the motion scene. Further, the server may group the multiple sub-fringe patterns based on any determined grouping method to obtain at least two fringe pattern groups, so that the phase error change period of the respective wrapped phases of the at least two fringe pattern groups is the same, and the phase error change trend is opposite.
[0071] Exemplarily, the fringe pattern to be processed is still taken as a standard four-step phase-shift coded fringe pattern for explanation. At this time, the fringe pattern to be processed includes four sub-fringe patterns. The process of grouping simulation based on the correction phase shift formula by the server can be specifically as follows:
[0072] The simulation divides the four sub-fringe patterns into two fringe pattern groups. For example, the first, second, and third sub-fringe patterns are used as the first fringe pattern group, and the second, third, and fourth sub-fringe patterns are used as the second fringe pattern group. For a static scene (there is no relative motion between the projection point and the object to be measured), the preset phase shift formula corresponding to the first fringe pattern group includes , , , the preset phase shift formula corresponding to the second fringe pattern group includes , , For a motion scene (there is relative motion between the projection point and the object to be measured), the correction phase shift formula corresponding to the first fringe pattern group includes , , , the correction phase shift formula corresponding to the second fringe pattern group includes , , .
[0073] For static scenes, the server can use the preset phase shift formula corresponding to each sub-fringe pattern in formula (2) ( , , , ), respectively determine the wrapping phase corresponding to the first fringe pattern group The calculation formula for the second fringe pattern group corresponds to the wrapped phase The calculation formula is shown in formula (4) and (5):
[0074] (4)
[0075] (5)
[0076] For dynamic scenes, the server can use the correction phase shift formula corresponding to each sub-fringe pattern in formula (3) ( , , , ), respectively determine the wrapping phase corresponding to the first fringe pattern group The calculation formula for the second fringe pattern group corresponds to the wrapped phase The calculation formula is shown in formula (6) and (7):
[0077] (6)
[0078] (7)
[0079] Furthermore, since the phase error caused by the relative motion between each two sub-fringe patterns is small, we can make , .in, Based on this, the server can substitute formula (3) into formulas (6) and (7) to obtain:
[0080] (8)
[0081] (9)
[0082] Furthermore, for the first fringe pattern group in a dynamic scene, the server can determine the phase error caused by relative motion based on formulas (4) and (8): , which can be specifically shown as formula (10):
[0083] (10)
[0084] The server can further simplify formula (10) according to the Taylor expansion formula and the properties of trigonometric functions, as shown in formula (11):
[0085] (11)
[0086] Similarly, for the second fringe pattern group in a dynamic scene, the server can determine the phase error caused by relative motion based on formulas (5) and (9): , which can be specifically shown as formula (12):
[0087] (12)
[0088] Based on this, the server can determine through formula (11) and formula (12) that in the motion scene, the frequency of the phase error change of the first fringe pattern group and the second fringe pattern group is approximately twice the original frequency, that is, both are approximately , and the sinusoidal parts of the phase errors of the two fringe pattern groups are approximately equal in magnitude and opposite in sign, that is, the phase error variation period of the respective wrapped phases of the two fringe pattern groups is the same, and the phase error variation trend is opposite. and ) to eliminate the periodic phase error in the motion scene. Therefore, the server can determine the grouping method of "taking the first, second, and third sub-fringe patterns as the first fringe pattern group, and taking the second, third, and fourth sub-fringe patterns as the second fringe pattern group" as the required grouping method, and group the multiple sub-fringe patterns in the image to be processed according to this grouping method to obtain at least two fringe pattern groups.
[0089] It should be noted that, in the present embodiment, the server can simulate a variety of grouping methods, including but not limited to the grouping methods shown above, but the server can determine through grouping simulation that, for the standard four-step phase-shift coded fringe pattern, the grouping method of "taking the first, second, and third sub-fringe patterns as the first fringe pattern group, and taking the second, third, and fourth sub-fringe patterns as the second fringe pattern group" is the required grouping method (which can eliminate the periodic phase error in motion scenes to the greatest extent by fusing the wrapped phases of all fringe pattern groups, thereby improving the accuracy of the final absolute phase).
[0090] Step 208, determining the wrapping phases of at least two fringe pattern groups based on the target projection data, fusing the wrapping phases of at least two fringe pattern groups to obtain a compensated wrapping phase, performing phase unwrapping on the compensated wrapping phase to obtain an absolute phase for determining the three-dimensional data of the object to be measured.
[0091] Among them, phase unwrapping is the unwrapping involved in the phase shift method. When calculating the phase, the phase extracted from the phase diagram using the inverse tangent function is the wrapped phase value (wrapped phase) wrapped in a periodic phase interval, not the actual phase. Therefore, it is necessary to obtain the absolute phase through phase unwrapping, that is, to recover the real phase from the value interval, so that the three-dimensional data of the object to be measured can be restored through the absolute phase. The accuracy of the absolute phase has a key impact on the accuracy of the final restored three-dimensional data.
[0092] Optionally, after the server determines through grouping simulation that "the first, second, and third sub-fringe patterns are used as the first fringe pattern group, and the second, third, and fourth sub-fringe patterns are used as the second fringe pattern group" is the desired grouping method, the server can group the multiple sub-fringe patterns in the fringe pattern to be processed according to this grouping method, and after grouping, respectively determine the calculation formula for the respective wrapping phase of each fringe pattern group. Further, the server can substitute the target projection data into the respective wrapping phase calculation formula of each fringe pattern group to obtain the respective wrapping phase of each fringe pattern group, and then average the wrapping phases of all fringe pattern groups to obtain the compensated wrapping phase. Furthermore, the server can obtain the absolute phase used to determine the three-dimensional data of the object to be measured by performing phase unfolding on the compensated wrapping phase.
[0093] The phase error correction method in the motion scene is to project the fringe pattern to be processed onto the surface of the object to be measured based on the projection point to obtain the target projection data. When the projection point and the object to be measured are in relative motion, the preset phase shift relationship of the multiple sub-fringe patterns in the fringe pattern to be processed is corrected to obtain the correction phase shift formula of each sub-fringe pattern, that is, the error generated in the motion scene is corrected first, so as to accurately measure the three-dimensional data of the object without increasing the hardware cost. Further, based on the correction phase shift formula of each sub-fringe pattern, the multiple sub-fringe patterns are grouped to obtain at least two fringe pattern groups, wherein the phase error change period of the respective wrapping phases of at least two fringe pattern groups is the same, and the phase error change trend is opposite, so that the periodic phase error in the motion scene can be eliminated by fusing the wrapping phase of the fringe pattern group, thereby accurately measuring the three-dimensional data of the object without increasing the hardware cost. Finally, the wrapping phase of each fringe pattern group is determined based on the target projection data, and the compensation wrapping phase is obtained by fusing the determined wrapping phase, and the compensated wrapping phase is phase-unwrapped to obtain the absolute phase that can be used to accurately determine the three-dimensional data of the object to be measured. The above method does not increase the hardware cost, nor does it reduce the number of fringe patterns. It can also combine the correction of the phase shift formula and the fusion and complementation of the wrapped phase of the fringe pattern group to eliminate the periodic phase error in the motion scene. Therefore, based on the above method, when using the phase-shifted coded fringe pattern to measure the three-dimensional data of the object in the motion scene, the three-dimensional data of the object can be accurately measured without increasing the hardware cost.
[0094] In an exemplary embodiment, when there is relative motion between the projection point and the object to be measured, the preset phase shift relationship of multiple sub-fringe patterns in the fringe pattern to be processed is corrected to obtain a correction phase shift formula for each sub-fringe pattern, including:
[0095] When there is relative motion between the projection point and the object to be measured, the phase shift between every two sub-fringe patterns is determined based on a preset phase shift relationship between multiple sub-fringe patterns in the fringe pattern to be processed;
[0096] Determine the phase error caused by the relative motion, and correct the phase shift between every two sub-fringe patterns according to the phase error to obtain a corrected phase shift relationship;
[0097] Based on the correction phase shift relationship, the correction phase shift formula of each sub-fringe pattern is obtained.
[0098] Optionally, when there is relative motion between the projection point and the object to be measured, the server can determine the preset phase shift formula corresponding to each sub-fringe pattern and the phase shift between every two sub-fringe patterns based on the preset phase shift relationship between the multiple sub-fringe patterns in the fringe pattern to be processed. Further, for every two sub-fringe patterns, the server can first use characters or letters to represent the relative error caused by the relative motion between every two sub-fringe patterns, so as to correct the phase shift between every two sub-fringe patterns according to the phase error between every two sub-fringe patterns, thereby achieving correction of the preset phase shift relationship of the multiple sub-fringe patterns and obtaining the corrected phase shift relationship, that is, achieving correction of the preset phase shift formula corresponding to each sub-fringe pattern, and then obtaining the corrected phase shift formula for each sub-fringe pattern.
[0099] For example, taking the standard four-step phase-shift coded fringe pattern as an example, the server can correct the preset phase shift relationship of the four sub-fringe patterns in the sub-fringe pattern to be processed to obtain the correction phase shift formula for each sub-fringe pattern, which can be specifically shown in formula (3). is the correction phase shift formula corresponding to the first sub-fringe pattern, is the correction phase shift formula corresponding to the second sub-fringe pattern, is the correction phase shift formula corresponding to the third sub-fringe pattern, is the correction phase shift formula corresponding to the fourth sub-fringe pattern.
[0100] In this embodiment, considering the phase error generated in the motion scene, the preset phase shift relationship between the multiple sub-fringe patterns is first corrected, that is, the preset phase shift formula of each sub-fringe pattern is first corrected to obtain the corrected phase shift formula of each sub-fringe pattern in the dynamic scene, so that the grouping simulation in the motion scene can be accurately performed based on the corrected phase shift formula of each sub-fringe pattern in the subsequent motion scene, thereby determining the grouping method that can eliminate the periodic phase error in the motion scene. Based on this, the multiple sub-fringe patterns in the fringe pattern to be processed can be grouped with reference to any of the determined grouping methods, ensuring that the respective wrapped phases of the obtained multiple fringe pattern groups can be fused to obtain the compensated wrapped phase that can eliminate the periodic phase error in the motion scene, and then ensuring that the compensated wrapped phase can be phase-unwrapped to obtain the absolute phase that can be used to accurately restore the three-dimensional data of the object to be measured, which is beneficial to the use of phase-shifted coded fringe patterns in motion scenes to measure the three-dimensional data of the object, and the three-dimensional data of the object can be accurately measured based on the absolute phase without increasing the hardware cost.
[0101] In a possible implementation, obtaining a fringe image to be processed includes:
[0102] Get the standard fringe pattern;
[0103] When the phase unwrapping method is time phase unwrapping, the standard fringe pattern is converted into a fringe pattern of a first frequency and a fringe pattern of a second frequency respectively; the first frequency is lower than the second frequency;
[0104] The fringe pattern of the first frequency and the fringe pattern of the second frequency are used as the fringe patterns to be processed.
[0105] Among them, temporal phase unwrapping can be specifically: unwrapping by using phase data of two or more different frequencies obtained at different times. In this embodiment, temporal phase unwrapping can be performed based on multi-frequency heterodyne method. The number of sub-fringe patterns included in the standard fringe pattern, the fringe pattern of the first frequency, and the fringe pattern of the second frequency is the same, and the preset phase shift relationship between the sub-fringe patterns is also the same, but the frequencies carried by the sub-fringe patterns are different. The frequencies carried by the multiple sub-fringe patterns in the standard fringe pattern can be understood as the default frequencies, while the frequencies carried by the multiple sub-fringe patterns in the fringe pattern of the first frequency are all the first frequencies, and the frequencies carried by the multiple sub-fringe patterns in the fringe pattern of the second frequency are all the second frequencies.
[0106] Optionally, the server may first obtain a standard fringe pattern. When the phase unwrapping method is time phase unwrapping, the server may first convert the standard fringe pattern into a fringe pattern of a first frequency and a fringe pattern of a second frequency, respectively, and use the fringe pattern of the first frequency and the fringe pattern of the second frequency as fringe patterns to be processed. That is, when it is planned to perform time phase unwrapping on the compensated wrapped phase, the server needs to process the standard fringe pattern to obtain a low-frequency fringe pattern and a high-frequency fringe pattern for subsequent projection.
[0107] In this example, considering the need to perform time phase unwrapping based on the multi-frequency heterodyne method (which requires the use of phase data of different frequencies for unwrapping), the standard fringe pattern is first processed to convert the single-frequency standard fringe pattern into a multi-frequency fringe pattern.
[0108] It should be noted that when the phase unwrapping method is time phase unwrapping, because the fringe pattern to be processed includes the fringe pattern of the first frequency and the fringe pattern of the second frequency, when the subsequent server groups the fringe patterns to be processed, it is necessary to group the multiple sub-fringe patterns in the fringe pattern of the first frequency according to the determined grouping method, and obtain multiple fringe pattern groups corresponding to the fringe pattern of the first frequency, and group the multiple sub-fringe patterns in the fringe pattern of the second frequency, and obtain multiple fringe pattern groups corresponding to the fringe pattern of the second frequency.
[0109] For example, the standard fringe pattern is a standard four-step phase-shift coded fringe pattern. At this time, the standard fringe pattern includes four sub-fringe patterns. The server can pre-determine through grouping simulation that "the first, second, and third sub-fringe patterns are used as the first fringe pattern group, and the second, third, and fourth sub-fringe patterns are used as the second fringe pattern group" is the required grouping method. Based on this, for multiple sub-fringe patterns in the fringe pattern of the first frequency, after correcting the preset phase shift relationship of the multiple sub-fringe patterns in the fringe pattern of the first frequency, the server can carry the first sub-fringe pattern of the first frequency (the correction phase shift formula is ), the second sub-fringe pattern (the correction phase shift formula is ), the third sub-fringe pattern (the correction phase shift formula is ), as the first fringe pattern group corresponding to the fringe pattern of the first frequency (the corresponding correction phase shift formula includes , , ), the second sub-fringe pattern, the third sub-fringe pattern, and the fourth sub-fringe pattern carrying the first frequency (the correction phase shift formula is ), as the second fringe pattern group corresponding to the fringe pattern of the first frequency (the corresponding correction phase shift formula includes , , ). Similarly, the server can group multiple sub-fringe patterns in the fringe pattern of the second frequency to obtain the first fringe pattern group corresponding to the fringe pattern of the second frequency (the corresponding correction phase shift formula includes , , ) and the second fringe pattern group (the corresponding correction phase shift formula includes , , ).
[0110] Based on the above process of obtaining the fringe pattern to be processed when the phase unwrapping method is time phase unwrapping, in some embodiments, the fringe pattern to be processed is projected onto the surface of the object to be measured based on the projection point to obtain target projection data, including:
[0111] Combining two sub-fringe patterns with the same phase shift value and different frequencies in the fringe pattern of the first frequency and the fringe pattern of the second frequency to obtain a plurality of projection combinations;
[0112] For each projection combination, the sub-fringe patterns in the projection combination are cross-projected onto the surface of the object to be measured based on the projection points to obtain projection data corresponding to the projection combination;
[0113] According to the projection data corresponding to each of the multiple projection combinations, target projection data is obtained.
[0114] Optionally, when the phase unwrapping method is time phase unwrapping, the server can combine two sub-fringe patterns with the same phase shift value and different frequencies in the fringe pattern of the first frequency and the second frequency to obtain multiple projection combinations. Further, the server can send the projection sequence generated based on the multiple projection combinations to the projection device (which can be used as a projection point), cross-project the sub-fringe patterns in each projection combination in the projection sequence to the surface of the object to be measured through the projection device, and control the camera to collect the projection images generated by the cross-projection process, and the camera converts the projection images generated by the projection of the multiple projection combinations into the corresponding projection data of each of the multiple projection combinations, and the camera transmits the converted projection data to the server, so that the server obtains the target projection data.
[0115] For example, the standard fringe pattern is a standard four-step phase-shift coded fringe pattern. Two sub-fringe patterns with the same phase shift value and different frequencies in the fringe pattern of the first frequency and the fringe pattern of the second frequency are combined to generate the projection sequence required for the cross projection. Specifically, the server can generate the first sub-fringe pattern (available in the fringe pattern of the first frequency) in the fringe pattern of the first frequency. Indicates) the first sub-fringe pattern in the fringe pattern of the second frequency (available As a projection combination, we get the projection sequence " , ", similarly, we get another three projection sequences" , "," , "," , ”, thus generating a cross-projection sequence “ , , , , , , , ” Among them, the projection sequence corresponding to the multiple sub-fringe patterns in the fringe pattern of the first frequency can be characterized as “ , , , ", the projection sequence corresponding to the multiple sub-fringe patterns in the fringe pattern of the second frequency can be characterized as " , , , ", and cross projection can reduce the influence of relative motion on projection sequences of different frequencies by cross-projecting two sets of fringe pattern projection sequences of different frequencies onto the surface of the object.
[0116] In this embodiment, when planning to unwrap the compensated wrapped phase through time phase unwrapping, the fringe pattern of the first frequency and the fringe pattern of the second frequency in the processed fringe pattern are cross-projected to reduce the impact of the relative motion between the projection point and the object to be measured on the projection sequence of the fringe patterns of different frequencies, which is beneficial to improving the accuracy of the obtained target projection data, thereby helping to improve the accuracy of the absolute phase obtained through time phase unwrapping, and further helping to accurately measure the three-dimensional data of the object based on the final absolute relative accuracy when using the phase-shifted encoded fringe pattern to measure the three-dimensional data of the object in a moving scene without increasing the hardware cost.
[0117] In one embodiment, the phase unwrapping method is time phase unwrapping; the fringe pattern to be processed includes a fringe pattern of a first frequency and a fringe pattern of a second frequency; the at least two fringe pattern groups include a plurality of fringe pattern groups of the first frequency and a plurality of fringe pattern groups of the second frequency;
[0118] The wrapped phases of at least two fringe pattern groups are fused to obtain a compensated wrapped phase, and the compensated wrapped phase is phase-unwrapped to obtain an absolute phase for determining three-dimensional data of the object to be measured, including:
[0119] Fusing the wrapping phases of a plurality of fringe pattern groups of the first frequency to obtain a first frequency compensation wrapping phase, and fusing the wrapping phases of a plurality of fringe pattern groups of the second frequency to obtain a second frequency compensation wrapping phase;
[0120] Temporal phase unwrapping is performed based on the first frequency-compensated wrapped phase and the second frequency-compensated wrapped phase to obtain an absolute phase for determining three-dimensional data of the object to be measured.
[0121] Optionally, when the phase unwrapping method is time phase unwrapping, the server can obtain a fringe pattern of the first frequency and a fringe pattern of the second frequency, and cross-project the fringe pattern of the first frequency and the fringe pattern of the second frequency onto the surface of the object to be measured based on the projection point to obtain target projection data generated by the cross projection. In addition, the server will group multiple sub-fringe patterns in the fringe pattern of the first frequency according to the grouping method determined by the grouping simulation to obtain multiple fringe pattern groups of the first frequency, and group multiple sub-fringe patterns in the fringe pattern of the second frequency to obtain multiple fringe pattern groups of the second frequency.
[0122] Further, for multiple fringe pattern groups of the first frequency, the server may first determine the calculation formulas for the wrapping phases corresponding to each of the multiple fringe pattern groups of the first frequency, and substitute the target projection data obtained after cross-projection for calculation, to obtain the wrapping phases corresponding to each of the multiple fringe pattern groups of the first frequency, and average the wrapping phases of the multiple fringe pattern groups of the first frequency to obtain the first frequency compensation wrapping phase. For multiple fringe pattern groups of the second frequency, the server may first determine the calculation formulas for the wrapping phases corresponding to each of the multiple fringe pattern groups of the second frequency, and substitute the target projection data obtained after cross-projection for calculation, to obtain the wrapping phases corresponding to each of the multiple fringe pattern groups of the second frequency, and average the wrapping phases of the multiple fringe pattern groups of the second frequency to obtain the second frequency compensation wrapping phase.
[0123] Furthermore, the server may perform time phase unwrapping based on the first frequency-compensated wrapped phase and the second frequency-compensated wrapped phase to obtain an absolute phase for determining three-dimensional data of the object to be measured.
[0124] Exemplarily, taking the standard four-step phase-shift coded fringe pattern as an example, when the phase unwrapping method is time phase unwrapping, the fringe pattern to be processed includes a fringe pattern of a first frequency and a fringe pattern of a second frequency. When the fringe pattern to be processed is grouped based on a determined grouping method, the server can group the fringe pattern of the first frequency and the fringe pattern of the second frequency respectively to obtain two fringe pattern groups corresponding to the fringe pattern of the first frequency and two fringe pattern groups corresponding to the fringe pattern of the second frequency. Further, the server can calculate the respective wrapped phases ( and ), and merge and , get the first frequency compensation wrapping phase corresponding to the first frequency fringe pattern Similarly, the wrapping phases of the two fringe pattern groups corresponding to the fringe pattern of the second frequency are calculated ( and ), and merge and , get the second frequency compensation wrapping phase corresponding to the second frequency fringe pattern Furthermore, the server can use formula (13) to compensate the wrapping phase based on the first frequency and second frequency compensation wrapping phase Perform time phase unwrapping to obtain the absolute phase used to determine the three-dimensional data of the object to be measured ,as follows:
[0125] (13)
[0126] in, is the first frequency, is the second frequency, is the modulo operator.
[0127] In this example, when the planned phase unwrapping method is time phase unwrapping, that is, the fringe pattern to be processed includes a fringe pattern of the first frequency and a fringe pattern of the second frequency, the server can group the fringe pattern of the first frequency and the fringe pattern of the second frequency respectively, and obtain the respective wrapped phases of the multiple fringe pattern groups corresponding to the fringe pattern of the first frequency, thereby fusing them to obtain the first frequency compensation wrapped phase that can eliminate the periodic phase error in the motion scene, and similarly, obtain the second frequency compensation wrapped phase. On this basis, the server can further perform time phase unwrapping based on the first frequency compensation wrapped phase and the second frequency compensation wrapped phase to obtain an absolute phase that can be used to accurately restore the surface data of the object to be measured, so that when the phase-shifted coded fringe pattern is used to measure the three-dimensional data of the object in the motion scene, the three-dimensional data of the object can be accurately measured by the obtained absolute phase without increasing the hardware cost.
[0128] It should be noted that there is not only one way to obtain the fringe pattern to be processed, and the server can also perform unwrapping based on spatial phase unwrapping. Based on this, in one embodiment, obtaining the fringe pattern to be processed includes:
[0129] Get the standard fringe pattern;
[0130] When the phase unwrapping method is spatial phase unwrapping, the standard fringe pattern is used as the fringe pattern to be processed;
[0131] Phase unwrapping is performed on the compensation wrapping phase to obtain an absolute phase for determining the three-dimensional data of the object to be measured, including:
[0132] Obtain a phase diagram corresponding to the compensation wrapping phase;
[0133] Spatial phase unwrapping is performed based on the phase difference between adjacent points in the phase diagram to obtain an absolute phase for determining three-dimensional data of the object to be measured.
[0134] Specifically, spatial phase unwrapping can be achieved by comparing the phase values of adjacent pixels in the phase image to achieve unwrapping, focusing on analyzing the spatial distribution characteristics of the phase image to restore the true phase. Spatial phase unwrapping is actually to find an optimal unwrapping phase path in the phase image. Since the phase unwrapping is performed in the same space, it is called spatial phase unwrapping (spatial phase unwrapping / spatial phase unwrapping algorithm), which can be achieved through Goldstein's branch cut algorithm, qualityguide phase unwrapping algorithm, mask cut algorithm and other methods.
[0135] Optionally, the server may first obtain a standard fringe pattern, and if unwrapping is to be performed based on spatial phase unwrapping, the server may use the standard fringe pattern as the fringe pattern to be processed. Further, the server may send the fringe pattern to be processed (which may also be understood as a projection sequence representing the fringe pattern to be processed) to a projection device, project the fringe pattern to be processed onto the surface of the object to be measured through the projection device, and control the camera to collect the projection image generated by the projection process, convert the projection image into projection data by the camera, and transmit the projection data to the server by the camera, so that the server obtains the target projection data. Further, the server may group the multiple sub-fringe patterns in the fringe pattern to be processed according to the determined grouping method, obtain multiple fringe pattern groups, and respectively determine the calculation formula of the wrapping phase corresponding to each fringe pattern group, thereby substituting the obtained target projection data for calculation, obtaining the wrapping phase corresponding to each fringe pattern group, and averaging the wrapping phases of all fringe pattern groups to obtain the compensation wrapping phase required for subsequent spatial phase unwrapping.
[0136] After obtaining the compensated wrapped phase, the server can further generate a phase diagram corresponding to the compensated wrapped phase, and find an optimal unwrapped phase path in the phase diagram based on the phase difference between adjacent points in the phase diagram, so as to restore the real phase according to the path starting point of the optimal path, that is, to obtain the absolute phase for determining the three-dimensional data of the object to be measured. Among them, the spatial phase unwrapping algorithm can usually use the phase values of two adjacent pixels for calculation, and generally only a single-frequency wrapped phase is required for solution (the time phase unwrapping algorithm requires multiple frequencies of compensated wrapped phases for solution), such as the single-frequency compensated wrapped phase in this embodiment, which will not be repeated here.
[0137] Exemplarily, taking the standard four-step phase-shift coded fringe pattern as an example, when the phase unwrapping method is spatial phase unwrapping, the server can use the standard four-step phase-shift coded fringe pattern as the fringe pattern to be processed, and can use the first, second, and third sub-fringe patterns in the fringe pattern to be processed as the first fringe pattern group, and the second, third, and fourth sub-fringe patterns in the fringe pattern to be processed as the second fringe pattern group. Further, the server can obtain the corresponding wrapped phase of each fringe pattern group based on the target projection data obtained after projecting the fringe pattern to be processed and the calculation formula of the wrapped phase corresponding to each fringe pattern group. Furthermore, the server can fuse the wrapped phases corresponding to the two fringe pattern groups to obtain the compensated wrapped phase, so as to obtain the absolute phase that can be used to accurately restore the three-dimensional data of the object to be measured by performing spatial phase unwrapping on the compensated wrapped phase.
[0138] In this example, if the phase unwrapping method to be used is spatial phase unwrapping, that is, the fringe pattern to be processed is a standard fringe pattern of a single frequency, the server can group the fringe patterns to be processed to obtain multiple fringe pattern groups, and calculate the respective wrapped phases of the multiple fringe pattern groups, thereby fusing them to obtain a compensated wrapped phase that can eliminate periodic phase errors in motion scenes. On this basis, the server can perform spatial phase unwrapping on the obtained compensated wrapped phase to obtain an absolute phase that can be used to accurately restore the surface data of the object to be measured, so that when the phase-shifted coded fringe pattern is used to measure the three-dimensional data of the object in a motion scene, the three-dimensional data of the object can be accurately measured by the obtained absolute phase without increasing the hardware cost.
[0139] In a possible embodiment, based on the embodiments of the phase error correction method in the above motion scene, as Figure 3 As shown, a flow chart of obtaining the absolute phase after phase error correction by time phase unwrapping in a motion scene is provided, which mainly includes the following steps:
[0140] Step 302, converting the standard fringe pattern into a fringe pattern of a first frequency and a fringe pattern of a second frequency; wherein the fringe pattern of the first frequency and the fringe pattern of the second frequency are used together as the fringe pattern to be processed;
[0141] Step 304, cross-projecting the fringe pattern of the first frequency and the fringe pattern of the second frequency to obtain target projection data; wherein, considering the multi-frequency fringe situation when performing the time phase unwrapping later, the fringe patterns of different frequencies are cross-projected in step 304 to reduce the influence of the relative motion between the projection point and the object to be measured on the phase error of the projection sequence of the fringe patterns of different frequencies, which is conducive to obtaining a more accurate absolute phase;
[0142] Step 306, grouping the multiple sub-fringe patterns in the fringe pattern of the first frequency according to a predetermined grouping method to obtain multiple fringe pattern groups of the first frequency, and grouping the multiple sub-fringe patterns in the fringe pattern of the second frequency to obtain multiple fringe pattern groups of the second frequency; wherein the predetermined grouping method needs to ensure that: after the wrapped phases of the multiple fringe pattern groups of the first frequency are fused, the periodic errors in the motion scene can be eliminated to the greatest extent, and after the wrapped phases of the multiple fringe pattern groups of the second frequency are fused, the periodic errors in the motion scene can also be eliminated to the greatest extent;
[0143] Step 308, based on the target projection data, calculating the respective wrapping phases of the plurality of fringe pattern groups of the first frequency, and fusing the plurality of wrapping phases of the first frequency to obtain a first frequency compensation wrapping phase;
[0144] Step 310, based on the target projection data, calculating the respective wrapping phases of the plurality of fringe pattern groups of the second frequency, and fusing the plurality of wrapping phases of the second frequency to obtain a second frequency compensation wrapping phase;
[0145] Step 312: Perform time phase unwrapping based on the first frequency-compensated wrapped phase and the second frequency-compensated wrapped phase to obtain an absolute phase for determining three-dimensional data of the object to be measured.
[0146] In this embodiment, a first frequency compensation wrapping phase and a second frequency compensation wrapping phase that can eliminate periodic phase errors in motion scenes can be obtained, thereby ensuring that the first frequency compensation wrapping phase and the second frequency compensation wrapping phase can be time-phase unfolded to obtain an absolute phase that can be used to accurately restore the three-dimensional data of the object to be measured. This is beneficial when using a phase-shifted coded fringe pattern to measure the three-dimensional data of the object in a motion scene. The three-dimensional data of the object can be accurately measured without increasing the hardware cost (suitable for low-cost optical three-dimensional measurement equipment) (there is no need to reduce the number of sub-fringe patterns, the anti-interference ability and phase quality of the fringe pattern to be processed can be maintained, and the accurate absolute phase can be solved).
[0147] In another possible embodiment, based on the embodiments of the phase error correction method in the above motion scene, such as Figure 4 As shown, a flow chart of obtaining the absolute phase after phase error correction by spatial phase unwrapping in a motion scene is provided, which mainly includes the following steps:
[0148] Step 402, using the standard fringe pattern as the fringe pattern to be processed;
[0149] Step 404, projecting the fringe pattern to be processed to obtain target projection data;
[0150] Step 406, grouping the multiple sub-fringe patterns in the fringe pattern to be processed according to a predetermined grouping method to obtain multiple fringe pattern groups; wherein the predetermined grouping method needs to ensure that: after the wrapped phases of the multiple fringe pattern groups are fused, the periodic error in the motion scene can be eliminated to the greatest extent;
[0151] Step 408, based on the target projection data, calculating the respective wrapping phases of the plurality of fringe pattern groups, and fusing the respective wrapping phases of the plurality of fringe pattern groups to obtain a compensated wrapping phase;
[0152] Step 410 , performing spatial phase unwrapping on the compensated wrapped phase to obtain an absolute phase for determining three-dimensional data of the object to be measured.
[0153] In this embodiment, a compensating wrapped phase that can eliminate periodic phase errors in motion scenes can be obtained, thereby ensuring that the absolute phase that can be used to accurately restore the three-dimensional data of the object to be measured can be obtained by performing spatial phase unfolding on the compensating wrapped phase. This is beneficial when using a phase-shifted coded fringe pattern to measure the three-dimensional data of the object in a motion scene. The three-dimensional data of the object can be accurately measured without increasing the hardware cost (suitable for low-cost optical three-dimensional measurement equipment) (there is no need to reduce the number of sub-fringe patterns, the anti-interference ability and phase quality of the fringe pattern to be processed can be maintained, and the accurate absolute phase can be solved).
[0154] It should be understood that, although the steps in the flowcharts involved in the above embodiments are displayed in sequence according to the indication of the arrows, these steps are not necessarily executed in sequence according to the order indicated by the arrows. Unless there is a clear explanation in this article, the execution of these steps is not strictly limited in order, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowcharts involved in the above embodiments may include multiple steps or multiple stages, and these steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily carried out in sequence, but can be executed in turn or alternately with other steps or at least a part of the steps or stages in other steps.
[0155] Based on the same inventive concept, the embodiment of the present application also provides a phase error correction device in a motion scene for implementing the phase error correction method in the motion scene involved above. The implementation scheme for solving the problem provided by the device is similar to the implementation scheme recorded in the above method, so the specific limitations in the embodiments of the phase error correction device in one or more motion scenes provided below can refer to the limitations of the phase error correction method in the motion scene above, and will not be repeated here.
[0156] In an exemplary embodiment, Figure 5As shown, a phase error correction device in a motion scene is provided, comprising: a projection data acquisition module 502, a phase shift formula correction module 504, a sub-fringe pattern grouping module 506 and an absolute phase acquisition module 508, wherein:
[0157] A projection data acquisition module is used to acquire the fringe pattern to be processed, and project the fringe pattern to be processed onto the surface of the object to be measured based on the projection point to obtain target projection data;
[0158] A phase shift formula correction module is used to correct the preset phase shift relationship of multiple sub-fringe patterns in the fringe pattern to be processed when there is relative motion between the projection point and the object to be measured, and obtain a correction phase shift formula for each sub-fringe pattern;
[0159] A sub-fringe pattern grouping module is used to group multiple sub-fringe patterns based on the correction phase shift formula of each sub-fringe pattern to obtain at least two fringe pattern groups; the phase error change period of the wrapped phase of the at least two fringe pattern groups is the same, and the phase error change trend is opposite;
[0160] The absolute phase acquisition module is used to determine the respective wrapped phases of at least two fringe pattern groups based on the target projection data, fuse the respective wrapped phases of at least two fringe pattern groups to obtain the compensated wrapped phase, perform phase unfolding on the compensated wrapped phase, and obtain the absolute phase for determining the three-dimensional data of the object to be measured.
[0161] The phase error correction device in the motion scene projects the fringe pattern to be processed onto the surface of the object to be measured based on the projection point to obtain the target projection data. When the projection point and the object to be measured are in relative motion, the preset phase shift relationship of the multiple sub-fringe patterns in the fringe pattern to be processed is corrected to obtain the correction phase shift formula of each sub-fringe pattern, that is, the error generated in the motion scene is corrected first, so as to accurately measure the three-dimensional data of the object without increasing the hardware cost. Further, based on the correction phase shift formula of each sub-fringe pattern, the multiple sub-fringe patterns are grouped to obtain at least two fringe pattern groups, wherein the phase error change period of the respective wrapping phases of at least two fringe pattern groups is the same, and the phase error change trend is opposite, so that the periodic phase error in the motion scene can be eliminated by fusing the wrapping phase of the fringe pattern group, thereby accurately measuring the three-dimensional data of the object without increasing the hardware cost. Finally, the wrapping phase of each fringe pattern group is determined based on the target projection data, and the compensation wrapping phase is obtained by fusing the determined wrapping phase, and the compensated wrapping phase is phase-unwrapped to obtain the absolute phase that can be used to accurately determine the three-dimensional data of the object to be measured. The above method does not increase the hardware cost, nor does it reduce the number of fringe patterns. It can also combine the correction of the phase shift formula and the fusion and complementation of the wrapped phase of the fringe pattern group to eliminate the periodic phase error in the motion scene. Therefore, based on the above method, when using the phase-shifted coded fringe pattern to measure the three-dimensional data of the object in the motion scene, the three-dimensional data of the object can be accurately measured without increasing the hardware cost.
[0162] In one of the embodiments, the phase shift formula correction module is also used to: when there is relative motion between the projection point and the object to be measured, determine the phase shift between every two sub-fringe patterns based on a preset phase shift relationship between multiple sub-fringe patterns in the fringe pattern to be processed; determine the phase error caused by the relative motion, and according to the phase error, correct the phase shift between every two sub-fringe patterns to obtain a corrected phase shift relationship; based on the corrected phase shift relationship, obtain a corrected phase shift formula for each sub-fringe pattern.
[0163] In one of the embodiments, the projection data acquisition module is also used to: acquire a standard fringe pattern; when the phase unwrapping method is time phase unwrapping, convert the standard fringe pattern into a fringe pattern of a first frequency and a fringe pattern of a second frequency respectively; the first frequency is lower than the second frequency; and use the fringe pattern of the first frequency and the fringe pattern of the second frequency as the fringe patterns to be processed.
[0164] In one of the embodiments, the projection data acquisition module is also used to: combine two sub-fringe patterns with the same phase shift value but different frequencies in the fringe pattern of the first frequency and the second frequency to obtain multiple projection combinations; for each projection combination, cross-project the sub-fringe patterns in the projection combination onto the surface of the object to be measured based on the projection point to obtain projection data corresponding to the projection combination; and obtain target projection data based on the corresponding projection data of each of the multiple projection combinations.
[0165] In one embodiment, the phase unwrapping method is time phase unwrapping; the fringe pattern to be processed includes a fringe pattern of a first frequency and a fringe pattern of a second frequency; the at least two fringe pattern groups include a plurality of fringe pattern groups of a first frequency and a plurality of fringe pattern groups of a second frequency. The absolute phase acquisition module is further used to: fuse the wrapped phases of the plurality of fringe pattern groups of the first frequency to obtain a first frequency compensated wrapped phase, and fuse the wrapped phases of the plurality of fringe pattern groups of the second frequency to obtain a second frequency compensated wrapped phase; perform time phase unwrapping based on the first frequency compensated wrapped phase and the second frequency compensated wrapped phase to obtain an absolute phase for determining the three-dimensional data of the object to be measured.
[0166] In one embodiment, the projection data acquisition module is further used to: acquire a standard fringe pattern; when the phase unwrapping method is spatial phase unwrapping, use the standard fringe pattern as the fringe pattern to be processed.
[0167] In one embodiment, the absolute phase acquisition module is also used to: obtain a phase diagram corresponding to the compensated wrapped phase; perform spatial phase unfolding based on the phase difference between adjacent points in the phase diagram to obtain an absolute phase for determining the three-dimensional data of the object to be measured.
[0168] Each module in the phase error correction device under the above-mentioned motion scene can be implemented in whole or in part by software, hardware and a combination thereof. Each of the above-mentioned modules can be embedded in or independent of the processor in the computer device in the form of hardware, or can be stored in the memory in the computer device in the form of software, so that the processor can call and execute the operations corresponding to each of the above modules.
[0169] In an exemplary embodiment, a computer device is provided. The computer device may be a server, and its internal structure diagram may be as shown in FIG. Figure 6As shown. The computer device includes a processor, a memory, an input / output interface (Input / Output, referred to as I / O) and a communication interface. Among them, the processor, the memory and the input / output interface are connected through a system bus, and the communication interface is connected to the system bus through the input / output interface. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the computer device is used to store phase error correction data in motion scenes. The input / output interface of the computer device is used to exchange information between the processor and an external device. The communication interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, a phase error correction method in a motion scene is implemented.
[0170] Those skilled in the art will understand that Figure 6 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.
[0171] In an exemplary embodiment, a computer device is provided, including a memory and a processor, wherein a computer program is stored in the memory, and the processor implements the steps in the above-mentioned method embodiments when executing the computer program.
[0172] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the steps in the above-mentioned method embodiments are implemented.
[0173] In one embodiment, a computer program product is provided, including a computer program, which implements the steps in the above method embodiments when executed by a processor.
[0174] It should be noted that the information and data involved in this application (including but not limited to data used for analysis, storage, display, etc.) are all information and data fully authorized by all parties, and the collection, use and processing of relevant data must comply with relevant regulations.
[0175] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to the memory, database or other medium used in the embodiments provided in the present application can include at least one of non-volatile memory and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The database involved in each embodiment provided in this application may include at least one of a relational database and a non-relational database. Non-relational databases may include distributed databases based on blockchains, etc., but are not limited to this. The processor involved in each embodiment provided in this application may be a general-purpose processor, a central processing unit, a graphics processor, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, an artificial intelligence (AI) processor, etc., but are not limited to this.
[0176] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this application.
[0177] The above embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the present application. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the attached claims.
Claims
1. A phase error correction method in a motion scene, characterized in that: The method comprises: Acquire a fringe pattern to be processed, and project the fringe pattern to be processed onto a surface of an object to be measured based on a projection point to obtain target projection data; When there is relative motion between the projection point and the object to be measured, the preset phase shift relationship of the multiple sub-fringe patterns in the fringe pattern to be processed is corrected to obtain a correction phase shift formula for each of the sub-fringe patterns; Based on the correction phase shift formula of each sub-fringe pattern, the plurality of sub-fringe patterns are grouped to obtain at least two fringe pattern groups; the phase error variation period of the respective wrapped phases of the at least two fringe pattern groups is the same, and the phase error variation trends are opposite; Based on the target projection data, the wrapping phases of the at least two fringe pattern groups are determined, the wrapping phases of the at least two fringe pattern groups are fused to obtain a compensated wrapping phase, and the compensated wrapping phase is phase-unwrapped to obtain an absolute phase for determining the three-dimensional data of the object to be measured.
2. The method according to claim 1, characterized in that When the projection point and the object to be measured are in relative motion, the preset phase shift relationship of the multiple sub-fringe patterns in the fringe pattern to be processed is corrected to obtain a correction phase shift formula for each sub-fringe pattern, including: When there is relative motion between the projection point and the object to be measured, based on a preset phase shift relationship between a plurality of sub-fringe patterns in the fringe pattern to be processed, determining a phase shift between every two of the sub-fringe patterns; Determine a phase error caused by the relative motion, and correct the phase shift between every two sub-fringe patterns according to the phase error to obtain a corrected phase shift relationship; Based on the correction phase shift relationship, a correction phase shift formula for each of the sub-fringe patterns is obtained.
3. The method according to claim 1, characterized in that The step of obtaining a fringe image to be processed comprises: Get the standard fringe pattern; When the phase unwrapping method is time phase unwrapping, the standard fringe pattern is converted into a fringe pattern of a first frequency and a fringe pattern of a second frequency respectively; the first frequency is lower than the second frequency; The fringe pattern of the first frequency and the fringe pattern of the second frequency are used as fringe patterns to be processed.
4. The method according to claim 3, characterized in that Projecting the fringe pattern to be processed onto the surface of the object to be measured based on the projection point to obtain target projection data, including: Combining two sub-fringe patterns with the same phase shift value and different frequencies in the fringe pattern of the first frequency and the fringe pattern of the second frequency to obtain a plurality of projection combinations; For each of the projection combinations, cross-projecting the sub-fringe patterns in the projection combination onto the surface of the object to be measured based on the projection points, to obtain projection data corresponding to the projection combination; Target projection data is obtained according to the projection data corresponding to each of the multiple projection combinations.
5. The method according to any one of claims 1 to 4, characterized in that: The phase unwrapping method is time phase unwrapping; the fringe pattern to be processed includes a fringe pattern of a first frequency and a fringe pattern of a second frequency; the at least two fringe pattern groups include a plurality of fringe pattern groups of the first frequency and a plurality of fringe pattern groups of the second frequency; The fusing of the respective wrapped phases of the at least two fringe pattern groups to obtain a compensated wrapped phase, performing phase unwrapping on the compensated wrapped phase to obtain an absolute phase for determining the three-dimensional data of the object to be measured, comprises: Fusing the wrapping phases of the plurality of fringe pattern groups of the first frequency to obtain a first frequency compensation wrapping phase, and fusing the wrapping phases of the plurality of fringe pattern groups of the second frequency to obtain a second frequency compensation wrapping phase; Temporal phase unwrapping is performed based on the first frequency-compensated wrapping phase and the second frequency-compensated wrapping phase to obtain an absolute phase for determining three-dimensional data of the object to be measured.
6. The method according to claim 1, characterized in that The step of obtaining a fringe image to be processed comprises: Get the standard fringe pattern; When the phase unwrapping method is spatial phase unwrapping, the standard fringe pattern is used as the fringe pattern to be processed; The phase unwrapping of the compensation wrapping phase to obtain an absolute phase for determining the three-dimensional data of the object to be measured includes: Obtaining a phase diagram corresponding to the compensation wrapping phase; Spatial phase unwrapping is performed based on the phase difference between adjacent points in the phase diagram to obtain an absolute phase for determining the three-dimensional data of the object to be measured.
7. A phase error correction device in a motion scene, characterized in that: The device comprises: A projection data acquisition module is used to acquire a fringe pattern to be processed, and project the fringe pattern to be processed onto the surface of the object to be measured based on the projection point to obtain target projection data; A phase shift formula correction module is used to correct the preset phase shift relationship of multiple sub-fringe patterns in the fringe pattern to be processed when the projection point and the object to be measured are in relative motion, so as to obtain a correction phase shift formula for each of the sub-fringe patterns; A sub-fringe pattern grouping module, for grouping the plurality of sub-fringe patterns based on a correction phase shift formula of each sub-fringe pattern to obtain at least two fringe pattern groups; the phase error variation period of the respective wrapped phases of the at least two fringe pattern groups is the same, and the phase error variation trends are opposite; An absolute phase acquisition module is used to determine the respective wrapping phases of the at least two fringe pattern groups based on the target projection data, fuse the respective wrapping phases of the at least two fringe pattern groups to obtain a compensated wrapping phase, perform phase unfolding on the compensated wrapping phase, and obtain an absolute phase for determining the three-dimensional data of the object to be measured.
8. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 6 are implemented.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.
10. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.
Citation Information
Cited By
Arched detection light source detection method
CN120703097A
