资源简介
opencv扩展库,结构光代码,生成指定分辨率的结构光,并保存,example_structured_light_cap_pattern
代码片段和文件信息
#include
#include
#include
#include
#include
using namespace cv;
using namespace std;
static const char* keys =
{ “{@path |aaa | Path of the folder where the captured pattern images will be save }“
“{@proj_width |608 | Projector width }“
“{@proj_height |684 | Projector height }“ };
static void help()
{
cout << “\nThis example shows how to use the \“Structured Light module\“ to acquire a graycode pattern“
“\nCall (with the two cams connected):\n“
“./example_structured_light_cap_pattern \n“
<< endl;
}
int main(int argc char** argv)
{
structured_light::GrayCodePattern::Params params;
CommandLineParser parser(argc argv keys);
String path = parser.get(0);
params.width = parser.get(1);
params.height = parser.get(2);
if (path.empty() || params.width < 1 || params.height < 1)
{
help();
return -1;
}
// Set up GraycodePattern with params
Ptr graycode = structured_light::GrayCodePattern::create(params);
// Storage for pattern
vector pattern;
graycode->generate(pattern);
cout << pattern.size() << “ pattern images + 2 images for shadows mask computation to acquire with both cameras“
<< endl;
// Generate the all-white and all-black images needed for shadows mask computation
Mat white;
Mat black;
graycode->getImagesForShadowMasks(black white);
pattern.push_back(white);
pattern.push_back(black);
// Setting pattern window on second monitor (the projector‘s one)
//namedWindow(“Pattern Window“ WINDOW_NORMAL);
//resizeWindow(“Pattern Window“ params.width params.height);
//moveWindow(“Pattern Window“ params.width + 316 -20);
//setWindowProperty(“Pattern Window“ WND_PROP_FULLSCREEN WINDOW_FULLSCREEN);
for (int i = 0; i < pattern.size(); i++)
{
char name1[30] = “gray_code_“;
char name2[] = “.bmp“;
char num[2];
itoa(i num 10);
strcat(name1 num);
strcat(name1 name2);
imwrite(name1 pattern[i]);
cout << “正在保存第“< }
waitKey(0);
//// Open camera number 1 using libgphoto2
//VideoCapture cap1(CAP_GPHOTO2);
//if (!cap1.isOpened())
//{
// // check if cam1 opened
// cout << “cam1 not opened!“ << endl;
// help();
// return -1;
//}
//// Open camera number 2
//VideoCapture cap2(1);
//if (!cap2.isOpened())
//{
// // check if cam2 opened
// cout << “cam2 not opened!“ << endl;
// help();
// return -1;
//}
//// Turning off autofocus
//cap1.set(CAP_PROP_SETTINGS 1);
//cap2.set(CAP_PROP_SETTINGS 1);
//int i = 0;
//while (i < (int)pattern.size())
//{
// cout << “Waiting to save image number “ << i + 1 << endl << “Press any key to acquire the photo“ << endl;
// imshow(“Pattern Window“ pattern[i]);
// Mat frame1;
// Mat frame2;
// cap1 >> frame1; // get a new fram
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
目录 0 2018-01-11 10:48 test_1\
目录 0 2018-01-07 12:14 test_1\Debug\
文件 77824 2018-01-07 12:28 test_1\Debug\test_1.exe
文件 555972 2018-01-07 12:28 test_1\Debug\test_1.ilk
文件 1821696 2018-01-07 12:28 test_1\Debug\test_1.pdb
目录 0 2018-01-07 12:11 test_1\Release\
文件 17408 2018-01-11 10:17 test_1\Release\test_1.exe
文件 830464 2018-01-11 10:17 test_1\Release\test_1.pdb
目录 0 2018-01-11 10:47 test_1\test_1\
文件 19333120 2018-01-11 10:48 test_1\test_1.sdf
文件 964 2018-01-07 12:26 test_1\test_1.sln
文件 39424 2018-01-11 10:48 test_1\test_1.v12.suo
文件 15 2017-12-18 10:36 test_1\test_1\123.txt
目录 0 2018-01-07 12:21 test_1\test_1\Debug\
文件 222438 2018-01-07 12:21 test_1\test_1\Debug\main.obj
文件 2790 2018-01-07 12:28 test_1\test_1\Debug\test_1.log
目录 0 2018-01-07 12:28 test_1\test_1\Debug\test_1.tlog\
文件 1086 2018-01-07 12:21 test_1\test_1\Debug\test_1.tlog\cl.command.1.tlog
文件 34094 2018-01-07 12:21 test_1\test_1\Debug\test_1.tlog\CL.read.1.tlog
文件 586 2018-01-07 12:21 test_1\test_1\Debug\test_1.tlog\CL.write.1.tlog
文件 4660 2018-01-07 12:28 test_1\test_1\Debug\test_1.tlog\li
文件 11070 2018-01-07 12:28 test_1\test_1\Debug\test_1.tlog\li
文件 278 2018-01-07 12:28 test_1\test_1\Debug\test_1.tlog\li
文件 156 2018-01-07 12:28 test_1\test_1\Debug\test_1.tlog\test_1.lastbuildstate
文件 1100800 2018-01-07 12:21 test_1\test_1\Debug\vc120.idb
文件 970752 2018-01-07 12:21 test_1\test_1\Debug\vc120.pdb
文件 172153 2018-01-04 08:41 test_1\test_1\Debug\源.obj
文件 5358 2018-01-11 10:17 test_1\test_1\main.cpp
目录 0 2018-01-11 10:17 test_1\test_1\Release\
文件 1310424 2018-01-11 10:17 test_1\test_1\Release\main.obj
文件 388 2018-01-11 10:47 test_1\test_1\Release\test_1.log
............此处省略12个文件信息
- 上一篇:PC远程控制程序
- 下一篇:QMosaic软件介绍(镶嵌匀色分幅一体化处理)
相关资源
- opencv 书籍
- 基于PCA的人脸识别系统
-
haartraining+ob
jectmarker,opencv,Adaboo - opencv提取光斑质心
- Ubuntu下Opencv显示中文
- 划痕缺陷检测
- 单USB双目摄像头拍摄程序
- RAAR相位恢复 opencv
- FTVd全变差去模糊opencv实现
- 全变差TV去噪(split bregman) opencv
- opencv开启本地摄像头并拍照
- 基于opencv的激光线中心提取源码
- opencv3.0 鱼眼标定校正 改进
- 简单的一维高斯滤波程序
- FreeType 结合opencv在图像上显示中文程
- Mastering OpenCV with Practical Computer Visio
- opencv计算机视觉编程攻略图片集
- Opencv安装过程中使用的vgg_generated_12
- opencv计算两平行线之间的距离
- 计算圆轮廓面积提取圆心
- 服务器截屏并使用socket发送给客户端
- Keras图像深度学习实战原版
- 训练得到的900维 HOG特征-检测算子进行
- msvcp120d .dll、msvcr120d.dll包括32位和64位
- qt+opencv的视频采集 与保存
- opencv做的姿态检测项目
- opencv运动目标检测帧差法
- 基于opencv的双目摄像头图像获取
- opencv vlc 访问海康网络摄像头
- 快速小波变换 基于opencv带注释
评论
共有 条评论