用cvSet2D即可得到图片的RGB值。
CvScalar s;
for(y = 0; y < img->height; y++) {
for(x = 0; x < img->width; x++) {
s = cvGet2D(img, y, x);
}
}