Skip to content

Python class that detects camera motion and record a video

License

Notifications You must be signed in to change notification settings

Denis4l/CameraMotionDetection

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 

Repository files navigation

CameraMotionDetection

Python class that detects camera motion and record a video.

Uses OpenCV 4 and Numpy on Python 3.7.

Prototype :

class MotionDetection (string path, int video_source, string video_size, float threshold, int time_interval, int recording_time, boolean show_camera, boolean show_mask, boolean debug)

Usage :

# Instanciating the class
MD = MotionDetection("D:\\path\\record", 0, '1080p', 20000, 5, 1, True, False, False)

# Starting detection
MD.start()

# Stopping détection
MD.end()

Attributes :

  • path : Path of the directory to put the recorded files.
  • video_source : Numeric value of the video source (in order to choose the right camera). Begin with 0.
  • video_size : Resolution of the video ('4k', '1080p', '720p' ou '480p').
  • threshold : Noise threshold of the motion detection (0 very sensible, 100000 not sensible).
  • time_interval : Time interval in second between records.
  • recording_time : Duration of the recording in second.
  • show_camera : Boolean to show the camera view.
  • show_mask : Boolean to show the motion mask.
  • debug : Boolean to show the numeric values of the noise in the console.

About

Python class that detects camera motion and record a video

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 100.0%