In your example image, you show what appears to be a fixed camera feed (for example, a security camera). If it is safe to assume that this is a fixed camera feed, this becomes much easier, since we can:
- Take your image, and have a reference image from when you know the door isn't blocked
- Take an identically-sized subsection of each that zooms in on the section in front of the door
- Use one of several approaches to find differences between those two sub-images, and decide if those differences are beyond some threshold.
There are many ways to compare two similar images (and many stack overflow posts, code snippets, python examples, etc). As a quick-and-easy subset to consider, take a look at:
- The compareHist() function, which would allow you to see if the colors in each image are generally similar. If they are almost exactly the same there's probably nothing blocking your door, but there would be a rare set of cases where there is a floor-colored object blocking it and this would fail. But this is generally quick, easy, and good enough.
- The matchTemplate() function, which allows you to provide a template and find the probabilty that that template is found at a given pixel. If you have a template in the form of the floor in front of the door, and you can't find a match for that floor, the door is blocked. I would expect this to be a bit more robust than the histogram approach.
- If you're doing things in Python, Scikit also has some helpful tools for computing the structural similarity index (SSIM), which allows you to find the difference between two images.
If we can't make that assumption, things become harder: you'll need your approach to be robust against a large variety of possible perspective shifts. The most common method for doing that is by training a classifier model that is robust to a wide variety of different viewing angles.