Hallo Leute,
hab folgenden Code geschrieben:
Dazu bekomme folgende Fehlermeldung, womit ich nicht weiterkomme:
Ich hoffe, ihr könnt mir weiter helfen.
Lg Tron36
hab folgenden Code geschrieben:
Code:
import cv2
cap = cv2.VideoCapture(0)
cv2.namedWindow('Interactive Systems: Towards AR Tracking')
while True:
# 1. read each frame from the camera (if necessary resize the image)
# and extract the SIFT features using OpenCV methods
# Note: use the gray image - so you need to convert the image
# 2. draw the keypoints using cv2.drawKeypoints
# There are several flags for visualization - e.g. DRAW_MATCHES_FLAGS_DRAW_RICH_KEYPOINTS
# close the window and application by pressing a key
# YOUR CODE HERE
_, frame_img = cap.read()
gray = cv2.cvtColor(frame_img, cv2.COLOR_BGR2GRAY)
sift = cv2.xfeatures2d.SIFT_create()
key_points = sift.detect(gray, None)
# bad python binding
img = cv2.drawKeypoints(gray, key_points, None, flags=cv2.DRAW_MATCHES_FLAGS_DRAW_RICH_KEYPOINTS)
ch = cv2.waitKey(1) & 0xFF
# quit
if ch == ord('q'):
break
cv2.imshow('image', img)
cap.release()
cv2.destroyAllWindows()
Dazu bekomme folgende Fehlermeldung, womit ich nicht weiterkomme:
Code:
Traceback (most recent call last):
File "D:/02_features.py", line 17, in <module>
gray = cv2.cvtColor(frame_img, cv2.COLOR_BGR2GRAY)
cv2.error: OpenCV(3.4.2) c:\projects\opencv-python\opencv\modules\imgproc\src\color.hpp:253: error: (-215:Assertion failed) VScn::contains(scn) && VDcn::contains(dcn) && VDepth::contains(depth) in function 'cv::CvtHelper<struct cv::Set<3,4,-1>,struct cv::Set<1,-1,-1>,struct cv::Set<0,2,5>,2>::CvtHelper'
Ich hoffe, ihr könnt mir weiter helfen.
Lg Tron36