Ask Your Question
0

I got a error "Incorrect type of self (must be 'Feature2D' or its derivative)" from line7(keypoints~~)

asked 2018-10-31 00:20:18 -0600

kyh39612 gravatar image

updated 2018-10-31 01:05:09 -0600

berak gravatar image

import cv2 as cv import numpy as np

im = cv.imread("mini.jpg", cv.IMREAD_GRAYSCALE)

detector = cv.SimpleBlobDetector()
keypoints = detector.detect(im)
im_with_keypoints = cv.drawKeypoints(im, keypoints, np.array([]), (0,0,255), cv.DRAW_MATCHES_FLAGS_DRAW_RICH_KEYPOINTS)

cv.imshow("keypoints", im_with_keypoints)
k = cv.waitKey(0)
cv.destroyAllWindows()
edit retag flag offensive close merge delete

Comments

opencv version ?

berak gravatar imageberak ( 2018-10-31 01:25:54 -0600 )edit

1 answer

Sort by ยป oldest newest most voted
0

answered 2018-10-31 02:30:54 -0600

berak gravatar image

updated 2018-10-31 02:33:26 -0600

there is a bug (in the wrappers) here, the correct invocation has to be:

detector = cv.SimpleBlobDetector_create()

(same problem with ORB,AKAZE, anything from features2d)

edit flag offensive delete link more

Question Tools

Stats

Asked: 2018-10-31 00:20:18 -0600

Seen: 5,630 times

Last updated: Oct 31 '18