nischi / MMM-Face-Reco-DNN

Face recognition with opencv and deep neural network
MIT License
91 stars 46 forks source link

Set rotation of PiCamera #34

Closed danth closed 4 years ago

danth commented 4 years ago

It'd be nice to provide an option to set the rotation of the camera when using the Raspberry Pi camera module. This is useful if the camera is mounted the wrong way around for the default orientation.

I have managed to do this temporarily by modifying picam.py and adding the line self.camera.rotation = 270, but a config option would be better.

nischi commented 4 years ago

That sounds like a good thing.

DrSoops commented 4 years ago

I am getting the following error vs = VideoStream(usePiCamera=True, rotation=args["rotateCamera"]).start()\nTypeError: __init__() got an unexpected keyword argument \'rotation\' I'm not going to pretend I know python that well (or even care to learn python) but if i would hinder a guess the import statement in tools/facerecognition.py should be changed from

from imutils.video import FPS, VideoStream

to

from imutils.video import FPS
from stream import VideoStream
nischi commented 4 years ago

@njoerd114 any idea?

DrSoops commented 4 years ago

I take this back. I was using imutils version 0.5.2 as the main readme says. The newer version 0.5.3 allows for extra parameters.

Ignore my previous statement, most likely will want to just bump the necessary version of imutils form 0.5.2 to 0.5.3