Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

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

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()

click to hide/show revision 2
None

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

berak gravatar image

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

import cv2 as cv import numpy as np

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

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.DRAW_MATCHES_FLAGS_DRAW_RICH_KEYPOINTS)

cv.imshow("keypoints", im_with_keypoints) k = cv.waitKey(0) cv.destroyAllWindows()

cv.destroyAllWindows()