现有一个依赖opencv的算法,类成员函数可实现输入输出,但参数中含有mat,private中含有net类型,头文件因此无法摆脱opencv依赖,问:现欲摆脱opencv的头文件和dll依赖,将该dll交付他人使用,是否可以做到将头文件写进cpp中,直接无头文件或者写个头文件接口直接dll和lib调用该类中的算法,以及修改接口中的私有变量参数
class _declspec(dllexport) ocr
{
private:
int crop_mode = 1;
int thresh_mode=1;
int bitwise_mode2 = 0;
double blur1 = 3;
double blur2 = 11;
//int rect_morph_x;
//int rect_morph_y;
int morph_x = 1;
int morph_y = 9;
int iteration = 1;
int canny_max = 300;
int min_width = 8;
int i;//高斯模糊
int flag;
int flag2;
string model_path = "./1.onnx";
Net net;
int rect_thresh = 0;
int blocksize = 31;
int C = 10;
int a = 3;
int c = 5;
int b = -5;
int d = 10;
int softmax_thresh=0.9;
//block,C,threshold
//unsigned char * img
public:
//void ~ocr(){}
//inline
void set_morph(int x, int y, int iter)
{
morph_x = x;
morph_y = y;
iteration = iter;
}
void set_blocksize(int x)
{
blocksize = x;
}
//inline
void set_net(string model_path)
{
net = cv::dnn::readNetFromONNX(model_path);
}
void set_rect_thresh(int x)
{
rect_thresh = x;
}