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

Moving the Motion Tracking Stream Area #108

Closed thjkral closed 3 years ago

thjkral commented 3 years ago

Is it possible to change the location of the Motion Tracking Stream Area? I'm using pi-timolo to capture birds that visit my bird feeder, and have the camera mounted to my window. This causes some physical limitations to aligning the camera correctly. If I understand correctly, this area is used to do the motion detection calculations on. Is it possible to move the stream area downwards? Or is it always in the middle of the picture? I have not been able to find the correct lines in the code.

My thanks in advance.

pageauc commented 3 years ago

The stream area will always be in the center since it is not a cropped but rather a separate camera image stream. When motion is detected the camera is put into still mode and the larger still image is taken. The motion area is just an overlay on the full size image to show you where the stream image is. The two are quite separate. Best advice is to point camera so motion tracking area is where you want to monitor.for motion then make the still image a large size to capture wider area. You can change the stream resolution height, width but don't make it too large since opencv performance will be affected. The config.py Image Settings has

STREAM_WIDTH = 320 # Default= 320 Width of motion tracking stream detection area STREAM_HEIGHT = 240 # Default= 240 Height of motion tracking stream detection area

These will change the motion tracking stream image resolution but it will always be in the center of the full size still image. You can move the camera pointing to the motion area you want to monitor so it is within the stream area.. I would not make image size too big. You you could make stream tall and thin (within reason) eg width 240 and height 320. This would detect more of the vertical area motion.

There will be a bit of a time delay to stop the stream and take the still image. The MOTION_TRACK_QUICK_PIC_ON option is faster since it captures the stream image but image quality will suffer. You might want to set this option and make the steam size larger. You might need to reduce the MOTION_TRACK_QUICK_PIC_BIGGER value. since it resizes the stream image to a larger display size. If you have a faster RPI you could try a larger stream size and reduce the FPS speed. eg

STREAM_WIDTH = 1296 # Default= 320 Width of motion tracking stream detection area STREAM_HEIGHT = 730 # Default= 240 Height of motion tracking stream detection area STREAM_FPS = 10 # Default= 20 fps PiVideoStream setting. Single core RPI suggest 15 fps

MOTION_TRACK_ON = True # Default= True True=Turns Motion Detect On, False=Off MOTION_TRACK_QUICK_PIC_ON = True # Default= False True= Grab stream frame rather than stopping stream to take full size image MOTION_TRACK_QUICK_PIC_BIGGER = 1.0 # Default= 3.0 multiply size of QuickPic saved image from Default 640x480

Turn off other features

TIMELAPSE_ON = False # Default= False True=Turn timelapse On, False=Off MOTION_VIDEO_ON = False # Default= False True=Take a video clip rather than image MOTION_TRACK_MINI_TL_ON = False # Default= False True=Take a quick time lapse sequence rather than a single image (overrides MOTION_VIDEO_ON) VIDEO_REPEAT_ON = False # Turn on Video Repeat Mode IMPORTANT Overrides timelapse and motion PANTILT_ON = False

This will capture a stream frame when motion tracking is triggered. Play around with the settings to see what gets the best results. You can make this into a plugin as well. The plugin settings over ride the respective config.py settings. See WIKI for more details.

Let me know how you are doing. Clauide

On Thu, Oct 22, 2020 at 10:56 AM Tom Kral notifications@github.com wrote:

Is it possible to change the location of the Motion Tracking Stream Area? I'm using pi-timolo to capture birds that visit my bird feeder, and have the camera mounted to my window. This causes some physical limitations to aligning the camera correctly. If I understand correctly, this area is used to do the motion detection calculations on. Is it possible to move the stream area downwards? Or is it always in the middle of the picture? I have not been able to find the correct lines in the code.

My thanks in advance.

— 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/108, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABNPKZAEBSWSCFYDPKOOF2TSMBBZRANCNFSM4S3KDF5A .

-- See my YouTube Channel at http://www.youtube.com/user/pageaucp