从图像中获取r,g,b像素
答
下面是你需要得到的RGB值是什么:
//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;
+0
“frame1”从哪里来? – 2013-03-07 13:37:46
+0
@ErnodeWeerd谢谢! – Oliver 2013-03-08 00:17:44
+0
+1什么是Bgr类型?为什么双打他们应该是'int's? – 2013-03-08 00:22:21
我编辑了自己的冠军。请参阅:“[应该在其标题中包含”标签“](http://meta.stackexchange.com/questions/19190/)”,其中的共识是“不,他们不应该”。 – 2013-03-06 18:17:03
不确定,但它看起来像有一个'Data'属性,您可以使用它来直接访问像素。请参阅http://stackoverflow.com/q/15045295/56778 – 2013-03-06 19:23:21