OPENCV桌面捕获 [英] OPENCV Desktop Capture

查看:593
本文介绍了OPENCV桌面捕获的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何要在OpenCV中捕获桌面(即将位图转换为Mat)?



您好,



任何人都可以向我解释我将如何使用这个代码在OpenCV捕获桌面屏幕?我一直试图让它工作大约30-45分钟,但我的屏幕上没有捕获任何东西,当我运行它。



在我的应用程序从主我有以下三个语句

  HWND hwndDesktop = GetDesktopWindow 
hwnd2mat(hwndDesktop);
imshow(output,src);

我调用上面的链接中找到的函数hwnd2mat。

解决方案

/ div>

您似乎忘了捕获 hwnd2mat()的返回:

  HWND hwndDesktop = GetDesktopWindow(); 
Mat src = hwnd2mat(hwndDesktop);
imshow(output,src);
waitKey(0);


How to capture the desktop in OpenCV (ie. turn a bitmap into a Mat)?

Hello,

Can anyone explain to me how I would use this code in OpenCV to capture the desktop screen? I've been trying to get it to work for about 30-45 minutes but my screen doesn't capture anything when I run it.

In my application from main I have the follow three statements

HWND hwndDesktop = GetDesktopWindow();
hwnd2mat(hwndDesktop);
imshow("output", src);

i'm calling the function hwnd2mat that is found in the link above. i'm a noob.

Thanks to anyone who answers.

解决方案

It seems you forgot to capture the return of hwnd2mat():

HWND hwndDesktop = GetDesktopWindow();
Mat src = hwnd2mat(hwndDesktop);
imshow("output", src);
waitKey(0);

这篇关于OPENCV桌面捕获的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆