weixin_42859188 2019-05-16 15:07 采纳率: 0%
浏览 1909
已结题

未经处理的异常:Microsoft C++?

图片说明
void CCameraDlg::OnBnClickedOpenButton()
{
// TODO: 在此添加控件通知处理程序代码
capture.open(0);
int framenum = 1800;
if (!capture.isOpened())
{
MessageBox(_T("无法连接摄像头!!!"));
return;
}
VideoCapture capture(0);
VideoWriter writer("VideoTest.avi", CV_FOURCC('M', 'J', 'P', 'G'), 30.0, Size(640, 480));
while (capture.isOpened() && framenum > 0)
{
capture >> frame;//读取当前帧
resize(frame, frame, Size(width, height));
writer << frame;
framenum --;
imshow("MyPicture", frame);
waitKey(10);
if (char(waitKey(1)) == 'q') break;
}
//capture >> frame; //读取当前帧
//resize(frame, frame, Size(width, height));

SetTimer(1, 25, NULL); //定时器,定时时间和帧率一致
writer.release();

}

  • 写回答

1条回答 默认 最新

  • dabocaiqq 2019-05-21 09:42
    关注
    评论

报告相同问题?

悬赏问题

  • ¥15 关于#网络安全#的问题:求ensp的网络安全,不要步骤要完成版文件
  • ¥15 可否在不同线程中调用封装数据库操作的类
  • ¥20 使用Photon PUN2解决游戏得分同步的问题
  • ¥15 微带串馈天线阵列每个阵元宽度计算
  • ¥15 keil的map文件中Image component sizes各项意思
  • ¥20 求个正点原子stm32f407开发版的贪吃蛇游戏
  • ¥15 划分vlan后,链路不通了?
  • ¥20 求各位懂行的人,注册表能不能看到usb使用得具体信息,干了什么,传输了什么数据
  • ¥15 Vue3 大型图片数据拖动排序
  • ¥15 Centos / PETGEM