SlideShare ist ein Scribd-Unternehmen logo
1 von 19
Downloaden Sie, um offline zu lesen
OpenCv & Android
Working with images

Badrinath Kulkarni
GDG Bangalore
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
Using in Android
Installation 1/3
Download OpenCv from SourceForge. Currently it’s OpenCV-2.4.6-android-sdk.zip
Installation 2/3
Import OpenCV library and samples to
the Eclipse.

‱ Library
‱ Samples

Android NDK must be
installed & configured.
OpenCv Manager
‱ Published on
Google Play
‱ Compact apk-size
‱ Hardware specific
optimizations
‱ Automatic updates
Sudoku App
Pre - processing
Java

Imgproc.medianBlur(src, dst, 3);

input.jpg

median_3x3.jpg
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
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
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
Step 3/4 : Detect corner points

Imgporc.HoughLinesP();

Detect periphery lines

Imgporc.HoughLinesP();

Java

Imgproc.HoughLinesP(image, lines, rho, theta, threshold,
minLineLength, maxLineGap);
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);
Thresholding
Java

Imgproc.adaptiveThreshold(src, dst, maxValue, adaptiveMethod, thresholdType, blockSize, delta);

registered_image.jpg

threshold_image.jpg
Number detection 1/2
Remove unwanted lines.

threshold_image.jpg

data_image.jpg
Number detection 2/2

NCC ~ 1

Java

Imgproc.findContours(image, contours, hierarchy, mode, method);
Imgproc.boundingRect(contourPoints);
Imgproc.resize(src, dst, dsize);
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
Thank You!

badrinath@gtugs.org

http://ibadrinath.in
@ibadrinath

Weitere Àhnliche Inhalte

KĂŒrzlich hochgeladen

+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
?#DUbAI#??##{{(☎+971_581248768%)**%*]'#abortion pills for sale in dubai@
 

KĂŒrzlich hochgeladen (20)

MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectors
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
Ransomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdfRansomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdf
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
 
AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 

Empfohlen

How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental Health
ThinkNow
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
Kurio // The Social Media Age(ncy)
 

Empfohlen (20)

2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot
 
Everything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPTEverything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPT
 
Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsProduct Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage Engineerings
 
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental Health
 
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
 
Skeleton Culture Code
Skeleton Culture CodeSkeleton Culture Code
Skeleton Culture Code
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
 
How to have difficult conversations
How to have difficult conversations How to have difficult conversations
How to have difficult conversations
 
Introduction to Data Science
Introduction to Data ScienceIntroduction to Data Science
Introduction to Data Science
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best Practices
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project management
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
 

OpenCV on Android

  • 1. OpenCv & Android Working with images Badrinath Kulkarni GDG Bangalore
  • 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.
  • 5. Installation 1/3 Download OpenCv from SourceForge. Currently it’s OpenCV-2.4.6-android-sdk.zip
  • 6. Installation 2/3 Import OpenCV library and samples to the Eclipse. ‱ Library ‱ Samples Android NDK must be installed & configured.
  • 7. OpenCv Manager ‱ Published on Google Play ‱ Compact apk-size ‱ Hardware specific optimizations ‱ Automatic updates
  • 9. Pre - processing Java Imgproc.medianBlur(src, dst, 3); input.jpg median_3x3.jpg
  • 10. 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
  • 11. 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
  • 12. 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
  • 13. Step 3/4 : Detect corner points Imgporc.HoughLinesP(); Detect periphery lines Imgporc.HoughLinesP(); Java Imgproc.HoughLinesP(image, lines, rho, theta, threshold, minLineLength, maxLineGap);
  • 14. 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);
  • 15. Thresholding Java Imgproc.adaptiveThreshold(src, dst, maxValue, adaptiveMethod, thresholdType, blockSize, delta); registered_image.jpg threshold_image.jpg
  • 16. Number detection 1/2 Remove unwanted lines. threshold_image.jpg data_image.jpg
  • 17. Number detection 2/2 NCC ~ 1 Java Imgproc.findContours(image, contours, hierarchy, mode, method); Imgproc.boundingRect(contourPoints); Imgproc.resize(src, dst, dsize);
  • 18. 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