QBoard » Artificial Intelligence & ML » AI and ML - Python » OpenCV 2.2 python bindings for machine learning part

OpenCV 2.2 python bindings for machine learning part

  • I'm interesting in getting the connection from Python to machine learning part of OpenCV 2.2. OpenCV 2.2 already includes python bindings but only to the computer vision (cv) part of it and not to the machine learning (ml) part.

    Where could I get some third party bindings to also have access to the machine learning part

      September 29, 2021 2:46 PM IST
    0
  • The pyopencv project is early in development, but provides access to most of the functionality, including the C++ and machine learning classes. It currently supports OpenCV 2.1.
    The ctypes-opencv bindings have the same problem you ran into, inability to wrap the C++ classes in the machine learning library.
      September 30, 2021 1:53 PM IST
    0
  • Check out the cv2 module. GBT, SVM, kmeans, and friends are all there. The Willow Garage SVN with examples is hanging for me right now, but Dell Zhang has some example code from his work on the Wikipedia-sponsored Kaggle competition that demonstrates how to use cv2 for machine learning.

    EDIT: just realized that cv2 is new in OpenCV 2.3, so my answer will not hold for the precise use case indicated in this question. Hopefully an upgrade to 2.3 is possible for you.

      October 2, 2021 2:21 PM IST
    0
  • By the way some of machine learning things seem to be included. For example

    import sys; print('%s %s' % (sys.executable or sys.platform, sys.version))
    >>> C:\Python26\python.exe 2.6.6 (r266:84297, Aug 24 2010, 18:46:32) [MSC v.1500 32 bit (Intel)]
    import cv
    cv.SVM, cv.DTree, cv.KNearest
    >>> (<built-in function SVM>, <built-in function DTree>, <built-in function KNearest>)
    
      October 6, 2021 3:44 PM IST
    0