The simpliest motion detection (IF motion happens return true)

l stumbled upon multiple tutorial about movement detection.

All of them are tracking movement.

I’m interested only in knowing IF the movement happened in the most cost-effective way.

(Return TRUE if movement happended, id not return false).

Does anybody know the algorithm/code to do that?

(For now I have this: DetectMotionTF - Pastebin.com )

https://docs.opencv.org/4.x/d2/d55/group__bgsegm.html

and then consider if that was enough change or not.