In order to access pixels, there is some ways to do that, for example:
uchar *ptr;
ptr = cvPtr2D (image, x, y);
// for 3 channels image
ptr[0] = 255; // blue
ptr[1] = 0; // red
ptr[2] = 0; // green
ptr[3] = 0; // alpha
the example above you will color your image to Blue. the same way you can read the value as:
BlueValue = ptr[0];
RedValue = ptr[1];
etc….
hope it helps somebody.


