资源简介
这是OCamCalib标定鱼眼出来的全视角相机模型对应的矫正程序,分享给大家使用,有问题可以去我的CSDN博客留言。
代码片段和文件信息
function export_data(ocam_model)
fprintf(1‘Exporting ocam_model to “calib_results.txt“\n‘);
if ~isfield(ocam_model‘invpol‘)
width = ocam_model.width;
height = ocam_model.height;
%The ocam_model does not contain the inverse polynomial pol
ocam_model.invpol = findinvpoly(ocam_model.sssqrt((width/2)^2+(height/2)^2));
end
fid = fopen(‘calib_results.txt‘ ‘w‘);
fprintf(fid‘#polynomial coefficients for the DIRECT mapping function (ocam_model.ss in MATLAB). These are used by cam2world\n\n‘);
fprintf(fid‘%d ‘length(ocam_model.ss)); %write number of coefficients
for i = 1:length(ocam_model.ss)
fprintf(fid‘%e ‘ocam_model.ss(i));
end
fprintf(fid‘\n\n‘);
fprintf(fid‘#polynomial coefficients for the inverse mapping function (ocam_model.invpol in MATLAB). These are used by world2cam\n\n‘);
fprintf(fid‘%d ‘length(ocam_model.invpol)); %write number of coefficients
for i = 1:length(ocam_model.invpol)
fprintf(fid‘%f ‘ocam_model.invpol(end-i+1));
end
fprintf(fid‘\n\n‘);
fprintf(fid‘#center: “row“ and “column“ starting from 0 (C convention)\n\n‘);
fprintf(fid‘%f %f\n\n‘ocam_model.xc-1 ocam_model.yc-1);
fprintf(fid‘#affine parameters “c“ “d“ “e“\n\n‘);
fprintf(fid‘%f %f %f\n\n‘ocam_model.c ocam_model.d ocam_model.e);
fprintf(fid‘#image size: “height“ and “width“\n\n‘);
fprintf(fid‘%d %d\n\n‘ocam_model.height ocam_model.width);
fclose(fid);
fprintf(1‘done\n‘);
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
目录 0 2009-06-26 16:08 undistortFunctions\
文件 670 2009-06-26 15:15 undistortFunctions\calib_results_catadioptric.txt
文件 595 2009-05-05 16:20 undistortFunctions\calib_results_fisheye.txt
文件 1479 2009-06-26 15:44 undistortFunctions\export_data.m
文件 1757 2009-03-30 01:40 undistortFunctions\findinvpoly.m
文件 9006 2009-06-26 15:39 undistortFunctions\main.cpp
文件 6053 2009-06-26 15:32 undistortFunctions\ocam_functions.cpp
文件 4584 2009-05-01 11:45 undistortFunctions\ocam_functions.h
文件 1954 2009-06-26 16:07 undistortFunctions\README.TXT
文件 401282 2008-11-17 16:25 undistortFunctions\test_catadioptric.jpg
文件 323821 2009-03-30 00:05 undistortFunctions\test_fisheye.jpg
文件 136246 2009-06-26 16:07 undistortFunctions\undistorted_panoramic.jpg
文件 102594 2009-06-26 16:07 undistortFunctions\undistorted_perspective.jpg
评论
共有 条评论