SlideShare a Scribd company logo
1 of 68
Camera 2 APIs 
Computational Photography Enablers 
Balwinder Kaur 
Senior Member, Technical Staff 
ON Semiconductor 
© 2014 Samsung Developer Conference. All rights reserved. www.samsungdevcon.com
Tools of the Trade 
2 
© 2014 Samsung Developer Conference. All rights reserved. www.samsungdevcon.com
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 
• Summary 
3 
© 2014 Samsung Developer Conference. All rights reserved. www.samsungdevcon.com
The Basic Idea 
Limitations of Existing Camera APIs 
© 2014 Samsung Developer Conference. All rights reserved. www.samsungdevcon.com
Limitations of android.hardware.Camera 
5 
3 Primary Operating 
Modes 
• Preview, Capture & Video 
Recording 
New Features – hard 
to implement 
• Burst mode photography 
• Zero Shutter Lag, Multi-Shot 
HDR, Panoramic Stitch 
No Support for RAW 
• Most products returned null 
for the raw callback 
Minimal Metadata 
• Support for face detection 
dataa 
http://source.android.com/devices/camera/camera.html 
No Per-Frame Control 
• Not Possible 
Primitive Custom Settings 
• Through 
Camera.Parameters class 
but no guarantees when the 
settings would go into effect 
© 2014 Samsung Developer Conference. All rights reserved. www.samsungdevcon.com
Enabling New Experiences 
© 2014 Samsung Developer Conference. All rights reserved. www.samsungdevcon.com
Camera2 API Enables - 
7 
Point and Click Camera 
Professional Camera 
Professional Camera + Post 
Processing on-device 
Innovative Mobile Camera ++ 
© 2014 Samsung Developer Conference. All rights reserved. www.samsungdevcon.com
Features and Requirements 
8 
Point and Click 
•Preview 
•Still 
•Video Recording 
Professional Camera 
•Fine Grained Control of 
Lens, Sensor, Flash 
•RAW Sensor Output 
with capture metadata 
Computational Photography 
•Individual Frame Control 
•Algorithms & Compute 
Power 
•HDR, Focus Stacking, 
Exposure Bracketing 
Innovative Mobile Cameras 
•Sensors 
•Location 
•Connectivity/Cloud Power 
•Compute Power 
© 2014 Samsung Developer Conference. All rights reserved. www.samsungdevcon.com
android.hardware.camera2 
• Enables Professional Quality Photography 
• Enables Access to RAW Images 
• Enables On-device processing of Camera Data 
• Enables New Use Cases combining Imaging with 
9 
– Think DSLR instead of Point-and-Shoot 
– High Dynamic Range, Focus Stacking 
– Rich Sensor input 
• Inertial sensors, altitude et. al. 
– Compute Power 
• Multi-core CPU & GPU 
– Connectivity 
• Power of the Cloud & Access to Proximity (BLE, NFC) 
– Context 
• Location & User History 
Major 
Limitation- 
Optics 
DSLR++ ? 
Computational Photography 
© 2014 Samsung Developer Conference. All rights reserved. www.samsungdevcon.com
Professional Quality Photography 
• Fine grained control of the 
– Sensor 
– 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 
10 
Professional Camera 
– Every frame is returned with the actual settings that it was taken with, and 
requested for. 
© 2014 Samsung Developer Conference. All rights reserved. www.samsungdevcon.com
Computational Photography 
Definition 
Professional Camera + 
Post Processing on-device 
• Computational photography refers to computational image capture, 
processing, and manipulation techniques that enhance or extend the 
capabilities of digital photography. 
11 
Source: Wikipedia 
© 2014 Samsung Developer Conference. All rights reserved. www.samsungdevcon.com
Multi Shot HDR 
Computational 
Photography 
• HDR = High Dynamic Range 
• Multiple shots at different exposures and then blended together 
12 
© 2014 Samsung Developer Conference. All rights reserved. www.samsungdevcon.com
Panoramic Stitching 
13 
Multiple Images with orientation information and fixed Exposure 
Source: commons.wikimedia.org 
Computational 
Photography 
© 2014 Samsung Developer Conference. All rights reserved. www.samsungdevcon.com
Flash No-Flash Photography 
Source: Microsoft Research 
14 
Computational 
Photography 
© 2014 Samsung Developer Conference. All rights reserved. www.samsungdevcon.com
Flash No-Flash Photography 
Source: Microsoft Research 
15 
Computational 
Photography 
• Take 2 shots of the scene– one 
with flash on, the other with 
flash off 
• Computationally blend the 2 
frames together 
© 2014 Samsung Developer Conference. All rights reserved. www.samsungdevcon.com
Focus Stacking 
Focus Stacking for macro photography. 
Also known as – all-in-focus photography 
Source: Wikipedia 
16 
Computational 
Photography 
© 2014 Samsung Developer Conference. All rights reserved. www.samsungdevcon.com
View Finder 
• Today’s smartphones 
enable features like 
• Computational 
Photography can take it to 
the next level 
17 
– Touch to Expose & Touch to 
Focus 
– Edit the frame in the view 
Computational 
Photography 
finder by selecting areas to 
sharpen, blur, brighten and 
maintain these during capture 
mode Source: SIGGRAPH 2012 
Android L Sample HdrViewFinder demonstrates a similar concept 
© 2014 Samsung Developer Conference. All rights reserved. www.samsungdevcon.com
Mobile Embedded Vision Applications 
• Gesture Recognition 
• Face Recognition, Object Tracking 
• Visual Search 
• 3D Mapping of the environment 
• Augmented Reality 
18 
Natural User Interface 
Companies are using the Front 
Facing Camera to provide gesture 
recognition solutions. 
© 2014 Samsung Developer Conference. All rights reserved. www.samsungdevcon.com
Innovative Mobile Camera ++ 
19 
Cloud 
Computing 
On-Device 
Compute 
Power 
Sensors 
Fine Grained 
Control 
You Lens, Sensor, Flash 
Location 
User History 
User Preferences 
© 2014 Samsung Developer Conference. All rights reserved. www.samsungdevcon.com
Camera2 Architecture 
© 2014 Samsung Developer Conference. All rights reserved. www.samsungdevcon.com
Limitations of android.hardware.Camera 
21 
3 Primary Operating Modes 
New Features – hard to implement 
No Per-Frame Control 
No Support for RAW 
Minimal Metadata 
Custom Settings 
http://source.android.com/devices/camera/camera.html 
© 2014 Samsung Developer Conference. All rights reserved. www.samsungdevcon.com
Camera2 Core 
Operation Model 
• 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 
© 2014 Samsung Developer Conference. All rights reserved. www.samsungdevcon.com
Camera3 HAL Model 
23 
http://source.android.com/devices/camera/camera.html 
© 2014 Samsung Developer Conference. All rights reserved. www.samsungdevcon.com
The Camera APIs 
© 2014 Samsung Developer Conference. All rights reserved. www.samsungdevcon.com
Android Lollipop 
Camera related classes and interfaces from android.hardware deprecated 
2 new packages 
25 
android.hardware.camera2 
android.hardware.camera2.params 
25+ classes, 1 Exception 
© 2014 Samsung Developer Conference. All rights reserved. www.samsungdevcon.com
Camera Model 
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 
© 2014 Samsung Developer Conference. All rights reserved. www.samsungdevcon.com
API walk through for primary use cases 
Live Preview 
27 
Still Capture 
(JPG) 
Still Capture 
(RAW/DNG) 
Still Capture 
(Burst) 
Video 
Recording 
© 2014 Samsung Developer Conference. All rights reserved. www.samsungdevcon.com
Ready. Set. Go! 
Figure out what’s available 
© 2014 Samsung Developer Conference. All rights reserved. www.samsungdevcon.com
Concepts and Terms from Camera 2 
• Camera Device 
• Streams 
• Capture Session 
• Target Surfaces 
29 
It’s a 
paradigm 
s h i f t ! 
• Capture Request 
• Capture Result 
– Image Data 
– Metadata 
– Total Capture Result 
© 2014 Samsung Developer Conference. All rights reserved. www.samsungdevcon.com
1. How many Cameras do I have? 
Query the System for capabilities 
CameraManager provides information on the number of available 
cameras, or CameraDevices. 
CameraManager manager = 
String[] camids = manager.getCameraIdList(); 
30 
(CameraManager) getSystemService(Context.CAMERA_SERVICE); 
© 2014 Samsung Developer Conference. All rights reserved. www.samsungdevcon.com
2. What kind of a CameraDevice is it? 
CameraCharacteristics provide static metadata for a given 
CameraDevice. This information is immutable for a given camera. 
CameraCharacteristics characteristics = 
CameraCharacteristics Keys 
3 Classes of Cameras are supported 
31 
manager.getCameraCharacteristics(camid); 
INFO_SUPPORTED_HARDWARE_LEVEL 
Additionally, RAW may be supported 
① FULL + RAW 
② LIMITED + RAW 
LEGACY LIMITED FULL 
© 2014 Samsung Developer Conference. All rights reserved. www.samsungdevcon.com
3. How many maximum streams does the system 
support? 
3 Classes of Streams 
①Processed & Non-Stalling 
②Processed & Stalling 
③RAW (Bayer Domain) 
The Maximum Number of Streams = 
REQUEST_MAX_NUM_OUTPUT_PROC1 
+ REQUEST_MAX_NUM_OUTPUT_PROC_STALLING1 
+ REQUEST_MAX_NUM_OUTPUT_RAW1 
FULL >=3 >=1 >=0 
LIMITED >=2 >=1 >=0 
LEGACY >=2 >=1 0 
32 
PROCESSED & 
NON_STALLING 
(like YUV) 
PROCESSED & 
STALLING 
(like JPEG) 
RAW 
1 CameraCharacteristics.Key 
© 2014 Samsung Developer Conference. All rights reserved. www.samsungdevcon.com
Guaranteed Stream Configurations - LEGACY 
Type Max Size Type Max Size Type Max Size 
PRIV1 Maximum2 
JPEG Maximum 
YUV Maximum 
PRIV Preview JPEG Maximum 
YUV Preview JPEG Maximum 
PRIV Preview PRIV Preview 
PRIV Preview YUV Preview 
PRIV Preview YUV Preview JPEG Maximum 
33 
Target 1 Target 2 Target 3 
Still capture plus in-app processing. 
1 Device Opaque Format, No Visibility into Format for Application 
2 Device Maximum Sensor Output 
© 2014 Samsung Developer Conference. All rights reserved. www.samsungdevcon.com
Guaranteed Stream Configurations - LIMITED 
34 
Target 1 Target 2 Target 3 
Type Max Size Type Max Size Type Max Size 
PRIV Preview PRIV Record 1 
PRIV Preview YUV Record 
YUV Preview YUV Record 
PRIV Preview PRIV Record JPEG Record 
PRIV Preview YUV Record JPEG Record 
YUV Preview YUV Preview JPEG Maximum 
1 Maximum resolution supported by the device for media recording 
© 2014 Samsung Developer Conference. All rights reserved. www.samsungdevcon.com
Guaranteed Stream Configurations - FULL 
35 
Target 1 Target 2 Target 3 
Type Max Size Type Max Size Type Max Size 
PRIV Preview PRIV Maximum 
PRIV Preview YUV Maximum 
YUV Preview YUV Maximum 
PRIV Preview PRIV Preview JPEG Maximum 
YUV 640x480 PRIV Preview YUV Maximum 
YUV 640x480 YUV Preview YUV Maximum 
© 2014 Samsung Developer Conference. All rights reserved. www.samsungdevcon.com
Guaranteed Stream Configurations - RAW 
36 
Target 1 Target 2 Target 3 
Type Max Size Type Max Size Type Max Size 
RAW Maximum 
PRIV Preview RAW Maximum 
YUV Preview RAW Maximum 
PRIV Preview PRIV Preview RAW Maximum 
PRIV Preview YUV Preview RAW Maximum 
YUV In-Preview app processing YUV with simultaneous Preview JPEG RAW and DNG. 
Maximum 
PRIV Preview JPEG Maximum RAW Maximum 
YUV Preview JPEG Maximum RAW Maximum 
© 2014 Samsung Developer Conference. All rights reserved. www.samsungdevcon.com
4. How can these streams be configured? 
CameraCharacteristics characteristics = 
cameraManager.getCameraCharacteristics(cameraId); 
StreamConfigurationMap configs = characteristics.get( 
StreamConfigurationMap provides information on 
• Supported Stalling and Non-Stalling Image Formats 
• Supported Image Sizes for Supported Image Formats 
• Supported Video Sizes and fps(frames per Second) Speeds 
• Minimum Frame Duration and Stall Duration for supported formats and sizes 
• Determine whether a given Surface is supported by this CameraDevice or not 
37 
CameraCharacteristics.SCALER_STREAM_CONFIGURATION_MAP); 
© 2014 Samsung Developer Conference. All rights reserved. www.samsungdevcon.com
FULL Camera Devices 
sensor max resolution 
more than 20fps is required 
38 
30 FPS at 
Per Frame Control 
android.sync.maxLatency 
PER_FRAME_CONTROL 
Manual Sensor Control 
Manual Post Processing 
Control 
android.request.availableCapabilities 
Arbitrary Cropping 
Region 
android.scaler.croppingType == 
FREEFORM 
Minimum 3 Processed 
Non-Stalling Output 
Streams 
(think YUV) 
Stream Configurations 
Available 
as a Configuration Map 
© 2014 Samsung Developer Conference. All rights reserved. www.samsungdevcon.com
LIMITED and LEGACY Camera Device 
LEGACY 
•NO Per- Frame Control 
•NO Manual Sensor Control 
•NO Manual Post Processing 
• NO Arbitrary Cropping Regions 
•No Stringent Performance Constraints 
•Not a candidate for a Superior Camera Experience 
39 
LIMITED 
• Query for individual capabilities! 
That’s 
a lot of 
checks! 
LEGACY LIMITED FULL 
① FULL + RAW 
② LIMITED + RAW 
© 2014 Samsung Developer Conference. All rights reserved. www.samsungdevcon.com
Ready. Set. Go! 
Open the Camera 
© 2014 Samsung Developer Conference. All rights reserved. www.samsungdevcon.com
1. Open a Full Camera Device 
① Use the instance of the CameraManager to open a Camera passing 
② Get a handle to a CameraDevice via the 
41 
in its camera id. 
CameraDevice.StateCallback method when it is successfully 
opened. 
CameraDevice.StateCallback mStateCallback = new 
CameraDevice.StateCallback () { 
…}; 
manager.openCamera(camid, mStateCallback, ..); 
© 2014 Samsung Developer Conference. All rights reserved. www.samsungdevcon.com
2. Create a Capture Session 
• Expensive Operation 
Minimize calls to 
createCaptureSession 
CameraCaptureSession.StateCallback mCaptureCallback= new 
CameraCaptureSession.StateCallback () {...}; 
List<Surface> outputs = new ArrayList<Surface>(...); 
createCaptureSession (outputs, mCaptureCallback, ...); 
// a handle to a capture session in mCaptureCallback 
method 
42 
– Involves allocation of buffers beneath the HAL 
–May take up to several hundred milliseconds 
•All modes cannot be supported concurrently 
–so Sessions may have to be torn down and setup again. 
Failure to create a capture session may result in exceptions being thrown 
© 2014 Samsung Developer Conference. All rights reserved. www.samsungdevcon.com
Different Target Output Streams 
43 
© 2014 Samsung Developer Conference. All rights reserved. www.samsungdevcon.com
3. Create a Capture Request 
① Pick the Capture Request Template 
CaptureRequest.Builder mPreviewBuilder = mCameraDevice 
.createCaptureRequest(CameraDevice.TEMPLATE_PREVIEW); 
44 
o TEMPLATE_PREVIEW 
o TEMPLATE_STILL_CAPTURE 
o TEMPLATE_VIDEO_SNAPSHOT 
o TEMPLATE_RECORD 
o TEMPLATE_MANUAL 
© 2014 Samsung Developer Conference. All rights reserved. www.samsungdevcon.com
3. Create a Capture Request – contd. 
② Pick an appropriate target output 
o e.g. TextureView for the correct width/height for Preview 
mPreviewBuilder.addTarget(mPreviewSurface); //where 
mPreviewSurface is a Surface initialized to the width and 
height of the Preview Desired 
③ Pick the Frequency of the Capture Request 
o capture 
o captureBurst 
o setRepeatingRequest 
o setRepeatingBurst 
o stopRepeating 
o abortCaptures() 
45 
© 2014 Samsung Developer Conference. All rights reserved. www.samsungdevcon.com
Ready. Set. Go! 
Get your pictures 
© 2014 Samsung Developer Conference. All rights reserved. www.samsungdevcon.com
Receiving Image and Metadata 
mSession.setRepeatingRequest(mPreviewBuilder.build(), 
listener,backgroundHandler); 
• The Image data is typically received in a listener associated with the 
Output Surface. 
• The Metadata is received in the onCaptureCompleted callback 
method of CameraCaptureSession.CaptureCallback via the 
TotalCaptureResult object. 
47 
How does the 
metadata tie to 
the correct image 
data frame? 
Through the Time Stamp! 
CaptureResult.SENSOR_TIMESTAMP 
& image.getTimestamp() 
© 2014 Samsung Developer Conference. All rights reserved. www.samsungdevcon.com
The Other Use Cases 
© 2014 Samsung Developer Conference. All rights reserved. www.samsungdevcon.com
Still Capture - JPEG 
①Use TEMPLATE_STILL_CAPTURE for the CaptureRequest 
②Create an ImageReader object with format == 
③Pick CameraCaptureSession.capture for the frequency of 
④Image Data is received in the 
⑤Metadata is received in the 
49 
ImageFormat.JPEG 
capture 
ImageReader.onImageAvailableListener 
CameraCaptureSession.CaptureCallback. 
onCaptureCompleted callback 
© 2014 Samsung Developer Conference. All rights reserved. www.samsungdevcon.com
Still Capture - RAW 
① Use TEMPLATE_STILL_CAPTURE for the CaptureRequest 
② Create an ImageReader object with format == ImageFormat. 
③ Pick CameraCaptureSession.capture for the frequency of capture 
④ Image Data is received in the ImageReader.onImageAvailableListener 
⑤ Metadata is received in the 
⑥ Use an instance of DngCreator to convert RAW to DNG (Digital Negative) 
50 
ImageFormat.RAW_SENSOR 
CameraCaptureSession.CaptureCallback.onCaptureCompleted callback 
final File dngFile = new File(path, filename); 
outs = new FileOutputStream(dngFile); 
if (mRawTotalResult != null) { 
DngCreator d = new DngCreator(characteristics, mRawTotalResult); 
d.writeImage(outs, image); 
} 
© 2014 Samsung Developer Conference. All rights reserved. www.samsungdevcon.com
Still Capture - BURST 
① Use TEMPLATE_STILL_CAPTURE for the CaptureRequest 
② Create an ImageReader object with format == ImageFormat. 
③ Pick CameraCaptureSession.captureBurst for the frequency of capture 
④ Image Data is received in the ImageReader.onImageAvailableListener 
⑤ Metadata is received in the CameraCaptureSession.CaptureCallback. 
51 
ImageFormat.JPEG 
onCaptureCompleted callback 
© 2014 Samsung Developer Conference. All rights reserved. www.samsungdevcon.com
Video Recording 
①Use TEMPLATE_RECORD for the CaptureRequest 
②Create a MediaRecorder Object and use its surface 
③Pick CameraCaptureSession.setRepeatingRequest 
④Image Data is recorded in the Image file set via 
⑤Metadata is received in the 
52 
as the output stream 
for the frequency of capture 
MediaRecorder.setOutputFile call. 
CameraCaptureSession.CaptureCallback. 
onCaptureCompleted callback 
© 2014 Samsung Developer Conference. All rights reserved. www.samsungdevcon.com
In-App Processing of Camera Data 
① Use an appropriate Template for the CaptureRequest; including 
② Create an object like Allocation Renderscript, ImageReader (with 
③ Pick an appropriate frequency for capture 
④ Image Data can be found in an appropriate callback for the surface 
⑤ Metadata is received in the CameraCaptureSession.CaptureCallback. 
53 
TEMPLATE_MANUAL if the use case so demands 
Format YUV_420_888), SurfaceTexture, or GLSurfaceView that 
provides a Surface 
chosen 
onCaptureCompleted callback 
© 2014 Samsung Developer Conference. All rights reserved. www.samsungdevcon.com
Some use cases for In-App Processing 
54 
• Use Cases 
– Filters 
– Computational Photography Use cases 
– Custom Post Processing of the Imaging Pipeline 
– Computer Vision Applications 
• Uses 
– Compute Framework 
• Renderscript, OpenCL 
– Low level Graphics APIs 
• OpenGL ES 
© 2014 Samsung Developer Conference. All rights reserved. www.samsungdevcon.com
And then there was Metadata… 
55 
CameraMetadata 
Controls 
CaptureRequest 
Information 
Static Metadata 
Fixed for a given CameraDevice 
CameraCharacteristics 
Dynamic Metadata 
Settings associated with each 
frame 
CaptureResult 
Key Value Pairs for Hardware Control (Lens, Sensor, Flash), Image Processing 
Pipeline, Control Algorithms and Output Buffers 
© 2014 Samsung Developer Conference. All rights reserved. www.samsungdevcon.com
Fine Grained Control 
a.k.a “The Devil is in the Details” 
© 2014 Samsung Developer Conference. All rights reserved. www.samsungdevcon.com
Manual Sensor Control 
57 
Sensor 
Sensitivity 
(Gain/ISO) 
Sensor 
Exposure Time 
Sensor Frame 
Duration 
Flash 
(if present) 
Flash 
Mode 
Lens 
(if adjustable) 
Lens Aperture 
Lens Filter Density 
Lens Focal Length 
Lens Focus Distance 
Black Level 
Lock 
Black 
Level 
Lock 
On/Off 
© 2014 Samsung Developer Conference. All rights reserved. www.samsungdevcon.com
Manual 3A Control 
• A Camera Request can override the 3A Algorithm Controls 
– Auto Exposure (AE) 
– Auto Focus(AF) 
– Auto White Balance (AWB) 
• There is an overall control for all Auto Algorithms 
58 
android.control.mode 
– When set to OFF, application has full control of the pipeline 
– When set to AUTO, the individual controls are in effect 
© 2014 Samsung Developer Conference. All rights reserved. www.samsungdevcon.com
Application Controlled (Auto) Algorithms 
Auto Focus 
android.control.mode= AUTO 
android.control.a*mode = OFF 
Auto Exposure 
• Application uses android.sensor.exposureTime, android.sensor.sensitivity 
Auto White Balance 
59 
• Application uses android.lens.focusDistance to control the Lens 
and android.sensor.frameDuration + android.flash.* to control exposure 
• Application uses android.colorCorrection.transform & 
android.colorCorrection.gains to control the white balance 
© 2014 Samsung Developer Conference. All rights reserved. www.samsungdevcon.com
Manual Post Processing 
60 
http://source.android.com/devices/camera/camera.html 
© 2014 Samsung Developer Conference. All rights reserved. www.samsungdevcon.com
Image Processing Pipeline 
Shading Mode 
(lens shading) 
61 
Hot Pixel 
Mode 
Black Level 
Correction 
Demosaic 
Noise 
Reduction 
Mode 
Color 
Correction 
Mode 
Tone Curve 
Adjustment 
Edge 
Enhancement 
© 2014 Samsung Developer Conference. All rights reserved. www.samsungdevcon.com
Manual Post Processing 
62 
Manual Tonemap control 
• android.tonemap.* 
Manual White Balance control 
• android.colorCorrection.* 
Manual Lens Shading map control 
• android.shading.* 
Manual aberration correction control (if supported) 
• android.colorCorrection.aberration.* 
© 2014 Samsung Developer Conference. All rights reserved. www.samsungdevcon.com
The other camera2 package 
android.hardware.camera2.params 
• BlackLevelPattern 
• ColorSpaceTransform 
• Face 
• LensShadingMap 
• MeteringRectangle 
• RggbChannelVector 
• StreamConfigurationMap 
• TonemapCurve 
63 
© 2014 Samsung Developer Conference. All rights reserved. www.samsungdevcon.com
Play Store Feature Filters 
Android Manifest <uses-feature> 
© 2014 Samsung Developer Conference. All rights reserved. www.samsungdevcon.com
Play Store Feature Filters 
• android.hardware.camera.hardware_level.full 
• android.hardware.camera.capability.raw 
• android.hardware.camera.capability.manual_sensor 
• android.hardware.camera.capability.manual_post_processing 
65 
See Also: Versioning 
© 2014 Samsung Developer Conference. All rights reserved. www.samsungdevcon.com
Summary 
© 2014 Samsung Developer Conference. All rights reserved. www.samsungdevcon.com
Cloud 
Computing 
Lens, Sensor, Flash 
67 
Its all about you and your power tools! 
On-Device 
Compute 
Power 
Sensors 
Fine Grained 
Control 
You Location 
User History 
User Preferences 
© 2014 Samsung Developer Conference. All rights reserved. www.samsungdevcon.com
68 
Q&A 
and THANK YOU for your time. 
Balwinder Kaur 
balwinder dot x dot kaur at gmail dot com 
http://www.slideshare.net/lbk003 https://github.com/lbk003 
© 2014 Samsung Developer Conference. All rights reserved. www.samsungdevcon.com

More Related Content

What's hot

The Android graphics path, in depth
The Android graphics path, in depthThe Android graphics path, in depth
The Android graphics path, in depthChris Simmonds
 
"Learning AOSP" - Android Hardware Abstraction Layer (HAL)
"Learning AOSP" - Android Hardware Abstraction Layer (HAL)"Learning AOSP" - Android Hardware Abstraction Layer (HAL)
"Learning AOSP" - Android Hardware Abstraction Layer (HAL)Nanik Tolaram
 
Multimedia on android
Multimedia on androidMultimedia on android
Multimedia on androidRamesh Prasad
 
Hable John Uncharted2 Hdr Lighting
Hable John Uncharted2 Hdr LightingHable John Uncharted2 Hdr Lighting
Hable John Uncharted2 Hdr Lightingozlael ozlael
 
Scene Graphs & Component Based Game Engines
Scene Graphs & Component Based Game EnginesScene Graphs & Component Based Game Engines
Scene Graphs & Component Based Game EnginesBryan Duggan
 
Understanding the Android System Server
Understanding the Android System ServerUnderstanding the Android System Server
Understanding the Android System ServerOpersys inc.
 
NDC 2017 비주얼 선택과 집중 - 3on3 아트 포스트모템
NDC 2017 비주얼 선택과 집중 - 3on3 아트 포스트모템NDC 2017 비주얼 선택과 집중 - 3on3 아트 포스트모템
NDC 2017 비주얼 선택과 집중 - 3on3 아트 포스트모템burnaby yang
 
Kernel Recipes 2017 - An introduction to the Linux DRM subsystem - Maxime Ripard
Kernel Recipes 2017 - An introduction to the Linux DRM subsystem - Maxime RipardKernel Recipes 2017 - An introduction to the Linux DRM subsystem - Maxime Ripard
Kernel Recipes 2017 - An introduction to the Linux DRM subsystem - Maxime RipardAnne Nicolas
 
Secrets of CryENGINE 3 Graphics Technology
Secrets of CryENGINE 3 Graphics TechnologySecrets of CryENGINE 3 Graphics Technology
Secrets of CryENGINE 3 Graphics TechnologyTiago Sousa
 
2-Game Design (Game Design and Development)
2-Game Design (Game Design and Development)2-Game Design (Game Design and Development)
2-Game Design (Game Design and Development)Hafiz Ammar Siddiqui
 
[TGDF 2020] Mobile Graphics Best Practices for Artist
[TGDF 2020] Mobile Graphics Best Practices for Artist[TGDF 2020] Mobile Graphics Best Practices for Artist
[TGDF 2020] Mobile Graphics Best Practices for ArtistOwen Wu
 
Hello, DirectCompute
Hello, DirectComputeHello, DirectCompute
Hello, DirectComputedasyprocta
 
Game Engine Architecture
Game Engine ArchitectureGame Engine Architecture
Game Engine ArchitectureAttila Jenei
 
LOD and Culling Systems That Scale - Unite LA
LOD and Culling Systems That Scale  - Unite LALOD and Culling Systems That Scale  - Unite LA
LOD and Culling Systems That Scale - Unite LAUnity Technologies
 
Using and Customizing the Android Framework / part 4 of Embedded Android Work...
Using and Customizing the Android Framework / part 4 of Embedded Android Work...Using and Customizing the Android Framework / part 4 of Embedded Android Work...
Using and Customizing the Android Framework / part 4 of Embedded Android Work...Opersys inc.
 

What's hot (20)

Android Camera
Android CameraAndroid Camera
Android Camera
 
Android Audio System
Android Audio SystemAndroid Audio System
Android Audio System
 
The Android graphics path, in depth
The Android graphics path, in depthThe Android graphics path, in depth
The Android graphics path, in depth
 
"Learning AOSP" - Android Hardware Abstraction Layer (HAL)
"Learning AOSP" - Android Hardware Abstraction Layer (HAL)"Learning AOSP" - Android Hardware Abstraction Layer (HAL)
"Learning AOSP" - Android Hardware Abstraction Layer (HAL)
 
Multimedia on android
Multimedia on androidMultimedia on android
Multimedia on android
 
Hable John Uncharted2 Hdr Lighting
Hable John Uncharted2 Hdr LightingHable John Uncharted2 Hdr Lighting
Hable John Uncharted2 Hdr Lighting
 
Scene Graphs & Component Based Game Engines
Scene Graphs & Component Based Game EnginesScene Graphs & Component Based Game Engines
Scene Graphs & Component Based Game Engines
 
Understanding the Dalvik Virtual Machine
Understanding the Dalvik Virtual MachineUnderstanding the Dalvik Virtual Machine
Understanding the Dalvik Virtual Machine
 
Understanding the Android System Server
Understanding the Android System ServerUnderstanding the Android System Server
Understanding the Android System Server
 
NDC 2017 비주얼 선택과 집중 - 3on3 아트 포스트모템
NDC 2017 비주얼 선택과 집중 - 3on3 아트 포스트모템NDC 2017 비주얼 선택과 집중 - 3on3 아트 포스트모템
NDC 2017 비주얼 선택과 집중 - 3on3 아트 포스트모템
 
Kernel Recipes 2017 - An introduction to the Linux DRM subsystem - Maxime Ripard
Kernel Recipes 2017 - An introduction to the Linux DRM subsystem - Maxime RipardKernel Recipes 2017 - An introduction to the Linux DRM subsystem - Maxime Ripard
Kernel Recipes 2017 - An introduction to the Linux DRM subsystem - Maxime Ripard
 
Secrets of CryENGINE 3 Graphics Technology
Secrets of CryENGINE 3 Graphics TechnologySecrets of CryENGINE 3 Graphics Technology
Secrets of CryENGINE 3 Graphics Technology
 
=SLAM ppt.pdf
=SLAM ppt.pdf=SLAM ppt.pdf
=SLAM ppt.pdf
 
2-Game Design (Game Design and Development)
2-Game Design (Game Design and Development)2-Game Design (Game Design and Development)
2-Game Design (Game Design and Development)
 
[TGDF 2020] Mobile Graphics Best Practices for Artist
[TGDF 2020] Mobile Graphics Best Practices for Artist[TGDF 2020] Mobile Graphics Best Practices for Artist
[TGDF 2020] Mobile Graphics Best Practices for Artist
 
Embedded Android : System Development - Part III (Audio / Video HAL)
Embedded Android : System Development - Part III (Audio / Video HAL)Embedded Android : System Development - Part III (Audio / Video HAL)
Embedded Android : System Development - Part III (Audio / Video HAL)
 
Hello, DirectCompute
Hello, DirectComputeHello, DirectCompute
Hello, DirectCompute
 
Game Engine Architecture
Game Engine ArchitectureGame Engine Architecture
Game Engine Architecture
 
LOD and Culling Systems That Scale - Unite LA
LOD and Culling Systems That Scale  - Unite LALOD and Culling Systems That Scale  - Unite LA
LOD and Culling Systems That Scale - Unite LA
 
Using and Customizing the Android Framework / part 4 of Embedded Android Work...
Using and Customizing the Android Framework / part 4 of Embedded Android Work...Using and Customizing the Android Framework / part 4 of Embedded Android Work...
Using and Customizing the Android Framework / part 4 of Embedded Android Work...
 

Viewers also liked

Camera 2.0 in Android 4.2
Camera 2.0 in Android 4.2 Camera 2.0 in Android 4.2
Camera 2.0 in Android 4.2 Balwinder Kaur
 
Camera2 introdction
Camera2 introdctionCamera2 introdction
Camera2 introdctionBooch Lin
 
Hidden Camera 3 APIs in Android 4.4 (KitKat)
Hidden Camera 3 APIs in Android 4.4 (KitKat)Hidden Camera 3 APIs in Android 4.4 (KitKat)
Hidden Camera 3 APIs in Android 4.4 (KitKat)Balwinder Kaur
 
Android Camera Architecture
Android Camera ArchitectureAndroid Camera Architecture
Android Camera ArchitecturePicker Weng
 
Camera2 API, SHIM, and HAL 3.2 in Android 5.1
Camera2 API, SHIM, and HAL 3.2 in Android 5.1Camera2 API, SHIM, and HAL 3.2 in Android 5.1
Camera2 API, SHIM, and HAL 3.2 in Android 5.1Cheng Hsien Chen
 
Introduction of Android Camera1
Introduction of Android Camera1Introduction of Android Camera1
Introduction of Android Camera1Booch Lin
 
Going Beyond the Device Heart Beat
Going Beyond the Device Heart BeatGoing Beyond the Device Heart Beat
Going Beyond the Device Heart BeatBalwinder Kaur
 
A new Post-Processing Pipeline
A new Post-Processing PipelineA new Post-Processing Pipeline
A new Post-Processing PipelineWolfgang Engel
 
Training Videovigilancia IP: What, Why, When and How
Training Videovigilancia IP: What, Why, When and HowTraining Videovigilancia IP: What, Why, When and How
Training Videovigilancia IP: What, Why, When and HowNestor Carralero
 
Jenkins@EC2 による 継続的インテグレーション
Jenkins@EC2 による 継続的インテグレーションJenkins@EC2 による 継続的インテグレーション
Jenkins@EC2 による 継続的インテグレーションbluepapa32
 
GreenDao Introduction
GreenDao IntroductionGreenDao Introduction
GreenDao IntroductionBooch Lin
 
Android internals 03 - Build system, emulator (rev_1.1)
Android internals 03 - Build system, emulator (rev_1.1)Android internals 03 - Build system, emulator (rev_1.1)
Android internals 03 - Build system, emulator (rev_1.1)Egor Elizarov
 
Location-Based Services on Android
Location-Based Services on AndroidLocation-Based Services on Android
Location-Based Services on AndroidJomar Tigcal
 
AWS Black Belt Techシリーズ リザーブドインスタンス & スポットインスタンス
AWS Black Belt Techシリーズ リザーブドインスタンス & スポットインスタンスAWS Black Belt Techシリーズ リザーブドインスタンス & スポットインスタンス
AWS Black Belt Techシリーズ リザーブドインスタンス & スポットインスタンスAmazon Web Services Japan
 
Camera API 3.0を触ってみた
Camera API 3.0を触ってみたCamera API 3.0を触ってみた
Camera API 3.0を触ってみたMasaki Otsuki
 

Viewers also liked (19)

Camera 2.0 in Android 4.2
Camera 2.0 in Android 4.2 Camera 2.0 in Android 4.2
Camera 2.0 in Android 4.2
 
Camera2 introdction
Camera2 introdctionCamera2 introdction
Camera2 introdction
 
Hidden Camera 3 APIs in Android 4.4 (KitKat)
Hidden Camera 3 APIs in Android 4.4 (KitKat)Hidden Camera 3 APIs in Android 4.4 (KitKat)
Hidden Camera 3 APIs in Android 4.4 (KitKat)
 
Android Camera Architecture
Android Camera ArchitectureAndroid Camera Architecture
Android Camera Architecture
 
Camera2 API, SHIM, and HAL 3.2 in Android 5.1
Camera2 API, SHIM, and HAL 3.2 in Android 5.1Camera2 API, SHIM, and HAL 3.2 in Android 5.1
Camera2 API, SHIM, and HAL 3.2 in Android 5.1
 
Introduction of Android Camera1
Introduction of Android Camera1Introduction of Android Camera1
Introduction of Android Camera1
 
Camera2
Camera2Camera2
Camera2
 
IoT in the Enterprise
IoT in the EnterpriseIoT in the Enterprise
IoT in the Enterprise
 
Going Beyond the Device Heart Beat
Going Beyond the Device Heart BeatGoing Beyond the Device Heart Beat
Going Beyond the Device Heart Beat
 
A new Post-Processing Pipeline
A new Post-Processing PipelineA new Post-Processing Pipeline
A new Post-Processing Pipeline
 
Training Videovigilancia IP: What, Why, When and How
Training Videovigilancia IP: What, Why, When and HowTraining Videovigilancia IP: What, Why, When and How
Training Videovigilancia IP: What, Why, When and How
 
Para el blog
Para el blogPara el blog
Para el blog
 
Jenkins@EC2 による 継続的インテグレーション
Jenkins@EC2 による 継続的インテグレーションJenkins@EC2 による 継続的インテグレーション
Jenkins@EC2 による 継続的インテグレーション
 
GreenDao Introduction
GreenDao IntroductionGreenDao Introduction
GreenDao Introduction
 
Android internals 03 - Build system, emulator (rev_1.1)
Android internals 03 - Build system, emulator (rev_1.1)Android internals 03 - Build system, emulator (rev_1.1)
Android internals 03 - Build system, emulator (rev_1.1)
 
Android Media player
Android Media playerAndroid Media player
Android Media player
 
Location-Based Services on Android
Location-Based Services on AndroidLocation-Based Services on Android
Location-Based Services on Android
 
AWS Black Belt Techシリーズ リザーブドインスタンス & スポットインスタンス
AWS Black Belt Techシリーズ リザーブドインスタンス & スポットインスタンスAWS Black Belt Techシリーズ リザーブドインスタンス & スポットインスタンス
AWS Black Belt Techシリーズ リザーブドインスタンス & スポットインスタンス
 
Camera API 3.0を触ってみた
Camera API 3.0を触ってみたCamera API 3.0を触ってみた
Camera API 3.0を触ってみた
 

Similar to Android 5.0 Camera2 APIs

Building a Custom Camera Application in Android
Building a Custom Camera Application in AndroidBuilding a Custom Camera Application in Android
Building a Custom Camera Application in AndroidHuyen Dao
 
AnDevCon 2014: Building a Custom Camera Application
AnDevCon 2014: Building a Custom Camera ApplicationAnDevCon 2014: Building a Custom Camera Application
AnDevCon 2014: Building a Custom Camera ApplicationHuyen Tue Dao
 
UplinQ - implementing computational camera
UplinQ - implementing computational cameraUplinQ - implementing computational camera
UplinQ - implementing computational cameraSatya Harish
 
SAMI - Samsung Developer Conference - Nov 2014
SAMI - Samsung Developer Conference - Nov 2014SAMI - Samsung Developer Conference - Nov 2014
SAMI - Samsung Developer Conference - Nov 2014Jerome Dubreuil
 
(CISC 2013) Real-Time Record and Replay on Android for Malware Analysis
(CISC 2013) Real-Time Record and Replay on Android for Malware Analysis(CISC 2013) Real-Time Record and Replay on Android for Malware Analysis
(CISC 2013) Real-Time Record and Replay on Android for Malware AnalysisZongXian Shen
 
ARM: Enhancing your Unity mobile VR experience
ARM: Enhancing your Unity mobile VR experienceARM: Enhancing your Unity mobile VR experience
ARM: Enhancing your Unity mobile VR experienceDevGAMM Conference
 
COSCUP 2017 FACE OFF
COSCUP 2017 FACE OFFCOSCUP 2017 FACE OFF
COSCUP 2017 FACE OFFPRADA Hsiung
 
Droidcon NYC 2014: Building Custom Camera Applications
Droidcon NYC 2014: Building Custom Camera ApplicationsDroidcon NYC 2014: Building Custom Camera Applications
Droidcon NYC 2014: Building Custom Camera ApplicationsHuyen Dao
 
Droidcon NYC 2014: Building Custom Camera Applications
Droidcon NYC 2014: Building Custom Camera ApplicationsDroidcon NYC 2014: Building Custom Camera Applications
Droidcon NYC 2014: Building Custom Camera ApplicationsHuyen Tue Dao
 
“Machine Learning for the Real World: What is Acceptable Accuracy, and How Ca...
“Machine Learning for the Real World: What is Acceptable Accuracy, and How Ca...“Machine Learning for the Real World: What is Acceptable Accuracy, and How Ca...
“Machine Learning for the Real World: What is Acceptable Accuracy, and How Ca...Edge AI and Vision Alliance
 
Emerging vision technologies
Emerging vision technologiesEmerging vision technologies
Emerging vision technologiesQualcomm Research
 
Computer Vision Technology and Expertise
Computer Vision Technology and ExpertiseComputer Vision Technology and Expertise
Computer Vision Technology and ExpertiseRhonda Software
 
Synthetic Monitoring Deep Dive - AppSphere16
Synthetic Monitoring Deep Dive - AppSphere16Synthetic Monitoring Deep Dive - AppSphere16
Synthetic Monitoring Deep Dive - AppSphere16AppDynamics
 
Simplify Troubleshooting With Context in Your Logs
Simplify Troubleshooting With Context in Your LogsSimplify Troubleshooting With Context in Your Logs
Simplify Troubleshooting With Context in Your LogsSolarWinds
 
"Snapdragon Hybrid Computer Vision/Deep Learning Architecture for Imaging App...
"Snapdragon Hybrid Computer Vision/Deep Learning Architecture for Imaging App..."Snapdragon Hybrid Computer Vision/Deep Learning Architecture for Imaging App...
"Snapdragon Hybrid Computer Vision/Deep Learning Architecture for Imaging App...Edge AI and Vision Alliance
 

Similar to Android 5.0 Camera2 APIs (20)

Building a Custom Camera Application in Android
Building a Custom Camera Application in AndroidBuilding a Custom Camera Application in Android
Building a Custom Camera Application in Android
 
AnDevCon 2014: Building a Custom Camera Application
AnDevCon 2014: Building a Custom Camera ApplicationAnDevCon 2014: Building a Custom Camera Application
AnDevCon 2014: Building a Custom Camera Application
 
UplinQ - implementing computational camera
UplinQ - implementing computational cameraUplinQ - implementing computational camera
UplinQ - implementing computational camera
 
Implementing Computational Camera
Implementing Computational CameraImplementing Computational Camera
Implementing Computational Camera
 
SAMI - Samsung Developer Conference - Nov 2014
SAMI - Samsung Developer Conference - Nov 2014SAMI - Samsung Developer Conference - Nov 2014
SAMI - Samsung Developer Conference - Nov 2014
 
(CISC 2013) Real-Time Record and Replay on Android for Malware Analysis
(CISC 2013) Real-Time Record and Replay on Android for Malware Analysis(CISC 2013) Real-Time Record and Replay on Android for Malware Analysis
(CISC 2013) Real-Time Record and Replay on Android for Malware Analysis
 
ARM: Enhancing your Unity mobile VR experience
ARM: Enhancing your Unity mobile VR experienceARM: Enhancing your Unity mobile VR experience
ARM: Enhancing your Unity mobile VR experience
 
COSCUP 2017 FACE OFF
COSCUP 2017 FACE OFFCOSCUP 2017 FACE OFF
COSCUP 2017 FACE OFF
 
Droidcon NYC 2014: Building Custom Camera Applications
Droidcon NYC 2014: Building Custom Camera ApplicationsDroidcon NYC 2014: Building Custom Camera Applications
Droidcon NYC 2014: Building Custom Camera Applications
 
Droidcon NYC 2014: Building Custom Camera Applications
Droidcon NYC 2014: Building Custom Camera ApplicationsDroidcon NYC 2014: Building Custom Camera Applications
Droidcon NYC 2014: Building Custom Camera Applications
 
Video analytics on the edge
Video analytics on the edgeVideo analytics on the edge
Video analytics on the edge
 
“Machine Learning for the Real World: What is Acceptable Accuracy, and How Ca...
“Machine Learning for the Real World: What is Acceptable Accuracy, and How Ca...“Machine Learning for the Real World: What is Acceptable Accuracy, and How Ca...
“Machine Learning for the Real World: What is Acceptable Accuracy, and How Ca...
 
Parking Lot App
Parking Lot AppParking Lot App
Parking Lot App
 
Emerging vision technologies
Emerging vision technologiesEmerging vision technologies
Emerging vision technologies
 
Computer Vision Technology and Expertise
Computer Vision Technology and ExpertiseComputer Vision Technology and Expertise
Computer Vision Technology and Expertise
 
Machine Vision Cameras
Machine Vision CamerasMachine Vision Cameras
Machine Vision Cameras
 
Synthetic Monitoring Deep Dive - AppSphere16
Synthetic Monitoring Deep Dive - AppSphere16Synthetic Monitoring Deep Dive - AppSphere16
Synthetic Monitoring Deep Dive - AppSphere16
 
Simplify Troubleshooting With Context in Your Logs
Simplify Troubleshooting With Context in Your LogsSimplify Troubleshooting With Context in Your Logs
Simplify Troubleshooting With Context in Your Logs
 
Camera and imaging APIs on Series 40
Camera and imaging APIs on Series 40Camera and imaging APIs on Series 40
Camera and imaging APIs on Series 40
 
"Snapdragon Hybrid Computer Vision/Deep Learning Architecture for Imaging App...
"Snapdragon Hybrid Computer Vision/Deep Learning Architecture for Imaging App..."Snapdragon Hybrid Computer Vision/Deep Learning Architecture for Imaging App...
"Snapdragon Hybrid Computer Vision/Deep Learning Architecture for Imaging App...
 

Recently uploaded

Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Commit University
 
Sample pptx for embedding into website for demo
Sample pptx for embedding into website for demoSample pptx for embedding into website for demo
Sample pptx for embedding into website for demoHarshalMandlekar2
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024Stephanie Beckett
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsSergiu Bodiu
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
A Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersA Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersNicole Novielli
 
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxThe Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxLoriGlavin3
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxLoriGlavin3
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek SchlawackFwdays
 
The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxLoriGlavin3
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Manik S Magar
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024BookNet Canada
 
Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...Rick Flair
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity PlanDatabarracks
 
What is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfWhat is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfMounikaPolabathina
 
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxThe Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxLoriGlavin3
 
Time Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsTime Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsNathaniel Shimoni
 
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxLoriGlavin3
 

Recently uploaded (20)

Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!
 
Sample pptx for embedding into website for demo
Sample pptx for embedding into website for demoSample pptx for embedding into website for demo
Sample pptx for embedding into website for demo
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platforms
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
A Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersA Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software Developers
 
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxThe Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
 
The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptx
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
 
Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity Plan
 
What is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfWhat is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdf
 
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxThe Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
 
Time Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsTime Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directions
 
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
 

Android 5.0 Camera2 APIs

  • 1. Camera 2 APIs Computational Photography Enablers Balwinder Kaur Senior Member, Technical Staff ON Semiconductor © 2014 Samsung Developer Conference. All rights reserved. www.samsungdevcon.com
  • 2. Tools of the Trade 2 © 2014 Samsung Developer Conference. All rights reserved. www.samsungdevcon.com
  • 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 • Summary 3 © 2014 Samsung Developer Conference. All rights reserved. www.samsungdevcon.com
  • 4. The Basic Idea Limitations of Existing Camera APIs © 2014 Samsung Developer Conference. All rights reserved. www.samsungdevcon.com
  • 5. Limitations of android.hardware.Camera 5 3 Primary Operating Modes • Preview, Capture & Video Recording New Features – hard to implement • Burst mode photography • Zero Shutter Lag, Multi-Shot HDR, Panoramic Stitch No Support for RAW • Most products returned null for the raw callback Minimal Metadata • Support for face detection dataa http://source.android.com/devices/camera/camera.html No Per-Frame Control • Not Possible Primitive Custom Settings • Through Camera.Parameters class but no guarantees when the settings would go into effect © 2014 Samsung Developer Conference. All rights reserved. www.samsungdevcon.com
  • 6. Enabling New Experiences © 2014 Samsung Developer Conference. All rights reserved. www.samsungdevcon.com
  • 7. Camera2 API Enables - 7 Point and Click Camera Professional Camera Professional Camera + Post Processing on-device Innovative Mobile Camera ++ © 2014 Samsung Developer Conference. All rights reserved. www.samsungdevcon.com
  • 8. Features and Requirements 8 Point and Click •Preview •Still •Video Recording Professional Camera •Fine Grained Control of Lens, Sensor, Flash •RAW Sensor Output with capture metadata Computational Photography •Individual Frame Control •Algorithms & Compute Power •HDR, Focus Stacking, Exposure Bracketing Innovative Mobile Cameras •Sensors •Location •Connectivity/Cloud Power •Compute Power © 2014 Samsung Developer Conference. All rights reserved. www.samsungdevcon.com
  • 9. android.hardware.camera2 • Enables Professional Quality Photography • Enables Access to RAW Images • Enables On-device processing of Camera Data • Enables New Use Cases combining Imaging with 9 – Think DSLR instead of Point-and-Shoot – High Dynamic Range, Focus Stacking – Rich Sensor input • Inertial sensors, altitude et. al. – Compute Power • Multi-core CPU & GPU – Connectivity • Power of the Cloud & Access to Proximity (BLE, NFC) – Context • Location & User History Major Limitation- Optics DSLR++ ? Computational Photography © 2014 Samsung Developer Conference. All rights reserved. www.samsungdevcon.com
  • 10. Professional Quality Photography • Fine grained control of the – Sensor – 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 10 Professional Camera – Every frame is returned with the actual settings that it was taken with, and requested for. © 2014 Samsung Developer Conference. All rights reserved. www.samsungdevcon.com
  • 11. Computational Photography Definition Professional Camera + Post Processing on-device • Computational photography refers to computational image capture, processing, and manipulation techniques that enhance or extend the capabilities of digital photography. 11 Source: Wikipedia © 2014 Samsung Developer Conference. All rights reserved. www.samsungdevcon.com
  • 12. Multi Shot HDR Computational Photography • HDR = High Dynamic Range • Multiple shots at different exposures and then blended together 12 © 2014 Samsung Developer Conference. All rights reserved. www.samsungdevcon.com
  • 13. Panoramic Stitching 13 Multiple Images with orientation information and fixed Exposure Source: commons.wikimedia.org Computational Photography © 2014 Samsung Developer Conference. All rights reserved. www.samsungdevcon.com
  • 14. Flash No-Flash Photography Source: Microsoft Research 14 Computational Photography © 2014 Samsung Developer Conference. All rights reserved. www.samsungdevcon.com
  • 15. Flash No-Flash Photography Source: Microsoft Research 15 Computational Photography • Take 2 shots of the scene– one with flash on, the other with flash off • Computationally blend the 2 frames together © 2014 Samsung Developer Conference. All rights reserved. www.samsungdevcon.com
  • 16. Focus Stacking Focus Stacking for macro photography. Also known as – all-in-focus photography Source: Wikipedia 16 Computational Photography © 2014 Samsung Developer Conference. All rights reserved. www.samsungdevcon.com
  • 17. View Finder • Today’s smartphones enable features like • Computational Photography can take it to the next level 17 – Touch to Expose & Touch to Focus – Edit the frame in the view Computational Photography finder by selecting areas to sharpen, blur, brighten and maintain these during capture mode Source: SIGGRAPH 2012 Android L Sample HdrViewFinder demonstrates a similar concept © 2014 Samsung Developer Conference. All rights reserved. www.samsungdevcon.com
  • 18. Mobile Embedded Vision Applications • Gesture Recognition • Face Recognition, Object Tracking • Visual Search • 3D Mapping of the environment • Augmented Reality 18 Natural User Interface Companies are using the Front Facing Camera to provide gesture recognition solutions. © 2014 Samsung Developer Conference. All rights reserved. www.samsungdevcon.com
  • 19. Innovative Mobile Camera ++ 19 Cloud Computing On-Device Compute Power Sensors Fine Grained Control You Lens, Sensor, Flash Location User History User Preferences © 2014 Samsung Developer Conference. All rights reserved. www.samsungdevcon.com
  • 20. Camera2 Architecture © 2014 Samsung Developer Conference. All rights reserved. www.samsungdevcon.com
  • 21. Limitations of android.hardware.Camera 21 3 Primary Operating Modes New Features – hard to implement No Per-Frame Control No Support for RAW Minimal Metadata Custom Settings http://source.android.com/devices/camera/camera.html © 2014 Samsung Developer Conference. All rights reserved. www.samsungdevcon.com
  • 22. Camera2 Core Operation Model • 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 © 2014 Samsung Developer Conference. All rights reserved. www.samsungdevcon.com
  • 23. Camera3 HAL Model 23 http://source.android.com/devices/camera/camera.html © 2014 Samsung Developer Conference. All rights reserved. www.samsungdevcon.com
  • 24. The Camera APIs © 2014 Samsung Developer Conference. All rights reserved. www.samsungdevcon.com
  • 25. Android Lollipop Camera related classes and interfaces from android.hardware deprecated 2 new packages 25 android.hardware.camera2 android.hardware.camera2.params 25+ classes, 1 Exception © 2014 Samsung Developer Conference. All rights reserved. www.samsungdevcon.com
  • 26. Camera Model 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 © 2014 Samsung Developer Conference. All rights reserved. www.samsungdevcon.com
  • 27. API walk through for primary use cases Live Preview 27 Still Capture (JPG) Still Capture (RAW/DNG) Still Capture (Burst) Video Recording © 2014 Samsung Developer Conference. All rights reserved. www.samsungdevcon.com
  • 28. Ready. Set. Go! Figure out what’s available © 2014 Samsung Developer Conference. All rights reserved. www.samsungdevcon.com
  • 29. Concepts and Terms from Camera 2 • Camera Device • Streams • Capture Session • Target Surfaces 29 It’s a paradigm s h i f t ! • Capture Request • Capture Result – Image Data – Metadata – Total Capture Result © 2014 Samsung Developer Conference. All rights reserved. www.samsungdevcon.com
  • 30. 1. How many Cameras do I have? Query the System for capabilities CameraManager provides information on the number of available cameras, or CameraDevices. CameraManager manager = String[] camids = manager.getCameraIdList(); 30 (CameraManager) getSystemService(Context.CAMERA_SERVICE); © 2014 Samsung Developer Conference. All rights reserved. www.samsungdevcon.com
  • 31. 2. What kind of a CameraDevice is it? CameraCharacteristics provide static metadata for a given CameraDevice. This information is immutable for a given camera. CameraCharacteristics characteristics = CameraCharacteristics Keys 3 Classes of Cameras are supported 31 manager.getCameraCharacteristics(camid); INFO_SUPPORTED_HARDWARE_LEVEL Additionally, RAW may be supported ① FULL + RAW ② LIMITED + RAW LEGACY LIMITED FULL © 2014 Samsung Developer Conference. All rights reserved. www.samsungdevcon.com
  • 32. 3. How many maximum streams does the system support? 3 Classes of Streams ①Processed & Non-Stalling ②Processed & Stalling ③RAW (Bayer Domain) The Maximum Number of Streams = REQUEST_MAX_NUM_OUTPUT_PROC1 + REQUEST_MAX_NUM_OUTPUT_PROC_STALLING1 + REQUEST_MAX_NUM_OUTPUT_RAW1 FULL >=3 >=1 >=0 LIMITED >=2 >=1 >=0 LEGACY >=2 >=1 0 32 PROCESSED & NON_STALLING (like YUV) PROCESSED & STALLING (like JPEG) RAW 1 CameraCharacteristics.Key © 2014 Samsung Developer Conference. All rights reserved. www.samsungdevcon.com
  • 33. Guaranteed Stream Configurations - LEGACY Type Max Size Type Max Size Type Max Size PRIV1 Maximum2 JPEG Maximum YUV Maximum PRIV Preview JPEG Maximum YUV Preview JPEG Maximum PRIV Preview PRIV Preview PRIV Preview YUV Preview PRIV Preview YUV Preview JPEG Maximum 33 Target 1 Target 2 Target 3 Still capture plus in-app processing. 1 Device Opaque Format, No Visibility into Format for Application 2 Device Maximum Sensor Output © 2014 Samsung Developer Conference. All rights reserved. www.samsungdevcon.com
  • 34. Guaranteed Stream Configurations - LIMITED 34 Target 1 Target 2 Target 3 Type Max Size Type Max Size Type Max Size PRIV Preview PRIV Record 1 PRIV Preview YUV Record YUV Preview YUV Record PRIV Preview PRIV Record JPEG Record PRIV Preview YUV Record JPEG Record YUV Preview YUV Preview JPEG Maximum 1 Maximum resolution supported by the device for media recording © 2014 Samsung Developer Conference. All rights reserved. www.samsungdevcon.com
  • 35. Guaranteed Stream Configurations - FULL 35 Target 1 Target 2 Target 3 Type Max Size Type Max Size Type Max Size PRIV Preview PRIV Maximum PRIV Preview YUV Maximum YUV Preview YUV Maximum PRIV Preview PRIV Preview JPEG Maximum YUV 640x480 PRIV Preview YUV Maximum YUV 640x480 YUV Preview YUV Maximum © 2014 Samsung Developer Conference. All rights reserved. www.samsungdevcon.com
  • 36. Guaranteed Stream Configurations - RAW 36 Target 1 Target 2 Target 3 Type Max Size Type Max Size Type Max Size RAW Maximum PRIV Preview RAW Maximum YUV Preview RAW Maximum PRIV Preview PRIV Preview RAW Maximum PRIV Preview YUV Preview RAW Maximum YUV In-Preview app processing YUV with simultaneous Preview JPEG RAW and DNG. Maximum PRIV Preview JPEG Maximum RAW Maximum YUV Preview JPEG Maximum RAW Maximum © 2014 Samsung Developer Conference. All rights reserved. www.samsungdevcon.com
  • 37. 4. How can these streams be configured? CameraCharacteristics characteristics = cameraManager.getCameraCharacteristics(cameraId); StreamConfigurationMap configs = characteristics.get( StreamConfigurationMap provides information on • Supported Stalling and Non-Stalling Image Formats • Supported Image Sizes for Supported Image Formats • Supported Video Sizes and fps(frames per Second) Speeds • Minimum Frame Duration and Stall Duration for supported formats and sizes • Determine whether a given Surface is supported by this CameraDevice or not 37 CameraCharacteristics.SCALER_STREAM_CONFIGURATION_MAP); © 2014 Samsung Developer Conference. All rights reserved. www.samsungdevcon.com
  • 38. FULL Camera Devices sensor max resolution more than 20fps is required 38 30 FPS at Per Frame Control android.sync.maxLatency PER_FRAME_CONTROL Manual Sensor Control Manual Post Processing Control android.request.availableCapabilities Arbitrary Cropping Region android.scaler.croppingType == FREEFORM Minimum 3 Processed Non-Stalling Output Streams (think YUV) Stream Configurations Available as a Configuration Map © 2014 Samsung Developer Conference. All rights reserved. www.samsungdevcon.com
  • 39. LIMITED and LEGACY Camera Device LEGACY •NO Per- Frame Control •NO Manual Sensor Control •NO Manual Post Processing • NO Arbitrary Cropping Regions •No Stringent Performance Constraints •Not a candidate for a Superior Camera Experience 39 LIMITED • Query for individual capabilities! That’s a lot of checks! LEGACY LIMITED FULL ① FULL + RAW ② LIMITED + RAW © 2014 Samsung Developer Conference. All rights reserved. www.samsungdevcon.com
  • 40. Ready. Set. Go! Open the Camera © 2014 Samsung Developer Conference. All rights reserved. www.samsungdevcon.com
  • 41. 1. Open a Full Camera Device ① Use the instance of the CameraManager to open a Camera passing ② Get a handle to a CameraDevice via the 41 in its camera id. CameraDevice.StateCallback method when it is successfully opened. CameraDevice.StateCallback mStateCallback = new CameraDevice.StateCallback () { …}; manager.openCamera(camid, mStateCallback, ..); © 2014 Samsung Developer Conference. All rights reserved. www.samsungdevcon.com
  • 42. 2. Create a Capture Session • Expensive Operation Minimize calls to createCaptureSession CameraCaptureSession.StateCallback mCaptureCallback= new CameraCaptureSession.StateCallback () {...}; List<Surface> outputs = new ArrayList<Surface>(...); createCaptureSession (outputs, mCaptureCallback, ...); // a handle to a capture session in mCaptureCallback method 42 – Involves allocation of buffers beneath the HAL –May take up to several hundred milliseconds •All modes cannot be supported concurrently –so Sessions may have to be torn down and setup again. Failure to create a capture session may result in exceptions being thrown © 2014 Samsung Developer Conference. All rights reserved. www.samsungdevcon.com
  • 43. Different Target Output Streams 43 © 2014 Samsung Developer Conference. All rights reserved. www.samsungdevcon.com
  • 44. 3. Create a Capture Request ① Pick the Capture Request Template CaptureRequest.Builder mPreviewBuilder = mCameraDevice .createCaptureRequest(CameraDevice.TEMPLATE_PREVIEW); 44 o TEMPLATE_PREVIEW o TEMPLATE_STILL_CAPTURE o TEMPLATE_VIDEO_SNAPSHOT o TEMPLATE_RECORD o TEMPLATE_MANUAL © 2014 Samsung Developer Conference. All rights reserved. www.samsungdevcon.com
  • 45. 3. Create a Capture Request – contd. ② Pick an appropriate target output o e.g. TextureView for the correct width/height for Preview mPreviewBuilder.addTarget(mPreviewSurface); //where mPreviewSurface is a Surface initialized to the width and height of the Preview Desired ③ Pick the Frequency of the Capture Request o capture o captureBurst o setRepeatingRequest o setRepeatingBurst o stopRepeating o abortCaptures() 45 © 2014 Samsung Developer Conference. All rights reserved. www.samsungdevcon.com
  • 46. Ready. Set. Go! Get your pictures © 2014 Samsung Developer Conference. All rights reserved. www.samsungdevcon.com
  • 47. Receiving Image and Metadata mSession.setRepeatingRequest(mPreviewBuilder.build(), listener,backgroundHandler); • The Image data is typically received in a listener associated with the Output Surface. • The Metadata is received in the onCaptureCompleted callback method of CameraCaptureSession.CaptureCallback via the TotalCaptureResult object. 47 How does the metadata tie to the correct image data frame? Through the Time Stamp! CaptureResult.SENSOR_TIMESTAMP & image.getTimestamp() © 2014 Samsung Developer Conference. All rights reserved. www.samsungdevcon.com
  • 48. The Other Use Cases © 2014 Samsung Developer Conference. All rights reserved. www.samsungdevcon.com
  • 49. Still Capture - JPEG ①Use TEMPLATE_STILL_CAPTURE for the CaptureRequest ②Create an ImageReader object with format == ③Pick CameraCaptureSession.capture for the frequency of ④Image Data is received in the ⑤Metadata is received in the 49 ImageFormat.JPEG capture ImageReader.onImageAvailableListener CameraCaptureSession.CaptureCallback. onCaptureCompleted callback © 2014 Samsung Developer Conference. All rights reserved. www.samsungdevcon.com
  • 50. Still Capture - RAW ① Use TEMPLATE_STILL_CAPTURE for the CaptureRequest ② Create an ImageReader object with format == ImageFormat. ③ Pick CameraCaptureSession.capture for the frequency of capture ④ Image Data is received in the ImageReader.onImageAvailableListener ⑤ Metadata is received in the ⑥ Use an instance of DngCreator to convert RAW to DNG (Digital Negative) 50 ImageFormat.RAW_SENSOR CameraCaptureSession.CaptureCallback.onCaptureCompleted callback final File dngFile = new File(path, filename); outs = new FileOutputStream(dngFile); if (mRawTotalResult != null) { DngCreator d = new DngCreator(characteristics, mRawTotalResult); d.writeImage(outs, image); } © 2014 Samsung Developer Conference. All rights reserved. www.samsungdevcon.com
  • 51. Still Capture - BURST ① Use TEMPLATE_STILL_CAPTURE for the CaptureRequest ② Create an ImageReader object with format == ImageFormat. ③ Pick CameraCaptureSession.captureBurst for the frequency of capture ④ Image Data is received in the ImageReader.onImageAvailableListener ⑤ Metadata is received in the CameraCaptureSession.CaptureCallback. 51 ImageFormat.JPEG onCaptureCompleted callback © 2014 Samsung Developer Conference. All rights reserved. www.samsungdevcon.com
  • 52. Video Recording ①Use TEMPLATE_RECORD for the CaptureRequest ②Create a MediaRecorder Object and use its surface ③Pick CameraCaptureSession.setRepeatingRequest ④Image Data is recorded in the Image file set via ⑤Metadata is received in the 52 as the output stream for the frequency of capture MediaRecorder.setOutputFile call. CameraCaptureSession.CaptureCallback. onCaptureCompleted callback © 2014 Samsung Developer Conference. All rights reserved. www.samsungdevcon.com
  • 53. In-App Processing of Camera Data ① Use an appropriate Template for the CaptureRequest; including ② Create an object like Allocation Renderscript, ImageReader (with ③ Pick an appropriate frequency for capture ④ Image Data can be found in an appropriate callback for the surface ⑤ Metadata is received in the CameraCaptureSession.CaptureCallback. 53 TEMPLATE_MANUAL if the use case so demands Format YUV_420_888), SurfaceTexture, or GLSurfaceView that provides a Surface chosen onCaptureCompleted callback © 2014 Samsung Developer Conference. All rights reserved. www.samsungdevcon.com
  • 54. Some use cases for In-App Processing 54 • Use Cases – Filters – Computational Photography Use cases – Custom Post Processing of the Imaging Pipeline – Computer Vision Applications • Uses – Compute Framework • Renderscript, OpenCL – Low level Graphics APIs • OpenGL ES © 2014 Samsung Developer Conference. All rights reserved. www.samsungdevcon.com
  • 55. And then there was Metadata… 55 CameraMetadata Controls CaptureRequest Information Static Metadata Fixed for a given CameraDevice CameraCharacteristics Dynamic Metadata Settings associated with each frame CaptureResult Key Value Pairs for Hardware Control (Lens, Sensor, Flash), Image Processing Pipeline, Control Algorithms and Output Buffers © 2014 Samsung Developer Conference. All rights reserved. www.samsungdevcon.com
  • 56. Fine Grained Control a.k.a “The Devil is in the Details” © 2014 Samsung Developer Conference. All rights reserved. www.samsungdevcon.com
  • 57. Manual Sensor Control 57 Sensor Sensitivity (Gain/ISO) Sensor Exposure Time Sensor Frame Duration Flash (if present) Flash Mode Lens (if adjustable) Lens Aperture Lens Filter Density Lens Focal Length Lens Focus Distance Black Level Lock Black Level Lock On/Off © 2014 Samsung Developer Conference. All rights reserved. www.samsungdevcon.com
  • 58. Manual 3A Control • A Camera Request can override the 3A Algorithm Controls – Auto Exposure (AE) – Auto Focus(AF) – Auto White Balance (AWB) • There is an overall control for all Auto Algorithms 58 android.control.mode – When set to OFF, application has full control of the pipeline – When set to AUTO, the individual controls are in effect © 2014 Samsung Developer Conference. All rights reserved. www.samsungdevcon.com
  • 59. Application Controlled (Auto) Algorithms Auto Focus android.control.mode= AUTO android.control.a*mode = OFF Auto Exposure • Application uses android.sensor.exposureTime, android.sensor.sensitivity Auto White Balance 59 • Application uses android.lens.focusDistance to control the Lens and android.sensor.frameDuration + android.flash.* to control exposure • Application uses android.colorCorrection.transform & android.colorCorrection.gains to control the white balance © 2014 Samsung Developer Conference. All rights reserved. www.samsungdevcon.com
  • 60. Manual Post Processing 60 http://source.android.com/devices/camera/camera.html © 2014 Samsung Developer Conference. All rights reserved. www.samsungdevcon.com
  • 61. Image Processing Pipeline Shading Mode (lens shading) 61 Hot Pixel Mode Black Level Correction Demosaic Noise Reduction Mode Color Correction Mode Tone Curve Adjustment Edge Enhancement © 2014 Samsung Developer Conference. All rights reserved. www.samsungdevcon.com
  • 62. Manual Post Processing 62 Manual Tonemap control • android.tonemap.* Manual White Balance control • android.colorCorrection.* Manual Lens Shading map control • android.shading.* Manual aberration correction control (if supported) • android.colorCorrection.aberration.* © 2014 Samsung Developer Conference. All rights reserved. www.samsungdevcon.com
  • 63. The other camera2 package android.hardware.camera2.params • BlackLevelPattern • ColorSpaceTransform • Face • LensShadingMap • MeteringRectangle • RggbChannelVector • StreamConfigurationMap • TonemapCurve 63 © 2014 Samsung Developer Conference. All rights reserved. www.samsungdevcon.com
  • 64. Play Store Feature Filters Android Manifest <uses-feature> © 2014 Samsung Developer Conference. All rights reserved. www.samsungdevcon.com
  • 65. Play Store Feature Filters • android.hardware.camera.hardware_level.full • android.hardware.camera.capability.raw • android.hardware.camera.capability.manual_sensor • android.hardware.camera.capability.manual_post_processing 65 See Also: Versioning © 2014 Samsung Developer Conference. All rights reserved. www.samsungdevcon.com
  • 66. Summary © 2014 Samsung Developer Conference. All rights reserved. www.samsungdevcon.com
  • 67. Cloud Computing Lens, Sensor, Flash 67 Its all about you and your power tools! On-Device Compute Power Sensors Fine Grained Control You Location User History User Preferences © 2014 Samsung Developer Conference. All rights reserved. www.samsungdevcon.com
  • 68. 68 Q&A and THANK YOU for your time. Balwinder Kaur balwinder dot x dot kaur at gmail dot com http://www.slideshare.net/lbk003 https://github.com/lbk003 © 2014 Samsung Developer Conference. All rights reserved. www.samsungdevcon.com

Editor's Notes

  1. Limited Capture Controls (Settings) Hardwired Operating Modes (Commands) Device state (Minimal Feedback) (Metadata) Image stream (slow, or low-resolution) All operations Unsynchronized – one doesn’t know when settings take effect.
  2. You + Algorithms!
  3. Limited Capture Controls (Settings) Hardwired Operating Modes (Commands) Device state (Minimal Feedback) (Metadata) Image stream (slow, or low-resolution) All operations Unsynchronized – one doesn’t know when settings take effect.
  4. 64 Lens_info Available_modes Control_AE Control_AF No Control_AWB
  5. What is Stall Duration The Output Stall Duration A stall duration is how much extra time would get added to the normal minimum frame duration for a repeating request that has streams with non-zero stall. YUV_420_888 => Non-Stall Format JPEG& RAW => Stalling Format
  6. For each output format -All supported Sizes - The minimum frame Duration (in nanoseconds) - The Output Stall Duration - A stall duration is how much extra time would get added to the normal minimum frame duration for a repeating request that has streams with non-zero stall. YUV_420_888 => Non-Stall Format JPEG& RAW => Stalling Format
  7. TODO Explain android.sync.maxLatency Define manual sensor control Define Manual Post processing control Define scaler cropping region android.sensor.info.exposureTimeRange supported exposure time range android.sensor.info.maxFrameDuration maximum Frame Duration Define Stalling and non-stalling output formats Define Processed and un-processed
  8. A handler can be passed if the callback is to be processed on a looper other than the default looper of the application Pass in the Camera Id, CameraDevice.StateCallback, and a Handler
  9. It is an expensive operation which can take several hundred milliseconds for the session's configuration to complete, since camera hardware may need to be powered on or reconfigured. While the Camera hardware may support a large variety of output formats and sizes, it may not be able to do so concurrently, so a session can be created for supporting a given set of modes Exceptions IllegalArgumentException if the set of output Surfaces do not meet the requirements, the callback is null, or the handler is null but the current thread has no looper. CameraAccessException if the camera device is no longer connected or has encountered a fatal error IllegalStateException if the camera device has been closed
  10. It is an expensive operation which can take several hundred milliseconds for the session's configuration to complete, since camera hardware may need to be powered on or reconfigured. While the Camera hardware may support a large variety of output formats and sizes, it may not be able to do so concurrently, so a session can be created for supporting a given set of modes
  11. It is an expensive operation which can take several hundred milliseconds for the session's configuration to complete, since camera hardware may need to be powered on or reconfigured. While the Camera hardware may support a large variety of output formats and sizes, it may not be able to do so concurrently, so a session can be created for supporting a given set of modes
  12. DNG file format is a cross-platform file format that is used to store pixel data from camera sensors with minimal pre-processing applied. DNG files allow for pixel data to be defined in a user-defined colorspace, and have associated metadata that allow for this pixel data to be converted to the standard CIE XYZ colorspace during post-processing.
  13. DNG file format is a cross-platform file format that is used to store pixel data from camera sensors with minimal pre-processing applied. DNG files allow for pixel data to be defined in a user-defined colorspace, and have associated metadata that allow for this pixel data to be converted to the standard CIE XYZ colorspace during post-processing. Convenience Class DngCreator helps in creating the cross-platform DNG File format from a RAW_SENSOR image buffer. DNG files can be processed on laptops, or even use some DNG applications on the device itself. Many commercial and free applications are available for the desktop and mobile platforms
  14. DNG file format is a cross-platform file format that is used to store pixel data from camera sensors with minimal pre-processing applied. DNG files allow for pixel data to be defined in a user-defined colorspace, and have associated metadata that allow for this pixel data to be converted to the standard CIE XYZ colorspace during post-processing. Convenience Class DngCreator helps in creating the cross-platform DNG File format from a RAW_SENSOR image buffer. DNG files can be processed on laptops, or even use some DNG applications on the device itself. Many commercial and free applications are available for the desktop and mobile platforms
  15. DNG file format is a cross-platform file format that is used to store pixel data from camera sensors with minimal pre-processing applied. DNG files allow for pixel data to be defined in a user-defined colorspace, and have associated metadata that allow for this pixel data to be converted to the standard CIE XYZ colorspace during post-processing.
  16. DNG file format is a cross-platform file format that is used to store pixel data from camera sensors with minimal pre-processing applied. DNG files allow for pixel data to be defined in a user-defined colorspace, and have associated metadata that allow for this pixel data to be converted to the standard CIE XYZ colorspace during post-processing.
  17. SENSOR_FRAME_DURATION Lots of details at https://developer.android.com/reference/android/hardware/camera2/CaptureRequest.html#SENSOR_FRAME_DURATION SENSOR_INFO_EXPOSURE_TIME_RANGE The range of image exposure times for android.sensor.exposureTime supported by this camera device. Units: Nanoseconds Range of valid values: The minimum exposure time will be less than 100 us. For FULL capability devices (android.info.supportedHardwareLevel == FULL), the maximum exposure time will be greater than 100ms. Black Level Lock Lots of details at https://developer.android.com/reference/android/hardware/camera2/CaptureRequest.html#BLACK_LEVEL_LOCK Whether black-level compensation is locked to its current values, or is free to vary. When set to true (ON), the values used for black-level compensation will not change until the lock is set to false (OFF). Since changes to certain capture parameters (such as exposure time) may require resetting of black level compensation, the camera device must report whether setting the black level lock was successful in the output result metadata.
  18. android.tonemap.curve android.tonemap.mode android.tonemap.maxCurvePoints android.colorCorrection.transform android.colorCorrection.gains
  19. You + Algorithms!