A apresentação está carregando. Por favor, espere

A apresentação está carregando. Por favor, espere

Visão estéreo - correspondência e reconstrução - Cap. 7 Trucco & Verry.

Apresentações semelhantes


Apresentação em tema: "Visão estéreo - correspondência e reconstrução - Cap. 7 Trucco & Verry."— Transcrição da apresentação:

1 Visão estéreo - correspondência e reconstrução - Cap. 7 Trucco & Verry

2 Reconstrução da forma

3 Captura de movimento

4 Basic principle to recover position from stereo images: Triangulation Requires correspondence and camera calibration

5 Correpondência por semelhança Sum of Square Differences – SSD ou Correlação

6 Correspondência por vizinhança correlacionada

7 Semelhança de duas regiões W W (SSD – Sum of Squared Difference) x0x0 y0y0 x0+ux0+u y0+vy0+v

8 Semelhança de duas regiões W W (correlação) constante

9 Semelhança de duas regiões W W (Normalização) Normalizando:

10 Correspondence between points With characteristics -

11 Correspondence problems: Oclusion -

12 Correspondence problem: lack of characterists - Ostridge egg on a Chinese checker board

13 Correspondência com luz estruturada Estéreo Ativo

14 Taxonomy of active range acquisition methods Active shape acquisition Contact Non destructive Non-contact Transmissive Reflective CT Asla Sá et al, Coded Structure Light for 3D-Photograpy: an Overview, Revista de Informática Teórica e Aplicada, Volume IX, Número 2, Porto Alegre, 2002 Brian Curless. New Methods for Surface Reconstruction from Range Images. PhD Dissertation. Stanford University Non-optical Sonar Microwave radar Optical Radar Triangulation Active stereo Active depth from defocus Passive Shape from focus Destructive Slices CMM Shape from shading Shape from silhouettes Active … …

15 Active stereo solution Use a light source to mark corresponding points uncalibrated light sourcecalibrated light source One point at the time: long capture process.

16 Active stereo: capturing many points Use of a digital projector as a structured light source Pattern with several elements in a way where each element can be identified univocally point coding: prone to errorsstripes: more robust

17 Methods for light coding: temporal codification Project, in sequence, a series of slides that code in the image a binary number. n slides for 2 n stripes. Two ilumination levels. Static scene. Code one axis. Posdamer, J. L. Altschuler, M. D. Surface Measurement by Space-Encoded Projected Beam Systems. Comput. Graphics Image Process. 18, pp. 1-17, slide1slide2codeslide3 problem: all transitions occur in the same place! can be also 111 or 001!

18 Código de Gray código binário Código binário 1 bit: bits: bits: Código de Gray 1 bit: bits: bits: ordem invertida

19 Código de Gray código binário Código binárioCódigo de Gray

20 Robust temporal codification: Gray coding Inokuchi, Seiji. Sato, Kosuki. Matsuda, Fumio. Range Imaging for 3D Object Recognition. Proc. Int. Conf. on Pattern Recognition, pp , transitions occur in different places

21 Example of Gray coding needs too many slides!

22 Color Gray coding better yet… reduces the number of slides by 3

23 (b,s)-BCSL Coding Sá, Asla Medeiros. Medeiros, Esdras Soares. Carvalho, Paulo Cezar Pinto. Velho, Luiz. Coded Structured Light for 3D-Photography: an Overview. Revista de Informática Teórica e Aplicada, Vol. 9, No. 2, outubro

24 A practical difficulty in the border detection example with the monochrome Gray code

25 Edge detection Projecting positive and negative slides is a robust way to recover edges

26 32rgb-BCSL coding (+) (-) slide 1slide 2

27 Recovering colored codes negative slide positive slide ambient light reflection factors projected light

28 Implementação do BCSL //A função getBcslStripeCode retorna o código de transição de faixa conforme a seqüência de cores fornecida. //Observe a ordem em que as cores devem ser passadas: //Primeiro as cores da imagem 1 e depois da imagem 2 //Primeiro a faixa da esquerda e depois a faixa da direita // //O código das cores e das bases é conforme a tabela abaixo. //Padrão 3_2 //base 3 //1 - vermelho //2 - verde //3 - azul //Padrão 4_2 //base 4 //1 - vermelho //2 - verde //3 - azul //4 - magenta //Padrão 6_2 //base 6 //1 - vermelho //2 - verde //3 - azul //4 - ciano //5 - magenta //6 - amarelo int getBcslStripeCode(int base, int colorLeft1, int colorRight1,int colorLeft2, int colorRight2);

29 int getBcslStripeCode(int base, int colorLeft1, int colorRight1,int colorLeft2, int colorRight2) { int aux1, aux2,linha,coluna; colorLeft2--; colorRight2--; colorLeft1--; colorRight1--; linha = (colorLeft1 * base) + colorLeft2; aux1 = (colorRight2 - colorLeft2); aux2 = (colorRight1 - colorLeft1); aux1 = (aux1>0)?(aux1-1):((base-1)+aux1); aux2 = (aux2>0)?(aux2-1):((base-1)+aux2); coluna = ((aux2) * (base-1)) + (aux1); switch(base){ case 3: return matrix3_2[linha *4+coluna]; break; case 4: return matrix4_2[linha *9 +coluna]; break; case 6: return matrix6_2[linha *25 +coluna]; break; default: printf("Error: invalid BCSL base\n"); return -1; } int matrix3_2[4*9]={ 0, 3, 6, 9, 14,17,19,11, 28,34,22,24, 26,29,18,21, 1,31,33,35, 15, 4, 8,13, 16, 23, 32,12, 27, 5, 7,25, 2, 10,20,30 }; …. teoria pode ser complicada mas a implementação é muito simples!

30 Mapa de profundiade Disparidade x Profundidade

31 Disparidade

32 Profundidade versus disparidade z x olol x oror z P clcl crcr xlxl xrxr T Z f

33 Geometria Epipolar Correspondência pela Geometria das Câmeras

34 Guido Gerig Epipolar Geometry ctd.

35 Geometria Epipolar: notação OlOl P OrOr PlPl plpl x cl y cl z cl x cr y cr z cr prpr PrPr elel erer Linha epipolar Linha epipolar

36 Example: converging cameras

37 Example: motion parallel with image plane

38 Example: forward motion e e

39 Geometria Epipolar: relações básicas P x cl y cl z cl x cr y cr z cr

40 Produto vetorial (revistado)

41 Matriz Essencial Matriz essencial eye l P eye r PlPl plpl x cl y cl z cl x cr y cr z cr prpr PrPr elel erer

42 Parâmetros extrínsecos xcxc ycyc zczc ywyw xwxw zwzw PwPw PcPc t

43 Rotação de a para b (left to right)

44 Vetor do eye de b em a X w Y w Z w eye l x cl y cl z cl x cr y cr z cr eye r

45 Glu Look At Dados: eye, center, up (definem o sistema de coordenadas do olho) Determine a matriz que leva do sistema de Coordenadas dos Objetos para o sistema de Coordenadas do Olho void gluLookAt(GLdouble eyex, GLdouble eyey, GLdouble eyez, GLdouble centerx, GLdouble centery, GLdouble centerz, GLdouble upx, GLdouble upy, GLdouble upz); up eye center Coordenadas dos objetos Coordenadas do olho eye

46 Calculo do sistema - x e y e z e yeye center eye zozo yoyo xoxo zeze xexe up dados: eye, center, up

47 Translada o eye para origem center eye zozo yoyo xoxo zeze xexe yeye zozo yoyo xoxo center eye zeze xexe yeye

48 Roda x e y e z e para x w y w z w x e, x o y e, y o z e, z o zozo yoyo xoxo center eye zeze xexe yeye

49 Matriz LookAt do OpenGL

50 Matriz essencial (código C) Matrix epiEssencialMatrix( Matrix Ra, Vector eye_a, Matrix Rb, Vector eye_b) { Matrix Rba = algMult(Rb,algTransp(Ra)); Vector eye = algMult(Ra,algSub(eye_b,eye_a); Matrix S = algVectorProductMatrix(eye); Matrix E = algMult(Rba,S); return E; }

51 Matriz Essencial T OlOl P OrOr PlPl plpl x cl y cl z cl x cr y cr z cr prpr PrPr elel erer

52 Câmera para imagem

53 Geometria Epipolar: Matriz Fundamental Matriz fundamental

54 Pode ser estimada diretamente se conhecermos pelo menos oito pares de pontos correspondentes

55 Transformações do OpenGL xexe yeye zeze center eye zozo yoyo xoxo up xnxn ynyn znzn

56 Matriz de projeção [ H ] = ? xexe yeye zeze xexe yeye zeze

57 Transforma o prisma de visão cubo normalizado [-1,1]×[-1,1] ×[-1,1] xexe yeye zeze l r b t xexe yeye zeze -(r-l)/2 (r-l)/2 -(t-b)/2 (t-b)/2 (f-n)/2-(f-n)/2 xexe yeye zeze far near xnxn ynyn znzn near far

58 Matriz Frustum do OpenGL OpenGL Spec

59 Transformação para o viewport xnxn ynyn znzn void glViewport(int x0, int y0, int w, int h ); z w [0.. z max ], z max = 2 n -1 geralmente xwxw ywyw w h 0 y0y0 x0x0

60 Revendo as transformações

61 Sistemas de coordenadas y im f x im ycyc vista lateral ococ zczc f =n fovy oyoy x im y im h s y oxox ococ eixo óptico x0x0 y0y0 ycyc xcxc zczc y' x' w s x x' y' pixel sxsx sysy

62 Revendo as transformações

63 Matriz Fundamental (código C) Matrix epiFundamentalMatrix( Matrix Ma, Matrix Ra, Vector eye_a, Matrix Mb, Matrix Rb, Vector eye_b) { Matrix E = epiEssencialMatrix(Ra,eye_a,Rb,eye_b); Matrix invMa = algInv(Ma); Matrix invMbTransp = algTransp(algInv(Mb)); Matrix tmp = algMult(invMbTransp,E); Matrix F = algMult(tmp,invMa); return F; }

64 Estimativa direta da Matriz Fundamental O algoritmo de 8 pontos

65 Estimating Fundamental Matrix Each point correspondence can be expressed as a linear equation The 8-point algorithm

66 Estimating Fundamental Matrix The 8-point algorithm F é a coluna de V correspondente ao menor valor singular

67 Estimating Fundamental Matrix The 8-point algorithm deveria ter posto 2! Seja D' = D com o menor valor singular = 0

68 The Normalized 8-point Algorithm Richard Hartley

69 The Normalized 8-point Algorithm Richard Hartley centróide escale para a distância média ficar em

70 Retificação de Imagens

71 Retificação UNC-CH

72 Rectification ctd. before after Guido Gerig

73 Retificação de imagens z'z' xcxc ycyc zczc y' x' O O' ponto principal Trucco e Verri

74 Retificação de imagens OlOl P OrOr plpl x cl y cl z cl x cr y cr z cr prpr elel erer T Trucco e Verri

75 Retificação de imagens Trucco e Verri 1. Construa: 2. Defina: 3. Aplique: P r = R(P l - T) 3. Aplique:

76 Stereo image rectification Steve Seitz, University of Washington

77 Stereo image rectification Image Reprojection reproject image planes onto common plane parallel to line between optical centers a homography (3x3 transform) applied to both input images pixel motion is horizontal after this transformation C. Loop and Z. Zhang. Computing Rectifying Homographies for Stereo Vision. IEEE Conf. Computer Vision and Pattern Recognition, 1999.Computing Rectifying Homographies for Stereo Vision Steve Seitz, University of Washington

78 Image Rectification Common Image Plane Parallel Epipolar Lines Search Correspondences on scan line Steve Seitz, University of Washington

79 Reconstrução

80 Reconstrução por triangulação

81

82 Outro processo de reconstrução Miguel Ribo, Axel Pinz, Anton L. Fuhrmann A new Optical Tracking System for Virtual and Augmented Reality Applications,

83 Reconstruction O O p p Steve Seitz, University of Washington

84 Reconstruction Equation 1 Equation 2 (From equations 1 and 2) Steve Seitz, University of Washington

85 Reconstruction up to a Scale Factor Assume that intrinsic parameters of both cameras are known Essential Matrix is known up to a scale factor (for example, estimated from the 8 point algorithm). Steve Seitz, University of Washington

86 Reconstruction up to a Scale Factor Steve Seitz, University of Washington

87 Reconstruction up to a Scale Factor Let It can be proved that Steve Seitz, University of Washington

88 Reconstruction up to a Scale Factor We have two choices of t, (t + and t - ) because of sign ambiguity and two choices of E, (E + and E - ). This gives us four pairs of translation vectors and rotation matrices. Steve Seitz, University of Washington

89 Reconstruction up to a Scale Factor Given and 1.Construct the vectors w, and compute R 2.Reconstruct the Z and Z for each point 3.If the signs of Z and Z of the reconstructed points are a)both negative for some point, change the sign of and go to step 2. b)different for some point, change the sign of each entry of and go to step 1. c)both positive for all points, exit. Steve Seitz, University of Washington

90 Proposed system: equipament 2 cameras and 1 projector (fast) 1 moving camera and 1 projector (slow)

91 Proposed system: 32rgb-BCSL coding leftright positive slide negative slide

92 Where is a point in the other image? u u

93 One solution: (u,v) coordinates double the number of photos!

94 Epipolar geometry eye l P eye r PlPl plpl x cl y cl z cl x cr y cr z cr prpr PrPr elel erer Epipolar Line Epipolar Line

95 Epipolar correspondence

96 Reconstruction by triangulation: ideia

97 Reconstruction by triangulation: algebra

98 Captured data

99 Cylinder model axis of the points p i : covariance matrix: centroid:

100 Initial cylinder adjustment tangent plane perpendicular to ê 3 : first guess for c c : first guess for z c :

101 Results of the initial cylinder adjustment

102 Giving a set of points P and a model Q, find the rigid body motion (R, t) that minimizes: where q(p i ) is the point in Q correspondent to p i. Model fitting problem

103 ICP (Iteractive Closest Point) Algorithm begins with a initial guess for the model pose( R and t ) at each iteration, q(p i ) is the point in Q closest to Rp i + t R e t are computed to minimize the error P. J. Besl and N. D. McKay, A Method for Registration of 3-D Shapes, IEEE Transactions on Pattern Analysis and Machine Intelligence, Vol. 14, No. 12, February 1992

104 Projection of a point on a cylinder Plane : Axis : Given : Compute :

105 ICP step find centroids: p 0 e q 0 Define p i = p i – p 0, q i = q i – q 0 Define where Rotation: R = M(M T M) –1/2 Translation: t = q 0 – Rp 0

106 Results

107 Direct measure


Carregar ppt "Visão estéreo - correspondência e reconstrução - Cap. 7 Trucco & Verry."

Apresentações semelhantes


Anúncios Google