2013-03-06 95 views
0

我是圖像處理新手,我使用emgu cv和c#,並遇到問題。 如何從圖像的RGB值中獲得R,G,B像素值?從圖像中獲取r,g,b像素

+0

我編輯了自己的冠軍。請參閱:「[應該在其標題中包含」標籤「](http://meta.stackexchange.com/questions/19190/)」,其中的共識是「不,他們不應該」。 – 2013-03-06 18:17:03

+0

不確定,但它看起來像有一個'Data'屬性,您可以使用它來直接訪問像素。請參閱http://stackoverflow.com/q/15045295/56778 – 2013-03-06 19:23:21

回答

2

下面是你需要得到的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

相關問題