- c - 在位数组中找到第一个零
- linux - Unix 显示有关匹配两种模式之一的文件的信息
- 正则表达式替换多个文件
- linux - 隐藏来自 xtrace 的命令
我正在尝试将我的笔记本电脑相机与 visual studio 2013 opencv 一起使用。这是我的代码:
#include <iostream>
#include <opencv2/core/core.hpp>
#include <opencv2/highgui/highgui.hpp>
#include <opencv2/imgproc/imgproc.hpp>
using namespace cv;
int main(int argc, char** argv)
{
char c = waitKey(1);
Mat img;
VideoCapture vc(0);
while (1)
{
vc >> img;
imshow("test", img);
if (c == 27) //ESc
break;
}
return 0;
}
当我运行代码时,我的相机不会打开,也不会给我任何错误这是我使用 ctrl+alt+dlt 退出时得到的结果:
`Assignment1.exe' (Win32): Loaded 'C:\Users\oulas\Documents\Visual Studio 2013\Projects\Assignment1\Debug\Assignment1.exe'. Symbols loaded.
'Assignment1.exe' (Win32): Loaded 'C:\Windows\SysWOW64\ntdll.dll'. Cannot find or open the PDB file.
'Assignment1.exe' (Win32): Loaded 'C:\Windows\SysWOW64\kernel32.dll'. Cannot find or open the PDB file.
'Assignment1.exe' (Win32): Unloaded 'C:\Windows\SysWOW64\kernel32.dll'
'Assignment1.exe' (Win32): Loaded 'C:\Windows\SysWOW64\kernel32.dll'. Cannot find or open the PDB file.
'Assignment1.exe' (Win32): Loaded 'C:\Windows\SysWOW64\KernelBase.dll'. Cannot find or open the PDB file.
'Assignment1.exe' (Win32): Loaded 'C:\Users\oulas\Documents\Visual Studio 2013\Projects\Assignment1\Debug\opencv_core249d.dll'. Cannot find or open the PDB file.
'Assignment1.exe' (Win32): Loaded 'C:\Users\oulas\Documents\Visual Studio 2013\Projects\Assignment1\Debug\opencv_highgui249d.dll'. Cannot find or open the PDB file.
'Assignment1.exe' (Win32): Loaded 'C:\Windows\SysWOW64\msvcp120d.dll'. Cannot find or open the PDB file.
'Assignment1.exe' (Win32): Loaded 'C:\Windows\SysWOW64\msvcr120d.dll'. Cannot find or open the PDB file.
'Assignment1.exe' (Win32): Loaded 'C:\Windows\SysWOW64\user32.dll'. Cannot find or open the PDB file.
'Assignment1.exe' (Win32): Loaded 'C:\Windows\SysWOW64\win32u.dll'. Cannot find or open the PDB file.
'Assignment1.exe' (Win32): Loaded 'C:\Windows\SysWOW64\gdi32.dll'. Cannot find or open the PDB file.
'Assignment1.exe' (Win32): Loaded 'C:\Windows\SysWOW64\gdi32full.dll'. Cannot find or open the PDB file.
'Assignment1.exe' (Win32): Loaded 'C:\Windows\SysWOW64\ole32.dll'. Cannot find or open the PDB file.
'Assignment1.exe' (Win32): Loaded 'C:\Windows\SysWOW64\combase.dll'. Cannot find or open the PDB file.
'Assignment1.exe' (Win32): Loaded 'C:\Windows\SysWOW64\ucrtbase.dll'. Cannot find or open the PDB file.
'Assignment1.exe' (Win32): Loaded 'C:\Windows\SysWOW64\rpcrt4.dll'. Cannot find or open the PDB file.
'Assignment1.exe' (Win32): Loaded 'C:\Windows\SysWOW64\sspicli.dll'. Cannot find or open the PDB file.
'Assignment1.exe' (Win32): Loaded 'C:\Windows\SysWOW64\cryptbase.dll'. Cannot find or open the PDB file.
'Assignment1.exe' (Win32): Loaded 'C:\Windows\SysWOW64\bcryptprimitives.dll'. Cannot find or open the PDB file.
'Assignment1.exe' (Win32): Loaded 'C:\Windows\SysWOW64\sechost.dll'. Cannot find or open the PDB file.
'Assignment1.exe' (Win32): Loaded 'C:\Windows\SysWOW64\oleaut32.dll'. Cannot find or open the PDB file.
'Assignment1.exe' (Win32): Loaded 'C:\Windows\SysWOW64\msvcp_win.dll'. Cannot find or open the PDB file.
'Assignment1.exe' (Win32): Loaded 'C:\Windows\SysWOW64\advapi32.dll'. Cannot find or open the PDB file.
'Assignment1.exe' (Win32): Loaded 'C:\Windows\SysWOW64\msvcrt.dll'. Cannot find or open the PDB file.
'Assignment1.exe' (Win32): Loaded 'C:\Windows\SysWOW64\avifil32.dll'. Cannot find or open the PDB file.
'Assignment1.exe' (Win32): Loaded 'C:\Windows\SysWOW64\msvfw32.dll'. Cannot find or open the PDB file.
'Assignment1.exe' (Win32): Loaded 'C:\Windows\SysWOW64\shell32.dll'. Cannot find or open the PDB file.
'Assignment1.exe' (Win32): Loaded 'C:\Windows\WinSxS\x86_microsoft.windows.common-controls_6595b64144ccf1df_5.82.14393.0_none_88fef4c26039fb25\comctl32.dll'. Cannot find or open the PDB file.
'Assignment1.exe' (Win32): Loaded 'C:\Windows\SysWOW64\avicap32.dll'. Cannot find or open the PDB file.
'Assignment1.exe' (Win32): Loaded 'C:\Windows\SysWOW64\cfgmgr32.dll'. Cannot find or open the PDB file.
'Assignment1.exe' (Win32): Loaded 'C:\Windows\SysWOW64\msacm32.dll'. Cannot find or open the PDB file.
'Assignment1.exe' (Win32): Loaded 'C:\Windows\SysWOW64\windows.storage.dll'. Cannot find or open the PDB file.
'Assignment1.exe' (Win32): Loaded 'C:\Windows\SysWOW64\winmm.dll'. Cannot find or open the PDB file.
'Assignment1.exe' (Win32): Loaded 'C:\Windows\SysWOW64\powrprof.dll'. Cannot find or open the PDB file.
'Assignment1.exe' (Win32): Loaded 'C:\Windows\SysWOW64\winmmbase.dll'. Cannot find or open the PDB file.
'Assignment1.exe' (Win32): Loaded 'C:\Windows\SysWOW64\shlwapi.dll'. Cannot find or open the PDB file.
'Assignment1.exe' (Win32): Loaded 'C:\Windows\SysWOW64\winmmbase.dll'. Cannot find or open the PDB file.
'Assignment1.exe' (Win32): Loaded 'C:\Windows\SysWOW64\kernel.appcore.dll'. Cannot find or open the PDB file.
'Assignment1.exe' (Win32): Unloaded 'C:\Windows\SysWOW64\winmmbase.dll'
'Assignment1.exe' (Win32): Loaded 'C:\Windows\SysWOW64\SHCore.dll'. Cannot find or open the PDB file.
'Assignment1.exe' (Win32): Loaded 'C:\Windows\SysWOW64\profapi.dll'. Cannot find or open the PDB file.
'Assignment1.exe' (Win32): Loaded 'C:\Windows\SysWOW64\imm32.dll'. Cannot find or open the PDB file.
'Assignment1.exe' (Win32): Loaded 'C:\Windows\SysWOW64\uxtheme.dll'. Cannot find or open the PDB file.
'Assignment1.exe' (Win32): Loaded 'C:\Program Files (x86)\Common Files\Microsoft Shared\Ink\tiptsf.dll'. Cannot find or open the PDB file.
'Assignment1.exe' (Win32): Loaded 'C:\Windows\SysWOW64\clbcatq.dll'. Cannot find or open the PDB file.
'Assignment1.exe' (Win32): Loaded 'C:\Windows\SysWOW64\devenum.dll'. Cannot find or open the PDB file.
'Assignment1.exe' (Win32): Loaded 'C:\Windows\SysWOW64\setupapi.dll'. Cannot find or open the PDB file.
'Assignment1.exe' (Win32): Loaded 'C:\Windows\SysWOW64\ntmarta.dll'. Cannot find or open the PDB file.
'Assignment1.exe' (Win32): Loaded 'C:\Windows\SysWOW64\devobj.dll'. Cannot find or open the PDB file.
'Assignment1.exe' (Win32): Loaded 'C:\Windows\SysWOW64\wintrust.dll'. Cannot find or open the PDB file.
'Assignment1.exe' (Win32): Loaded 'C:\Windows\SysWOW64\msasn1.dll'. Cannot find or open the PDB file.
'Assignment1.exe' (Win32): Loaded 'C:\Windows\SysWOW64\crypt32.dll'. Cannot find or open the PDB file.
'Assignment1.exe' (Win32): Loaded 'C:\Windows\SysWOW64\msdmo.dll'. Cannot find or open the PDB file.
'Assignment1.exe' (Win32): Loaded 'C:\Windows\SysWOW64\qcap.dll'. Cannot find or open the PDB file.
'Assignment1.exe' (Win32): Loaded 'C:\Windows\SysWOW64\quartz.dll'. Cannot find or open the PDB file.
'Assignment1.exe' (Win32): Loaded 'C:\Windows\SysWOW64\bcrypt.dll'. Cannot find or open the PDB file.
'Assignment1.exe' (Win32): Loaded 'C:\Windows\SysWOW64\msctf.dll'. Cannot find or open the PDB file.
'Assignment1.exe' (Win32): Loaded 'C:\Windows\SysWOW64\dwmapi.dll'. Cannot find or open the PDB file.
'Assignment1.exe' (Win32): Loaded 'C:\Windows\SysWOW64\UIAutomationCore.dll'. Cannot find or open the PDB file.
'Assignment1.exe' (Win32): Loaded 'C:\Windows\SysWOW64\userenv.dll'. Cannot find or open the PDB file.
'Assignment1.exe' (Win32): Loaded 'C:\Windows\SysWOW64\mfksproxy.dll'. Cannot find or open the PDB file.
'Assignment1.exe' (Win32): Loaded 'C:\Windows\SysWOW64\atl.dll'. Cannot find or open the PDB file.
'Assignment1.exe' (Win32): Loaded 'C:\Windows\SysWOW64\mfplat.dll'. Cannot find or open the PDB file.
'Assignment1.exe' (Win32): Loaded 'C:\Windows\SysWOW64\RTWorkQ.dll'. Cannot find or open the PDB file.
'Assignment1.exe' (Win32): Loaded 'C:\Windows\SysWOW64\mfcore.dll'. Cannot find or open the PDB file.
'Assignment1.exe' (Win32): Loaded 'C:\Windows\SysWOW64\ksuser.dll'. Cannot find or open the PDB file.
'Assignment1.exe' (Win32): Loaded 'C:\Windows\SysWOW64\mfperfhelper.dll'. Cannot find or open the PDB file.
'Assignment1.exe' (Win32): Loaded 'C:\Windows\SysWOW64\FSClient.dll'. Cannot find or open the PDB file.
'Assignment1.exe' (Win32): Loaded 'C:\Windows\SysWOW64\mfsensorgroup.dll'. Cannot find or open the PDB file.
'Assignment1.exe' (Win32): Loaded 'C:\Windows\SysWOW64\avrt.dll'. Cannot find or open the PDB file.
'Assignment1.exe' (Win32): Loaded 'C:\Windows\SysWOW64\vidcap.ax'. Cannot find or open the PDB file.
'Assignment1.exe' (Win32): Loaded 'C:\Windows\SysWOW64\Kswdmcap.ax'. Cannot find or open the PDB file.
'Assignment1.exe' (Win32): Loaded 'C:\Windows\SysWOW64\mfc42.dll'. Cannot find or open the PDB file.
'Assignment1.exe' (Win32): Loaded 'C:\Windows\SysWOW64\odbc32.dll'. Cannot find or open the PDB file.
'Assignment1.exe' (Win32): Loaded 'C:\Windows\SysWOW64\dpapi.dll'. Cannot find or open the PDB file.
'Assignment1.exe' (Win32): Loaded 'C:\Windows\SysWOW64\policymanager.dll'. Cannot find or open the PDB file.
'Assignment1.exe' (Win32): Loaded 'C:\Windows\SysWOW64\msvcp110_win.dll'. Cannot find or open the PDB file.
'Assignment1.exe' (Win32): Loaded 'C:\Windows\SysWOW64\mfreadwrite.dll'. Cannot find or open the PDB file.
'Assignment1.exe' (Win32): Loaded 'C:\Windows\SysWOW64\qedit.dll'. Cannot find or open the PDB file.
'Assignment1.exe' (Win32): Loaded 'C:\Windows\SysWOW64\comdlg32.dll'. Cannot find or open the PDB file.
'Assignment1.exe' (Win32): Loaded 'C:\Windows\WinSxS\x86_microsoft.windows.gdiplus_6595b64144ccf1df_1.1.14393.187_none_bab139cc35912856\GdiPlus.dll'. Cannot find or open the PDB file.
'Assignment1.exe' (Win32): Loaded 'C:\Windows\SysWOW64\ddraw.dll'. Cannot find or open the PDB file.
'Assignment1.exe' (Win32): Loaded 'C:\Windows\SysWOW64\dciman32.dll'. Cannot find or open the PDB file.
'Assignment1.exe' (Win32): Loaded 'C:\Windows\SysWOW64\igdumdim32.dll'. Cannot find or open the PDB file.
'Assignment1.exe' (Win32): Loaded 'C:\Windows\SysWOW64\igc32.dll'. Cannot find or open the PDB file.
'Assignment1.exe' (Win32): Loaded 'C:\Windows\SysWOW64\d3dim700.dll'. Cannot find or open the PDB file.
'Assignment1.exe' (Win32): Unloaded 'C:\Windows\SysWOW64\igc32.dll'
'Assignment1.exe' (Win32): Unloaded 'C:\Windows\SysWOW64\igdumdim32.dll'
'Assignment1.exe' (Win32): Loaded 'C:\Windows\SysWOW64\igdumdim32.dll'. Cannot find or open the PDB file.
'Assignment1.exe' (Win32): Loaded 'C:\Windows\SysWOW64\igc32.dll'. Cannot find or open the PDB file.
'Assignment1.exe' (Win32): Unloaded 'C:\Windows\SysWOW64\igc32.dll'
'Assignment1.exe' (Win32): Unloaded 'C:\Windows\SysWOW64\igdumdim32.dll'
'Assignment1.exe' (Win32): Loaded 'C:\Windows\SysWOW64\msyuv.dll'. Cannot find or open the PDB file.
The thread 0x1950 has exited with code 1 (0x1).
The thread 0x574 has exited with code 1 (0x1).
The thread 0x2284 has exited with code 1 (0x1).
The thread 0x1fb0 has exited with code 1 (0x1).
The thread 0x8e0 has exited with code 1 (0x1).
The thread 0x1b3c has exited with code 1 (0x1).
The thread 0xc4 has exited with code 1 (0x1).
The thread 0xb18 has exited with code 1 (0x1).
The thread 0x1c78 has exited with code 1 (0x1).
The thread 0x23d8 has exited with code 1 (0x1).
The thread 0xed8 has exited with code 1 (0x1).
The thread 0x1b4c has exited with code 1 (0x1).
The thread 0x4a4 has exited with code 1 (0x1).
The thread 0xf2c has exited with code 1 (0x1).
The thread 0x1354 has exited with code 1 (0x1).
The thread 0x2258 has exited with code 1 (0x1).
The program '[5740] Assignment1.exe' has exited with code 1 (0x1).`
最佳答案
Opencv窗口显示需要添加waitkey。在提供的代码中,它应该在 while 循环下,以便它每次都可以扫描键,如果在延迟时间内没有按下键,它将继续直到按下退出键。
这是工作代码:
#include <iostream>
#include <opencv2/core/core.hpp>
#include <opencv2/highgui/highgui.hpp>
#include <opencv2/imgproc/imgproc.hpp>
using namespace cv;
int main(int argc, char** argv)
{
Mat img;
VideoCapture vc(0);
while (1)
{
char c = waitKey(1);
vc >> img;
imshow("test", img);
if (c == 27) //ESc
break;
}
return 0;
}
关于c++ - 用 opencv 打开我的笔记本电脑摄像头,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39585751/
我正在尝试从 Linux 远程登录到 Windows PC,但显示错误“登录失败”。 这是我的 Python 脚本。我正在使用 pexpect 模块。我也尝试过使用 telnetlib 但同样的错误:
大多人在windows平台用的tomcat都是免安装版本的,很自然想到复制几份目录,就是在同一个电脑上跑多个tomcat服务了。实际上是不可以的。经过如下方法就可以实现统一台服务器(电脑)上运行多个
正负号是一个不常用的符号,很多小伙伴不知道怎么打出来,打出来确实有点麻烦,很多小伙伴不知道怎么弄,今天小编就给大家带来了轻松便捷的方法吧。 正负号怎么打出来 方法1、“&plu
在一项作业中,我被要求创建一个 [7] x [7] 矩阵,以及一个与计算机对战的井字棋游戏。玩家是 X,计算机是 O。[1][1] 是选择 1,[1][3] 是选择 2,[1][5] 是选择 3,[3
我想知道如何开发应用程序/服务器。我的安卓手机会在我说话时录制我的声音,并将其发送到 PC,然后使用 PC 的扬声器播放。 我想我需要一个在计算机上运行的媒体服务器来接收我的声音,然后使用手机上已有的
我正在开发一个使用蓝牙玩的安卓游戏应用程序。在搜索蓝牙设备时,结果包含移动设备和 mac pc/笔记本电脑。我只想在结果列表中列出移动设备。是否可以确定检测到的设备是否为移动设备? 最佳答案 当你有
在学习 Meteor 框架的过程中,我正在将 Yik Yak 移动应用程序重新创建为 Web 应用程序。但该应用程序是完全匿名的,没有用户帐户,但您仍然只能对帖子投赞成票或反对票一次。如何做到这一点?
我花了一些时间寻找解决方案。我已经使用 MacPorts 在我的 mac 上重新安装了 Vim 好几次。 vim --version 命令显示 +clipboard 和 +xterm_clipboar
我是一名优秀的程序员,十分优秀!