簡體   English   中英

如何將捕獲轉換為圖像 <Bgr,Byte> 使用Emgu庫

[英]How to convert Capture to Image<Bgr,Byte> using Emgu library

我正在努力使用C#中的Emgu庫將Capture隱藏成Image。 我知道Emgu網站上有一些代碼示例,但這些示例不涉及相機捕獲。 我想對相機的鏡框進行一些處理。

這是我到目前為止的內容:

Capture capture = null;
capture = new Capture(); //create a camera capture
capture.SetCaptureProperty(Emgu.CV.CvEnum.CapProp.Fps, 30);
capture.SetCaptureProperty(Emgu.CV.CvEnum.CapProp.FrameHeight, 240);
capture.SetCaptureProperty(Emgu.CV.CvEnum.CapProp.FrameWidth, 320); 
viewer.Image = capture.QueryFrame()
viewer.ShowDialog();

我希望能夠在以下行中使用捕獲:

Image<Gray, Byte> gray = capture.Convert<Gray, Byte>().PyrDown().PyrUp();

謝謝

我認為,如果您有Mat並想要一張Image,可以執行以下操作:

Image<Bgr, Byte> img = new Image<Bgr, Byte>(theMat.Bitmap);

道格

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM