资源简介

matlab实现的鱼眼畸变矫正(含GUI),有几种可供选择实现方法,主函fish_3D_2014.m包括:2D球面坐标法,3D投影法,金字塔3D投影法

资源截图

代码片段和文件信息

clc;
clear;
I0=imread(‘001.jpg‘);
I0=uint8(rgb2gray(I0));  
[heighwidth]=size(I0);
r=floor((min(heighwidth))/2);   %原图像半径
oriwidth=2*r;                    %原图像宽长
oriheigh=2*r;
nwidth=4*r;                      %定义校正后图像大小
nheigh=4*r;
%ewidth1=round(0.707*r);
%ewidth2=round(1.293*r);
%eheigh1=round(0.707*r);
%eheigh2=round(1.293*r);
I1=uint8(zeros(nheighnwidth));
p1=r;
m1=r;
n1=r;
xc=r;
yc=r;
u0=r;
v0=r;

%%-----------立方体左侧面校正------------------%%
for i=1:2*r
    for j=-r+1:0 
        p=j+xc;
        m=i-yc;
        u=(r*m)/(sqrt(m^2+n1^2+p^2));
        v=(r*(-n1))/(sqrt(m^2+n1^2+p^2));
        xft=round(u+u0);                        
        yft=round(v+v0);
        if (xft<=0)||(xft>oriwidth)||(yft<=0)||(yft>oriheigh)
            I1(r+i2*r+j)=0;
        

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     文件       58146  2013-07-22 10:39  00.jpg
     文件       40754  2014-05-14 15:36  001.JPG
     文件       66418  2014-05-31 08:50  112.jpg
     文件      405222  2013-07-23 10:26  12.jpg
     文件       58276  2013-07-23 15:44  34.jpg
     文件       48111  2013-07-22 19:12  a00.jpg
     文件        4170  2014-05-21 15:13  CMQ.m
     文件        1208  2013-07-23 12:32  DistortionRate.m
     文件       68111  2013-06-09 13:57  f.jpg
     文件        5653  2014-06-04 12:01  Fish_3D_2014.fig
     文件       34511  2014-06-04 12:01  Fish_3D_2014.m
     文件        6565  2014-05-29 13:29  fish_3D_Cube.m
     文件        6502  2014-05-21 15:02  fish_3D_origin.m
     文件        5545  2014-05-29 13:39  fish_3D_Pyramid.m
     文件        5530  2014-05-31 08:51  fish_3D_Pyramid_simplify.m
     文件        5661  2014-05-29 13:41  fish_3D_Pyramid_zero.m
     文件         743  2014-05-14 11:36  fish_correcttion.m
     文件       16710  2014-10-26 19:52  renyan01.JPG
     文件         354  2014-05-28 22:23  solve_equatation.m
     文件        1508  2013-07-24 10:37  Spherical_coordinates.m
     文件        1470  2013-07-24 13:26  Spherical_perspective_projection.m
     文件         254  2013-07-24 13:39  鱼眼校正程序.txt

评论

共有 条评论