Outils pour utilisateurs

Outils du site


intel_realsense

Différences

Ci-dessous, les différences entre deux révisions de la page.

Lien vers cette vue comparative

Les deux révisions précédentesRévision précédente
Prochaine révision
Révision précédente
intel_realsense [2021/03/18 15:13] – Tag0 Added: opencv,python sergeintel_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>skeleton camera3D|Les pages sur les caméras 3D et la détection de squelette}}**     **[[http://translate.google.com/translate?hl=&sl=auto&tl=en&u=https%3A%2F%2Fressources.labomedia.org%2Fintel_realsense|English Version]]**
 +</WRAP>
  
-=====Installation du driver du Capteur D455=====+{{ :media_15:img_0005.jpg?600 |}} 
 +===== Ressources ===== 
 + 
 +  * **[[cameras_de_profondeur|Camera Realsense Installation]] Intel® RealSense™ Computer Vision - Depth and Tracking cameras**
  
 +  * [[https://intelrealsense.github.io/librealsense/python_docs/_generated/pyrealsense2.html|API python]]
 +  * [[https://pyrealsense.readthedocs.io/en/master/pyrealsense.html|pyrealsense.readthedocs.io]]
 +  * [[https://github.com/IntelRealSense/librealsense/tree/development/wrappers/python/examples| Exemples python sur GitHub]]
  
 +=====Installation du driver du Capteur D455=====
   * **[[https://github.com/IntelRealSense/librealsense/blob/master/doc/distribution_linux.md|github.com librealsense doc linux]]**   * **[[https://github.com/IntelRealSense/librealsense/blob/master/doc/distribution_linux.md|github.com librealsense doc linux]]**
  
-  sudo apt-key adv --keyserver keys.gnupg.net --recv-key F6E65AC044F831AC80A06380C8B3A55A6F3EFCDE || sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-key F6E65AC044F831AC80A06380C8B3A55A6F3EFCDE +Validé sur Debian 11 Bullseye 
-  sudo add-apt-repository "deb http://realsense-hw-public.s3.amazonaws.com/Debian/apt-repo bionic main" -u + 
-  sudo apt-get install librealsense2-dkms +<code bash> 
-  sudo apt-get install librealsense2-utils+sudo apt-key adv --keyserver keys.gnupg.net --recv-key F6E65AC044F831AC80A06380C8B3A55A6F3EFCDE || sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-key F6E65AC044F831AC80A06380C8B3A55A6F3EFCDE 
 +sudo apt install software-properties-common 
 +sudo add-apt-repository "deb https://librealsense.intel.com/Debian/apt-repo focal main" -u 
 +</code> 
 + 
 +Puis\\ 
 +  sudo apt update 
 +  sudo apt install -librealsense2-dkms
  
 Tester avec: Tester avec:
 +  sudo apt install librealsense2-utils
   realsense-viewer   realsense-viewer
 +  
 +Voir si le module est bien chargé
 +  modinfo uvcvideo | grep "version:"            devrait inclure realsense
  
 {{ ::realsense_viewer.png?400 |}} {{ ::realsense_viewer.png?400 |}}
Ligne 20: Ligne 41:
   * https://github.com/IntelRealSense/librealsense/tree/master/wrappers/python#installation   * https://github.com/IntelRealSense/librealsense/tree/master/wrappers/python#installation
  
-  pip install pyrealsense2+  python3 -m pip install pyrealsense2 --user
  
 ====L'exemple de la doc librealsense==== ====L'exemple de la doc librealsense====
Ligne 27: Ligne 48:
 {{ :media_14:realsense_opencv.png?800 |}} {{ :media_14:realsense_opencv.png?800 |}}
  
-<code python opencv_viewer_example.py> +====Calibration de la caméra==== 
-## License: Apache 2.0. See LICENSE file in root directory. +**Avec une calibrationla 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: [[https://github.com/sergeLabo/rs-opencv/blob/main/rs-imu-calibration/rs-imu-calibration.py|rs-imu-calibration.py]]\\ 
- +Suivre le script et le PDF [[https://github.com/sergeLabo/rs-opencv/blob/main/rs-imu-calibration/IMU_Calibration_Tool_for_Intel_RealSense-Depth_Cameras_Whitepaper.pdf|IMU_Calibration_Tool_for_Intel_RealSense-Depth_Cameras_Whitepaper.pdf]]
-############################################### +
-##      Open CV and Numpy integration        ## +
-############################################### +
- +
-import pyrealsense2 as rs +
-import numpy as np +
-import cv2 +
- +
-# Configure depth and color streams +
-pipeline rs.pipeline() +
-config rs.config() +
- +
-# Get device product line for setting a supporting resolution +
-pipeline_wrapper rs.pipeline_wrapper(pipeline) +
-pipeline_profile config.resolve(pipeline_wrapper) +
-device pipeline_profile.get_device() +
-device_product_line str(device.get_info(rs.camera_info.product_line)) +
- +
-config.enable_stream(rs.stream.depth640, 480, rs.format.z16, 30) +
- +
-if device_product_line == 'L500': +
-    config.enable_stream(rs.stream.color, 960, 540, rs.format.bgr8, 30) +
-else: +
-    config.enable_stream(rs.stream.color, 640, 480, rs.format.bgr8, 30)+
  
-# 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:  053422251581 
 +  Product Line:  D400 
 +  Firmware version:  05.12.11.00 
 +Start interactive mode: 
 +FOUND ACCEL with fps=63 
 +FOUND GYRO with fps=200 
 +------------------------- 
 +*** Press ESC to Quit *** 
 +-------------------------
  
-try+Align to direction [ 0. -1.  0.]   Mounting screw pointing down, device facing out 
-    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:  [100.]   Mounting screw pointing left, device facing out 
-        depth_frame = frames.get_depth_frame() + Status.collect_dataWARNINGMOVING     ]]                                                 
-        color_frame = frames.get_color_frame() + Status.collect_data[...................]]                                                
-        if not depth_frame or not color_frame+
-            continue+
  
-        # Convert images to numpy arrays +Direction data collected. 
-        depth_image = np.asanyarray(depth_frame.get_data()) +Align to direction:  [010.]   Mounting screw pointing up, device facing out 
-        color_image = np.asanyarray(color_frame.get_data())+ Status.collect_data[...................]]                                                
  
-        # Apply colormap on depth image (image must be converted to 8-bit per pixel first) +Direction data collected. 
-        depth_colormap = cv2.applyColorMap(cv2.convertScaleAbs(depth_image, alpha=0.03)cv2.COLORMAP_JET)+Align to direction:  [-1 0 0.]   Mounting screw pointing rightdevice facing out 
 + Status.collect_dataWARNING: MOVING     ]]                                                 
 + Status.collect_data[...................]]                                                
  
-        depth_colormap_dim = depth_colormap.shape +Direction data collected
-        color_colormap_dim = color_image.shape+Align to direction:  [ 0 0. -1.]   Viewing direction facing down 
 + Status.collect_data[...................]]                                                
  
-        # 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. 01.]   Viewing direction facing up 
-            resized_color_image = cv2.resize(color_image, dsize=(depth_colormap_dim[1], depth_colormap_dim[0]), interpolation=cv2.INTER_AREA) + Status.collect_dataWARNINGMOVING     ]]                                                 
-            images = np.hstack((resized_color_image, depth_colormap)) + Status.collect_data[...................]]                                                
-        else+
-            images = np.hstack((color_image, depth_colormap))+
  
-        # Show images +Direction data collected. 
-        cv2.namedWindow('RealSense', cv2.WINDOW_AUTOSIZE) +Would you like to save the raw data? Enter footer for saving files (accel_<footer>.txt and gyro_<footer>.txt
-        cv2.imshow('RealSense', images+Enter nothing to not save raw data to disk>toto
-        cv2.waitKey(1)+
  
-finally: 
  
-    # Stop streaming +Writing files: 
-    pipeline.stop()+accel_toto.txt 
 +gyro_toto.txt 
 +[ 5.22060069e-04  6.86921142e-05 -2.07340278e-03] 
 +[1000 1000 1000 1000 1000 1000] 
 +using 6000 measurements. 
 +[[ 1.01076975e+00  3.60727590e-02 -8.35014969e-03] 
 + [ 4.92538947e-04  1.01871131e+00 -8.72837958e-03] 
 + [-6.46373829e-03  1.24138802e-02  1.01959596e+00] 
 + [ 2.24575082e-01  1.56413994e-01  2.86333600e-01]] 
 +residuals: [  7.25572588   3.70199967 114.63373591] 
 +rank: 4 
 +singular: [441.23030094 430.20638248 424.20085017  77.26445512] 
 +norm (raw data  ): 9.655707 
 +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:  053422251581 
 +  Firmware version:  05.12.11.00 
 +SUCCESS: saved calibration to camera. 
 +Done.
 </code> </code>
 =====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 realsense sb skeleton camera3D ia}}
intel_realsense.1616080427.txt.gz · Dernière modification : 2021/03/18 15:13 de serge