我有一个共享库(util.so),它将以下内容返回给 python:
cv::Mat toCvMat(PyObject *ndArrayObj) {
// return cv::Mat
}
我使用以下命令从我的 python 脚本中调用该方法:
Python:
testMat = util.toCvMat(orig_frame_gray_img)
当我将它传递给我的其他测试库 (test_library.so) 时,它作为 PyObject* 传递,我如何访问我的 test_library.so 中的 cv::Mat?:
Python:
test_library.process(testMat)
C++
bool TestLibrary::Process( PyObject* pTestImg)
{
// How to get cv::Mat from pTestImg?
}
目前,我的 test_library 没有与 util 链接,它们是单独的 .so 文件。