【发布时间】:2016-01-18 08:37:20
【问题描述】:
我有一个共享库 (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 文件。
【问题讨论】:
标签: python c++ type-conversion boost-python pyobject