Libraryless. Click here for Pure Java version (6821L/41K).
1 | // Look for motion between 2 images |
2 | // We only do one channel |
3 | |
4 | srecord noeq LookForMotion( |
5 | IIntegralImage img1, |
6 | IIntegralImage img2, |
7 | int splitDepth // how often to split - our new, more intuitive measure over "featureSize" |
8 | ) extends Probabilistic {
|
9 | bool verbose; |
10 | |
11 | record LookAtClip(Rect r) implements Runnable {
|
12 | run {
|
13 | // check whether image brightness has changed over the last image |
14 | // if not: guess "no motion" |
15 | // if yes: guess "motion" |
16 | // split image |
17 | // repeat procedure for each part of image |
18 | } |
19 | } |
20 | |
21 | run { schedule(root()); }
|
22 | |
23 | LookAtClip root() {
|
24 | assertEquals("Sizes of compared images have to be equal", img1.getSize(), img2.getSize());
|
25 | ret new LookAtClip(imageRect(img1)); |
26 | } |
27 | } |
Began life as a copy of #1032159
download show line numbers debug dex old transpilations
Travelled to 4 computer(s): bhatertpkbcr, mowyntqkapby, mqqgnosmbjvj, pyentgdyhuwx
No comments. add comment
| Snippet ID: | #1032464 |
| Snippet name: | LookForMotion [dev.] |
| Eternal ID of this version: | #1032464/4 |
| Text MD5: | 8ff80fcebee617d54ba8738e422c0c51 |
| Transpilation MD5: | e0aca69580968e05eef62c2587962e56 |
| Author: | stefan |
| Category: | javax |
| Type: | JavaX fragment (include) |
| Public (visible to everyone): | Yes |
| Archived (hidden from active list): | No |
| Created/modified: | 2021-09-08 03:57:18 |
| Source code size: | 790 bytes / 27 lines |
| Pitched / IR pitched: | No / No |
| Views / Downloads: | 345 / 446 |
| Version history: | 3 change(s) |
| Referenced in: | [show references] |