Sunday, 8 September 2013

Get RGB color values on OpenCV and C#

Get RGB color values on OpenCV and C#

I can't find a solution to a simple problem i have:
In this code:
private void ibOriginal_MouseClick(object sender, MouseEventArgs e)
{
int mouse_get_X = (int)(e.Location.X);
int mouse_get_Y = (int)(e.Location.Y);
Byte byte_color = imgOriginal.Data[mouse_get_X, mouse_get_Y, 0];
}
I want to have an RGB value (in a 3-dimensional array of int) of a pixel
with X,Y coordinates get by a Mouse Click.
Can i make a conversion of "byte_color"? Is it correct?
I can't find anything in C# that can help me, i'm using EmguCV
Many thanks :D

No comments:

Post a Comment