Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

BOWKMeansTrainer in Python?

Hi all,

I found that BOWKMeansTrainer / BOWImgDescriptorExtractor are not available in the python wrapper ... any special reason for this? I'm using the latest version from github.

Anyway, I checked how the python wrapper is generated, replaced the CV_EXPORTS in the class declarations with CV_EXPORTS_W, rebuilt and now the classes do show up in the generated wrapper code.

Only problem is, python (2.7) still complains that "object has no attribute 'BOWKMeansTrainer'" if I try to instantiate it like bowtrainer = cv2.BOWKMeansTrainer()

So the question is, what am I doing wrong? What is the correct way to expose a class to python? Is this wrapping process documented somewhere?

Thanks in advance Peter

BOWKMeansTrainer in Python?

Hi all,

I found that BOWKMeansTrainer / BOWImgDescriptorExtractor are not available in the python wrapper ... any special reason for this? I'm using the latest version from github.

Anyway, I checked how the python wrapper is generated, replaced the CV_EXPORTS in the class declarations with CV_EXPORTS_W, rebuilt and now the classes do show up in the generated wrapper code.

Only problem is, python (2.7) still complains that "object has no attribute 'BOWKMeansTrainer'" if I try to instantiate it like bowtrainer = cv2.BOWKMeansTrainer()

So the question is, what am I doing wrong? What is the correct way to expose a class to python? Is this wrapping process documented somewhere?

Thanks in advance Peter