官术网_书友最值得收藏!

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.
主站蜘蛛池模板: 会昌县| 屯门区| 榕江县| 汤原县| 栖霞市| 九台市| 呼玛县| 泸州市| 泰和县| 秀山| 望谟县| 宣恩县| 西华县| 城市| 安吉县| 社会| 许昌市| 左权县| 马尔康县| 合肥市| 布拖县| 曲周县| 富顺县| 牙克石市| 安康市| 海门市| 永福县| 清原| 如东县| 商丘市| 西和县| 玉树县| 阿坝| 织金县| 资源县| 滨海县| 论坛| 稷山县| 彰化市| 景东| 曲松县|