Trying to implement background region detection