unable to find KNearest and SVM functions in cv2?
I am using open cv 2.4 and python 2.7 and ubuntu 14.04 when i write a code as knn=cv2.KNearest()
error comes: knn=cv2.KNearest().find_nearest() AttributeError: 'module' object has no attribute 'KNearest'
I have tried everything. PLz help
try a
cv2.__version__
.if it turns out, you're using opencv3.0, not 2.4 as you think, then the answer is:
the ml classes in opencv3.0 had to be temporarily (i hope) disabled, the wrapper scripts have some problems with the latest refactoring of the ml module (can't handle inner classes)
I have installed opencv 3.0 now but still error remains same.
oh sorry, it's the other way round : ifyou want to use any ml functionality from python, you will have to use 2.4.x (until this issue gets fixed in 3.0)
Yes! but in start i was using 2.4.x version but still encountered this problem. That's why thought of changing version. There is some issue related to installation of open CV that it cannot find these functions, others are available. Thanks for replying