• Share
  • Email
  • Embed
  • Like
  • Save
  • Private Content
MobiCom on Android: Barcode Processing, Detection, & Localization; Navigating Android Installation; Greeting & Toasing Gingerbread & Jelly Bean; Android App Dev Process; Anatomy of Android App

MobiCom on Android: Barcode Processing, Detection, & Localization; Navigating Android Installation; Greeting & Toasing Gingerbread & Jelly Bean; Android App Dev Process; Anatomy of Android App






Total Views
Views on SlideShare
Embed Views



16 Embeds 327

http://vkedco.blogspot.com 248
http://www.vkedco.blogspot.com 45
http://vkedco.blogspot.in 14
http://vkedco.blogspot.de 3
http://www.vkedco.blogspot.in 3
http://vkedco.blogspot.mx 2
http://vkedco.blogspot.com.es 2
http://vkedco.blogspot.it 2
http://vkedco.blogspot.fr 1
http://vkedco.blogspot.jp 1
http://www.vkedco.blogspot.ru 1
http://www.vkedco.blogspot.co.il 1
http://vkedco.blogspot.be 1
http://vkedco.blogspot.com.br 1
http://vkedco.blogspot.tw 1
http://vkedco.blogspot.ca 1



Upload Details

Uploaded via as Adobe PDF

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
Post Comment
Edit your comment

    MobiCom on Android: Barcode Processing, Detection, & Localization; Navigating Android Installation; Greeting & Toasing Gingerbread & Jelly Bean; Android App Dev Process; Anatomy of Android App MobiCom on Android: Barcode Processing, Detection, & Localization; Navigating Android Installation; Greeting & Toasing Gingerbread & Jelly Bean; Android App Dev Process; Anatomy of Android App Presentation Transcript

    • MobiCom on Android Barcode Processing, Detection, & Localization Navigating Your Android Installation Greeting & Toasting Gingerbread & Jelly Bean Android App Development Process Anatomy of Android Application Vladimir Kulyukinwww.youtube.com/vkedco www.vkedco.blogspot.com
    • Outline ● Research – Barcode Processing – Barcode Detection – Barcode Localization ● Development – Navigating Your Android Installation – Greeting & Toasting Gingerbread (2.3.X) & Jelly Bean (4.2) – Anatomy of Android Application – Android Development Processwww.youtube.com/vkedco www.vkedco.blogspot.com
    • Researchwww.youtube.com/vkedco www.vkedco.blogspot.com
    • Definitions ● Barcode Detection – decision procedure that detects the presence or absence of a barcode in an image; the procedure can be binary (true/false) or probabilistic ● Barcode Localization – procedure that returns the coordinates of a region that contains a barcode ● Barcode Decoding – procedure that produces a sequence of numbers corresponding to a barcodewww.youtube.com/vkedco www.vkedco.blogspot.com
    • Domain Constraints ● Constraint 1 – We are interested in finding barcodes on product surfaces (boxes, bags, bottles, & cans) ● Constraint 2 – We are interested in finding aligned (horizontal or vertical) barcodes; this constraint will be gradually loosened ● Constraint 3 computation is mobile so many algorithms that work in MATLAB will not be appropriatewww.youtube.com/vkedco www.vkedco.blogspot.com
    • Barcode Processing Overviewwww.youtube.com/vkedco www.vkedco.blogspot.com
    • Barcode Detectionwww.youtube.com/vkedco www.vkedco.blogspot.com
    • Barcode Detection Overviewwww.youtube.com/vkedco www.vkedco.blogspot.com
    • Image Binarization ● Each pixel is typically represented by a tuple PC = (R, G, B), where PC is a pixel in a RGB image ● R (red), G (green), B (blue) are typically represented as bytes so that 0 <= R, G, B <= 255 ● Many applications convert RGB tuples into Y Y grayscale values (0 <= P <= 255, where P is a pixel value in a grayscale image) or bi-level values (PB = 0 or PB = 255, PB is a pixel in a bi-level image)www.youtube.com/vkedco www.vkedco.blogspot.com
    • Grayscale Formula C Given P = (R, G, B), the corresponding grayscale value is Y P = 0.3R + 0.59G + 0.11Bwww.youtube.com/vkedco www.vkedco.blogspot.com
    • Image Binarization ● Let G be a grayscale image, B a binarized image, Threshold is a real number, and ThresholdFun(x, y) is a function ● Global Methods For every pixel at G(x, y), B(x, y) = 255 if G(x, y) <= Threshold B(x, y) = 0 if G(x, y) > Threshold ● Local Methods For every pixel at G(x, y), B(x, y) = 255 if G(x, y) <= ThresholdFun(x, y) B(x, y) = 0 if G(x, y) > ThresholdFun(x, y)www.youtube.com/vkedco www.vkedco.blogspot.com
    • Local vs Global Tradeoffs ● Global binarization – Pro: simple & efficient because the value of a threshold remains the same for each pixel – Con: may not be able to handle large variations in illumination over the whole image ● Local binarization – Pro: more responsive to large variations in illumination – Con: more complex & less efficient because the value is a function of a specific pixel (x, y)www.youtube.com/vkedco www.vkedco.blogspot.com
    • Niblacks Binarization Let m(x, y) and s(x, y) be the mean and standard deviation values for an n x n window centered at G(x, y) and let k be a real number (user defined), then the Niblack threshold is computed as ThresholdFun(x, y) = m(x, y) + k*s(x, y)www.youtube.com/vkedco www.vkedco.blogspot.com
    • Modified Niblacks Binarization ● It may be expensive to compute Niblacks thresholds for large images and large n x n windows ● One way to address the problem is to divide the grayscale image G into n x n subimages and compute a single threshold for each subimage Gi,j of Gwww.youtube.com/vkedco www.vkedco.blogspot.com
    • Modified Niblacks Binarization ● Let m(i, j) and s(i, j) be the mean and the standard deviation for the subimage Gi,j of G and let k, t, st be user-defined thresholds T(i, j, k, t, st) = m(i, j) + k*s(i, j) if s(i, j) >= st T(i, j, k, t, st) = t if s(i, j) < stwww.youtube.com/vkedco www.vkedco.blogspot.com
    • Modified Niblacks Binarization Formulas Original Threshold Modified Thresholdwww.youtube.com/vkedco www.vkedco.blogspot.com
    • Original vs Modified Thresholds: Examplewww.youtube.com/vkedco www.vkedco.blogspot.com
    • Gradients ● A gradient of a continuous function is the functions derivative along a given direction X ● Let B be a binarized image and B and Y B be its gradients along the x and y axes of pixel at B(x, y), then X B = B(x, y) * GX, GX = [-1, 2, -1] Y T B = B(x, y) * GY, GY = [-1, 2, -1]www.youtube.com/vkedco www.vkedco.blogspot.com
    • Image Regions & Gradients ● A product surface has four distinct image regions: 1) Barcode, 2) Background, 3) Text, 4) Graphics ● Barcode (remember domain constraint 2) – Horizontal barcode exhibits a large gradient along the y axis and a small gradient along the x axis – Vertical barcode exhibits a large gradient along the x axis and a small gradient along the y axis ● Background exhibits small gradients along both directions ● Text & Graphics exhibit large gradients along both axeswww.youtube.com/vkedco www.vkedco.blogspot.com
    • Image Regions & Gradients: Example Gradients →www.youtube.com/vkedco www.vkedco.blogspot.com
    • Computation of Image Gradients ● Let B be a binarized image divided into n x n subimages Bi,j ● Let the top left and bottom right points for each subimage Bi,j be (XTL, YTL) and (XBR, YBR), then the gradients along the x and y axes can be computed as follows:www.youtube.com/vkedco www.vkedco.blogspot.com
    • Subimage Classification ● If a subimage contains a barcode only one of the gradient values will likely be high (exclusive or) ● If a subimage contains constant background, both values will likely be low ● If a subimage contains text or graphics both values will likely be highwww.youtube.com/vkedco www.vkedco.blogspot.com
    • Subimage Classification with SVMs ● A Support Vector Machine (SVM) is a linear classifier that can classify linearly separable data ● In 2D, the idea is to train an SVM to construct a line that separates positive and negative examples ● In the case of gradients, we can construct (X- Gradient, Y-Gradient) data points for subimages that contain and do not contain barcodeswww.youtube.com/vkedco www.vkedco.blogspot.com
    • Subimage Classification with SVMs ● One hundred images were manually collected and divided into two classes: – Positive (yes barcode) – Negative (no barcode) ● Two SVMs were trained on these images (SVM1 and SVM2) ● A subimage contains a barcode if at least one SVM says yeswww.youtube.com/vkedco www.vkedco.blogspot.com
    • Subimage Classification with Support Vector Machineswww.youtube.com/vkedco www.vkedco.blogspot.com
    • Barcode Localizationwww.youtube.com/vkedco www.vkedco.blogspot.com
    • Barcode Localization Overview Objective is to determine the exact location of a barcode in a frame and segment itwww.youtube.com/vkedco www.vkedco.blogspot.com
    • Application of Line Filterswww.youtube.com/vkedco www.vkedco.blogspot.com
    • Developmentwww.youtube.com/vkedco www.vkedco.blogspot.com
    • Navigation Android Installationwww.youtube.com/vkedco www.vkedco.blogspot.com
    • Android Root Directory After you install Android, your Android root directory (e.g., E:/Android/android-sdks) will likely look as follows (your particular installation may look somewhat different)www.youtube.com/vkedco www.vkedco.blogspot.com
    • Android Root/add-ons ● /add-ons - 3rd party releases of Android; add-ons may require some licensing agreement (make sure you understand licensing before adopting an add-on) ● The most important sub-directories of an add-on are: – /images – system image files for Android devices – /libs – JAR files you need to include in your projects – /skins – available looks for Android devices – /samples – if present, contains sample projects with source codewww.youtube.com/vkedco www.vkedco.blogspot.com
    • Android Root/platforms ● /platforms – specific platforms installed on your system (e.g., android-8, android-10, etc) ● Each platform directory will have, at least, the sub-directories: /data, /images, & /skins – /data – various resources (e.g., fonts, icons, etc) – /skins – looks of devices – /images – file system imageswww.youtube.com/vkedco www.vkedco.blogspot.com
    • Android Root/samples & /platform-tools ● /samples – sample projects for specific platforms ● /samples are a great way to learn Android development tricks (many of them are not well documented: you build them, run them, & study the source, modify it, etc) ● /platform-tools are applications and libraries you need for Android development – aapt (Android Asset Packaging Tool) – adb (Android Debug Bridge) – aidl (Android Interface Definition Language compiler)www.youtube.com/vkedco www.vkedco.blogspot.com
    • Android Root/sources ● /sources – source code from various companies and organizations ● /tools are applications and libraries you need for running and debugging Android apps – emulator – ddms (Dalvik Debug Monitor Server) – apkbuilder (APK stands for Android Package File; APK is a file format for Android application distribution; it is actually - ZIP) – hierarchyviewer (UI debugging and opitmization tool)www.youtube.com/vkedco www.vkedco.blogspot.com
    • Tool Access & Versions ● Android Plugins for Eclipse make most tools available from within IDE ● If you are a command line developer, think of adding /platform-tools and /tools to your PATH ● Android APIs tend to be backward compatible (modulo hardware restrictions) but some APIs do get depricated: you have to stay current on what is current on your target Android platformwww.youtube.com/vkedco www.vkedco.blogspot.com
    • Greeting & Toasting Gingerbread (Android 2.3.X) & Jelly Bean (Android 4.2) download source HelloGingerbread, HelloJellyBeanwww.youtube.com/vkedco www.vkedco.blogspot.com
    • Hello to & Toast on Gingerbreadwww.youtube.com/vkedco www.vkedco.blogspot.com
    • Hello to & Toast on Jelly Beanwww.youtube.com/vkedco www.vkedco.blogspot.com
    • Android App Anatomywww.youtube.com/vkedco www.vkedco.blogspot.com
    • Android App/AndroidManifest.xml ● AndroidManifest.xml is the glue that specifies & holds your app together (conceptually similar to Unix/Linux make files) ● Specifies your apps package, minimum & target SDK versions, your application and activities inside your applicationwww.youtube.com/vkedco www.vkedco.blogspot.com
    • Android App/src ● /src folder contains all your Java source code (packages & classes) ● Initial Activity class with two methods onCreate() and onCreateOptionsMenu() is auto-generatedwww.youtube.com/vkedco www.vkedco.blogspot.com
    • Android App/gen ● /gen folder contains all auto-generated Java source ● You should not modify it ● R.java is a very important class that defines constants that you need to programmatically access various elements of your applicationwww.youtube.com/vkedco www.vkedco.blogspot.com
    • Android App/assets, /bin, /libs, /res ● /assets - arbitraty user created files or file hierarchies not available through R.java ● /bin - .dex (Dalvik byte code), .apk and drawables ● /libs JARs for required by the app ● /res – XML and drawable resources available through R.javawww.youtube.com/vkedco www.vkedco.blogspot.com
    • Android App/res ● /res folder contains XML resources and drawables of various resolutions required for your app ● /res/drawable-xxxx - drawables of various resolutions ● /res/layout - XML UI specs for activities ● /res/menu – XML menu specs for activities ● /res/values – XML definitions of string constants and styleswww.youtube.com/vkedco www.vkedco.blogspot.com
    • Android App Development Processwww.youtube.com/vkedco www.vkedco.blogspot.com
    • Building & Running Stepswww.youtube.com/vkedco www.vkedco.blogspot.com
    • Building & Running Apps ● Eclipse ADT plugin builds your app incrementally as you make changes to it (check Project | Build Automatically menu option) ● The .apk file is saved in the /bin folder ● It is possible to develop in non-Eclipse environments: you can use the generated build.xml Ant file in the project directory ● The app must be signed (debug or release mode) to run on an AVD or a device ● Eclipse ADT automatically signs your app in debug modewww.youtube.com/vkedco www.vkedco.blogspot.com
    • Building & Signing Apps Building Apps Signing Appswww.youtube.com/vkedco www.vkedco.blogspot.com
    • Research References ● ● Kulyukin, V., Kutiyanawala, A., Zaman, T. “Eyes-Free Barcode Detection with Niblacks Binarization & Support Vector Machines.” ● Kulyukin, V. & Kutiyanawala, A. “Eyes-Free Barcode Detection & Decoding for Visually Impaired Mobile Phone Users.” ● Kulyukin, V. “Toward Comprehensive Smartphones: Shopping Solutions.”www.youtube.com/vkedco www.vkedco.blogspot.com
    • Development References ● http://developer.android.com/reference/packages.html ● developer.android.com/tools/building/index.html ● http://www.youtube.com/vkedcowww.youtube.com/vkedco www.vkedco.blogspot.com
    • FeedbackBugs to vladimir dot kulyukin at gmail dot com