2012-09-03 43 views
1

任何想法如何將Image類型轉換爲Image<Bgr, Byte>類型?如何將圖片類型轉換爲圖片<Bgr, Byte>?

我從PictureBox得到圖像控制,我需要將它轉換爲Image<Bgr, Byte>類型。

Image pictureBoxImage = pictureBox.Image; 
Image<Bgr, Byte> image = // ... 
+4

什麼是'Imgae','Bgr'和'Imgae < Bgr,Byte >'? –

+0

我可以建議您閱讀文檔嗎? http://www.emgu.com/wiki/index.php/Working_with_Images – Liam

回答

3

根據documentation

從位圖

創建圖像

也可以創建從.NET Bitmap對象的Image<TColor, TDepth>

所以,你應該可以做到:

var image = new Image<Bgr, Byte>(new Bitmap(pictureBox.Image));