因为要标定相机,所以小编写了个自动拍照并按顺序保存图片到指定文件夹的程序
#include\"stdafx.h\"
#include <opencv2/highgui/highgui.hpp>
#include <opencv2/imgproc/imgproc.hpp>
#include <opencv2/core/core.hpp>
using namespace cv;
int main()
{
VideoCapture cap(0);
Mat ;
char key;
char filename[200];
int i = 8;
while (true)
{
string filename = \"/home/shangbinbin/opencv_linux_test/test1/\" +to_string(i)+\".jpg\";
char key = waitKey(100);
cap >> ;
imshow(\" \", )
switch (key)
{
case\'p\':
i++;
imwrite(filename, );
imshow(\"photo\", );
waitKey(500);
destroyWindow(\"photo\");
break;
default:
break;
}
}
waitKey(0);
return 0;
}
继续阅读与本文标签相同的文章
下一篇 :
调用堆栈
-
数字技术让“诗和远方”融为一体
2026-05-18栏目: 教程
-
“成人网站”免费让人上钩,其背后有什么不为人知的猫腻,网友:不敢惹
2026-05-18栏目: 教程
-
网络互连技术之路由协议
2026-05-18栏目: 教程
-
信息技术助力物流行业转型升级
2026-05-18栏目: 教程
-
登榜!风采依旧表现“佳”
2026-05-18栏目: 教程
