kaur
play

Kaur Balw alwinder inder Kaur Senior Member, Technical Staff ON - PowerPoint PPT Presentation

Android 5.xs Stream-Based Camera Architecture Kaur Balw alwinder inder Kaur Senior Member, Technical Staff ON Semiconductor Andr ndroid oid Builder uilders Summit ummit | San an Jos ose e | 3.23.15 3.23.15 Tools ools of of the


  1. Android 5.x’s Stream-Based Camera Architecture Kaur Balw alwinder inder Kaur Senior Member, Technical Staff ON Semiconductor Andr ndroid oid Builder uilder’s Summit ummit | San an Jos ose e | 3.23.15 3.23.15

  2. Tools ools of of the he Trade ade 2

  3. Agenda • The Basic Idea • Enabling New Experiences • Camera2 Architecture • Camera2 APIs – Ready. Set. Go! • The Other Use Cases • The Devil is in the Details • Play Store Filters • Demo • Summary 3

  4. The he Bas asic ic Idea dea Limitations of original Camera Architecture

  5. Limit Limitations ions of of andr android.har oid.hardwar are.C e.Camer amera 3 ¡Primary ¡Opera,ng ¡ No Per-Frame Control ¡ New Features – hard to Modes ¡ implement ¡ • Not ¡Possible ¡ • Preview, Capture & Video • Burst mode photography ¡ Recording ¡ • Zero Shutter Lag, Multi-Shot HDR, Panoramic Stitch No ¡Support ¡for ¡RAW ¡ Minimal Metadata Primi,ve ¡Custom ¡Se@ngs • Most products returned null • Support for face detection • Through for the raw callback ¡ data Camera.Parameters class but no guarantees when the settings would go into effect ¡ http://source.android.com/devices/camera/camera.html 5

  6. Ena nabling bling New New Exper xperiences iences

  7. Camer amera2 a2 Archit hitect ectur ure e Ena nables bles - - Point ¡and ¡Click ¡Camera ¡ Professional ¡Camera ¡ Professional ¡Camera ¡+ ¡Post ¡ Processing ¡on-­‑device ¡ Innova,ve ¡Mobile ¡Camera ¡++ ¡ 7

  8. Fea eatur ures es and and Requir equirement ements Point ¡and ¡Click ¡ Professional ¡Camera ¡ • Preview ¡ • Fine ¡Grained ¡Control ¡of ¡ • S,ll ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡Lens, ¡Sensor, ¡Flash ¡ • Video ¡Recording ¡ • RAW ¡Sensor ¡Output ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡with ¡capture ¡metadata ¡ Computa4onal ¡Photography ¡ Innova4ve ¡Mobile ¡Cameras ¡ • Individual ¡Frame ¡Control ¡ • Sensors ¡ • Algorithms ¡ ¡& ¡Compute ¡ • Loca,on ¡ Power ¡ ¡ • Connec,vity/Cloud ¡Power ¡ • HDR, ¡Focus ¡Stacking, ¡ • Compute ¡Power ¡ Exposure ¡Bracke,ng ¡ ¡ 8

  9. android.har andr oid.hardwar are.camer e.camera2 a2 • Enables Professional Quality Photography – Think DSLR instead of Point-and-Shoot Computa,onal ¡Photography ¡ • Enables Access to RAW Images DSLR++ ¡? ¡ ¡ • Enables On-device processing of Camera Data – High Dynamic Range, Focus Stacking • Enables New Use Cases combining Imaging with – Rich Sensor input Major ¡ • Inertial sensors, altitude et. al. Limita,on-­‑ ¡ – Compute Power Op,cs ¡ • Multi-core CPU & GPU – Connectivity • Power of the Cloud & Access to Proximity (BLE, NFC) – Context • Location & User History 9

  10. Prof ofes essional ional Qualit Quality Phot hotog ography phy • Fine grained control of the – Sensor Professional ¡Camera ¡ – Flash – Lens – Image Signal Processing Pipeline • Control on a per-frame basis, and deterministic behavior • Processing Images at full resolution and full frame rate(30 fps) • Meta data – Every frame is returned with the actual settings that it was taken with, and requested for. 10

  11. Comput omputational ional Phot hotog ography phy Professional ¡Camera ¡+ ¡ Post ¡Processing ¡on-­‑device ¡ Definition • Computational photography refers to computational image capture, processing, and manipulation techniques that enhance or extend the capabilities of digital photography. Source: Wikipedia 11

  12. Mult ulti i Shot hot HD HDR Computa,onal ¡ Photography ¡ • HDR = High Dynamic Range • Multiple shots at different exposures and then blended together 12

  13. Panor anoramic amic Stit itching hing Computa,onal ¡ Photography ¡ Multiple Images with orientation information and fixed Exposure Source: commons.wikimedia.org 13

  14. Flas lash h No-F No-Flas lash h Phot hotog ography phy Computa,onal ¡ Photography ¡ Source: ¡MicrosoW ¡Research ¡ 14

  15. Flas lash h No-F No-Flas lash h Phot hotog ography phy Computa,onal ¡ Photography ¡ • Take 2 shots of the scene– one with flash on, the other with flash off • Computationally blend the 2 frames together Source: Microsoft Research 15

  16. Focus ocus Stac acking king Computa,onal ¡ Photography ¡ Focus Stacking for macro photography. Also known as – all-in-focus photography Source: Wikipedia 16

  17. View iew Finder Finder Computa,onal ¡ Photography ¡ • Today’s smartphones enable features like – Touch to Expose & Touch to Focus • Computational Photography can take it to the next level – Edit the frame in the view finder by selecting areas to sharpen, blur, brighten and maintain these during capture Source: SIGGRAPH 2012 mode 17

  18. Mobile obile Embed mbedded ded Vis ision ion Applica pplications ions • Gesture Recognition Natural ¡User ¡Interface ¡ • Face Recognition, Object Tracking Companies ¡are ¡using ¡the ¡Front ¡ • Visual Search Facing ¡Camera ¡to ¡provide ¡ • 3D Mapping of the environment gesture ¡recogni,on ¡solu,ons. ¡ ¡ • Augmented Reality ¡ 18

  19. Inno nnovativ ive e Mobile obile Camer amera a ++ On-­‑Device ¡ Compute ¡ Sensors ¡ Power ¡ Cloud ¡ Loca,on ¡ Compu,ng ¡ You ¡ Fine ¡Grained ¡ User ¡History ¡ Control ¡ User ¡Preferences ¡ Lens, ¡Sensor, ¡Flash ¡ 19

  20. Camer amera2 a2 Archit hitect ectur ure e

  21. Limit Limitations ions of of andr android.har oid.hardwar are.C e.Camer amera 3 ¡Primary ¡Opera,ng ¡Modes ¡ New Features – hard to implement ¡ No Per-Frame Control ¡ No ¡Support ¡for ¡RAW ¡ Minimal Metadata Custom ¡Se@ngs 21 http://source.android.com/devices/camera/camera.html

  22. Camer amera2 a2 Cor ore e Oper Operation ion Model odel • Per Frame Settings • The Settings travel with individual requests and are no longer globally applied • Image buffer delivered to all configured and requested Surfaces • Metadata returned back to the application as requested separately • Multiple requests and results in queue simultaneously http://source.android.com/devices/camera/camera.html 22

  23. Camer amera3 a3 HA HAL L Model odel 23 http://source.android.com/devices/camera/camera.html

  24. The he Camer amera a APIs

  25. Andr ndroid oid Lollipop Lollipop Camera related classes and interfaces from android.hardware deprecated 2 new packages android.hardware.camera2 android.hardware.camera2.params 25+ classes, 1 Exception 25

  26. Camer amera a Model odel From the Javadoc “This package models a camera device as a pipeline, which takes in input requests for capturing a single frame, captures the single image per the request, and then outputs one capture result metadata packet, plus a set of output image buffers for the request. The requests are processed in-order, and multiple requests can be in flight at once. Since the camera device is a pipeline with multiple stages, having multiple requests in flight is required to maintain full frame-rate on most Android devices.” 26

  27. Archit hitect ectur ure e walk alk thr hrough ough for or pr primar imary us use e cas cases es Live ¡ S,ll ¡Capture ¡ S,ll ¡Capture ¡ Preview ¡ (JPG) ¡ (RAW/DNG) ¡ S,ll ¡Capture ¡ Video ¡ (Burst) ¡ Recording ¡ 27

  28. Ready eady. . Set et. . Go! Go! Figure out what’s available

  29. Concept oncepts and and Ter erms ms from om Camer amera a 2 2 • Camera Device • Capture Request It’s ¡a ¡ • Streams • Capture Result paradigm ¡ ¡ – Image Data • Capture Session s ¡h ¡ ¡i ¡ ¡ ¡f ¡ ¡ ¡ ¡t ¡! ¡ – Metadata • Target Surfaces – Total Capture Result 29

  30. 1. 1. Ho How many many Camer ameras as do do I ha have? e? Query the System for capabilities CameraManager provides information on the number of available cameras, or CameraDevices. CameraManager manager = (CameraManager) getSystemService(Context.CAMERA_SERVICE); String[] camids = manager.getCameraIdList(); 30

  31. 2. 2. Wha hat kind kind of of a a Camer ameraD aDevice ice is is it it? CameraCharacteristics provide static metadata for a given CameraDevice. This information is immutable for a given camera. CameraCharacteristics characteristics = manager.getCameraCharacteristics(camid); CameraCharacteris,cs ¡Keys ¡ Additionally, RAW may be supported ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡INFO_SUPPORTED_HARDWARE_LEVEL ¡ ① FULL + RAW 3 ¡Classes ¡of ¡Cameras ¡are ¡supported ¡ ② LIMITED + RAW ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ LEGACY ¡ LIMITED ¡ FULL ¡ 31

Download Presentation
Download Policy: The content available on the website is offered to you 'AS IS' for your personal information and use only. It cannot be commercialized, licensed, or distributed on other websites without prior consent from the author. To download a presentation, simply click this link. If you encounter any difficulties during the download process, it's possible that the publisher has removed the file from their server.

Recommend


More recommend