-
-
Notifications
You must be signed in to change notification settings - Fork 72
Expand file tree
/
Copy pathestimateHomographies.m
More file actions
26 lines (23 loc) · 773 Bytes
/
estimateHomographies.m
File metadata and controls
26 lines (23 loc) · 773 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
%% estimate pairwise homographies
% input: imgs - source images
% output: homographies - homographies matrices to align each pair of images
function [ homographies ] = estimateHomographies( imgs )
% parameters
edgeThresh = 10;
successProb = 0.99;
inlierRatio = 0.3;
epsilon = 1.5;
% image information
nImgs = size(imgs, 4);
% pairwise homography estimation
homographies = zeros(3, 3, nImgs);
homographies(:, :, 1) = eye(3);
[f2, d2] = getSIFTFeatures(imgs(:, :, :, 1), edgeThresh);
for i = 2 : nImgs
f1 = f2;
d1 = d2;
[f2, d2] = getSIFTFeatures(imgs(:, :, :, i), edgeThresh);
[matches, ~] = getPotentialMatches(f1, d1, f2, d2);
homographies(:, :, i) = RANSAC(successProb, inlierRatio, 4, matches, epsilon, @solveHomography, @compError);
end
end