Ask Your Question

Revision history [back]

TypeError: data type not understood opencv python

thats my python3 opencv3 code i get this error when i run this code i did't finished it yet that's are the error can some one help ?

line 19, in <module> matches = bf.match(np.array(kpTrain, desTrain)) TypeError: data type not understood

that's my code

import numpy as np
import cv2


camera = cv2.VideoCapture(0)
orb = cv2.ORB_create()

img = cv2.imread('/home/shar/home.jpg')
imggray = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY)


kpTrain = orb.detect(imggray,None)
kpTrain, desTrain = orb.compute(imggray, kpTrain)

ret, imgCamColor = camera.read()

bf = cv2.BFMatcher(cv2.NORM_HAMMING, crossCheck=True)

matches = bf.match(np.array(kpTrain, desTrain))