这个错误是因为OpenCV库中没有名为'findFirstNonZero'的函数。

可能是因为你在使用OpenCV的旧版本,而该函数是在新版本中添加的。

建议升级OpenCV到最新版本,或者使用其他方法来替代'findFirstNonZero'函数。

OpenCV 错误: AttributeError: module 'cv2' has no attribute 'findFirstNonZero'