资源简介
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的数字识别468815
- 使用opencv去掉二值化图像中黑色面积
- opencv环境配置
- win10 64位下编译的opencv4.5.5库,opencv
- NVIDIAOpticalFlowSDK-79c6cee80a2df9a196f20afd6
- opencv_contrib-3.4.0.zip
- opencv2.4.9源码分析——SIFT
- 用两个摄像头实现,双目标定,双目
- opencv_traincascade训练分类器,手势识别
- opencv3.0交叉编译用parallel.cpp
- 基于opencv的图像识别识别图像中的色
- 基于openCV的识别特定颜色区域
- 基于OpenCV的分水岭算法实现
- QT+opencv+OCR 身份证号码,银行卡号识别
- opencv视频特定颜色区域识别
- 把RGB转换为HSV和HSI然后根据黄色和蓝
- opencv视觉测距
- 基于Qt和opencv的身份证号码识别系统
- opencv_ffmpeg249.dll
- SfM稀疏三维点云重建--完整工程文件
- 基于opencv的数人头程序源代码
- 利用OpenCV中的Stitcher类实现全景图像拼
- opencv实现的sift算法源码,包含了图像
- openCV 上的小波变换
- 基于OPENCV的车牌识别系统设计
- 617张国内车牌60-17bmp图片用于OpenCV正样
- hog特征提取,c版本代码
- 基于Qt5.8+OpenCV3.2的Basler多相机触发开
- 基于Opencv实现的图像纠偏
- ImageWatch2019.vsix
评论
共有 条评论