我需要将两个数组 ( int[1024][3]
, int[1024][4]
) 和一个Mat*
(OpenCV 矩阵) 传递给回调函数。
我有这样的结构:
struct data_holder {
Mat* mat;
unsigned int* data[4];
unsigned int* tara[3];
//unsigned int tara[1024][3]; //Previous attempt
//unsigned int data[1024][4];
}
这是我的任务:
Opencv_Button pokus = Opencv_Button(20,40,50,20); //Creating button class instance
pokus.val("Tara"); //Button title
ui.addButton(&pokus); //Adding button to UI
data_holder but_data; //structure
but_data.data = &data; //!!Expression must be a modifiable lvalue!!
but_data.tara = &tara; //For unsigned int data[1024][4] in structure I did ... = data
but_data.mat = &UI_tara;//Matrix assigned with no problems
pokus.setCallback(taraButtonCallback, (void*)&but_data);
那么如何将两个数组和那个 Mat 对象传递给回调函数呢?