用matlab标定相机——cameraCalibrator
像这样的相机照片多个角度拍摄几次,然后打开cameracalibrator,即单目相机标定。matlab自带很多好用的应用的!依次导入后直接calibrate运行。左边查看参数,右边保存内外参。选择add images。
·

matlab自带很多好用的应用的!!!!良心推荐
- 制作标定版并拍照

像这样的相机照片多个角度拍摄几次,然后打开cameracalibrator,即单目相机标定。
如果熟悉c++编程的话可以执行:
```cpp
#include "opencv2/opencv.hpp"
#include <string>
#include <iostream>
using namespace cv;
using namespace std;
int main()
{
VideoCapture inputVideo(0); //视情况选择预标定摄像头
//inputVideo.set(CAP_PROP_FRAME_WIDTH, 320); //可选项,调整窗口大小
//inputVideo.set(CAP_PROP_FRAME_HEIGHT, 240);
if (!inputVideo.isOpened())
{
cout << "Could not open the input video " << endl;
return -1;
}
Mat frame;
string imgname;
int f = 1;
while (1) //Show the image captured in the window and repeat
{
inputVideo >> frame; // read
if (frame.empty()) break; // check if at end
imshow("Camera", frame);
char key = waitKey(1);
if (key == 27) break; //按ESC退出
if (key == 'q' || key == 'Q')
{
imgname = to_string(f++) + ".jpg"; //输出文件名为 f.jpg, 保留在工程文件夹中
imwrite(imgname, frame);
}
}
cout << "Finished writing" << endl;
return 0;
}
- 添加图片
选择add images
-
设置标定板参数

-
依次导入后直接calibrate运行

-
左边查看参数,右边保存内外参

魔乐社区(Modelers.cn) 是一个中立、公益的人工智能社区,提供人工智能工具、模型、数据的托管、展示与应用协同服务,为人工智能开发及爱好者搭建开放的学习交流平台。社区通过理事会方式运作,由全产业链共同建设、共同运营、共同享有,推动国产AI生态繁荣发展。
更多推荐

所有评论(0)