使用opencv 写了个算法,但是类中包含 Mat Net类型,头文件直接删除这些会内存越界
所以用了如下链接中回答里的方法,建了一个静态类,直接接口调用静态类中的成员函数
#define DLLIMPL
#include "api.h"
#include "ocr.h"
static ocr ocr_;
void interface(int x){
ocr_.interface(x);
}
class ocr
{
private:
Net a;
int b;
public:
ocr(){} //a = readNetFromONNX("./1.onnx")
~ocr(){}
void interface(int x); //b = x;接口
void func1(string c); //无用方程,隐藏
}
我一看就知道是你了。教了你很多次,你还这样搞,不出错就怪。先把基础学了,再说吧,不然别人费尽口水都没有意义。
哈哈哈