PHASE-SHIFTING PHASE MEASUREMENT ERROR CORRECTION METHOD BASED ON PIXEL TRACING OF OBJECT RASTER IMAGES

20220107173 · 2022-04-07

    Inventors

    Cpc classification

    International classification

    Abstract

    Disclosed is a phase-shifting phase measurement error correction method based on pixel tracing of object raster images. During traditional phase-shifting shape measurement, surface height information is represented by phase information. The nonlinearity of equipment inevitably causes errors of phase information calculated according to images captured by a camera. The method comprises: projecting, by projector, a special raster projection to resolve a pixel-tracing mapping relation; in a direction against a light path, determining the position of a point light source that illuminates any one image pixel in a captured image and is located in an imaging plane of the projector according to the pixel-tracing mapping relation; and finally, replacing distributed phase information in image pixels with ideal phases in point light sources to correct phase errors to improve the accuracy of phase-shifting shape measurement. Compared with existing methods, the method is easy to operate and high in efficiency and precision.

    Claims

    1. A phase-shifting phase measurement error correction method based on pixel tracing of object raster images, comprising the following steps: step 1: placing a measured object (5) on a measurement platform (3), allowing lenses of a projector (2) and a camera (6) to face the measured object, connecting the projector (2) and the camera (6) to a computer (1), setting a first raster period, inputting the first raster period to the computer (1) to generate ideal phase information, carrying out encoding on the computer (1) through a gray encoding method to obtain first sinusoidal raster fringes, carrying out phase shifting on the sinusoidal raster fringes through an N-step phase shifting method to obtain N digital phase-shifting patterns with different initial phases, and obtaining, according to gray values of pattern pixels at the same position in the N digital phase-shifting patterns, ideal phase values of the pattern pixels at this position; step 2: inputting the digital phase-shifting patterns to the projector (2) to generate raster projections, wherein point light source arrays of the raster projections are identical in size with pattern pixel arrays of the digital phase-shifting patterns, and point light sources of the raster projections are in one-to-one correspondence with the pattern pixels of the digital phase-shifting patterns and are also in one-to-one correspondence with the ideal phase values of the corresponding pattern pixels; the raster projections are projected onto a surface of the measured object (5) and the measurement platform (3) around the measured object (5), and the camera (6) captures images of the surface of the measured objected projected by the raster projections; for the N digital phase-shifting patterns, N images are sequentially captured by the camera (6), and resolved phase values of image pixels in the images are obtained through an N-step phase shifting method; step 3: for each said image pixel in the images, establishing an error relation between the resolved phase values and the ideal phase values of the point light sources of the raster projections, and determining whether or not a minimum error exceeds an error threshold; if the minimum error of the image pixels is greater than the error threshold, performing step 4; or, if the minimum error of all the image pixels is not greater than the error threshold, resolving a reciprocal of the error relation to obtain a first confidence sub-function of the image pixels, and performing step 5; step 4: performing Step 1 and Step 2 again by using sinusoidal raster fringes with a smaller raster period as new first sinusoidal raster fringes to obtain new resolved phase values, and determining the new resolved phase values according to the step 3; step 5: setting a second raster period, inputting the second raster period to the computer (1) to generate second sinusoidal raster fringes, repeating the step 1 to the step 3 to resolve a second confidence sub-function P.sub.2(y.sub.k) of the image pixels, multiplying the first confidence sub-function P.sub.1(y.sub.k) and the second confidence sub-function P.sub.2(y.sub.k) of a same image pixel to obtain a confidence function P.sup.U(y.sub.k) of this image pixel, and resolving the confidence function to obtain pixel-tracing mapping coordinates of this image pixel in the raster projection, wherein the relation between the second raster period and the first raster period is as follows: the second raster period is smaller than the first raster period, the two raster periods are both positive integers and are co-prime, and a product of the two raster periods is greater than a maximum value of y coordinates of the point light sources; step 6: because positions of the point light sources in the raster projections are in one-to-one correspondence with the ideal phase values of the image pixels at same positions in the digital phase-shifting patterns, replacing the resolved phase values of the image pixels in the images with the ideal phase values according to pixel-tracing mapping coordinates of the image pixels in the raster projections to complete error correction of the resolved phase values.

    2. The phase-shifting phase measurement error correction method based on pixel tracing of object raster images according to claim 1, wherein the step 3) specifically comprises the following sub-steps: 3.1) resolving a squared difference E(y.sub.k) between the resolved phase value of each said image pixel and the ideal phase value of the corresponding point light source of the raster projection to obtain the error relation that is specifically as follows: E ( y k ) = ( ( φ ( m , n ) + 2 π ( .Math. y k p .Math. - 1 ) ) - φ t ( y k ) ) 2 in the expression, E(y.sub.k) represents the squared difference, y.sub.k represents a y coordinate of the point light source, φ(m, n) represents the resolved phase value of the image pixel (m, n), φ.sub.t(y.sub.k) represents a unique ideal phase value determined according to the y coordinate of the point light source; p represents the first raster period; 3.2) traversing the coordinates of all the point light sources, taking a minimum squared difference as a minimum error of the image pixel, and determining whether or not the minimum error exceeds the error threshold according to the following formula: .Math. Δϕ ( m , n ) .Math. < π p in the formula, Δ?(m, n) represents the minimum error of the image pixel (m, n), and π p represents the error threshold; and 3.3) resolving a reciprocal of the squared difference obtained in 3.1) to obtain the first confidence function P.sub.1(y.sub.k) of the image pixel point; P 1 ( y k ) = 1 E ( y k ) + ϵ , 1 y k p in the equation, ∈ represents a non-zero parameter.

    3. The phase-shifting phase measurement error correction method based on pixel tracing of object raster images according to claim 1, wherein resolving the confidence function in the step 5 specifically comprises: traversing the y coordinates of all the point light sources to obtain a maximum value of the confidence function P.sup.U(y.sub.k), wherein the maximum value of the confidence function P.sup.U(y.sub.k) is the y coordinate value of the point light source disclosed by the pixel-tracing mapping relation and is also a pixel-tracing mapping coordinate of the image pixel in the raster protection.

    4. The phase-shifting phase measurement error correction method based on pixel tracing of object raster images according to claim 1, wherein in all the steps, positions of the measured object (5), the measurement platform (3), the projector (2) and the camera (6) remain unchanged, and only the raster period input to the computer (1) is changed.

    5. The phase-shifting phase measurement error correction method based on pixel tracing of object raster images according to claim 1, wherein the N-step phase-shifting method is specifically a four-step phase-shifting method, and the resolved phase values of the image pixels are obtained by a subtraction/differential operation.

    6. The phase-shifting phase measurement error correction method based on pixel tracing of object raster images according to claim 1, wherein the unique ideal phase value is determined according to the y coordinate of the point light source as follows: a raster projection coordinate system (x, y) is established, and the position of each said point light source in the raster projection is determined; with the position of a first point light source on a top left corner of the point light source array as an origin of the coordinate system, a varying direction of the ideal phase information is defined as a y-axis according to characteristics of sinusoidal raster, and an x-axis is perpendicular to the y-axis; the point light sources in the raster projection are identical in number with the pattern pixels in the digital phase-shifting patter and are in one-to-one correspondence with the pattern pixels in position, so that an ideal phase value of the corresponding pattern pixel in the digital phase-shifting pattern can be determined according to the position of each said point light source in the raster projection, and the ideal phase value does not vary in an x-axis direction, that is, the ideal phase value is independent of x coordinates, so the unique ideal phase value can be determined according to the y coordinate of the point light source.

    Description

    BRIEF DESCRIPTION OF THE SEVERAL VIEWS OF THE DRAWINGS

    [0044] FIG. 1 is a schematic diagram of a phase-shifting shape measurement system improved by the present invention;

    [0045] FIG. 2(a) is a principle diagram of phase error correction by means of pixel tracing of the present invention; FIG. 2(b) is a principle diagram of phase error compensation by means of a traditional phase error compensation method;

    [0046] FIG. 3(a) is a schematic diagram of a variation relation of two adjacent digital phase-shifting patterns; FIG. 3(b) illustrates a time chart of different raster projections projected according to different digital phase-shifting patterns in one embodiment of the present invention;

    [0047] FIG. 4 is a flow diagram of phase error correction during phase-shifting shape measurement of the present invention;

    [0048] FIG. 5 is a flow diagram of the calculation of a pixel-tracing mapping relation of a method provided by the present invention;

    [0049] FIG. 6 illustrates one embodiment where the present invention is used to resolve wrapping coordinates of point light sources;

    [0050] FIG. 7 illustrates one embodiment where the present invention is used to resolve coordinates of point light sources;

    [0051] FIG. 8(a) illustrates phase distributions before and after the method of the present invention is adopted; FIG. 8(b) illustrates gray value distributions before and after the method of the present invention is adopted.

    [0052] In the figures: 1, computer; 2, projector; 3, measurement platform; 4, flat board; 5, measured object; 6, camera.

    DETAILED DESCRIPTION OF THE INVENTION

    [0053] The present invention will be further described below in conjunction with the accompanying drawings and the embodiments. Specific implementations are mainly used to improve the accuracy of phase-shifting shape measurement.

    [0054] As shown in FIG. 1, a phase-shifting structured light measurement system comprises a computer 1, a projector 2, a camera 6 and a measurement platform 3, wherein the computer 1 is connected to the projector 2 and the camera 6, a measured object 5 is disposed on the surface of the measurement platform, and the surface of the measurement platform is a flat board 4. Lenses of the projector 2 and the camera 7 are arranged towards the measured object 5, so that it is ensured that the projector 2 can project light onto the surface of the measured object 5 and the measurement platform 3 and that the camera 6 can receive reflected light from the surface of the measured object 5.

    [0055] The flat board 4 on the surface of the measurement platform is used to acquire phase reference information. For a part, reflecting the flat board, in any image, ideal phase information corresponding to image pixels shall vary linearly in the gradient direction of a maximum gray according to the variation characteristics of the ideal phase information. Thus, resolved phases corresponding to the image pixels of the part, reflecting the flat board, of the image in the maximum gray gradient direction are piece-wise fitted to form a straight line, and the fitting result is the resolved phase reference information; and a resolved phase error can be obtained by calculating a difference between the resolved phase information and the phase reference information.

    [0056] Specific steps of the present invention are as follows:

    [0057] Step 1: an initial raster period is selected to be used to generate ideal phase information, and the ideal phase information is encoded in N digital phase-shifting patterns.

    [0058] The computer 1 encodes the ideal phase information into the N digital phase-shifting patterns in form of gray values. Then, the computer 1 inputs the N digital phase-shifting patterns to the projector 2 and controls the projector 2 to generate N corresponding raster projections that are projected to the flat board 4 and the surface of the measured object 5. The flat board 4 is the surface of the measurement platform 3. The camera 6 captures reflected lights, projected onto the flat board 4 and the surface of the measured object 5 by of the raster projections, into captured images, and phase information encoded in the reflected lights are decoded by means of the captured images to obtain resolved phase information.

    [0059] Because of the gamma nonlinearity and electronic noises of the projector 2 and the camera 6 and inevitable environmental disturbance on the reflected lights in the propagation process, gray values of the phase information encoded in the captured images will be inevitably distributed, which leads to errors of the phase information decoded from the captured images. When depth information is mapped from the phase information, error-distorted phases will result in final measurement errors. According to the principle of phase-shifting shape measurement, the accuracy of phase information directly determines the final measurement accuracy, so the present invention is proposed to correct phase errors to improve the final measurement accuracy of phase-shifting shape measurement.

    [0060] As shown in FIG. 4, a first raster period of first sinusoidal raster fringes is set to p, and the ideal phase information φ.sub.t can be expressed as:

    [00005] φ t ( x , y ) = φ t ( y ) = 2 π p y

    [0061] In the above equation, (x, y) is the coordinates of pattern pixels in a pattern pixel array, and φ.sub.t(x, y) is ideal phase values encoded at the coordinates (x, y) of the pattern pixels. As shown in FIG. 1, the varying direction of the ideal phase information is the y-axis direction, and the ideal phase information varies in the y-axis direction and does not vary in the x-axis direction, that is, the ideal phase information is independent of x coordinates. Thus, φ.sub.t (x, y) can be simplified as φ.sub.t (y). It should be noted that because the pattern pixel array is identical in size and distribution with a point light source array in an imaging plane of the projector, (x, y) may also represent the coordinates of the point light sources in the point light source array.

    [0062] It should be noted that, because the ideal phase information is only associated with the y coordinates and is independent of the x coordinates, ideal phase information for error correction can be obtained merely by determining the y coordinates according to a pixel-tracing mapping relation, and it is unnecessary to known the x coordinates.

    [0063] The ideal phase information is encoded into N digital phase-shifting patterns, wherein the n-th digital phase-shifting pattern I.sub.t.sup.n can be expressed as:

    [00006] I t n ( x , y ) = a + b cos ( φ t ( y ) + 2 π n N ) = a + b cos ( 2 π p ( y + p n N ) )

    [0064] wherein, I.sub.t.sup.n(x, y) is a gray value of the n-th digital phase-shifting pattern in the pattern pixel at (x, y), a is a set average gray value, b is a set gray variation amplitude, and N is the number of times of phase-shifting of the phase-shifting method;

    [0065] Gray values of the pattern pixels in the digital phase-shifting pattern are obtained by substituting corresponding ideal phases into a trigonometric function; in an ideal phase linear variation direction, the gray values vary sinusoidally, and a sinusoidal variation period is the selected raster period; the gray values do not vary in the other direction; any two adjacent digital phase-shifting pattern in the N digital phase-shifting patterns have the same displacement in the varying direction of the gray values.

    [0066] For the pattern pixel at (x, y), the ideal phase φ.sub.t(x, y) corresponding to this pattern pixel is encoded by N gray values I.sup.1.sub.t(x, y), I.sup.2.sub.t(x, y), . . . , I.sup.N.sub.t(x, y), wherein N is an integer, and N≥3. N is the total number of digital phase-shifting patterns used for encoding phase information. As shown in FIG. 3(a), every two adjacent digital phase-shifting pattern have a displacement (pn/N) along the y-axis. In addition, the gray values in the digital phase-shifting patterns vary along the y-axis and are identical along the x-axis. The variation period of the gray values in the digital phase-shifting patterns in the y-axis direction is p pixels.

    [0067] The N digital phase-shifting patterns are sequentially input to the projector 2 to generate N raster projections. The N raster projections are sequentially projected to the surface of the measured object 5 and the surface of the measurement platform 3, the camera 6 captures reflected lights, projected to the surface of the measured object 5 and the surface of the measurement platform 3 by the raster projections, into N images, and the N images can be expressed as:

    [00007] I n ( m , n ) = A ( m , n ) + B ( m , n ) cos ( φ ( m , n ) + 2 π n N )

    [0068] In the above equation, (m, n) is the coordinates of the image pixels in the image pixel array, I.sub.n(m, n) is the gray value of the reflected light, captured by the image pixel at (m, n), of the n-th raster projection, A(m, n) and B(m, n) are a constant component value and a variable component coefficient of the gray value captured by the pixel, respectively, and φ(m, n) is a phase value of the gray value captured by the image pixel.

    [0069] As shown in FIG. 1, an image coordinate system (m, n) is established with the position of a first pixel at the top left corner of the imaging plane of the camera 6 as the origin, an m-axis and an n-axis are parallel to two perpendicular edges of the imaging plate, respectively, and then, the coordinate positions of the image pixels in the images can be determined. The image captured by the camera is consisted of an image pixel array, and each image pixel in the image pixel array corresponds to one gray value; for N images, the image pixel at the same position in the image pixel array corresponds to N gray values, a resolved phase can be obtained by means of the N gray values through the N-step phase-shifting method, and a set of resolved phases corresponding to all the image pixels is referred to as resolved phase information.

    [0070] The image pixel array is a rectangular array in shape and is identical in size and distribution with a photosensitive element array in the imaging plane of the camera, that is, the image pixels in the image are in one-to-one correspondence with the photosensitive elements in the imaging plane of the camera, and the photosensitive elements receive the reflected lights and convert the light intensities into gray values that are stored in the image pixels at the same position in the image pixel array.

    [0071] The resolved phase information obtained from the N captured images through the N-step method is as follows:

    [00008] φ ( m , n ) = arctan .Math. n = 0 n = N - 1 I n ( m , n ) sin 2 π n N .Math. n = 0 n = N - 1 I n ( m , n ) cos 2 π n N

    [0072] In the above equation, φ (m, n) is the resolved phase of the image pixel at (m, n) obtained by calculation according to N gray values I.sup.1(x, y), I.sup.2(x, y), . . . , I.sup.N(x, y). As can be known from the properties of a value domain of the arc-tangent function arctan in this equation, the value of the resolved phase obtained according to this equation is limited between 0 and 2π.

    [0073] Preferably, in this embodiment, N=4. In this case, the above equation can be modified into:

    [00009] φ ( m , n ) = arctan I 1 ( m , n ) - I 3 ( m , n ) I 2 ( m , n ) - I 4 ( m , n )

    [0074] As can be known from the above equation, when the resolved phase of the image pixel at (m, n) is calculated, a subtraction/differential operation exists both in the numerator and the denominator to remove the contribution of an overall illumination element to the gray values and reserve the contribution of a direct illumination element to the gray values, and thus, the calculation accuracy and robustness of the pixel-tracing mapping relation are improved. In addition, it can be deduced that for any N≥3, the N-step phase-shifting method involves subtraction/differential operations in similar forms when used for calculating the resolved phase information.

    [0075] According to the present invention, erroneous resolved phase information is used as an input to acquire an accurate pixel-tracing mapping relation to correct phase errors and improve the accuracy of phase-shifting shape measurement. The principle is as follows: for each image pixel, the resolved phase obtained through the N-step phase-shifting method is distributed in a continuous real number field, and the coordinates of the point light source, that is disclosed by the pixel-tracing mapping relation, illuminates the image pixel and is located in the imaging plane of the projector, are distributed in a discrete positive integer field. Thus, the calculation of the pixel-tracing mapping relation by means of the resolved phase information is essentially searching for a mapping relation from a continuous domain to a discrete domain. Because of the “one-to-many” relation from the continuous domain to the discrete domain, errors of the resolved phases in the continuous domain within a certain range are tolerable and will not affect the accuracy of the resolved pixel-tracing mapping relation.

    [0076] For the image pixel at (m, n), the position of the point light source illuminating the image pixel, namely the y coordinate of the point light source, is set as y.sub.k, a squared difference between an assumed unwrapping resolved phase and an assumed ideal phase at this image pixel is calculated, and the assumed unwrapping resolved phase is the sum of a resolved phase corresponding to a certain image pixel taken into consideration and obtained under a given raster period and the product of 2π and an assumed number of fringe periods; the assumed number of fringe periods is obtained by subtracting 1 from a maximum integer not greater than an assumed position of the point light source and the given raster period; the assumed ideal phase is an encoded ideal phase of the point light source at the position indicated by the assumed position point light source.

    [0077] A calculation formula of the squared difference E(y.sub.k) is as follows:

    [00010] E ( y k ) = ( ( φ ( m , n ) + 2 π ( .Math. y k p .Math. - 1 ) ) - φ t ( y k ) ) 2

    [0078] In this formula, ┌y.sub.k/p┐ represents a maximum integer not greater than (y.sub.k/p). As shown in FIG. 1, the value range of y.sub.k is the position coordinates of all possible point light sources in the y-axis direction, that is, y.sub.k is greater than or equal to 1 and is smaller than or equal to s; s is a maximum coordinate of the point light sources in the y-axis direction. In this formula, (φ(m, n)+2π(┌y.sub.k/p┐−1)) is the assumed unwrapping resolved phase, wherein, (┌y.sub.k/p┐−1) is the assumed number of fringe periods; φ.sub.t(y.sub.k) is a unique ideal phase value determined according to y.sub.k.

    [0079] When y.sub.k traverses to the point light source illuminating the image pixel at (m, n), E(y.sub.k) can be expressed as:

    [00011] E ( y ) = { ( φ ( m , n ) + 2 π ( .Math. y p .Math. - 1 ) ) - φ t ( y ) } 2 = ( Δ ϕ ( m , n ) ) 2

    [0080] In the above equation, y represents the y coordinate of the point light source corresponding to the image pixel at (m, n), and Δϕ(m, n) represents an error of the resolved phase corresponding to the image pixel at (m, n) relative to an ideal phase. As can be known from the above equation, if the resolved phase is error-free, that is Δϕ(m, n)=0, E(y.sub.k) will be minimized, that is, E(y.sub.k)=0, which indicates that pixel tracing can be realized by resolving an extreme value of E(y.sub.k). In case of Δϕ(m, n)≠0, to realize pixel tracing by resolving the extreme value of E(y.sub.k), the following condition should be met:

    [00012] min y k E ( y k ) = ( Δ ϕ ( m , n ) ) 2 , 1 y k s

    [0081] In the above equation, min represents a minimum value of all possible values of y.sub.k. To make the above equation workable, Δϕ(m, n) should meet some condition. To overturn this condition, the above equation is equivalent to:

    [00013] { E ( y k ) = ( Δϕ ( m , n ) + 2 π ( .Math. y k p .Math. - .Math. y p .Math. ) - 2 π p ( y k - y ) ) 2 E ( y k ) > E ( y ) , y k y and 1 y k s

    [0082] By resolving the above equation, Δϕ(m, n) should meet the following condition:

    [00014] .Math. Δϕ ( m , n ) .Math. < π p

    [0083] The condition that should be met by the resolved phase error when the pixel-tracing mapping relation is resolved is given by the above formula, and this condition is associated with the raster period p. As can be known from the above formula, a small raster period P can provide a loose error limiting condition. Thus, in the embodiments of the present invention, a small raster period should be selected to provide a loose error limiting condition.

    [0084] As a preferred embodiment of the present invention, a reciprocal of E(y.sub.k) is resolved to obtain P(y.sub.k), and a maximum value of P(y.sub.k) is resolved to obtain wrapping coordinate values of the pixels mapped in the raster projection coordinate system to realize pixel tracing;

    [00015] y * = arg max y k P ( y k ) = arg max y k 1 E ( y k ) + ϵ , 1 y k p

    [0085] In the above equation, y* represents the wrapping coordinate values, and to prevent “zero error”, ε is an infinitesimal and is generally a real number of 10.sup.−16; p represents the period of the first sinusoidal raster fringes,

    [00016] arg max y k P ( y k )

    represents an operation for resolving the maximum value of the y coordinate of the point light source; as shown in FIG. 6(c), when y.sub.k traverses to the point light source illuminating the image pixel at (m, n), P(y.sub.k) has the maximum value.

    [0086] It should be noted that because the value of the resolved phase φ(m, n) is between 0 and 2π, the minimum value of E(y.sub.k) appears periodically, and the period of appearance of the minimum value of E(y.sub.k) is p, as shown in FIG. 6(c), so multiple extreme values of E(y.sub.k) can be obtained. Although it is impossible to directly obtain a final pixel-tracing result by means of these extreme values, the coordinates of the point light sources disclosed by the pixel-tracing mapping relation exist in these extreme values, and remainders obtained by dividing these extreme values by p are identical. The remainders obtained by dividing these extreme values by p are referred to as wrapping coordinates of the point light sources, and it is defined that the wrapping coordinates is p when the remainder is zero. Thus, the values of the wrapping coordinates of the point light sources range from 1 top.

    [0087] FIG. 6 shows an example of solving the wrapping coordinates of the point light sources. FIG. 6(a) illustrates one raster projection in the imaging plane of the projector, and the reflected light projected to the surface of the measurement platform by the raster projection illustrated in FIG. 6(a) is captured into the image illustrated in FIG. 6(b) by the camera; one point light source at (x.sub.0, y.sub.0) in FIG. 6(a) is projected by the projector to the surface of the measurement platform and is then reflected to an image pixel at (m.sub.0, n.sub.0) in the camera, as shown in FIG. 6(b). A confidence sub-function P(y.sub.k) is constructed by means of a resolved pixel corresponding to this image pixel and the raster period p=19. When y.sub.k traverses all possible values, the variation characteristics of P(y.sub.k) are shown in FIG. 6(c), and y coordinates of the curve in FIG. 6(c) are normalized between 0 and 1. In FIG. 6(c), the maximum value of P(y.sub.k) appears when y.sub.k is equal to 388, 407, 426, etc., the period of appearance of the maximum value of P(y.sub.k) is equal to the raster period, that is, the period of appearance of the maximum value is 19. As mentioned above, the maximum value is divided by the raster period to obtain the wrapping coordinate of the point light source y*=8.

    [0088] As shown in FIG. 5, to finally obtain the coordinates of the point light sources illuminating the image pixels, in this embodiment, two different raster periods are selected to construct to different confidence sub-functions. Therefore, to resolve the pixel-tracing mapping relation, 2N digital phase-shifting patterns should be generated totally in this embodiment. FIG. 3(a) is a time chart of the 2N digital phase-shifting patterns. As shown in FIG. 3(b), for each raster period, N raster projections are needed totally, and the displacements of every two adjacent raster projections along the y-axis are identical. Then, as for the second raster period, the other N raster projections are carried out in the same way.

    [0089] As mentioned above, the selection criterion of the raster period is to improve a sufficient error limiting condition. Because a smaller raster period can provide a looser error limiting condition, a first phase error is selected by setting an initial raster period (30 pixels), measuring a resolved phase error and adjusting/reducing the raster period (selection-measurement-adjustment). If the measured resolved phase error is greater than the selected raster period, the error limiting condition is met, and the currently selected raster period is the first raster period; otherwise, the raster period should be reduced in the positive integer field, the resolved phase error is re-measured until a selected raster period can provide a sufficient error limiting condition. The second raster period should be smaller than the first raster period, that is, the second raster period can provide a looser error limiting condition than the first raster period for the following reason: the resolved phase error is independent of the selected raster period; the error threshold is in inverse proportion with the raster period, and the second raster period is smaller than the first raster period, so that a greater error threshold can be provided. Thus, in this embodiment, the second raster period can be selected without selection-measurement-adjustment.

    [0090] As a preferred embodiment of the present invention, the resolved phase error is measured through the flat board 4. Specifically, the resolved phase error is measured in the gradient direction of the maximum gray value in the captured image. As for the flat board, the ideal phase information encoded in this direction should be linear, so that the resolved phases corresponding to the image pixels in this direction can be piece-wise fitted into a straight line, and an obtained fitting result is the phase reference information. The difference between the resolved phase information and the phase reference information is calculated to obtain the resolved phase error.

    [0091] As shown in FIG. 6(c), due to the fact that P(y.sub.k) is periodical, if one raster period is used to construct the confidence sub-function, only the wrapping coordinates of the point light sources can be obtained. To finally obtain the positions of the point light sources illuminating the image pixels, the periodicity of P(y.sub.k) needs to be broken. As a preferred embodiment of the present invention, two co-prime raster periods are selected to construct two different confidence sub-functions, and the product of the two confidence sub-functions is calculated to resolve the pixel-tracing mapping relation.

    [0092] The product of the two confidence sub-functions is calculated for the following reason: the two co-prime raster periods are p.sub.1 and p.sub.2, respectively, and the periods of appearance of the maximum value of the two confidence functions P.sub.1(y.sub.k) and P.sub.2(y.sub.k) constructed by these two raster periods are p.sub.1 and p.sub.2, respectively. The period of appearance of the maximum value of the product of the two confidence sub-functions is p.sub.1 p.sub.2. If p.sub.1 p.sub.2 is greater than the maximum value within the value range of y.sub.k, the maximum value of the product of P.sub.1(y.sub.k) and P.sub.2(y.sub.k) appears only once when y.sub.k traverses all possible values. In view of this, the product of P.sub.1(y.sub.k) and P.sub.2(y.sub.k) is defined as the confidence function P.sup.U(y.sub.k) that is expressed as:


    P.sup.U(y.sub.k)=P.sub.1(y.sub.k)×P.sub.2(y.sub.k)

    [0093] As a preferred embodiment of the present invention, in the above equation, the first raster period p.sub.1 and the second raster period p.sub.2 should meet the following condition: p.sub.1 p.sub.2 is greater than the maximum value within the value range of y.sub.k, and p.sub.1 and p.sub.2 are both positive integers and are co-prime. It is provide below that when this condition is met, the positions, where the maximum value appears, correspond to the coordinates of the point light sources illuminating the image pixels.

    [0094] Assuming the maximum value of P.sup.U(y.sub.k) appears when y.sub.k=y.sub.m, both P.sub.1(y.sub.k) and P.sub.2(y.sub.k) have the maximum value when y.sub.k=y.sub.m. Assuming the coordinate of the point light source illuminating the image pixel is y.sub.0, y.sub.0=y.sub.m+k.sub.1p.sub.1=y.sub.m+k.sub.2p.sub.2 is workable according to the characteristics of the confidence sub-functions P.sub.1(y.sub.k) and P.sub.2(y.sub.k), that is, k.sub.1p.sub.1=k.sub.2p.sub.2, wherein both k.sub.1, and k.sub.2 are integers. When the condition that p.sub.1 p.sub.2 is greater than the maximum value within the value range of y.sub.k, and p.sub.1 and p.sub.2 are both positive integers and are co-prime is met, that is, y<p.sub.1p.sub.2 and both k.sub.1, and k.sub.2 are integers, k.sub.1=k.sub.2=0, and y.sub.0=y.sub.m. When y.sub.k traverses all possible values, the positions where the maximum value of the confidence function P.sup.U(y.sub.k) appears correspond to the coordinates of the point light sources illuminating the image pixels. Thus, a final result of pixel tracing can be obtained by resolving the maximum value of P.sup.U(y.sub.k), and the maximum value is the coordinate of the point light source disclosed by the pixel-tracing mapping relation and is referred to as the pixel-tracing mapping coordinate.

    [0095] FIG. 7 illustrates an example of resolving the pixel-tracing mapping coordinate. For the image pixel at (m.sub.0, n.sub.0) in FIG. 6(a), the two confidence sub-functions P.sub.1(y.sub.k) and P.sub.2(y.sub.k) are constructed by means of a first raster period p.sub.1=30 and a second raster period p.sub.2=19, and the confidence function P.sup.U(y.sub.k) is constructed. FIG. 7(a) illustrates the variation characteristics of the confidence sub-functions P.sub.1(y.sub.k) and P.sub.2(y.sub.k). As shown in FIG. 7(a), the maximum value of P.sub.1(y.sub.k) and P.sub.2(y.sub.k) appears when y.sub.k=407. Thus, the pixel-tracing mapping coordinate of the image pixel at (m.sub.0, n.sub.0) in FIG. 6(a) is 407.

    [0096] FIG. 2(a) is a principle diagram of phase error correction of the present invention. After the pixel-tracing mapping relation is obtained, for each image pixel, the position of the point light source illuminating this image pixel has been disclosed by the pixel-tracing mapping relation, and an error-free ideal phase that should be encoded in this point light source has been recorded in the computer and is known, phase errors of resolved phase information can be corrected by replacing the erroneous resolved phase information with the known ideal phase information encoded in the point light sources, thus improving the accuracy of phase-shifting shape measurement.

    [0097] FIG. 2(b) is a principle diagram of phase error compensation by means of a traditional phase error compensation method. The method of the present invention shown in FIG. 2(a) is compared with the traditional phase error compensation method to analyze the beneficial effects of the method of the present invention.

    [0098] As shown in FIG. 2(a), FIG. 2(b), FIG. 8(a) and FIG. 8(b), compared with traditional methods, the method of the present invention has the following beneficial effects:

    [0099] First, the present invention has higher accuracy. Traditional phase error compensation methods pre-estimate errors based on an inaccurate explicit or implicit error model and then subtract estimated measurement errors from measurement results to carry out error compensation on resolved phase information, and because the error model and the estimated phase errors are inaccurate, these traditional phase error compensation methods lead to system errors. However, the method provided by the present invention creatively utilizes the pixel-tracing mapping relation to make it possible to correct phase errors directly by means of error-free ideal phase information, thus having higher accuracy.

    [0100] Second, the present invention has higher efficiency. Traditional phase error compensation methods pre-estimate errors by complicated operations, so that the efficiency is drastically reduced. However, the method provided by the present invention directly obtains ideal phase information for error correction in a direction against the light path by means of the pixel-tracing mapping relation and does not need any time-consuming and strenuous phase error estimation process, thus having higher efficiency.

    [0101] Third, the present invention has higher robustness. The method provided by the present invention is not based on any fixed error models, so that no matter in which form phase errors are distributed, these phase errors can be corrected through this method. However, traditional phase error compensation methods are workable only for phase errors in specific forms such as gamma nonlinear errors. Thus, the method of the present invention has higher robustness.