MATLAB摄像机标定与畸变图像校正:完整教程

(MATLAB)

J = (checkerboard(300,4,5)>0.5);

figure, imshow(J);

1

2

1

2

采集数据

那么有了棋盘格之后自然是需要进行照片了。不多说,直接上程序。按q键即可保存图像,尽量把镜头的各个角度都覆盖好。

#include "opencv2/opencv.hpp"

#include <string>

#include <iostream>

 

using namespace cv;

using namespace std;

 

int main()

{

    VideoCapture inputVideo(0);

    //inputVideo.set(CV_CAP_PROP_FRAME_WIDTH, 320);

    //inputVideo.set(CV_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;

        if (key == 'q' || key == 'Q')

        {

            imgname = to_string(f++) + ".jpg";

            imwrite(imgname, frame);

        }

    }

    cout << "Finished writing" << endl;

    return 0;

}

进行标定

直接而在MATLAB的Command Window里面输入cameraCalibrator即可调用标定应用。

QR Code
微信扫一扫,欢迎咨询~

联系我们
武汉格发信息技术有限公司
湖北省武汉市经开区科技园西路6号103孵化器
电话:155-2731-8020 座机:027-59821821
邮件:tanzw@gofarlic.com
Copyright © 2023 Gofarsoft Co.,Ltd. 保留所有权利
遇到许可问题?该如何解决!?
评估许可证实际采购量? 
不清楚软件许可证使用数据? 
收到软件厂商律师函!?  
想要少购买点许可证,节省费用? 
收到软件厂商侵权通告!?  
有正版license,但许可证不够用,需要新购? 
联系方式 155-2731-8020
预留信息,一起解决您的问题
* 姓名:
* 手机:

* 公司名称:

姓名不为空

手机不正确

公司不为空