Augmented Reality using Computer Vision Instructor - Simon Lucey - - PowerPoint PPT Presentation

augmented reality using computer vision
SMART_READER_LITE
LIVE PREVIEW

Augmented Reality using Computer Vision Instructor - Simon Lucey - - PowerPoint PPT Presentation

Augmented Reality using Computer Vision Instructor - Simon Lucey 16-623 - Designing Computer Vision Apps Today Augmented Reality Review: Homographies & Pinhole Cameras ARToolkit in iOS Example of SLAM for AR Taken from: H.


slide-1
SLIDE 1

Augmented Reality using Computer Vision

Instructor - Simon Lucey

16-623 - Designing Computer Vision Apps

slide-2
SLIDE 2

Today

  • Augmented Reality
  • Review: Homographies & Pinhole Cameras
  • ARToolkit in iOS
slide-3
SLIDE 3
slide-4
SLIDE 4
slide-5
SLIDE 5

Example of SLAM for AR

Taken from: H. Liu et al. “Robust Keyframe-based Monocular SLAM for Augmented Reality”, ISMAR 2016.

slide-6
SLIDE 6

Motivation

Adapted from: Computer vision: models, learning and inference. Simon J.D. Prince

slide-7
SLIDE 7

Short AR History

  • Head mounted displays were first

developed in the 1960s, and is considered the first step in making AR possible.

  • Tom Caudell first coined the term while

working on a project for Boeing in the early 1990s.

  • Used the term to describe a digital display

used by aircraft technicians that blended virtual graphics onto a physical reality.

Thomas P. Caudell “Sword of Damocles” Ivan Sutherland

slide-8
SLIDE 8

Short AR History

  • In the late 1990s, Hirokazu Kato of the

Nara Institute of Science and Technology developed ARToolkit.

  • Originally released by the University of

Washington’s HIT Lab to the open source community.

  • ARToolkit probably the most well known

and commonly used package for AR.

  • ARToolkit now owned and maintained by

West Coast startup DAQRI.

฀฀฀฀฀

  • ฀฀฀฀฀฀฀฀฀฀฀฀฀฀฀฀฀฀฀฀฀฀฀฀฀฀฀฀฀

฀฀฀ ฀ ฀ ฀ ฀ ฀ ฀ ฀ ฀ ฀ ฀ ฀ ฀ ฀ ฀ ฀ ฀ ฀ ฀ ฀ ฀ ฀ ฀ ฀ ฀฀

Hirokazu Kato AR Toolkit

slide-9
SLIDE 9

ARToolkit Example

slide-10
SLIDE 10

ARToolkit My Example

slide-11
SLIDE 11

Other SDKs for AR

  • Vuforia is another popular SDK for AR development.
  • Like ARToolkit is portable for Android and iOS.
  • Lots of nice examples on their developer portal.
  • Check out more at - https://developer.vuforia.com/
slide-12
SLIDE 12

Google Glass

slide-13
SLIDE 13

The Future?? - DAQRI Smart Helmet

slide-14
SLIDE 14

AR versus VR

Taken from http://www.slideshare.net/brainberryglobal/augmented-reality-meetup-in-kiev-hakan-mutlu-sonmez.

slide-15
SLIDE 15

Today

  • Augmented Reality
  • Review: Homographies & Pinhole Cameras
  • ARToolkit in iOS
slide-16
SLIDE 16

Review: Pinhole Camera

Real camera image is inverted Instead model impossible but more convenient virtual image

Adapted from: Computer vision: models, learning and inference. Simon J.D. Prince

slide-17
SLIDE 17

Notation - Cheat Sheet

Hartley & Zisserman Prince Description

3D Point

X

2D Point

x w x

Rotation matrix

R

Intrinsics matrix

K Ω Φ Λ

Homography matrix

H

translation vector

t τ

slide-18
SLIDE 18

Pinhole camera

  • Camera model:
  • In homogeneous coordinates:

(linear!)

Adapted from: Computer vision: models, learning and inference. Simon J.D. Prince

slide-19
SLIDE 19

Pinhole camera

  • Writing out these three equations
  • Eliminate λ to retrieve original equations

Adapted from: Computer vision: models, learning and inference. Simon J.D. Prince

slide-20
SLIDE 20

Adding in extrinsics

Or for short: Or even shorter:

Adapted from: Computer vision: models, learning and inference. Simon J.D. Prince

slide-21
SLIDE 21

Review: Affine warp

Homogeneous: Cartesian: For short:

How many unknowns?

slide-22
SLIDE 22

Affine and Homography warps

Affine transform describes mapping well when the depth variation within the planar object is small and the camera is far away. When variation in depth is comparable to distance to object then the affine transformation is not a good model. Here we need the homography.

Adapted from: Computer vision: models, learning and inference. Simon J.D. Prince

slide-23
SLIDE 23

Review: Estimating the Affine Warp

  • Rearranging:
  • Form system of equations:
  • In MATLAB this becomes,

>> p = A\x;

slide-24
SLIDE 24

Review: Homography

  • Start with basic projection equation:
  • Combining these two matrices we get:

Adapted from: Computer vision: models, learning and inference. Simon J.D. Prince

slide-25
SLIDE 25

Review Homography

Homogeneous: Cartesian:

For short:

How many unknowns?

slide-26
SLIDE 26

Homography Estimation

  • Re-arrange cartesian equations,

           −u1 −v1 −1 y1u1 y1v1 y1 u1 v1 1 −x1u1 −x1v1 −x1 −u2 −v2 −1 y2u2 y2v2 y2 u2 v2 1 −x2u2 −x2v2 −x2 . . . . . . . . . . . . . . . . . . . . . . . . . . . −uI −vI −1 yIuI yIvI yI uI vI 1 −xIuI −xIvI −xI                          φ11 φ12 φ13 φ21 φ22 φ23 φ31 φ32 φ33               = 0,

  • Form linear system

Adapted from: Computer vision: models, learning and inference. Simon J.D. Prince

slide-27
SLIDE 27

Homography Estimation

  • In MATLAB this becomes,

>> [U,S,V] = svd(A); >> Phi = reshape(V(:,end),[3,3])’;

  • Both sides are 3x1 vectors; should be parallel, so cross

product will be zero

  • For you to try MATLAB,

>> x = [randn(2,1);1]; cross(x,4*x)

slide-28
SLIDE 28

Estimating Extrinsics

slide-29
SLIDE 29

Estimating Extrinsics

  • Writing out the camera equations in full
  • Estimate the homography from matched points
  • Factor out the intrinsic parameters

Adapted from: Computer vision: models, learning and inference. Simon J.D. Prince

slide-30
SLIDE 30

Estimating Extrinsics

  • Find the last column using the cross product of first two

columns

  • Make sure the determinant is 1. If it is -1, then multiply

last column by -1.

  • Find translation scaling factor between old and new

values

  • Finally, set

Adapted from: Computer vision: models, learning and inference. Simon J.D. Prince

slide-31
SLIDE 31

Augmented Reality

slide-32
SLIDE 32

Today

  • Augmented Reality
  • Review: Homographies & Pinhole Cameras
  • ARToolkit in iOS
slide-33
SLIDE 33

ARToolkit Example

  • Good example of using ARToolkit in iOS can be found on

ARToolkit website.

  • On your browser please go to the address,

http://www.artoolkit.org/dist/artoolkit5/5.3/ARToolKit5-bin-5.3.2-iOS.tar.gz

  • Careful: Xcode project is a little different to what you are

used to at the moment.

  • Project has multiple Apps combined together you need to

select which one you want to use.

slide-34
SLIDE 34

ARToolkit Example

  • To start with go and print off the Hiro pattern from,

https://github.com/artoolkit/artoolkit5/blob/master/doc/patterns/Hiro%20pattern.pdf

  • Load the Xcode project ARToolKit5iOS.xcodeproj
  • From there attach your iOS device and select the ARAppES1

to build and run.

slide-35
SLIDE 35

Intrinsics & ARToolkit

  • Cool thing is that they have the intrinsics estimated for

nearly all iOS devices.

slide-36
SLIDE 36

Reading in Intrinsics

slide-37
SLIDE 37

Uses OpenGL ES Heavily

  • All drawing and rendering is done through OpenGL ES.
  • Useful resource for anyone thinking of project involving AR.
slide-38
SLIDE 38

How does it work?

  • Vision tracking component uses a combination of RANSAC

and the FREAK detector framework.

Original images Initial matches Inliers from RANSAC

slide-39
SLIDE 39

Things to think about??