OpenCV on Android

7,198 views

Published on

Presented at GDG Singapore DevFest 2013 on 12/10/2013, by Badrinath Kulkarni, GDG Bangalore.

This talk mainly gives an introduction to basic image processing concepts and how the same can be implemented in Android apps using OpenCv framework.

Published in: Technology, Education
0 Comments
9 Likes
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total views
7,198
On SlideShare
0
From Embeds
0
Number of Embeds
2,633
Actions
Shares
0
Downloads
108
Comments
0
Likes
9
Embeds 0
No embeds

No notes for slide

OpenCV on Android

  1. 1. OpenCv & Android Working with images Badrinath Kulkarni GDG Bangalore
  2. 2. What is OpenCv ? Open Source Computer Vision Library OpenCV is an open source computer vision and machine learning software library. Windows, Linux/Mac, Android, IOS Current version 2.4.6
  3. 3. Using in Android
  4. 4. Installation 1/3 Download OpenCv from SourceForge. Currently it’s OpenCV-2.4.6-android-sdk.zip
  5. 5. Installation 2/3 Import OpenCV library and samples to the Eclipse. • Library • Samples Android NDK must be installed & configured.
  6. 6. OpenCv Manager • Published on Google Play • Compact apk-size • Hardware specific optimizations • Automatic updates
  7. 7. Sudoku App
  8. 8. Pre - processing Java Imgproc.medianBlur(src, dst, 3); input.jpg median_3x3.jpg
  9. 9. Registration Registration is the determination of a geometrical transformation that aligns points in one view of an object with corresponding points in another view of that Object. input.jpg registered_image.jpg | size : 640X640
  10. 10. Step 1/4 : Detect horizontal lines Java Imgproc.Sobel(src, dst, ddepth, dx, dy, ksize, scale, delta); medin_3x3.jpg sobel_horizontal.jpg sobel_horizontal_binarized.jpg
  11. 11. Step 2/4 : Detect vertical lines Java Imgproc.Sobel(src, dst, ddepth, dx, dy, ksize, scale, delta); medin_3x3.jpg sobel_vertical.jpg sobel_vertical_binarized.jpg
  12. 12. Step 3/4 : Detect corner points Imgporc.HoughLinesP(); Detect periphery lines Imgporc.HoughLinesP(); Java Imgproc.HoughLinesP(image, lines, rho, theta, threshold, minLineLength, maxLineGap);
  13. 13. Step 4/4 : Homography Java Mat transformM = Calib3d.findHomography(srcPts, dstPts); src points : intersection points dst points : (1,1) (1,640) (640,1) (640,640) median_3x3.jpg registered_image.jpg | size : 640X640 Java Imgproc.warpPerspective(src, dst, transformM, dsize);
  14. 14. Thresholding Java Imgproc.adaptiveThreshold(src, dst, maxValue, adaptiveMethod, thresholdType, blockSize, delta); registered_image.jpg threshold_image.jpg
  15. 15. Number detection 1/2 Remove unwanted lines. threshold_image.jpg data_image.jpg
  16. 16. Number detection 2/2 NCC ~ 1 Java Imgproc.findContours(image, contours, hierarchy, mode, method); Imgproc.boundingRect(contourPoints); Imgproc.resize(src, dst, dsize);
  17. 17. Final output The extracted matrix can be given to any Sudoku solver engine and the solved output can be shown to the user. 5 6 5 6 2 7 3 1 1 6 8 4 5 7 3 6 2 6 1 4 9 8 9 9 9X9 matrix with data from the image
  18. 18. Thank You! badrinath@gtugs.org http://ibadrinath.in @ibadrinath

×