SlideShare a Scribd company logo
1 of 14
©SIProp Project, 2006-2008 1
Supporting OpenCV 3.0 for
Noritsuna Imamura
noritsuna@siprop.org
"Mastering OpenCV Android
Application Programming"
©SIProp Project, 2006-2008 2
What’s this?
"Mastering OpenCV Android Application
Programming" is one of programming book.
Published Site:
https://www.packtpub.com/application-
development/mastering-opencv-android-application-
programming
I explain:
How to Rewrite the sample
source codes to OpenCV 3.0
Additions of New Features on
OpenCV 3.0
©SIProp Project, 2006-2008 3
All Chapters
Transition Guide for OpenCV 3.0
http://docs.opencv.org/master/db/dfa/tutorial_transi
tion_guide.html
OpenCV Version for Loarder
OLD:
OpenCVLoader.initAsync(OpenCVLoader.OPENCV_VERSIO
N_2_4_10, this, mLoaderCallback);
NEW:
OpenCVLoader.initAsync(OpenCVLoader.OPENCV_VERSIO
N_3_0_0, this, mLoaderCallback)
©SIProp Project, 2006-2008 4
Chapter 1
Add THRESH_TRIANGLE to threshold options.
THRESH_TRIANGLE:
Use Triangle algorithm to choose the optimal threshold value
©SIProp Project, 2006-2008 5
Chapter 2
"Core" class to "Imgproc" class
Old:
Core.circle(corners, new Point(i, j), 5, new
Scalar(r.nextInt(255)), 2);
Core.line(houghLines, pt1, pt2, new Scalar(255, 0, 0), 1);
Core.circle(houghCircles,center,r, new Scalar(255,0,0),1);
Core.rectangle(people, facesArray[i].tl(), facesArray[i].br(),
new Scalar(100), 3);
New:
Imgproc.circle(corners, new Point(i, j), 5, new
Scalar(r.nextInt(255)), 2);
Imgproc.line(houghLines, pt1, pt2, new Scalar(255, 0, 0), 1);
Imgproc.circle(houghCircles,center,r, new Scalar(255,0,0),1);
Imgproc.rectangle(people, facesArray[i].tl(), facesArray[i].br(),
new Scalar(100), 3);
©SIProp Project, 2006-2008 6
Chapter 3
Add "AKAZE(Accelerated KAZE)" algorithm in
FeatureDetector & DescriptorExtractor.
"AKAZE" algorithm
http://docs.opencv.org/3.0-
beta/modules/features2d/doc/feature_detection_and_descri
ption.html#akaze
©SIProp Project, 2006-2008 7
Chapter 4
"Core" class to "Imgproc" class
Old:
Core.rectangle(mRgba, facesArray[i].tl(), facesArray[i].br(),
new Scalar(100), 3);
New:
Imgproc.rectangle(mRgba, facesArray[i].tl(), facesArray[i].br(),
new Scalar(100), 3);
Removed "NativeCameraView" class in OpenCV
3.0
OpenCV 3.0 has "JavaCameraView" only.
©SIProp Project, 2006-2008 8
Chapter 5
"Core" class to "Imgproc" class
Old:
Core.line(mGray, prevList.get(i), nextList.get(i), color);
Core.circle(mGray, p, 5, new Scalar(255));
New:
Imgproc.line(mGray, prevList.get(i), nextList.get(i), color);
Imgproc.circle(mGray, p, 5, new Scalar(255));
©SIProp Project, 2006-2008 9
Chapter 6
Change Include file dir
Old:
#include "opencv2/imgproc/imgproc.hpp"
#include "opencv2/highgui/highgui.hpp"
#include <opencv2/stitching/stitcher.hpp>
New:
#include "opencv2/imgproc.hpp"
#include "opencv2/highgui.hpp"
#include <opencv2/stitching.hpp>
Supporting ARM 64bits in Application.mk
Old:
APP_ABI := armeabi-v7a
New:
APP_ABI := armeabi-v7a arm64-v8a
©SIProp Project, 2006-2008 10
Chapter 7 1/5
"Core" class to "Imgproc" class
Old:
Core.rectangle(temp, new Point(temp.cols()/2 - 200,
temp.rows() / 2 - 200), new Point(temp.cols() / 2 + 200,
temp.rows() / 2 + 200), new Scalar(255,255,255),1);
New:
Imgproc.rectangle(temp, new Point(temp.cols()/2 - 200,
temp.rows() / 2 - 200), new Point(temp.cols() / 2 + 200,
temp.rows() / 2 + 200), new Scalar(255,255,255),1);
"ML" Package is modified.
Old Name Rule:
org.opencv.ml.CvXXX
org.opencv.ml.CvXXXPrames
©SIProp Project, 2006-2008 11
Chapter 7 2/5
Main class & Parameter class are separated.
New Name Rule:
org.opencv.ml.XXX
Main class & Parameter class are combined.
Ex.
CvKNearest -> KNearest
CvSVM -> SVM
©SIProp Project, 2006-2008 12
Chapter 7 3/5
Constructor is removed, change to create()
static method.
Old:
new KNearest();
new CvSVM();
New:
KNearest.create();
SVM.create();
©SIProp Project, 2006-2008 13
Chapter 7 4/5
arguments of "train()" method is changed.
Old:
knn.train(training_images, training_labels, new Mat(), false, 10,
false);
svm.train(training_images, training_labels);
New:
knn.train(training_images, Ml.ROW_SAMPLE, training_labels);
svm.train(training_images, Ml.ROW_SAMPLE, training_labels);
60k data is too big for SVM. Please modify the
small data.
Ex.
total_images = temp.getInt(); -> total_images = 100;
©SIProp Project, 2006-2008 14
Chapter 7 5/5
"KNearest.find_nearest()" method is changed
the new name.
Old:
knn.find_nearest(test, 10, results, new Mat(), new Mat());
New:
knn.findNearest(test, 10, results);

More Related Content

More from Industrial Technology Research Institute (ITRI)(工業技術研究院, 工研院)

More from Industrial Technology Research Institute (ITRI)(工業技術研究院, 工研院) (20)

What is the world where you can make your own semiconductors?
What is the world where you can make your own semiconductors?What is the world where you can make your own semiconductors?
What is the world where you can make your own semiconductors?
 
半導体製造(TinyTapeout)に挑戦しよう!
半導体製造(TinyTapeout)に挑戦しよう!半導体製造(TinyTapeout)に挑戦しよう!
半導体製造(TinyTapeout)に挑戦しよう!
 
Introduction of ISHI-KAI with OpenMPW
Introduction of ISHI-KAI with OpenMPWIntroduction of ISHI-KAI with OpenMPW
Introduction of ISHI-KAI with OpenMPW
 
Kernel/VMレイヤーを自分色に染める!By ISHI会
Kernel/VMレイヤーを自分色に染める!By ISHI会Kernel/VMレイヤーを自分色に染める!By ISHI会
Kernel/VMレイヤーを自分色に染める!By ISHI会
 
Principle Representation of The 8 Qubits Quantum Computer by RaspberryPi
Principle Representation of The 8 Qubits Quantum Computer by RaspberryPiPrinciple Representation of The 8 Qubits Quantum Computer by RaspberryPi
Principle Representation of The 8 Qubits Quantum Computer by RaspberryPi
 
Microwaveguquantum
MicrowaveguquantumMicrowaveguquantum
Microwaveguquantum
 
The easiest way of setup QuTiP on Windows
The easiest way of setup QuTiP on WindowsThe easiest way of setup QuTiP on Windows
The easiest way of setup QuTiP on Windows
 
GNU Radio Study for Super beginner
GNU Radio Study for Super beginnerGNU Radio Study for Super beginner
GNU Radio Study for Super beginner
 
The Self-Contained SDR Satellite Grand Station with Raspberry Pi 3
The Self-Contained SDR Satellite Grand Station with Raspberry Pi 3The Self-Contained SDR Satellite Grand Station with Raspberry Pi 3
The Self-Contained SDR Satellite Grand Station with Raspberry Pi 3
 
Self‐Contained SDR Grand Station with Raspberry Pi 3
Self‐Contained SDR Grand Station with Raspberry Pi 3Self‐Contained SDR Grand Station with Raspberry Pi 3
Self‐Contained SDR Grand Station with Raspberry Pi 3
 
衛星追尾用パラボラアンテナ建設記
衛星追尾用パラボラアンテナ建設記衛星追尾用パラボラアンテナ建設記
衛星追尾用パラボラアンテナ建設記
 
Zedroid - Android (5.0 and later) on Zedboard
Zedroid - Android (5.0 and later) on ZedboardZedroid - Android (5.0 and later) on Zedboard
Zedroid - Android (5.0 and later) on Zedboard
 
How to Build & Use OpenCL on OpenCV & Android NDK
How to Build & Use OpenCL on OpenCV & Android NDKHow to Build & Use OpenCL on OpenCV & Android NDK
How to Build & Use OpenCL on OpenCV & Android NDK
 
3D Printed Google Cardboard for workshop
3D Printed Google Cardboard for workshop3D Printed Google Cardboard for workshop
3D Printed Google Cardboard for workshop
 
計算機(物理)
計算機(物理)計算機(物理)
計算機(物理)
 
Resume
ResumeResume
Resume
 
How to Make a Scanning Drone in Chinese
How to Make a Scanning Drone in ChineseHow to Make a Scanning Drone in Chinese
How to Make a Scanning Drone in Chinese
 
How to Use OpenMP on Native Activity
How to Use OpenMP on Native ActivityHow to Use OpenMP on Native Activity
How to Use OpenMP on Native Activity
 
How to Use OpenGL/ES on Native Activity
How to Use OpenGL/ES on Native ActivityHow to Use OpenGL/ES on Native Activity
How to Use OpenGL/ES on Native Activity
 
How to Make Hand Detector on Native Activity with OpenCV
How to Make Hand Detector on Native Activity with OpenCVHow to Make Hand Detector on Native Activity with OpenCV
How to Make Hand Detector on Native Activity with OpenCV
 

Recently uploaded

Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
WSO2
 

Recently uploaded (20)

Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot ModelMcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
 
Platformless Horizons for Digital Adaptability
Platformless Horizons for Digital AdaptabilityPlatformless Horizons for Digital Adaptability
Platformless Horizons for Digital Adaptability
 
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptx
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challenges
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
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
 
CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In PakistanCNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistan
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 

Supporting OpenCV 3.0 for "Mastering OpenCV Android Application Programming"

  • 1. ©SIProp Project, 2006-2008 1 Supporting OpenCV 3.0 for Noritsuna Imamura noritsuna@siprop.org "Mastering OpenCV Android Application Programming"
  • 2. ©SIProp Project, 2006-2008 2 What’s this? "Mastering OpenCV Android Application Programming" is one of programming book. Published Site: https://www.packtpub.com/application- development/mastering-opencv-android-application- programming I explain: How to Rewrite the sample source codes to OpenCV 3.0 Additions of New Features on OpenCV 3.0
  • 3. ©SIProp Project, 2006-2008 3 All Chapters Transition Guide for OpenCV 3.0 http://docs.opencv.org/master/db/dfa/tutorial_transi tion_guide.html OpenCV Version for Loarder OLD: OpenCVLoader.initAsync(OpenCVLoader.OPENCV_VERSIO N_2_4_10, this, mLoaderCallback); NEW: OpenCVLoader.initAsync(OpenCVLoader.OPENCV_VERSIO N_3_0_0, this, mLoaderCallback)
  • 4. ©SIProp Project, 2006-2008 4 Chapter 1 Add THRESH_TRIANGLE to threshold options. THRESH_TRIANGLE: Use Triangle algorithm to choose the optimal threshold value
  • 5. ©SIProp Project, 2006-2008 5 Chapter 2 "Core" class to "Imgproc" class Old: Core.circle(corners, new Point(i, j), 5, new Scalar(r.nextInt(255)), 2); Core.line(houghLines, pt1, pt2, new Scalar(255, 0, 0), 1); Core.circle(houghCircles,center,r, new Scalar(255,0,0),1); Core.rectangle(people, facesArray[i].tl(), facesArray[i].br(), new Scalar(100), 3); New: Imgproc.circle(corners, new Point(i, j), 5, new Scalar(r.nextInt(255)), 2); Imgproc.line(houghLines, pt1, pt2, new Scalar(255, 0, 0), 1); Imgproc.circle(houghCircles,center,r, new Scalar(255,0,0),1); Imgproc.rectangle(people, facesArray[i].tl(), facesArray[i].br(), new Scalar(100), 3);
  • 6. ©SIProp Project, 2006-2008 6 Chapter 3 Add "AKAZE(Accelerated KAZE)" algorithm in FeatureDetector & DescriptorExtractor. "AKAZE" algorithm http://docs.opencv.org/3.0- beta/modules/features2d/doc/feature_detection_and_descri ption.html#akaze
  • 7. ©SIProp Project, 2006-2008 7 Chapter 4 "Core" class to "Imgproc" class Old: Core.rectangle(mRgba, facesArray[i].tl(), facesArray[i].br(), new Scalar(100), 3); New: Imgproc.rectangle(mRgba, facesArray[i].tl(), facesArray[i].br(), new Scalar(100), 3); Removed "NativeCameraView" class in OpenCV 3.0 OpenCV 3.0 has "JavaCameraView" only.
  • 8. ©SIProp Project, 2006-2008 8 Chapter 5 "Core" class to "Imgproc" class Old: Core.line(mGray, prevList.get(i), nextList.get(i), color); Core.circle(mGray, p, 5, new Scalar(255)); New: Imgproc.line(mGray, prevList.get(i), nextList.get(i), color); Imgproc.circle(mGray, p, 5, new Scalar(255));
  • 9. ©SIProp Project, 2006-2008 9 Chapter 6 Change Include file dir Old: #include "opencv2/imgproc/imgproc.hpp" #include "opencv2/highgui/highgui.hpp" #include <opencv2/stitching/stitcher.hpp> New: #include "opencv2/imgproc.hpp" #include "opencv2/highgui.hpp" #include <opencv2/stitching.hpp> Supporting ARM 64bits in Application.mk Old: APP_ABI := armeabi-v7a New: APP_ABI := armeabi-v7a arm64-v8a
  • 10. ©SIProp Project, 2006-2008 10 Chapter 7 1/5 "Core" class to "Imgproc" class Old: Core.rectangle(temp, new Point(temp.cols()/2 - 200, temp.rows() / 2 - 200), new Point(temp.cols() / 2 + 200, temp.rows() / 2 + 200), new Scalar(255,255,255),1); New: Imgproc.rectangle(temp, new Point(temp.cols()/2 - 200, temp.rows() / 2 - 200), new Point(temp.cols() / 2 + 200, temp.rows() / 2 + 200), new Scalar(255,255,255),1); "ML" Package is modified. Old Name Rule: org.opencv.ml.CvXXX org.opencv.ml.CvXXXPrames
  • 11. ©SIProp Project, 2006-2008 11 Chapter 7 2/5 Main class & Parameter class are separated. New Name Rule: org.opencv.ml.XXX Main class & Parameter class are combined. Ex. CvKNearest -> KNearest CvSVM -> SVM
  • 12. ©SIProp Project, 2006-2008 12 Chapter 7 3/5 Constructor is removed, change to create() static method. Old: new KNearest(); new CvSVM(); New: KNearest.create(); SVM.create();
  • 13. ©SIProp Project, 2006-2008 13 Chapter 7 4/5 arguments of "train()" method is changed. Old: knn.train(training_images, training_labels, new Mat(), false, 10, false); svm.train(training_images, training_labels); New: knn.train(training_images, Ml.ROW_SAMPLE, training_labels); svm.train(training_images, Ml.ROW_SAMPLE, training_labels); 60k data is too big for SVM. Please modify the small data. Ex. total_images = temp.getInt(); -> total_images = 100;
  • 14. ©SIProp Project, 2006-2008 14 Chapter 7 5/5 "KNearest.find_nearest()" method is changed the new name. Old: knn.find_nearest(test, 10, results, new Mat(), new Mat()); New: knn.findNearest(test, 10, results);