Mehtap Gül
Mehtap Gül

Reputation: 1

Get r,g,b pixel from an image

I am new at image processing and I use emgu cv with c# and I have a problem. How can I get R,G,B pixel value from RGB value from an image?

Upvotes: 0

Views: 5556

Answers (1)

Oliver
Oliver

Reputation: 696

Here's what you need to get the RGB values:

//load image
Image<Bgr, byte> image = new Image<Bgr, byte>("sample.png");

//get the pixel from [row,col] = 24,24
Bgr pixel = image[24, 24];

//get the b,g,r values
double b = pixel.Blue;
double g = pixel.Green;
double r = pixel.Red;

Upvotes: 2

Related Questions