일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | ||
6 | 7 | 8 | 9 | 10 | 11 | 12 |
13 | 14 | 15 | 16 | 17 | 18 | 19 |
20 | 21 | 22 | 23 | 24 | 25 | 26 |
27 | 28 | 29 | 30 | 31 |
- sources.list
- YoLO
- error
- Kinetic
- roslaunch
- ax200
- gcc
- CUDA
- roslib
- 부분공간
- Gazebo
- 전이학습
- Linux
- Installation
- CuDNN
- G++
- opencv
- autorace
- amcl
- webots
- RGB-D
- turtlebot
- darknet_ros
- linetracing
- turtlebot3
- ubuntu
- ROS
- FreeCAD
- 촉각센서
- rqt
- Today
- Total
기술 성공, 실패 기록소
decompress 16bit grey scale depth compressed image 본문
realsense camera 토픽 중
/camera/depth/image_rect_raw/compressed
/camera/depth/image_rect_raw/compressedDepth
위 두 토픽 중
/camera/depth/image_rect_raw/compressedDepth
를 사용한다. 위에건 fake이다.
decompress 16 bit grey scale은 opencv에서 제공하지 않는다.
opencv는 8 bit grey scalse 만 decompress 해줌
간단하게
http://wiki.ros.org/image_transport
image_transport 를 사용하면 된다.
node 항목에 있는 명령어를 사용해서
rosrun image_transport republish compressedDepth in:=/camera/depth/image_rect_raw raw out:=/sun
위와 같은 식으로 쓰면 된다.
in, out에는 원형의 토픽을 넣어줘야 한다.
in 앞에 인자가 원형에 붙어서
/camera/depth/image_rect_raw/compressedDepth 토픽을 사용하는 셈.
http://wiki.ros.org/compressed_depth_image_transport
compressed depth image transport 패키지는 image_transport 의 플러그인 패키지인데
''compressed_depth_image_transport works only with floating-point or 16-bit integer encoded depth images.''
위와 같이 친절하게 opencv에선 제공하지 않는, 16-bit integer encoded depth image를 decompress 해준다.
별도의 명령어가 필요한것이 아니라, image_transport 의 republish 노드를 사용할 때 인자로 compressedDepth가 있으면 자동으로 호출되서 사용되는 식.
+
cv_bridge does not properly support conversions for 16bit pngs
https://github.com/ros-perception/vision_opencv/issues/206
compressed_imgmsg_to_cv2
http://docs.ros.org/en/lunar/api/cv_bridge/html/python/index.html
http://docs.ros.org/en/jade/api/sensor_msgs/html/image__encodings_8h_source.html
imdecode()
https://docs.opencv.org/3.4/d4/da8/group__imgcodecs.html#ga26a67788faa58ade337f8d28ba0eb19e
https://docs.opencv.org/3.4/d8/d6a/group__imgcodecs__flags.html#ga61d9b0126a3e57d9277ac48327799c80
'프로그래밍언어 > ROS' 카테고리의 다른 글
param과 args에 대해서. (0) | 2022.03.04 |
---|---|
rosbag , topic 저장 (0) | 2021.12.01 |
imdecode (0) | 2021.08.18 |
what is image step? (0) | 2021.08.18 |
remove package (0) | 2021.08.17 |