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

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.
主站蜘蛛池模板: 金寨县| 布尔津县| 得荣县| 阿拉善左旗| 宿州市| 沈阳市| 综艺| 汝南县| 黎城县| 凤凰县| 乌兰浩特市| 南部县| 宿州市| 大荔县| 大余县| 隆林| 漯河市| 塘沽区| 武冈市| 深水埗区| 黔江区| 准格尔旗| 南丹县| 内丘县| 永城市| 上思县| 察哈| 晋城| 云林县| 凉山| 栾城县| 阜平县| 习水县| 夏津县| 桓台县| 文昌市| 吉隆县| 双柏县| 陕西省| 芷江| 郴州市|