问题
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