8

Click here to load reader

Three-Dimensional Noise-Immune Phase Unwrapping Algorithm

Embed Size (px)

Citation preview

Page 1: Three-Dimensional Noise-Immune Phase Unwrapping Algorithm

qmdw

wmt

Three-dimensional noise-immune phaseunwrapping algorithm

Jonathan M. Huntley

The classical problem of phase unwrapping in two dimensions, that of how to create a path-independentunwrapped map, is extended to the case of a three-dimensional phase distribution. Whereas in twodimensions the path dependence problem arises from isolated phase singularity points, in three dimen-sions the phase singularities are shown to form closed loops in space. A closed path that links one suchloop will cross a nonzero number of phase discontinuities. In two dimensions, path independence isachieved when branch-cut lines are placed between singular points of opposite sign; an equivalentpath-independent algorithm for three dimensions is developed that places branch-cut surfaces so as toprevent unwrapping through the phase singularity loops. The placing of the cuts is determined uniquelyby the phase data, which contrasts with the two-dimensional case for which there are many possible waysin which to pair up the singular points. The performance of the new algorithm is demonstrated onthree-dimensional phase data from a high-speed phase-shifting speckle pattern interferometer. © 2001Optical Society of America

OCIS codes: 120.2650, 120.5050, 120.6160, 120.3180, 100.6890.

wsmroa

1. Introduction

Many advanced imaging technologies ~e.g., opticalinterferometry, satellite radar interferometry, mag-netic resonance imaging! provide data on the re-uired measurand ~e.g., displacement, height,agnetic field! that is encoded in the form of a phase

istribution. The measured phase is normallyrapped onto the range 2p to p and requires un-

wrapping ~i.e., restoration of the unknown integralmultiple of 2p to each pixel! before visualization orfurther postprocessing of the data can take place.

In one dimension, unwrapping is trivial if the datahave been sampled in accordance with the Shannonsampling theorem, i.e., if there are at least two sam-ples per cycle.1 Unwrapping is normally impossible

ith undersampled data, unless assumptions areade about the underlying form of the phase func-

ion.2,3 In two dimensions, localized undersamplingof the phase data causes a nontrivial problem of pathdependence of the unwrapped phase. Many algo-rithms have been proposed to solve this problem. It

J. M. Huntley [email protected]! is with the Departmentof Mechanical Engineering, Loughborough University, Loughbor-ough, Leicestershire LE11 3TU, United Kingdom.

Received 23 January 2001; revised manuscript received 17 May2001.

0003-6935y01y233901-08$15.00y0© 2001 Optical Society of America

is probably fair to say that the two current main-stream solutions are the branch-cut method,4–7 in

hich branch cuts are placed to make the phase mapingle valued; and the weighted least-squaresethod ~and its variants!, in which a finite-difference

epresentation of a global least-squares criterion,ver valid regions of the image, is solved by means ofn iterative cosine transform technique.8,9 A con-

nection between the branch-cut method and theglobal so-called minimum L0-norm solution waspointed out by Ghiglia and Romero,9 and efficientalgorithms based on network flow techniques havebeen developed recently to find approximations tothis solution.10–12

Over the past 12 years, more than 200 journalpapers have been published on the two-dimensional~2-D! problem, and the field now also has its owntextbook.13 However, despite this activity, there is,to the best of my knowledge, almost no literature onthe problem of phase unwrapping in three dimen-sions. Cusack recently presented an unpublishedconference paper14 in which he described a three-dimensional ~3-D! algorithm for functional magneticresonance imaging analysis. He discovered inde-pendently the concept of phase singularity loops thatis described here in Section 3.B, and he developed analgorithm that unwrapped loop-free regions beforethose containing the loops.

Apart from simple intellectual curiosity, there aregood reasons for seeking to extend the 2-D algorithms

10 August 2001 y Vol. 40, No. 23 y APPLIED OPTICS 3901

Page 2: Three-Dimensional Noise-Immune Phase Unwrapping Algorithm

it

wWf

ase

es

t

wtfto

p2rae

pp

3

into the third dimension: For example, apart fromthe magnetic resonance imaging technique men-tioned above that provides inherently 3-D data, in-terferometers are currently producing 3-D phasedistributions in which time provides the third ax-is.15,16 My purpose in this paper is to suggest waysn which the 2-D branch-cut algorithm can be ex-ended into three dimensions. In Section 2 I provide

an overview of the 2-D branch-cut theory, which givesa necessary background to understanding unwrap-ping on 2-D surfaces within 3-D volumes ~Section 3!.The theory is used in the development of a path-independent 3-D unwrapping algorithm in Section 4,which is finally applied to the unwrapping of datafrom a high-speed phase-shifting speckle interferom-eter in Section 5.

2. Two-Dimensional Phase Unwrapping withBranch Cuts

For completeness, we revise first some of the mainconcepts and terminology used in 2-D phase unwrap-ping. f~x, y! ~x 5 1, 2, . . . , Nx; y 5 1, 2, . . . , Ny!denotes the sampled phase distribution. f is as-sumed to be sampled along each axis in accordancewith Shannon’s sampling theorem, except for smallregions where noise may cause local undersampling.Figure 1 is an example in which the phase distribu-tion in Fig. 1~a!, when sampled on the mesh in Fig.1~b!, satisfies the sampling theorem everywhere ex-cept in a small region at the center. Figure 1~b! canbe regarded as a graph in which the sample points~filled circles! are the vertices and the lines betweennearest neighbors are the edges. If point P has al-ready been unwrapped, then we can unwrap anotherpoint Q by setting up a path @e.g., path A in Fig. 1~b!#of alternate vertices and edges between the twopoints. We can unwrap the phase values along thepath, denoted as fA~i! @i 5 0, 1, 2, . . . NA, with NA 59 in Fig. 1~b!#, by noting that the true phase changebetween two adjacent pixels must ~if sampled in ac-cordance with the sampling theorem! lie in the range2p to p. A phase change lying outside this range istherefore regarded as being due to the presence of a

Fig. 1. ~a! Wrapped phase map ~black and white representing,respectively, 2p and 1p! containing phase singularities. ~b! Cor-responding graph with vertices ~filled circles! representing the

ixels at which the phase is sampled and edges ~lines! representingotential unwrapping paths between the vertices.

902 APPLIED OPTICS y Vol. 40, No. 23 y 10 August 2001

2p phase discontinuity between the two points. Thenumber of discontinuities between adjacent pixelscan be calculated as

dA(i) 5 NINT{[fA(i) 2 fA(i 2 1)]y2p}, (1)

here NINT denotes rounding to the nearest integer.e unwrap the phase at Q by subtracting 2pn from

A~NA!, where n is the total number of discontinuitiescrossed by the path:

nA 5 (i51

NA

dA(i). (2)

The basic tenet of the branch-cut approach is thatll allowed unwrapping paths must result in theame unwrapped phase value. In Fig. 1~b!, how-ver, we can see that, whereas nA 5 23, the corre-

sponding quantity nB for path B takes the value of22. The goal of the analysis is to place cuts that actas barriers to unwrapping, or equivalently, to removesome of the edges from the graph in Fig. 1~b! so as tonsure that all remaining allowed paths give theame unwrapped phase value at point Q.One of the key steps is the calculation of the dis-

ribution of so-called discontinuity sources s~x, y!.The alternative term residue has become establishedin the satellite radar interferometry community andis also used throughout the present paper. s~x, y! isthe number of phase discontinuities crossed by ananticlockwise closed loop around the four pixels ~x, y!,~x 1 1, y!, ~x 1 1, y 1 1!, and ~x, y 1 1!:

s(x, y) 5 NINT{[f(x 1 1, y) 2 f(x, y)]y2p}

1 NINT{[f(x 1 1, y 1 1) 2 f(x 1 1,

y)]y2p}

1 NINT{[f(x, y 1 1) 2 f(x 1 1,

y 1 1)]y2p}

1 NINT{[f(x, y) 2 f(x, y 1 1)]y2p}. (3)

s can take the values 21, 0, and 11.17 In Ref. 5 itwas shown that the total number of 2p phase jumpsaround an arbitrary closed path is given by

S 5 (x,y

s(x, y), (4)

here the sum is taken over all residues enclosed byhe path. Path independence requires S to be zeroor all possible closed paths and is therefore guaran-eed provided that every residue is joined to a residuef opposite sign, or to the boundary, by a branch cut.In Fig. 1~a!, the two points 1 and 2 denote singular

oints that give rise to residues ~respectively, 11 and1! in the sampled distribution. The residues are

epresented by arrowed circles in Fig. 1~b!. We canchieve the branch cut in this case by removing thedges e1 and e2 from the graph so as to prevent an

unwrapping path between the two residues. In gen-eral, any local noise domain must contain an equal

Page 3: Three-Dimensional Noise-Immune Phase Unwrapping Algorithm

ecNgcnlaiht

yz

@

spw

number of 11 and 21 residues. If this were not thecase, then two paths passing on either side of thenoise domain through regions of valid phase datawould disagree on the integral multiple of 2p re-quired to unwrap the final phase value. Such a re-sult is important in the extension of the 2-D theory tothree dimensions. Residue pairs are sometimestermed dipoles. A monopole can also occur, but onlyif the noise domain is close to the boundary and thepartner residue lies beyond the boundary.

3. Extension to Three Dimensions

The sampled phase distribution in three dimensionsis represented by f~x, y, z! ~z 5 1, 2, . . . Nz!. As intwo dimensions, f is assumed to be sampled alongach axis in accordance with Shannon’s theorem, ex-ept for small local violations that are due to noise.ote that this assumption excludes the possibility oflobal violations of the sampling theorem, oftenalled shear in the unwrapping literature, which isot considered in the present paper. We can calcu-

ate residue distributions as before by unwrappinglong closed loops around the 2-D elements consist-ng of squares bounded by four edges. There are,owever, now three axes to consider instead of justhe one axis in the 2-D case. sz~x, y, z! is therefore

used to denote the residue distribution resulting fromunwrapping around the pixels ~x, y, z!, ~x 1 1, y, z!,~x 1 1, y 1 1, z!, and ~x, y 1 1, z! according to Eq.~3!. Similarly, we calculate sx~x, y, z! by workingaround the loops defined by ~x, y, z!, ~x, y 1 1, z!, ~x,y 1 1, z 1 1!, and ~x, y, z 1 1!; and we calculate sy~x,, z! by unwrapping around the loops defined by ~x, y,!, ~x, y, z 1 1!, ~x 1 1, y, z 1 1!, and ~x 1 1, y, z!. The

sign of the residue distribution is important. Theconvention adopted here is similar to the right-handscrew rule in electromagnetism: The unwrappingpath for sx, sy, and sz corresponds to the direction ofthe fingers when the thumb of the right hand points,respectively, along the positive x, y, and z axes.

A. Two-Dimensional Surfaces within theThree-Dimensional Volume

We can derive important results for the 3-D case byconsidering 2-D surfaces within the full volume. Toapply the 2-D results from Section 2 to such surfaces,it is necessary for each 2-D element in the surface toshare each of its edges with one ~and only one! otherelement in the surface, or with the boundary. Forsimplicity, we also require that the set of elements isbounded around the outer perimeter by a continuousboundary ~i.e., we exclude a surface such as a sphereor torus, both of which have no boundary! and that itcan be deformed continuously into a plane ~i.e., weexclude surfaces such as the Mobius strip!. Conti-guity of adjacent elements is needed because the der-ivation of Eq. ~4! depends on cancellation of thecontributions from the internal paths of all the en-closed residues. In the remainder of this paper, Irefer to a collection of 2-D elements satisfying theserequirements as a fully contiguous surface ~FCS!.The fact that any FCS can be represented as a plane

allows the results from Section 2 to be applied di-rectly.

An extended version of Eq. ~4! can be written asfollows,

S 5 (i

s*(xi, yi, zi), (5)

where the sum is over all the elements encircled bythe path within the FCS and where the superscript *denotes that the s values are calculated in the usualanticlockwise sense about the normal to the plane onwhich the FCS is represented.

As a simple illustration, consider the two surfacesABCD and AEFGHD in Fig. 2. Both clearly satisfythe requirements specified above to be labeled as aFCS. Suppose now that surface ABCD contains, asa result of localized noise, a dipole pair of residuess*~x1, y1, z1! @5sx~x1, y1, z1!# 5 1 and s*~x2, y2, z2!5 sx~x2, y2, z2!# 5 21. Surface AEFGHD as it

stands will contain only a monopole at position ~x1,y1, z1!. As stated in Section 2, this leads to the un-physical consequence that a closed path encirclingthe monopole through regions of valid data will passthrough a nonzero number of phase discontinuities.We are therefore forced to the conclusion that theregion of the surface EFGH must contain one or moreresidues, such that the sum of the residues s* onEFGH equals 21. The simplest example of this is asingle residue at some point ~x3, y3, z3! such that*~x3, y3, z3! @5 2sy~x3, y3, z3!# 5 21. Any closedath encircling the noisy region on surface AEFGHDill then have S 5 0.

B. Phase Singularity Loops

The results of Subsection 3.A show that residues can-not exist in isolation on a single plane. In this sub-section I extend the analysis to consider the detailedneighborhood rules for residues within the 3-D graph.

Figure 3~a! shows the 3-D representation of a planethat forms part of a FCS. The 2-D representation, inwhich the out-of-page normal is in the 1x direction, isgiven in Fig. 4~a!. Consider now the second FCS inFig. 3~b! that is identical to that in Fig. 3~a!, except forthe removal of the element ABCD and the addition of

Fig. 2. Two FCSs containing residues.

10 August 2001 y Vol. 40, No. 23 y APPLIED OPTICS 3903

Page 4: Three-Dimensional Noise-Immune Phase Unwrapping Algorithm

tW1eSarst

p3ootstrctwcvts

etc

Spwcpott

3

elements ABFE, BCGF, CDHG, DAEH, and EFGH.Its 2-D representation is given in Fig. 4~b!. Supposethat a dipole exists on the FCS from Fig. 4~a!, withhe 11 residue lying within the element ABCD.

hen we use the arguments from Subsection 3.A, a1 residue must therefore exist in one of the five

lements ABFE, BCGF, CDHG, DAEH, and EFGH.trictly speaking, there can be more than one residuemong these five faces, as long as the sum of theesidues equals 11. I discuss this possibility in Sub-ection 3.C, but for the sake of clarity assume for nowhat only a single 11 residue is present.

One can interpret this result by means of a simplehysical picture. A phase singularity is a curve in-D space that, on entering a cube element throughne face, must leave the same cube through one of thether five faces. Each time it passes through one ofhe faces, a residue is detected as a nonzero value for* at that face. Entering and leaving mean that, inerms of the right-hand screw rule, the thumb of theight hand points, respectively, into and out of theube. Repeated application of this argument showshat the phase singularity can never terminateithin a cube. It must therefore form either a fully

losed loop in space or else enter and leave the phaseolume through the boundary surface. We callhese two cases, respectively, full and partial phaseingularity loops ~PSLs!.This physical analogy leads to two further inter-

sting conclusions. First, a 2-D cross sectionhrough a phase volume with PSLs will automati-ally generate dipole pairs. Figure 5~a! shows an

Fig. 3. Three-dimensional representation of parts of two FCSs.

Fig. 4. Two-dimensional representations of the surfaces fromFig. 3.

904 APPLIED OPTICS y Vol. 40, No. 23 y 10 August 2001

example: The arrows on the PSL indicate the direc-tion that the thumb of the right hand would point inas it follows the loop through the volume. Any planeintersecting this loop will contain two residues, onewith the thumb pointing into the plane, the otherwith the thumb pointing out. The residues there-fore form a 11 and 21 pair. One of the argumentssometimes leveled against the branch-cut method intwo dimensions is that the pairing of the residues,when the cuts are placed, is somewhat arbitrary.9There is no way of knowing which residue should bepaired with which, thereby requiring use of statisti-cal approaches. In one example, the maximum-likelihood pairing was shown to involve a globalminimization of the sums of the squares of the cutlengths.7,18 With the above interpretation, however,it is clear that each residue is in fact linked to anotherresidue by a line that happens to be invisible to anobserver confined to the 2-D surface. The computa-tional effort involved in the global minimization,which takes most of the time in a 2-D phase unwrap-ping, is therefore eliminated in the 3-D case.

A second conclusion that follows from this view-point is that a closed unwrapping path that is linkedwith a PSL will automatically have S Þ 0. Linkedmeans that, like two links in a chain, the closed pathand the PSL cannot be separated without the twocurves passing through one another. We can seethis result by constructing a FCS that contains thecomplete closed unwrapping path @see, e.g., Fig. 5~b!#.

uch a surface will intersect the PSL, generating theair of residues, only one of which will be enclosedithin the loop. This conclusion is important be-

ause it shows that, to create a path-independenthase unwrapping algorithm in three dimensions,ne must place branch surfaces across all PSLs so aso prevent potential unwrapping paths from passinghrough them.

C. Uniqueness of Solution for the Unwrapped Phase

The above two conclusions suggest that the un-wrapped phase distribution, calculated on the basisof the phase singularity loops, depends uniquely onthe original wrapped phase data. I ignore here theissue of the precise position of a cut surface for a givenPSL because, as in two dimensions, this affects only

Fig. 5. ~a! Example of the formation of a pair of residues within a2-D phase map through the intersection of the plane ~shaded! witha PSL. ~b! Closed path A linking a PSL encircles a single residuewhen represented on a FCS.

Page 5: Three-Dimensional Noise-Immune Phase Unwrapping Algorithm

ttlrttas

z

uwwpsgp

ltPettfit

those voxels close to the loop. In two dimensions onenormally places a straight cut line between residuesof opposite sign and is unconcerned about the localdetail of the unwrapped phase distribution becausethis has in any case been corrupted by the noise.The more interesting issue is rather the implicationthat there is a unique set of surfaces, which is dic-tated by the data, that contrast with the 2-D case inwhich there are at least ~Nsy2!! distinct possiblebranch-cut distributions for a set of Ns residues.

There is, however, one potential complicating fac-tor: The possibility of more than one PSL passingthrough a single cube element. We can construct anexample for the cube ABCDEFGH of Figs. 3 and 4 bytaking the phase values shown in Fig. 6~a!. In thisexample there are two PSLs entering the cube~through faces ABFE and CDHG! and two PSLs leav-ing the cube ~through faces ABCD and EFGH!.When a PSL enters such a volume element, it is notclear which of the two exiting PSLs it should be joinedto. Such a cube then acts as a knot point, and theambiguity arises from not knowing whether it tiestogether two loops or two sections of the same loop asshown in Fig. 6~b!. Fortunately, however, thebranch-cut surfaces for these two distinct situationsare identical.

The number of possible loop distributions would ofcourse increase rapidly if individual loops were tohave multiple knot points. Although this is a theo-retical possibility, it does not seem to be a problem inpractice. Even with the noisy unfiltered speckle in-terferometry data presented in Section 5, single knotswere a rare event. The question of multiple knotstherefore can probably be neglected in many situa-tions, although such a possibility should be borne inmind in future developments of the theory.

4. Path-Independent Three-DimensionalUnwrapping Algorithm

In this section I make use of the theory describedabove to develop a path-independent algorithm ap-plicable to 3-D phase distributions. Three basicsteps are required: ~1! the identification of the loops,~2! the placing of cuts to prevent unwrapping pathspassing through the loops, and ~3! the unwrappingitself.

Fig. 6. ~a! Example of two PSLs passing through a single cubevolume element. Phase values are specified as fractions of 2p.~b! Resulting knot point.

A. Identification of the Phase Singularity Loops

Step 1 requires the residue distributions sx, sy, and szto be calculated as described in Section 3. A list isformed of the nonzero members of these arrays.Each row of the list contains five parameters: ~1! theype of residue ~sx, sy, or sz!, ~2! its sign ~61!, and ~3!he ~x, y, z! coordinates specifying its position. Theist is then sorted into loops. Neighborhood rules foresidues within a loop can be written down based onhe fact, proved above, that a phase singularity en-ering one face of a cube element must leave throughnother face of the same cube. In the examplehown in Fig. 3~b!, an sx 5 11 residue at ~x0, y0, z0!

can be connected to an sx 5 11 residue at ~x0 1 1, y0,0!, an sy 5 21 residue at ~x0, y0, z0!, an sy 5 11

residue at ~x0, y0 1 1, z0!, an sz 5 21 residue at ~x0,y0, z0!, or to an sz 5 11 residue at ~x0, y0, z0 1 1!.Residues are progressively transferred from the un-sorted list to a list of sorted residues by use of suchrules encoded in the form of a look-up table. Eachdetected loop is finally given a flag to specify whetherit is either a full loop or a partial loop.

B. Placing the Branch-Cut Surfaces

Step 2 involves setting up arrays of flags, ex, ey, andez, to specify which nearest neighbor vertices arelinked by edges that can form part of a valid unwrap-ping path. ex~x, y, z! 5 0 or 1, for example, indicatesthat an edge, respectively, exists or does not existbetween vertices ~x, y, z! and ~x 1 1, y, z!. ey and ezare equivalent arrays specifying the existence, or oth-erwise, of edges parallel to the y and z axes, respec-tively. All flag arrays are initially set to zero. Toset the appropriate flags for a given PSL, we start byplacing an imaginary loop that shadows the PSL as itweaves through the lattice of edges. The aim of thisstage of the algorithm is to shrink the shadow loop tozero size. As the loop shrinks, it passes throughsuccessive edges; each time it passes through anedge, the corresponding flag is set to 1, denoting re-moval of the edge from the graph. A useful physicalanalogy is that of a highly elastic rubber band undertension ~representing the shadow loop! snakingthrough a cubic lattice of weak matchsticks ~repre-senting the initial set of edges!. As the band shrinks

nder the tension, it cuts through successive sticks,hich can then no longer act as part of a valid un-rapping path. Any conceivable closed unwrappingath linking a PSL will be broken by the shrinkinghadow loop, which, as stated above, is required touarantee path independence of the unwrappedhase map.By analogy with the physical model, the shadow

oop is always chosen to shrink next at the point withhe smallest radius of curvature. As with the realSL, the shadow loop is defined by a list of the 2-Dlements through which it passes. Each entry inhis list is assigned the coordinates corresponding tohe center of the element face. A local least-squarest of the equation for a circle provides an estimate ofhe local center of the circle for each element of the

10 August 2001 y Vol. 40, No. 23 y APPLIED OPTICS 3905

Page 6: Three-Dimensional Noise-Immune Phase Unwrapping Algorithm

lomet

asvcpp

dtuttntod~t

nwr

a

oagewb

u8a

3

list. The element from the list with the smallestradius is selected, and the relative positions of thecircle center and the element center determine whichof the four edges for that element are to be removed.We achieve removal of the edge by setting the appro-priate flag in ex, ey, or ez and threading the shadowoop around the edge. This process is repeated untilnly four entries remain in the shadow loop list,eaning that the shadow loop surrounds only one

dge. Removal of this edge completes the setting ofhe flags for this particular PSL.

We can easily deal with partial loops by the samelgorithm by reflecting the loop in the surface ~orurfaces! by which it enters and leaves the phaseolume. The original partial loop and its reflectionsan then be assembled to form a complete loop that isrocessed as above. Flags lying outside the originalhase volume are then discarded.

C. Flood-Fill Unwrapping

The third step is implemented by a flood-fill-typealgorithm, just as for the 2-D branch-cut algo-rithms.17 A vertex queue is used to store the coor-

inates of vertices that have been unwrapped andhat have nearest neighbors that have not yet beennwrapped. Each entry in the queue contains thehree coordinates of the unwrapped vertex and thehree coordinates of a nearest neighbor that is con-ected to the unwrapped vertex by an edge. Eachime an entry is removed from the queue, the phasef the neighbor is unwrapped by bringing the phaseifference between the two vertices into the range2p, p!, and its nearest neighbors are examined inurn. Those that are joined by edges to the first

Fig. 7. Phase singularity loops and cuts for a 3-D phase distribu-tion, measured with a high-speed speckle pattern interferometer.

906 APPLIED OPTICS y Vol. 40, No. 23 y 10 August 2001

earest neighbor, and have also not yet been un-rapped, are added to the queue. This process is

epeated until the queue is empty.

5. Practical Application

The potential practical benefits of this new unwrap-ping technique are illustrated here with data froma high-speed out-of-plane speckle interferometer.The interferometer was used to record images of adeforming plate at a rate of 1000 frames s21, withpy2 phase shifts introduced between frames bymeans of a Pockels cell.15 The resulting 3-D phasemap ~calculated by a four-frame algorithm without

ny spatial smoothing!15 represents the deforma-tion state of the plate relative to the first frame:The z axis corresponds to the frame number, andthe x and y coordinates specify the pixel indices.The detected residues within a small phase volume~Nx 5 Ny 5 11, Nz 5 17! are displayed in Fig. 7 aspen circles. Residues on the surface of the volumere marked as filled circles. Detected phase sin-ularity loops are shown as continuous lines: Asxpected, these are either fully or partially closed,ith none terminating inside the volume. Theranch cuts ~i.e., the nonzero values of ex, ey, or ez!

placed by the algorithm described above are repre-sented by asterisks.

Figure 8 shows the final phase image f~x, y, Nz!,nwrapped by a traditional spatial method @Fig.~a!#, a temporal method @Fig. 8~b!#, and the newpproach @Fig. 8~c!#. The spatial method involved

Fig. 8. Result of unwrapping the phase distribution from Fig. 7with ~a! a spatial method, ~b! a temporal method, and ~c! theproposed new method.

Page 7: Three-Dimensional Noise-Immune Phase Unwrapping Algorithm

mo

b2tpgsoosas

w

2

1

1

unwrapping f in the plane z 5 Nz along the line x 51, followed by unwrapping along lines parallel tothe x axis. The fact that this unwrapping pathpasses between the residue pairs R and S causes a2p phase error to propagate spatially, a character-istic failure mode of this type of unwrapping algo-rithm. Although a more sophisticated algorithmwould have placed branch cuts to prevent the spa-tial error propagation, it is not obvious which 11residue should be joined to which 21 residue. Fig-ure 7 shows that, with the full 3-D analysis, theresidue pairing is unambiguous. A further disad-vantage of the 2-D spatial unwrapping method isthat the phase relationship to the starting phasedistribution ~z 5 1! is uncertain to some integral

ultiple of 2p. The temporal unwrapping meth-d15,19 involves unwrapping along the time ~z! axis.

Data from each pixel are processed independentlyfrom all other pixels in the image, thereby prevent-ing spatial propagation of the 2p phase errors; fur-thermore, there can be no unknown integralmultiple of 2p offset to the phase surface, unlike thecase with spatial unwrapping. However, there areseveral horizontal phase singularity loops ~such asloops T and U in Fig. 7! that, when passed through

y the vertical unwrapping path, cause an isolatedp phase error at the corresponding pixel. By con-rast, unwrapping by the new algorithm @Fig. 8~c!#revents both the spatial and the temporal propa-ation of 2p phase errors. The resulting phaseurface is more consistent with the expected motionf the sample ~essentially rigid body translationver such a small field of view!, with a reducedtandard deviation of 0.90 rad compared with 1.20nd 1.13 for the spatial and temporal surfaces, re-pectively.The algorithm was coded in MATLAB and was run

on a Sun Ultra 10 workstation. Computationtimes for phase maps containing a few thousandvertices and a few hundred residues are typically afew tens of seconds. Such data sets are of coursemuch smaller than those likely to arise in practicalapplications of the algorithm. Although the code isnot optimized ~use of a compiled, rather than inter-preted, language would, for example, reduce thecomputation time significantly!, it is important toconsider the scaling of the computation time withthe size of the data set. The computational effortrequired for most steps of the algorithm iso~NxNyNz!. The placing of the cuts requires at

orst o~NrNL! calculations where Nr is the totalnumber of residues and NL is the average number ofresidues per PSL. It is reasonable to expect NL tobe approximately size independent and for Nr toscale with NxNyNz. In this case, the only step thatdoes not scale linearly with the total number ofphase values is that of sorting the residues into theloops. The current basic sort routine requireso~Nr

2! calculations, but this could be reduced sig-nificantly by use of more efficient sorting algo-rithms. For comparison, in the case of 2-Dunwrapping, global minimization of the cut lengths

by the Hungarian algorithm requires o~Nr ! calcu-lations.7

6. Conclusions

A novel unified approach to the unwrapping of noisy3-D phase distributions has been proposed. Closedphase singularity loops are shown to be responsiblefor the propagation of unwrapping errors. The pres-ence of 11 and 21 residue pairs in the classical 2-Dunwrapping problem arises from the intersection ofthe loops with the 2-D surface. Path independencefor the full 3-D problem is obtained when cut surfacesare placed so as to prevent unwrapping through theloops.

I am pleased to acknowledge useful discussionswith M. Takeda and R. Cusack. This research wassupported by the Engineering and Physical SciencesResearch Council through contracts GRyM65861 andGRyN22380.

References1. K. Itoh, “Analysis of the phase unwrapping algorithm,” Appl.

Opt. 21, 2470 ~1982!.2. J. E. Greivenkamp, “Sub-Nyquist interferometry,” Appl. Opt.

26, 5245–5258 ~1987!.3. M. Servin, D. Malacara, and F. J. Cuevas, “Path-independent

phase unwrapping of subsampled phase maps,” Appl. Opt. 35,1643–1649 ~1996!.

4. R. M. Goldstein, H. A. Zebker, and C. L. Werner, “Satelliteradar interferometry—two-dimensional phase unwrapping,”Radio Sci. 23, 713–720 ~1988!.

5. J. M. Huntley, “Noise-immune phase unwrapping algorithm,”Appl. Opt. 28, 3268–3270 ~1989!.

6. L. D. Barr, V. Coude du Foresto, J. Fox, G. A. Poczulp, J.Richardson, C. Roddier, and F. Roddier, “Large-mirror testingfacility at the national-optical-astronomy observatories,” Opt.Eng. 30, 1405–1414 ~1991!.

7. J. R. Buckland, J. M. Huntley, and S. R. E. Turner, “Unwrap-ping noisy phase maps by use of a minimum-cost-matchingalgorithm,” Appl. Opt. 34, 5100–5108 ~1995!.

8. D. C. Ghiglia and L. A. Romero, “Robust two-dimensionalweighted and unweighted phase unwrapping that uses fasttransforms and iterative methods,” J. Opt. Soc. Am. A 11,107–117 ~1994!.

9. D. C. Ghiglia and L. A. Romero, “Minimum Lp-norm two-dimensional phase unwrapping,” J. Opt. Soc. Am. A 13, 1999–2013 ~1996!.

10. T. J. Flynn, “Two-dimensional phase unwrapping with mini-mum weighted discontinuity,” J. Opt. Soc. Am. A 14, 2692–2701 ~1997!.

1. M. Constantini, “A novel phase unwrapping method based onnetwork programming,” IEEE Trans. Geosci. Remote Sens. 36,813–821 ~1998!.

12. C. W. Chen and H. A. Zebker, “Network approaches to two-dimensional phase unwrapping: intractability and two newalgorithms,” J. Opt. Soc. Am. A 17, 401–414 ~2000!.

3. D. C. Ghiglia and M. D. Pritt, Two-Dimensional Phase Un-wrapping ~Wiley, New York, 1998!.

14. R. Cusack, “Unwrapping 3d maps of magnetic field deviationsfor use in undistorting fMRI images of the brain,” paper pre-

10 August 2001 y Vol. 40, No. 23 y APPLIED OPTICS 3907

Page 8: Three-Dimensional Noise-Immune Phase Unwrapping Algorithm

sented at the Institute of Physics Applied Optics Divisional

1

17. D. J. Bone, “Fourier fringe analysis—the two-dimensional

3

Conference, Loughborough, UK, September 2000.5. J. M. Huntley, G. H. Kaufmann, and D. Kerr, “Phase-shifted

dynamic speckle pattern interferometry at 1 kHz,” Appl. Opt.38, 6556–6563 ~1999!.

16. P. Haible, M. P. Kothiyal, and H. J. Tiziani, “Heterodyne tem-poral speckle-pattern interferometry,” Appl. Opt. 39, 114–117~2000!.

908 APPLIED OPTICS y Vol. 40, No. 23 y 10 August 2001

phase unwrapping problem,” Appl. Opt. 30, 3627–3632 ~1991!.18. J. M. Huntley and J. R. Buckland, “Characterization of sources

of 2p phase discontinuity in speckle interferograms,” J. Opt.Soc. Am. A 12, 1990–1996 ~1995!.

19. J. M. Huntley and H. Saldner, “Temporal phase-unwrappingalgorithm for automated interferogram analysis,” Appl. Opt.32, 3047–3052 ~1993!.