_,contours, hierarchy = cv.findContours(EC_Img, cv.RETR_EXTERNAL, cv.CHAIN_APPROX_SIMPLE); #CV_RETR_EXTERNAL,CV_CHAIN_APPROX_NONE
ResImg = frame.copy()
#for cont in contours:
cnt = max(contours, key = cv.contourArea)
x, y, w, h = cv.boundingRect(cnt)
l_top = (x, y)
r_bottom = (x + w, y + h)
cv.rectangle(ResImg, l_top, r_bottom, (255, 0, 0), 2)
当识别不到时max会报empty,如何修改代码