【发布时间】:2021-02-23 16:21:14
【问题描述】:
# -*- coding: utf-8 -*-
"""
Created on Mon Feb 22 15:09:13 2021
@author:
"""
import cv2
import numpy as np
import numpy
...
...
...
...
thickness = int(pointsarray[1,0]) - int(pointsarray[0,0]) #here is the error
print(thickness)
cv2.line(img, (cx, cy), (cx+50, cy), (0,0,255), 1)
cv2.putText(img, 'Thickness : '+str(thickness),(x-20, y-10), font, 0.4,(0,0,0),1,cv2.LINE_AA)
cv2.imshow('img', img)
出现以下错误:
厚度 = int(pointsarray[1,0]) - int(pointsarray[0,0]) IndexError: 数组索引过多
【问题讨论】: