#include <opencv2/core/core.hpp>
#include <opencv2/highgui/highgui.hpp>
#include <opencv2/imgproc/imgproc.hpp>
struct outdata
{
int in;
int out;
};
int test( Mat frame);
outdata* video_test(char* file_path, int channel, int inNum, int outNum);
Passenger_pyd.cpp
#include<pybind11/pybind11.h>
namespace py = pybind11;
PYBIND11_MODULE(Passenger_pyd, m) {
m.doc() = “pybind11 example module”;
py::class_(m, “outdata”)
.def_readonly(“in_num”, &outdata::in)
.def_readonly(“out_num”, &outdata::out);
// Add bindings here
m.def(“Testframe”, &test, “Test frame”);
m.def(“DetectionTrack”, &video_test, “Detection and Track”);
编译生成.pyd和lib
3、python端(pych