全景成像技术(3)—鱼眼全景成像
1.1鱼眼镜头
鱼眼镜头具有相当长的景深,有利于表现图像的长景深效果。鱼眼镜头有两种,一种像其他镜头一样,成像充满画面,另一种成像为圆形。
1.2成像投影模型
![](https://img-blog.csdnimg.cn/20210723151152358.png)
![](https://img-blog.csdnimg.cn/20210723151308727.png)
图8.23
1.3鱼眼图像的矫正方法
![](https://img-blog.csdnimg.cn/20210723152334696.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3dlaXhpbl80NDY5MDkzNQ==,size_16,color_FFFFFF,t_70)
代码:
from PIL import Image
import math
def fish_eye_dis(img):
"fish eye distortion"
width_in, height_in = img.size;
im_out = Image.new("RGB",(width_in,height_in));
radius = max(width_in, height_in)/2;
#assume the fov is 180
#R = f*theta
lens = radius*2/math.pi;
for i in range(width_in):
for j in range(height_in):
#offset to center
x = i - width_in/2;
y = j - height_in/2;
r = math.sqrt(x*x + y*y);
theta = math.atan(r/radius);
if theta<0.00001:
k = 1;
else:
k = lens*theta/r;
src_x = x*k;
src_y = y*k;
src_x = src_x+width_in/2;
src_y = src_y+height_in/2;
pixel = im.getpixel((src_x,src_y));
im_out.putpixel((i,j),pixel);
return im_out;
if __name__=="__main__":
input_name = "image0.jpg";
output_name = "image_dis.jpg";
im = Image.open(input_name);
img_out = fish_eye_dis(im);
img_out.save(output_name);
print "fish eye distortion completely, save image to %s" % output_name
代码来源: https://blog.csdn.net/smallflyingpig/article/details/56687436
仅作学习,详情请参考《计算摄影学基础》
你有带摩拉吗?: 这种一般可以通过短曝光帧去压制光晕吧,类似手机上的HDR?
小叶*: 用了个寂寞
谦虚啦家: 调试想换工作转算法,但好难啊
weixin_41793904: 我们需要图像高手,可以合作合作
ZWB19960417: 请问这个是什么版本的Imatest呀,我下载的3.4和3.7都没有,在高级的版本找不到了