The document summarizes a presentation about building custom camera applications for Android. It covers topics like camera setup, image capture, camera parameters, face detection, and previews the new Camera2 API being introduced in Android L. It provides code snippets and recommendations for implementing core camera features like initializing the camera preview, taking pictures, and accessing camera metadata. It also discusses challenges like dealing with different device orientations and specifications.
How to create a camera2
more detail blog: http://vinta.ws/booch/?p=30
reference:
Camera 2
Google I/o video:https://www.youtube.com/watch?v=92fgcUNCHic#t=1758
Camera basic demo code: https://developer.android.com/preview/samples.html
Camera2 sdk reference (Need download 60mb): http://storage.googleapis.com/androiddevelopers/preview/l-developer-preview-reference.zip
Set up android l: https://developer.android.com/preview/setup-sdk.html
Camera
HAL3:https://source.android.com/devices/camera/camera3.html
HAL Subsystem https://source.android.com/devices/camera/camera3_requests_hal.html
https://source.android.com/devices/camera/camera.html
How to create a camera2
more detail blog: http://vinta.ws/booch/?p=30
reference:
Camera 2
Google I/o video:https://www.youtube.com/watch?v=92fgcUNCHic#t=1758
Camera basic demo code: https://developer.android.com/preview/samples.html
Camera2 sdk reference (Need download 60mb): http://storage.googleapis.com/androiddevelopers/preview/l-developer-preview-reference.zip
Set up android l: https://developer.android.com/preview/setup-sdk.html
Camera
HAL3:https://source.android.com/devices/camera/camera3.html
HAL Subsystem https://source.android.com/devices/camera/camera3_requests_hal.html
https://source.android.com/devices/camera/camera.html
This presentation that we're going to talk about how to use CameraKit to implement high performance real-time camera app. We also will cover the tips that you should know when you implement customized camera feature in your app.
Android Lollipop was released with new Camera2 APIs. This talk was delivered at the Samsung Developer's Conference 2014 showing how to use it and how it enables new use cases
Detection and tracking of red color by using matlabAbhiraj Bohra
This program just tracks all red color objects and draws a bounding box around them. This works on the difference between frames concept. Every frame in the video is returned as an rgb image on which we can do image processing.
Hidden Camera 3 APIs in Android 4.4 (KitKat)Balwinder Kaur
Android 4.4 (KitKat) shipped with some hidden Java APIs for the new Camera 3 APIs. This slide deck was presented at AnDevCon 2013 held in Burlingame, CA. It covers the history of the new Camera Framework, hidden APIs and some basics of the Camera Platform Framework.
https://github.com/lbk003/Cam3HiddenAPIs
The Mobile Vision API provides a framework for recognizing objects in photos and videos. The framework includes detectors, which locate and describe visual objects in images or video frames, and an event-driven API that tracks the position of those objects in video.
You can find the slides with speaker notes here : http://bit.ly/lifeofapp
During this talk we live the life of your app on the user's point of view.
The idea is to follow the user experience from the Play Store to the daily use, measure each time its frustration to find ways for us, as developers, to avoid them.
In this talk, I spoke about CameraX, a new Jetpack library that makes camera development in Android easier.
I delivered this talk in droidcon India 2019 and BlrDroid's 113th Meetup.
Find my website: https://bapspatil.com
The Art of the Pitch: WordPress Relationships and SalesLaura Byrne
Clients don’t know what they don’t know. What web solutions are right for them? How does WordPress come into the picture? How do you make sure you understand scope and timeline? What do you do if sometime changes?
All these questions and more will be explored as we talk about matching clients’ needs with what your agency offers without pulling teeth or pulling your hair out. Practical tips, and strategies for successful relationship building that leads to closing the deal.
More Related Content
Similar to Droidcon NYC 2014: Building Custom Camera Applications
This presentation that we're going to talk about how to use CameraKit to implement high performance real-time camera app. We also will cover the tips that you should know when you implement customized camera feature in your app.
Android Lollipop was released with new Camera2 APIs. This talk was delivered at the Samsung Developer's Conference 2014 showing how to use it and how it enables new use cases
Detection and tracking of red color by using matlabAbhiraj Bohra
This program just tracks all red color objects and draws a bounding box around them. This works on the difference between frames concept. Every frame in the video is returned as an rgb image on which we can do image processing.
Hidden Camera 3 APIs in Android 4.4 (KitKat)Balwinder Kaur
Android 4.4 (KitKat) shipped with some hidden Java APIs for the new Camera 3 APIs. This slide deck was presented at AnDevCon 2013 held in Burlingame, CA. It covers the history of the new Camera Framework, hidden APIs and some basics of the Camera Platform Framework.
https://github.com/lbk003/Cam3HiddenAPIs
The Mobile Vision API provides a framework for recognizing objects in photos and videos. The framework includes detectors, which locate and describe visual objects in images or video frames, and an event-driven API that tracks the position of those objects in video.
You can find the slides with speaker notes here : http://bit.ly/lifeofapp
During this talk we live the life of your app on the user's point of view.
The idea is to follow the user experience from the Play Store to the daily use, measure each time its frustration to find ways for us, as developers, to avoid them.
In this talk, I spoke about CameraX, a new Jetpack library that makes camera development in Android easier.
I delivered this talk in droidcon India 2019 and BlrDroid's 113th Meetup.
Find my website: https://bapspatil.com
The Art of the Pitch: WordPress Relationships and SalesLaura Byrne
Clients don’t know what they don’t know. What web solutions are right for them? How does WordPress come into the picture? How do you make sure you understand scope and timeline? What do you do if sometime changes?
All these questions and more will be explored as we talk about matching clients’ needs with what your agency offers without pulling teeth or pulling your hair out. Practical tips, and strategies for successful relationship building that leads to closing the deal.
UiPath Test Automation using UiPath Test Suite series, part 4DianaGray10
Welcome to UiPath Test Automation using UiPath Test Suite series part 4. In this session, we will cover Test Manager overview along with SAP heatmap.
The UiPath Test Manager overview with SAP heatmap webinar offers a concise yet comprehensive exploration of the role of a Test Manager within SAP environments, coupled with the utilization of heatmaps for effective testing strategies.
Participants will gain insights into the responsibilities, challenges, and best practices associated with test management in SAP projects. Additionally, the webinar delves into the significance of heatmaps as a visual aid for identifying testing priorities, areas of risk, and resource allocation within SAP landscapes. Through this session, attendees can expect to enhance their understanding of test management principles while learning practical approaches to optimize testing processes in SAP environments using heatmap visualization techniques
What will you get from this session?
1. Insights into SAP testing best practices
2. Heatmap utilization for testing
3. Optimization of testing processes
4. Demo
Topics covered:
Execution from the test manager
Orchestrator execution result
Defect reporting
SAP heatmap example with demo
Speaker:
Deepak Rai, Automation Practice Lead, Boundaryless Group and UiPath MVP
Transcript: Selling digital books in 2024: Insights from industry leaders - T...BookNet Canada
The publishing industry has been selling digital audiobooks and ebooks for over a decade and has found its groove. What’s changed? What has stayed the same? Where do we go from here? Join a group of leading sales peers from across the industry for a conversation about the lessons learned since the popularization of digital books, best practices, digital book supply chain management, and more.
Link to video recording: https://bnctechforum.ca/sessions/selling-digital-books-in-2024-insights-from-industry-leaders/
Presented by BookNet Canada on May 28, 2024, with support from the Department of Canadian Heritage.
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf91mobiles
91mobiles recently conducted a Smart TV Buyer Insights Survey in which we asked over 3,000 respondents about the TV they own, aspects they look at on a new TV, and their TV buying preferences.
Key Trends Shaping the Future of Infrastructure.pdfCheryl Hung
Keynote at DIGIT West Expo, Glasgow on 29 May 2024.
Cheryl Hung, ochery.com
Sr Director, Infrastructure Ecosystem, Arm.
The key trends across hardware, cloud and open-source; exploring how these areas are likely to mature and develop over the short and long-term, and then considering how organisations can position themselves to adapt and thrive.
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...DanBrown980551
Do you want to learn how to model and simulate an electrical network from scratch in under an hour?
Then welcome to this PowSyBl workshop, hosted by Rte, the French Transmission System Operator (TSO)!
During the webinar, you will discover the PowSyBl ecosystem as well as handle and study an electrical network through an interactive Python notebook.
PowSyBl is an open source project hosted by LF Energy, which offers a comprehensive set of features for electrical grid modelling and simulation. Among other advanced features, PowSyBl provides:
- A fully editable and extendable library for grid component modelling;
- Visualization tools to display your network;
- Grid simulation tools, such as power flows, security analyses (with or without remedial actions) and sensitivity analyses;
The framework is mostly written in Java, with a Python binding so that Python developers can access PowSyBl functionalities as well.
What you will learn during the webinar:
- For beginners: discover PowSyBl's functionalities through a quick general presentation and the notebook, without needing any expert coding skills;
- For advanced developers: master the skills to efficiently apply PowSyBl functionalities to your real-world scenarios.
Epistemic Interaction - tuning interfaces to provide information for AI supportAlan Dix
Paper presented at SYNERGY workshop at AVI 2024, Genoa, Italy. 3rd June 2024
https://alandix.com/academic/papers/synergy2024-epistemic/
As machine learning integrates deeper into human-computer interactions, the concept of epistemic interaction emerges, aiming to refine these interactions to enhance system adaptability. This approach encourages minor, intentional adjustments in user behaviour to enrich the data available for system learning. This paper introduces epistemic interaction within the context of human-system communication, illustrating how deliberate interaction design can improve system understanding and adaptation. Through concrete examples, we demonstrate the potential of epistemic interaction to significantly advance human-computer interaction by leveraging intuitive human communication strategies to inform system design and functionality, offering a novel pathway for enriching user-system engagements.
Essentials of Automations: Optimizing FME Workflows with ParametersSafe Software
Are you looking to streamline your workflows and boost your projects’ efficiency? Do you find yourself searching for ways to add flexibility and control over your FME workflows? If so, you’re in the right place.
Join us for an insightful dive into the world of FME parameters, a critical element in optimizing workflow efficiency. This webinar marks the beginning of our three-part “Essentials of Automation” series. This first webinar is designed to equip you with the knowledge and skills to utilize parameters effectively: enhancing the flexibility, maintainability, and user control of your FME projects.
Here’s what you’ll gain:
- Essentials of FME Parameters: Understand the pivotal role of parameters, including Reader/Writer, Transformer, User, and FME Flow categories. Discover how they are the key to unlocking automation and optimization within your workflows.
- Practical Applications in FME Form: Delve into key user parameter types including choice, connections, and file URLs. Allow users to control how a workflow runs, making your workflows more reusable. Learn to import values and deliver the best user experience for your workflows while enhancing accuracy.
- Optimization Strategies in FME Flow: Explore the creation and strategic deployment of parameters in FME Flow, including the use of deployment and geometry parameters, to maximize workflow efficiency.
- Pro Tips for Success: Gain insights on parameterizing connections and leveraging new features like Conditional Visibility for clarity and simplicity.
We’ll wrap up with a glimpse into future webinars, followed by a Q&A session to address your specific questions surrounding this topic.
Don’t miss this opportunity to elevate your FME expertise and drive your projects to new heights of efficiency.
UiPath Test Automation using UiPath Test Suite series, part 3DianaGray10
Welcome to UiPath Test Automation using UiPath Test Suite series part 3. In this session, we will cover desktop automation along with UI automation.
Topics covered:
UI automation Introduction,
UI automation Sample
Desktop automation flow
Pradeep Chinnala, Senior Consultant Automation Developer @WonderBotz and UiPath MVP
Deepak Rai, Automation Practice Lead, Boundaryless Group and UiPath MVP
4. WHERE TO START
What you want vs what you need
Balance having critical
features with supporting
target user base
What features
the API supports
deciding minimum SDK
using Build.VERSION
What features
the device camera has
using use-feature and PackageManager
querying support level from the Camera
being aware of manufacturer/device quirks
WANT
CAN
You can’t always get what you want.
But if you try sometimes well you just mind find
You get what you need.
5. CAMERA SETUP: THE MANIFEST
<uses-permission android:name="android.permission.CAMERA" />
Without any <uses-feature> specifications, to install a device would require:
a back-facing camera
a front-facing camera
auto-focus
flash
From docs: “This will automatically enforce the <uses-feature> manifest element for
all camera features.”
If any of the above are not requirements, specify <uses-feature>:
<uses-feature android:name="android.hardware.camera.autofocus"
android:required="false"/>
5
6. CAMERA SETUP: CAMERA + PREVIEW
The order of things…
Add a SurfaceView to your layout
for the camera preview
Implement a SurfaceHolder.Callback:
surfaceCreated(), surfaceChanged(),
surfaceDestroyed()
Pass the callback to the SurfaceHolder
instance of the SurfaceView
Get android.hardware.Camera
instance via Camera.open()
Call Camera.getParameters()
and perform any initial setup
wait for surface to be created: #surfaceCreated
Call Camera.setPreviewDisplay() with the SurfaceHolder
Call Camera.startPreview()
9. CAMERA SETUP: THINGS TO NOTE
“Did you speak the exact words?”
Must call Camera.setPreviewDisplay() after the
surface is created
Otherwise, no error, no preview
Preview size changes must be made between
Camera.stopPreview()/Camera.startPreview()
all Camera.release() in onPause() to free up the camera
The surface is destroyed when SurfaceView is View.INVISIBLE.
9
10. IMAGE CAPTURE
Call Camera.takePicture(ShutterCallback, PictureCallback,
PictureCallback, PictureCallback)
The 3 PictureCallback parameters = 3 image formats
raw: uncompressed
postview: scaled, fully processed
JPEG: compressed
Raw and postview support depends on device
ShutterCallback (more or less) invoked the moment that camera
sensor captures an image
Camera.takePicture() stops the camera preview; call
Camera.startPreview() in/after picture taking callbacks
10
12. CAMERA INFO: SWITCHING IT UP
CameraInfo: per device camera
orientation: angle of rotation when facing the camera for the
image to match the natural orientation of the device
facing: front or back
whether the shutter sound can be disabled
Camera.getCameraInfo(): camera IDs are 0-based indices
Use CameraInfo to swap between front and back
Use PackageManager to check if a front camera exists if front
camera is not required by <use-feature>
Close the current camera before swapping
12
16. Natural camera orientation (looking at the device from the front)
Natural device orientation
90°
Camera.Info.orientation = 90
270°
Camera.Info.orientation = 270
DEVICE ORIENTATION VS CAMERA ORIENTATION
i.e. your camera is sideways
18. CAMERA ROTATION
Camera/display rotation + configuration changes -> sucks
Complicated
Device and camera orientation changes don’t play nice
Option #1: change activity orientation animation (API 18+):
WindowManager.LayoutParams.html#rotationAnimation
Option #2: lock the activity orientation
18
19. CAMERA PARAMETERS
Camera.Parameters information about and access to features
Device support:
PackageManager to check for auto-focus and flash
Otherwise check getter return values in Camera.Parameters
!isAutoWhiteBalanceLockSupported()
Or returns 0 or null
API level also a factor (of course)
19
21. CAMERA SETTINGS: UPDATING
Camera.Parameters changes happen immediately (mostly)
Saving/restoring parameters
Camera.Parameters.flatten()
Camera.Parameters.unflatten()
Change values on a Camera.Parameters instance and pass it to
Camera.setParameters()
Always call Camera.getParameters()
Do not hold onto Camera.Parameters instances
Only flattened string makes it past Camera service
21
23. CAMERA FEATURES: AREAS
Camera.Area rectangular bounds within viewfinder
metering areas: measuring light to calculate exposure + WB
focus areas: prioritizing focus
Camera.Parameters.setMeteringAreas(List<Camera.Area>)
Camera.Parameters.setFocusAreas(List<Camera.Area>)
Relative to the current zoom: cannot be outside FOV
Camera viewfinder/sensor has its own coordinate system
23
24. Camera
-1000
-1000 1000
(0,0)
H
1000
W
View
Viewfinder
Full FOV
Viewfinder
VIEWFINDER VS VIEW COORDINATES
Translating between what the camera sees and what the user sees
zoom = 1.5x
preview surface in layout
26. FACE DETECTION
Camera.Parameters.getMaxNumDetectedFaces()
Camera
FaceDetectionListener, setFaceDetectionListener()
startFaceDetection(), stopFaceDetection()
Camera.Face: data object
ID: unique per face
face bounds
score: how confident are we that this is a face?
eye and face coordinates
26
27. FACE DETECTION
FaceDetectionListener.onFaceDetection() is called frequently
Start only when actually needed
Avoid intensive work inside the callback
No event when no faces are detected
Modifying the UI in response to face detection: timer or
postDelayed to reset UI after some time without detection event
27
28. CAMERA API 2 IN L: THE FUTURE IS AWESOME
Driven by a new Hardware Abstract Layer (HAL3)
HAL Version 1: black box: 3 modes (preview, still, video)
HAL3: all requests handled same way, “unified view”
More user control for both capture and post-processing
Maintainability and efficiency
28
29. HAL V1 VS HAL V3
https://source.android.com/devices/camera/camera3.html
31. CAMERA API 2 IN L: THE FUTURE IS AWESOME
More metadata
Camera information
Capture configuration part of request and result
Dynamic metadata: timestamps, exposure time
More output options
Multiple Surface instances receive results from a single request
App-visible JPEG, YUV, RAW Bayer buffers
31
32. CAMERA API 2 IN L: THE FUTURE IS AWESOME
Camera (static bits) -> CameraManager
AvailabilityListener: removable cameras
Asynchronous opening + CameraDevice.StateListener
Camera (function access) -> CameraDevice
Actually get the ID of the camera!
CameraCaptureSession/CaptureRequest
Parameters -> CaptureRequest.Builder.set() to configure
CameraInfo -> CameraCharacteristics
CameraMetadata parent of CameraCharacteristics, CaptureRequest,
CaptureResult, TotalCaptureResult
32
33. CAMERA API 2 IN L: THE FUTURE IS AWESOME
Lessons from API 1 do not go away (remember the words)
More complex… but more is still better
More control and performance
More consistency in the API
More for developers to leverage
It’s going to be…
33
34. THANK YOU +
QUESTIONS?
Huyen Tue Dao
Lead developer | Owner
Randomly Typing
!
@queencodemonkey
!
huyen@randomlytyping.com
randomlytyping.com
!
speakerdeck.com/randomlytyping
slideshare.net/randomlytyping
34
Code will coming to github
!
Things To check out
!
Building Apps with Multimedia: Capturing Photos
developer.android.com/training/camera/
index.html
!
Android Design in Action: Camera Apps
youtube.com/watch?v=OLSa7fErTAM
!
Standford Digital Image Processing Class
stanford.edu/class/ee368/Android/index.html
!
DevBytes: Android L - Camera2 API
youtube.com/watch?v=Xtp3tH27OFs
!
Sample Camera 2 API app:
github.com/googlesamples/android-
Camera2Basic/blob/master/Camera2BasicSample
!
Digital Camera Sensor Sizes
gizmag.com/camera-sensor-size-guide/26684/