Hardware and software configurations
We will use a standard camera developed for the Pi that costs about $30 in many major electronics stores.
Pi has a camera port where you can plug in the camera cable. The plug on the Pi can be opened by pulling it upwards. If you have problems connecting the camera to the Pi, you can find many videos on the Internet showing how to do it. You can watch one from Raspberry Pi Foundation at https://www.raspberrypi.org/help/camera-module-setup/.
The next step is to configure the Pi and enable the camera hardware. This is done using the Pi configuration program accessed by issuing the following command:
sudo raspi-config
In the menu provided, select Enable Camera and hit Enter. Then click on Finish where you'll be prompted to reboot.