鱼眼镜头校准实验

A normal lens has pincushion or barrel distortion which can be corrected for to give a perfect perspective projection, a pin-hole camera. This is called "rectification" and is often applied before any warp/stitch/blending is applied, for example, in panoramic photography. 

普通的镜头主要是桶形畸变和枕形畸变,通过透视投影变换进行校准。像全景拼接中用的“矫正”方法包括,扭曲(反扭曲)/缝合/融合。

In the same way there is a perfect circular fisheye projection, that is, one in which the distance r from the center of the fisheye circle is linearly proportional to the latitude of the corresponding 3D vector. Such a fisheye lens is often referred to as a "tru-theta" lens and while such lenses can and have been manufactured, in real life and for lower cost lenses the relationship is non-linear. The non-linearity normally occurs towards the periphery of the fisheye and results in a compression artefact. 

理想的鱼眼镜头(真鱼眼镜头),鱼眼图像像素到圆心(光心)的距离与图像投影到球面坐标系后的纬度成线性关系。理想的鱼眼模型如下图所示离光心越远theta越大,纬度就越大,上半球整个纬度为[0~pi/2]

In many cases the lens manufacturer can supply data for the curve relating "r", the distance on the sensor or fisheye circular image, to latitude of the 3D vector corresponding to that radius. In some cases for high grade lenses the manufacturer will supply curves for the particular lens in question, an acknowledgement that lenses can vary typically by 5% in the manufacturing process. In the situation where no such data is available one needs to construct a rig which when photographed will allow the angles to be measured. 

很多情况镜头厂家会提供r与纬度的曲线。

The approach to correcting for the non-linear relationship is to fit a suitable polynomial to the data points relating "r" to latitude. A general function for the latitude φ might be 

拟合r与纬度的曲线一般多项式:

Since the fisheye is assumed to be radially symmetric and r=0 is the center of the fisheye corresponding to a latitude of 0, a0 is zero. In practice the highest order polynomial needed for the fitting is n=3, in some extreme examples a 4th order (n=4) is required. So the polynomial for a least squares fit is: 

一般多项式在具体到鱼眼镜头实际情况,一般是3阶比较极端情况需要4阶,一般认为鱼眼是沿光轴对称的,因此常数项a0为0.

It was found that more lenses than expected did indeed require a 4th order correction and for numerical reasons it was better to map from radians rather than degrees. All the following examples follow this convention. 

从大多数场景看,映射需要四阶,而且是弧度而不是角度。

Entaniya M12 250 degree fisheye

This lens curve seems to need a 4'th order term in order to get a good fit at the extreme field of view angle of 125 degrees. Graph is radians horizontally, and normalised fisheye image (sensor) vertically 

OpenCV的畸变模型:

对手头的鱼眼镜头进行畸变矫正。

矫正后的图像如下:

畸变参数为:

-0.50074, 0.425324, -0.275751, 0.0866413

该相机的theta-R曲线图如下:

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值