Ask Your Question

Revision history [back]

click to hide/show revision 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.

click to hide/show revision 2
No.2 Revision

updated 2015-02-07 03:06:54 -0600

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.