#include #include #include #include "StitchStruct.h" // 包含 API_UnderStitch 的定义 #include "API_UnderStitch.h" using namespace cv; namespace py = pybind11; // 导出的 C++ 函数 std::string greet(const std::string &name) { return "Hello, " + name + "! pybind11 module loaded successfully!"; } cv::Mat getMat() { return cv::Mat::zeros(3,3,CV_8UC1); } cv::Mat getH(FrameInfo info) { printf("run get H"); auto module = API_UnderStitch::Create(); return module->getHomography(info); } // PYBIND11 模块入口点 PYBIND11_MODULE(simple_test, m) { m.doc() = "***************A minimal pybind11 test module.*****************"; // 绑定 greet 函数 m.def("greet", &greet, "A function that returns a greeting string."); m.def("getMat", &getMat, "A function that returns a greeting string."); m.def("getH",&getH,"getH"); }