matlab——图像配准
来源:互联网 发布:xftp连接linux失败 编辑:程序博客网 时间:2024/06/01 10:28
只介绍两种方法:
第一种为手动选关键点:
function on2 = registerImages1(MOVING,FIXED,type) cpselect(FIXED, MOVING) %选择关键点 flag = input('Hit the Enter key after you finished control points selection'); mytform = cp2tform(input_points,base_points, 'projective');%求出投影变化的矩阵 registered = imtransform(MOVING, mytform, 'bicubic');%进行变化 on2=registered;%输出变换结果end
第二种为image process toolbox中的自动feature-based 函数中的SURF 函数:
function on2 = registerImages1(MOVING,FIXED,type)% 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(MOVING,FIXED) 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 fixedPoints = detectSURFFeatures(FIXED,'MetricThreshold',750.000000,'NumOctaves',3,'NumScaleLevels',5); movingPoints = detectSURFFeatures(MOVING,'MetricThreshold',750.000000,'NumOctaves',3,'NumScaleLevels',5); % Extract features [fixedFeatures,fixedValidPoints] = extractFeatures(FIXED,fixedPoints,'Upright',false); [movingFeatures,movingValidPoints] = extractFeatures(MOVING,movingPoints,'Upright',false); % Match features indexPairs = matchFeatures(fixedFeatures,movingFeatures,'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(movingMatchedPoints,fixedMatchedPoints,'projective'); MOVINGREG.Transformation = tform; MOVINGREG.RegisteredImage = imwarp(MOVING, movingRefObj, tform, 'OutputView', fixedRefObj, 'SmoothEdges', true); on2=MOVINGREG.RegisteredImage;endfunction checkLicense()% Check for license to Computer Vision System ToolboxCVSTStatus = license('test','video_and_image_blockset');if ~CVSTStatus error(message('images:imageRegistration:CVSTRequired'));endend
第二种其实就是工具箱函数的输出,如果需要使用,直接用工具箱就好。
0 0
- matlab——图像配准
- matlab图像配准
- matlab—图像显示
- 图像的配准——MATLAB实现
- matlab图像配准2
- MATLAB实现图像配准
- 图像傅里叶变换——MATLAB
- matlab实现多种图像配准
- (2)MATLAB 车牌图像配准
- 图像配准实现(matlab篇)
- 图像配准实现(matlab篇)
- matlab 两幅图像配准
- 【图像处理】MATLAB:几何变换与图像配准
- Matlab图像处理1——imgadjust
- MATLAB图像处理——特征提取
- Matlab 图像处理 ——特征提取
- 图像平移 ——MATLAB实现
- 图像转置——MATLAB实现
- ubuntu16.04 xshell链接后不弹出输入用户名和密码框
- Linux网卡的配置
- Mybatis 学习一
- git相关
- git问题 warning: LF will be replaced by CRLF in README.md.
- matlab——图像配准
- RecycleView多条目布局不填充满父布局
- spring与mybatis整合配置文件详解
- Java高新技术第一篇:类加载器详解
- 各厂商接入交换机通过ACL限制端口应用的配置信息
- 一个UILabel不同部分显示不同颜色
- 【Java深入】ArrayList源码剖析(一)
- 41万亿元规模的消金行业,重构势在必行,AI算法会是突破口?
- 关于移动端input框 在手机页面中无法输入文字的问题