Ask Your Question

Revision history [back]

You have to change the line:

 uint8_t* p = y_channel.data;

to:

float * p = (float*)y_channel.data;

You have to change the line:

 uint8_t* p = y_channel.data;

to:

float * p = (float*)y_channel.data;

and no need to use saturate_cast<>, just do like this:

std::cout << p[i*y_channel.cols + j] << std::endl;