Intro. Essential Mat. Fundamental Mat. Epipolar Geom. Corresp. Reconst Matlab tool for pixel normalization %from %http://www.mathworks.com/matlabcentral/fileexchange/27541-fundamental-matrix-computation function [norm mat]=get normalization matrices(x) computes the norm mat such that if transformed by norm mat x is approximately centered around the origin and has an average distance of sqrt 2)to origin See appendix for how inputs: x 3xN homogeneous coordinates of x normalization works %ourputs: norm mat 3x3 see above function [ norm mat]=get normalization matrix(x) if size (x, 1 )=3; error( point should have dimension 3xN),end if sum(isnan(x()))I sum(isif(x ( ))), error(,points can not be on infinity),end if sum(x(3, )<1e-10), error('this method does not support points at infinity"), end although points might be improperly scal ed centroid= mean(x, 2) dists= sqrt(sum((x-repmat(centroid, 1, size (x, 2))). 2, 1) mean dist =mean dists norm mat=[sqrt(2)/mean dist O-sqrt(2)/mean dist*centroid (1); 0 sqrt(2)/mean dist-sqrt(2 )/mean dist*centroid (2) 001]; Seealsohttps://ww2.mathworks.cn/matlabcentral/mlc downloads/downloads /submissions /27541/versions/1/previews/get_ normalization_matrix m/in dex. htmlMatlab tool for pixel normalization Stereo vO. a
Intro. | Essential Mat. | Fundamental Mat. | Epipolar Geom. | Corresp. | Reconst. Matlab tool for pixel normalization • %from • %http://www.mathworks.com/matlabcentral/fileexchange/27541-fundamental-matrix-computation • % function [norm_mat] = get_normalization_matrices(x) • % computes the norm_matsuch that if transformed by norm_mat • % x is approximately centered around the origin and has • % an average distance of \sqrt{2} to origin. • % inputs: x 3xN homogeneous coordinates of x • % ourputs: norm_mat 3x3 see above • function [norm_mat] = get_normalization_matrix(x) • if size(x,1) ~= 3; error('point should have dimension 3xN'), end • if sum(isnan(x(:))) || sum(isinf(x(:))), error('points can not be on infinity'), end • if sum(x(3,:) < 1e-10), error('this method does not support points at infinity'), end % although points might be improperly scal ed! • centroid = mean(x,2); • dists = sqrt(sum((x -repmat(centroid,1,size(x,2))).^2,1)); • mean_dist = mean(dists); • norm_mat = [sqrt(2)/mean_dist 0 -sqrt(2)/mean_dist*centroid(1);... • 0 sqrt(2)/mean_dist-sqrt(2)/mean_dist*centroid(2);... • 0 0 1]; • end See also https://ww2.mathworks.cn/matlabcentral/mlcdownloads/downloads/submissions/27541/versions/1/previews/get_normalization_matrix.m/in dex.htmlMatlab tool for pixel normalization Stereo v0.a 26 See appendix for how normalization works
Intro. I Essential Mat. I Fundamental Mat. KEpipolar Geom) Corresp. I Reconst Epipolar geometry Based on E or f we have specia relations between the two cameras in a stereo system eg ( Epipolar lines (i) Epipoles Stereo vO. a 27
Intro. | Essential Mat. | Fundamental Mat. | Epipolar Geom. | Corresp. | Reconst. Epipolar geometry : Based on E or F, we have special relations between the two cameras in a stereo system, e.g. (i) Epipolar lines (ii) Epipoles Stereo v0.a 27
Intro. I Essential Mat. I Fundamental Mat. KEpipolar Geom) Corresp. I Reconst G Epipolar lines U2 (F*U1=0, (F*u1)is a 3x1 vector, we can set it be L2=F*u1 So u2(L2) =0, this shows the point u2 is on Line L2 Meaning: A point u, in the left image( cam1) Has a corresponding epipolar line l, in the right image (point / line relation la bc]=(F*u, =L, is 3x1 vector, note u,=lujv, 1] and u2=lu2,v2, 1 u2,v2I The epipolar line equation in the right image cam2 ) is au2+bv2+c=0 The Line l2 passes through [ V2, 1 in the right image Stereo vO. a
Intro. | Essential Mat. | Fundamental Mat. | Epipolar Geom. | Corresp. | Reconst. (i) Epipolar lines • u2 T*(F*u1 )=0, (F*u1 ) is a 3x1 vector, we can set it be L2=F*u1 • So u2 T*(L2 )=0, this shows the point u2 T is on Line L2 • Meaning: A point u1 in the left image (cam1) – Has a corresponding epipolar line L2 in the right image (point / line relation) – [a b c]T=(F*u1 )=L2 is 3x1 vector, – note u1=[u1 ,v1 ,1]T and u2=[u2 ,v2 ,1]T – The epipolar line equation in the right image (cam2) is au2+bv2+c=0 – The Line L2 passes through [u2 , v2 ,1]T in the right image • Stereo v0.a 28
Intro. I Essential Mat. I Fundamental Mat. KEpipolar Geom) Corresp. | Reconst Left-point governs the right epipolar line la b c=(FU,=L, is 3x 1 vector The epipolar line equation in the right image is au, tbv tC=O The line lz passes through u2=Lu2, v2 1]in the right image Left side is the reference Right epipolar line l, Left lu, val right frame Frame plane plane 1 O1 epipole epipole e Focal F Focal length=f, length-f2
Intro. | Essential Mat. | Fundamental Mat. | Epipolar Geom. | Corresp. | Reconst. Left-point governs the right epipolar line • Stereo v0.a 29 X O2 Ol right Frame plane1 2 Left Frame plane1 1 Epipole e1 Epipole e2 Right epipolar line L2 F (u1 ,v1 ) (u2 ,v2 ) Left side is the reference Focal length=f1 Focal length=f2 [a b c]T=(F*u1 )=L2 is 3x1 vector The epipolar line equation in the right image is au2+bv2+c=0 The Line L2 passes through u2=[u2 , v2 ,1]T in the right image
Intro. I Essential Mat. I Fundamental Mat. KEpipolar Geom) Corresp. I Reconst Similarly Right-point governs the left epipolar line [a'b'c]=(FT*u2=L, is 3x1 vector The epipolar line equation in the right image is a'utb' v+C=Q The Line L,passes through X U,=[Ul, v,, 1] in the left image Left side is the reference u1.v Left epipolar line Li Left (2 Right frai Frame plane plane O1 e epipole e Focal epipole T Focal length=f, ength
Intro. | Essential Mat. | Fundamental Mat. | Epipolar Geom. | Corresp. | Reconst. Similarly: Right-point governs the left epipolar line • Stereo v0.a 30 X O2 Ol Right Frame plane1 2 Left Frame plane1 1 e1 e2 Left epipolar line L1 F T (u2 ,v2 ) (u1 ,v1 ) Epipole e1 Epipole e2 Left side is the reference Focal length=f1 Focal length=f2 [a’ b’ c’]T=(FT*u2 )=L1 is 3x1 vector The epipolar line equation in the right image is a’u+b’v+c’=0 The Line L1 passes through u1= [u1 , v1 ,1] Tin the left image