opencv Mat中某点的值

Mat mat = imread("baby.jpg");
    
Mat p = mat.col(20).row(20);
uchar* ptr = (uchar*) p.data;
int B = ptr[0];
int G = ptr[1];
int R = ptr[2];
cout<<"res:"<<B<<" "<<G<<" "<<R<<" "<<endl;

 

posted @ 2017-05-04 14:31  Wenism  阅读(2124)  评论(0编辑  收藏  举报