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
548 stars 101 forks source link

Suggested optimization for resize call when in quick pic mode #122

Closed npaibrooklyn closed 3 years ago

npaibrooklyn commented 3 years ago

In pi_timolo.py at https://github.com/pageauc/pi-timolo/blob/master/source/pi-timolo.py#L1279

replace:

big_image = cv2.resize(image, (bigImageWidth, bigImageHeight))

with

        big_image = cv2.resize(image, (bigImageWidth, bigImageHeight)) if bigImage != 1 else image

This is so that, if the user has set the multiplier to 1, we don't waste time resizing the image which is an expensive operation and potentially jpeg-lossy if the cv2 API does not have checks

pageauc commented 3 years ago

Thanks for the update. Pushed Release 12.12 with change. You can upgrade using menubox.sh UPGRADE option

On Thu, Apr 29, 2021 at 3:05 AM npaibrooklyn @.***> wrote:

In pi_timolo.py at https://github.com/pageauc/pi-timolo/blob/master/source/pi-timolo.py#L1279

replace:

big_image = cv2.resize(image, (bigImageWidth, bigImageHeight))

with

    big_image = cv2.resize(image, (bigImageWidth, bigImageHeight)) if bigImage != 1 else image

This is so that, if the user has set the multiplier to 1, we don't waste time resizing the image which is an expensive operation and potentially jpeg-lossy if the cv2 API does not have checks

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/pageauc/pi-timolo/issues/122, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABNPKZHWBHSTAF4TMD7I4YDTLEAKDANCNFSM43ZH3WSA .

-- YouTube Channel at https://www.youtube.com/user/pageaucp http://www.youtube.com/user/pageaucp GitHub Repository at https://github.com/pageauc