Img_mat is a 3-channel image. Each channel consists of uchar pixel uchar in a data type. Thus, using split(Img_mat, BGR) Img_mat divided into 3 planes: blue, green and red, which are stored together in the BGR vector. Thus, BGR[0] is the first (blue) plane with uchar data uchar ... therefore, it will be
int dataB = (int)BGR[0].at<uchar>(i,j); int dataG = (int)BGR[1].at<uchar>(i,j);
soon...
rotating_image
source share