How to use BOWImgDescriptorExtractor in python - openCV ?
Hi,
I am a beginner to openCV and am trying to use python-openCV. I have version 2.4.10. In this I am trying to use the BOWImgDescriptorExtractor as follows :
extractor = cv2.BOWImgDescriptorExtractor(cv2.SURF(), cv2.BFMatcher(cv2.NORM_L2))
and am getting the following error :
extractor = cv2.BOWImgDescriptorExtractor(cv2.SURF(), cv2.BFMatcher(cv2.NORM_L2)) TypeError: Expected cv::DescriptorExtractor for argument 'dextractor'
Not sure how to resolve this since the namespace convention is not used in python.
can you try:
and pass that to the BOWImgDescriptorExtractor ?
I tried this but I still get the same error .
shame, i only got ocv3 here, can't really test your situation
can you check, what cv2.SURF() or cv2.FeatureDetector_create("SURF") return ?
(did you build the cv2.pyd ? maybe your weird distro ripped it out again)
The value returned by these is of the following type -
<type 'cv2.SURF'>
and<type 'cv2.FeatureDetector'>
. I did not build the cv2.pyd but used the one already provided. I was facing issues building and using opencv3.0 in windows in python so I switched to 2.4.10 because it does not separate SIFT and SURF into opencv_contrib that require building. I even used the pre-built binaries provided at http://www.lfd.uci.edu/~gohlke/python... (2.4.12) and it gave the same error as above.Thank you for your inputs Berak.I tried and searched on google a fair bit to figure out the issue here but could not resolve it. So, I complied opencv3.0 and switched to it. opencv3.0 for python seems to work without any issues :)