资源简介
这个代码用于数字图像处理中的图像拼接,几幅具有公共区域的图像可以拼接成一幅全图。
代码片段和文件信息
% Load images.
buildingDir = fullfile(toolboxdir(‘vision‘) ‘visiondata‘ ‘building‘);
buildingScene = imageDatastore(buildingDir);
% Display images to be stitched
montage(buildingScene.Files)
% Read the first image from the image set.
I = readimage(buildingScene 1);
% Initialize features for I(1)
grayImage = rgb2gray(I);
points = detectSURFFeatures(grayImage);
[features points] = extractFeatures(grayImage points);
% Initialize all the transforms to the identity matrix. Note that the
% projective transform is used here because the building images are fairly
% close to the camera. Had the scene been captured from a further distance
% an affine transform would suffice.
numImages = numel(buildingScene.Files);
tforms(numImages) = projective2d(eye(3));
% Iterate over remaining image pairs
for n = 2:numImages
% Store points and features for I(n-1).
pointsPrevious = points;
featuresPrevious = features;
% Read I(n).
I = readimage(buildingScene n);
% Detect and extract SURF features for I(n).
grayImage = rgb2gray(I);
points = detectSURFFeatures(grayImage);
[features points] = extractFeatures(grayImage points);
% Find correspondences between I(n) and I(n-1).
indexPairs = matchFeatures(features featuresPrevious ‘Unique‘ true);
matchedPoints = points(indexPairs(:1) :);
matchedPointsPrev = pointsPrevious(indexPairs(:2) :);
% Estimate the transformation between I(n) and I(n-1).
tforms(n) = estimateGeometricTransform(matchedPoints matchedPointsPrev...
‘projective‘ ‘Confidence‘ 99.9 ‘MaxNumTrials‘ 2000);
% Compute T(1) * ... * T(n-1) * T(n)
tforms(n).T = tforms(n-1)
相关资源
- 图像降噪Matlab代码
- 8916_msimage.mbn
- image normalization图像归一化matlab程序
- BM3D matlab
- HDR_image-master MATLAB仿真程序
- image fusion tools
- IMAGE_MATLAB_GUI
- Deblurring Images Matrices Spectra and Filteri
- _image fusion(精品.zip
- matlab开发-Poissonimageediting
- BM3D滤波算法+BM3D_image,可实现
- digital image correlation
- Biosignal and biomedical image processing matl
- HDR_image-master MATLAB 仿真程序 包含多张
- kmeans图像分类
- Image Deformation Using Moving Least Squaresma
- matlab开发-Image2Data
- Image Deformation Using Moving Least Squares 移
- MATLAB实现灰度处理
- Quaternion and Octonion Color Image Processing
- [实用Matlab图像与视频处理][ocr_exampl
- Gonzalez_2009_Digital Image Processing Using M
- 数字图像处理MATLAB版第二版配套资源
- 图像分割的matlab算法
- Rectangling Panoramic Images via Warping论文的
- Digital Image Processing Using Matlab_2ed_Gonz
- SAR图像分类识别
- 基于MATLAB的金属表面缺陷分类与测量
- MATLAB Image Processing Toolbox官方教程
- MATLAB图像处理能力提高与应用案例
评论
共有 条评论