Skip to content

wentzien/MotionDetector

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

MotionDetector

With this engine it is possible to detect motion in a video stream. The output is a motion score. In addition, a box can be drawn around the moving parts of the video to make them visible.

Integration via CDN

<script src="https://cdn.jsdelivr.net/npm/motiondetector@1.0.3/index.min.js"></script>

Exemplary use

Example in detailed form at GitHub-Example-Repo or live in action motiondetector.wntzn.com

<body>
<!-- for the output -->
<canvas id="motion-canvas"></canvas>
<canvas id="capture-canvas"></canvas>
<span id="motion-score">???</span>
<!-- setting the sensitivity with slider -->
<input id="slider" type="range" min="10" max="100" value="32"/>

<script src="https://cdn.jsdelivr.net/npm/motiondetector@1.0.3/index.min.js"></script>
<script>
    settings = {
        motionCanvasRef: document.getElementById("motion-canvas"),
        captureCanvasRef: document.getElementById("capture-canvas"),
        scoreRef: document.getElementById("motion-score")
    };

    const motionDetector = new MotionDetector(settings);
    motionDetector.start();
    
    const slider = document.getElementById("slider");
    slider.addEventListener("change", () => motionDetector.settings.sensitivity = slider.value);
</script>
</body>

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published