====== Module Caméra ====== Page en cours de construction... ===== Configuration ===== Pour connecter le module caméra à une Raspberry Pi, il faut : * Brancher le module caméra correctement à une Raspberry Pi. * Allumer la Raspberry Pi. * Aller dans le menu principal pour ouvrir **Raspberry Pi Configuration**. * Dans la table des **Interfaces**, autoriser **Camera** et valider. * Redémarer la Raspberry Pi. ===== Bibliothèque picamera ===== [[https://picamera.readthedocs.io/en/release-1.13/|Documentation de la bibliothèque picamera]] ==== Installation ==== Pour installer la bibliothèque python picamera, il suffit de taper dans le termial : sudo apt-get update sudo apt-get install python-picamera python3-picamera ou sudo pip install picamera ==== Premiers Codes ==== from picamera import PiCamera from time import sleep camera = PiCamera() camera.start_preview() sleep(5) camera.capture('/home/pi/Desktop/image.jpg') camera.stop_preview() from picamera import PiCamera from time import sleep camera = PiCamera() camera.start_preview() camera.start_recording('/home/pi/Desktop/video.h264') sleep(5) camera.stop_recording() camera.stop_preview() ===== Bibliothèque opencv-python ===== [[https://opencv-python-tutroals.readthedocs.io/en/latest/|Documentation de la bibliothèque opencv-python]] ==== Installation ==== Pour installer la bibliothèque python cv2, il suffit de taper dans le termial : pip install opencv-contrib-python pip install opencv-contrib-python-headless