First option is just implement this code in Python. It looks like all functions mentioned in article are avaible in Python API. CvEM
is just EM
(in module cv2):
>>> cv2.EM.__doc__
'EM([, nclusters[, covMatType[, termCrit]]]) -> <EM object>'
there is no CvEMParams
, because EM
already handles it. If you are looking for any other function/object, type dir(cv2)
in Python console and most likely you will find what you are looking for. Quite often things in Python API has slightly different names, but still it's not a big problem to find them. Note that some things may be in cv2.cv
module as well.
Second option is just to use this C++ code and call it from Python. Writing extensions for Python is not very easy, but if you use Boost.Python it shouldn't be very hard. Writing extension modules is quite popular task for Boost.Python so there are some good tutorials which describes that well. Good point to start might be this one. Writing converter for cv::Mat <->numpy.array might be a problem, but here is easy solution.