CEE598 - Visul Sensing for Civil Infrsrucure Eng. & Mgm. Session 2 Review of Liner Algebr nd Geomeric Trnsformions Mni Golprvr-Frd Deprmen of Civil nd Environmenl Engineering Deprmen of Compuer Science 329D, Newmrk Civil Engineering Lb e-mil: mgolpr@illinois.edu UNIVERSITY OF ILLINOIS AT URBANA-CHAMPAIGN
Useful Redings An book on liner lgebr! [HZ] chpers 2, 4. (b) Imge View 3D View () Temporr srucures, sie profile, foundion wlls, nd slb rebrs re reconsruced (c) Some of he slides in his lecure re coures o Prof. Ocvi I. Cmps, Penn Se Universi, Prof. Silvio Svrese, Snford Universi, Prof. Derek Hoie,, UIUC, nd Prof. Noh Snvel, Cornell Universi. 2 CEE598 Visul Sensing for Civil Infrsrucure Eng. & Mgm. Mni Golprvr-Frd, 24
DoProduc3D hp://www.ouube.com/wch?v=fkchlima5y 3 CEE598 Visul Sensing for Civil Infrsrucure Eng. & Mgm. Mni Golprvr-Frd, 24
Bringing BIM o Jobsies hp://www.ouube.com/wch?v=rwjzmmvl4 4 CEE598 Visul Sensing for Civil Infrsrucure Eng. & Mgm. Mni Golprvr-Frd, 24
Bringing BIM o Jobsies Benefi from Dil Phoo Collecions Uplod o Server (boh web-bsed nd Admin App Your overls (DCR, QA/QC, Punch Lis) show up on new phoos of consrucion elemens hp://www.ouube.com/wch?v=rwjzmmvl4 5 CEE598 Visul Sensing for Civil Infrsrucure Eng. & Mgm. Mni Golprvr-Frd, 24
Inroducion o Mchine Vision 6 CEE598 Visul Sensing for Civil Infrsrucure Eng. & Mgm. Mni Golprvr-Frd, 24
Ouline Imge Formion Review of Liner Algerb nd Geomeric Trnsformion Bsics definiions nd properies Geomericl rnsformions Applicion: removing perspecive disorion he DLT lgorihm Ne Clss 7 CEE598 Visul Sensing for Civil Infrsrucure Eng. & Mgm. Mni Golprvr-Frd, 24
Wh is n imge? hp://medi.phoobucke.com/imge/bes%2consrucion%2imge/joejordisonfn6/burj%252dubi%2522/5oi.jpg 8 CEE598 Visul Sensing for Civil Infrsrucure Eng. & Mgm. Mni Golprvr-Frd, 24
Wh is n imge? 9 Digil Cmer We ll focus on hese in his clss Source: A. Efros (More on his process ler) The Ee CEE598 Visul Sensing for Civil Infrsrucure Eng. & Mgm. Mni Golprvr-Frd, 24 9
Imges Discree represenion of coninuous funcion Ech imge is wo dimensionl rr of piels Piel: Elemen of picure cell of consn color in digil imge (i.e., numeric vlue represening uniform porion of n imge) Grscle All piels represen he inensi of ligh in n imge, be i red, green, blue, or noher color Similr o holding piece of rnspren colored plsic over our ees Inensi of ligh in piel is sored s number, generll..255 inclusive Coures of Howie Chose e l. CEE598 Visul Sensing for Civil Infrsrucure Eng. & Mgm. Mni Golprvr-Frd, 24
Imges (Con d) Color Three grscle imges lered on op of ech oher wih ech ler indicing he inensi of specific color ligh, generll red, green, nd blue (RGB) Third dimension in digil imge Resoluion Number of piels cross in horizonl Number of piels in he vericl Number of lers used for color Ofen mesured in bis per piel (bpp) where ech color uses 8 bis of d E: 644824bpp Coures of Howie Chose e l. CEE598 Visul Sensing for Civil Infrsrucure Eng. & Mgm. Mni Golprvr-Frd, 24
Imges (Con d) A grid (mri) of inensi vlues 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 2 255 255 255 255 255 255 255 255 255 255 75 75 75 255 255 255 255 255 255 = 255 255 75 95 95 75 255 255 255 255 255 255 255 255 96 27 45 75 255 255 255 255 255 255 255 255 27 45 75 75 75 255 255 255 255 255 255 255 27 45 2 2 75 75 95 255 255 255 255 255 27 45 2 2 75 75 95 47 255 255 255 255 27 45 45 75 27 27 95 47 255 255 255 255 74 27 27 27 95 95 95 47 255 255 255 255 255 74 74 74 74 74 74 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 (common o use one be per vlue: = blck, 255 = whie) Source: Noh Snvel CEE598 Visul Sensing for Civil Infrsrucure Eng. & Mgm. Mni Golprvr-Frd, 24 2
Color Imge R G B Coures of Derek Hoiem CEE598 Visul Sensing for Civil Infrsrucure Eng. & Mgm. Mni Golprvr-Frd, 24 3
Imges in Mlb Imges represened s mri Suppose we hve NM RGB imge clled im im(,,) = op-lef piel vlue in R-chnnel im(,, b) = piels down, piels o righ in he b h chnnel im(n, M, 3) = boom-righ piel in 3-chnnel imred(filenme) reurns uin8 imge (vlues o 255) Conver o double form (vlues o ) wih im2double Coures of Derek Hoiem row column.92.93.94.97.62.37.85.97.93.92.99.95.89.82.89.56.3.75.92.8.95.9.89.72.5.55.5.42.57.4.49.9.92 G.92.93.94.97.62.37.85.97.93.92.99.96.95.88.94.56.46.9.87.9.97.95.95.89.82.89.56.3.75.92.8.95.9.7.8.8.87.57.37.8.88.89.79.85.89.72.5.55.5.42.57.4.49.9.92.49.62.6.58.92.5.93.6.94.58.97.5.62.6.37.45.85.33.97.93.92.99.96.95.88.94.56.46.9.87.9.97.95.86.84.74.58.95.5.89.39.82.73.89.92.56.9.3.49.75.74.92.8.95.9.7.8.8.87.57.37.8.88.89.79.85.96.67.54.85.89.48.72.37.5.88.55.9.5.94.42.82.57.93.4.49.9.92.49.62.6.58.5.6.58.5.6.45.33.69.49.56.66.96.43.95.42.88.77.94.73.56.7.46.9.9.99.87.9.97.95.86.84.74.58.5.39.73.92.9.49.74.79.73.9.67.7.33.8.6.8.69.87.79.57.73.37.93.8.97.88.89.79.85.96.67.54.85.48.37.88.9.94.82.93.9.94.89.49.49.4.62.78.6.78.58.77.5.89.6.99.58.93.5.6.45.33.69.49.56.66.43.42.77.73.7.9.99.86.84.74.58.5.39.73.92.9.49.74.79.73.9.67.33.6.69.79.73.93.97.96.67.54.85.48.37.88.9.94.82.93.9.94.89.49.4.78.78.77.89.99.93.69.49.56.66.43.42.77.73.7.9.99.79.73.9.67.33.6.69.79.73.93.97.9.94.89.49.4.78.78.77.89.99.93 CEE598 Visul Sensing for Civil Infrsrucure Eng. & Mgm. Mni Golprvr-Frd, 24 R B 4
Wh is liner lgebr useful in compuer vision? Represenion 3D poins in he scene 2D poins in he imge Coordines will be used o Perform geomericl rnsformions Associe 3D wih 2D poins Imges re mrices of numbers Find properies of hese numbers 5 CEE598 Visul Sensing for Civil Infrsrucure Eng. & Mgm. Mni Golprvr-Frd, 24
Liner Algebr
Vecors (i.e., 2D or 3D vecors) P = [,,z] p = [,] 3D world Imge 7 CEE598 Visul Sensing for Civil Infrsrucure Eng. & Mgm. Mni Golprvr-Frd, 24
Vecors (i.e., 2D vecors) v (, 2 ) 2 v P Mgniude: 2 2 v 2 If v, v Is UNIT vecor v v 2, v v Is uni vecor Orienion: n 2 8 CEE598 Visul Sensing for Civil Infrsrucure Eng. & Mgm. Mni Golprvr-Frd, 24
Vecor Addiion v w (, 2) (, 2) (, 2 2) v+w v w 9 CEE598 Visul Sensing for Civil Infrsrucure Eng. & Mgm. Mni Golprvr-Frd, 24
Vecor Subrcion v w (, 2) (, 2) (, 2 2) v v-w w 2 CEE598 Visul Sensing for Civil Infrsrucure Eng. & Mgm. Mni Golprvr-Frd, 24
Sclr Produc v (, 2) (, 2) v v 2 CEE598 Visul Sensing for Civil Infrsrucure Eng. & Mgm. Mni Golprvr-Frd, 24
Inner (do) Produc v w v w (, ) (, ) 2 2 22 The inner produc is SCALAR! vw (,2) (, 2) v w cos if v w, v w? 22 CEE598 Visul Sensing for Civil Infrsrucure Eng. & Mgm. Mni Golprvr-Frd, 24
Orhonorml Bsis 2 j i v P i j (,) (,) i j i j v (, 2 ) v i 2j vi? v j ( i j) i 2 2 i 2j) j. 2. 2 ( 23 CEE598 Visul Sensing for Civil Infrsrucure Eng. & Mgm. Mni Golprvr-Frd, 24
Vecor (cross) Produc u w u vw v The cross produc is VECTOR! Mgniude: u v w v w sin Orienion: u u v u v ( v w) v w u w ( v w) w if v // w? u 24 CEE598 Visul Sensing for Civil Infrsrucure Eng. & Mgm. Mni Golprvr-Frd, 24
Vecor Produc Compuion ),, ( ),, ( 3 2 3 2 w v u (,,) (,, ) (,, ) k j i k j i k j k i j i k j i ) ( ) ( ) ( 2 2 3 3 2 3 3 2 CEE598 Visul Sensing for Civil Infrsrucure Eng. & Mgm. Mni Golprvr-Frd, 24 25
Mrices A nm n 2 3 2 22 32 n2 m 2m 3m nm Piel s inensi vlue Sum: C nm A nm B nm c ij ij b ij A nd B mus hve he sme dimensions! Emple: 2 3 5 6 2 5 8 4 7 6 26 CEE598 Visul Sensing for Civil Infrsrucure Eng. & Mgm. Mni Golprvr-Frd, 24
nm n n m m m m n A 2 3 32 3 2 22 2 2 p m m n p n B A C Produc: m k kj ik j i ij b c b n n n n n n n n A B B A A nd B mus hve compible dimensions! i nm n n m m m m n b b b b b b b b b b b b B 2 3 32 3 2 22 2 2 b j CEE598 Visul Sensing for Civil Infrsrucure Eng. & Mgm. Mni Golprvr-Frd, 24 27 Mrices
Mrices Trnspose: C mn c A ij ji T nm ( A B) ( T A T T AB) B T A T B T If A T A A is smmeric 6 Emples: 2 5 T 6 2 5 6 3 2 5 8 T 6 2 5 3 8 5 3 2 2 5 2 7 Smmeric? Smmeric? No! Yes! 28 CEE598 Visul Sensing for Civil Infrsrucure Eng. & Mgm. Mni Golprvr-Frd, 24
Mrices Deerminn: de 2 2 22 2 2 22 22 2 2 de 2 3 2 22 32 3 23 33 22 32 23 33 2 2 3 23 33 3 2 3 22 32 A mus be squre Emple: 2 de 3 5 2 5 3 29 CEE598 Visul Sensing for Civil Infrsrucure Eng. & Mgm. Mni Golprvr-Frd, 24
Mrices Inverse: A mus be squre A nn A nn A nn A nn I 2 2 22 22 2 2 22 2 2 Emple: 6 2 5? 28 5 2 6 6 2 5 6. 2 5 28 5 2 6. 6 2 5 28 28 28 3 CEE598 Visul Sensing for Civil Infrsrucure Eng. & Mgm. Mni Golprvr-Frd, 24
2D Geomericl Trnsformions
2D Trnslion P P 32 CEE598 Visul Sensing for Civil Infrsrucure Eng. & Mgm. Mni Golprvr-Frd, 24
2D Trnslion Equion P P ), ( ' P P ), ( ), ( P CEE598 Visul Sensing for Civil Infrsrucure Eng. & Mgm. Mni Golprvr-Frd, 24 33
2D Trnslion using Mrices P P P (, ) (, ) Homogeneous Coordines P' 34 CEE598 Visul Sensing for Civil Infrsrucure Eng. & Mgm. Mni Golprvr-Frd, 24
Homogeneous Coordines Mulipl he coordines b non-zero sclr nd dd n er coordine equl o h sclr. For emple, ),,, ( ),, ( ),, ( ), ( w w w z w w z z z z z CEE598 Visul Sensing for Civil Infrsrucure Eng. & Mgm. Mni Golprvr-Frd, 24 35
Bck o Cresin Coordines Divide b he ls coordine nd elimine i. For emple, NOTE: in our emple he sclr ws CEE598 Visul Sensing for Civil Infrsrucure Eng. & Mgm. Mni Golprvr-Frd, 24 36 ) /, /, / ( ),,, ( ) /, / ( ),, ( w z w w w w z z z z z
2D Trnslion using Homogeneous Coordines P P ' P,), ( ), (,), ( ), ( P P P T P I CEE598 Visul Sensing for Civil Infrsrucure Eng. & Mgm. Mni Golprvr-Frd, 24 37
Scling P P 38 CEE598 Visul Sensing for Civil Infrsrucure Eng. & Mgm. Mni Golprvr-Frd, 24
Scling Equion P s P s ' s s s s P,), ( ), ( ',), ( ), ( s s s s P P S P S P S ' ),s (s ' ), ( P P CEE598 Visul Sensing for Civil Infrsrucure Eng. & Mgm. Mni Golprvr-Frd, 24 39
Scling & Trnsling P P P =S P P =T P P =T P =T (S P)=(T S) P = A P 4 CEE598 Visul Sensing for Civil Infrsrucure Eng. & Mgm. Mni Golprvr-Frd, 24
Scling & Trnsling s s S s s s s '' P S T P A CEE598 Visul Sensing for Civil Infrsrucure Eng. & Mgm. Mni Golprvr-Frd, 24 4
Trnsling & Scling = Scling & Trnsling? s s s s s s s s s s ''' P T S P s s s s s s '' ' P S T P CEE598 Visul Sensing for Civil Infrsrucure Eng. & Mgm. Mni Golprvr-Frd, 24 42
Roion P P 43 CEE598 Visul Sensing for Civil Infrsrucure Eng. & Mgm. Mni Golprvr-Frd, 24
Roion Equions Couner-clockwise roion b n ngle P ' ' cosθ cosθ sin θ sin θ P ' ' cos sin sin cos P' R P CEE598 Visul Sensing for Civil Infrsrucure Eng. & Mgm. Mni Golprvr-Frd, 24 44
Degrees of Freedom ' ' cos sin sin cos R is 22 4 elemens Noe: R belongs o he cegor of norml mrices nd sisfies mn ineresing properies: R R T R T R I de( R) 45 CEE598 Visul Sensing for Civil Infrsrucure Eng. & Mgm. Mni Golprvr-Frd, 24
Roion+ Scling +Trnslion P = (T R S) P s s cosθ sinθ sin θ cosθ R ' P S T P s s cosθ sinθ sin θ cosθ S R S R If s =s, his is similri rnsformion! CEE598 Visul Sensing for Civil Infrsrucure Eng. & Mgm. Mni Golprvr-Frd, 24 46
Trnsformion in 2D Isomeries Similriies Affini Projecive 47 CEE598 Visul Sensing for Civil Infrsrucure Eng. & Mgm. Mni Golprvr-Frd, 24
Trnsformion in 2D Isomeries: [Euclidens] ' ' R H e - Preserve disnce (res) - 3 DOF - Regule moion of rigid objec 48 CEE598 Visul Sensing for Civil Infrsrucure Eng. & Mgm. Mni Golprvr-Frd, 24
Trnsformion in 2D Similriies: ' ' s R H s - Preserve - rio of lenghs - ngles - 4 DOF 49 CEE598 Visul Sensing for Civil Infrsrucure Eng. & Mgm. Mni Golprvr-Frd, 24
Trnsformion in 2D Affiniies: H A ' ' 22 2 2 A ) R( D ) R( ) ( R s s D CEE598 Visul Sensing for Civil Infrsrucure Eng. & Mgm. Mni Golprvr-Frd, 24 5
Trnsformion in 2D Affiniies: ' ' A H 2 A R( ) R( ) DR( ) 2 22 D s s -Preserve: - Prllel lines - Rio of res - Rio of lenghs on colliner lines - ohers - 6 DOF 5 CEE598 Visul Sensing for Civil Infrsrucure Eng. & Mgm. Mni Golprvr-Frd, 24
Trnsformion in 2D Projecive: ' ' A v b H p -Preserve: - cross rio of 4 colliner poins - collineri - nd few ohers - 8 DOF 52 CEE598 Visul Sensing for Civil Infrsrucure Eng. & Mgm. Mni Golprvr-Frd, 24
Trnsformion in 2D 53 CEE598 Visul Sensing for Civil Infrsrucure Eng. & Mgm. Mni Golprvr-Frd, 24
Removing Perspecive Disorion (recificion) H p 54 CEE598 Visul Sensing for Civil Infrsrucure Eng. & Mgm. Mni Golprvr-Frd, 24
CEE598 Visul Sensing for Civil Infrsrucure Eng. & Mgm. Mni Golprvr-Frd, 24 55
Compuing H p - 8 DOF - how mn poins do I need o esime H p? A les 4 poins! (8 equions) - There re severl lgorihms 56 CEE598 Visul Sensing for Civil Infrsrucure Eng. & Mgm. Mni Golprvr-Frd, 24
DLT lgorihm (Direc Liner Trnsformion) H i i H i i 57 CEE598 Visul Sensing for Civil Infrsrucure Eng. & Mgm. Mni Golprvr-Frd, 24
DLT lgorihm (Direc Liner Trnsformion) Unknown [9] i H i A h i (h ) T Funcion of mesuremens [39] 9 h h h h 2 9 3 equions (onl wo re independen) CEE598 Visul Sensing for Civil Infrsrucure Eng. & Mgm. Mni Golprvr-Frd, 24 58
DLT lgorihm (Direc Liner Trnsformion) H A 29 h 9 A i h A A 2 A N h h h i i A h N9 9 2 Over deermined Homogenous ssem 59 CEE598 Visul Sensing for Civil Infrsrucure Eng. & Mgm. Mni Golprvr-Frd, 24
DLT lgorihm (Direc Liner Trnsformion) A h N9 9 2 How o solve? Singulr Vlue Decomposiion (SVD)! Don Worr. MATLAB hs funcion for his 6 CEE598 Visul Sensing for Civil Infrsrucure Eng. & Mgm. Mni Golprvr-Frd, 24
Eigenvlues nd Eigenvecors 6 CEE598 Visul Sensing for Civil Infrsrucure Eng. & Mgm. Mni Golprvr-Frd, 24
Eigenvlues nd Eigenvecors The eigenvlues of A re he roos of he chrcerisic equion S AS p( ) de( I A) S v v N N 2. N digonl form of mri Eigenvecors of A re columns of S 62 CEE598 Visul Sensing for Civil Infrsrucure Eng. & Mgm. Mni Golprvr-Frd, 24
Singulr Vlue Decomposiion h A U V U AV 2. N 63 CEE598 Visul Sensing for Civil Infrsrucure Eng. & Mgm. Mni Golprvr-Frd, 24
DLT lgorihm (direc Liner Trnsformion) A h N9 9 2 How o solve? Singulr Vlue Decomposiion (SVD)! U D V 2n9 99 T 99 Ls column of V gives h! H! 64 CEE598 Visul Sensing for Civil Infrsrucure Eng. & Mgm. Mni Golprvr-Frd, 24
DLT lgorihm (direc Liner Trnsformion) A h N9 9 2 How o solve? [U, D, V] = SVD(A); X= V(:,end); 65 CEE598 Visul Sensing for Civil Infrsrucure Eng. & Mgm. Mni Golprvr-Frd, 24
Mrili Mschion Producer & Direcor UCSD ICAM undergrdue Vincen Rbud Technicl Advisor UCSD CSE suden Serge Belongie Projec Advisor UCSD CSE Deprmen A: wch Course websie >> Firs Lecure >> Video A: review SVD decomposiion 66 CEE598 Visul Sensing for Civil Infrsrucure Eng. & Mgm. Mni Golprvr-Frd, 24
Ne lecure Cmers models 67 CEE598 Visul Sensing for Civil Infrsrucure Eng. & Mgm. Mni Golprvr-Frd, 24
Appendi Properies of SVD 68 CEE598 Visul Sensing for Civil Infrsrucure Eng. & Mgm. Mni Golprvr-Frd, 24
CEE598 Visul Sensing for Civil Infrsrucure Eng. & Mgm. Mni Golprvr-Frd, 24 69
CEE598 Visul Sensing for Civil Infrsrucure Eng. & Mgm. Mni Golprvr-Frd, 24 7
Appendi: DLT lgorihm (Direc Liner Trnsformion) From: Muliple View Geomer in Compuer Vision, b R. Hrle nd A. Zissermn, Acdemic Press, 22 7 CEE598 Visul Sensing for Civil Infrsrucure Eng. & Mgm. Mni Golprvr-Frd, 24
CEE598 Visul Sensing for Civil Infrsrucure Eng. & Mgm. Mni Golprvr-Frd, 24 72
CEE598 Visul Sensing for Civil Infrsrucure Eng. & Mgm. Mni Golprvr-Frd, 24 73
CEE598 Visul Sensing for Civil Infrsrucure Eng. & Mgm. Mni Golprvr-Frd, 24 74
CEE598 Visul Sensing for Civil Infrsrucure Eng. & Mgm. Mni Golprvr-Frd, 24 75
CEE598 Visul Sensing for Civil Infrsrucure Eng. & Mgm. Mni Golprvr-Frd, 24 76