MobiCom on Android         Barcode Processing, Detection, & Localization           Navigating Your Android Installation   ...
Outline   ●       Research         – Barcode Processing         – Barcode Detection         – Barcode Localization   ●    ...
Researchwww.youtube.com/vkedco         www.vkedco.blogspot.com
Definitions   ●       Barcode Detection – decision procedure that       detects the presence or absence of a barcode in   ...
Domain Constraints   ●       Constraint 1 – We are interested in finding       barcodes on product surfaces (boxes, bags, ...
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 RG...
Grayscale Formula                    C        Given P = (R, G, B), the        corresponding grayscale value is         Y  ...
Image Binarization  ●      Let G be a grayscale image, B a binarized image,      Threshold is a real number, and Threshold...
Local vs Global Tradeoffs  ●      Global binarization          – Pro: simple & efficient because the value of a           ...
Niblacks Binarization    Let m(x, y) and s(x, y) be the mean and    standard deviation values for an n x n    window cente...
Modified Niblacks Binarization  ●      It may be expensive to compute Niblacks      thresholds for large images and large ...
Modified Niblacks Binarization  ●      Let m(i, j) and s(i, j) be the mean and the      standard deviation for the subimag...
Modified Niblacks Binarization Formulas  Original Threshold  Modified Thresholdwww.youtube.com/vkedco   www.vkedco.blogspo...
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                 ...
Image Regions & Gradients  ●      A product surface has four distinct image regions: 1)      Barcode, 2) Background, 3) Te...
Image Regions & Gradients: Example                         Gradients                           →www.youtube.com/vkedco    ...
Computation of Image Gradients  ●      Let B be a binarized image divided into n x n      subimages Bi,j  ●      Let the t...
Subimage Classification   ●       If a subimage contains a barcode only one of       the gradient values will likely be hi...
Subimage Classification with SVMs  ●      A Support Vector Machine (SVM) is a linear      classifier that can classify lin...
Subimage Classification with SVMs  ●      One hundred images were manually collected      and divided into two classes:   ...
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 i...
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 ...
Android Root/add-ons    ●        /add-ons - 3rd party releases of Android; add-ons may        require some licensing agree...
Android Root/platforms   ●       /platforms – specific platforms installed on your       system (e.g., android-8, android-...
Android Root/samples & /platform-tools   ●       /samples – sample projects for specific platforms   ●       /samples are ...
Android Root/sources   ●       /sources – source code from various companies and       organizations   ●       /tools are ...
Tool Access & Versions   ●       Android Plugins for Eclipse make most tools       available from within IDE   ●       If ...
Greeting & Toasting          Gingerbread (Android 2.3.X)                       &            Jelly Bean (Android 4.2)      ...
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.xm...
Android App/src                            ●                                /src folder contains all                      ...
Android App/gen                            ●                                /gen folder contains all                      ...
Android App/assets, /bin, /libs, /res                         ●                             /assets - arbitraty user creat...
Android App/res                    ●                        /res folder contains XML resources and                        ...
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 ...
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 Niblac...
Development References   ●       http://developer.android.com/reference/packages.html   ●       developer.android.com/tool...
FeedbackBugs to vladimir dot kulyukin at gmail dot com
Upcoming SlideShare
Loading in …5
×

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

704
-1

Published on

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

Published in: Software
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total Views
704
On Slideshare
0
From Embeds
0
Number of Embeds
14
Actions
Shares
0
Downloads
0
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

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

  1. 1. 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
  2. 2. 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
  3. 3. Researchwww.youtube.com/vkedco www.vkedco.blogspot.com
  4. 4. 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
  5. 5. 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
  6. 6. Barcode Processing Overviewwww.youtube.com/vkedco www.vkedco.blogspot.com
  7. 7. Barcode Detectionwww.youtube.com/vkedco www.vkedco.blogspot.com
  8. 8. Barcode Detection Overviewwww.youtube.com/vkedco www.vkedco.blogspot.com
  9. 9. 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
  10. 10. 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
  11. 11. 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
  12. 12. 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
  13. 13. 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
  14. 14. 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
  15. 15. 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
  16. 16. Modified Niblacks Binarization Formulas Original Threshold Modified Thresholdwww.youtube.com/vkedco www.vkedco.blogspot.com
  17. 17. Original vs Modified Thresholds: Examplewww.youtube.com/vkedco www.vkedco.blogspot.com
  18. 18. 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
  19. 19. 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
  20. 20. Image Regions & Gradients: Example Gradients →www.youtube.com/vkedco www.vkedco.blogspot.com
  21. 21. 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
  22. 22. 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
  23. 23. 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
  24. 24. 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
  25. 25. Subimage Classification with Support Vector Machineswww.youtube.com/vkedco www.vkedco.blogspot.com
  26. 26. Barcode Localizationwww.youtube.com/vkedco www.vkedco.blogspot.com
  27. 27. 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
  28. 28. Application of Line Filterswww.youtube.com/vkedco www.vkedco.blogspot.com
  29. 29. Developmentwww.youtube.com/vkedco www.vkedco.blogspot.com
  30. 30. Navigation Android Installationwww.youtube.com/vkedco www.vkedco.blogspot.com
  31. 31. 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
  32. 32. 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
  33. 33. 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
  34. 34. 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
  35. 35. 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
  36. 36. 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
  37. 37. Greeting & Toasting Gingerbread (Android 2.3.X) & Jelly Bean (Android 4.2) download source HelloGingerbread, HelloJellyBeanwww.youtube.com/vkedco www.vkedco.blogspot.com
  38. 38. Hello to & Toast on Gingerbreadwww.youtube.com/vkedco www.vkedco.blogspot.com
  39. 39. Hello to & Toast on Jelly Beanwww.youtube.com/vkedco www.vkedco.blogspot.com
  40. 40. Android App Anatomywww.youtube.com/vkedco www.vkedco.blogspot.com
  41. 41. 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
  42. 42. 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
  43. 43. 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
  44. 44. 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
  45. 45. 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
  46. 46. Android App Development Processwww.youtube.com/vkedco www.vkedco.blogspot.com
  47. 47. Building & Running Stepswww.youtube.com/vkedco www.vkedco.blogspot.com
  48. 48. 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
  49. 49. Building & Signing Apps Building Apps Signing Appswww.youtube.com/vkedco www.vkedco.blogspot.com
  50. 50. 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
  51. 51. 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
  52. 52. FeedbackBugs to vladimir dot kulyukin at gmail dot com

×