- Machine Learning for OpenCV
- Michael Beyeler
- 126字
- 2021-07-02 19:47:16
Getting a glimpse of OpenCV's ML module
Starting with OpenCV 3.1, all machine learning-related functions in OpenCV have been grouped into the ml module. This has been the case for the C++ API for quite some time. You can get a glimpse of what's to come by displaying all functions in the ml module:
In [4]: dir(cv2.ml)
Out[4]: ['ANN_MLP_BACKPROP',
'ANN_MLP_GAUSSIAN',
'ANN_MLP_IDENTITY',
'ANN_MLP_NO_INPUT_SCALE',
'ANN_MLP_NO_OUTPUT_SCALE',
...
'__spec__']
If you have installed an older version of OpenCV, the ml module might not be present. For example, the k-nearest neighbor algorithm (which we will talk about in Chapter 3, First Steps in Supervised Learning) used to be called cv2.KNearest() but is now called cv2.ml.KNearest_create(). In order to avoid confusion throughout the book, I therefore recommend using at least OpenCV 3.1.
推薦閱讀
- Data Visualization with D3 4.x Cookbook(Second Edition)
- The DevOps 2.3 Toolkit
- 國際大學生程序設計競賽中山大學內(nèi)部選拔真題解(二)
- Java異步編程實戰(zhàn)
- Android Application Development Cookbook(Second Edition)
- Bulma必知必會
- 學Python也可以這么有趣
- Learning OpenStack Networking(Neutron)
- 西門子S7-200 SMART PLC編程從入門到實踐
- C編程技巧:117個問題解決方案示例
- 大話代碼架構(gòu):項目實戰(zhàn)版
- Java服務端研發(fā)知識圖譜
- 用Go語言自制編譯器
- Office VBA開發(fā)經(jīng)典:中級進階卷
- jQuery基礎(chǔ)教程(第4版)