obniz developer team
Published

Model Railroad Controller

Using obniz, you can operate a model train from your smartphone or PC.

AdvancedFull instructions provided10 hours365
Model Railroad Controller

Things used in this project

Hardware components

obniz
Cambrian Robotics obniz
×1

Story

Read more

Code

Code snippet #1

Plain text
...
cap.read(src);
cv.cvtColor(src, gray, cv.COLOR_RGBA2GRAY);
if (first_flag) {
  gray.copyTo(before);
  first_flag = false;
}
cv.addWeighted(gray, 0.5, before, 0.5, 2.2, before);
cv.convertScaleAbs(before, b1, 1, 0);
cv.absdiff(gray, b1, mdframe);

let delay = 1000 / FPS - (Date.now() - begin);
setTimeout(processVideoMoving, delay);
...

source code (Github Gist)

https://gist.github.com/9wick/68bdd6999b868f83a655a17f1e30e6e0

Credits

obniz developer team

obniz developer team

80 projects • 35 followers
Development board "obniz" is controlled via the internet.

Comments