Ubuntu 16.04
Compare two camera JPEGs (moving detection)
# Command line
compare -metric NCC camLast.jpg camPrev.jpg null: ;echo
0.9974321
# Prog
floatDiff=$( compare -metric NCC camLast.jpg camPrev.jpg null: 2>&1 )
echo $floatDiff
- On two identical pictures, result is 1.
- Results on camera are between 0.997 and 0.998, due to camera noise and jpeg conversion loss.
- Results below 0.997 are true differences, meaning Moving detection on camera view field happened.