I'm getting this error:
Cannot initialize a variable of type 'unsigned char' with an rvalue of type 'unsigned char *'
when I'm trying to compile my code. I get the error at this line:
unsigned char imgdata = image.data(Glo_x[i][j],Glo_y[i][j]);
and the code in the loop is
unsigned char imgdata = image.data(Glo_x[i][j],Glo_y[i][j]);
int dataset = (int)(imgdata);
int sample_size = pow(filter_width,2);
double mean = mean + dataset/sample_size;
double variance = variance + (dataset - mean) * 2;
var = variance / sample_size; here
I'm really new at coding so please don't judge. The problem is that I want to take the pixel value in the image and use it to calculate the mean. But I have to make the value to an int and I don't know how to do it. Please tell if you don't understand the question.