質問です。
8ビット1チャンネルの画像の場合、
1ピクセル(x,y)は
((uchar)( img->imageData + img->widthStep*y))[x];
で表現されるのでしょうか?
8ビット3チャンネルの画像の場合は、
1ピクセル(x,y)は、
((uchar)( img->imageData + img->widthStep*y))[x*3];B
((uchar)( img->imageData + img->widthStep*y))[x*3+1];G
((uchar)( img->imageData + img->widthStep*y))[x*3+2];R
で表現されてましたけれども。