Estou testando um codigo e tive problemas: nao consigo ver a imagem. A mensage que aparece é: TypeError: Image data cannot be converted to float (dado da imagem nao pode ser convertido para float) Nao consegui resolver isso, por favor me ajude
CODIGO:
from matplotlib import pyplot as plt
import numpy as np
import cv2
img1 = cv2.imread('teste8/inco.png',0) # queryImage
img2 = cv2.imread('teste8/incoRec.png',0) # trainImage
# Initiate SIFT detector
orb = cv2.ORB_create()
# find the keypoints and descriptors with SIFT
kp1, des1 = orb.detectAndCompute(img1,None)
kp2, des2 = orb.detectAndCompute(img2,None)
# create BFMatcher object
bf = cv2.BFMatcher(cv2.NORM_HAMMING, crossCheck=True)
# Match descriptors.
matches = bf.match(des1,des2)
# Sort them in the order of their distance.
matches = sorted(matches, key = lambda x:x.distance)
# Draw first 10 matches.
img3 = cv2.drawMatches(img1,kp1,img2,kp2,matches,None, flags=2)
plt.imshow(img3),plt.show()