小编Hus*_*ein的帖子

'NoneType' 对象没有属性 'shape'

截屏我正在尝试在我的 Mac 上运行这个项目。

在这个项目中有两个主要的 python 文件我必须运行,那就是calibrate.py打开相机并获取图像detectCoins.py,但是我每次尝试构建时都会收到这个错误detectCoins.py:

File "detectCoins.py", line 226, in <module>
    scale = finalHeight / im.shape[0]
AttributeError: 'NoneType' object has no attribute 'shape'
Run Code Online (Sandbox Code Playgroud)

谁能告诉我如何正确运行这个项目?谢谢。编码

import numpy as np
import logging, sys
import yaml

## =========================================================================
# select video & camera and whether to use calibration
VIDEO = 0
camera = 1
CAL = True
# Beaware that camera calibration can move some objects out of the frame
# and as a …
Run Code Online (Sandbox Code Playgroud)

python error-handling opencv

3
推荐指数
1
解决办法
8029
查看次数

标签 统计

error-handling ×1

opencv ×1

python ×1