1 | initial version |
Mat img=imread("<<filename>.<extension>>",CV_LOAD_IMAGE_COLOR);
int i=;//row pixel co-ordinate;
int j= ;//coloumn pixel co-ordinate;
Vec3f intensity = img.at<Vec3b>(i,j);
float blue=intensity.val[0];
float green=intensity.val[1];
float red=intensity.val[2];
the variables blue,green and red contains the BGR value.
2 | No.2 Revision |
Mat img=imread("<<filename>.<extension>>",CV_LOAD_IMAGE_COLOR);
int i=;//row pixel co-ordinate;
int j= ;//coloumn pixel co-ordinate;
Vec3f Vec3b intensity = img.at<Vec3b>(i,j);
float blue=intensity.val[0];
float green=intensity.val[1];
float red=intensity.val[2];
the variables blue,green and red contains the BGR value.