Tài liệu hạn chế xem trước, để xem đầy đủ mời bạn chọn Tải xuống
1
/ 24 trang
THÔNG TIN TÀI LIỆU
Thông tin cơ bản
Định dạng
Số trang
24
Dung lượng
2,1 MB
Nội dung
Bernd Girod, David Chen: EE368 MobileImageProcessing – Part 1 no. 1 Mobileimageprocessing – Part 1 Mobile application development on Android Project 1: “Hello Image”, reading/writing/modifying images Project 2: “Viewfinder EE368”, processing viewfinder frames Project 3: “CVCamera”, utilizing OpenCV functions Mobile application examples Bernd Girod, David Chen: EE368 MobileImageProcessing – Part 1 no. 2 http://www.stanford.edu/~gtakacs/publication.html Mobile landmark recognition Bernd Girod, David Chen: EE368 MobileImageProcessing – Part 1 no. 3 http://www.stanford.edu/~sstsai/research.html Mobile product recognition Bernd Girod, David Chen: EE368 MobileImageProcessing – Part 1 no. 4 Popular mobile platforms Symbian Apple iOS Windows 7 Nokia N8 HTC Arrive Samsung Focus iPhone iPad Motorola Droid Nokia N97 Android Samsung Galaxy Tab Bernd Girod, David Chen: EE368 MobileImageProcessing – Part 1 no. 5 Spotlight on Android Open source mobile platform developed by Google Supported by Open Handset Alliance 13 mobile operators 18 handset manufacturers 20 semiconductor companies 16 software makers Uses an open-source, customizable Linux kernel and a virtual machine designed for mobile hardware Largest share of smartphone market in the US Android Market now contains over 250k apps Bernd Girod, David Chen: EE368 MobileImageProcessing – Part 1 no. 6 Android software stack [ Professional Android Application Development ] Linux Kernel Bernd Girod, David Chen: EE368 MobileImageProcessing – Part 1 no. 7 Programming in Java Android encourages high-level development Android uses Java as the main programming language Inherits basic classes from conventional Java String, Container, Math, IO, Network Adds new classes specific to mobile devices Camera, Telephony, Map, GPS, Speech Bernd Girod, David Chen: EE368 MobileImageProcessing – Part 1 no. 8 Android programming with Eclipse Eclipse IDE Android SDK Java Runtime program installation and execution system messages programmer inputs data and messages Internet Bernd Girod, David Chen: EE368 MobileImageProcessing – Part 1 no. 9 Class tutorials for Android (1) Android tutorials designed specifically for mobileimageprocessing in the EE368 class Tutorial #1: Basic Android Setup Image processing-oriented introduction to Android Explains how to download and install the different software packages (JDK, SDK, Eclipse) on your own computer Shows how to build and run a viewfinder app that computes color histograms in real time Tutorial #2: OpenCV for Android Setup Builds on core skills developed in Tutorial #1 Explains how to download and install OpenCV for Android Shows how to build a more advanced viewfinder app that computes various image feature keypoints supported by OpenCV Bernd Girod, David Chen: EE368 MobileImageProcessing – Part 1 no. 10 Class tutorials for Android (2) http://ee368.stanford.edu/Android Support for Windows, Macintosh, and Linux in both tutorials [...]... BitmapFactory.decodeFile(imageFileName); // Display the image in the image viewer myImageView = (ImageView)findViewById(R.id.my _image_ view); if (myImageView != null) { myImageView.setImageBitmap(myBitmap); } Display image in viewer } } Bernd Girod, David Chen: EE368 MobileImageProcessing – Part 1 no 17 HelloImage Activity class (3) private void processImage() { brighten(50); Apply some imageprocessing operation... EE368 MobileImageProcessing – Part 1 no 22 Class Project: Jigsaw Puzzle Solver L Liang and Z Liu, Spring 2010 http://ee368.stanford.edu/Project_10 Bernd Girod, David Chen: EE368 MobileImageProcessing – Part 1 no 23 Mobileimageprocessing – Part 1 Mobile application development on Android Project 1: “Hello Image , reading/writing/modifying images Project 2: “Viewfinder EE368”, processing. .. 0, width, height); } Bernd Girod, David Chen: EE368 MobileImageProcessing – Part 1 no 19 Running the program on an Android device 0123456789ABC Bernd Girod, David Chen: EE368 MobileImageProcessing – Part 1 no 20 “Hello Image application running on device http://ee368.stanford.edu/Android/HelloImage Bernd Girod, David Chen: EE368 MobileImageProcessing – Part 1 no 21 Class Project: Plant Leaf... Chen: EE368 MobileImageProcessing – Part 1 no 14 Recommended project settings (2) Bernd Girod, David Chen: EE368 Mobile Image Processing – Part 1 no 15 HelloImage Activity class (1) Subclass of Activity class will be visible on the phone public class HelloImage extends Activity { Bitmap myBitmap; ImageView myImageView; public void onCreate(Bundle savedInstanceState) { … } private void processImage()... Chen: EE368 Mobile Image Processing – Part 1 no 16 HelloImage Activity class (2) onCreate called when the application first starts public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); String imageFileName = “/sdcard/test_vga.jpg”; File imageFile = new File(imageFileName); Load image if (imageFile.exists()) { from SD card // Load the image from... Girod, David Chen: EE368 Mobile Image Processing – Part 1 no 12 “Hello Image project Goals of this project Learn how to create a new Android project Learn how to read/write images from/to SD card Learn how to access and modify image bitmaps Full source available on class website: http://ee368.stanford.edu/Android/HelloImage Bernd Girod, David Chen: EE368 Mobile Image Processing – Part 1 no... bufOutStr.close(); } catch (FileNotFoundException exception) { image to the SD card Log.e("debug_log", exception.toString()); } catch (IOException exception) { Log.e("debug_log", exception.toString()); Catch exceptions } myImageView.setImageBitmap(myBitmap); Show the image on the display } Bernd Girod, David Chen: EE368 Mobile Image Processing – Part 1 no 18 HelloImage Activity class (4) private void brighten(int... Project 1: “Hello Image , reading/writing/modifying images Project 2: “Viewfinder EE368”, processing viewfinder frames Project 3: “CVCamera”, utilizing OpenCV functions Mobile application examples Bernd Girod, David Chen: EE368 MobileImageProcessing – Part 1 no 24 ...Eclipse IDE Different perspectives Text editor Class hierarchy Project files Bernd Girod, David Chen: EE368 Errors and warnings MobileImageProcessing – Part 1 no 11 Structure of an Android Project in Eclipse Programmer-defined Java files Program new functions here Auto-generated Java files Don’t edit anything here Android library Don’t