テストに成功
コンポーネントpybind11が必要です
Python呼び出し:
#-*- coding:utf-8 -*-
import dahua_sdk
import time
import numpy as np
import cv2
import datetime
start=time.time()
t2=0
start2=datetime.datetime.now()
def m_callback(value):
global start
global start2
print('callback',value)
return 0
# print('callback ok',a)
aaa= dahua_sdk.add(2,3, m_callback)
print(aaa)
name=b"liasd"
cardID=b"card001"
dahua_sdk.add_person(cardID,name)
# vp= binddemo.add(1280, 720, aaa)
c ++部分
/ dahua_sdk.cpp : 此文件包含 "main" 函数。程序执行将在此处开始并结束。
//
#include "pch.h"
#include <iostream>
#include <windows.h>
#include "dhnetsdk.h"
#include <time.h>
#include <pybind11/pybind11.h>
#include <pybind11/numpy.h>
using namespace std;
namespace py = pybind11;
int gettimeofda