pythonopencvunwrap

Using the OpenCV Phase Unwrapping Function in Python


I would like to use the OpenCV phase unwrapping functions presented here in Python, but I've been unable to find the function inside the cv2 namespace (this module). Has anyone else used this function outside of C++? I know there is an unwrap function in Numpy, but my goal is to use the OpenCV algorithm inside our production code in C# via the OpenCVSharp Nuget package, so it would be preferable to use the same OpenCV function in Python and C# than to use the Numpy unwrap function and rewrite it in C#. Has anyone been able to successfully use the OpenCV phase unwrapping functions outside of C++?


Solution

  • I discovered that if I pip install opencv-contrib-python, then I have the following functions available, which were not available before I installed opencv contrib

    cv2.phase_unwrapping_HistogramPhaseUnwrapping()

    and

    cv2.phase_unwrapping_PhaseUnwrapping()

    I believe these were the ones I was looking for, so the reason I couldn't find them before is that they were/are still contrib modules. Note that I'm using version 4.2.0 of OpenCV.