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 - )

and then consider if that was enough change or not.