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

Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsJoaquim Jorge
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobeapidays
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdflior mazor
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
Developing An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilDeveloping An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilV3cube
 
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 2024The Digital Insurer
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024The Digital Insurer
 
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 WorkerThousandEyes
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slidevu2urc
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?Igalia
 
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 educationjfdjdjcjdnsjd
 
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 WorkerThousandEyes
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...apidays
 
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 Scriptwesley chun
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUK Journal
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Enterprise Knowledge
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...DianaGray10
 

Recently uploaded (20)

Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
Developing An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilDeveloping An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of Brazil
 
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
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
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
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
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
 
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
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
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
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 

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);