资源简介
这是我自己编写的matlab运动模糊盲复原程序
代码片段和文件信息
function [THETAS] = EstAngle(ifbl)
%Function to estimate blur angle
%Inputs: ifbl expertstatus
%Returns: THETAS
%
%ifbl: It is the input image.
%THETAS: It is the blur angle. The angle at which the image is blurred. It
% is a collection of possible blur angles.
%
%Example:
% [THETAS] = EstAngle(image expertstatus handle);
% This call takes image as input and returns a group of blur angle.
%No of steps in the algorithm
steps = 8;
%Number of estimates required
noofest = 10;
%Preprocessing
%Performing Median Filter before restoring the blurred image
ifbl = medfilt2(abs(ifbl));
%We have to convert the image to Cepstrum domain
%This is how we represent Cepstrum Domain
%Cep(g(xy)) = invFT{log(FT(g(xy)))}
%Converting image from spatial domain to frequency domain
fbl = abs(fft2(ifbl));
%Performing Log Transform
lg = log(1+fbl);
lgpow = abs(lg).^2;
%Converting to cepstral domain
lgcep = ifft2(lgpow);
%Finding edges in image
BW = edge(lgcep);
BW = ifftshift(BW);
%Calling hough transform
h = Hough(BW);
siz = size(ifbl);
rl = ceil(sqrt(siz(1)^2+siz(2)^2));
%Finding first maximum in the accumulator
maxi = 0;
theta = 0;
for i = 1:rl
for j = 1:360
if h(ij)>maxi
maxi = h(ij);
theta = j;
end
end
end
%Storing first maximum in the array
g = 1;
maxarr(g) = theta;
g = g + 1;
%Saving our original accumulator array
h2 = h;
%Iterating 10 times to find 10 highest angle values
for p = 1:(noofest-1)
%Band Elimination the region of +5 & -5 degrees of the maximum angle
%If angle is between 0 and 5
if theta<=5
for j = 1:theta+5
for i = 1:rl
h2(ij)=0;
end
end
for j = 355:360
for i = 1:rl
h2(ij)=0;
end
end
%If angle is between 355 and 360
elseif theta>=355
for j = theta-5:360
for i = 1:rl
h2(ij)=0;
end
end
for j = 1:360-theta
for i = 1:rl
h2(ij)=0;
end
end
%For any other angle
else
for j = theta-5:theta+5
for i = 1:rl
h2(ij)=0;
end
end
end
%Finding the next maximum
maxi = 0;
theta = 0;
for i = 1:rl
for j = 1:360
if h2(ij)>maxi
maxi = h2(ij);
theta = j;
r1 = i;
end
end
end
%Storing next maximum in the array
maxarr(g) = theta;
g = g + 1;
end
newarr = maxarr;
arrsiz = size(maxarr);
%Fitting it into 180 degrees
for i = 1:arrsiz(2)
if newarr(i)>180
newarr(i) = newarr(i)-180;
end
end
%Possible values of THETA
THETAS = newarr;
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 118886 2013-12-26 13:53 matlab运动模糊盲复原\20131226135258.jpg
文件 2932 2013-12-25 16:15 matlab运动模糊盲复原\EstAngle.m
文件 1838 2013-12-25 16:18 matlab运动模糊盲复原\EstLen.m
文件 828 2013-12-22 16:20 matlab运动模糊盲复原\Hough.m
文件 512 2013-12-26 20:45 matlab运动模糊盲复原\main.m
目录 0 2013-12-26 20:43 matlab运动模糊盲复原
----------- --------- ---------- ----- ----
124996 6
- 上一篇:LFM脉冲压缩matlab程序264292
- 下一篇:导线网平差
相关资源
- LFM脉冲压缩matlab程序264292
- 异步电机直接转矩控制Matlab仿真
- CNN卷积神经网络的MATLAB程序解释
- 模糊K-均值算法及其matlab实现
- 基于MATLAB的_4_DQPSK信号差分解调性能仿
- 波束形成算法
- matlab can总线工具箱介绍
- matlab修正离轴制作全息图与再现
- Wagner Whitin算法的Matlab实现附有算例
- doa算法的matlab实现
- MATLAB中傅里叶变换常用函数
- matlab信噪比的计算
- 相控阵天线测试仿真
- matlab空间圆弧插补程序
- 小波变换图像去噪MATLAB仿真
- 圆阵目标方位估计,mvdr方法matlab
- 线性偏振片Mueller矩阵计算_Matlab代码
- 无约束最优控制matlab程序
- 回声抵消器
- 基于肤色的人脸检测matlab代码
- 详解MATLAB 数字信号处理[张德丰][程序
- 7,3循环码课程设计
- 卡尔曼滤波matlab代码
- GPS 捕获 matlab仿真实现
- Matlab最早版本
- 用MATLAB实现Bresenham方法画圆
- 智能优化算法及其MATLAB第2版-书中的
- 基于遗传算法的TSP问题(matlab)
- dipum_toolbox_2.0.1.zip数字图像处理课本自
- bsc信道的2/3卷积码matlab仿真
评论
共有 条评论