matlab で画像をスティッチングする目的で、RANSAC アルゴを実装する必要があります。bestMatches マトリックス (2 x 500) の 2 つの画像からの最適な一致点があります。次に、RANSAC を実装する必要があります。これが私がこれまでに行ったことです。何をする必要があるかについてコメントを付けました。だれかが実装を手伝ってくれますか?それを全体として。私はこれを行うために何日も懸命に努力しましたが、成功しませんでした. 助けてください。
% ---- run RANSAC ----
% define RANSAC parameters
threshDistBetPoints = 0.1;
numOfIteration = 50;
numOfRandomPoints = 3;
inlierRatio = 0.6;
% output parameters of RANSAC
best_transform = [];
best_num_inliers = 0;
% Plot the data points
for i=1:numOfIteration
% 1) select 3 random points
idx = randperm(size(bestMatches,2),numOfRandomPoints);
sample = bestMatches(:,idx);
% 2) compute affine transform T'
% 3) take all 500 matching points
% map all Q(right image) to P'(left image) (transformation)
% Compute distances between P' and P point (Left Image)
% compute no. of inliers
% 4) store the currently best affine transform
% output of first iteration - T' and no. of inliers
if inlierNum >= best_num_inliers
best_num_inliers = inlierNum
if end
for end
% End of algorithm best transform = T' with largest numbers of inliers
% stitch function - already implemented
Additional information
sample =
3677 6527 2759
3413 6343 2485