Is there any function in OpenCV or Emgu CV desktop capture options? (addons, libs, classes)

给你一囗甜甜゛ 提交于 2021-02-07 09:07:07

问题


Is there any function in OpenCV or Emgu CV desktop capture options? (addons, libs, classes) So I know we can capture camera in a very easy way, is there any option for desktop capturing that way?


回答1:


I would recommend doing a screen capture outside of Emgu (ie, in non-Emgu C++/C#).

The first step is to create a bitmap from the screen image. There are plenty of websites detailing methods of how to do this. I found this one helpful.

Once you have a bitmap, it's easy to create new Emgu Image<,> from it. Here's the documentation for that.

Good luck, and have fun!




回答2:


This solution is also one outside of emgucv: you can also use the c sharp System.Drawing.Graphics.CopyFromScreen

Bitmap bitmap = new Bitmap(Screen.PrimaryScreen.Bounds.Width, Screen.PrimaryScreen.Bounds.Height);
Graphics graphics = Graphics.FromImage(bitmap as Image);
graphics.CopyFromScreen(0, 0, 0, 0, bitmap.Size);


来源:https://stackoverflow.com/questions/3223159/is-there-any-function-in-opencv-or-emgu-cv-desktop-capture-options-addons-lib

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!