raspberrypi / pytrack

17 stars 8 forks source link

Fails if camera-v1 is connected #2

Closed jrobinson-uk closed 7 years ago

jrobinson-uk commented 7 years ago

With a v1 camera connected test_tracker.py throws this error:

Traceback (most recent call last):
  File "/usr/lib/python3.4/threading.py", line 920, in _bootstrap_inner
    self.run()
  File "/usr/lib/python3.4/threading.py", line 868, in run
    self._target(*self._args, **self._kwargs)
  File "/home/pi/pytrack/tracker/camera.py", line 62, in __photo_thread
    self.camera.resolution = (item['Width'], item['Height'])
  File "/usr/local/lib/python3.4/dist-packages/picamera/camera.py", line 2271, in _set_resolution
    "Invalid resolution requested: %r" % (value,))
picamera.exc.PiCameraValueError: Invalid resolution requested: PiResolution(width=3280, height=2464)
daveake commented 7 years ago

Yeah, that's because the full-sized pictures use the Sony resolution. I'll look to see how best to cope with the choice of camera; ideally the pycamera library has a "use max resolution" option (though I didn't see it when I looked). I'm away all of this week and possibly all of next too, but I'll get it sorted when I get back.

On 28 March 2017 at 18:06, James Robinson notifications@github.com wrote:

With a v1 camera connected test_tracker.py throws this error:

Traceback (most recent call last): File "/usr/lib/python3.4/threading.py", line 920, in _bootstrap_inner self.run() File "/usr/lib/python3.4/threading.py", line 868, in run self._target(*self._args, **self._kwargs) File "/home/pi/pytrack/tracker/camera.py", line 62, in __photo_thread self.camera.resolution = (item['Width'], item['Height']) File "/usr/local/lib/python3.4/dist-packages/picamera/camera.py", line 2271, in _set_resolution "Invalid resolution requested: %r" % (value,)) picamera.exc.PiCameraValueError: Invalid resolution requested: PiResolution(width=3280, height=2464)

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/raspberrypi/pytrack/issues/2, or mute the thread https://github.com/notifications/unsubscribe-auth/ABBodHMzVaAz7ZVqof10jL0P6xurwvgyks5rqT4igaJpZM4Mr63E .

daveake commented 7 years ago

I've added some code to check the camera version and set the resolution accordingly. Commiting soon.