Phase compensation method, device and equipment for vibration error, medium and product
By separating and encoding the dual-channel images of the object under test and iteratively optimizing them, the phase shift problem in 3D reconstruction under dynamic scenes was solved, achieving high-precision and real-time phase compensation and improving the accuracy of 3D reconstruction.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-12-23
- Publication Date
- 2026-03-31
AI Technical Summary
In dynamic scenes or vibration environments, traditional 3D reconstruction methods cannot effectively eliminate depth motion artifacts. Existing technologies such as projection point tracking, phase statistics, and deep learning methods each have their limitations and are difficult to achieve high-precision and real-time phase compensation.
By acquiring a dual-channel image of the object under test, the speckle pattern in the red channel and three stripe patterns in the blue channel are obtained through separation and encoding. The initial displacement of the local region of the speckle pattern is determined, and the entire image is iteratively optimized based on the initial displacement to obtain the optimal displacement. The stripe pattern is then compensated in reverse to achieve phase compensation.
It achieves high-precision and real-time compensation for phase shift errors caused by depth direction vibration, improves the accuracy and stability of 3D reconstruction, and avoids the limitations of traditional methods.
Smart Images

Figure CN121761797A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of optical measurement technology, and in particular to a method, apparatus, device, medium, and product for phase compensation of vibration errors. Background Technology
[0002] Phase-shifting profilometry, one of the most widely used techniques in structured light 3D measurement, obtains precise 3D topography by projecting phase-shifted fringe patterns onto an object and using phase demodulation. However, in dynamic scenes or vibrating environments, the slight displacement of the object along the camera's optical axis (Z-axis of depth) causes an additional phase shift in the measured fringes at the moment of sampling. This shift cannot be eliminated by the phase-shifting algorithm itself, resulting in severe motion artifacts in the 3D reconstruction.
[0003] Currently, there are several representative techniques for solving depth motion errors: motion compensation methods based on projection point tracking, motion compensation methods based on phase probability equalization, and motion compensation methods based on deep learning.
[0004] However, traditional projection point tracking methods can only treat regional displacement as global displacement, making it difficult to focus on non-uniform motion in local areas; phase statistics-based methods are sensitive to noise and have limited local accuracy; although deep learning methods have strong fitting ability, they lack stable geometric references, their prediction results depend on a large amount of training data, and their generalization ability is insufficient. Summary of the Invention
[0005] This invention provides a method, apparatus, device, medium, and product for phase compensation of vibration errors, so as to achieve high-precision and real-time compensation for phase offset errors caused by vibration in the depth direction.
[0006] According to a first aspect of the present invention, a phase compensation method for vibration error is provided, the method comprising:
[0007] Acquire a dual-channel image of the object under test, and perform separation encoding on the dual-channel image to obtain a speckle pattern in the red channel and three stripe patterns in the blue channel;
[0008] Determine the initial displacement of local regions in the speckle map for each frame;
[0009] Based on the initial displacement, the entire image of the speckle pattern is iteratively optimized to obtain the optimal displacement;
[0010] The three fringe patterns are reverse-compensated by the optimal displacement to obtain the compensated unfolded phase.
[0011] According to a second aspect of the present invention, a phase compensation device for vibration error is provided, comprising:
[0012] The image acquisition module is used to acquire a dual-channel image of the object under test, and to separate and encode the dual-channel image to obtain a speckle pattern in the red channel and three stripe patterns in the blue channel.
[0013] The displacement determination module is used to determine the initial displacement of local regions in the speckle map in each frame;
[0014] The displacement optimization module is used to perform iterative displacement optimization on the entire image of the speckle pattern based on the initial displacement to obtain the optimal displacement;
[0015] The phase compensation module is used to perform reverse compensation on the three fringe patterns using the optimal displacement to obtain the compensated unfolded phase.
[0016] According to a third aspect of the present invention, an electronic device is provided, the electronic device comprising:
[0017] At least one processor; and
[0018] A memory communicatively connected to the at least one processor; wherein,
[0019] The memory stores a computer program that can be executed by the at least one processor, which enables the at least one processor to perform the vibration error phase compensation method according to any embodiment of the present invention.
[0020] According to a fourth aspect of the present invention, a computer-readable storage medium is provided, the computer-readable storage medium storing computer instructions for causing a processor to execute and implement the vibration error phase compensation method according to any embodiment of the present invention.
[0021] According to a fifth aspect of the present invention, embodiments of the present invention also provide a computer program product, the computer program product including a computer program, which, when executed by a processor, implements the vibration error phase compensation method of any embodiment of the present invention.
[0022] The technical solution of this invention acquires a dual-channel image of the object under test, separates and encodes the dual-channel image to obtain a speckle pattern in the red channel and three fringe patterns in the blue channel; determines the initial displacement of a local region in the speckle pattern of each frame; performs iterative displacement optimization on the entire speckle pattern based on the initial displacement to obtain the optimal displacement; and performs reverse compensation on the three fringe patterns using the optimal displacement to obtain the compensated unfolded phase. By obtaining accurate displacement through the red channel speckle pattern and reverse compensating the blue channel fringe pattern, the accuracy of displacement detection and the reliability of phase compensation are balanced, achieving high-precision and real-time compensation for phase shift errors caused by depth-direction vibration.
[0023] It should be understood that the description in this section is not intended to identify key or essential features of the embodiments of the present invention, nor is it intended to limit the scope of the invention. Other features of the invention will become readily apparent from the following description. Attached Figure Description
[0024] To more clearly illustrate the technical solutions in the embodiments of the present invention, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0025] Figure 1 This is a flowchart of a vibration error phase compensation method provided according to Embodiment 1 of the present invention;
[0026] Figure 2 This is a schematic diagram of a measurement system for a phase compensation method for vibration error provided according to Embodiment 1 of the present invention;
[0027] Figure 3 This is a fringe diagram of a phase compensation method for vibration error provided according to Embodiment 1 of the present invention;
[0028] Figure 4 This is a speckle diagram illustrating a phase compensation method for vibration error provided according to Embodiment 1 of the present invention.
[0029] Figure 5 This is a schematic diagram of the structure of a phase compensation device for vibration error provided in Embodiment 2 of the present invention;
[0030] Figure 6 This is a schematic diagram of the structure of an electronic device that implements an embodiment of the present invention. Detailed Implementation
[0031] To enable those skilled in the art to better understand the present invention, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings of the embodiments of the present invention. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort should fall within the scope of protection of the present invention.
[0032] It should be noted that the terms "first," "second," etc., in the specification, claims, and accompanying drawings of this invention are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of the invention described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.
[0033] Example 1
[0034] Figure 1 This is a flowchart illustrating a phase compensation method for vibration errors provided in Embodiment 1 of the present invention. This embodiment is applicable to phase compensation of a test object containing vibration errors. The method can be executed by a phase compensation device for vibration errors, which can be implemented in hardware and / or software and can be configured in an electronic device. Figure 1 As shown, the method includes:
[0035] S110. Acquire a dual-channel image of the object to be tested, and perform separation encoding on the dual-channel image to obtain a speckle pattern in the red channel and three stripe patterns in the blue channel.
[0036] In this embodiment, the object under test can be understood as an object undergoing vibrational motion whose phase needs to be measured. A dual-channel image can be understood as a color image composed of red and blue channels, projected onto the surface of the object under test by a color projector and then captured by a color camera; the two channels encode patterns with different functions. A speckle pattern can be understood as an image with a random grayscale distribution encoded by the red channel. A fringe pattern can be understood as three sinusoidal phase-shifted fringe patterns encoded by the blue channel.
[0037] For example, a concrete example can be used to demonstrate the generation of a two-channel image. Figure 2 This is a schematic diagram of a measurement system for a phase compensation method for vibration error provided in Embodiment 1 of the present invention, as shown below. Figure 2As shown, a measurement system can be set up to acquire dual-channel images of the object under test. The measurement system includes a color camera 1, a color projector 2, a horizontal moving platform 3, a white calibration plate 4, and a computer 5. The positions of the color camera 1, the horizontal moving platform 3, and the white calibration plate 4 are adjusted so that the optical axis of the color camera 1, the direction of the horizontal moving platform 3, and the center of the white calibration plate 4 are on the same straight line, and the white calibration plate 4 is fixed to the horizontal moving platform 3 by a clamp. For example, if the object under test is the white calibration plate 4, the deformed fringe pattern on the white calibration plate 4 can be clearly imaged in the measurement field of the color camera 1. The computer 5 generates a dual-channel coded pattern: the blue channel is the coded fringe pattern, and the red channel is the speckle image. The parameters of the horizontal moving platform 3 are set: a motion command is sent through the serial port, and a new control command is added to make the platform slider vibrate periodically within its motion range with an amplitude of 3mm, and the vibration frequency is set to 5Hz. The white calibration plate 4 is fixed to the slider so that it vibrates synchronously with the platform. The color projector 2 projects the dual-channel pattern onto the object under test, and the color camera 1 acquires the dual-channel pattern.
[0038] Among them, three sinusoidal phase-shifted fringe images were generated. Satisfy the following formula:
[0039]
[0040] in, The light intensity of the positive phase-shifted fringe image. For the background light intensity of the stripes, For striped tones, For phase information, n=1,2,3, N=3.
[0041] Specifically, the processor can be the computer in the example above. The processor can acquire a dual-channel image of the object under test taken by a color camera, and separate and decode the dual-channel image to obtain a speckle pattern in the red channel and three stripe patterns in the blue channel.
[0042] For example, a specific example can be used to demonstrate the collected stripe and speckle patterns. Figure 3 This is a fringe diagram illustrating a phase compensation method for vibration error provided in Embodiment 1 of the present invention, as shown below. Figure 3 As shown, this is one of the three fringe patterns. It can be seen that it presents sinusoidal fringes with periodic alternation of light and dark. Compared with the original fringe pattern of the projection, it will have a phase error introduced by the depth vibration. The core difference between the three fringe patterns is that the phase is shifted by a fixed angle in turn. The other basic parameters (background light intensity, modulation degree, fringe period) are the same. If only a single fringe pattern is used, it is impossible to separate the influence of background light intensity, noise and the true phase. If the phase shift is irregular, it is also impossible to construct an effective system of equations to solve it. Figure 4This is a speckle diagram illustrating a phase compensation method for vibration error provided in Embodiment 1 of the present invention, as shown below. Figure 4 As shown, the speckle pattern has no fixed periodicity, the gray values are randomly distributed, and the bright and dark pixels are arranged alternately to form a uniform and unique speckle texture without obvious edges or regular patterns.
[0043] Among them, three sinusoidal phase-shifted fringe images were collected. Satisfy the following formula:
[0044]
[0045] in, The light intensity of the sinusoidal phase-shifted fringe image. The background light intensity of the acquired striped image. To acquire the modulation of the stripe image, The folded phase information is calculated from the acquired sinusoidal phase-shifted fringe image. The phase error introduced by the vibration in the depth direction of the object, n=1,2,3, N=3.
[0046] make , , Then we have:
[0047]
[0048] Equation (3) can be rewritten as a system of equations as follows:
[0049]
[0050] Phase change can be obtained using equation (4) . The calculation formula is as follows:
[0051]
[0052] S120. Determine the initial displacement of local regions in the speckle map for each frame.
[0053] In this embodiment, the local region specifically refers to the ROI (Region of Interest) at the center of the speckle pattern. This region is chosen because the central region has more stable imaging and less noise, providing a reliable initial reference for displacement calculation. The initial displacement can be understood as the displacement parameters used to characterize the local region.
[0054] Specifically, for each frame of speckle image, the processor can select a sub-region at the center of the image, establish an objective function through the sub-region, minimize the objective function of the image processing algorithm DIC, and solve for the displacement of the sub-region as the initial displacement.
[0055] S130. Based on the initial displacement, perform iterative optimization of the entire image of the speckle pattern to obtain the optimal displacement.
[0056] In this embodiment, the optimal displacement can be understood as the final result of displacement iterative optimization, which is the full pixel displacement covering the entire image.
[0057] Specifically, since the initial displacement obtained in the previous step only reflects the motion information of a local area, while the displacement of the actual object in the whole image is different in different parts, it is necessary to construct a global error function based on the initial displacement of the sub-region, and obtain the optimal displacement that minimizes the overall matching error through iterative solution.
[0058] S140. The three fringe patterns are reverse-compensated by the optimal displacement to obtain the compensated unfolded phase.
[0059] In this embodiment, the unfolded phase can be understood as a global continuous phase that truly reflects the geometric information (depth, displacement, strain) of an object.
[0060] Specifically, the processor can reverse the phase of the acquired fringe pattern by obtaining the optimal displacement to obtain the folded phase, and then unwrap the folded phase to cancel the phase error caused by the depth vibration of the object and restore the true continuous phase, i.e., the unfolded phase.
[0061] The technical solution of this invention acquires a dual-channel image of the object under test, separates and encodes the dual-channel image to obtain a speckle pattern in the red channel and three fringe patterns in the blue channel; determines the initial displacement of a local region in the speckle pattern of each frame; performs iterative displacement optimization on the entire speckle pattern based on the initial displacement to obtain the optimal displacement; and performs reverse compensation on the three fringe patterns using the optimal displacement to obtain the compensated unfolded phase. By obtaining accurate displacement through the red channel speckle pattern and reverse compensating the blue channel fringe pattern, the accuracy of displacement detection and the reliability of phase compensation are balanced, achieving high-precision and real-time compensation for phase shift errors caused by depth-direction vibration.
[0062] Furthermore, based on the above embodiments, the steps for determining the initial displacement of local regions in the speckle map of each frame can be refined as follows:
[0063] For each frame of the speckle map, a sub-region at the center of the speckle map is selected to obtain a set of sub-regions; the initial displacement is determined based on the normalized cross-correlation coefficient and the sub-regions of adjacent frames in the set of sub-regions.
[0064] In this embodiment, a sub-region can be understood as a local pixel block at the center of the speckle pattern, a key region specifically selected for calculating the initial displacement. The reason for choosing the center location is that the speckle pattern center imaging is more stable, with less edge distortion and noise, providing more reliable gray-level matching features and avoiding displacement calculation errors caused by edge region interference. The sub-region set can be understood as a collection of sub-regions from different frames. The normalized cross-correlation coefficient can be understood as a statistical function that quantifies the similarity of gray-level distribution in the central sub-regions of speckle patterns from adjacent frames.
[0065] Specifically, for each frame of speckle image, the processor can select a sub-region at the image center, resulting in a set of sub-regions composed of sub-regions from different frames. The processor can establish an objective function based on the normalized cross-correlation coefficient and solve for the sub-regions of adjacent frames in the sub-region set to determine the initial displacement. For example, the processor can use an image processing algorithm (such as Digital Image Correlation, DIC) to minimize the objective function and solve for the displacement of the sub-region as the initial displacement. Here, the normalized cross-correlation coefficient is used as the matching target, and its objective function is:
[0066]
[0067] in, For a set of sub-regions, For displacement model, For the parameters to be determined, The average value of the sub-regions in the first and second frames. Let be the standard deviation. Minimize this to obtain the optimal subregion displacement parameters.
[0068] Furthermore, based on the above embodiments, the step of performing displacement iteration optimization on the entire image of the speckle pattern based on the initial displacement to obtain the optimal displacement can be refined as follows:
[0069] Based on the initial displacement, a global error function for the entire image of the speckle pattern is constructed; the global error function is iteratively solved using the least squares method to update the displacement estimate; the displacement estimate that minimizes the global error function is taken as the optimal displacement.
[0070] In this embodiment, the global error function can be understood as a function that quantifies the matching error of the entire speckle pattern. Essentially, it is the sum of the squares of the grayscale errors of all pixels in the entire image, ensuring that the displacement estimate covers the entire image rather than just a local area. The displacement estimate can be understood as the displacement parameter obtained after each round of correction during the iteration process, which is an intermediate result that gradually approximates the true displacement.
[0071] Specifically, the processor can construct a global error function based on the initial displacement of the sub-region, and obtain the optimal global displacement that minimizes the overall matching error through iterative solution. The normalized error function for the entire image is defined as:
[0072]
[0073] in, For the entire image, This is the first frame of the speckle pattern. This is the speckle pattern of the nth frame after the initial displacement translation. The initial iteration parameters are:
[0074]
[0075] Furthermore, based on the above embodiments, the steps for reverse compensation of the three fringe patterns using optimal displacement can be refined as follows:
[0076] The folded phase value is determined based on the optimal displacement; the fringe order is determined based on the three fringe patterns; the folded phase value is expanded by combining the optimal three-fringe selection method with the fringe order to determine the expanded phase.
[0077] In this embodiment, the folded phase value can be understood as the phase value determined after optimal phase inverse compensation. It exhibits a 2π periodic jump and cannot directly reflect global depth information, requiring further expansion. The fringe order can be understood as a quantitative index used to identify the periodicity of the bright and dark periods of the periodic fringes in the blue channel fringe pattern. The optimal three-fringe selection method can be understood as a multi-frequency fringe parameter optimization algorithm used for phase unwrapping.
[0078] Specifically, the processor can perform reverse phase compensation on the acquired fringe pattern using optimal displacement, and simultaneously substitute this into the above formula (5) to obtain the folded phase value. The relationship between the unfolded phase and the folded phase is shown in formula (9). The processor can unfold the folded phase value using the optimal three-fringe method to obtain the unfolded phase.
[0079]
[0080] in, To unfold the phase, For folded phase, It is a stripe level.
[0081] The number of fringe periods required for projection in the optimal three-fringe selection method satisfies the following relationship:
[0082]
[0083]
[0084] in, The number of stripe groups, and , The maximum number of stripe periods. For the optimal three-stripe selection rule... And the relationship between the number of stripe periods satisfies formula (11), so choose By traversing all pixels in the field and correcting all 2π transitions through the fringe level, a seamless and continuous global phase, i.e., the unfolded phase, is obtained. The periods of the three fringe patterns are designed according to the optimal three-fringe rule.
[0085] As a first optional embodiment of this embodiment, after performing reverse compensation on the three fringe patterns through optimal displacement to obtain the compensated unfolded phase, the method further includes:
[0086] The three-dimensional shape of the object under test is determined based on the unfolded phase and the calibration position data of the object under test.
[0087] In this embodiment, the three-dimensional morphology can be understood as the real three-dimensional spatial structure of the surface of the object to be measured.
[0088] In this embodiment, the calibration position data can be understood as the calibrated reference data. For example, following the above example, a white calibration plate is placed at 13 known positions in a direction almost perpendicular to the camera's optical axis, so that the depth measurement range is ±24mm and the interval between adjacent positions is 4mm. At each plate position, a projector projects a sequence of 36 sinusoidal fringes (3 frequencies, 12 steps) onto the calibration plate surface; then the camera acquires the fringes image at each plate position and stores it in the computer; the folded phase is calculated using the 12-step phase shift method; the absolute phase is calculated using the optimal three-fringe selection method; finally, the middle 0 position is selected as the reference position, and the following formula is used to establish... and By establishing the correspondence between them, the polynomial coefficients at each pixel can be obtained.
[0089]
[0090] in, These are the fitting coefficients. It is the depth offset of a pixel of the object under test relative to the reference position.
[0091] Specifically, the processor can substitute the unfolded phase into the above formula to obtain the depth offset of each pixel, forming the three-dimensional coordinate data of the object under test, and thus obtaining the three-dimensional shape of the object under test.
[0092] The technical solution of this invention uses a red channel to encode a speckle pattern and a blue channel to encode three sinusoidal phase-shift fringe patterns. Dual-channel synchronous projection and acquisition ensure the motion synchronization of displacement and phase data, avoiding errors caused by the asynchronous nature of traditional additional projection markers and fringe patterns. Separate color channel encoding reduces interference from ambient light and surface reflections on a single channel, and subsequent color crosstalk correction further improves data purity, resulting in stronger robustness than traditional single-channel measurements. The speckle pattern provides a highly recognizable matching benchmark for the DIC algorithm, ensuring accurate displacement calculation; the periodic structure of the fringe pattern provides the basis for phase demodulation. The two have clear division of labor and share the same data source, solving the core problem of separating displacement reference and phase measurement in existing technologies. Initial displacement is first obtained through the ROI region at the center of the speckle pattern, and then a global error function is constructed using the Gauss-Newton least squares algorithm. Iterative updates yield the full-pixel displacement field, overcoming the limitation that the initial displacement only reflects local motion, achieving accurate compensation across the entire pixel area, and adapting to non-uniform vibrations. By combining the optimal three-fringe selection method to achieve phase unwrapping, the phase is accurately mapped to depth. This method offers more stable measurement accuracy than existing phase probability equalization methods (which have weak noise resistance) and deep learning methods (which have poor generalization). It does not rely on large-scale training data (unlike deep learning methods) or complex encoding and decoding processes (unlike encoded fringe methods). It can be achieved using only conventional color cameras, projectors, and algorithm optimization. This method balances accuracy and practicality, accurately responds to small vibrations, and significantly improves the accuracy of 3D reconstruction.
[0093] Example 2
[0094] Figure 5 This is a schematic diagram of the structure of a phase compensation device for vibration error provided in Embodiment 2 of the present invention. Figure 5 As shown, the device includes:
[0095] Image acquisition module 51 is used to acquire a dual-channel image of the object to be tested, and to separate and encode the dual-channel image to obtain a speckle pattern in the red channel and three stripe patterns in the blue channel.
[0096] The displacement determination module 52 is used to determine the initial displacement of a local region in the speckle map in each frame;
[0097] The displacement optimization module 53 is used to perform iterative displacement optimization on the entire image of the speckle pattern based on the initial displacement to obtain the optimal displacement;
[0098] The phase compensation module 54 is used to perform reverse compensation on the three fringe patterns through the optimal displacement to obtain the compensated unfolded phase.
[0099] The dual-channel image is obtained by projecting a dual-channel pattern onto the object under test using a color projector. The dual-channel pattern consists of a coded stripe pattern in the blue channel and a speckle pattern in the red channel.
[0100] Furthermore, the displacement determination module 52 is specifically used for:
[0101] For each frame of the speckle map, a sub-region at the center of the speckle map is selected to obtain a set of sub-regions;
[0102] The initial displacement is determined by combining the normalized cross-correlation coefficient with the sub-regions of adjacent frames in the sub-region set.
[0103] Furthermore, the displacement optimization module 53 is specifically used for:
[0104] Based on the initial displacement, a global error function for the entire image of the speckle pattern is constructed;
[0105] The global error function is solved iteratively using the least squares method to update the displacement estimate.
[0106] The displacement estimate that minimizes the global error function is taken as the optimal displacement.
[0107] Furthermore, the phase compensation module 54 is specifically used for:
[0108] Based on the optimal displacement, determine the folding phase value;
[0109] Determine the stripe order based on the three stripe patterns described;
[0110] The unfolded phase is determined by expanding the folded phase value using the optimal three-stripe selection method combined with the stripe order.
[0111] Optionally, the device further includes a topography determination module.
[0112] The morphology determination module is specifically used for:
[0113] After performing reverse compensation on the three fringe patterns using the optimal displacement to obtain the compensated unfolded phase, the three-dimensional shape of the object under test is determined based on the unfolded phase and the calibration position data of the object under test.
[0114] The vibration error phase compensation device provided in the embodiments of the present invention can execute the vibration error phase compensation method provided in any embodiment of the present invention, and has the corresponding functional modules and beneficial effects of the method.
[0115] Example 3
[0116] Figure 6A schematic diagram of an electronic device 40 that can be used to implement embodiments of the present invention is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processors, cellular phones, smartphones, wearable devices (e.g., helmets, glasses, watches, etc.), and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely illustrative and are not intended to limit the implementation of the invention described and / or claimed herein.
[0117] like Figure 6 As shown, the electronic device 40 includes at least one processor 41 and a memory, such as a read-only memory (ROM) 42 and a random access memory (RAM) 43, communicatively connected to the at least one processor 41. The memory stores computer programs executable by the at least one processor. The processor 41 can perform various appropriate actions and processes based on the computer program stored in the ROM 42 or loaded from storage unit 48 into the RAM 43. The RAM 43 can also store various programs and data required for the operation of the electronic device 40. The processor 41, ROM 42, and RAM 43 are interconnected via a bus 44. An input / output (I / O) interface 45 is also connected to the bus 44.
[0118] Multiple components in electronic device 40 are connected to I / O interface 45, including: input unit 46, such as keyboard, mouse, etc.; output unit 47, such as various types of monitors, speakers, etc.; storage unit 48, such as disk, optical disk, etc.; and communication unit 49, such as network card, modem, wireless transceiver, etc. Communication unit 49 allows electronic device 40 to exchange information / data with other devices through computer networks such as the Internet and / or various telecommunications networks.
[0119] Processor 41 can be a variety of general-purpose and / or special-purpose processing components with processing and computing capabilities. Some examples of processor 41 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special-purpose artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, a digital signal processor (DSP), and any suitable processor, controller, microcontroller, etc. Processor 41 performs the various methods and processes described above, such as phase compensation methods for vibration errors.
[0120] In some embodiments, the vibration error phase compensation method may be implemented as a computer program tangibly contained in a computer-readable storage medium, such as storage unit 48. In some embodiments, part or all of the computer program may be loaded and / or installed on electronic device 40 via ROM 42 and / or communication unit 49. When the computer program is loaded into RAM 43 and executed by processor 41, one or more steps of the vibration error phase compensation method described above may be performed. Alternatively, in other embodiments, processor 41 may be configured to perform the vibration error phase compensation method by any other suitable means (e.g., by means of firmware).
[0121] Various embodiments of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field-programmable gate arrays (FPGAs), application-specific integrated circuits (ASICs), application-specific standard products (ASSPs), systems-on-a-chip (SoCs), payload-programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various embodiments may include implementations in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which may be a dedicated or general-purpose programmable processor, capable of receiving data and instructions from a storage system, at least one input device, and at least one output device, and transmitting data and instructions to the storage system, the at least one input device, and the at least one output device.
[0122] Computer programs used to implement the methods of the present invention may be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, such that when executed by the processor, the computer programs cause the functions / operations specified in the flowcharts and / or block diagrams to be performed. The computer programs may be executed entirely on a machine, partially on a machine, or as a standalone software package, partially on a machine and partially on a remote machine, or entirely on a remote machine or server.
[0123] In the context of this invention, a computer-readable storage medium can be a tangible medium that may contain or store a computer program for use by or in conjunction with an instruction execution system, apparatus, or device. A computer-readable storage medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination thereof. Alternatively, a computer-readable storage medium may be a machine-readable signal medium. More specific examples of machine-readable storage media include electrical connections based on one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fibers, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination thereof.
[0124] To provide interaction with a user, the systems and techniques described herein can be implemented on an electronic device having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and pointing device (e.g., a mouse or trackball) through which the user provides input to the electronic device. Other types of devices can also be used to provide interaction with the user; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including sound input, voice input, or tactile input).
[0125] The systems and technologies described herein can be implemented in computing systems that include backend components (e.g., as data servers), or middleware components (e.g., application servers), or frontend components (e.g., user computers with graphical user interfaces or web browsers through which users can interact with implementations of the systems and technologies described herein), or any combination of such backend, middleware, or frontend components. The components of the system can be interconnected via digital data communication of any form or medium (e.g., communication networks). Examples of communication networks include local area networks (LANs), wide area networks (WANs), blockchain networks, and the Internet.
[0126] A computing system can include clients and servers. Clients and servers are generally located far apart and typically interact through communication networks. The client-server relationship is created by computer programs running on the respective computers and having a client-server relationship with each other. The server can be a cloud server, also known as a cloud computing server or cloud host, which is a hosting product within the cloud computing service system to address the shortcomings of traditional physical hosts and VPS services, such as high management difficulty and weak business scalability.
[0127] In one embodiment, the present invention further includes a computer program product, which includes a computer program that, when executed by a processor, implements the vibration error phase compensation method of any embodiment of the present invention.
[0128] In implementing the computer program product, computer program code for performing the operations of this invention can be written in one or more programming languages or a combination thereof. Programming languages include object-oriented programming languages such as Java, Smalltalk, and C++, as well as conventional procedural programming languages such as C or similar languages. The program code can be executed entirely on the user's computer, partially on the user's computer, as a standalone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving remote computers, the remote computer can be connected to the user's computer via any type of network—including a local area network (LAN) or a wide area network (WAN)—or can be connected to an external computer (e.g., via the Internet using an Internet service provider).
[0129] It should be understood that the various forms of processes shown above can be used, with steps reordered, added, or deleted. For example, the steps described in this invention can be executed in parallel, sequentially, or in different orders, as long as the desired result of the technical solution of this invention can be achieved, and this is not limited herein.
[0130] The specific embodiments described above do not constitute a limitation on the scope of protection of this invention. Those skilled in the art should understand that various modifications, combinations, sub-combinations, and substitutions can be made according to design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of this invention should be included within the scope of protection of this invention.
Claims
1. A method of phase compensation of vibration errors, characterized in that, The method comprises: acquiring a double-channel image of a to-be-measured object, performing separate coding on the double-channel image to obtain a speckle pattern under a red channel and three fringe patterns under a blue channel; determining an initial displacement of a local region in the speckle pattern under each frame; performing displacement iterative optimization on the whole image of the speckle pattern based on the initial displacement to obtain an optimal displacement; performing reverse compensation on the three fringe patterns through the optimal displacement to obtain a compensated unwrapped phase.
2. The method of claim 1, wherein, The determination of the initial displacement of the local region in the speckle pattern under each frame comprises: for the speckle pattern of each frame, selecting a sub-region at the center of the speckle pattern to obtain a sub-region set; determining an initial displacement based on a normalized cross-correlation coefficient and sub-regions of adjacent frames in the sub-region set.
3. The method of claim 1, wherein, The displacement iterative optimization on the whole image of the speckle pattern based on the initial displacement to obtain an optimal displacement comprises: constructing a global error function of the whole image of the speckle pattern based on the initial displacement; updating a displacement estimation value by iteratively solving the global error function through a least square method; taking the displacement estimation value that minimizes the global error function as the optimal displacement.
4. The method of claim 1, wherein, The reverse compensation on the three fringe patterns through the optimal displacement to obtain a compensated unwrapped phase comprises: determining a folded phase value according to the optimal displacement; determining a fringe order according to the three fringe patterns; determining an unwrapped phase by unwrapping the folded phase value through an optimal three-fringe selection method in combination with the fringe order.
5. The method of claim 1, wherein, After the reverse compensation on the three fringe patterns through the optimal displacement to obtain a compensated unwrapped phase, the method further comprises: determining a three-dimensional topography of the to-be-measured object according to the unwrapped phase and calibration position data of a position where the to-be-measured object is located.
6. The method of claim 1, wherein, The double-channel image is obtained by projecting a double-channel pattern composed of an encoded fringe pattern of a blue channel and a speckle pattern of a red channel onto the to-be-measured object by a color projector.
7. A device for phase compensation of vibration errors, characterized in that The method comprises: an image acquisition module configured to acquire a double-channel image of a to-be-measured object, perform separate coding on the double-channel image to obtain a speckle pattern under a red channel and three fringe patterns under a blue channel; a displacement determination module configured to determine an initial displacement of a local region in the speckle pattern under each frame; a displacement optimization module configured to perform displacement iterative optimization on the whole image of the speckle pattern based on the initial displacement to obtain an optimal displacement; a phase compensation module configured to perform reverse compensation on the three fringe patterns through the optimal displacement to obtain a compensated unwrapped phase.
8. An electronic device, comprising: The electronic device comprises: at least one processor; and a memory connected in communication with the at least one processor; wherein the memory stores a computer program that can be executed by the at least one processor, and the computer program is executed by the at least one processor to enable the at least one processor to execute the phase compensation method for vibration error according to any one of claims 1-6.
9. A computer-readable storage medium, characterized in that, The computer readable storage medium stores computer instructions for causing the processor to implement the phase compensation method of the vibration error according to any one of claims 1-6 when executed.
10. A computer program product, characterised in that, The computer program product comprises a computer program which, when executed by the processor, implements the phase compensation method of the vibration error according to any one of claims 1-6.