Point the camera at the door, use the camera to detect if the door is open.
Mount the camera on the door facing down and watch for a moving floor
That's a clever solution that would use less processing power. A camera pointed at the door provides the benefit of being useful for other purposes e.g. person detection / recognition and standard security camera purposes.