Fast two-dimensional phase-unwrapping

Fast two-dimensional phase-unwrapping algorithm
based on sorting by reliability following
a noncontinuous path
Miguel Arevallilo Herráez, David R. Burton, Michael J. Lalor, and Munther A. Gdeisat
We describe what is to our knowledge a novel technique for phase unwrapping. Several algorithms
based on unwrapping the most-reliable pixels first have been proposed. These were restricted to
continuous paths and were subject to difficulties in defining a starting pixel. The technique described
here uses a different type of reliability function and does not follow a continuous path to perform the
unwrapping operation. The technique is explained in detail and illustrated with a number of examples.
© 2002 Optical Society of America
OCIS codes: 100.0100, 120.0120, 070.0070.
1. Introduction
It is commonly the case in fringe-pattern analysis
that the phase is obtained by means of an expression
involving the arctangent function. This mathematical function returns values that are known between
the limits ⫹␲ and ⫺␲. Hence the result is given
modulo 2␲ and discontinuities with values near to 2␲
appear in the phase distribution. Unwrapping is
the procedure by which these discontinuities are resolved, the result is converted into the desired continuous phase function.1
The unwrapping problem has been a major topic of
research for over a decade.2 Many different algorithms do exist, but a correct solution is by no means
guaranteed, and long execution times are often involved. At first sight, phase unwrapping seems a
relatively simple problem but, when working with
real images, procedures have to be designed to deal
with many different issues. Discontinuities in the
phase wraps, under sampling in local areas, high
local variations of signal-to-noise ratios, and masked
M. A. Herráez is with the Computing School, Mediterranean
University of Science and Technology, Edificio Galileo Galilei,
Avda. de los Naranjos s兾n. Valencia, Spain. E-mail: miguel@
must-es.com. D. R. Burton, M. J. Lalor, and M. A. Gdeisat are
with the Coherent and Electro-Optics Research Group, School of
Engineering, Liverpool John Moores University, Byrom Street,
Liverpool, L3 3AF, United Kingdom. E-mail: d.r.burton@
livjm.ac.uk, [email protected], [email protected].
Received 2 May 2002; revised manuscript received 31 July 2002.
0003-6935兾02兾357437-08$15.00兾0
© 2002 Optical Society of America
areas are some of the problems that an unwrapper
has to overcome.
Many phase-unwrapping algorithms have been
proposed in the past to improve the noise immunity of
the unwrapping algorithms. These algorithms can
be classified as follows:3 共1兲 Global algorithms, 共2兲
region algorithms, and 共3兲 path-following algorithms.
The global algorithms formulate the unwrapping
algorithm in terms of minimization of a global function.4 All the algorithms in this class are known to
be robust but computationally intensive.3,5
The region algorithms divide the image into regions. Each region is processed individually, and
then the processed regions are unwrapped with respect to each other to form larger regions until the
whole image is processed. The region algorithms
can be subclassified into two groups: the tilebased3,6,7 algorithms and the region-based5,8,9 algorithms. The
region
algorithms
provide
a
compromise between the robustness and the computational intensity.9
The path-following algorithms class can be subclassified into three groups.3 共1兲 path-dependent methods, 共2兲 residue-compensation methods, and 共3兲
quality guided path methods.
The simplest algorithm between the pathdependent methods is the Schafer and Oppenheim’s
unwrapper.10 This group includes spiral and multiple scan direction methods.1 These methods detect
the position of edges or abrupt phase steps in an
image and use this information to calculate running
phase offsets. These algorithms are usually fast but
10 December 2002 兾 Vol. 41, No. 35 兾 APPLIED OPTICS
7437
are unable to handle noisy images because of the
fixed data evaluation order.
The residue compensation algorithms search for
residues in an image and generate cuts between positive and negative residues.11 These algorithms are
generally computationally efficient but not robust.5
The quality guided path algorithms depend on unwrapping the highest-quality pixels with the highestreliability values first and the lowest-quality pixels
that have the lowest-reliability values last to prevent
error propagation. The unwrapping path is determined by use of the pixels’ reliability.12–19 Even
though some unwrapping errors can remain undetected and propagate in a manner that depends on the
unwrapping path, the algorithms are surprisingly robust in practice.2 Also, these algorithms are generally computationally efficient.5 The proposed
algorithm falls into this category.
The proposed unwrapping algorithm follows discrete paths as will be explained in Section 2, while the
unwrapping algorithms in Refs. 12–19 tend to follow
a continuous path. These unwrapping algorithms
tend to unwrap pixels with the best reliability values
that are neighbors to the integrator pixel.
2. Algorithm
Fig. 1. Calculation of the second differences in an image.
j ⫹ 1兲, and 共i ⫹ 1, j ⫹ 1兲 pixels are called diagonal
neighboring pixels. The second difference D of an
共i, j兲 pixel can be calculated by the equation:
D共i, j兲 ⫽ 关H 2 共i, j兲 ⫹ V 2共i, j兲 ⫹ D 12共i, j兲
⫹ D 22 共i, j兲兴 1兾2 ,
where
H共i, j兲 ⫽ ␥关␸共i ⫺ 1, j兲 ⫺ ␸共i, j兲兴
In quality guided path unwrapping algorithms there
are two main issues: the choice of the reliability
function and the design of the unwrapping path.
These two issues are explained from the perspective
of the proposed algorithm.
A.
V共i, j兲 ⫽ ␥关␸共i, j ⫺ 1兲 ⫺ ␸共i, j兲兴
⫺ ␥关␸共i, j兲 ⫺ ␸共i, j ⫹ 1兲兴
Reliability Function
Quality guided path unwrapping algorithms use different criterion to determine the reliability of a point.
This criterion is usually based upon the gradients or
differences between a pixel and its neighbors. Those
points with the lowest module 2␲ gradients with respect to their neighbors are determined to be the best
points and, therefore, are processed first.15
The use of the absolute value of the gradients in the
reliability function has a number of disadvantages.
If a high carrier value is present 共compared with the
modulation of the fringe pattern兲, the carrier becomes
the major modulation component. However, a low
carrier value would increase or decrease the values of
the gradients depending on the pixel of the image,
and produce a nonappropriate measurement for reliability.
Second differences would provide a measurement
for the degree of concavity兾convexity of the phase
function. By use of second differences a better detection of possible inconsistencies in the phase map is
provided.16
The calculation of second differences for pixels in
an image can be explained with the aid of Fig. 1. To
calculate the second difference for a pixel in an image,
the values of its orthogonal and diagonal neighbors’
in a 3 ⫻ 3 window are required. The pixels 共i, j ⫺ 1兲,
共i, j ⫹ 1兲, 共i ⫺ 1, j兲, and 共i ⫹ 1, j 兲 that are neighbors
to the 共i, j兲 pixels are called orthogonal neighboring
pixels. Whereas 共i ⫺ 1, j ⫺ 1兲, 共i ⫹ 1, j ⫺ 1兲, 共i ⫺ 1,
7438
⫺ ␥关␸共i, j兲 ⫺ ␸共i ⫹ 1, j兲兴
APPLIED OPTICS 兾 Vol. 41, No. 35 兾 10 December 2002
D 1共i, j兲 ⫽ ␥关␸共i ⫺ 1, j ⫺ 1兲 ⫺ ␸共i, j兲兴
⫺ ␥关␸共i, j兲 ⫺ ␸共i ⫹ 1, j ⫹ 1兲兴
D 2共i, j兲 ⫽ ␥关␸共i ⫺ 1, j ⫹ 1兲 ⫺ ␸共i, j兲兴
⫺ ␥关␸共i, j兲 ⫺ ␸共i ⫹ 1, j ⫺ 1兲兴 ,
(1)
where ␥共⵺兲 is a simple unwrapping operation to remove any 2␲ steps between two consecutive pixels.
The second differences can be calculated for all
pixels in an image except the borders. The second
differences D of the pixels at the borders of the image
are set to infinity to be resolved last as will be explained in the following subsection.
The reliability R of a pixel is defined as
R⫽
1
.
D
(2)
Consequently, pixels are more reliable as their second differences are lower.
B.
Unwrapping Path
An edge is an intersection of two pixels that are connected horizontally or vertically. Any pixel with its
left hand side, right hand side, upper, or lower neighboring pixel can construct an edge. Figure 2共a兲
shows a part of an image whose pixels’ reliabilities
are shown in the figure. Every two orthogonal
neighboring pixels can produce an edge as shown in
Fig. 2. Numerical example of the proposed algorithm. (Continues on next page.)
Fig. 2共b兲. The reliability of an edge is defined as the
summation of the reliabilities of the two pixels that
the edge connects as illustrated in Fig. 2共b兲. Edges
can be classified as horizontal edges that appear in a
green color in the figure and vertical edges, which are
colored in red.
An unwrapping path cannot be defined relative to
the reliability of the pixels. Instead, it is defined by
looking at the value of the reliability of the edges.
The definition of the unwrapping path is relatively
simple: Those edges with higher reliability are unwrapped first. The edges are stored in an array and
sorted by value of reliability. The edges with a
higher reliability are resolved first.
Figures 2共c兲–2共j兲 illustrate the principle of the proposed algorithm. Suppose that we want to unwrap
the pixels whose reliability values are shown in Fig.
2共a兲 using the proposed algorithm. The edges that
can be constructed and their reliability values are
shown in Fig. 2共b兲.
Initially all the pixels are considered not belonging
to any group. In Fig. 2共c兲, pixels f and g are unwrapped first with respect to each other because the
edge that connects them has the highest reliability
value. Both pixels belong to the same group, and
this is illustrated by coloring them the same color.
Then the unwrapping operation of pixels a and b is
carried out, and both pixels construct a second group.
The unwrapping of pixels i and j follows, and they
construct a third group.
Figures 2共c兲 and 2共d兲 show that the edge that connects pixels a and e has the fourth highest value, and
10 December 2002 兾 Vol. 41, No. 35 兾 APPLIED OPTICS
7439
Fig. 2. (Continued.)
the two pixels that construct the edge should be unwrapped with respect to each other. But pixel a is
already unwrapped with respect to pixel b, and both
pixels belong to the same group. To unwrap pixel e,
the 2␲ multiples required to be added兾subtracted to
unwrap pixel e is calculated and added兾subtracted
from pixel e. Pixels a, b, and e are now considered to
belong to the same group, and they are given the
same color as shown in Fig. 2共d兲.
Figures 2共e兲 and 2共f 兲 illustrate the unwrapping of
two groups with respect to each other. The first
group consists of the pixels a, b, and e; whereas the
second group contains i and j pixels. Both groups
are connected by a vertical edge whose reliability
value is higher than or equal to the reliability values of the other unprocessed edges. Both groups
should be unwrapped with respect to each other.
The second group contains a smaller number of pixels, so the multiples of 2␲ of the difference between
one of the pixels in the first group and one of the
pixels in the second group is calculated. The 2␲multiples value is then added to or subtracted from
all the pixels in the group that contains the smaller
number of pixels. The five pixels are joined together
and are now considered to belong to the same group.
The five pixels are given the same color as shown in
Fig. 2共f 兲. The proposed algorithm proceeds as
shown in Fig. 2 until all the pixels are unwrapped.
The unwrapping path is discrete and therefore, the
7440
APPLIED OPTICS 兾 Vol. 41, No. 35 兾 10 December 2002
unwrapping operation is local. This is a major difference when compared to the Quiroga et al. algorithms.15,16 This can be demonstrated in Fig. 2共d兲,
where the pixels l and q are unwrapped with respect to each other, and they are disconnected from
the rest of the unwrapped pixels 共a, b, e, f, g, i, and
j pixels兲.
In the unwrapping process, three cases are possible:
1. Both pixels have not been unwrapped before.
The pixels are unwrapped with respect to each other
and gathered into a single group of unwrapped pixels.
2. One of the pixels has been processed before
共and therefore belongs to a group of unwrapped pixels兲 but the other has not 共does not belong to any
group兲. The pixel that has not been processed before
is unwrapped with respect to the other pixel and
added to the second pixel’s group.
3. Both pixels have been processed before. If
they do not belong to the same group, the two groups
need to be unwrapped with respect to each other.
The smallest group is unwrapped with respect to the
largest group. This operation involves unwrapping
the pixel belonging to the smallest group with respect
to the other pixel and adding the same constant that
is added to the pixel to the rest of the smallest group.
Finally, both groups are joined together into a single
new group.
Fig. 3. Flow chart of the proposed algorithm.
A flow chart that describes the operation of the
proposed algorithm is shown in Fig. 3.
The reliability function may be modified, and lowreliability points may cause problems in the final
result. It may be better to ignore intersections with
very low reliability values and interpolate these after
unwrapping is complete.
3. Simulated and Experimental Results
A.
Simulated Results
The proposed algorithm has been tested by use of
simulated images. All images depicting wrapped
phases in the range 关⫺␲, ␲兴 are scaled between black
and white for display. Unwrapped phase images
10 December 2002 兾 Vol. 41, No. 35 兾 APPLIED OPTICS
7441
Fig. 4. Unwrapping of a simple simulated wrapped phase distribution: 共a兲 wrapped phase distribution 共b兲 unwrapped phase distribution.
are also scaled between black and white to cover the
full dynamic range.
Figure 4共a兲 shows a very high quality wrapped
phase distribution with no noise and no physical discontinuities present. This image has been used to
test the proposed algorithm under ideal conditions.
Figure 4共b兲 shows the resulting unwrapped phase.
Figure 5共a兲 shows a simulated wrapped phase distribution in which there is no noise in the body of the
phase, but there is a small central area that contains
only random noise. The purpose of this data set is to
test the unwrapper’s ability to isolate this noise and
prevent it from corrupting the unwrapping of the
good data. Figure 5共b兲 shows the resulting unwrapped phase map.
B.
Experimental Results
Figure 6共a兲 shows a wrapped phase map resulting
from the analysis of a real fringe pattern. The
wrapped phase map contains corrupted areas that
result from a shadow of the projected fringes. The
wrapped phase map has been unwrapped by use of
the proposed algorithm. The unwrapped phase map
is shown in Fig. 6共b兲, which indicates that the algorithm was capable of unwrapping the unreliable re-
gions last to prevent error propagation. The
algorithm copes well with these problems and successfully unwraps the image.
Figure 7共a兲 presents a noisy wrapped phase map
that is corrupted by salt-and-pepper noise. The image has been unwrapped by use of the proposed algorithm, and the unwrapped phase map is shown in
Fig. 7共b兲. A three-dimensional representation of the
unwrapped phase map is shown in Fig. 7共c兲. The
wrapped phase map shown in Fig. 7共a兲 has been unwrapped by use of Schafer and Oppenheim’s unwrapping algorithm,10 and the unwrapped phase map is
shown in Fig. 7共d兲.
The dynamic range of the unwrapped phase map
can be much larger than the dynamic range of the
wrapped phase map. The displaying of the unwrapped phase map by scaling it between black and
white is not always indicative of the unwrapping process being performed correctly. Therefore following
Ghiglia and Romero’s method,4 we rewrapped the
unwrapped phase map to permit a direct comparison
with the wrapped image. This rewrapping is visually convincing that the unwrapping is qualitatively
correct.
Figure 8 shows the rewrapped phase map of the
unwrapped phase map shown in Fig. 7共b兲. Figs. 7共a兲
and 8 show a good agreement between the wrapped
and the rewrapped phase maps, which demonstrates
that the proposed algorithm unwrapped the wrapped
phase map successfully.
The execution time of the proposed algorithm varies from image to image and depends on the particular phase distribution being analyzed. The tested
images are 512 ⫻ 512 pixels in size. The proposed
algorithm has been executed on a PC system. The
PC contains dual Pentium III processors that run at
1 GHz clock speed. The memory on this PC is 512
Mbyte Rambus RAM. The execution time is in the
order of half a second on average. The execution
Fig. 5. Unwrapping of a simple simulated wrapped phase distribution with a noisy area: 共a兲 wrapped phase distribution, 共b兲 unwrapped
phase distribution.
7442
APPLIED OPTICS 兾 Vol. 41, No. 35 兾 10 December 2002
Fig. 6. Unwrapping of a wrapped phase distribution obtained from a real fringe pattern. The region crossing the image is a product of
its shadow: 共a兲 wrapped phase distribution. 共b兲 unwrapped phase distribution.
Fig. 7. Unwrapping of a wrapped phase distribution obtained from the measurement of a human face: 共a兲 wrapped phase distribution,
共b兲 unwrapped phase distribution, 共c兲 three dimensional representation of the resulting phase, 共d兲 result obtained with the linear scanning
procedure.
10 December 2002 兾 Vol. 41, No. 35 兾 APPLIED OPTICS
7443
5.
6.
7.
8.
9.
10.
Fig. 8. Rewrapped phase map.
time to unwrap the image shown in Fig. 7共a兲 is 0.65
seconds.
11.
12.
13.
4. Conclusions
A fast, reliable two-dimensional unwrapper has been
proposed, described, and tested. The algorithm,
based on unwrapping points with higher reliability
values first following a noncontinuous path, produces
consistent results when discontinuities or noisy areas
are present.
14.
15.
16.
References
1. D. Robinson, “Phase unwrapping methods,” in Interferogram
Analysis: Digital Fringe Pattern Measurement Techniques,
W. R. Robinson and G. T. Reid, eds., 共Institute of Physics
Publishing, Bristol and Philadelphia, 1993兲, pp. 194 –229.
2. D. C. Ghiglia and M. D. Pritt, Two-Dimensional Phase Unwrapping: Theory, Algorithms, and Software 共Wiley, New
York, 1998兲.
3. A. Baldi, “Two-dimensional phase unwrapping by quad-tree
decomposition,” Appl. Opt. 40, 1187–1194 共2001兲.
4. D. C. Ghiglia and L. A. Romero, “Robust two-dimensional
7444
APPLIED OPTICS 兾 Vol. 41, No. 35 兾 10 December 2002
17.
18.
19.
weighted and unweighted phase unwrapping that uses fast
transforms and iterative methods,” J. Opt. Soc. Am. A 11,
107–117 共1994兲.
K. M. Hung and T. Yamada, “Phase unwrapping by regions
using least-squares approach,” Opt. Eng. 37, 2965–2970
共1998兲.
M. Arevallilo Herráez, D. R. Burton, and D. B. Clegg, “Robust,
simple, and fast algorithm for phase unwrapping,” Appl. Opt.
35, 5847–5852 共1996兲.
P. Stephenson, D. R. Burton, and M. J. Lalor, “Data validation
techniques in a tiled phase unwrapping algorithm,” Opt. Eng.
33, 3703–3708 共1994兲.
J. J. Gierloff, “Phase unwrapping by regions,” in Current Developments in Optical Engineering II, R. E. Fischer and W. J.
Smith, eds., Proc. SPIE 818, 2–9 共1987兲.
P. G. Charette, and I. W. Hunter, “Robust phase-unwrapping
method for phase images with high noise content,” Appl. Opt.
35, 3506 –3513 共1996兲.
R. W. Schafer, and A. V. Oppenheim, Digital Signal Processing
共Prentice-Hall, Englewood Cliffs, N.J., 1975兲, pp. 507–511.
J. M. Huntley, “Noise-immune phase unwrapping algorithm,”
Appl. Opt. 28, 3268 –3270 共1989兲.
O. Y. Kwon, D. M. Shough, R. A. Williams, “Stroboscopic
phase-shifting interferometry,” Opt. Lett. 12, 855– 857 共1987兲.
J. Schörner, A. Ettemeyer, U. Neupert, H. Rottenkolber, C.
Winter, and P. Obermeier, “New approaches in interpreting
holographic images,” Opt. Lasers Eng. 14, 283–291 共1991兲.
H. A. Vrooman and A. M. Maas, “Image processing algorithms
for the analysis of phase-shifted speckle interference patterns,” Appl. Opt. 30, 1636 –1641 共1991兲.
J. A. Quiroga and E. Bernabeu, “Phase unwrapping algorithm
for noisy phase-map processing,” Appl. Opt. 33, 6725– 6731
共1994兲.
J. A. Quiroga, A. Gonzalez-Cano, and E. Bernabeu, “Phase
unwrapping algorithm based on adaptive criterion,” Appl. Opt.
34, 2560 –2563 共1995兲.
Y. Xu and C. Ai, “Simple and effective phase unwrapping
technique,” Interferometry IV: Techniques and Analysis,
Proc. SPIE 30, 254 –263 共1991兲.
H. Lim, W. Xu, and X. Huang, “Two new practical methods for
phase unwrapping,” IEEE Trans. Geosci. Remote Sens.
IGARSS’95 33, Firenze, Italy, 196 –198 共1995兲.
W. Xu, and I. Cumming, “A region-growing algorithm for InSAR phase unwrapping,” IEEE Trans. Geosci. Remote Sens.
IGARSS’96 34, Lincoln, Nebraska, USA, 2044 –2046 共1996兲.