Visão estéreo - correspondência e reconstrução -

Slides:



Advertisements
Apresentações semelhantes
Presenter’s Notes Some Background on the Barber Paradox
Advertisements

Visualização do OpenGL
São Paulo - November 7, 2013 Measuring the Cost of Formalization in Brazil © 2003 The Ronald Coase Institute Adopting RCI methodology to measure start.
TADs Vector, Lista e Sequência
Z Y X [0 1 0] [1 0 1]. Z Y X [0 1 0] [1 0 1] a x y z b c For cubic: a = b = c = ao [001] [210] [100] [111] [120] 1½0 -2/311.
Instituto de Computação - UFF 1 Computação Gráfica I Professor: Anselmo Montenegro Conteúdo: - Transformações geométricas no plano.
Yosio Shimabukuro Ruth DeFries Douglas Morton Liana Anderson Ellen Jasinski Fernando Espirito-Santo Matthew Hansen Marcelo Latorre INPE / University of.
Circuitos Lógicos e Organização de Computadores Capítulo 6 – Blocos com Circuitos Combinacionais Ricardo Pannain
1/7/ Introducing the Personal Studies for New Christians curriculum Introduzindo o Currículo dos Estudos Pessoais para Novos Cristãos By Por David.
Towards a Requirement Analysis Approach for Dependable Law-Governed Systems Maíra Gatti, Gustavo Carvalho May 2nd 2006.
MC542 Organização de Computadores Teoria e Prática
DIRETORIA ACADÊMICA NÚCLEO DE CIÊNCIAS HUMANAS E ENGENHARIAS DISCIPLINA: INGLÊS FUNDAMENTAL - NOITE PROFESSOR: JOSÉ GERMANO DOS SANTOS PERÍODO LETIVO
Caracteristicas de Imagens II Fitting. Etapas p Borda Borda=cadeia de pixels Borda=tem um modelo Finding Connected Components Fitting.
Visão computacional.
Um pouco mais sobre modelos de objetos. Ray Path Categorization Ray Path Categorization. Nehab, D.; Gattass, M. Proceedings of SIBGRAPI 2000, Brazil,
Parâmetros Geométricos de Câmeras
Calibração de Câmeras Cap. 6 Trucco & Verri.
Linha de produção de imagens com o OpenGL™ (OpenGL Rendering Pipeline)
A.4. Trabalhando com elementos de biblioteca STL – Standard Template Libraby Disponibiliza um conjunto de classes templates, provendo algoritmos eficientes.
Fundamentos da teoria dos semicondutores Faixas de energia no cristal semicondutor. Estatística de portadores em equilíbrio. Transporte de portadores.
Aula 02.
Mais sobre classes Baseada no Livro: Deitel&Deitel - C++ How To program Cap. 7 Prentice Hall 1994 SCE 213 Programação Orientada a Objetos, ICMC - USP 2.
Técnicas de Processamento Imagens
Visão Computacional Geometria de Transformações
Computação Gráfica Visualização 3D
Computação Gráfica - LM
Iluminação local MC-930 Tópicos em Computação Gráfica Luiz M. G. Gonçalves.
Computação Gráfica Geometria de Transformações
OpenGL Computação Gráfica. O que é OpenGL? Uma linguagem de programação gráfica de baixo nível Projetada para gráfico interativo 2D e 3D Uma interface.
Uniform Resource Identifier (URI). Uniform Resource Identifiers Uniform Resource Identifiers (URI) ou Identificador de Recursos Uniforme provê um meio.
Provas de Concursos Anteriores
Renderização de cenas por traçado de raios na Placa Gráfica Fabiano Segadaes Romeiro Sistemas Gráficos 3D IMPA.
CARTOGRAPHIES OF SEGREGATION From Snapshots to Processes and Trajectories Flávia F. Feitosa (UFABC) Antônio Miguel V. Monteiro (INPE) XIV Brazilian Symposium.
IEEE PES General Meeting, Tampa FL June 24-28, 2007 Conferência Brasileira de Qualidade de Energia Santos, São Paulo, Agosto 5-8, Chapter 3 Harmonic.
Criação de objetos da AD 1Luis Rodrigues e Claudia Luz.
Tópicos Especiais em Aprendizagem Reinaldo Bianchi Centro Universitário da FEI 2012.
Part 5: Regression Algebra and Fit 5-1/34 Econometrics I Professor William Greene Stern School of Business Department of Economics.
MECÂNICA - DINÂMICA Cinemática de uma Partícula Cap Exercícios.
Transformações Geométricas
INPE / CAP-315 Airam J. Preto, Celso L. Mendes Aula 30 (1) Empacotamento de Dados em MPI Tópicos: Buffer de Mensagem Empacotamento/Desempacotamento.
Definição do MoC Subjacente a Aplicação Prof. Dr. César Augusto Missio Marcon Parcialmente extraído de trabalhos de Axel Jantch, Edward Lee e Alberto Sangiovanni-Vincentelli.
Universidade de Brasília Laboratório de Processamento de Sinais em Arranjos 1 Subspace based Multi-Dimensional Model Order Selection in Colored Noise Scenarios.
Universidade de Brasília Laboratório de Processamento de Sinais em Arranjos 1 Adaptive & Array Signal Processing AASP Prof. Dr.-Ing. João Paulo C. Lustosa.
Avaliação Constituição dos grupos de trabalho:
Lecture 4 Pressure distribution in fluids. Pressure and pressure gradient. Hydrostatic pressure 1.
Lecture 2 Properties of Fluids Units and Dimensions 1.
EXERCÍCIOS PARA GUARDA-REDES
1-Considerações Básicas Sandro R. Lautenschlager Mecânica dos Fluidos Aula 2.
1 2 Observa ilustração. Cria um texto. Observa ilustração.
Grupo A – Azul Claro, Marrom, Laranja
Elos e Juntas.
IEEE PES General Meeting, Tampa FL June 24-28, 2007 Conferência Brasileira de Qualidade de Energia Santos, São Paulo, Agosto 5-8, Chapter 5: Harmonic.
Prof Afonso Ferreira Miguel
CALENDÁRIO SEXY Ele & Ela. CALENDÁRIO SEXY Ele & Ela.
Curva de Remanso Direct Step Method.
Equação da Continuidade e Equação de Navier-Stokes
Microprocessadores 8051 – Aula 3 Interrupção
Ambrósio et al e-POSTER Enhanced Screening for Refractive Candidates based on Corneal Tomography and Biomechanics Renato Ambrósio Jr., MD, PhD Ruiz Alonso,
Aula Teórica 18 & 19 Adimensionalização. Nº de Reynolds e Nº de Froude. Teorema dos PI’s , Diagrama de Moody, Equação de Bernoulli Generalizada e Coeficientes.
Equação de Bernoulli e Equação de Conservação da Energia
Este fotógrafo Indonésio, nasceu em Jakarta. A Indonésia é um dos melhores locais do planeta para qualquer amante da fotografia, afirma Rarindra Prakarsa.
IEEE PES General Meeting, Tampa FL June 24-28, 2007 Conferência Brasileira de Qualidade de Energia Santos, São Paulo, Agosto 5-8, Chapter 8: Procedure.
Rio Verde - Goiás - Brasil
11/09/07 Visão Computacional e Realidade Aumentada César Palomo – inf. puc-rio. br 1 Visão Computacional e Realidade Aumentada Prof Marcelo Gattass.
Visão estéreo - correspondência e reconstrução -.
Modelo e Câmera e Projeção no OpenGL
Geometria Epipolar Correspondência a partir da calibração das câmeras ou Forma a partir de correspondências.
Visão estéreo - correspondência e reconstrução -
Tópicos Avançados em Engenharia de Software
Reflection, rotation and translation
Transcrição da apresentação:

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

Reconstrução da forma

Captura de movimento

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

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

Correspondência por vizinhança correlacionada

Semelhança de duas regiões WW (SSD – Sum of Squared Difference) x0+u y0+v y0 x0

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

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

Correspondence between points With characteristics - 

Correspondence problems: Oclusion - 

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

Correspondência com luz estruturada Estéreo Ativo

Taxonomy of active range acquisition methods Transmissive Sonar Non-contact Non-optical Microwave radar Reflective Shape from focus Shape from shading Active shape acquisition Passive Shape from silhouettes Slices … Destructive Optical Radar Contact Active Triangulation Non destructive Active depth from defocus Active stereo CMM … 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. 1997

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

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 errors stripes: more robust

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

Código de Gray  código binário 1 bit: 0 1 2 bits: 00 01 10 11 3 bits: 000 001 010 011 100 101 110 111 Código de Gray 2 bits: 00 01 11 10 3 bits: 000 001 011 010 110 111 101 100 ordem invertida

Código de Gray  código binário Código binário Código de Gray

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

Example of Gray coding needs too many slides! 

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

(b,s)-BCSL Coding 20 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 2002

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

Edge detection Projecting positive and negative slides is a robust way to recover edges. 5 1 60 40 41 21 18 16

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

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

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 //4 - magenta //Padrão 6_2 //base 6 //4 - ciano //5 - magenta //6 - amarelo int getBcslStripeCode(int base, int colorLeft1, int colorRight1,int colorLeft2, int colorRight2);

teoria pode ser complicada mas a implementação é muito simples! 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 }; …. 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]; case 6: return matrix6_2[linha *25 +coluna]; default: printf("Error: invalid BCSL base\n"); return -1; } teoria pode ser complicada mas a implementação é muito simples!

Disparidade x Profundidade Mapa de profundiade Disparidade x Profundidade

Disparidade

Profundidade versus disparidade Z xl xr cl cr f ol or x x z z T

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

Epipolar Geometry ctd. Guido Gerig

Geometria Epipolar: notação Pl pl Linha epipolar pr Pr ycl xcr ycr zcr xcl el er Or Ol zcl

Example: converging cameras

Example: motion parallel with image plane

Example: forward motion

Geometria Epipolar: relações básicas xcl ycl zcl xcr ycr zcr

Produto vetorial (revistado)

Matriz Essencial Pl Pr P Matriz essencial ycr xcr zcr ycl xcl er el eye l P eye r Pl pl xcl ycl zcl xcr ycr zcr pr Pr el er Matriz essencial

Parâmetros extrínsecos xc yc zc Pc t yw xw zw Pw

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

Vetor do eye de b em a ycl xcl eye l Z w zcl ycr Y w xcr eye r zcr X w

Glu Look At void gluLookAt(GLdouble eyex, GLdouble eyey, GLdouble eyez, GLdouble centerx, GLdouble centery, GLdouble centerz, GLdouble upx, GLdouble upy, GLdouble upz); 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 up eye center Coordenadas dos objetos Coordenadas do olho eye

Calculo do sistema - xe ye ze center eye zo yo xo ze xe up dados: eye, center, up

Translada o eye para origem center eye zo yo xo ze xe ye zo yo xo center eye ze xe ye

Roda xe ye ze para xw yw zw zo yo xo center eye ze xe ye xe , xo ye , yo ze , zo

Matriz LookAt do OpenGL

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; }

Matriz Essencial P Pl Pr pl pr xcl ycl zcl xcr ycr zcr el er Ol T Or

Câmera para imagem

Geometria Epipolar: Matriz Fundamental

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

Transformações do OpenGL center eye zo yo xo up xe ye ze xn yn zn

Matriz de projeção ye ze xe ye ze xe 8 4 7 3 5 1 2 6 [ H ] = ? 8 4 3 7

Transforma o prisma de visão cubo normalizado [-1,1]×[-1,1] ×[-1,1] xe ye ze -(r-l)/2 (r-l)/2 -(t-b)/2 (t-b)/2 (f-n)/2 -(f-n)/2 xe ye ze l r b t xn yn zn 1 -1 near far xe ye ze 1 -1 far near

Matriz Frustum do OpenGL OpenGL Spec

Transformação para o viewport void glViewport(int x0, int y0, int w, int h ); xw yw w h y0 x0 xn yn zn 1 -1 zw[0.. zmax], zmax = 2n-1 geralmente 65535

Revendo as transformações

Sistemas de coordenadas yim yc y' eixo óptico zc y0 x' oc xc x0 pixel f xim yim sy y' sx vista lateral yc oy fovy zc h sy x' oc ox xim f =n w sx

Revendo as transformações

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; }

Estimativa direta da Matriz Fundamental O algoritmo de 8 pontos

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

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

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

The Normalized 8-point Algorithm Richard Hartley

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

Retificação de Imagens

Retificação UNC-CH

Rectification ctd. before after Guido Gerig

Retificação de imagens Trucco e Verri y' yc z' zc O O' x' xc ponto principal

Retificação de imagens Trucco e Verri P ycl pl xcr ycr zcr pr xcl el T er Or Ol zcl

Retificação de imagens Trucco e Verri 1. Construa: Pr= R(Pl - T) 2. Defina: 3. Aplique: 3. Aplique:

Stereo image rectification Steve Seitz, University of Washington

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. Steve Seitz, University of Washington

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

Reconstrução

Reconstrução por triangulação

Reconstrução por triangulação

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

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

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

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

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

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

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

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

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

Proposed system: 32rgb-BCSL coding positive slide positive slide negative slide left right

Where is a point in the other image? u u

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

Epipolar geometry P Pl Epipolar Pr Line pl ycr ycl pr xcr xcl er el zcr xcl el er eyer eyel zcl

Epipolar correspondence

Reconstruction by triangulation: ideia

Reconstruction by triangulation: algebra

Captured data

Cylinder model covariance matrix: centroid: axis of the points pi:

Initial cylinder adjustment tangent plane perpendicular to ê3: first guess for cc: first guess for zc:

Results of the initial cylinder adjustment

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

ICP (Iteractive Closest Point) Algorithm begins with a initial guess for the model pose( R and t ) at each iteration, q(pi) is the point in Q closest to Rpi + 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

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

ICP step find centroids: p0 e q0 Define pi’= pi – p0 , qi’= qi – q0 where Rotation: R = M(MT M) –1/2 Translation: t = q0– Rp0

Results

Direct measure