% Complete HSM algorithm: find the roto-translations that % overlap two sets of points. % % With respect to test1.m and test2.m, we now encapsulate % much of the functionalities in external functions function result =test3 % We create the first set of points npoints = 18; xAxis = 2; yAxis = 1; noise = 0.4; points1 = patternEllipse(npoints,xAxis, yAxis, noise) ; % We sample a random roto-translation % translation T = rand(2,1) % rotation, between -pi and pi theta = (rand)*2*pi % We do a roto-translation of the first set and then % add some noise points2 = points1; % translation points2 = points2 + repmat(T,1,size(points2,2)); % rotation points2 = rotationMatrix(theta) * points2; % add noise noise = 0.2; points2 = points2 + noise * randn(2, size(points2,2)); % We create this object "params" to hold the parameters params.thetaCells = 360; params.rhoCells = 100; params.rhoScale = 6; params.points1 = points1; params.points2 = points2; params.maxPhiHypotheses = 4; params.maxTHypotheses = 2; params.phiFilterSigma = 15; params.rhoFilterSigma = 4; params.maxRhoCorrelations = 8; params.maxTBound = 1.1; result = doHSM(params); [f1,f2] = displayHSMResult(result); figure(f1); set(gcf, 'PaperPositionMode', 'auto'); set(gcf, 'position', [0 0 400 800]) print -depsc2 -tiff testPoints-phi.eps print -dpng testPoints-phi.png figure(f2); set(gcf, 'PaperPositionMode', 'auto'); set(gcf, 'position', [0 0 400 300]) print -depsc2 -tiff testPoints-t.eps print -dpng testPoints-t.png