You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
38 lines
924 B
38 lines
924 B
|
1 week ago
|
#include <pybind11/pybind11.h>
|
||
|
|
#include <string>
|
||
|
|
#include <opencv2/opencv.hpp>
|
||
|
|
#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");
|
||
|
|
}
|