- 获取图像处理类的指针
- 将图像载入处理类
- 计算
- 获取结果
获取图像处理类指针采用
extern "C" DLL_EXPORT ImgProcess *get_process()
载入图像
extern "C" DLL_EXPORT void set_image(ImgProcess *self, unsigned char * image, size_t length)
{
vector<unsigned char> data(image, image+length);
cv::mat image = cv::imdecode(data);
....
}
计算,根据type类型来计算结果
extern "C" DLL_EXPORT void compute(ImgProcess *self, size_t type)
获取绘制后的图像
extern "C" DLL_EXPORT void get_draw(ImgProcess *self, char *image)