I want my webcam to be able to automatically focus and take the photo of a 2mx2m wall that is placed at a minimum distance of 1m.

Can anyone please help me out with the camera specifications to achieve this?

Thanks in advance!