Motion Detection Problem

That is a challenge. I wrote a little about this if it can help.