Unwraps phased images by path following
[unwrapped_phase,jumps] = unwrapp(image,merit_function, ... [line_start,column_start,threshold])
If these parameters are not specified, the function will search the best point (=the point with the lowest merit function) in a sqarre around the center of the image.
Default = 0.5
For an explanation on phased images, have a look at the help of the function unwrapl.
This function uses an algorithm of "path following" to unwrapp the phase: The idea is to unwrapp non ambiguous pixels first. Here are some details:
1) the quality of each pixel is estimated by a "merit function". Most often, the "merit function" will be variance (function "imvariance"), but you could try others functions like laplacien. A good quality pixel has a low merit function.
2) We begin from a point of good quality. It is called "integrator point".
3) we rely it to its best quality neighbour, which becomes the new "integrator point".
4) If the difference between phases of the 2 points is higher (or lower) than a threshold (=0.5 by default), then we consider there's a phase jump.
5) we continue until all points are treated.
How to ignore some points ? You can decide that some points are so unsure that you prefer to simply ignore them. This can be done by affecting them a merit function >= 3000.
Note about the "jumps" matrix: it is a matrix containing only the number of jumps needed to re-establish phase continuity: unwrapped_phase=image+jumps;
stacksize(4e7); pw=imread(SIPDIR+'images/photonics/pyramide_wrapped.jpg'); //phase wrapped mf=imvariance(pw);//calculate a "merit function" //you could try also: mf=imconv(a,mkfilter('laplace1')); [puw,jumps]=unwrapp(pw,mf); xset("window",1);clf;xselect();imshow(normal(puw,1,0)); xtitle("unwrapped phase"); xset("window",2);clf;plot3d1(1:8:size(puw,'r'),1:8:size(puw,'c'),puw(1:8:$,1:8:$)) |
"techniques automatiques de raccordement de phase"
David VENET, Memoire de l'universite de Lausanne.
http://siptoolbox.sourceforge.net