Professional Documents
Culture Documents
Examples of mobile image processing Android platform Class resources for Android Eclipse integrated development environment Augmentation of viewfinder frames Debugging with DDMS perspective Taking a device screenshot Creating an Android emulator Mixed programming with Android JNI OpenCV library for Android Past class projects
Digital Image Processing: Bernd Girod, David Chen, Matt Yu 2013-2014 Stanford University -- Mobile Image Processing 1
Digital Image Processing: Bernd Girod, David Chen, Matt Yu 2013-2014 Stanford University -- Mobile Image Processing 2
Digital Image Processing: Bernd Girod, David Chen, Matt Yu 2013-2014 Stanford University -- Mobile Image Processing 3
Android platform
Open source mobile platform developed by Google Supported and maintained by Open Handset Alliance
Digital Image Processing: Bernd Girod, David Chen, Matt Yu 2013-2014 Stanford University -- Mobile Image Processing 4
Android platform
Open source mobile platform developed by Google Supported and maintained by Open Handset Alliance
Uses an open-source kernel and a virtual machine designed for mobile hardware Commands the largest share of the smartphone market in the world Google Play store contains over 1M apps
Digital Image Processing: Bernd Girod, David Chen, Matt Yu 2013-2014 Stanford University -- Mobile Image Processing 5
Market Share
Linux Kernel
Android encourages high-level app development Android uses Java as the main programming language Android inherits basic classes from conventional Java
Digital Image Processing: Bernd Girod, David Chen, Matt Yu 2013-2014 Stanford University -- Mobile Image Processing 8
Image processing-oriented introduction to Android Explains how to download and install the different software packages (JDK, SDK, Eclipse) on your own computer or use these pre-installed packages on SCIEN machines Shows how to build and run viewfinder augmentation apps in real time
http://www.stanford.edu/ee368/Android
Digital Image Processing: Bernd Girod, David Chen, Matt Yu 2013-2014 Stanford University -- Mobile Image Processing 9
Builds on core skills developed in Tutorial #1 Explains how to download and install OpenCV for Android Shows how to build viewfinder apps that detect circles and lines, detect feature keypoints, track feature keypoints, perform locally adaptive thresholding, detect human faces
http://www.stanford.edu/ee368/Android
Digital Image Processing: Bernd Girod, David Chen, Matt Yu 2013-2014 Stanford University -- Mobile Image Processing 10
HTTP
4. Server-side application processes the data
http://www.stanford.edu/ee368/Android
Digital Image Processing: Bernd Girod, David Chen, Matt Yu 2013-2014 Stanford University -- Mobile Image Processing 12
programmer inputs
Eclipse IDE
Android SDK
Java JDK
Digital Image Processing: Bernd Girod, David Chen, Matt Yu 2013-2014 Stanford University -- Mobile Image Processing 13
Learn how to create a simple Android project Learn how to display viewfinder frames Learn how to process viewfinder frames
Digital Image Processing: Bernd Girod, David Chen, Matt Yu 2013-2014 Stanford University -- Mobile Image Processing 16
Preview (View)
Handle incoming viewfinder frames and toggles processing state
Digital Image Processing: Bernd Girod, David Chen, Matt Yu 2013-2014 Stanford University -- Mobile Image Processing 17
}
}
Digital Image Processing: Bernd Girod, David Chen, Matt Yu 2013-2014 Stanford University -- Mobile Image Processing 18
Preview (View)
Handle incoming viewfinder frames and toggles processing state
Digital Image Processing: Bernd Girod, David Chen, Matt Yu 2013-2014 Stanford University -- Mobile Image Processing 19
Preview (View)
myCamera.setPreviewCallback(new PreviewCallback() { public void onPreviewFrame(byte[] data, Camera camera) { ... Pass data to DrawOnTop class ... } });
w/2 Cr
Digital Image Processing: Bernd Girod, David Chen, Matt Yu 2013-2014 Stanford University -- Mobile Image Processing 20
h/2
Digital Image Processing: Bernd Girod, David Chen, Matt Yu 2013-2014 Stanford University -- Mobile Image Processing 21
Preview (View)
Handle incoming viewfinder frames and toggles processing state
Digital Image Processing: Bernd Girod, David Chen, Matt Yu 2013-2014 Stanford University -- Mobile Image Processing 22
w/2
h/2 Cb
w/2
Cr h
RGB
298.08 Y 408.58 Cr R 222.921 256 256 298.08 Y 100.29 Cb 208.12 Cr G 135.58 256 256 256 298.08 Y 516.41 Cb 276.84 B 256 256
Digital Image Processing: Bernd Girod, David Chen, Matt Yu 2013-2014 Stanford University -- Mobile Image Processing 23
Called whenever this view is repainted Decode frame with or without hist. eq. Draw decoded frame in new layer
Digital Image Processing: Bernd Girod, David Chen, Matt Yu 2013-2014 Stanford University -- Mobile Image Processing 24
Digital Image Processing: Bernd Girod, David Chen, Matt Yu 2013-2014 Stanford University -- Mobile Image Processing 25
Digital Image Processing: Bernd Girod, David Chen, Matt Yu 2013-2014 Stanford University -- Mobile Image Processing 26
Learn how to modify camera parameters Learn how to create drawing instruments Learn how to augment the viewfinder frames
Digital Image Processing: Bernd Girod, David Chen, Matt Yu 2013-2014 Stanford University -- Mobile Image Processing 27
Preview (View)
Handle incoming viewfinder frames and adjust camera parameters
Digital Image Processing: Bernd Girod, David Chen, Matt Yu 2013-2014 Stanford University -- Mobile Image Processing 28
public void onCreate(Bundle savedInstanceState) { ... getWindow().setFlags( WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN ); requestWindowFeature(Window.FEATURE_NO_TITLE); ... }
Digital Image Processing: Bernd Girod, David Chen, Matt Yu 2013-2014 Stanford University -- Mobile Image Processing 29
Preview (View)
Handle incoming viewfinder frames and adjust camera parameters
Digital Image Processing: Bernd Girod, David Chen, Matt Yu 2013-2014 Stanford University -- Mobile Image Processing 30
New frame
Capture YCbCr
Augment RGB
Augment RGB
Time
Digital Image Processing: Bernd Girod, David Chen, Matt Yu 2013-2014 Stanford University -- Mobile Image Processing 31
Digital Image Processing: Bernd Girod, David Chen, Matt Yu 2013-2014 Stanford University -- Mobile Image Processing 32
Preview (View)
Handle incoming viewfinder frames and adjust camera parameters
Digital Image Processing: Bernd Girod, David Chen, Matt Yu 2013-2014 Stanford University -- Mobile Image Processing 33
Digital Image Processing: Bernd Girod, David Chen, Matt Yu 2013-2014 Stanford University -- Mobile Image Processing 34
String meanStr = "Mean (R,G,B): " + String.format("%.4g", imageRedMean) + ", " + String.format("%.4g", imageGreenMean) + ", " + String.format("%.4g", imageBlueMean); myCanvas.drawText(meanStr, x, y, mPaintYellow);
Digital Image Processing: Bernd Girod, David Chen, Matt Yu 2013-2014 Stanford University -- Mobile Image Processing 35
Bin 0
Bin 1
Bin 2
Bin 3
Bin 4
// Draw red rectangle Rect rect = new Rect( left x, top y, right x, bottom y ); myCanvas.drawRect( rect, myPaintRed );
Digital Image Processing: Bernd Girod, David Chen, Matt Yu 2013-2014 Stanford University -- Mobile Image Processing 36
Digital Image Processing: Bernd Girod, David Chen, Matt Yu 2013-2014 Stanford University -- Mobile Image Processing 37