Différences
Ci-dessous, les différences entre deux révisions de la page.
| Les deux révisions précédentes Révision précédente | |||
| raspberry:camera [11/10/2020 17:29] – ↷ Page déplacée de electronique:raspberry:camera à raspberry:camera fjiang | raspberry:camera [14/10/2020 17:36] (Version actuelle) – fjiang | ||
|---|---|---|---|
| Ligne 1: | Ligne 1: | ||
| + | ====== Module Caméra ====== | ||
| + | <WRAP center round todo 80%> | ||
| + | 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**, | ||
| + | * Redémarer la Raspberry Pi. | ||
| + | |||
| + | ===== Bibliothèque picamera ===== | ||
| + | [[https:// | ||
| + | |||
| + | ==== Installation ==== | ||
| + | Pour installer la bibliothèque python picamera, il suffit de taper dans le termial : | ||
| + | <code linux> | ||
| + | sudo apt-get update | ||
| + | sudo apt-get install python-picamera python3-picamera | ||
| + | </ | ||
| + | ou | ||
| + | <code linux> | ||
| + | sudo pip install picamera | ||
| + | </ | ||
| + | |||
| + | ==== Premiers Codes ==== | ||
| + | <WRAP group> | ||
| + | <WRAP half column> | ||
| + | <code python photo.py> | ||
| + | from picamera import PiCamera | ||
| + | from time import sleep | ||
| + | |||
| + | camera = PiCamera() | ||
| + | |||
| + | camera.start_preview() | ||
| + | sleep(5) | ||
| + | camera.capture('/ | ||
| + | camera.stop_preview() | ||
| + | </ | ||
| + | </ | ||
| + | |||
| + | <WRAP half column> | ||
| + | <code python video.py> | ||
| + | from picamera import PiCamera | ||
| + | from time import sleep | ||
| + | |||
| + | camera = PiCamera() | ||
| + | |||
| + | camera.start_preview() | ||
| + | camera.start_recording('/ | ||
| + | sleep(5) | ||
| + | camera.stop_recording() | ||
| + | camera.stop_preview() | ||
| + | </ | ||
| + | </ | ||
| + | </ | ||
| + | ===== Bibliothèque opencv-python ===== | ||
| + | [[https:// | ||
| + | |||
| + | ==== Installation ==== | ||
| + | Pour installer la bibliothèque python cv2, il suffit de taper dans le termial : | ||
| + | <code linux> | ||
| + | pip install opencv-contrib-python | ||
| + | pip install opencv-contrib-python-headless | ||
| + | </ | ||