Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

answered Feb 7 '15

jamesnzt gravatar image
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.

click to hide/show revision 2
No.2 Revision

updated Feb 7 '15

berak gravatar image
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.