%%%%%%%VERSION 2
%%ANOTHER DESCRIBTION OF GABOR FILTER
%The Gabor filter is basically a Gaussian (with variances sx and sy along x and y-axes respectively)
%modulated by a complex sinusoid (with centre frequencies U and V along x and y-axes respectively)
%described by the following equation
%%
% -1 x' ^ y' ^
%%% G(x,y,theta,f) = exp ([----{(----) 2+(----) 2}])*cos(2*pi*f*x');
% 2 sx' sy'
%%% x' = x*cos(theta)+y*sin(theta);
%%% y' = y*cos(theta)-x*sin(theta);
%% Describtion :
%% I : Input image
%% Sx & Sy : Variances along x and y-axes respectively
%% f : The frequency of the sinusoidal function正弦函数的频率
%% theta : The orientation of Gabor filter滤波器的方向
%% G : The output filter as described above输出滤波器
%% gabout : The output filtered image过滤的图像
%% Author : Ahmad poursaberi e-mail : a.poursaberi@ece.ut.ac.ir
%% Faulty of Engineering, Electrical&Computer Department,Tehran
%% University,Iran,June 2004
function gabout=gaborfilter2(I,Sx,Sy,f,theta);
if isa(I,'double')~=1
I = double(I);
end
for x = -fix(Sx):fix(Sx) %fix:朝零方向取整
for y = -fix(Sy):fix(Sy)
xPrime = x * cos(theta) + y * sin(theta);%将 Gabor(x,y)中的x,y坐标以theta角度进行方向坐标变换:
yPrime = y * cos(theta) - x * sin(theta);
G(fix(Sx)+x+1,fix(Sy)+y+1) = exp(-.5*((xPrime/Sx)^2+(yPrime/Sy)^2)) * cos(2*pi*f*xPrime)/(2*pi);
end
end
Imgabout = conv2(I,double(imag(G)),'same');
Regabout = conv2(I,double(real(G)),'same');
gabout = sqrt(Imgabout.*Imgabout + Regabout.*Regabout);
%G
%size(G)
%figure;imshow(G,[]);
%figure;g=log(abs(fftshift(fft2(double(G)))));imshow(g,[]);
%figure;imshow(gabout,[]);
%figure;g=log(abs(fftshift(fft2(double(gabout)))));imshow(g,[]);
基于多尺度融合的布匹瑕疵检测技术(代码完整,数据齐全)
34 浏览量
2023-08-19
07:29:09
上传
评论 1
收藏 3.48MB RAR 举报
神经网络机器学习智能算法画图绘图
- 粉丝: 2485
- 资源: 605
最新资源
- cmak-3.0.0.6.zip
- Map2ShpPro-Demo.zip
- vue3 的 main.ts 文件,包含了 elementui-plus 注册,icon 全局注册等常用注册
- Typecho博客主题Joe素颜执念修改版
- SP8K32-TB-VB一款2个N-Channel沟道SOP8的MOSFET晶体管参数介绍与应用说明
- Alibaba 阿里P9百亿级高并发系统设计手册最新全彩PDF版本
- Socket通讯验证工具 可验证本机端口是否被占用 验证服务端端口是否开通或可访问 查看服务端与客户端的socket发送信息
- SP8K31-TB-VB一款2个N-Channel沟道SOP8的MOSFET晶体管参数介绍与应用说明
- 安卓AndroidStudio基于百度云平台人脸识别学生考勤签到系统
- 红外温度传感器的原理及应用
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈