如何使用 Emgu 库将 Capture 转换为 Image<Bgr,Byte>
How to convert Capture to Image<Bgr,Byte> using Emgu library
我正在努力使用 C# 中的 Emgu 库将捕获转换为图像。我知道 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<Bgr, Byte> img = new Image<Bgr, Byte>(theMat.Bitmap);
道格
我正在努力使用 C# 中的 Emgu 库将捕获转换为图像。我知道 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<Bgr, Byte> img = new Image<Bgr, Byte>(theMat.Bitmap);
道格