sean-obrien / rpotter

Raspberry Potter - Use a wand to control the IoT (Internet of Things)
https://www.raspberrypotter.net/
MIT License
57 stars 51 forks source link

FindWand() crashing if no points found #15

Open HisDaveness opened 2 years ago

HisDaveness commented 2 years ago

Using the version updated for OpenCV 3.2.
Mine keeps crashing in FindWan(), line 124 if it can't find any points:

File "rpotter.py", line 124, in FindWand p0.shape = (p0.shape[1], 1, p0.shape[2]) AttributeError: 'NoneType' object has no attribute 'shape'

I guess it's more accurate to say this happens when cv2.HoughCircles() returns a NoneType.

I can trigger this by covering the camera for three seconds, so I assume the problem is that it doesn't see any points.