我目前正在通过Udemy学习openCV课程,遇到了内核即将崩溃的问题。我试着逐行消除,看看原因是什么,我发现当代码到达行时:keypoints=探测器(图像)它失败了。现在,我是一个业余爱好者,当谈到这类东西,但会感谢一些反馈,为什么这可能会发生。以下是我正在使用的代码:
import cv2
import numpy as np;
# Read image
image = cv2.imread("images/Sunflowers.jpg")
# Set up the detector with default parameters.
detector = cv2.SimpleBlobDetector()
# Detect blobs.
keypoints = detector.detect(image)
# Draw detected blobs as red circles.
# cv2.DRAW_MATCHES_FLAGS_DRAW_RICH_KEYPOINTS ensures the size of
# the circle corresponds to the size of blob
blank = np.zeros((1,1))
blobs = cv2.drawKeypoints(image, keypoints, blank, (0,255,255),
cv2.DRAW_MATCHES_FLAGS_DEFAULT)
# Show keypoints
cv2.imshow("Blobs", blobs)
cv2.waitKey(0)
cv2.destroyAllWindows()```
目前没有回答
相关问题 更多 >
编程相关推荐