本文作者Color Space,文章未经作者允许禁止转载!
本文将介绍EmguCV相机标定并将标定结果保存到xml,然后读取xml内容使用,做相机畸变校正!
相机标定可以查看这篇文章:
C#图像处理-EmguCV相机标定与畸变矫正 实现代码
在上面基础上增加将相机标定参数保存到xml,使用时读取xml参数做相机畸变校正的功能。
完整代码如下:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Drawing;
using Emgu.CV;
using Emgu.CV.Structure;
using Emgu.CV.Util;
using Emgu.CV.CvEnum;
namespace Camera_Calibration_Demo
{
class Program
{
static int chessWidth = 11;
static int chessHeight = 8;
static int imgCount = 8;
static MCvPoint3D32f[][] _cornersObjectList = new MCvPoint3D32f[imgCount][];
static PointF[][] _cornersPointsList = new PointF[imgCount][];