资源简介
opencv 单目 摄像头 标定 带图片

代码片段和文件信息
#include
#include
#include
// OpenCV
#include
#include
#include
#include
using namespace std;
using namespace cv;
const int imageWidth = 640; //摄像头的分辨率
const int imageHeight = 480;
const int boardWidth = 5; //横向的角点数目
const int boardHeight = 4; //纵向的角点数据
const int boardCorner = boardWidth * boardHeight; //总的角点数据
const int frameNumber = 12; //相机标定时需要采用的图像帧数
const int squareSize = 20; //标定板黑白格子的大小 单位mm
const Size boardSize = Size(boardWidth boardHeight); //
Mat intrinsic; //相机内参数
Mat distortion_coeff; //相机畸变参数
vector rvecs; //旋转向量
vector tvecs; //平移向量
vector> corners; //各个图像找到的角点的集合 和objRealPoint 一一对应
vector> objRealPoint; //各副图像的角点的实际物理坐标集合
vector corner; //某一副图像找到的角点
Mat rgbImage grayImage;
/*计算标定板上模块的实际物理坐标*/
void calRealPoint(vector>& obj int boardwidthint boardheight int imgNumber int squaresize)
{
// Mat imgpoint(boardheight boardwidth CV_32FC3Scalar(000));
vector imgpoint;
for (int rowIndex = 0; rowIndex < boardheight; rowIndex++)
{
for (int colIndex = 0; colIndex < boardwidth; colIndex++)
{
// imgpoint.at(rowIndex colIndex) = Vec3f(rowIndex * squaresize colIndex*squaresize 0);
imgpoint.push_back(Point3f(rowIndex * squaresize colIndex * squaresize 0));
}
}
for (int imgIndex = 0; imgIndex < imgNumber; imgIndex++)
{
obj.push_back(imgpoint);
}
}
/*设置相机的初始参数 也可以不估计*/
void guessCameraParam(void )
{
/*分配内存*/
intrinsic.create(3 3 CV_64FC1);
distortion_coeff.create(5 1 CV_64FC1);
/*
fx 0 cx
0 fy cy
0 0 1
*/
intrinsic.at(00) = 256.8093262; //fx
intrinsic.at(0 2) = 160.2826538; //cx
intrinsic.at(1 1) = 254.7511139; //fy
intrinsic.at(1 2) = 127.6264572; //cy
intrinsic.at(0 1) = 0;
intrinsic.at(1 0) = 0;
intrinsic.at(2 0) = 0;
intrinsic.at(2 1) = 0;
intrinsic.at(2 2) = 1;
/*
k1 k2 p1 p2 p3
*/
distortion_coeff.at(0 0) = -0.193740; //k1
distortion_coeff.at(1 0) = -0.378588; //k2
distortion_coeff.at(2 0) = 0.028980; //p1
distortion_coeff.at(3 0) = 0.008136; //p2
distortion_coeff.at(4 0) = 0; //p3
}
void outputCameraParam(void )
{
/*保存数据*/
//cvSave(“cameraMatrix.xml“ &intrinsic);
//cvSave(“cameraDistoration.xml“ &distortion_coeff);
//cvSave(“rotatoVector.xml“ &rvecs);
//cvSave(“translationVector.xml“ &tvecs);
/*输出数据*/
cout << “fx :“ << intrinsic.at(0 0) << endl << “fy :“ << intrinsic.at(1 1) << endl;
cout << “cx :“ << intrinsic.at(0 2) << endl << “cy :“ << intrinsic.at(1 2) << endl;
cout << “k1 :“ << distortion_coeff.at
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 28542 2009-11-06 19:34 03.jpg
文件 30202 2009-11-06 19:34 04.jpg
文件 29695 2009-11-06 19:34 05.jpg
文件 25192 2009-11-06 19:34 06.jpg
文件 26076 2009-11-06 19:35 07.jpg
文件 33800 2009-11-06 19:35 08.jpg
文件 33484 2009-11-06 19:35 09.jpg
文件 32192 2009-11-06 19:36 10.jpg
文件 35004 2009-11-06 19:37 11.jpg
文件 33999 2009-11-06 19:38 12.jpg
文件 6062 2016-05-23 21:49 CalibrationOpenCV3.cpp
文件 28056 2009-11-06 19:33 01.jpg
文件 26742 2009-11-06 19:33 02.jpg
----------- --------- ---------- ----- ----
369046 13
- 上一篇:基于django的网页倒计时
- 下一篇:在树莓派上创建无线热点
相关资源
- 基于OpenCV的数字识别468815
- 使用opencv去掉二值化图像中黑色面积
- delphi摄像头拍照
- opencv环境配置
- win10 64位下编译的opencv4.5.5库,opencv
- 虚拟摄像头VCam开发SDK
- 大华摄像头抓图录像亲测可用
- STM32F103实现OV7670摄像头显示
- amcap摄像头驱动
- 海康摄像头+web3.0开发包SDK的demo
- 戴尔Inspiron笔记本 摄像头工具webcam
- 万能摄像头驱动程序 最新版
- USB摄像头万能驱动器 v2011.3 官方最新
- dell inspiron n4010摄像头驱动 官方最新版
- ASUS华硕笔记本万能摄像头驱动 2012 完
- 华硕笔记本万能摄像头驱动v2.0官方正
- EyeToy SCEH-0004 摄像头驱动
- NVIDIAOpticalFlowSDK-79c6cee80a2df9a196f20afd6
- 500万像素手机摄像头优化设计
- 华硕ASUS K42JZ摄像头驱动程序 v061.005
- opencv_contrib-3.4.0.zip
- 基于K60的线性CCD摄像头的自主循迹平
- opencv2.4.9源码分析——SIFT
- 基于STM32平台配置OV7620摄像头,并采集
- 用两个摄像头实现,双目标定,双目
- 摄像头测试 24色卡 Color24.rar
- ov7725彩色摄像头显示图像k60源码
- opencv_traincascade训练分类器,手势识别
- opencv3.0交叉编译用parallel.cpp
- 基于opencv的图像识别识别图像中的色
评论
共有 条评论