资源简介
CircleCalib.rar
代码片段和文件信息
#include “opencv2/core/core.hpp“
#include “opencv2/imgproc/imgproc.hpp“
#include “opencv2/calib3d/calib3d.hpp“
#include “opencv2/highgui/highgui.hpp“
#include
#include
using namespace cv;
using namespace std;
void main()
{
ifstream fin(“calibdata_G.txt“); /* 标定所用图像文件的路径 */
ofstream fout(“caliberation_result.txt“); /* 保存标定结果的文件 */
//读取每一幅图像,从中提取出角点,然后对角点进行亚像素精确化
cout << “开始提取角点………………“;
int image_count = 0; /* 图像数量 */
Size image_size; /* 图像的尺寸 */
Size board_size = Size(77); /* 标定板上每行、列的角点数。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。需要改 */
vector image_points_buf; /* 缓存每幅图像上检测到的角点 */
vector> image_points_seq; /* 保存检测到的所有角点 */
string filename;
int count = -1;//用于存储角点个数。
while (getline(fin filename))
{
image_count++;
// 用于观察检验输出
cout << “image_count = “ << image_count << endl;
/* 输出检验*/
cout << “-->count = “ << count;
Mat imageInput = imread(filename);
if (image_count == 1) //读入第一张图片时获取图像宽高信息
{
image_size.width = imageInput.cols;
image_size.height = imageInput.rows;
cout << “image_size.width = “ << image_size.width << endl;
cout << “image_size.height = “ << image_size.height << endl;
}
/* 提取角点 */
if (0 != findChessboardCorners(imageInput board_size image_points_buf))
{
cout << “can not find chessboard corners!\n“; //找不到角点
exit(1);
}
else
{
Mat view_gray;
cvtColor(imageInput view_gray CV_RGB2GRAY);
/* 亚像素精确化 */
//find4QuadCornerSubpix(view_gray image_points_buf Size(5 5)); //对粗提取的角点进行精确化
cv::SimpleBlobDetector::Params param;
param.filterByCircularity = true;
param.minCircularity = 0.8f;
param.maxCircularity = 1.0f;
cv::Ptr blobDetector = cv::SimpleBlobDetector::create(param);
cv::Size boardSize = cv::Size(7 7);//.................................................................................................................需要改
bool found = findCirclesGrid(view_gray boardSize image_points_buf cv::CALIB_CB_SYMMETRIC_GRID | cv::CALIB_CB_CLUSTERING blobDetector);
image_points_seq.push_back(image_points_buf); //保存亚像素角点
/* 在图像上显示角点位置 */
drawChessboardCorners(view_gray board_size image_points_buf true); //用于在图片中标记角点
namedWindow(“Camera Calibration“0);
imshow(“Camera Calibration“ view_gray);//显示图片
waitKey(500);//暂停0.5S
}
}
int total = image_points_seq.size();
cout << “total = “ << total << endl;
int CornerNum = board_size.width*board_size.height; //每张图片上总的角点数
for (int ii = 0; ii {
if (0 == ii%CornerNum)// 24 是每幅图片的角点个数。此判断语句是为了输出 图片号,便于控制台观看
{
int i = -1;
i = ii / CornerNum;
int j = i + 1;
cout << “--> 第 “ << j << “图片的数据 --> : “ << endl;
}
if (0 == ii % 3) // 此判断语句,格式化输出,便于控制台查看
{
cout << endl;
}
else
{
cout.width(10);
}
//输出所有的角点
cout << “ -->“ << image_points_seq[ii][0].x;
cout <<
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
..A..H. 40960 2018-10-22 13:24 CircleCalib\.vs\DotFitting\v14\.suo
文件 740105 2018-10-22 13:13 CircleCalib\DotFitting\1_d.jpg
文件 679136 2018-10-22 13:13 CircleCalib\DotFitting\2_d.jpg
文件 702128 2018-10-22 13:13 CircleCalib\DotFitting\3_d.jpg
文件 682442 2018-10-22 13:13 CircleCalib\DotFitting\4_d.jpg
文件 688486 2018-10-22 13:13 CircleCalib\DotFitting\5_d.jpg
文件 681585 2018-10-22 13:13 CircleCalib\DotFitting\6_d.jpg
文件 722943 2018-10-22 13:13 CircleCalib\DotFitting\7_d.jpg
文件 63 2018-10-22 10:30 CircleCalib\DotFitting\calibdata_G.txt
文件 3274 2018-10-22 13:13 CircleCalib\DotFitting\caliberation_result.txt
文件 9366 2018-10-22 10:32 CircleCalib\DotFitting\CircleCalib.cpp
文件 7699 2018-10-22 10:22 CircleCalib\DotFitting\DotFitting.vcxproj
文件 952 2018-10-22 10:22 CircleCalib\DotFitting\DotFitting.vcxproj.filters
文件 223 2018-10-22 10:22 CircleCalib\DotFitting\DotFitting.vcxproj.user
文件 416817 2018-10-21 16:54 CircleCalib\DotFitting\G_1.jpg
文件 372028 2018-10-21 16:54 CircleCalib\DotFitting\G_2.jpg
文件 389877 2018-10-21 16:54 CircleCalib\DotFitting\G_3.jpg
文件 371512 2018-10-21 16:54 CircleCalib\DotFitting\G_4.jpg
文件 381058 2018-10-21 16:54 CircleCalib\DotFitting\G_5.jpg
文件 377537 2018-10-21 16:54 CircleCalib\DotFitting\G_6.jpg
文件 401167 2018-10-21 16:54 CircleCalib\DotFitting\G_7.jpg
文件 1934651 2018-10-22 10:32 CircleCalib\DotFitting\x64\Release\CircleCalib.obj
文件 1582 2018-10-22 10:22 CircleCalib\DotFitting\x64\Release\DotFitting.Build.CppClean.log
文件 1043 2018-10-22 10:32 CircleCalib\DotFitting\x64\Release\DotFitting.log
文件 734 2018-10-22 10:32 CircleCalib\DotFitting\x64\Release\DotFitting.tlog\CL.command.1.tlog
文件 18982 2018-10-22 10:32 CircleCalib\DotFitting\x64\Release\DotFitting.tlog\CL.read.1.tlog
文件 502 2018-10-22 10:32 CircleCalib\DotFitting\x64\Release\DotFitting.tlog\CL.write.1.tlog
文件 225 2018-10-22 10:32 CircleCalib\DotFitting\x64\Release\DotFitting.tlog\DotFitting.lastbuildstate
文件 1480 2018-10-22 10:32 CircleCalib\DotFitting\x64\Release\DotFitting.tlog\li
文件 3734 2018-10-22 10:32 CircleCalib\DotFitting\x64\Release\DotFitting.tlog\li
............此处省略27个文件信息
- 上一篇:SWAT模型培训-+中技培讲课
- 下一篇:TI Am335x用户手册
相关资源
- DownloadFile.zip
- DeepLearningBookChineseTranslation.zip
- 西门子plc仿真软件S7-PLCSIMV5.4.rar
- Netty入门与实战:仿写微信IM即时通讯
- TCPIP协议详解(全三卷).rar
- 2ie0pu.pdf
- 深度学习车牌识别模型.zip
- 痕迹清除.7z
- 线性代数及其应用英文第四版—2018
- 通信系统仿真原理与无线应用--中文
-
Databa
semanagementsystems3rd.part1.rar - Learning-OpenCV-3_examples.zip
- 算法图解高清版.zip
- Doc(liruan7.0文档-个人学习).rar
- 游戏关卡设计.pdf
- redis开发与运维(清晰完整版).pdf.
- 汽车CAN总线系统原理设计与应用罗峰
- AnIntroductiontoStatisticalLearning.zip
- opencv3原书源码.7z
- Car_License_Plate.rar
- VxWorks高级程序设计.zip
- m0_38007995_10005850.zip
- zw_超市管理系统.zip
- zw_rosemirrorha410110.zip
- zw_USB-over-network5.02.zip
- zw_OpenCV-2.3.1-win-superpack.part3.zip
- 爱快9341-1.2.2.bin
- 计算机图形学习题答案源代码.rar
- lzt711_10500937.zip
- lxl.zip
评论
共有 条评论