55
SocialSync: Synchronization for a Smartphone Camera Network Richard Latimer Rice University September 7, 2014

SocialSync: Synchronization for a Smartphone Camera Network · Ashok, Lin, Ashu and their students 2. Co-Author Jason Holloway 3. LF4CV Reviewers, Paper Accepted 4. National Science

  • Upload
    others

  • View
    1

  • Download
    0

Embed Size (px)

Citation preview

Page 1: SocialSync: Synchronization for a Smartphone Camera Network · Ashok, Lin, Ashu and their students 2. Co-Author Jason Holloway 3. LF4CV Reviewers, Paper Accepted 4. National Science

SocialSync: Synchronization for a

Smartphone Camera Network

Richard Latimer

Rice University

September 7, 2014

Page 2: SocialSync: Synchronization for a Smartphone Camera Network · Ashok, Lin, Ashu and their students 2. Co-Author Jason Holloway 3. LF4CV Reviewers, Paper Accepted 4. National Science

2

2

Intro

Page 3: SocialSync: Synchronization for a Smartphone Camera Network · Ashok, Lin, Ashu and their students 2. Co-Author Jason Holloway 3. LF4CV Reviewers, Paper Accepted 4. National Science

3

Why Smartphones?

• 1 billion smartphones sold in 2014

• Growth in computer vision applications

• Advanced development platform

Best camera is the one with you!

Page 4: SocialSync: Synchronization for a Smartphone Camera Network · Ashok, Lin, Ashu and their students 2. Co-Author Jason Holloway 3. LF4CV Reviewers, Paper Accepted 4. National Science

4

4

What if Smartphones Could Collaborate?

Refocusing Free Viewpoint Television

3D Depth

Lytro

PelicanPhilips

Kilner et al.

Page 5: SocialSync: Synchronization for a Smartphone Camera Network · Ashok, Lin, Ashu and their students 2. Co-Author Jason Holloway 3. LF4CV Reviewers, Paper Accepted 4. National Science

5

Prior Work: Camera Arrays

Traditional camera arrays are assumed to be embedded and tightly synchronized.

High-Speed VideographyUsing a Dense Camera Array

[Wilburn et al.]

High Performance ImagingUsing Large Camera Arrays

[Wilburn et al.]

Page 6: SocialSync: Synchronization for a Smartphone Camera Network · Ashok, Lin, Ashu and their students 2. Co-Author Jason Holloway 3. LF4CV Reviewers, Paper Accepted 4. National Science

6

6

A Smartphone Camera ArrayInvolves the OS Stack

Application

Application Framework

Library Runtime

Linux Kernel/Drivers

Hardware

Page 7: SocialSync: Synchronization for a Smartphone Camera Network · Ashok, Lin, Ashu and their students 2. Co-Author Jason Holloway 3. LF4CV Reviewers, Paper Accepted 4. National Science

7

7

Social Capture: Problem Statement

If you use multiple smartphone cameras to capture video simultaneously, there is an inherit synchronization challenge that manifests (due to OS stack) when the scene is moving.

Page 8: SocialSync: Synchronization for a Smartphone Camera Network · Ashok, Lin, Ashu and their students 2. Co-Author Jason Holloway 3. LF4CV Reviewers, Paper Accepted 4. National Science

8

8

Scene Setup: How Bad is Misalignment?

Scene Setup

1

0

0

1

0

0

1

0

0

1

0

0

Resolution Target

SmartphoneCamera Array

Page 9: SocialSync: Synchronization for a Smartphone Camera Network · Ashok, Lin, Ashu and their students 2. Co-Author Jason Holloway 3. LF4CV Reviewers, Paper Accepted 4. National Science

9

9

Outcome: How Bad is Misalignment?

Even when photos are captured simultaneously, misalignment of frames can

cause problems when target is moving.

Moving Resolution Target Capturedby 4 Phones Simultaneously

Page 10: SocialSync: Synchronization for a Smartphone Camera Network · Ashok, Lin, Ashu and their students 2. Co-Author Jason Holloway 3. LF4CV Reviewers, Paper Accepted 4. National Science

10

10

Source of Problem

Frame 0 Frame 1 Frame 2

Frame 0 Frame 1

Frame 1 Frame 2 Frame 3

time

Camera 1:

Camera 2:

Camera 3: Frame 2

Frame 0

Page 11: SocialSync: Synchronization for a Smartphone Camera Network · Ashok, Lin, Ashu and their students 2. Co-Author Jason Holloway 3. LF4CV Reviewers, Paper Accepted 4. National Science

11

11

Goal of SocialSync

Objective: Align frame sequences from smartphone cameras within tolerance ranges less

than t milliseconds, where t < frame duration.

Frame 0 Frame 1 Frame 2

Frame 0 Frame 1

Frame 1 Frame 2 Frame 3

time

Camera 1:

Camera 2:

Camera 3: Frame 2

Frame 0

Page 12: SocialSync: Synchronization for a Smartphone Camera Network · Ashok, Lin, Ashu and their students 2. Co-Author Jason Holloway 3. LF4CV Reviewers, Paper Accepted 4. National Science

12

12

1. Characterization

2. SocialSync Protocol

3. Evaluation

Page 13: SocialSync: Synchronization for a Smartphone Camera Network · Ashok, Lin, Ashu and their students 2. Co-Author Jason Holloway 3. LF4CV Reviewers, Paper Accepted 4. National Science

13

13

1. Characterization

• Measurement Test Apparatus

• Results

2. SocialSync Protocol

3. Evaluation

Page 14: SocialSync: Synchronization for a Smartphone Camera Network · Ashok, Lin, Ashu and their students 2. Co-Author Jason Holloway 3. LF4CV Reviewers, Paper Accepted 4. National Science

14

14

What We Use: Android 4.4

Page 15: SocialSync: Synchronization for a Smartphone Camera Network · Ashok, Lin, Ashu and their students 2. Co-Author Jason Holloway 3. LF4CV Reviewers, Paper Accepted 4. National Science

15

15

Network Setup

1

0

0

Hub and Spoke Network

•Server provides global reference clock

•Server broadcasts image capture request

1

0

0

1

0

0

1

0

0

1

0

0

Page 16: SocialSync: Synchronization for a Smartphone Camera Network · Ashok, Lin, Ashu and their students 2. Co-Author Jason Holloway 3. LF4CV Reviewers, Paper Accepted 4. National Science

16

System for Measuring Capture Timestamps

16

Page 17: SocialSync: Synchronization for a Smartphone Camera Network · Ashok, Lin, Ashu and their students 2. Co-Author Jason Holloway 3. LF4CV Reviewers, Paper Accepted 4. National Science

17

17

1. Characterization

• Measurement Test Apparatus

• Results

2. SocialSync Protocol

3. Evaluation

Page 18: SocialSync: Synchronization for a Smartphone Camera Network · Ashok, Lin, Ashu and their students 2. Co-Author Jason Holloway 3. LF4CV Reviewers, Paper Accepted 4. National Science

18

18

Random Variables Associatedwith Capturing a Frame

Setup Time: Delay to setup camera before capture of first frame

Delivery Time: After capture, there is delay to when frame reaches application and a timestamp can be recorded.

Page 19: SocialSync: Synchronization for a Smartphone Camera Network · Ashok, Lin, Ashu and their students 2. Co-Author Jason Holloway 3. LF4CV Reviewers, Paper Accepted 4. National Science

19

19

Camera Setup

Setup Frame 0 Frame 1 Frame 2

time

Page 20: SocialSync: Synchronization for a Smartphone Camera Network · Ashok, Lin, Ashu and their students 2. Co-Author Jason Holloway 3. LF4CV Reviewers, Paper Accepted 4. National Science

20

20

Camera 1: Is Setup Time Consistent?

Setup

Setup

Setup

time

Page 21: SocialSync: Synchronization for a Smartphone Camera Network · Ashok, Lin, Ashu and their students 2. Co-Author Jason Holloway 3. LF4CV Reviewers, Paper Accepted 4. National Science

21

21

Camera 1: Is Setup Time Consistent?

Setup

Setup

Setup

time

Frame 0

Frame 0

Frame 0

Page 22: SocialSync: Synchronization for a Smartphone Camera Network · Ashok, Lin, Ashu and their students 2. Co-Author Jason Holloway 3. LF4CV Reviewers, Paper Accepted 4. National Science

22

22

Variability in Camera Setup Makes Aligning Frames Challenging

Each time camera started, the start of the image sequence will be delayed by a variable amount of time.

•Setup can vary at least 35 ms

•StDev = 9.4 ms

•Not deterministic

Page 23: SocialSync: Synchronization for a Smartphone Camera Network · Ashok, Lin, Ashu and their students 2. Co-Author Jason Holloway 3. LF4CV Reviewers, Paper Accepted 4. National Science

23

23

Frame Delay

Setup Frame 0

time

Frame 1 Frame N

Page 24: SocialSync: Synchronization for a Smartphone Camera Network · Ashok, Lin, Ashu and their students 2. Co-Author Jason Holloway 3. LF4CV Reviewers, Paper Accepted 4. National Science

24

Measurement of Frame Delay

Page 25: SocialSync: Synchronization for a Smartphone Camera Network · Ashok, Lin, Ashu and their students 2. Co-Author Jason Holloway 3. LF4CV Reviewers, Paper Accepted 4. National Science

25

25

Delivery Time of Frame to Application

If we keep measuring capture times of frames, they are spaced evenly

Delivery time of frame to app is a proxy for estimating capture time with delay:

• μ = 67 ms• σ = 4.5 ms

Page 26: SocialSync: Synchronization for a Smartphone Camera Network · Ashok, Lin, Ashu and their students 2. Co-Author Jason Holloway 3. LF4CV Reviewers, Paper Accepted 4. National Science

26

26

1. Characterization

2. SocialSync Protocol

• Estimation

• Alignment

3. Evaluation

Page 27: SocialSync: Synchronization for a Smartphone Camera Network · Ashok, Lin, Ashu and their students 2. Co-Author Jason Holloway 3. LF4CV Reviewers, Paper Accepted 4. National Science

27

27

Setup Frame 0 Frame 1 Frame 2

Setup Frame 0 Frame 1

Setup Frame 0 Frame 1 Frame 2

time

Camera 1:

Camera 2:

Camera 3: Frame 2

Goal of Social Sync

Page 28: SocialSync: Synchronization for a Smartphone Camera Network · Ashok, Lin, Ashu and their students 2. Co-Author Jason Holloway 3. LF4CV Reviewers, Paper Accepted 4. National Science

28

Social Sync Protocol

Estimation Step: Estimating Capture Timestamps to Measure Misalignment of Frames

Alignment Step: Using Repeated Attempts at Launching Image Sequence to Reduce Sub-Frame Misalignment

28

Page 29: SocialSync: Synchronization for a Smartphone Camera Network · Ashok, Lin, Ashu and their students 2. Co-Author Jason Holloway 3. LF4CV Reviewers, Paper Accepted 4. National Science

29

29

Setup Frame 0 Frame 1 Frame 2

Setup Frame 0 Frame 1

Setup Frame 0 Frame 1 Frame 2

time

Camera 1:

Camera 2:

Camera 3: Frame 2

If Misalignment is Due to Camera Setup

Page 30: SocialSync: Synchronization for a Smartphone Camera Network · Ashok, Lin, Ashu and their students 2. Co-Author Jason Holloway 3. LF4CV Reviewers, Paper Accepted 4. National Science

Frame 2

30

30

Setup Frame 0 Frame 1 Frame 2

Setup Frame 0 Frame 1

Setup Frame 0 Frame 1 Frame 2

time

Camera 1:

Camera 2:

Camera 3:

Could We Estimate Capture Time By Calibrating for Setup Time?

Page 31: SocialSync: Synchronization for a Smartphone Camera Network · Ashok, Lin, Ashu and their students 2. Co-Author Jason Holloway 3. LF4CV Reviewers, Paper Accepted 4. National Science

31

31

Recall Wide Variability in Setup

If setup time had little variance, could align capture timestamps by offsetting

•Setup can vary at least 35 ms, when worst case frame misalignment was 33 ms (inverse of FPS)

•Can’t calibrate for setup time to reduce misalignment!

Page 32: SocialSync: Synchronization for a Smartphone Camera Network · Ashok, Lin, Ashu and their students 2. Co-Author Jason Holloway 3. LF4CV Reviewers, Paper Accepted 4. National Science

32

32

Does Frame Delay Provide a Better Estimate of the Capture Timestamp?

Setup Frame 0

time

Frame 1 Frame N

Page 33: SocialSync: Synchronization for a Smartphone Camera Network · Ashok, Lin, Ashu and their students 2. Co-Author Jason Holloway 3. LF4CV Reviewers, Paper Accepted 4. National Science

33

Measurement of Frame Delay

Page 34: SocialSync: Synchronization for a Smartphone Camera Network · Ashok, Lin, Ashu and their students 2. Co-Author Jason Holloway 3. LF4CV Reviewers, Paper Accepted 4. National Science

34

How does estimate of mean improve with number of samples?

Stats 101: Standard error of a sample mean is

Based on Central Limit Theorem, 95% confidence sample mean is within range:

Page 35: SocialSync: Synchronization for a Smartphone Camera Network · Ashok, Lin, Ashu and their students 2. Co-Author Jason Holloway 3. LF4CV Reviewers, Paper Accepted 4. National Science

35

35

Mean Frame Delay Recap

Setup Frame 0

time

Page 36: SocialSync: Synchronization for a Smartphone Camera Network · Ashok, Lin, Ashu and their students 2. Co-Author Jason Holloway 3. LF4CV Reviewers, Paper Accepted 4. National Science

36

36

Mean Frame Delay Recap

Setup Frame 0

time

Mean Delay Est.:

Page 37: SocialSync: Synchronization for a Smartphone Camera Network · Ashok, Lin, Ashu and their students 2. Co-Author Jason Holloway 3. LF4CV Reviewers, Paper Accepted 4. National Science

37

37

Mean Frame Delay Recap

Setup Frame 0

time

Frame 1

Mean Delay Est.:

Page 38: SocialSync: Synchronization for a Smartphone Camera Network · Ashok, Lin, Ashu and their students 2. Co-Author Jason Holloway 3. LF4CV Reviewers, Paper Accepted 4. National Science

38

38

Mean Frame Delay Recap

Setup Frame 0

time

Frame 1 Frame N

Mean Delay Est.:

Page 39: SocialSync: Synchronization for a Smartphone Camera Network · Ashok, Lin, Ashu and their students 2. Co-Author Jason Holloway 3. LF4CV Reviewers, Paper Accepted 4. National Science

39

Samples Required for Estimate

Since mean delay is , we can determine the capture image sequence position for milliseconds using:

•22 samples for 2 ms accuracy

•85 samples for 1 ms accuracy

39

Page 40: SocialSync: Synchronization for a Smartphone Camera Network · Ashok, Lin, Ashu and their students 2. Co-Author Jason Holloway 3. LF4CV Reviewers, Paper Accepted 4. National Science

40

Social Sync Protocol

Estimation Step: Estimating Capture Timestamps to Measure Misalignment of Frames

Alignment Step: Using Repeated Attempts at Launching Image Sequence to Reduce Sub-Frame Misalignment

40

Page 41: SocialSync: Synchronization for a Smartphone Camera Network · Ashok, Lin, Ashu and their students 2. Co-Author Jason Holloway 3. LF4CV Reviewers, Paper Accepted 4. National Science

41

41

Synchronization Tolerance

time

Goal: Want

synchronization to

a reference image

sequence to be

aligned within

some tolerance

Page 42: SocialSync: Synchronization for a Smartphone Camera Network · Ashok, Lin, Ashu and their students 2. Co-Author Jason Holloway 3. LF4CV Reviewers, Paper Accepted 4. National Science

42

42

Synchronization Attempt 1

Setup Frame 0

time

Page 43: SocialSync: Synchronization for a Smartphone Camera Network · Ashok, Lin, Ashu and their students 2. Co-Author Jason Holloway 3. LF4CV Reviewers, Paper Accepted 4. National Science

43

43

Synchronization Attempt 1

time

Frame N

Setup Frame 0

Page 44: SocialSync: Synchronization for a Smartphone Camera Network · Ashok, Lin, Ashu and their students 2. Co-Author Jason Holloway 3. LF4CV Reviewers, Paper Accepted 4. National Science

44

44

Synchronization Attempt k

Setup Frame 0

time

Page 45: SocialSync: Synchronization for a Smartphone Camera Network · Ashok, Lin, Ashu and their students 2. Co-Author Jason Holloway 3. LF4CV Reviewers, Paper Accepted 4. National Science

45

45

Synchronization Attempt k

time

Frame N

Setup Frame 0

Page 46: SocialSync: Synchronization for a Smartphone Camera Network · Ashok, Lin, Ashu and their students 2. Co-Author Jason Holloway 3. LF4CV Reviewers, Paper Accepted 4. National Science

46

Obtaining Synchronization

•Let T be the worst case misalignment between frames

•Let t be the range specified by the sync tolerance, where t ≤T

Let p = t/T, be the probability of synchronization error being reduced for a single phone

46

Page 47: SocialSync: Synchronization for a Smartphone Camera Network · Ashok, Lin, Ashu and their students 2. Co-Author Jason Holloway 3. LF4CV Reviewers, Paper Accepted 4. National Science

47

Single Camera Sync ProbabilityAfter k Attempts

Pk = 1-(1-p)k

Expected Number of Sync Cameras

n*Pk

47

Page 48: SocialSync: Synchronization for a Smartphone Camera Network · Ashok, Lin, Ashu and their students 2. Co-Author Jason Holloway 3. LF4CV Reviewers, Paper Accepted 4. National Science

48

Expected Attempts to Sync N Cameras

48

Page 49: SocialSync: Synchronization for a Smartphone Camera Network · Ashok, Lin, Ashu and their students 2. Co-Author Jason Holloway 3. LF4CV Reviewers, Paper Accepted 4. National Science

49

49

•Characterization

•SocialSync Protocol

•Evaluation

Page 50: SocialSync: Synchronization for a Smartphone Camera Network · Ashok, Lin, Ashu and their students 2. Co-Author Jason Holloway 3. LF4CV Reviewers, Paper Accepted 4. National Science

50

Evaluating Synchronization

NaïveSync SocialSync

4 Cameras

8 Cameras

23 ms

35 ms

5 ms

6 ms

50

Smartphones in array to reduceartifacts not related to timesynchronization error

Page 51: SocialSync: Synchronization for a Smartphone Camera Network · Ashok, Lin, Ashu and their students 2. Co-Author Jason Holloway 3. LF4CV Reviewers, Paper Accepted 4. National Science

51

8 Cameras

Naïve Sync

SocialSync

Reference Views Depth Map 51

Page 52: SocialSync: Synchronization for a Smartphone Camera Network · Ashok, Lin, Ashu and their students 2. Co-Author Jason Holloway 3. LF4CV Reviewers, Paper Accepted 4. National Science

52

4 Cameras

Reference NaïveSync SocialSync

52

Page 53: SocialSync: Synchronization for a Smartphone Camera Network · Ashok, Lin, Ashu and their students 2. Co-Author Jason Holloway 3. LF4CV Reviewers, Paper Accepted 4. National Science

53

4 Cameras

NaïveSync SocialSyncReference

53

Page 54: SocialSync: Synchronization for a Smartphone Camera Network · Ashok, Lin, Ashu and their students 2. Co-Author Jason Holloway 3. LF4CV Reviewers, Paper Accepted 4. National Science

54

Conclusion

1. Characterize Android Camera

2. Developed SocialSync Protocol

3. Demonstrated SocialSync

Future Work:

- Greater control of Android camera system

- In wild implementation

54

Page 55: SocialSync: Synchronization for a Smartphone Camera Network · Ashok, Lin, Ashu and their students 2. Co-Author Jason Holloway 3. LF4CV Reviewers, Paper Accepted 4. National Science

55

Acknowledgements

1. Ashok, Lin, Ashu and their students

2. Co-Author Jason Holloway

3. LF4CV Reviewers, Paper Accepted

4. National Science Foundation

55