SIP Toolbox

unwrapl - Unwraps phased images linearly

Calling Sequence

[unwrapped_phase, phase_jumps] = unwrapl(image[,threshold,step,direction])

Parameters

Description

Phased images are obtained in various interferometry domains. The phase (coded in gray levels) is represented as the altitude of each pixel. Because the phase is modulo (2*pi or 1 when working with gray levels), the absolute altitude is not known.

This function unwraps a phased image (gray levels) in the simplest manner: linearly. It works this way:

  • computes a linear matrix: 1st line is read from left to right, 2nd line is read from right to left, etc...

  • compares the gradient to a threshold (0.5 is the default): add or substract 1 to ensure phase continuity.

  • rebuilds a image matrix from the linear matrix

  • step: don't authorize 2 phase jumps which are too close from one another

  • direction: h (horizontal: default) or v (vertical)

  • jumps is the map containing the number of phase jumps

  • Very simple and quite fast algorithm. But very noise sensitive. Images to treat should be of excellent quality.

    For those not familiar with phase unwrapping, I tried to write a very detailed example.

    Examples

       stacksize(1e7); // images are memory-expensive
    
       pw=gray_imread(SIPDIR+'images/photonics/pyramide_wrapped.jpg'); //phase wrapped
    
       xset("window",0); //create a 1st window to display the original image
       xbasc();xselect();imshow(pw);
       xtitle("original wrapped phase")
    
       //we try to show the object in 3D:
       //because of phase jumps, it's not very good
       xset("window",1);//the best of all: in a 3rd window, show the object in 3D
       xbasc();xselect();
       //we take 1 point on 4 to draw the object (faster and more beautifull than
       //drawing all the points)
       plot3d1(1:4:size(pw,'r'),1:4:size(pw,'c'),pw(1:4:$,1:4:$));
       xtitle("original wrapped phase in 3D")
    
       //now we unwrap the phase linearly:
       //In this example we don't need any additionnal parameters
       //because the image is of good quality.
       //be a little patient for this operation
       puw=unwrapl(pw);//phase unwrapped
    
       //and we show the result
       xset("window",2);//show the unwrapped phase in 2D: we have to put it in the 0-1 range
       //to display it properly
       xbasc();xselect();imshow(normal(puw));
       xtitle("unwrapped phase");
    
       xset("window",3);//we can now show the original object in 3D
       xbasc();xselect();
       // Again, we take 1 point on 4 to draw the object
       plot3d1(1:4:size(puw,'r'),1:4:size(puw,'c'),puw(1:4:$,1:4:$));
       xtitle("unwrapped phase in 3D");
       

    Bibliography

    An easy introduction to these problems can be found in "Methods for 2-D phase unwrapping in Matlab" by Jiri Novak.

    A more complete one: "Phase unwrapping algorithms for radar interferometry: residue-cut, least-squares, and synthesis algorithms" by Zebker and Lu (Journal of Optical Society America, vol 15, n3, march 98)

    Authors

    Jocelyn DRUEL <jocelyn.druel1@libertysurf.fr>

    Availability

    The latest version of the Scilab Image Processing toolbox can be found at

    http://siptoolbox.sourceforge.net

    See Also

    unwrapp,  imvariance,  imphase,