Mobile image processing – Part 2 Mobile application development on Android “Hello World” project Hello World project “Viewfinder EE368” project Image processing library Mobile application examples Bernd Girod, David Chen: EE368 Mobile Image Processing – Part 2 no. 1
24
Embed
Microsoft PowerPoint - Android-2.ppt [Compatibility Mode]
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Mobile image processing – Part 2
Mobile application development on Android“Hello World” projectHello World project“Viewfinder EE368” projectImage processing libraryg g yMobile application examples
Bernd Girod, David Chen: EE368 Mobile Image Processing – Part 2 no. 1
Google GogglesProduct recognition
Bernd Girod, David Chen: EE368 Mobile Image Processing – Part 2 no. 2
http://www.google.com/mobile/goggles
How to download Google Goggles
Open the Android Market applicationSearch for “Google Goggles”Search for Google Goggles
Bernd Girod, David Chen: EE368 Mobile Image Processing – Part 2 no. 3
Recognizing video at a glanceVisual bookmarks for movies and TV shows
(1) User snaps a photo of screen (3) User resumes video on the phone(1) User snaps a photo of screen. (3) User resumes video on the phone.
Bernd Girod, David Chen: EE368 Mobile Image Processing – Part 2 no. 4
(2) Our system identifies video andframe within the video.
Recognizing video at a glanceVisual bookmarks for movies and TV shows
Bernd Girod, David Chen: EE368 Mobile Image Processing – Part 2 no. 5
Bernd Girod, David Chen: EE368 Mobile Image Processing – Part 2 no. 8
Android manifest file (AndroidManifest.xml)
Landscape mode
…
Landscape mode
Main Activityy…
Set the proper hardware permissions
Bernd Girod, David Chen: EE368 Mobile Image Processing – Part 2 no. 9
Class hierarchy
Viewfinder Manage two views andViewfinder EE368
(Activity)
Manage two views and manage program open/close
Draw onPreview(View)
Draw on Top
(View)
Handle incoming viewfinder frames and adjust camera
Augment viewfinder frames with a new layer of information
Bernd Girod, David Chen: EE368 Mobile Image Processing – Part 2 no. 10
jparameters
yon top
Viewfinder class: full screen mode
Icon and title bars visible Icon and title bars hidden
Viewfinder EE368
Bernd Girod, David Chen: EE368 Mobile Image Processing – Part 2 no. 11
Class hierarchy
Viewfinder Manage two views andViewfinder EE368
(Activity)
Manage two views and manager program open/close
Draw onPreview(View)
Draw on Top
(View)
Handle incoming viewfinder frames and adjust camera
Augment viewfinder frames with a new layer of information
Bernd Girod, David Chen: EE368 Mobile Image Processing – Part 2 no. 12
jparameters
yon top
Timeline of events on the mobile device
N f N fNew frame New frame
CapturePreview CaptureCapture
Augment
Preview
DrawOnTop
Capture
Augment
TimeFrame Interval
Bernd Girod, David Chen: EE368 Mobile Image Processing – Part 2 no. 13
Preview class: frames go down two paths
Preview frames Display on phone screen
Preview(View)
…phone screen
Forward to callback functioncallback function
…Data in YCbCr 4:2:0 format
width w
heig
ht h
w/2 w/2h/
2
h/2
Cb Cr
Bernd Girod, David Chen: EE368 Mobile Image Processing – Part 2 no. 14
h Y
Preview class: set camera parameters
Preview(View)(View)
Bernd Girod, David Chen: EE368 Mobile Image Processing – Part 2 no. 15
Class hierarchy
Viewfinder Manage two views andViewfinder EE368
(Activity)
Manage two views and manage program open/close
Draw onPreview(View)
Draw on Top
(View)
Handle incoming viewfinder frames and adjust camera
Augment viewfinder frames with a new layer of information
Bernd Girod, David Chen: EE368 Mobile Image Processing – Part 2 no. 16
jparameters
yon top
DrawOnTop class: create a paint brush
Bernd Girod, David Chen: EE368 Mobile Image Processing – Part 2 no. 17
DrawOnTop class: YCbCr to RGB
width w
t h
w/2 w/2
2 2
w
heig
ht h/2
h/2
YCb Cr
h
RGB
921.22225658.408
25608.298
−⋅
+⋅
=CrYR
58.13525612.208
25629.100
25608.298
256256
+⋅
−⋅
−⋅
=CrCbYG
84.27625641.516
25608.298
−⋅
+⋅
=CbYB
Bernd Girod, David Chen: EE368 Mobile Image Processing – Part 2 no. 18
DrawOnTop class: draw histogram bars
Bin 0 Bin 1 Bin 2 Bin 3 Bin 4
Rect rect = new Rect( left x, top y, right x, bottom y );Canvas.drawRect( rect );
Bernd Girod, David Chen: EE368 Mobile Image Processing – Part 2 no. 19
Viewfinder EE368 demo
Bernd Girod, David Chen: EE368 Mobile Image Processing – Part 2 no. 20
http://ee368.stanford.edu/Android/ViewfinderEE368
Real-time debugging using DDMS (1)
Bernd Girod, David Chen: EE368 Mobile Image Processing – Part 2 no. 21
Real-time debugging using DDMS (2)
03EH368929E3K
DeviceFile system on device
Device
Messages on the devicethe device
Bernd Girod, David Chen: EE368 Mobile Image Processing – Part 2 no. 22
Danger of unresponsiveness
Users notice delays longer than ~0.5 secAndroid only lets your program “hang” or “freeze” for ~5 secAndroid only lets your program hang or freeze for 5 sec before bringing up warning dialog
Bernd Girod, David Chen: EE368 Mobile Image Processing – Part 2 no. 23
Activity life cycle
[ Professional Android Application Development ]
Bernd Girod, David Chen: EE368 Mobile Image Processing – Part 2 no. 24