2994
OPTICS LETTERS / Vol. 34, No. 19 / October 1, 2009
Three-dimensional phase unwrapping using the Hungarian algorithm Munther Gdeisat,1 Miguel Arevalillo-Herráez,2,* David Burton,1 and Francis Lilley1 1
General Engineering Research Institute (GERI), Liverpool John Moores University, James Parsons Building Room 114, Byrom Street, Liverpool L3 3AF, UK 2 Department of Computing, University of Valencia, Avenida Vicente Andrés Estellés s/n, 46100 Burjassot, Valencia, Spain *Corresponding author:
[email protected] Received July 29, 2009; accepted August 29, 2009; posted September 11, 2009 (Doc. ID 114809); published September 29, 2009 We propose a three-dimensional phase unwrapping technique that uses the Hungarian algorithm to join together all the partial residual loops that may occur in a wrapped phase volume. Experimental results have shown that the proposed algorithm is more robust and reliable than other well-known three-dimensional phase unwrapping algorithms. Additionally, the proposed algorithm is fast in terms of computational complexity, which makes it suitable for practical applications. © 2009 Optical Society of America OCIS codes: 100.2650, 120.5050, 100.5070.
Three-dimensional (3D) phase unwrapping has applications in many advanced imaging technologies, all of which are characterized by the fact that the required data are encoded in the form of a phase distribution. Examples of such applications are the measurement of dynamic objects by using fringe pattern projection, synthetic aperture radar, and magnetic resonance imaging (MRI). Similar to the 2D phase unwrapping algorithms [1], 3D phase unwrapping algorithms can be classified into three main categories: quality-guided techniques [2,3], global-error minimization methods [4], and residue-balancing approaches [5–7]. The algorithm proposed in this Letter belongs to the last of these categories. In the residue-balancing method, all residues in the phase volume are identified, and these are then connected together to form residue loops. These loops are then used to construct 3D barrier surfaces, the role of which is to act as constraints to the phase unwrapping path, i.e., through which the unwrapping path is forbidden to cross during the phase unwrapping process [5]. Residue loops may either form closed loops, as shown by loop (5) in Fig. 1, or they may form partial loops that terminate at the boundary of the wrapped phase volume, as is the case for all the other loops shown in Fig. 1. Partial loops can be classified into three types: • Partial loops that enter the wrapped phase volume at one side of the phase volume and leave the volume from the same side; for example, partial loops similar to loops (1) and (4) shown in Fig. 1. • Partial loops that enter the phase volume from one side and then leave the phase volume from a side adjacent to the one from where they entered; for instance, partial loops similar to loop (3), as shown in Fig. 1. • Partial loops that enter the phase volume from one side and leave the phase volume from the opposite side; for example loops similar to loop (2), as shown in Fig. 1. In this Letter, we refer to this last type of loop as a “crossing loop.” 0146-9592/09/192994-3/$15.00
The first two types of partial loop may also cause an incorrect unwrapping result, and they are produced mainly by noise. The final type, i.e., a crossing loop, is produced only in the case of the 3D measurement of dynamic objects by using fringe projection methods as identified in [6]. In Huntley’s approach [5], partial loops are artificially closed back on themselves. This is performed by adding a segment made up of artificial residues running along the phase volume boundary in such a way that the two loop end points become connected. However, it can be shown that in certain conditions this approach may yield the construction of incorrect branch-cut surfaces. This can be easily understood by means of the following simple example. Let us assume that we have a single 2D phase map with only two residues, located in the positions indicated in Fig. 2(a). Let us then stack a pile of these phase maps together in order to construct a 3D phase volume, as is illustrated in Fig. 2(b). These residues will form two loops that break at the boundaries of the volume,
Fig. 1. Closed singularity loops and partial singularity loops in the phase volume. © 2009 Optical Society of America
October 1, 2009 / Vol. 34, No. 19 / OPTICS LETTERS
Fig. 2. (Color online) Example construction of a phase volume with two crossing loops that break at the opposite boundaries. (a) 2D phase map with two residues of different signs; (b) 3D phase map built by stacking together a pile of these 2D phase maps; (c) incomplete loops in the 3D volume.
as illustrated in Fig. 2(c). The resulting branch-cut surface, formed when each loop is closed back upon itself, is shown in Fig. 3(a). In contrast, Fig. 3(b) illustrates a more consistent solution, in which the loop ends have been connected to one another, and hence the area of the branch-cut surface has been minimized. Although the problem has been illustrated here with an example that may seem artificial, it is commonplace to find incomplete loops crossing the 3D volume along the time axis in wrapped-phase data that is produced via real-world 3D measurement of dynamic objects [6]. Salfity et al. proposed the use of the Hungarian algorithm to pair crossing partial loops that end on the first and last slices of MRI wrapped-phase volumes and that run in opposite directions [6]. A cost function is used for this purpose that is equal to the sum of the distances between the ends of the two loop segments, which occur on the first and last slices of the MRI volume. This method is not correct because incomplete loops of this type do not necessarily have to enter and exit on the first and last slices of the volume, but instead may also enter or exit at the sides, as is shown in the case of residue loop (6) in Fig. 1. This happens when a residue caused by a true discontinuity on the surface leaves the field of view, for example, in the analysis of dynamically moving objects with respect to time. The execution time of this algorithm is considerably less than the algorithm proposed in [7], which makes it eligible for real-time applications such as the measurement of dynamic objects using fringe pattern projection. A reasonable approximation to minimizing the L0 norm in this case may be achieved by finding the best way of linking incomplete loops so that the total area
Fig. 3. (Color online) Resulting branch cut surface when (a) each loop in Fig. 2(c) is closed on itself; (b) ends are allowed to connect to other incomplete loops.
2995
of the surfaces is minimized. Such an approach has been proposed in [7], using a heuristic algorithm to link multiple incomplete loops. Here a Monte Carlo algorithm is used for deciding the best linking strategy, and an iterative method, called a surface evolver, is used to find an approximation to the minimum surface that is enclosed by each loop. A major problem with this approach is the evaluation of each potential solution to the problem. In the 2D case, the total length of a combination of branch cuts can be calculated relatively easily, using the Euclidean distance between the residues that define each individual branch cut [1]. In the 3D case, however, the calculation of the total surface defined by a potential solution is a computationally intensive operation. Hence, although this approach leads to a more consistent definition of the surfaces than the extension to the original algorithm that was presented in [6], the introduction of such a loop-linking mechanism causes a significant increase in the execution time, considerably limiting its potential for application in real-time environments. In this Letter, we propose an approach that combines the speed of the algorithm in [6] and the robustness of the algorithm in [7]. The suggested method pairs all the partial loops in the wrapped phase volume, which is contrary to the method used in [6], which pairs crossing partial loops only. The proposed algorithm uses the Hungarian algorithm with a cost function similar to that used in [6] to join the partial loops together. The use of the Hungarian algorithm to join partial loops and the use of the total distance between the ends of the loops as a cost function make this algorithm much faster to implement than the algorithm proposed in [7], since that technique employs a Monte Carlo approach to join the partial loops together and uses the area of the loops’ surfaces as a cost function. The proposed phase unwrapping algorithm has been tested experimentally, i.e., involving real wrapped phase data. Experiments were performed by measuring a dynamically moving RANDO phantom (a synthetic human head and torso used in radiotherapy calibration), which was undergoing manually induced pseudo-respiratory-motion in a laboratory setting. Fringe patterns were projected onto the phantom’s face. The deformed fringe patterns were captured by using a CCD camera, and they form a video sequence that was subsequently analyzed by the Fourier fringe analysis technique, thereby producing a real experimentally produced wrapped phase volume. The wrapped phase volume so obtained had dimensions of 512 ⫻ 512 ⫻ 25 voxels, and this was then unwrapped by using the proposed algorithm as well as other existing 3D algorithms for comparative purposes. This wrapped phase volume contains 110,900 closed residue loops and 8,604 partial residue loops. Row (a) in Fig. 4, reading from left to right, shows the respective wrapped phase maps taken from frames 0, 15, and 24 of the wrapped phase volume. The unwrapped phase maps that were produced by using the algorithm of Cusack and Papadakis [2], the
2996
OPTICS LETTERS / Vol. 34, No. 19 / October 1, 2009
isolated region near the dummy’s nose. The results of the proposed approach are shown in Fig. 4(f). This new technique produces better results than the other four comparative techniques presented here. This can be deduced by visual inspection of the wrapped phase maps in Fig. 4. The wrapped phase maps produced by the proposed algorithm do not contain 2 discontinuities that run along large distances across the face of RANDO. In this work the proposed algorithm has been programmed in the C computer language. The C code used to obtain the results presented in this Letter is made freely available to the public, subject to nonprofit conditions, and is published on our Website [8]. The five phase unwrapping algorithms mentioned above were executed on a host computer platform with a Pentium 4 processor with clock speed of 2 GHz, and 4 Gbytes of RAM. The execution times for these five algorithms were measured by processing the entire 512 ⫻ 512 ⫻ 25 voxel phase volume for the RANDO phantom on this computing platform. The execution times for the Huntley, Cusack, 3D best path techniques, and the proposed algorithm were of the order of 30 s, whereas the execution time for the Prelude algorithm was of the order of 3 days. As a conclusion, we have presented a 3D phase unwrapping algorithm that combines the dual useful features of high speed and robustness.
Fig. 4. (a) Source wrapped-phase maps, produced by Fourier fringe analysis of fringe patterns projected onto the head of a radiotherapy RANDO phantom; (b)–(f) show a selection of different unwrapped-phase maps that have been produced by application of the following respective unwrapping algorithms: (b) Cusack’s algorithm, (c) the Prelude algorithm, (d) Huntley’s algorithm, (e) the author M. Gdeisat’s best path algorithm, and (f) the proposed algorithm.
Prelude algorithm [4], Huntley’s algorithm [5], present author M. Gdeisat’s best path algorithm that uses the second difference quality map method [3], and the proposed algorithm are shown in rows (b), (c), (d), (e), and (f), respectively. As the figure shows, Cusack’s algorithm and the author’s best path algorithm both give very poor results. Huntley’s algorithm is still robust at dealing with noise, but ambiguities in the singularity loops have produced an
This work has been partially supported by the Spanish Ministry of Education and FEDER through projects TIN2006-12890 and Consolider Ingenio 2010 CSD2007-00018. References 1. D. C. Ghiglia and M. D. Pritt, Two-Dimensional Phase Unwrapping: Theory, Algorithms and Software (Wiley, 1998). 2. R. Cusack and N. Papadakis, Neuroimage 16, 754 (2001). 3. H. S. Abdul-Rahman, M. A. Gdeisat, D. R. Burton, M. J. Lalor, F. Lilley, and C. Moore, Appl. Opt. 46, 6623 (2007). 4. M. Jenkinson, Magn. Reson. Med. 49, 193 (2003). 5. J. M. Huntley, Appl. Opt. 40, 3901 (2001). 6. M. F. Salfity, P. D. Ruiz, J. M. Huntley, M. J. Graves, R. Cusack, and D. A. Beauregard, J. R. Soc. Interface 3, 415 (2006). 7. A. Hooper and H. A. Zebker, J. Opt. Soc. Am. A 24, 2737 (2007). 8. “Phase unwrapping,” http://www.ljmu.ac.uk/GERI/ 90202.htm.