Camera & Sensors in Windows Phone Application

28

description

Session Code. Camera & Sensors in Windows Phone Application. Larry Lieberman Product Mgr , Windows Phone Developer Microsoft Corporation. Agenda. What sensors are available, and how do I use them? How do I access the camera to address various scenarios. - PowerPoint PPT Presentation

Transcript of Camera & Sensors in Windows Phone Application

Page 1: Camera & Sensors in  Windows Phone Application
Page 2: Camera & Sensors in  Windows Phone Application

Session Code

Camera & Sensors in Windows Phone Application

Larry LiebermanProduct Mgr, Windows Phone DeveloperMicrosoft Corporation

Page 3: Camera & Sensors in  Windows Phone Application

AgendaWhat sensors are available, and how do I use them?How do I access the camera to address various scenarios

Page 4: Camera & Sensors in  Windows Phone Application

New scenarios enabled in Windows Phone 7.5

Augmented realityBarcode scanning appsCustom camerasImage processing

Page 5: Camera & Sensors in  Windows Phone Application

What hardware sensors are supported?

Accelerometer

Compass

Gyro

New for 7.5

Page 6: Camera & Sensors in  Windows Phone Application

Motion sensor

Motion Sensor

[cos γ .cos α −cos β . sin α+sin β . sin γ .cosα sin β .sin α+cos β . sin γ .cos α

cos γ . sin α cos β .cos α+sin β . sin γ . sin α − sin β .cos α+cos β . sin γ .sin α

− sin γ sin β .cos γ cos β .sin γ ]All the sensors + a bunch of math!

Use this sensor whenever available

Page 7: Camera & Sensors in  Windows Phone Application

Why not always use motion sensor?Motion.IsSupported is false

Motion will work even without gyroscopeWhen you want data specific to the sensor reading

Accelerometer – acceleration (in g’s)Gyro –rotational velocity (rad/s)Compass – heading (degrees)

Advanced UsagesCustom motion algorithmsGestures?

Page 8: Camera & Sensors in  Windows Phone Application

Two Ways to Access the CameraPhotoCamera Class:

New ISV Managed API developed for WPSilverlight 4 WebCam API

Ported SL4 API with added functionality and perf

Page 9: Camera & Sensors in  Windows Phone Application

Scenarios Dictate Which Camera API Choice

Silverlight 4 WebCamReuse SL4 WebCam KnowledgeEasily Target Desktop and PhoneRecord Video and Audio into a File

PhotoCameraTake High Quality PhotosHandling Hardware ButtonHandling Flash mode and Focus

Page 10: Camera & Sensors in  Windows Phone Application

Camera “Good to Know”Output for Video recorded is MP4Always check for device specific support for Flash modeUse Y or YUV format for Processing Samples

Page 11: Camera & Sensors in  Windows Phone Application

Hardware Availability and Debugging

Not all phones will have same hardware configurationGyro and Compass optional (but if Gyro present, Compass present)Motion Sensor quality based on sensors present

Accelerometer, Gyro, and Compass - best qualityAccelerometer and Compass – good for AR scenarios(reduced quality without Gyro)

Physical hardware required for most debugging scenarios

Accelerometer can be debugged with emulator

Page 12: Camera & Sensors in  Windows Phone Application

Re-capGyro, compass, and motion sensor are coming

The new motion sensor class does all the hard math for youYou can still access raw sensor data if you need to

New camera API’s will enable cool new scenarios on the phone

Augmented RealityCustomer Photo Camera

Questions?

Page 13: Camera & Sensors in  Windows Phone Application

Summary Many of the most compelling mobile applications and games leverage sensors to create wildly interactive experiences

Page 14: Camera & Sensors in  Windows Phone Application

Related Content

Page 15: Camera & Sensors in  Windows Phone Application

Resources

Page 16: Camera & Sensors in  Windows Phone Application

Feedback Your feedback is very important! Please complete an evaluation form!

Thank you!

Page 17: Camera & Sensors in  Windows Phone Application

Questions? Session Code Speaker Name

Title Email Blog …

You can ask your questions at “Ask the expert” zone within an hour after end of this session

Page 18: Camera & Sensors in  Windows Phone Application
Page 19: Camera & Sensors in  Windows Phone Application

Session Code

Title of Presentation

NameCompany

NameCompany

Page 20: Camera & Sensors in  Windows Phone Application

Session Code

Title of Presentation

Name Company

Name Company

Name Company

Page 21: Camera & Sensors in  Windows Phone Application

Contents

Page 22: Camera & Sensors in  Windows Phone Application

Slide Title First level

Second levelThird level

Fourth level Fifth level

Page 23: Camera & Sensors in  Windows Phone Application

PowerPoint GuidelinesFont, size, and color for text have been formatted for you in the Slide MasterUse the color palette shown belowHyperlink color: www.microsoft.com

Sample FillSample FillSample Fill

Sample FillSample FillSample Fill

Page 24: Camera & Sensors in  Windows Phone Application

Bar Chart Example

Category 1

Category 2

Category 3

Category 4

012345

Series 1Series 2Series 3

Page 25: Camera & Sensors in  Windows Phone Application

demo

Demo Title Name

Page 26: Camera & Sensors in  Windows Phone Application

video

Video Title

Page 27: Camera & Sensors in  Windows Phone Application

announcement

Announcement Title

Page 28: Camera & Sensors in  Windows Phone Application

Code Sample Get-Process –computername srv1

class TechEdProgram{

public static void Main(){

System.Console.WriteLine("Hello, Tech·Ed!");}

}