# Fringe Phase unwrapping

Hi all,

I am just looking for some psuedo code logic for a structured light problem I am working on

Lets suppose the following

- I have calculated a Mat object with all the phase values from three fringe patterns using the following formula for each xy location of the three fringe images (phase_value = atan(sqrt(3.0) * (intensity_phase_n120 - intensity_phase_p120) / (2.0*(intensity_phase_0)-(intensity_phase_n120)-(intensity_phase_p120))) / M_PI), and as such the phases are wrapped
- Assume that each fringe pattern is like the attaced image here
- Assume I know the correct multiple of 2 pi to apply to each of the locations in the phase Mat object so that I can add the appropriate 2 pi jump to unwrap

What does the pseudo code look like to properly unwrap all the phases given all of the above? I presume it's not just a simple case of adding 1 x 2 pi to the first fringe N number, 2 x 2 pi to the second one etc. What else needs to be done in Pseudo code?

Thanks in advance

JT

Suppose I have a Mat object that is filled with phase values that are unwrapped