I know that in memory opencv represents Mat objects as one big array. So if I have 3 channels mat of dimension 200x200 then In memory it will store this mat in an array of size
You can get values in array like this:
double val = array+ (r*mat.step)+c*mat.channels()+ch;