Download Jar. Uses 2596K of libraries. Click here for Pure Java version (427L/4K).
!7 lib 1008985 // webcam lib 1008987 // bridj lib 1004016 // slf4j api import com.github.sarxos.webcam.Webcam; import com.github.sarxos.webcam.WebcamMotionDetector; import com.github.sarxos.webcam.WebcamMotionEvent; import com.github.sarxos.webcam.WebcamMotionListener; /** * Detect motion. This example demonstrates how to use build-in motion detector * and motion listener to fire motion events. * * @author Bartosz Firyn (SarXos) */ sclass DetectMotionExample implements WebcamMotionListener { *() { WebcamMotionDetector detector = new(Webcam.getDefault()); detector.setInterval(500); // one check per 500 ms detector.addMotionListener(this); detector.start(); } @Override public void motionDetected(WebcamMotionEvent wme) { print("Detected motion I, alarm turn on you have"); } } p { new DetectMotionExample; }
Began life as a copy of #1008986
download show line numbers debug dex old transpilations
Travelled to 13 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, gwrvuhgaqvyk, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tslmcundralx, tvejysmllsmz, vouqrxazstgt
No comments. add comment
Snippet ID: | #1008988 |
Snippet name: | Webcam Motion Detection [probably works] |
Eternal ID of this version: | #1008988/2 |
Text MD5: | e0c115ad8a29ad7a0ac6de97a4a35bbb |
Transpilation MD5: | aa374bff2383c24e25227527443f61d0 |
Author: | stefan |
Category: | javax / desktop / camera |
Type: | JavaX source code (desktop) |
Public (visible to everyone): | Yes |
Archived (hidden from active list): | No |
Created/modified: | 2017-06-22 19:40:01 |
Source code size: | 878 bytes / 35 lines |
Pitched / IR pitched: | No / No |
Views / Downloads: | 561 / 1268 |
Version history: | 1 change(s) |
Referenced in: | -