我正在尝试多模板匹配牙齿。在
import numpy as np
import cv2
import glob
X_data=[]
files = glob.glob ('C:/Users/amuly/Pictures/Saved Pictures/template/*.jpg')
img=cv2.imread('C:/Users/amuly/Pictures/Saved Pictures/teeth.jpeg')
gray=cv2.cvtColor(img,cv2.COLOR_BGR2GRAY)
for myfile in files:
temp=cv2.imread(myfile)
w,h=temp.shape[::-1]
在这一行之后,我得到了错误太多的值无法解压缩。 请帮忙。在
^{pr2}$
基于OpenCV-Python的多模板匹配-
图片来源谷歌图片
代码和图像文件的链接-https://github.com/Pawankumar2925/multiple-template-matching
裁剪软件-Windows Paint
如果图像是彩色的,
temp.shape
将返回一个包含3个值的元组。你不能把它分解成2个变量,你需要3个变量。在也许你的代码中也有一个双冒号。在
从最后一个元素中删除两个变量,这样就可以把它们解包了。在
^{pr2}$相关问题 更多 >
编程相关推荐