资源简介
本案例是利用Matlab来查找两幅图像的不同之处,利用SURF特征匹配的算法将图片对齐,之后采用形态学算法,对图像进行处理。大家下载之后可以快速的入门,欢迎大家下载。

代码片段和文件信息
function on2 = Align(MOVINGFIXED)
% This function can be used to image registration 该函数可用于图像配准
% moving is image A fixed is image B
% type is the method used
% type ‘no‘do not use image registration
% type ‘auto‘ use the automatic image registration.
% type ‘user‘ use the user defined control points to registration
% registerImages Register grayscale images using auto-generated code from Registration Estimator app.
% [MOVINGREG] = registerImages(MOVINGFIXED) Register grayscale images
% MOVING and FIXED using auto-generated code from the Registration
% Estimator App. The values for all registration parameters were set
% interactively in the App and result in the registered image stored in the
%-----------------------------------------------------------
% Feature-based techniques require license to Computer Vision System Toolbox
% 基于特征的技术需要计算机视觉系统工具箱的许可
checkLicense()
% Default spatial referencing objects 默认空间引用对象
fixedRefObj = imref2d(size(FIXED));
movingRefObj = imref2d(size(MOVING));
% Detect SURF features 检测SURF特征并返回SURFPoints对象
fixedPoints = detectSURFFeatures(FIXED‘MetricThreshold‘750.000000‘NumOctaves‘3‘NumScaleLevels‘5);
movingPoints = detectSURFFeatures(MOVING‘MetricThreshold‘750.000000‘NumOctaves‘3‘NumScaleLevels‘5);
% Extract features 特征提取
[fixedFeaturesfixedValidPoints] = extractFeatures(FIXEDfixedPoints‘Upright‘false);
[movingFeaturesmovingValidPoints] = extractFeatures(MOVINGmovingPoints‘Upright‘false);
% Match features 特征匹配
indexPairs = matchFeatures(fixedFeaturesmovingFeatures‘MatchThreshold‘50.000000‘MaxRatio‘0.500000);
fixedMatchedPoints = fixedValidPoints(indexPairs(:1));
movingMatchedPoints = movingValidPoints(indexPairs(:2));
MOVINGREG.FixedMatchedFeatures = fixedMatchedPoints;
MOVINGREG.MovingMatchedFeatures = movingMatchedPoints;
% Apply transformation - Results may not be identical between runs because of the randomized nature of the algorithm
% 应用转换——由于算法的随机性,运行之间的结果可能不相同
tform = estimateGeometricTransform(movingMatchedPointsfixedMatchedPoints‘projective‘);
MOVINGREG.Transformation = tform;
MOVINGREG.RegisteredImage = imwarp(MOVING movingRefObj tform ‘OutputView‘ fixedRefObj ‘SmoothEdges‘ true);
on2=MOVINGREG.RegisteredImage;
end
function checkLicense()
% Check for license to Computer Vision System Toolbox 获取计算机视觉系统工具箱许可证
CVSTStatus = license(‘test‘‘video_and_image_blockset‘);
if ~CVSTStatus
error(message(‘images:imageRegistration:CVSTRequired‘));
end
end
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 2881 2018-12-24 16:31 Align.m
文件 3217 2018-12-24 16:33 Main.m
文件 2857 2018-12-24 16:15 Remove_LargeArea.m
文件 64930 2018-12-12 20:01 test2-1.jpg
文件 73861 2018-12-13 18:26 test2-2.jpg
文件 146086 2018-12-13 10:29 timg-1.1.jpg
文件 147725 2018-12-13 09:38 timg-2.2.jpg
文件 108559 2018-12-12 19:56 timg2-1.jpg
文件 115671 2018-12-13 18:42 timg2-2.jpg
文件 84459 2018-12-13 18:45 timgKT-1.jpg
文件 98614 2018-12-13 18:52 timgKT-2.jpg
文件 215 2018-12-25 19:56 程序说明.txt
相关资源
- 四旋翼MATLAB仿真文件+实验报告
- 串行级联cpm系统MATLAB仿真
- matlab_OFDM调制解调(来自剑桥大学)
- Matlab路面裂缝识别69319
- 高灵敏度GPS接收机MATLAB仿真,附捕获
- 基于MATLAB的质点弹道计算与外弹道优
- 阵列天线的matlab仿真
- MATLAB 经典程序源代码大全
- MATLAB小波软阈值去噪代码33473
- 天线阵的波束形成在MATLAB仿真程序及
- 非线性SVM算法-matlab实现
- 《MATLAB 智能算法超级学习手册》-程序
- 组合导航matlab程序
- 读取txt文件内容matlab代码实现
- Matlab实现基于相关的模板匹配程序
- matlab优化工具箱讲解
- 基于MATLAB的快速傅里叶变换
- 光纤传输中的分布傅立叶算法matlab实
- 基于matlab的图像处理源程序
- matlab 椭圆拟合程序
- 算术编码解码matlab源代码
- optical_flow 光流法 matlab 实现程序
- 引导图像滤波器 Matlab实现
- 分形几何中一些经典图形的Matlab画法
- OFDM系统MATLAB仿真代码
- SVM工具箱(matlab中运行)
- 图像小波变换MatLab源代码
- LU分解的MATLAB实现
- 冈萨雷斯数字图像处理matlab版(第三
- 替代数据法的matlab程序
评论
共有 条评论