i have writen SURF feature detection and RANSAC code with the help of matlab demo and video , please help me to get final panoroma image i m not geting final output , please help to find the error in the code.
1 visualizzazione (ultimi 30 giorni)
Mostra commenti meno recenti
clc;
close all;
clear all;
whos
imgArgb = im2single(imread('9.1.jpg'));
imgBrgb = im2single(imread('9.2.jpg'));
imgArgb_resized = imresize(imgArgb,0.25); imgBrgb_resized = imresize(imgBrgb,0.25); imgA = rgb2gray(imgArgb_resized); imgB = rgb2gray(imgBrgb_resized);
h1 = figure; set(h1,'Position',[200,533,1064,346]); subplot(1,2,1); imshow(imgArgb_resized); subplot(1,2,2); imshow(imgBrgb_resized); %imshow(imgA); %imshow(imgB);
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%feature detection h2 = figure; set(h2,'NumberTitle','Off','Position',[478 695 564 386]); set(h2,'Name','Surf Dtection'); pointsA = detectSURFFeatures(imgA); pointsB = detectSURFFeatures(imgB); imshow(imgA); hold on; Subset_Features = pointsA(1:9:end); plot(Subset_Features);
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%extrction%%%%%%%%%%%%%%%%
[featuresA, pointsA]= extractFeatures(imgA,pointsA); [featuresB, pointsB]= extractFeatures(imgB,pointsB);
%%%%%%%%%%%%%%%%%%%%%%%%%%%match features %%%%%%%%%%%%%%%%%%5
indexPairs = matchFeatures(featuresA, featuresB,'Method','Threshold'); numMatchedPoints = int32(size(indexPairs,1));
matchedPointsA = pointsA(indexPairs(:,1),:); matchedPointsB = pointsB(indexPairs(:,2),:); figure; showMatchedFeatures(imgA, imgB, matchedPointsA, matchedPointsB); legend('Image 1','Image 2');
hGTE2 = vision.GeometricTransformEstimator('Transform','Projective','InlierOutputPort',true,'AlgebraicDistanceThreshold',3,'RefineTransformMatrix',true,'NumRandomSamplings',2000);
hGT = vision.GeometricTransformer; [tform, inliers] = step(hGTE2, matchedPointsB.Location, matchedPointsA.Location);
%%%%%%%%%%%%%%%%%%%%Apply geometric transformation
hGTPrj = vision.GeometricTransformer('OutputImagePositionSource','Property','OutputImagePosition',[1 1 600 300],'BackgroundFillValue',0);
mod_imgBrgb(:,:,1) =step(hGTPrj,imgBrgb_resized(:,:,1), tform); mod_imgBrgb(:,:,2) =step(hGTPrj,imgBrgb_resized(:,:,2), tform); mod_imgBrgb(:,:,3) =step(hGTPrj,imgBrgb_resized(:,:,3), tform);
halphablender = vision.AlphaBlender('Operation','Binary mask', 'MaskSource','Input port'); a = step(halphablender,mod_imgBrgb,imgArgb_resized,rgb2gray(imgArgb_resized)<1);
1 Commento
Risposte (0)
Vedere anche
Categorie
Scopri di più su Feature Detection and Extraction in Help Center e File Exchange
Prodotti
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!