Apply the findNonZero function to your foreground mask, then see if at least 10% of your image content is changing (since you want to ignore noise), and trigger the alarm.