在 Python 中使用 OpenCV 相位展开函数

Using the OpenCV Phase Unwrapping Function in Python

我想使用 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 提供的 OpenCV 相位展开函数,因此在 Python 和 C# 中使用相同的 OpenCV 函数比使用 Numpy 展开函数和重写更好它在 C# 中。有没有人能够在 C++ 之外成功使用 OpenCV 相位展开函数?

我在 C++ 中使用了相位展开模块。对于 Python,我发现此模块在 Ubuntu 20.04 和 Fedora 31 的 cv2 命名空间中可用。

您使用的是哪个发行版?

我发现,如果我pip install opencv-contrib-python,那么我可以使用以下功能,这些功能在我安装opencv contrib之前是不可用的

cv2.phase_unwrapping_HistogramPhaseUnwrapping()

cv2.phase_unwrapping_PhaseUnwrapping()

我相信这些就是我要找的,所以我之前找不到它们的原因是它们 were/are 仍然是 contrib 模块。请注意,我使用的是 OpenCV 4.2.0 版。