The legality of installed cameras is complex where I live. It might not even be legal depending on available spots to place the camera. An ugly sign would be needed to notify visitors of the camera. Then I'd have to destroy parts on the RPi so that it couldn't be turned into a recording device. Last, the camera would need to be put in a rigid housing from where it can't be vandalised or stolen.
I think a much better solution would be to use a proximity sensor of some kind, avoiding all of the above issues.