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

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.
主站蜘蛛池模板: 胶州市| 安吉县| 绍兴县| 张家口市| 鹰潭市| 长海县| 阿图什市| 乌苏市| 盐源县| 桦川县| 湘乡市| 磴口县| 贵州省| 胶州市| 荔波县| 平罗县| 建阳市| 布拖县| 阜平县| 蒙城县| 普兰县| 老河口市| 通道| 明溪县| 长汀县| 奉节县| 昌江| 绥江县| 且末县| 新闻| 泰和县| 寿宁县| 光泽县| 利川市| 河南省| 卢氏县| 固原市| 湘阴县| 闸北区| 延寿县| 长白|