Phase height mapping method, device, system, computer device and storage medium

By combining linear and nonlinear mapping methods with a neural network correction model, the problems of low phase height mapping accuracy and complex calibration in existing technologies are solved, achieving efficient and accurate phase height mapping.

CN116625276BActive Publication Date: 2026-06-02HUIZHOU MICRON TECH CO LTD

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
HUIZHOU MICRON TECH CO LTD
Filing Date
2023-04-21
Publication Date
2026-06-02

Smart Images

  • Figure CN116625276B_ABST
    Figure CN116625276B_ABST
Patent Text Reader

Abstract

The application discloses a phase height mapping method, device, system, computer equipment and storage medium, and the method comprises the steps of obtaining a to-be-measured workpiece image modulated by a sine fringe; calculating a phase difference matrix of a measured point on the to-be-measured workpiece according to the to-be-measured workpiece image, as a first phase difference matrix; pre-processing the first phase difference matrix to obtain two parts required for linear mapping and nonlinear mapping; performing linear mapping on the part required for linear mapping to obtain a height information matrix of a linear region, as a first height information matrix; inputting the part required for nonlinear mapping into a trained neural network model to output a predicted height information matrix after nonlinear mapping, as a second height information matrix; and adding the first height information matrix and the second height information matrix to obtain overall height information. The application can correct the influence of phase distortion caused by image distortion on height calculation.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to a phase height mapping method, apparatus, system, computer equipment, and storage medium, belonging to the field of structured light three-dimensional measurement technology. Background Technology

[0002] Structured light measurement technology has advantages such as non-contact measurement, high precision, and high speed, and has been widely used in industrial inspection, machine vision, and biomedicine. Establishing a high-precision phase-height mapping relationship is one of the key technologies in structured light measurement.

[0003] Currently, there are two main types of phase height mapping algorithms: one calibrates the phase height mapping relationship based on the system's structural parameters and a reference plane; the other treats the projector as a camera, transforming the calibration of the structured light measurement system into a mature binocular vision calibration. The first type of calibration requires a precision translation stage to move the standard plane several positions within the measurement volume, placing high demands on the equipment and making it unsuitable for on-site calibration with low accuracy. The second type of calibration establishes a correspondence between camera and projector images by projecting grating images in different directions onto a calibration plate, thus transforming the calibration of the structured light measurement system into a mature binocular vision calibration. This method is simple and easy to implement; however, because the lens distortion used in general commercial projectors is greater than that of industrial lenses, the pinhole imaging model that considers lens distortion cannot effectively eliminate it, making it difficult to achieve high calibration accuracy when calibrating projectors. Therefore, simplifying the steps, improving efficiency, and generating a more universal solution while ensuring accuracy and robustness is an important research direction in this field.

[0004] Neural networks, with their high-speed parallel computing and powerful function approximation capabilities, can learn from known samples and approximate any finite continuous function with arbitrary precision. Currently, many scholars have studied the application of neural networks in structured light measurement technology. Summary of the Invention

[0005] In view of this, the present invention provides a phase height mapping method, apparatus, system, computer device and storage medium, which realizes phase height mapping based on linear and neural network nonlinearity, can correct the influence of phase distortion caused by image distortion on height calculation, has fast calculation speed, strong robustness, and wide applicability. Because the model used is fixed, the process can be simplified and it is easy to implement and deploy.

[0006] The first objective of this invention is to provide a phase height mapping method.

[0007] A second objective of this invention is to provide a phase height mapping device.

[0008] A third objective of this invention is to provide a phase height mapping system.

[0009] A fourth objective of this invention is to provide a computer device.

[0010] The fifth object of the present invention is to provide a storage medium.

[0011] The first objective of this invention can be achieved by adopting the following technical solution:

[0012] A phase height mapping method, the method comprising:

[0013] Acquire an image of the workpiece under test modulated with sinusoidal fringes;

[0014] Calculate the phase difference matrix of the measured points on the workpiece based on the image of the workpiece to be tested;

[0015] Preprocessing the phase difference matrix yields the two parts required for linear and nonlinear mappings;

[0016] Perform a high-level linear mapping on the part required for the linear mapping to obtain the height information matrix of the linear region, which serves as the first height information matrix;

[0017] The part required for nonlinear mapping is input into the trained nonlinear distortion correction neural network model, and the output is the height information matrix predicted after nonlinear mapping, which is used as the second height information matrix.

[0018] The overall altitude information is obtained by adding the first altitude information matrix and the second altitude information matrix.

[0019] Furthermore, before acquiring the test image modulated with sinusoidal stripes, the process further includes:

[0020] Acquire a standard workpiece image modulated with sinusoidal stripes;

[0021] Based on the standard workpiece image, calculate the actual phase difference matrix of the measured points on the standard workpiece, and use the matrix composed of the height information corresponding to all pixels of the actual phase difference matrix as the actual height matrix.

[0022] Based on the actual phase difference matrix, the standard height matrix is ​​calculated using the phase height mapping formula;

[0023] The difference between the standard height matrix and the actual height matrix is ​​calculated to obtain the difference matrix;

[0024] The difference matrix is ​​processed by a function to obtain the identifier matrix;

[0025] The neural network model is pre-trained based on the identification matrix, standard phase difference matrix, and standard height matrix to make the prediction results reach the standard results.

[0026] The neural network model is trained based on the identifier matrix and the actual phase difference matrix to achieve the standard prediction result, resulting in a trained nonlinear distortion correction neural network model, and the identifier matrix is ​​updated.

[0027] Furthermore, the pre-training of the neural network model based on the identifier matrix, standard phase difference matrix, and standard height matrix to achieve the standard prediction results specifically includes:

[0028] Based on the identification matrix, the standard phase difference matrix is ​​preprocessed to obtain the standard phase difference matrix of the distortion region;

[0029] Based on the identification matrix and the standard height matrix, calculate the standard height matrix of the distortion region corresponding to the standard phase difference matrix of the distortion region;

[0030] The standard phase difference matrix of the distorted region is input into the neural network model, and the predicted height matrix of the distorted region is output. All values ​​of the neural network model are trained, and backpropagation is used to correct the neural network model so that the predicted height matrix of the distorted region gradually approaches the standard height matrix of the distorted region.

[0031] Furthermore, the step of training the neural network model based on the identifier matrix and the actual phase difference matrix to achieve the standard prediction result, thereby obtaining a trained nonlinear distortion correction neural network model, specifically includes:

[0032] Based on the identification matrix, the actual phase difference matrix of each pixel is preprocessed to obtain the actual phase difference matrix of the distorted region.

[0033] The actual phase difference matrix of the distorted region is input into the neural network model, and the predicted height matrix of the distorted region is output. All values ​​of the neural network model are trained, and backpropagation is used to correct the neural network model so that the predicted height matrix of the distorted region gradually approaches the standard height matrix of the distorted region, thus obtaining a trained nonlinear distortion correction neural network model.

[0034] Furthermore, the phase height mapping formula is as follows:

[0035]

[0036] Where p is the actual phase difference at the measured point, d is the distance from the optical center to the reference plane, l is the distance between the two optical centers, and θ D Let θ be the reference phase value of the grating on the reference plane. E This represents the phase of the grating image after distortion following the addition of a standard workpiece.

[0037] Furthermore, the backpropagation correction employs the gradient descent method, the formula of which is as follows:

[0038]

[0039] Where η is the learning rate, ΔW ij For weight variables, Let E be the derivative of the current position, and E be the cost function, which is the squared error cost function, calculated as follows:

[0040]

[0041] Among them, H predict This is the predicted output of the neural network model.

[0042] The second objective of this invention can be achieved by adopting the following technical solution:

[0043] A phase height mapping device, the device comprising:

[0044] The acquisition module is used to acquire an image of the workpiece under test after being modulated with sinusoidal stripes;

[0045] The first calculation module is used to calculate the phase difference matrix of the measured points on the workpiece based on the image of the workpiece to be tested.

[0046] The preprocessing module is used to preprocess the phase difference matrix to obtain the two parts required for linear and nonlinear mapping;

[0047] The linear mapping module is used to perform a linear mapping on the part required for linear mapping, and obtain the height information matrix of the linear region, which serves as the first height information matrix.

[0048] The nonlinear mapping module is used to input the part required for nonlinear mapping into the trained nonlinear distortion correction neural network model, and output the height information matrix predicted after nonlinear mapping, which serves as the second height information matrix.

[0049] The second calculation module is used to add the first altitude information matrix and the second altitude information matrix to obtain the overall altitude information.

[0050] The third objective of this invention can be achieved by adopting the following technical solution:

[0051] A phase height mapping system includes a camera, a projector, and a computer. The projector and the camera are parallel to each other and are at the same distance from a reference plane. A workpiece is placed on the reference plane. The workpiece is either a standard workpiece or a workpiece to be measured. The computer is connected to the projector and the camera respectively.

[0052] The projector is used to project sinusoidally modulated structured light stripes onto the workpiece;

[0053] The camera is used to acquire images of the workpiece modulated with sinusoidal stripes;

[0054] The computer is used to execute the phase height mapping method described above.

[0055] The fourth objective of this invention can be achieved by adopting the following technical solution:

[0056] A computer device includes a processor and a memory for storing a processor-executable program, characterized in that, when the processor executes the program stored in the memory, it implements the phase height mapping method described above.

[0057] The fifth objective of this invention can be achieved by adopting the following technical solution:

[0058] A storage medium storing a program that, when executed by a processor, implements the phase height mapping method described above.

[0059] The present invention has the following advantages over the prior art:

[0060] This invention achieves phase-height mapping based on linear and nonlinear neural network methods, which can, to some extent, solve the impact of lens distortion on height mapping, such as radial and tangential distortion. By combining linear height mapping with nonlinear neural network mapping, it solves these problems while improving the speed and robustness of phase and height mapping. It also has a wide range of applications and strong anti-interference capabilities. Attached Figure Description

[0061] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on the structures shown in these drawings without creative effort.

[0062] Figure 1 This is a structural diagram of the phase height mapping system of Embodiment 1 of the present invention.

[0063] Figure 2 This is a schematic diagram of the optical principle of Embodiment 1 of the present invention.

[0064] Figure 3 This is a simplified flowchart of the phase height mapping method according to Embodiment 1 of the present invention.

[0065] Figure 4This is a detailed flowchart of the phase height mapping method according to Embodiment 1 of the present invention.

[0066] Figure 5 This is a flowchart of the construction of the nonlinear distortion correction neural network model in Embodiment 1 of the present invention.

[0067] Figure 6 This is a structural block diagram of the phase height mapping device according to Embodiment 2 of the present invention.

[0068] Figure 7 This is a structural block diagram of the computer device according to Embodiment 3 of the present invention. Detailed Implementation

[0069] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are some embodiments of the present invention, but not all embodiments. All other embodiments obtained by those skilled in the art based on the embodiments of the present invention without creative effort are within the scope of protection of the present invention.

[0070] Example 1:

[0071] This embodiment provides a phase-height mapping method, which is mainly implemented through a phase-height mapping system. This system is a three-dimensional measurement system capable of acquiring data and calculating the phase-height matrix, such as... Figure 1 As shown, it includes a camera 1, a projector 2, and a computer 5. The camera 1 is a CCD (Charge Coupled Device) camera. The projector 2 is parallel to the optical axis of the camera 1, and both axes are perpendicular to the reference plane 4. The projector 2 and camera 1 are at the same distance from the reference plane 4. A workpiece 3, which can be a standard workpiece or the workpiece to be measured, is placed on the reference plane. The projector 1 can project sinusoidally modulated structured light stripes onto the workpiece, and the camera 2 can acquire the workpiece image modulated by the sinusoidal stripes. The computer 5 is connected to both the projector 1 and the camera 2, and can realize the specific process of phase height mapping. The optical principle of this system is as follows: Figure 2 As shown, h is the height of the measured point B, p is the actual phase difference of the measured point B, and d is the distance from the optical center (O). p and O c The distance from the reference plane is l, and the distance between the two optical centers is l.

[0072] like Figure 3 and Figure 4 As shown, the phase height mapping method in this embodiment includes the following steps:

[0073] S401. Obtain an image of the workpiece under test modulated with sinusoidal stripes.

[0074] In this embodiment, before acquiring the image of the workpiece to be tested, a nonlinear distortion correction neural network model needs to be constructed, such as... Figure 5 As shown, the specific process is as follows:

[0075] S501. Obtain a standard workpiece image modulated with sinusoidal stripes.

[0076] In this embodiment, a projector projects sinusoidally modulated structured light stripes onto a standard workpiece, and a camera captures a large number of images modulated by sinusoidal stripes.

[0077] S502. Based on the standard workpiece image, calculate the actual phase difference matrix of the measured points on the standard workpiece, and use the matrix composed of the height information corresponding to all pixels of the actual phase difference matrix as the actual height matrix.

[0078] The relative phase of the grating image is calculated using a four-step phase-shifting method. The phase shifts of the four raster images are 0, π The light intensities are as follows:

[0079]

[0080]

[0081]

[0082]

[0083] Where A is the background light intensity and B is the modulation depth; the wrapping phase is solved according to the above equations as follows:

[0084]

[0085] Then, the phase is expanded using the multi-frequency heterodyne method to obtain the absolute phase.

[0086] Finally, according to the phase height mapping formula, it is as follows:

[0087]

[0088] Where p, d, and l are parameters that need to be calibrated in the phase-height model (phase-height mapping formula), these parameters can be measured manually, θ D Let θ be the reference phase value of the grating on the reference plane. E This represents the phase of the grating image after distortion following the addition of a standard workpiece.

[0089] θ can be determined using the phase shift method. D and θ E Using θD -θ E The value of the matrix is ​​the actual phase difference matrix T of the measured point on the standard workpiece, and the matrix composed of the height information corresponding to all pixels is the actual height matrix H. t .

[0090] S503. Based on the actual phase difference matrix, the standard height matrix is ​​calculated using the phase height mapping formula.

[0091] In this embodiment, since the calibration workpiece parameters are known, that is, the corresponding distortion-free standard phase difference matrix P is also known, the standard height matrix H can be obtained through the phase height mapping formula mentioned above using the standard phase difference matrix.

[0092] S504. Solve for the difference between the standard height matrix and the actual height matrix to obtain the difference matrix.

[0093] In this embodiment, the standard height matrix H and the actual height matrix H' are solved. t The difference between the standard height matrix and the measured height matrix is ​​obtained by calculating the difference matrix D.

[0094] S505. Perform function processing on the difference matrix to obtain the identifier matrix.

[0095] The function processing formula for each corresponding item in the difference matrix D in this embodiment is as follows:

[0096] D(x,y)=H(x,y)-H t (x,y)

[0097] The difference matrix D is processed by a function to generate an identifier matrix M for the height difference information. s The position with a value of 1 indicates no deviation, and the calculation formula can be expressed as:

[0098]

[0099] S506. Based on the identifier matrix, standard phase difference matrix, and standard height matrix, pre-train the neural network model to make the prediction results reach the standard results.

[0100] Furthermore, step S506 specifically includes:

[0101] S5061. Based on the identification matrix, preprocess the standard phase difference matrix to obtain the standard phase difference matrix of the distorted region.

[0102] Specifically, according to the identification matrix M s Preprocessing the standard phase difference matrix P yields the standard phase difference matrix P in the distorted region. s The formula is as follows:

[0103] Ps (x,y)=P(x,y)-M s (x,y)·P(x,y)

[0104] S5062. Based on the identification matrix and the standard height matrix, calculate the standard height matrix of the distorted region corresponding to the standard phase difference matrix of the distorted region.

[0105] Specifically, according to the identification matrix M s Given the standard height matrix H, calculate the standard phase difference matrix of the distortion region corresponding to the standard height matrix H of the distortion region. s The formula is as follows:

[0106] H s (x,y)=H(x,y)-M s (x,y)·H(x,y)

[0107] S5063. Input the standard phase difference matrix of the distorted region into the neural network model, and output the predicted height matrix of the distorted region. Train all values ​​of the neural network model, and use backpropagation to correct the neural network model so that the predicted height matrix of the distorted region gradually approaches the standard height matrix of the distorted region.

[0108] The neural network model used in this embodiment is the BP (Back Propagation) neural network model, which uses the standard phase difference matrix P of the distortion region. s Input a backpropagation (BP) neural network model, whose output is the predicted height matrix of the distorted region. Train all values ​​of the neural network using data, and use backpropagation to correct the neural network model so that its predicted output gradually approaches the standard height matrix H of the distorted region. s .

[0109] The BP neural network model has a backpropagation correction process, which uses the gradient descent method. The formula for gradient descent is as follows:

[0110]

[0111] Where η is the learning rate, ΔW ij For weight variables, Let E be the derivative of the current position, and E be the cost function, which is the squared error cost function, calculated as follows:

[0112]

[0113] Among them, H predict This is the predicted output of the BP neural network model.

[0114] S507. Based on the identifier matrix and the actual phase difference matrix, train the neural network model to make the prediction result reach the standard result, obtain the trained nonlinear distortion correction neural network model, and update the identifier matrix.

[0115] Furthermore, step S507 specifically includes:

[0116] S5071. Based on the identifier matrix, preprocess the actual phase difference matrix of each pixel to obtain the actual phase difference matrix of the distorted region.

[0117] Specifically, according to the identification matrix M s The actual phase difference matrix T of each pixel is preprocessed to obtain the actual phase difference matrix T of the distorted region. s The formula is as follows:

[0118] T s (x,y)=T(x,y)-M s (x,y)·T(x,y)

[0119] S5072. Input the actual phase difference matrix of the distorted region into the neural network model, output the predicted height matrix of the distorted region, train all the values ​​of the neural network model, use backpropagation to correct the neural network model, so that the predicted height matrix of the distorted region gradually approaches the standard height matrix of the distorted region, obtain the trained nonlinear distortion correction neural network model, and update the label matrix.

[0120] This embodiment uses the actual phase difference matrix T of the distorted region. s Inputting a BP neural network model, referring to step S5063 above, the output of the BP neural network model is the predicted height matrix of the distorted region, making its predicted output gradually approach the standard height matrix H of the distorted region. s .

[0121] Update the identifier matrix M s The overall identifier matrix M is calculated using the following formula:

[0122] M(x,y)=M(x,y)·M s (x,y)

[0123] In this embodiment, a series of data is used as a training set to repeat the above steps to train the neural network model, and finally a trained nonlinear distortion correction neural network model and an overall identifier matrix M can be obtained.

[0124] S402. Calculate the phase difference matrix of the measured points on the workpiece based on the image of the workpiece to be tested.

[0125] In this embodiment, after acquiring the image of the workpiece under test after sinusoidal stripe modulation by the method in step S501, the phase difference matrix W of the measured points on the workpiece under test is calculated by the method in step S502.

[0126] S403. Preprocess the phase difference matrix to obtain the two parts required for linear and nonlinear mappings. In this embodiment, the phase difference matrix W is preprocessed using the overall identifier matrix M, as shown in the following formula:

[0127] W l (x,y)=M(x,y)·W(x,y)

[0128] W m (x,y)=W(x,y)-W l (x,y)

[0129] Among them, W l W represents the part needed to represent a linear mapping. m The part required for nonlinear mapping.

[0130] S404. Perform a high-level linear mapping on the part required by the linear mapping to obtain the height information matrix of the linear region, which is used as the first height information matrix.

[0131] Specifically, the part W required for the linear mapping l Perform a linear mapping to obtain the height information matrix of the linear region, which serves as the first height information matrix H. l The calculation formula is derived from the phase height formula in step S502, as follows:

[0132]

[0133] Where p, l, and d are the calibration parameters obtained in step S502.

[0134] S405. Input the part required for nonlinear mapping into the trained nonlinear distortion correction neural network model, and output the height information matrix predicted after nonlinear mapping, as the second height information matrix.

[0135] Specifically, the part W required for the nonlinear mapping m Input a trained nonlinear distortion correction neural network model (model), and output the height information matrix predicted after nonlinear mapping, which serves as the second height information matrix H. m .

[0136] S406. Add the first altitude information matrix and the second altitude information matrix to obtain the overall altitude information.

[0137] In this embodiment, the first height information matrix Hl Second height information matrix H m Adding them together gives the total height information H. a The calculation formula is as follows:

[0138] H a (x,y)=H l (x,y)+H m (x,y)

[0139] It is understandable that the height information can then be calculated using the data collected by the camera through the steps S402 to S406 described above.

[0140] It should be noted that although the method operations of the above embodiments are described in a specific order, this does not require or imply that these operations must be performed in that specific order, or that all the operations shown must be performed to achieve the desired result. On the contrary, the described steps may be performed in a different order. Additionally or alternatively, certain steps may be omitted, multiple steps may be combined into one step, and / or one step may be broken down into multiple steps.

[0141] Example 2:

[0142] like Figure 6 As shown, this embodiment provides a phase height mapping device based on texture feature analysis. The device includes an acquisition module 601, a first calculation module 602, a preprocessing module 603, a linear mapping module 604, a nonlinear mapping module 605, and a second calculation module 606. The specific functions of each module are as follows:

[0143] The acquisition module 601 is used to acquire an image of the workpiece under test after being modulated by sinusoidal stripes.

[0144] The first calculation module 602 is used to calculate the phase difference matrix of the measured points on the workpiece based on the image of the workpiece to be tested.

[0145] The preprocessing module 603 is used to preprocess the phase difference matrix to obtain the two parts required for linear and nonlinear mapping.

[0146] The linear mapping module 604 is used to perform a linear mapping of the height required for the linear mapping, and obtain the height information matrix of the linear region as the first height information matrix.

[0147] The nonlinear mapping module 605 is used to input the part required for nonlinear mapping into the trained nonlinear distortion correction neural network model, and output the height information matrix predicted after nonlinear mapping, which serves as the second height information matrix.

[0148] The second calculation module 606 is used to add the first altitude information matrix and the second altitude information matrix to obtain the overall altitude information.

[0149] For the specific implementation of each of the above modules, please refer to Embodiment 1 above. It should be noted that the device provided in this embodiment is only illustrated by the division of the above functional modules. In actual applications, the above functions can be assigned to different functional modules as needed, that is, the internal structure can be divided into different functional modules to complete all or part of the functions described above.

[0150] Example 3:

[0151] This embodiment provides a computer device, such as... Figure 7 As shown, it includes a processor 702, a memory, an input device 703, a display 704, and a network interface 705 connected via a device bus 701. The processor provides computing and control capabilities. The memory includes a non-volatile storage medium 706 and internal memory 707. The non-volatile storage medium 706 stores operating devices, computer programs, and a database. The internal memory 707 provides an environment for the operation of the operating devices and computer programs in the non-volatile storage medium. When the processor 702 executes the computer program stored in the memory, it implements the phase height mapping method of Embodiment 1 described above, as follows:

[0152] Acquire an image of the workpiece under test modulated with sinusoidal fringes;

[0153] Calculate the phase difference matrix of the measured points on the workpiece based on the image of the workpiece to be tested;

[0154] Preprocessing the phase difference matrix yields the two parts required for linear and nonlinear mappings;

[0155] Perform a high-level linear mapping on the part required for the linear mapping to obtain the height information matrix of the linear region, which serves as the first height information matrix;

[0156] The part required for nonlinear mapping is input into the trained nonlinear distortion correction neural network model, and the output is the height information matrix predicted after nonlinear mapping, which is used as the second height information matrix.

[0157] The overall altitude information is obtained by adding the first altitude information matrix and the second altitude information matrix.

[0158] Example 4:

[0159] This embodiment provides a storage medium, which is a computer-readable storage medium, storing a computer program. When the computer program is executed by a processor, it implements the phase height mapping method of Embodiment 1 above, as follows:

[0160] Acquire an image of the workpiece under test modulated with sinusoidal fringes;

[0161] Calculate the phase difference matrix of the measured points on the workpiece based on the image of the workpiece to be tested;

[0162] Preprocessing the phase difference matrix yields the two parts required for linear and nonlinear mappings;

[0163] Perform a high-level linear mapping on the part required for the linear mapping to obtain the height information matrix of the linear region, which serves as the first height information matrix;

[0164] The part required for nonlinear mapping is input into the trained nonlinear distortion correction neural network model, and the output is the height information matrix predicted after nonlinear mapping, which is used as the second height information matrix.

[0165] The overall altitude information is obtained by adding the first altitude information matrix and the second altitude information matrix.

[0166] It should be noted that the computer-readable storage medium in this embodiment can be a computer-readable signal medium or a computer-readable storage medium, or any combination thereof. The computer-readable storage medium can be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor device, apparatus, or device, or any combination thereof. More specific examples of a computer-readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer disk, a hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination thereof.

[0167] In this embodiment, the computer-readable storage medium can be any tangible medium containing or storing a program that can be used or combined with an instruction execution device, apparatus, or device. In this embodiment, the computer-readable signal medium can include a data signal propagated in baseband or as part of a carrier wave, carrying a computer-readable program. Such propagated data signals can take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. The computer-readable signal medium can also be any computer-readable storage medium other than a computer-readable storage medium, which can send, propagate, or transmit a program for use or combined with an instruction execution device, apparatus, or device. The computer program contained on the computer-readable storage medium can be transmitted using any suitable medium, including but not limited to: wires, optical cables, RF (radio frequency), etc., or any suitable combination thereof.

[0168] The computer-readable storage medium described above can be used to write computer programs for executing this embodiment in one or more programming languages ​​or combinations thereof. These programming languages ​​include object-oriented programming languages—such as Java, Python, and C++—and conventional procedural programming languages—such as C or similar programming languages. The program 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 it can be connected to an external computer (e.g., via the Internet using an Internet service provider).

[0169] In summary, this invention achieves phase-height mapping based on linear and nonlinear neural network methods, which can, to some extent, address the impact of lens distortion on height mapping, such as radial and tangential distortion. By combining linear height mapping with nonlinear neural network mapping, it solves these problems while simultaneously improving the speed and robustness of phase and height mapping. Furthermore, it has a wide range of applications and strong anti-interference capabilities.

[0170] The above description is merely a preferred embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any equivalent substitutions or modifications made by those skilled in the art within the scope disclosed in the present invention, based on the technical solution and inventive concept of the present invention, shall fall within the scope of protection of the present invention.

Claims

1. A phase height mapping method, characterized in that, The method includes: Acquire a standard workpiece image modulated with sinusoidal stripes; Based on the standard workpiece image, calculate the actual phase difference matrix of the measured points on the standard workpiece, and use the matrix composed of the height information corresponding to all pixels of the actual phase difference matrix as the actual height matrix. Based on the actual phase difference matrix, the standard height matrix is ​​calculated using the phase height mapping formula; The difference between the standard height matrix and the actual height matrix is ​​calculated to obtain the difference matrix; The difference matrix is ​​processed by a function to obtain the identifier matrix; The neural network model is pre-trained based on the identification matrix, standard phase difference matrix, and standard height matrix to make the prediction results reach the standard results. The neural network model is trained based on the identifier matrix and the actual phase difference matrix to achieve the standard prediction result, resulting in a well-trained nonlinear distortion correction neural network model, and the identifier matrix is ​​updated. Acquire an image of the workpiece under test modulated with sinusoidal fringes; Calculate the phase difference matrix of the measured points on the workpiece based on the image of the workpiece to be tested; Preprocessing the phase difference matrix yields the two parts required for linear and nonlinear mappings; Perform a high-level linear mapping on the part required for the linear mapping to obtain the height information matrix of the linear region, which serves as the first height information matrix; The part required for nonlinear mapping is input into the trained nonlinear distortion correction neural network model, and the output is the height information matrix predicted after nonlinear mapping, which is used as the second height information matrix. The overall altitude information is obtained by adding the first altitude information matrix and the second altitude information matrix.

2. The phase height mapping method according to claim 1, characterized in that, The pre-training of the neural network model based on the identifier matrix, standard phase difference matrix, and standard height matrix to achieve the standard prediction results specifically includes: Based on the identification matrix, the standard phase difference matrix is ​​preprocessed to obtain the standard phase difference matrix of the distortion region; Based on the identification matrix and the standard height matrix, calculate the standard height matrix of the distortion region corresponding to the standard phase difference matrix of the distortion region; The standard phase difference matrix of the distorted region is input into the neural network model, and the predicted height matrix of the distorted region is output. All values ​​of the neural network model are trained, and backpropagation is used to correct the neural network model so that the predicted height matrix of the distorted region gradually approaches the standard height matrix of the distorted region.

3. The phase height mapping method according to claim 2, characterized in that, The process of training the neural network model based on the identifier matrix and the actual phase difference matrix to achieve the standard prediction result and obtain a trained nonlinear distortion correction neural network model specifically includes: Based on the identification matrix, the actual phase difference matrix of each pixel is preprocessed to obtain the actual phase difference matrix of the distorted region. The actual phase difference matrix of the distorted region is input into the neural network model, and the predicted height matrix of the distorted region is output. All values ​​of the neural network model are trained, and backpropagation is used to correct the neural network model so that the predicted height matrix of the distorted region gradually approaches the standard height matrix of the distorted region, thus obtaining a trained nonlinear distortion correction neural network model.

4. The phase height mapping method according to claim 3, characterized in that, The phase height mapping formula is as follows: ; in, p The actual phase difference at the measured point. d The distance from the optical center to the reference plane, l The distance between the two optical centers. This is the reference phase value of the grating on the reference plane. This represents the phase of the grating image after distortion following the addition of a standard workpiece.

5. The phase height mapping method according to claim 4, characterized in that, The backpropagation correction employs the gradient descent method, the formula of which is as follows: ; in, For learning rate, For weight variables, Let E be the derivative of the current position, and E be the cost function, which is the squared error cost function, calculated as follows: ; in, This is the predicted output of the neural network model.

6. A phase height mapping device, characterized in that, The device includes: The first acquisition module is used to acquire a standard workpiece image modulated with sinusoidal stripes. The first calculation module is used to calculate the actual phase difference matrix of the measured points on the standard workpiece based on the standard workpiece image, and to use the matrix composed of the height information corresponding to all pixels of the actual phase difference matrix as the actual height matrix. The second calculation module is used to calculate the standard height matrix based on the actual phase difference matrix and the phase height mapping formula. The solver module is used to calculate the difference between the standard height matrix and the actual height matrix, and obtain the difference matrix. The function processing module is used to perform function processing on the difference matrix to obtain the identifier matrix; The pre-training module is used to pre-train the neural network model based on the identifier matrix, the standard phase difference matrix, and the standard height matrix, so that the prediction results reach the standard results. The training module is used to train the neural network model based on the identifier matrix and the actual phase difference matrix, so that the prediction results reach the standard results, obtain the trained nonlinear distortion correction neural network model, and update the identifier matrix. The second acquisition module is used to acquire an image of the workpiece under test modulated with sinusoidal stripes; The third calculation module is used to calculate the phase difference matrix of the measured points on the workpiece based on the image of the workpiece to be tested. The preprocessing module is used to preprocess the phase difference matrix to obtain the two parts required for linear and nonlinear mapping; The linear mapping module is used to perform a linear mapping on the part required for linear mapping, and obtain the height information matrix of the linear region, which serves as the first height information matrix. The nonlinear mapping module is used to input the part required for nonlinear mapping into the trained nonlinear distortion correction neural network model, and output the height information matrix predicted after nonlinear mapping, which serves as the second height information matrix. The fourth calculation module is used to add the first altitude information matrix and the second altitude information matrix to obtain the overall altitude information.

7. A phase height mapping system, characterized in that, The system includes a camera, a projector, and a computer. The optical axes of the projector and the camera are parallel, and the projector and the camera are at the same distance from a reference plane. A workpiece is placed on the reference plane. The workpiece is either a standard workpiece or a workpiece to be measured. The computer is connected to the projector and the camera respectively. The projector is used to project sinusoidally modulated structured light stripes onto the workpiece; The camera is used to acquire images of the workpiece modulated with sinusoidal stripes; The computer is used to execute the phase height mapping method according to any one of claims 1-5.

8. A computer device comprising a processor and a memory for storing a processor-executable program, characterized in that, When the processor executes the program stored in the memory, it implements the phase height mapping method according to any one of claims 1-5.

9. A storage medium storing a program, characterized in that, When the program is executed by the processor, it implements the phase height mapping method according to any one of claims 1-5.