pageauc / pi-timolo

Raspberry PI-TIMOLO ( PI-TImelapse, MOtion, LOwLight ) uses RPI picamera and OpenCV for Remote Headless Security Monitoring using Motion Tracking, Rclone Auto Sync files with remote storage services. Auto Twilight Transitions and Low Light Camera Settings. Panoramic images using PanTiltHat and More. This project is featured on GitHub Awesome software.
MIT License
549 stars 101 forks source link

Image Rotation #13

Closed dcrand2012 closed 8 years ago

dcrand2012 commented 8 years ago

Hi Claude- This is what I have been looking for however the case and camera mounting I have requires the image to be rotated 270 degrees is there a way to do this?

pageauc commented 8 years ago

I have commented out the camera rotation in the function takeDayImage(filename): You can un comment the camera.rotation line the comment out the vflip and hflip lines so the rotation is not overridden. You will need to add a variable to config.py eg cameraRotate = 270

with picamera.PiCamera() as camera: camera.resolution = (imageWidth, imageHeight)

camera.rotation = cameraRotate #Note use imageVFlip and imageHFlip variables

    time.sleep(0.5)   # sleep for a little while so camera can get adjustments
    if imagePreview:
        camera.start_preview()
    camera.vflip = imageVFlip
    camera.hflip = imageHFlip

Let me know if you have any issues.

pageauc commented 8 years ago

Also please note you will need to add similar logic to takeNightImage Just add the line camera.rotation = cameraRotate

dcrand2012 commented 8 years ago

Thanks for the fast reply It's working as I wanted.