资源简介
本案例是利用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
相关资源
- Pattern Recognition and Machine Learning(高清
- MATLAB 编程 第二版 Stephen J. Chapman 著
- 均值滤波和FFT频谱分析Matlab代码
- 《MATLAB扩展编程》代码
- HDB3码、AMI码的MATLAB实现
- 3点GPS定位MATLAB仿真
- MATLAB数字信号处理85个实用案例精讲入
- matlab从入门到精通pdf94795
- 欧拉放大论文及matlab代码
- 跳一跳辅助_matlab版本
- 全面详解LTE MATLAB建模、仿真与实现
- MIMO-OFDM无线通信技术及MATLAB实现_孙锴
- MATLAB Programming for Engineers 4th - Chapman
- matlab 各种谱分析对比
- 分数阶chen混沌matlab程序
- 基于粒子群算法的非合作博弈的matl
- MATLAB车流仿真 包括跟驰、延误
- matlab空间桁架计算程序
- 基于MATLAB的图像特征点匹配和筛选
- DMA-TVP-FAVAR
- GPS信号的码捕获matlab代码.7z
- 一维光子晶体MATLAB仿真代码吸收率折
- newmark法源程序
- 传统关联成像、计算鬼成像matlab
- pri传统分选算法
- 摆动滚子推杆盘形凸轮设计
- 医学图像重建作业matlab源码
- Matlab实现混沌系统的控制
- 检测疲劳驾驶
- Matlab锁相环仿真-Phase Locked Loop.rar
评论
共有 条评论