资源简介
一个很好桶形畸变的校正程序,主要有重要的代码,自己研究研究可以看得懂的,对畸变的学习帮助比较大
代码片段和文件信息
%%% ================================================================%%%
%%% This arithmetic is programmed by Xiang Li
%%% Copyright 2005All Copyright Reserved by Xiang Li
%%% You can modify and distibute this programme under the GPL license
%%% If you have any question about this programme
%%% please contact with XiangLi@uestc.edu.cn
%%% ================================================================%%%
%%% ================================================================%%%
%%% first step:
%%% assume we have the inverse alias functionthen we need to determine and
%%% establish the range of x and y of the original image from this function
%%% ================================================================%%%
%%% read alias image into current working memory space
origImg = imread(‘lena_barrel.tif‘‘tif‘);
figure;
imshow(origImg‘truesize‘);
title(‘barrel image‘);
%%% get width and height of alias image
origWidth = size(origImg1);
origHeight = size(origImg2);
%%% calculate the middle coordinate of alias image
origMidOfX = round(origWidth/2);
origMidOfY = round(origHeight/2);
%%% shift the coordinate to the center of the alias image
[xOrigIndexyOrigIndex] = meshgrid(1:origWidth1:origHeight);
xNewIndex = xOrigIndex(:) - origMidOfX;
yNewIndex = yOrigIndex(:) - origMidOfY;
%%% transform rectangular to polar coordinatenote that theta is measured
%%% in radiansand please note that we can think Cartesian ordinate is just
%%% the rectangular coordinatewe can of course think it like thisanyway
[thetaradius] = cart2pol(xNewIndexyNewIndex);
%%% a1 and a2 are image alias coeffientsso here we produce the aliasing image‘s
%%% radius in polar coordinates.
%%% noteinverse formula:newRadius = (a1 - sqrt(a1 ^ 2 - 4 * a2 * radius))/(2 * a2)
%%% is from formular:
%%% aliasRadius = a1 * radius - a2 * radius .^ 2
%%% which is the alias function I guessedand it seems true.
a1 = 2.0;
a2 = 0.005;
newRadius = (a1 - sqrt(a1 ^ 2 - 4 * a2 * radius))/(2 * a2);
newTheta = theta;
%%% now we can map the aliasing rectangular coordinates to its polar
%%% counterpart
[xAliasIndexyAliasIndex] = pol2cart(newThetanewRadius);
%%% here calculate the min and max position
xMinAliasIndex = double(round(min(xAliasIndex)));
xMaxAliasIndex = double(round(max(xAliasIndex)));
yMinAliasIndex = double(round(min(yAliasIndex)));
yMaxAliasIndex = double(round(max(yAliasIndex)));
%%% calculate the to-be-fixed image‘s width and height according to the min and max position
newWidth = xMaxAliasIndex - xMinAliasIndex + 1;
newHeight = yMaxAliasIndex - yMinAliasIndex + 1;
%%% ================================================================%%%
%%% end first step
%%% ================================================================%%%
%%% ================================================================%%%
%%% second step:
%%% for each point in the to-be-fixed imagecompute the corresponding position
%%% in th
- 上一篇:基础buck电路仿真
- 下一篇:SFLA算法 matlab
相关资源
-
自校正 调节器 控制器 matlab simuli
- 自动控制系统校正课程设计
- gamma校正matlab
- Fusiello极线校正 - 论文和Matlab程序
- 自动控制原理课程设计--用MATLAB进行控
- ISAR 飞机模型成像
-
模糊自校正PID simuli
nk 仿真 - matlab偏色校正代码
- 图像色彩校正代码
- 基于matlab的gamma校正
- radon变换车牌倾斜校正Matlab代码
- 经纬度映射法校正鱼眼图像 程序
- matlab红外图像两点定标非均匀校正
- 最小方差自校正调节器matlab
- MATLAB图像倾斜校正
- matlab 图像校正
- matlab 倾斜校正算法
- matlab程序 梯度校正参数辨识程序
- 梯度校正参数辨识程序
- 一种快速灰度校正方法
- 基于matlab的Boost变换器的有源功率因数
- 用matlab实现控制系统的超前校正设计
- 图像畸变校正
- 文档图像倾斜校正Matlab:霍夫变换原
- 梯度校正参数辨识方法算例及matlab程
- 时移相位差校正法
- 歪斜的图像校正成正视图
- 手机拍摄图像的二维码的提取
- 平均电流控制的有源功率因数校正(
- matlab鱼眼校正
评论
共有 条评论