The application relates generally to phase-based time-of-flight (TOF) imaging systems that acquire depth images at distances (d) by comparing shift in phase (φ) between emitted modulated optical energy having modulation frequency f, and detected optical energy reflected by a target at distance d. More specifically, the application is directed to unwrapping (or dealiasing) the inherent ambiguity in phase-based TOF systems between detected values of phase shift (φ) and distance d.
In phase-based TOF systems, changes in distance d produce changes in phase φ. The relationship between phase φ and distance d between the center of projection of the TOF system lens and the intersection between the optical ray and the surface of the target object seen by the TOF system sensor array is given by:
where cis speed of light and f is modulation frequency. But φ can only vary between 0 and 2·π, and at best distance d is known modulo 2·π·c/2·ω=c/2·f. Consequently the maximum distance dmax that is known without ambiguity and without further processing is given by:
From equation (2) it is clear that increasing modulation frequency f in a TOF system decreases operating range distance dmax over which φ correlates uniquely to d. For example at f=50 MHz, a TOF system will have dmax≈3 M, whereas decreasing modulation frequency to f=20 MHz increases dmax to about 7.5 M, e.g., a factor of 50/20, or 2.5/1. But for maintaining acquired depth data of similar quality at 20 MHz, it may be desirable to increase TOF system optical output power by 6.25×, i.e., 2.5×2.5. U.S. Pat. No. 7,791,715 (2010) to Bamji, assigned to Microsoft, Inc., assignee herein, describes a phase-based TOF system that seeks to unwrap d as a function of φ using two modulation frequencies f1, f2 each close to the TOF system maximum modulation frequency fm. Use of the two relatively high modulation frequencies per U.S. Pat. No. 7,791,715 (“the '715 patent”) created virtual modulation frequencies resulting from a quasi-mixing process that resulted in an increased fmax while preserving high modulation frequencies.
The ratio fE/fD acts as a noise coefficient factor, and noise associated with phase φD increases by this ratio. Thus an increased ratio fE/fD represents amplified noise in φD and is undesired as it contributes to an incorrect dealiasing or unwrapping decision. Advantageously, acquiring data using two relatively high frequency modulation frequencies per the '715 patent averages phase data measurement noise, which enhances signal/noise performance for the TOF system. TOF systems that can disambiguate range using data acquired with modulation frequencies close to maximum modulation frequency fm are said to be relatively lossless.
However further improvement in extending dmax would be useful. In addition, it may be desirable for a real-time method to sense TOF system acquisition data so as to dynamically vary value of error tolerances to minimize the probability of introducing errors during the unwrapping process. The present application provides a method and system for so doing.
A phase-based TOF system is operated with at least two and preferably with N=3 modulation frequencies fi. These frequencies can be changed during N equal time intervals that together define an exposure time for the TOF pixel array. In embodiments of the present application, preferably N=3 and modulation frequecies f1, f2, f3 are used, where f1=am1, f2=am2, and f3=am3, where m1, m2, and m3 are small integers co-prime to each other, and α is a coefficent.
According to embodiments of the present application in which N=3, a first phase image is acquired during the first third of the exposure time using f1, then for the next third of the exposure time a second phase image is acquired using f2, and then f3 is used to acquire a third phase image during the last third of the exposure time. In these embodiments m1, m2, and m3 are co-prime numbers.
For N=3, the unwrapping problem may be conceptualized as being related to an N-sided figure, here a three-dimensional geometric figure, i.e., a cube, having sides that measure π. A total of m1+m2+m3−2 wrapping segments lie within this cube parallel to the three-dimensional vector defined as:
Indicator segments are identified and a rotation matrix is computed, and the rotation is applied to the wrapped phases. Noise-corrupted phase measurements (φ1, φ2, φ3) can be projected onto the plane orthogonal to v, which brings the φ3 coordinate axis parallel to v. So doing reduces a three-dimensional analysis to a two-dimensional analysis, advantageously reducing computational time and overhead. So doing identifies indicator points and corresponding aliasing intervals. In some embodiments an optimized rotation matrix preferably is computed and applied to the indicator segments before identifying the indicator points and corresponding aliasing intervals.
Preferably during runtime operation of the TOF system input phase data is rotated to find closest indicator points to line segments. In some embodiments these points can be labeled as valid or invalid based upon their computed distance from an indicator point, with validity confidence being determined by a static or by a dynamic threshold test. The unwrapping interval associated with each indicator point is used to unwrap the phase measurements, which measurements preferably are averaged, which averaging also reduces noise magnitude in the phase data.
The applied geometric analysis results in optimal selection of m1, m2, and m3 to unwrap and disambiguate phase for the TOF system. The ability to dynamically assign confidence labels to acquired phase data can advantageously reduce motion blur error due to target objects that move during data acquisiton using N modulation frequencies.
Other features and advantages of the application will appear from the following description in which the preferred embodiments have been set forth in detail, in conjunction with their accompanying drawings.
Co-pending U.S. patent application Ser. No. 13/021,484 (US Patent Application Publication Number 2011/0188028) by Hui and Bamji, entitled “Methods and Systems for Hierarchical De-Aliasing Time-Of-Flight (TOF) Systems” and assigned to Microsoft, Inc., assignee herein, describes improvements to U.S. Pat. No. 7,791,715—both of which are incorporated herein by reference. It will be appreciated that a challenge in designing and operating a TOF system is to maintain a small ratio fE/fD while achieving a desired range dmax associated with small fD and a precision of depth associated with a large fE. Some embodiments in the '484 application employ an n-step hierarchical approach to unwrapping, to minimize problems associated by a large amplification of noise in phase φE. Other embodiments of the '484 application apply a two-step hierarchical approach while operating the TOF system using three modulation frequencies.
Assume there are m modulation frequencies f1, f2, . . . , fm (f1>f2> . . . , >fm), and it is desired that the TOF system achieve unambiguous range dD, which corresponds to frequency fD as in
One embodiment in the '484 application uses fD to de-alias and to achieve the distance resolution of the effective frequency fE, where fE=g0 (f1, f2, . . . , fm) is a function of the modulation frequencies f1, f2, . . . , fm, preferably an arithmetic mean or a weighted average.
Rather than use fD to dealias or unwrap phase for effective frequency fE in a single step, preferably a set of N−1 intermediate frequencies is generated fDE1, fDE2, fDE(N−1)) where fD<fDE1<fDE2< . . . <fDE(N−1)<fE and where fD<fDE1<fDE2< . . . <fDE(N−1)<fE. Each of the intermediate frequencies is a function of the modulation frequencies f1, f2, . . . , fm as in
fDEk=gk(f1, f2, . . . , fm) where k=1, 2, 3, . . . , N−1.
fDEk=gk(f1, f2, . . . , fm) where k=1, 2, 3 . . . , N−1. Let fDE0=fD, and let fDEN=fE.
At each step of this hierarchical de-aliasing or unwrapping, dealiasing of the phase φDEk of fDEk occurs using phase φDE(k+1) of fDE(k+1) (k=0, 1, . . . N−1) by finding the correct de-aliasing interval mk such that φDEk
The final unwrapped phase for fE is:
The number of the intermediate frequencies N−1 and the ratio
between frequencies in each consecutive pair preferably are determined by the uncertainty of the depth. Preferably uncertainty of the amplifying factor at each step is sufficiently small such that the probability of choosing mk incorrectly is low.
The use of three modulation frequencies in a TOF system will now be described with reference to
In a second hierarchical de-aliasing step, each de-aliasing interval of φE is used to de-alias the effective phase φD of effective frequency fE by finding the correct de-aliasing interval n such that φDS≅φE+n2π. Referring now to
Note that the amplification ratio for the de-aliasing steps are
respectively. Advantageously, this method achieves the desired large ratio
without amplifying the noise in φE by such a large ratio. The beneficial result occurs because the de-aliasing intervals m and n are determined separately and the noise is amplified by a much smaller ratio at each method step.
Let the three modulation frequencies be f1, f2 and f3. Embodiments of the '484 application seek to achieve an effective frequency fE that is as close as possible to the TOF system maximum modulation frequency fm. Let fD=f1−f2 be designated as the slowest frequency associated with the total dealiasing range, and let fDE=f1−f3 be designated as the intermediate frequency. The final effective frequency can be
or other weignted linear combination of f1, f2 and f3.
Referring to
One can now rescale φD to the same slope as φDE and create φDS, where
Completing the first step, one can next find the correct dealiasing interval m by minimizing
for m=0, 1, 2, . . . . . Consider next step two, which involves dealiasing
from fDE=f1−f3. Although it is desired to dealias fE, one cannot get the phase corresponding to
with the correct wrapping-around method. Instead embodiments of the '484 application dealias f1, f2 and f3 separately and get the unwrapped phases φ1=φ1+n12π, φ2=φ2+n22π, and φ3=φ3+n32π.
Unwrapped phase for
can be calculated as
|φDES−(φioffset+ni2π)| for ni=0, 1, 2, . . . where i=1, 2, 3
The unwrapped phase for each frequency fi is computed as:
The unwrapped phase for
The above described hierarchical dealiasing methods preferably used at least three close-together modulation frequencies and created a low dealiasing frequency and at least one intermediate frequency to successfully dealias an increased disambiguated distance dmax for a TOF system. Further unlike two-frequency dealiasing, the methods described in the '484 application amplified noise by only a small ratio coefficient at each dealiasing step. But while the methods described in the '484 application represent substantial improvements in dealiasing or unwrapping phase, it is difficult for the TOF system to know in real-time how best to dynamically make corrections to further reduce acquisition error. In one sense, the analyses associated with the '484 application are simply too complicated to provide a real-time sense of how to further improve quality of the data stream being output by the TOF system sensor array.
As will now be described, embodiments of the present application enable substantially lossless phase unwrapping (or dealiasing), using multiple modulation frequencies, while providing a mathematical graphical analysis useable to make real-time dynamic adjustments to the TOF system.
TOF system 10′ in
As noted earlier, d is known modulo c/2·f. The phase φ measured by the TOF sensor array 40 is said to be wrapped to the interval [0,2π[ and the largest disambiguated range distance dmax may be termed the wrapping distance. It is useful to write the relation between phase φ as defined in equation (1) and wrapped phase φw as:
φ=φw+2πn(d) (3)
where n(d) is often called the indicator function. According to the present application, phase unwrapping is concerned with the computation of the indicator function. The relation between wrapped and unwrapped phase can be made explicit by the wrapping operator:
φw=W[φ] (4)
Phase unwrapping is an ill-posed problem, since equation (3) has infinite solutions. However one can unwrap a discrete sequence of phase samples φ[i] based on the observation that if
−π≦∇{φ[i]}≦π (5)
it is possible to show that
∇{φ[i]}=W{∇{W{φ[i]}}}=W{∇{φw[i]}} (6)
where ∇ denotes the first order difference of a discrete sequence:
∇x[i]=x[i+1]−x[i].
The unwrapped sequence φ[i] can be recovered by the wrapped phase samples φd[i] by integration:
While the above-described unwrapping method is straightforward it unfortunately fails in most practical cases. Failure occurs because equation (5) is not satisfied, typically for several reasons incuding the presence of noise, and the absence of adequate signal bandlimiting. Methods for overcoming these limitations will now be described.
Embodiments of the present application employ a phase unwrapping algorithm that uses N multiple modulation frequencies and functions adequately in most real world applications. In these embodiments, the modulation frequency of active optical source 30 (see
A single instance of the ramp signal is shown in the φω[i] vs. i plot of
Consider now the case of two different modulation frequencies f1 and f2, where f1<f2. It is assumed for each data point d[i] the pixel sensor array will produce two phase value according to
where w1[i], w2[i] are independent and identically distributed noise terms drawn from a zero-mean Gaussian distribution with variances σ1, σ2.
In the plot depicted in
be chosen so that m1 and m2 are integers co-prime to each other. The plot of φw2(φw1) will span a [0,2π[×[0,2π[ square with a sequence of m1+m2−1 segments, which are termed indicator segments herein. (The bracket notation [0,2π[ is used because 0 and 2π are essentially the same point due to phase wrapping, and wrapped point 2π may safely be excluded from the interval.) The trace left by the point of coordinates (φw1,φw2) as d[i] progresses from 0 to dmax starts at the origin and passes through the origin again at the new wrapping distance U12
Given a measurement ({tilde over (φ)}w1,{tilde over (φ)}{tilde over (φw2)}) corrupted by noise, if one can correctly estimate the indicator segment to which the noiseless point (φw1,φw2) belongs, then the two phases shall have been effectively unwrapped. In doing so, magnitude of the wrapping distance is advantageously extended from
The indicator segment preferably is found by first computing the orthogonal distance between the measured point and each of the lines containing the segments. The closest such line uniquely determines indicator functions for the two frequencies. Referring, for example, to
For example, Table 1 indicates that for segment index 0, each modulation frequency adds two cycles of 2π to provide the desired unwrapping. For segment index 1, each modulation frequenices add one cycle of 2π to provide the desired unwrapping, etc.
The unwrapped measurements are thus given by
φj[i]=φwj[i]+2πnj[i], (14)
j=1,2. (15)
In addition to the segments noted by the parallel sloped lines in
A further optimization can be realized by rotating the indicator segments such that they are parallel with the x-axis. This optimization reduces the two-dimensional “closest line problem” to a single dimensional “closest point problem”. As such, the optimal indicator segment can then be found by simply identifying the segment closest to the point on the x-axis. This approach can be extended to N dimensions (N≧2), effectively reducing the scope of the problem from N dimensions to N−1 dimensions. The details of this optimization are described later for the case N=3.
Embodiments of the present application extend the above-described two frequency method to use of three modulation frequencies, f1, f2, and f3, as follows.
f
1
=αm
1,
f
2
=αm
2,
f
3
=αm
3,
where m1, m2 and m3 are co-prime to each other and are preferably small integers. If there is a common denominator between the various modulation frequencies fi, that term would be extracted and multiplied by the coefficient α. The coefficient α (units typically MHz) is related to the maximum unambiguous range dmax. By way of example if α=15 MHz then dmax=10 M. Small integers work well with embodiments of the present application, but possibly other approaches would function where m1, m2, and m3 were not small integers. There may exist a more general but less optimal solution, in which these modulation frequencies are not required to be prime to each other. Table 2 depicts some of the interplay between m1, m2, and m3 and α.
For the case of three modulation frequencies that are co-prime to each other, one can show that the wrapping distance U123 is:
There are a total of m1+m2+m3−2 wrapping segments lying inside the [0,2]×[0,2π]×[0,2π] cube parallel to v, where:
and therefore (φ1,φ2,φ3) can be projected onto the plane orthogonal to v. One of many possible ways of building this projection involves consideration of the rotation that brings the φ3 coordinate axis parallel to v. The axis of this rotation is parallel to the vector n,
and orthogonal to both v and k, the direction of φ3. The angle of rotation is defined by:
The rotation vector ω is thus given by:
One can use Rodrigues' formula to write the expression for the rotation matrix R as
where I3 is the 3×3 identity matrix and X(w) is the skew-symmetric matrix defined as:
How then to compute the three-dimensional coordinates for the indicator segments end-points, and how to computer values of the indicator functions for the case of three modulation frequencies m1, m2, m3. Consider the following exemplary three-dimensional coordinate and indicator function algorithm that can be stored in memory and executed by a processor included in electronic system 100 and/or in system 50′; see
Once the three-dimensional points with coordinates (PX,i, PY,i, PZ,i) are known, they can be projected onto the plane orthogonal to vector v defined in Eq. (17) using, for example, matrix equation (23):
There exists a rotation matrix R′ε{R} that rotates the projected indicator segment end points pi such that the pi closest to the origin that is not the origin itself is rotated such that it is aligned with the x-axis. Let pi′ denote these axis-aligned indicator segment end points:
p
i
′=R′p
i
=R′RP
i (24)
Let pi denote projected indicator segments endpoint i with coordinates (pXi,pYi), and let R denote the rotation matrix used to rotate the indicator endpoint segments. An exemplary algorithm to solve for R′ given inputs pi and R may be written as follows:
In the case of multiple α values, α can be chosen arbitrarily from these values.
The above-mentioned two-dimensional closest point problem involved finding the nearest indicator point (pX,i, pY,i) closest to (φ1w,φ2w). This optimization advantageously reduces that problem to a pair of single dimensional closest point problems, for which the nearest indicator point pi′, closest to φw′ can be found by simply identifying the set of indicator points closest to the φw′ on the y-axis, followed by finding the closest point to φw′ on the x-axis from that set of points. An exemplary algorithm is as follows:
In the case of multiple values of i in
It can be shown that this method correctly solves the closest-point point problem for all points within radius ε from any indicator segment endpoints, where 2ε is the smallest distance between any pair of endpoints.
Turning now to
By contrast,
As this juncture, it is useful to describe a more final version of a preferred phase unwrapping algorithm. This algorithm preferably is stored in memory in electronics module 100 and preferably is executable therein by processors associated with module 100. Alternative some or all of the storage and execution of this algorithm may occur in system 50′; see
Inputs to this phase unwrapping algorithm are the three wrapped phase values measured at the phase modulation frequencies f1, f2, f3, the indicator points of the projections pX,i, pY,i, and the values of the indicator functions N1,i, N2,i, N3,i returned by the above-described exemplary three-dimensional coordinate and indicator function algorithm. The exemplary phase unwrapping algorithm may be represented as follows:
Find the index i of the indicator point (pX,i, pY,i) closest to (φ1w,φ2w) and finally, compute:
Φ1u=Φ1w+2πN1,i
Φ2u=Φ2w+2πN2,i
Φ3u=Φ3w+2πN3,i (29)
It will be appreciated from the description of
An additional source of error can result from motion blur if target object 20 moves during data acquisition by TOF system 10′ (see
With reference to
Given outputs from a dealiasing algorithm, embodiments of the present application compute a dealiasing error preferably based on deviation from the actual distance from the TOF system sensor array to an imaged object in the scene, also known as the ground truth. In a perfect TOF system the ground truth would be identical to the TOF system measured depth distance.
Magnitude of acceptable deviation is preferably based on the particular application for which TOF system 10′ is used. Dealiasing algorithm outputs can be labeled as ‘correct’ or as ‘incorrect’, manually using human judgment, or can be labeled automatically by bounding the noise using a pre-defined specification. Other methods for labeling dealiasing algorithm outputs could instead be used.
Given the list of correct and incorrect points, embodiments of the present application preferably tune a static zone or a dynamic zone by minimizing false positives and maximizing true positives. As used herein, false positives are outputs with incorrect depth (d values) that have not been marked as invalid outputs. As used herein, true positives are outputs that have correct depth (d values) and are not marked as invalid outputs. A TOF system 10′ receiver operating characteristic (ROC) curve can be plotted using the above information. The zone corresponding to the point on the ROC curve that maximizes true positives and minimizes false positives is preferably selected for optimum performance. A detailed description is not presented herein as selection methods are known to those skilled in the relevant art.
In
Method step 220 can be followed directly by method step 230, in which identification of the indicator points and corresponding intervals occurs. Such identification may be carried out using the analysis described with respect to equations (29). Once the indicator points have been identified and their segment number ascertained, a look-up table of data, stored in module 100 or module 50′ (see
However optionally, method step 220 preferably will branch to carry out steps 240, 250, and 260 rather than proceed directly to step 230. At method step 240, an optimized rotation matrix is computed, preferably using the method described herein, culminating with equation (25). At method step 250, the optimized rotation matrix information determined in step 240 is applied to the indicator segments, preferably using the method described with respect to equation (24). Optionally but preferably, method step 260 may be used to compute a maximum sphere size, which can help optimize the analysis as suggested by a comparison between
As noted, once the method steps depicted in
Turning now to
In
At method step 310, closest indicator points are determined for the rotated data provided from method step 300. These determinations may be carried out as described with respect to equations (26) and (27). Advantageously rotation at step 300 simplifies calculations at step 310, as a three-dimensional analytical problem is reduced to a two-dimensional analysis.
Method step 310 may be followed directly by method step 320, in which phase unwrapping occurs, preferably by applying the unwrapping interval associated with each indicator point. Such unwrapping calculations may be carried out as described with respect to equation (29). Method step 320 is followed by method step 330 in which the unwrapped phases are averaged, since one value of distance d to the target object is desired, not three values. Since many noise components are random in nature, method step 330 advantageously reduces noise associated with the unwrapped phase information.
Optionally, however, method step 310 may be followed by method steps 340 and 350, which help implement the labeling of data indicated in
The foregoing analytical technique enables dynamic modification of modulation frequencies to unwrap and thus disambiguate phase. As noted, preferably processing and software used to carry out this analysis is performed by module 100 and/or components of TOF system 10′; see
While increasing the number (N) of modulation frequencies will yield a greater wrapping distance dmax in practice use of N=3 modulation frequencies can provide acceptable TOF system performance. In one embodiment, TOF system 10′ acquires image data using modulation frequencies of 97 MHz, 115 MHz, and 125 MHz to obtain an unambiguous range distance dmax of about 15 M, using a 5 W optical emitter 30 (see
Modifications and variations may be made to the disclosed embodiments without departing from the subject and spirit of the application as defined by the following claims.