hybrid robust and fast algorithm for three-dimensional phase unwrapping

11
Hybrid robust and fast algorithm for three-dimensional phase unwrapping Miguel Arevalillo-Herráez, 1, * Munther A. Gdeisat, 2 and David R. Burton 2 1 Department of Computer Science, University of Valencia, Avda. Vicente Andrés Estellés s/n, 46100 Burjassot, Valencia, Spain 2 General Engineering Research Institute (GERI), Liverpool John Moores University James Parsons Building, Room 114, Byrom Street, Liverpool L3 3AF, UK *Corresponding author: [email protected] Received 13 July 2009; revised 25 August 2009; accepted 15 September 2009; posted 22 September 2009 (Doc. ID 114189); published 6 November 2009 We present a hybrid three-dimensional (3D) unwrapping algorithm that combines the strengths of two other fast and robust existing techniques. In particular, a branch-cut surface algorithm and a path- following method have been integrated in a symbiotic way, still keeping execution times within a range that permits their use in real-time applications that need a relatively fast solution to the problem. First, branch-cut surfaces are calculated, disregarding partial residue loops that end at the boundary of the 3D phase volume. These partial loops are then used to define a quality for each image voxel. Finally, unwrapping proceeds along a path determined by a minimum spanning tree (MST). The MST is built according to the quality of the voxels and avoids crossing the branch-cut surfaces determined at the first step. The resulting technique shows a higher robustness than any of the two methods used in isolation. On the one hand, the 3D MST algorithm benefits from the branch-cut surfaces, which endows it with a higher robustness to noise and open-ended wraps. On the other hand, incorrectly placed surfaces due to open loops at the boundaries in the branch-cut surface approach disappear. © 2009 Optical Society of America OCIS codes: 100.5088, 100.5070. 1. Introduction Phase unwrapping refers to a set of techniques that are used to reconstruct signals in a large number of application areas, such as optical interferometry, synthetic aperture radar (SAR), and magnetic reso- nance imaging (MRI). In these application areas there exist certain analysis techniques that produce data in the form of a phase distribution, with values defined in the range of ½π; þπÞ. This causes 2π dis- continuities to appear in the result, making it un- usable until they are resolved. The removal of these discontinuities is known as phase unwrapping. In principle, phase unwrapping seems a simple operation, which consists of detecting phase jumps and adding (or subtracting) the most appropriate multiple of 2π to each signal value. However, the pre- sence of noise, processing errors, undersampling, and spurious artifacts converts this to a cumbersome pro- cess. For this reason, phase unwrapping has been a major topic of research during the past two decades, to such an extent that there exists a book dedicated to this topic in full [1]. Since in the past most relevant techniques pro- duced two-dimensional (2D) data, most of the initial work focused on the implementation of 2D algori- thms. However, relatively recent techniques produce phase volumes, and this has motivated the study of three-dimensional (3D) algorithms. This is the case of noncontact measurement of dynamic objects, mul- titemporal SAR interferometric measurements [2], and MRI [3]. Although phase volumes can easily be processed as a set of independent 2D maps, such an approach would not consider useful information 0003-6935/09/326313-11$15.00/0 © 2009 Optical Society of America 10 November 2009 / Vol. 48, No. 32 / APPLIED OPTICS 6313

Upload: david-r

Post on 05-Oct-2016

212 views

Category:

Documents


0 download

TRANSCRIPT

Hybrid robust and fast algorithm for three-dimensionalphase unwrapping

Miguel Arevalillo-Herráez,1,* Munther A. Gdeisat,2 and David R. Burton2

1Department of Computer Science, University of Valencia, Avda. Vicente Andrés Estellés s/n,46100 Burjassot, Valencia, Spain

2General Engineering Research Institute (GERI), Liverpool John Moores UniversityJames Parsons Building, Room 114, Byrom Street, Liverpool L3 3AF, UK

*Corresponding author: [email protected]

Received 13 July 2009; revised 25 August 2009; accepted 15 September 2009;posted 22 September 2009 (Doc. ID 114189); published 6 November 2009

We present a hybrid three-dimensional (3D) unwrapping algorithm that combines the strengths of twoother fast and robust existing techniques. In particular, a branch-cut surface algorithm and a path-following method have been integrated in a symbiotic way, still keeping execution times within a rangethat permits their use in real-time applications that need a relatively fast solution to the problem. First,branch-cut surfaces are calculated, disregarding partial residue loops that end at the boundary of the 3Dphase volume. These partial loops are then used to define a quality for each image voxel. Finally,unwrapping proceeds along a path determined by a minimum spanning tree (MST). The MST is builtaccording to the quality of the voxels and avoids crossing the branch-cut surfaces determined at the firststep. The resulting technique shows a higher robustness than any of the two methods used in isolation.On the one hand, the 3D MST algorithm benefits from the branch-cut surfaces, which endows it with ahigher robustness to noise and open-ended wraps. On the other hand, incorrectly placed surfaces dueto open loops at the boundaries in the branch-cut surface approach disappear. © 2009 Optical Societyof America

OCIS codes: 100.5088, 100.5070.

1. Introduction

Phase unwrapping refers to a set of techniques thatare used to reconstruct signals in a large number ofapplication areas, such as optical interferometry,synthetic aperture radar (SAR), and magnetic reso-nance imaging (MRI). In these application areasthere exist certain analysis techniques that producedata in the form of a phase distribution, with valuesdefined in the range of ½�π;þπÞ. This causes 2π dis-continuities to appear in the result, making it un-usable until they are resolved. The removal of thesediscontinuities is known as phase unwrapping.In principle, phase unwrapping seems a simple

operation, which consists of detecting phase jumpsand adding (or subtracting) the most appropriate

multiple of 2π to each signal value. However, the pre-sence of noise, processing errors, undersampling, andspurious artifacts converts this to a cumbersome pro-cess. For this reason, phase unwrapping has been amajor topic of research during the past two decades,to such an extent that there exists a book dedicatedto this topic in full [1].

Since in the past most relevant techniques pro-duced two-dimensional (2D) data, most of the initialwork focused on the implementation of 2D algori-thms. However, relatively recent techniques producephase volumes, and this has motivated the study ofthree-dimensional (3D) algorithms. This is the caseof noncontact measurement of dynamic objects, mul-titemporal SAR interferometric measurements [2],and MRI [3]. Although phase volumes can easily beprocessed as a set of independent 2D maps, such anapproach would not consider useful information

0003-6935/09/326313-11$15.00/0© 2009 Optical Society of America

10 November 2009 / Vol. 48, No. 32 / APPLIED OPTICS 6313

contained in the third dimension, which can be usedto increase the quality of the result. For this reason,there is an interest in 3D unwrapping algorithmsthat inherently incorporate the third dimension intothe process. In this direction, a number of techniqueshave already been proposed, most of them extensionsof their 2D counterparts.Most existing techniques can be classified as be-

longing to one of the following three groups: global,region growing, and quality guided.Global algorithms attempt to minimize a function,

whether a measure of the difference between the gra-dients of the wrapped and unwrapped signals or thenumber of discontinuities in the unwrapped signal.The Lp-norm [4], branch-cut methods (e.g., [5]), theleast-squares approach [6], the ZπM algorithm [7],Green’s formulation [8], the use of a Markov randomfield model [9], and the energy minimization frame-work presented in [10] are all methods that fall with-in this first category. In 3D, it is worth mentioningthe extension of the 2D branch-cut method presentedin [11], which is revisited later in this paper.Region-growing approaches (e.g., [12,13]) operate

by dividing the image into smaller areas, unwrap-ping these areas independently and then bringingthem together using a joining strategy. Althoughthese algorithms are normally very fast, they usuallyfail at detecting large discontinuities in the wraps. Inmultiple dimensions, an algorithm that uses a best-pair-first region merging approach has also beenpresented in [14]. In particular, the n-dimensionalvolume is divided into a number of regions, each ofwhich contains no phase wraps, in a similar wayas in the 2D algorithm in [15]. These regions are thentreated as single entities and a cost function is usedto determine which regions are merged first. Thisprocess continues until a single region remains.Quality-guided techniques [16–18] convert an n-

dimensional signal into a one-dimensional (1D) one,according to a quality measure that guides theconstruction of an unwrapping path. In an attemptto avoid error propagation, the most reliable valuesare the first to be processed. In essence, the n-dimensional signal is considered a graph, with a ver-tex per value and an edge between vertices thatappear adjacent in any of the n dimensions. A relia-bility value is assigned to every existing edge, and aminimum spanning tree (MST) is built according toedge costs, which are related to the inverse of theirreliability values. Finally, the signal is unwrappedusing the simple threshold-based 1D algorithm men-tioned above, applied on the path determined by theMST. In three dimensions, a quality-guided approachis presented in [3]. As a first step, a noise-level map isbuilt and a voxel is set as the starting seed. There-after, the technique operates in an iterative fashion.At each iteration, only the voxels with a noise levelbelow a threshold are unwrapped. The unwrappingof the remaining voxels is deferred to subsequentiterations, during which the threshold value is gra-dually increased until the volume has been fully

unwrapped. This technique was improved in [19]by avoiding the iterative procedure and the selectionof a starting seed. In particular, the technique pre-sented in [18] is adapted to three dimensions, byusing voxels instead of pixels and considering theedges in each of the three dimensions. In this context,several mechanisms to produce 3D quality maps areevaluated, and the approach is compared to otherexisting 3D unwrapping methods, showing a higherrobustness.

Execution times, noise immunity, and response toundersampled data are key issues that affect theselection of the most suitable unwrapping algorithmfor a specific application. In general, global techni-ques are robust and usually extendable to 3D. Never-theless, they are also computationally intensive. Onthe contrary, quality guided techniques depend onhow reliable the quality map is. However, they aregenerally fast and a good alternative for processinglarge 3D phase volumes.

Both branch-cut-surface-based algorithms (e.g.,[11]) and MST-based methods (e.g., [19]) offer a rea-sonable compromise between execution time and per-formance, and this makes them especially attractivefor real-time processing. However, although both ofthese algorithms share low execution times, there ex-ist a number of factors that affect their performancein terms of the correctness of the final unwrapped re-sult. In this paper, these problems are analyzed and anovel approach is proposed that integrates the fun-damental principles of both algorithms with a qual-ity measure proposed in [3]. Themethod yields betterresults than when they are used independently, with-out altering execution times significantly.

The remainder of the paper is organized as follows.In Sections 2 and 3 the principles of the two algo-rithms are described, and the issues that motivatedthe development of the proposed algorithm arediscussed. The proposed algorithms are describedin Section 4 and are then applied to unwrapping a ser-ies of representative 3Ddata volumes in Section 5. Fi-nally, Section 6 discusses themost relevant aspects ofthe approach and describes some future work.

2. Branch-Cut Unwrapping

A compromise approach between execution timeand performance is the 3D noise-immune phase-unwrapping algorithm presented in [11], a 3D exten-sion of classical branch-cut methods (e.g., [5,20]).

Branch-cut methods are based on the assumptionthat a fully consistent unwrapped phase map re-quires that the integral of unwrapped gradientsaround any closed loop should be zero. Under this as-sumption, any 2 × 2 set of pixels, such that it is notpossible to define a wrap-free phase map by addinginteger multiples of 2π to the wrapped signal values,causes an inconsistency. These are called residues orsingularities, and they occur at the ends of an open-ended wrap. If they are integrated in a loop, they pro-duce −1, 0, or 1. If a phase contains these types ofinconsistency, any integration path that encloses a

6314 APPLIED OPTICS / Vol. 48, No. 32 / 10 November 2009

different number of positive and negative residueswill violate the constraint above.To avoid these inconsistencies, a series of branch-

cut lines joining singularities of different signs areplaced. Then, the signal is unwrapped along any1D path that does not cross the cut lines, by addingor subtracting multiples of 2π to all successive pixelsafter a phase discontinuity is detected. This ap-proach guarantees the consistency of any integrationpath that does not cross any branch cut (this is usual-ly referred to as path independence). However, thelocation of the cut lines for a given wrapped phasemap is not unique, and they may be placed in manydifferent arrangements and orientations.It is interesting to note that the path-indepen-

dence condition implies that phase discontinuitiesgreater than π in the unwrapped signal may onlyhappen at the branch cuts. Hence, the total lengthof the cuts imposes an upper bound to the numberof discontinuities greater than π in the result (theL0 norm), and minimizing this length constitutes areasonable approximation to minimizing the L0

norm. This operation can be considered an instanceof the classical linear assignment problem, a specialcase of the minimum cost flow problem. This can besolved in polynomial time by using the so-calledHungarian algorithm [21] in a time that is Oðn3Þ,with n as the number of residues in the phase map.A 3D version of the algorithm has been presented

in [11] and further developed in [22–24]. In thesecases, the concept of a branch cut is replaced by thatof a 3D branch-cut surface. In three dimensions, re-sidues appear in a disposition such that they formclosed loops in space, except when they break atthe boundary of the phase volume. To prevent theunwrapping path from going through the loopsand causing inconsistencies, branch-cut surfacesare placed on these loops.In the first of these publications [11], the author

claimed that this made it possible to determinethe location of the cuts uniquely, in contrast withthe 2D case, for which there are many possible waysin which singularities can be paired up. A major im-plication of this assumption is that it allows for a fastimplementation, avoiding the residue-matching stepthat is required in the 2D case. This makes the algo-rithm especially suitable for real-time applicationsthat need 3D data reconstruction, with executiontimes below some of the fastest approaches to 3Dphase unwrapping (e.g., [19]).Unfortunately, broken loops at the boundary of the

phase volume make this statement not strictly true.The reality is that the problem of determining thebest-possible pairing still remains, but in this occa-sion at the sides of the 3D volume.In the initial proposal [11], incomplete loops are

artificially closed on themselves, by adding a seg-ment made up of artificial residues residing in theboundary, so that their two endpoints become con-nected. However, it can be shown that this approachmay yield the construction of incorrect branch-cut

surfaces. This can be easily understood by usingthe following simple example. Let us assume a single2D phasemap with only two residues at the sides of asmall open-ended wrap, in the positions indicated inFig. 1(a). Let us then stack a pile of these phase mapsto construct a 3D phase volume, as illustrated inFig. 1(b). These residues will form two loops thatbreak at the boundaries of the volume, as illustratedin Fig. 1(c). The resulting branch-cut surface wheneach loop is closed on itself is shown in Fig. 2(a).In contrast, Fig. 2(b) illustrates a more consistent so-lution, in which the loop ends have been connected toone another and the area of the surface has beenminimized. Although the problem has been illustra-ted with an example that may seem artificial, incom-plete loops crossing the 3D volume are common alongthe time axis in 3D measurement of dynamic objects.

This problem has been recently identified in [22].In this work, the Hungarian algorithm is used to pairpartial loops that end on the first and last slices andrun in opposite directions. A cost function that equalsthe sum of the distances between the ends of the twoloop segments on the first and last slices is used forthis purpose. This method is not correct for threemain reasons. First, incomplete loops of this typedo not necessarily enter and exit on the first and lastslices of the volume, but theymay also enter or exit atthe sides. This happens, e.g. in the analysis of movingobjects over time, when a residue caused by a truediscontinuity on the surface leaves the field of view.Second, a loop may enter and exit the boundary anyeven number of times and thus pairing the loops isnot a correct approach. Third, if the objective is mini-mizing the L0 norm, the cost should be a function ofthe total surface enclosed by the loops.

The third problem is illustrated in Fig. 3, in thecontext of 3D measurement of dynamic objects. Inthis figure, the evolution along the time axis of tworesidues of different sign caused by a true surfacediscontinuity are illustrated, on an object that ismoving toward the right. At some point, one of theresidues exits the volume and reenters after a frame.The surfaces determined by pairing the loops is farfrom the minimum in both cases. Note that the sameproblems would still happen if the second residuehad not reentered the volume.

The problem of joining the loops presents a highercomplexity than its 2D counterpart. In the 3D case,

Fig. 1. (Color online) Construction of a phase volume with twoloops that break at boundaries. (a) A 2D phase map with two re-sidues of different sign, (b) a 3D phase map build by stacking a pileof these 2D phase maps, and (c) incomplete loops in the 3D volume.

10 November 2009 / Vol. 48, No. 32 / APPLIED OPTICS 6315

phase gradients above π in the final unwrapped re-sult may only occur at the sides of a branch surface.Therefore, the reasonable approximation to minimiz-ing the L0 norm in this case is finding the best way oflinking incomplete loops, so that the total area of thesurfaces is minimum. Such an approach has beenproposed in [25], using a heuristic algorithm to linkmultiple incomplete loops. In particular, a MonteCarlo algorithm is used for deciding the best linking;and an iterative method, called surface evolver [26],is used to find an approximation to theminimum sur-face enclosed by each loop.A major problem with this approach is the evalua-

tion of each potential solution to the problem. In the2D case, the total length of a combination of branchcuts can be calculated relatively easily, using theEuclidean distance between the residues that defineeach individual branch cut. In the 3D case, however,the calculation of the total surface defined by a poten-tial solution is a computationally intensive opera-tion. Hence, although this approach leads to a moreconsistent definition of the surfaces than the exten-sion to the original algorithm presented in [22], theintroduction of such a loop-linking mechanismcauses a significant increase in the execution time,considerably limiting its potential for applicationin real-time environments.

3. MST-Based Techniques

Quality-based techniques are based on processing themost reliable voxels first, in an attempt to avoid noisyand inconsistent areas. In the algorithm presented in[19], the quality of the edges (a frontier between twovoxels in any of the axes) is used to guide the unwrap-ping path, which is calculated by using a relativelysimple algorithm. First, each edge is assigned a costthat is inverselyproportional to its quality. Then, localunwrapping operations are performed on a pathdetermined by a MST (the minimum cost set of edgesthat connects all voxels together without containingany loops), which is computed by using Kruskal’salgorithm [27]. This approach is summarized inAlgorithm 1.

Although a phase-unwrapping path following aMST usually avoids going through residues [28]and, thus, yields reliable phase unwrapping results,this is by no means guaranteed and heavily dependson the quality function used (see, e.g., [3,19] for ex-amples of noise-level estimators). Besides, and morecrucially, a single incorrectly unwrapped phase valuewill propagate through the shortest branch originat-ing from that voxel. A major problem with this kindof algorithm is that their robustness strongly de-pends on the quality function (also called reliabilityfunction or noise-level estimator in other works). Asan example, any of the measures proposed in [19]would be efficient at avoiding concentrated largenoisy areas, but not robust at dealing with noise-freeopen-ended wraps. On the other hand, a noisy esti-mator based on residue density [3] would be robustat dealing with large discontinuities in the wraps inthe absence of noise, but inefficient at this same taskin the presence of sparse noise.

4. Proposed Approach

MST-based and Huntley’s noise-immune [11] tech-niques are both computationally efficient phase-unwrapping methods. In fact, they present executiontimes that are far lower than other more elaborate

Fig. 2. (Color online) Resulting branch-cut surface when (a) eachloop in Fig. 1(c) is closed on itself and when (b) ends are allowed toconnect to other incomplete loops.

Fig. 3. (Color online) Example of a problem with pairing partialloops. One of two residues caused by a true surface discontinuityexits and reenters the volume. (a) Illustration in 3D. (b) A 2D viewof the loops from the top of the volume.

Algorithm 1. MSTunwrapping. MST-Based Technique forPhase Unwrapping

1 Calculate the quality of all edges in the phase map2 Build a list with all edges sorted in descending order of quality3 Assign each voxel to a different elementary group containing justthat voxel4 WHILE the list of edges is not empty4.1 Extract an edge from the list4.2 IF the two voxels u and v that form the edge do not belong tothe same group, unwrap the group of v with respect to the groupof u locally, and merge the two groups into a single one. The localunwrapping operation consists of adding the following integermultiple of 2π to all voxels in the group of u, where u:phase andv:phase represent the phase values of voxels u and v before theoperation:

2π⌊v:phase� u:phase2π þ 0:5⌋ ð1Þ

6316 APPLIED OPTICS / Vol. 48, No. 32 / 10 November 2009

alternatives that also produce an approximation tothe minimum L0 norm. Unfortunately, MST-basedtechniques do not cope well with open-ended wraps,and Huntley’s algorithm suffers from improper de-termination of branch-cut surfaces, caused by brokenloops that end at the boundary of the phase volume.Our objective is to develop a new technique that

improves the performance of both techniques above(in terms of correctness of the final result), still keep-ing execution times within a range that permits theiruse in real-time applications that need relatively fast

solutions to the problem. To this end, it is necessaryto analyze some characteristics of residues and loops.

• Most of the residues that are due to noise (ex-cept those at the boundaries of the phase volume)will define closed loops. Huntley’s original algorithmconstitutes a good approximation to the minimum L0

norm in these cases.• Most loops that are due to sparse noise are con-

fined in relatively small regions in space. Partialloops that cross the phase volume (or have distant

Fig. 4. (Color online) Visual example of computing reliability values according to the nearest neighbor rule (distance from a voxel to itsnearest residue). For clarity, the process is illustrated in two dimensions, on a mesh with only the two residues shown in (a).

10 November 2009 / Vol. 48, No. 32 / APPLIED OPTICS 6317

ends) are likely to be caused by real phase disconti-nuities, dense noise areas, and/or the method usedto obtain the phase volume. This is especially truein 3D measurements of moving objects. In this case,a residue produced by a true discontinuity moveswith the object. This movement produces a partialresidue loop in the normal direction, propagatingalong the 2D frames that form the phase volume.This loop starts when the point at which the true dis-

continuity happens enters the field of view (or at thefirst frame, when the capture begins) and ends whenthe same point leaves the field of view (or at the lastframe, when the capture stops).

The first characteristic above suggests the use ofthe branch-cut surfaces determined by closed loopsas a mechanism to deal with noise. However, thetreatment of partial loops needs to be studied further.

Fig. 5. Results of unwrapping a synthetic phase volume composed of 64 frames with a cube of random noise at the center: (a) middleframe, (b)–(f) unwrapping results with (b) flood-fill algorithm, (c) MST, (d) NN, (e) Huntley, and (f) proposed.

Fig. 6. Results of unwrapping a synthetic phase volume that represents a growing sphere: (a) middle frame, (b)–(f) unwrapping resultswith (b) flood-fill algorithm, (c) MST, (d) NN, (e) Huntley, and (f) proposed.

6318 APPLIED OPTICS / Vol. 48, No. 32 / 10 November 2009

Calculating the optimum way to join these loops toyield a minimum surface (as in previous approxima-tions) is a computationally expensive process, evenwhen heuristic measures are used to approximatethe best solution. In our proposal, this operation isavoided by not closing partial loops. This causesthe consistency of any integration path that doesnot cross any branch-cut surface to not be guaran-teed, and implies that the unwrapped result will de-pend on the unwrapping path. Thus, a suitablestrategy to devise this path becomes necessary.A quality-guided unwrapping algorithm has been

used for this task. In particular, a MST-based algo-rithm using a residue density measure [3] has beenintegrated into the approach. Such a technique isefficient at dealing with large discontinuities inthe wraps in the absence of sparse noise.To be able to cope with sparse noise, residues that

are part of a closed loop have been excluded (theyhave already been used to build the branch-cut sur-

faces). In this way, the only loops produced by sparsenoise that might have an influence on the qualitymap are partial ones. Although these are usually lim-ited to voxels near the boundary, they may still causea problem when the dimensions of the axes are sig-nificantly different. In these cases, even small openloops (produced by sparse noise) at either of the twovolume faces that are perpendicular to the shortestaxis may affect the quality values of a large pro-portion of the entire phase volume. In fact, they willlimit the capacity of the approach to solve wrap dis-continuities of a length above that of the shortestaxis. To avoid this problem, the three axes are re-scaled to have an equal size.

Regarding the computation of residue density, anearest-neighbor approach [29] has been adopted,considering the residue density at a voxel v as inver-sely proportional to the size of the sphere needed tocontain a given number of observations (fixed to onein our case):

dNNðvÞ ¼1=N

Vð∥v�NNðvÞ∥Þ ; ð2Þ

where N represents the total number of residues inthe phase volume, NNðvÞ denotes the nearest residueto the voxel v, and V is the volume of the minimalsphere centered in v that contains NNðvÞ (i.e., asphere of radius ∥v�NNðvÞ∥). Since the final pur-pose of computing qualities is to establish a ranking,the reliability of each voxel has been directly esti-mated as the distance to the nearest residue, andthe reliability of an edge e between two voxels v1and v2 as the sum of the reliabilities of the voxels:

reliabilityðvÞ ¼ ∥v�NNðvÞ∥; ð3Þ

reliabilityðeÞ ¼ reliabilityðv1Þ þ reliabilityðv2Þ: ð4Þ

Computing distances from each voxel to their respec-tive nearest residues is a simple problem in a 3Dmesh, if Manhattan distances are used (distancesbetween two voxels at positions ðx1; y1; z1Þ andðx2; y2; z2Þ are measured along axes in right anglesby using the expression jx1 � x2j þ jy1 � y2jþjz1 � z2j). Algorithm 2 describes the pseudocode forsuch an operation, when no rescaling of the axes isrequired. As a first step, residues are identified.Then, distances from each voxel to their closest resi-dues are estimated, by using an iterative region-growing approach in which every residue determinesthe quality value of the voxels that are closer to itthan to any other residue. Initially, a distance coun-ter dc is set to zero and a region per residue is built.Each of these regions contains the four voxels thatform the residue, which are assigned the value ofthe distance counter dc (zero). Then, an iterative pro-cess starts. At each iteration, all regions extend theirboundary of influence by one voxel in the horizontal,vertical, and normal directions, evading voxels thatare already part of another region (the ones that havealready been assigned a distance value). Besides, the

Fig. 7. Results of unwrapping a synthetic phase volume thatrepresents a moving complex surface. Two representative framesare shown, with different noise intensities.

10 November 2009 / Vol. 48, No. 32 / APPLIED OPTICS 6319

distance counter dc is incremented, and the resultingvalue is assigned to all the new voxels that have beenadded to any of the regions. In this way, the voxelsadded at a given iteration are all assigned the samevalue, which is one unit higher than that assigned tothe voxels added at the previous iteration (to reflectthat the new voxels included in the regions are oneunit farther apart from their respective nearest resi-due than those added at the previous iteration). As

all regions grow at the same rate, the voxels addedduring one iteration are all at the same distance fromtheir corresponding nearest residue (which is storedin the distance counter dc), and are assigned thesame quality value. This iterative process is illu-strated in two dimensions in Fig. 4. Finally, onceall voxels have been assigned a distance value, edgereliabilities are computed. In our implementation,we support axis rescaling by using a heap instead

Fig. 8. Results of unwrapping a real phase volume that resulted from the analysis of real fringe patterns projected onto a mannequin.

6320 APPLIED OPTICS / Vol. 48, No. 32 / 10 November 2009

of a queue, updating the reliability value of a voxelwhen a lesser value is found, and reconsidering itsneighbors when this happens.

Algorithm 3 presents an outline of the entire meth-od. First, closed residue loops are computed and

stored in a list (open loops are not considered at thisstage). Then, each loop is processed to compute itscorresponding surface, and edges that cross this sur-face are added to a mask. Afterward, open residueloops are used to calculate the reliability of the edges,according to the calculateEdgeReliability algorithmpresented above. Finally, the MSTunwrapping algo-rithm is applied, using the resulting reliability mapand excluding edges that were masked when consid-ering the closed residue loops.The resulting technique is more robust than any

of the two techniques used in isolation, as it will beshown in Section 5. On the one hand, the quality-guided approach benefits from the branch-cut sur-faces established by Huntley’s technique, whichendows it with a higher robustness to noise-freeopen-ended wraps. On the other hand, this strategycauses incorrectly placed surfaces due to open loopsat the boundaries inHuntley’s approach to disappear.

5. Results

The 3D phase unwrapping technique presented inthis paper has been tested exhaustively in both simu-lated and real phase volumes. In this section, the re-sults are compared to those obtained by using thebranch-cut surface technique [11], and the quality

guided method described in [19]. For the latter case,two different quality measures have been tested: sec-ond differences and distance to the nearest residue.The integration of the nearest residue measurewithin a quality-guided algorithm aims to show thatthe improvements achieved are not just a merit ofthe quality measure. We will refer to these algo-rithms as Huntley’s, MST, and nearest neighbor(NN), respectively.

To display the results, a typical range image repre-sentation has been employed, using gray levels torepresent phase values. White is used to representthe maximum value, black the minimum, and othervalues are represented with intensities that scaleproportionally between the two.

As a first simple experiment, we have constructeda synthetic 3D phase volume composed of 64 framesof size 128 × 128 pixels. In this volume, the phasegrows slowly along the x, y, and z axes and containsa box of random noise of size 32 × 32 pixels located atthe center of the signal. This volume has been un-wrapped with a simple flood-fill strategy and withall the algorithms mentioned above. The result ona representative frame (the middle one) is illustratedin Fig. 5. All the algorithms, except the simple flood-fill strategy, perform efficiently in this case.

For a second test, a computer-generated phase vol-ume has been used. In particular, 100 frames of size256 × 256 pixels that correspond to a single growingsphere, whose radius increases with time, has beensimulated. Then, Gaussian noise has been added,and unwrapping has been attempted with Huntley’s,MST, NN, and the proposed approach. The results forthemiddle frame are shown in Fig. 6. In this case, theHuntley and the proposed approach performed thebest. The MST-based algorithm did not achieve a cor-rect unwrapping and the NN approach producedsome tiny incorrectly unwrapped areas along thereconstructed phase.

As a third experiment, we have simulated a com-plex surface with steep-sided features, whose heightis increasing with time. The volume contains 40frames of size 256 × 256 pixels, and Gaussian noisehas been added (increasing with the frame number).Figure 7 shows the results. In this case, only the pro-posed approach and NN achieved an appropriatephase reconstruction. Huntley’s technique sufferedfrom improper determination of surfaces caused bypartial loops ending at the volume’s boundary; andMST produced large wrongly unwrapped areasacross the entire phase volume.

A fourth experiment has been performed on realdata, analyzing the face of a mannequin used inradiotherapy calibration. To simulate movement, themannequin was manually raised and lowered, simu-lating respiration. A total of 25 frames, of size 512 ×512 pixels, were captured and Gaussian noise wasartificially added. The results are shown in Fig. 8.On this occasion, only the proposed approachproduced a reasonable result. As in the previouscase, Huntley’s approach failed to produce a correct

Algorithm 2. calculateEdgeReliability. Algorithm Used to Define theReliability of the Edges

1 Build a list with all voxels which are part of residues in the phasevolume2 Set the distance counter dc ¼ 03 WHILE the list of voxels is not empty3.1 Assign the value dc to all pixels in the list as their reliabilityvalue3.2 Replace the list of voxels by a new list containing theneighbors of the voxels in the old list which have not yet beenassigned a reliability value3.3 Increment the distance counter dc by one

4 Calculate the reliability of each edge as the average of thedistances assigned to the two voxels associated with it.

Algorithm 3. Outline of the Proposed Technique

1 Calculate closed residue loops in the phase volume2 Compute the minimum surface enclosed by these loops, andmask the edges which cross through these surfaces3 Calculate partial residue loops in the phase volume4 Execute algorithm calculateEdgeReliability above, byconsidering only residues which are part of these partial loops5 Execute algorithm MSTunwrapping above, using the resultingreliabilitymap from the previous step and excluding edgesmaskedin step 2

10 November 2009 / Vol. 48, No. 32 / APPLIED OPTICS 6321

reconstruction. Two partial loops crossing the entirevolume from front to back produced the straightwraps in the final unwrapped distribution. MSTand NN also had problems around the area of thenose and produced a corrupted result.

6. Conclusions

We have presented a novel 3D phase unwrappingtechnique. The algorithm combines the principlesof the quality-guided and branch-cut surface meth-ods with a quality measure that depends on residuedensity. This has been estimated by using a nearest-neighbor approach.In particular, loops of residues are identified but,

unlike in the classical branch-cut surface method[11], no attempt is made at closing partial loops thatend at the volume’s boundary. Instead, closed andpartial loops receive different treatment. The formerare used to define branch-cut surfaces, and the latterto define a quality measure that is then used to de-termine the unwrapping path according to a MSTstrategy. In this way, the algorithm inherits the noiseimmunity of the branch-cut method and the perfor-mance against large discontinuities in the wrapsthat the nearest-neighbor measure provides in theabsence of noise.The resulting technique can be looked at from two

different perspectives. From the point of view of aMST-based quality-guided approach, the robustnesshas been improved by incorporating the branch-cutsurfaces defined by closed loops of residues. Fromthe perspective of a branch-cut method, the determi-nation of the set of segments that would connect par-tial loops minimizing the total surface area has beenreplaced by the use of a quality-guided algorithm,with the consequent computational savings. The ap-proach has been tested on a number of simulated andreal phase maps, suggesting a significant improve-ment in robustness.

This work has been partially supported/fundedby European Funds for Regional Development, theSpanish Ministry of Education through projectsConsolider Ingenio 2010 CSD2007-00018 andTIN2006-12890, and by the Engineering and Physi-cal Sciences Research Council (EPSRC) throughgrants “MEGURATH” EP/D077702/1 and “ECSON”

EP/F013698/1.

References1. D. C. Ghiglia and M. D. Pritt, Two-Dimensional Phase Un-

wrapping: Theory, Algorithms, and Software (Wiley, 1998).2. M. Costantini, F. Malvarosa, F. Minati, L. Pietranera, and G.

Milillo, “A three-dimensional phase unwrapping algorithm forprocessing of multitemporal sar interferometric measure-ments,” in Geoscience and Remote Sensing Symposium,2002 (IEEE, 2002), Vol. 3, pp. 1741–1743.

3. R. Cusack and N. Papadakis, “New robust 3-d phase unwrap-ping algorithms: Application to magnetic field mapping andundistorting echoplanar images,” NeuroImage 16, 754–764(2002).

4. D. C. Ghiglia and L. A. Romero, “Minimum lp-norm two-dimensional phase unwrapping,” J. Opt. Soc. Am. A 13,1999–2013 (1996).

5. R. Cusack, J. M. Huntley, and H. T. Goldrein, “Improved noise-immune phase-unwrapping algorithm,” Appl. Opt. 34, 781–789 (1995).

6. M. Pritt and J. Shipman, “Least-squares two-dimensionalphase unwrapping using FFT’s,” IEEE Trans. Geosci. RemoteSens., 32, 706–708 (1994).

7. J. M. B. Dias and J. M. N. Leitão, “The ZπM algorithm: a meth-od for interferometric image reconstruction in SAR/SAS,”IEEE Trans. Image Process. 11, 408–422 (2002).

8. L. Aiello, D. Riccio, P. Ferraro, S. Grilli, L. Sansone, G.Coppola, S. D. Nicola, and A. Finizio, “Green’s formulationfor robust phase unwrapping in digital holography,” Opt.Lasers Eng. 45, 750–755 (2007).

9. L. Ying, Z. Liang, D. Munson, R. Koetter, and B. Frey,“Unwrapping of MR phase images using a Markov randomfield model,” IEEE Trans. Med. Imaging 25, 128–136(2006).

10. J. Bioucas-Dias and G. Valadao, “Phase unwrapping via graphcuts,” IEEE Trans Image Process. 16, 698–709 (2007).

11. J. M. Huntley, “Three-dimensional noise-immune phaseunwrapping algorithm,” Appl. Opt. 40, 3901–3908 (2001).

12. M. A. Herráez, J. G. Boticario, M. J. Lalor, and D. R. Burton,“Agglomerative clustering-based approach for two-dimensional phase unwrapping,” Appl. Opt. 44, 1129–1140 (2005).

13. A. Baldi, “Two-dimensional phase unwrapping by quad-treedecomposition,” Appl. Opt. 40, 1187–1194 (2001).

14. M. Jenkinson, “A fast, automated, n-dimensional phaseunwrapping algorithm,” Magn. Reson. Med. 49, 193–197(2003).

15. M. A. Herráez, D. R. Burton, M. J. Lalor, and M. A. Gdeisat,“Robust, fast and effective two dimensional automatic phaseunwrapping algorithm based on image decomposition,” Appl.Opt. 41, 7445–7455 (2002).

16. N. H. Ching, D. Rosenfeld, and M. Braun, “Two-dimensionalphase unwrapping using a minimum spanning treealgorithm,” IEEE Trans. Image Process. 1, 355–365(1992).

17. L. An, Q.-S. Xiang, and S. Chavez, “A fast implemen-tation of the minimum spanning tree method for phaseunwrapping,” IEEE Trans. Med. Imaging 19, 805–808(2000).

18. M. A. Herráez, D. R. Burton, M. J. Lalor, and M. A. Gdeisat,“Fast two-dimensional phase-unwrapping algorithm based onsorting by reliability following a noncontinuous path,” Appl.Opt. 41, 7437–7444 (2002).

19. H. S. Abdul-Rahman, M. A. Gdeisat, D. R. Burton, M. J. Lalor,F. Lilley, and C. J. Moore, “Fast and robust three-dimensionalbest path phase unwrapping algorithm,” Appl. Opt. 46, 6623–6635 (2007).

20. R. M. Goldstein, H. A. Zebker, and C. L. Werner, “Satellite ra-dar interferometry: two-dimensional phase unwrapping,”Radio Sci. 23, 713–720 (1988).

21. H. W. Kuhn, “The Hungarian method for the assignmentproblem,” Naval Res. Log. Q. 2, 83–97 (1955).

22. “Extending the dynamic range of phase contrast magnetic res-onance velocity imaging using advanced higher-dimensionalphase unwrapping algorithms,” J. R. Soc. Interface 3, 415–427(2006).

23. M. F. Salfity, P. D. Ruiz, J. M. Huntley, M. J. Graves, R. Cusack,and D. A. Beauregard, “Branch cut surface placement forunwrapping of undersampled three-dimensional phase data:application to magnetic resonance imaging arterial flow map-ping,” Appl. Opt. 45, 2711–2722 (2006).

6322 APPLIED OPTICS / Vol. 48, No. 32 / 10 November 2009

24. O. Marklund, J. M. Huntley, and R. Cusack, “Robust unwrap-ping algorithm for three-dimensional phase volumes of arbi-trary shape containing knotted phase singularity loops,” Opt.Eng. 46, (2007).

25. A. Hooper and H. A. Zebker, “Phase unwrapping in three di-mensions with application to InSAR time series,” J. Opt. Soc.Am. A 24, 2737–2747 (2007).

26. K.Brakke, “Thesurface evolver,”Exp.Math.1, 141–165 (1992).

27. M. T. Goodrich and R. Tamassia, “Kruskal’s algorithm,” inData Structures and Algorithms in Java, 4th ed. (Wiley,2006), Chap. 13, Section 13.7, p. 632.

28. S. Chavez, Q.-S. Xiang, and L. An, “Understanding phasemaps in mri: a new cutline phase unwrapping method,” IEEETrans. Med. Imaging 21, 966–977 (2002).

29. B. W. Silverman, Density Estimation for Statistics and DataAnalysis (CRC, 1986).

10 November 2009 / Vol. 48, No. 32 / APPLIED OPTICS 6323