intel_realsense
Différences
Ci-dessous, les différences entre deux révisions de la page.
Les deux révisions précédentesRévision précédenteProchaine révision | Révision précédente | ||
intel_realsense [2021/03/18 15:13] – Tag0 Added: opencv,python serge | intel_realsense [2022/03/22 14:12] (Version actuelle) – [Les pages sur la détection de squelette] Benjamin Labomedia | ||
---|---|---|---|
Ligne 1: | Ligne 1: | ||
====== Intel Realsense====== | ====== Intel Realsense====== | ||
+ | <WRAP center round box 80% centeralign> | ||
+ | **{{tagpage> | ||
+ | </ | ||
- | =====Installation du driver du Capteur D455===== | + | {{ : |
+ | ===== Ressources | ||
+ | |||
+ | * **[[cameras_de_profondeur|Camera Realsense Installation]] Intel® RealSense™ Computer Vision - Depth and Tracking cameras** | ||
+ | * [[https:// | ||
+ | * [[https:// | ||
+ | * [[https:// | ||
+ | =====Installation du driver du Capteur D455===== | ||
* **[[https:// | * **[[https:// | ||
- | | + | Validé sur Debian 11 Bullseye |
- | sudo add-apt-repository " | + | |
- | sudo apt-get install librealsense2-dkms | + | <code bash> |
- | sudo apt-get install | + | sudo apt-key adv --keyserver keys.gnupg.net --recv-key F6E65AC044F831AC80A06380C8B3A55A6F3EFCDE || sudo apt-key adv --keyserver hkp:// |
+ | sudo apt install software-properties-common | ||
+ | sudo add-apt-repository " | ||
+ | </ | ||
+ | |||
+ | Puis\\ | ||
+ | sudo apt update | ||
+ | sudo apt install | ||
Tester avec: | Tester avec: | ||
+ | sudo apt install librealsense2-utils | ||
realsense-viewer | realsense-viewer | ||
+ | | ||
+ | Voir si le module est bien chargé | ||
+ | modinfo uvcvideo | grep " | ||
{{ :: | {{ :: | ||
Ligne 20: | Ligne 41: | ||
* https:// | * https:// | ||
- | pip install pyrealsense2 | + | |
====L' | ====L' | ||
Ligne 27: | Ligne 48: | ||
{{ : | {{ : | ||
- | <code python opencv_viewer_example.py> | + | ====Calibration de la caméra==== |
- | ## License: Apache 2.0. See LICENSE file in root directory. | + | **Avec une calibration, la détction du squelette est beaucoup plus stable.**\\ |
- | ## Copyright(c) 2015-2017 Intel Corporation. All Rights Reserved. | + | Une copie du script de la doc se trouve dans le dossier rs-imu-calibration: |
- | + | Suivre le script et le PDF [[https://github.com/ | |
- | ############################################### | + | |
- | ## Open CV and Numpy integration | + | |
- | ############################################### | + | |
- | + | ||
- | import pyrealsense2 as rs | + | |
- | import numpy as np | + | |
- | import cv2 | + | |
- | + | ||
- | # Configure depth and color streams | + | |
- | pipeline | + | |
- | config | + | |
- | + | ||
- | # Get device product line for setting a supporting resolution | + | |
- | pipeline_wrapper | + | |
- | pipeline_profile | + | |
- | device | + | |
- | device_product_line | + | |
- | + | ||
- | config.enable_stream(rs.stream.depth, 640, 480, rs.format.z16, 30) | + | |
- | + | ||
- | if device_product_line == ' | + | |
- | config.enable_stream(rs.stream.color, | + | |
- | else: | + | |
- | config.enable_stream(rs.stream.color, | + | |
- | # Start streaming | + | Exemple d'une calibration |
- | pipeline.start(config) | + | <code bash> |
+ | python3 rs-imu-calibration.py | ||
+ | waiting for realsense device... | ||
+ | Device PID: 0B5C | ||
+ | Device name: Intel RealSense D455 | ||
+ | Serial number: | ||
+ | Product Line: D400 | ||
+ | Firmware version: | ||
+ | Start interactive mode: | ||
+ | FOUND ACCEL with fps=63 | ||
+ | FOUND GYRO with fps=200 | ||
+ | ------------------------- | ||
+ | *** Press ESC to Quit *** | ||
+ | ------------------------- | ||
- | try: | + | Align to direction: [ 0. -1. 0.] |
- | while True: | + | Status.collect_data[...................]] |
- | # Wait for a coherent pair of frames: depth and color | + | Direction data collected. |
- | frames = pipeline.wait_for_frames() | + | Align to direction: |
- | | + | Status.collect_dataWARNING: MOVING |
- | color_frame = frames.get_color_frame() | + | Status.collect_data[...................]] |
- | if not depth_frame or not color_frame: | + | |
- | | + | |
- | # Convert images to numpy arrays | + | Direction data collected. |
- | | + | Align to direction: |
- | | + | Status.collect_data[...................]] |
- | # Apply colormap on depth image (image must be converted | + | Direction data collected. |
- | depth_colormap = cv2.applyColorMap(cv2.convertScaleAbs(depth_image, | + | Align to direction: |
+ | | ||
+ | | ||
- | depth_colormap_dim = depth_colormap.shape | + | Direction data collected. |
- | | + | Align to direction: |
+ | | ||
- | # If depth and color resolutions are different, resize color image to match depth image for display | + | Direction data collected. |
- | if depth_colormap_dim != color_colormap_dim: | + | Align to direction: [0. 0. 1.] |
- | resized_color_image = cv2.resize(color_image, | + | Status.collect_dataWARNING: MOVING |
- | images = np.hstack((resized_color_image, | + | Status.collect_data[...................]] |
- | else: | + | |
- | | + | |
- | # Show images | + | Direction data collected. |
- | | + | Would you like to save the raw data? Enter footer for saving files (accel_< |
- | cv2.imshow(' | + | Enter nothing to not save raw data to disk. >toto |
- | cv2.waitKey(1) | + | |
- | finally: | ||
- | # Stop streaming | + | Writing files: |
- | | + | accel_toto.txt |
+ | gyro_toto.txt | ||
+ | [ 5.22060069e-04 | ||
+ | [1000 1000 1000 1000 1000 1000] | ||
+ | using 6000 measurements. | ||
+ | [[ 1.01076975e+00 | ||
+ | [ 4.92538947e-04 | ||
+ | | ||
+ | [ 2.24575082e-01 | ||
+ | residuals: [ 7.25572588 | ||
+ | rank: 4 | ||
+ | singular: [441.23030094 430.20638248 424.20085017 | ||
+ | norm (raw data | ||
+ | norm (fixed data): 9.805557 A good calibration will be near 9.806650 | ||
+ | Would you like to write the results to the camera? (Y/N)Y | ||
+ | Writing calibration to device. | ||
+ | Device PID: 0B5C | ||
+ | Device name: Intel RealSense D455 | ||
+ | Serial number: | ||
+ | Firmware version: | ||
+ | SUCCESS: saved calibration to camera. | ||
+ | Done. | ||
</ | </ | ||
=====Les pages sur la détection de squelette===== | =====Les pages sur la détection de squelette===== | ||
* [[skeleton_tracking_de_cubemos_logiciel_proprietaire|]] | * [[skeleton_tracking_de_cubemos_logiciel_proprietaire|]] | ||
- | * [[detection_d_un_squelette_dans_une_image|]] | + | * [[pose_estimation_avec_opencv]] |
- | {{tag> capteurs opencv python sb }} | + | {{tag> capteurs opencv python |
intel_realsense.1616080427.txt.gz · Dernière modification : 2021/03/18 15:13 de serge