0
ORB를 사용하여 이전에 생성 된 스펙트로 그램의 키포인트와 설명자를 찾으려고합니다. I 오류 얻고있다, 그러나opencv (파이썬)를 사용할 때 "orb.detectAndCompute"오류가 발생했습니다.
start = time.time()
x = 1
img = range(101)
imgname = range(101)
# Directory Images
os.chdir("/home/undead/Documents/TempSongSpectro/") #1,2,3
for file in glob.glob("*.png"):
img[x] = cv2.imread(file, 0) # trainImage
imgname[x] = os.path.splitext(file)[0]
# print "%s: %d " % (os.path.splitext(file)[0],(x))
x = x + 1
# Initiate ORB detector
orb = cv2.ORB_create(3000)
# find the keypoints and descriptors with ORB
a = 1
des = range(101)
kp = range(101)
for a in range(1, 101):
kp[a], des[a] = orb.detectAndCompute(img[a], None)
end = time.time()
print("Initialize time: %f seconds" % (end - start))
: 나는이 코드를 가지고 내가, 오류가 KP, DES 또는 IMG의 데이터 유형과 관련이있을 수 있습니다 수집 한 바로는
OpenCV Error: Assertion failed (depth == CV_8U || depth == CV_16U || depth == CV_32F) in cvtColor, file /home/undead/opencv/opencv-3.2.0/modules/imgproc/src/color.cpp, line 9710
Traceback (most recent call last):
File "/home/undead/PycharmProjects/KavTest/Test3.py", line 37, in <module>
kp[a], des[a] = orb.detectAndCompute(img[a], None)
cv2.error: /home/undead/opencv/opencv-3.2.0/modules/imgproc/src/color.cpp:9710: error: (-215) depth == CV_8U || depth == CV_16U || depth == CV_32F in function cvtColor
을,하지만 난 ' 그것을 해결하는 방법에 대한 확신이 없습니다. 누군가 도움을 줄 수 있습니까?
이것은 문제를 해결 한 것으로 보입니다. 고맙습니다 :) – Undead