I'm combining two scans, one extracted from a depth camera, and the other from
a 2D LIDAR. But I'm getting some jitter from the depth camera's scan's
contribution. I suppose it's to be expected when combining a 30Hz depth scan
with a 40Hz LIDAR, but I was wondering if there was anything that could be
done better. A qualitative example of the jitter artifact in RVIZ; red/LIDAR,
green/depth-camera, yellow/combined. Note how combined lagges with the camera,
and the LIDAR remains quite static. ![image
description](https://cloud.githubusercontent.com/assets/2293573/13169970/f20197fa-d6b6-11e5-9bb6-e128d5a7444d.gif)
The example you see here is a turtlebot simulation from gazebo, with a asus
pointing forward, and a gpu_lidar pointing backwards, using this small PR of
ira_laser_tools: [#7](https://github.com/iralabdisco/ira_laser_tools/pull/7).
I made an issue [#8](https://github.com/iralabdisco/ira_laser_tools/issues/8)
of this, but thought It could be general enough for a good old approach
question here.


[ cv_bridge::SR
](namespacecv__bridge.html#a166887feb09ea6ce14e8742384e574bfa55079b5ac03221deb5d4bac1ed17996e)


320  cv::Mat image2;


Copy link


177  res[std::make_pair( [ YUV422
](../../../../api/sensor_msgs/html/namespacesensor__msgs_1_1image__encodings.html#a4cd4806e2221b58787bf6fa643ccf60d)
, BGRA)].push_back(cv::COLOR_YUV2BGRA_UYVY);


575  catch  (  const  std::runtime_error& e)


We read every piece of feedback, and take your input very seriously.


[ ↂ
](////talos181.rssing.com/chan-58296078/article541.html#c58296078a541i381855922
"JasperLoader Emerges, Targets Italy with Gootkit Banking Trojan")


311  {


[ cv_bridge::PPM
](namespacecv__bridge.html#a166887feb09ea6ce14e8742384e574bfaf9dc454f916fd886aa9157ca353aa80f)


640  if  (options. [ colormap
](structcv__bridge_1_1CvtColorForDisplayOptions.html#ac9997c80cc25010e95cee3c96f5a8f4d)
== -1) {


    /camera/depth/camera_info
    /camera/depth/image_rect_raw
    /rosout_agg
    /camera/depth/image_rect_raw/compressedDepth
    /camera/depth/image_rect_raw/compressed
    /camera/depth/metadata
    /rosout
    /camera/depth/camera_info
    /camera/depth/image_rect_raw
    /rosout_agg
    /diagnostics
    /diagnostics
    /diagnostics
    /diagnostics
    /camera/depth/image_rect_raw/compressedDepth
    /camera/depth/image_rect_raw/compressed
    /camera/depth/image_rect_raw
    /rosout
    /camera/depth/metadata
    /camera/depth/camera_info
    /rosout_agg
    /camera/realsense2_camera_manager/bond
    /camera/realsense2_camera_manager/bond
    /camera/depth/image_rect_raw/compressedDepth
    /camera/depth/image_rect_raw/compressed
    /rosout
    /camera/depth/metadata
    /camera/depth/camera_info
    /camera/depth/image_rect_raw
    /rosout_agg
    /camera/depth/image_rect_raw/compressedDepth
    /camera/depth/image_rect_raw/compressed
    /rosout
    /camera/depth/metadata
    /camera/depth/camera_info
    /rosout_agg
    /camera/depth/image_rect_raw
    /diagnostics
    /diagnostics
    /diagnostics


151  res[std::make_pair( [ GRAY
](namespacecv__bridge_1_1rgb__colors.html#aa6343a2cb9080c11afefb714570c63cca04e661921a463f3df840acbb03527c98)
, BGRA)].push_back(cv::COLOR_GRAY2BGRA);


[ _≪_ Previous: Depth map from bumblebee2 camera?
](//question2135.rssing.com/chan-36145539/all_p4.html#c36145539a72 "Previous
Article")


258  ss << "Image is wrongly formed: step < width * byte_depth * num_channels
or "  << source.step << " != "  <<


[ ](javascript:; "Ouch") 0


446  switch  (format) {


July 21, 2016, 10:48 am


82  if  (encoding == enc::RGBA8)  return  CV_8UC4;


[ ](//www.rssing.com/index.php?zw=2123 "Home") [ $ ](javascript:; "MoMoney")


Email Address


[ ![Fake lip ring, silver lip ring, simple lip ring, unisex lip ring by
AIRlab](//i.etsystatic.com/10798216/r/il/3a91cc/761285074/il_570xN.761285074_fu8j.jpg)
](////kuteriot1.rssing.com/chan-5865851/article17035.html#c5865851a17035i913072506)


[ ↂ
](////metro2989.rssing.com/chan-40972540/article57410.html#c40972540a57410i495009908
"The Umbrella Academy’s Justin Min shares adorable first selfie with new
boyfriend")


63  return  3;


505  cv::imencode(  "."  \+ format, image, ros_image.data);


[ ![@MikeHallettUK](https://avatars.githubusercontent.com/u/57232441?s=80&v=4)
](/MikeHallettUK)


605  // result image should be BGR


For


[ CWAndersn ](/CWAndersn) opened this issue  Feb 7, 2022  · 15 comments


Sorry, something went wrong.


84  if  (encoding == enc::RGBA16)  return  CV_16UC4;


643  (max_image_value - min_image_value));


559  (enc::bitDepth(source->encoding) == 32))


](/monajalal) [
![@felixvd](https://avatars.githubusercontent.com/u/4535737?s=52&v=4)
](/felixvd) [
![@Triocrossing](https://avatars.githubusercontent.com/u/8653434?s=52&v=4)
](/Triocrossing) [
![@CameronDevine](https://avatars.githubusercontent.com/u/10394896?s=52&v=4)
](/CameronDevine) [
![@icarpis](https://avatars.githubusercontent.com/u/17433152?s=52&v=4)
](/icarpis) [
![@gonultasbu](https://avatars.githubusercontent.com/u/19195222?s=52&v=4)
](/gonultasbu) [
![@ankurbaruah90](https://avatars.githubusercontent.com/u/21272990?s=52&v=4)
](/ankurbaruah90) [
![@mingyokim](https://avatars.githubusercontent.com/u/21287547?s=52&v=4)
](/mingyokim) [
![@lucasjinreal](https://avatars.githubusercontent.com/u/21303438?s=52&v=4)
](/lucasjinreal) [
![@NovoG93](https://avatars.githubusercontent.com/u/31406662?s=52&v=4)
](/NovoG93) [
![@basvroeg](https://avatars.githubusercontent.com/u/35264855?s=52&v=4)
](/basvroeg) [
![@RealSenseCustomerSupport](https://avatars.githubusercontent.com/u/46742753?s=52&v=4)
](/RealSenseCustomerSupport)
##  Footer
[ ](https://github.com "GitHub") © 2024 GitHub, Inc.
###  Footer navigation
  * [ Terms ](https://docs.github.com/site-policy/github-terms/github-terms-of-service)
  * [ Privacy ](https://docs.github.com/site-policy/privacy-policies/github-privacy-statement)
  * [ Security ](/security)
  * [ Status ](https://www.githubstatus.com/)
  * [ Docs ](https://docs.github.com/)
  * [ Contact ](https://support.github.com?tags=dotcom-footer)
  * Manage cookies
  * Do not share my personal information
You can’t perform that action at this time.


[ cv_bridge::CvImage::toImageMsg
](classcv__bridge_1_1CvImage.html#a48a7cc72fa96bdf0180d0306543ceb07)


Collaborator


* [ Pricing ](/pricing)


AND ... I have tried "roslaunch realsense2_camera rs_camera.launch
align_depth:=true filters:=pointcloud ordered_pc:=true"...


628  result->image.setTo(cv::Scalar(1., 1., 1.)*255./2.);


518  const  cv::Mat_<uchar> in(1, source.data.size(),  const_cast< uchar*  >
(&source.data[0]));


[ ](javascript:; "Share Article") [
](//www.rssing.com/contact.php?r=o6&u=%2F%2Fquestion2135.rssing.com%2Fchan-36145539%2Farticle79-live.html
"Article Support")


417  if  ((!encoding.empty() && source.encoding != [ encoding
](classcv__bridge_1_1CvImage.html#ac3e39d95b3691df0b08496267517f2db) ) ||
(source.is_bigendian &&


414  const  std::string& encoding)


[ Remove ADS ](//www.rssing.com/account.php?r=27)


Copy link


![MICOM & POWER AMP SCHEMATIC - LG RAT376B - Mini Hi-Fi
System](//3.bp.blogspot.com/-92Oskeb2C5M/Uyl-
laWjxPI/AAAAAAAA_o0/039IkqhyYmk/s1600/MICOM.bmp.jpg)


[ ](javascript:; "Like") 0


December 9, 2013, 2:57 am


673  else  if  (source->encoding ==  "16UC1"  )


###  [ Class 10 Sanskrit Grammar Book Solutions अपठित-अवबोधनम्
](////learn4804.rssing.com/chan-65098560/article5043.html#c65098560a5043i329832300)


[ ![@monajalal](https://avatars.githubusercontent.com/u/1892917?s=52&v=4)
](/monajalal) [ ![@MartyG-
RealSense](https://avatars.githubusercontent.com/u/41145062?s=52&v=4)
](/MartyG-RealSense)


467  case  [ RAS
](namespacecv__bridge.html#a166887feb09ea6ce14e8742384e574bfa2239eb1bb1fe372887900174cfd90620)
:


653  float  float_value = source->image.at< float  >(j, i);


184  res[std::make_pair(BAYER_BGGR, [ GRAY
](namespacecv__bridge_1_1rgb__colors.html#aa6343a2cb9080c11afefb714570c63cca04e661921a463f3df840acbb03527c98)
)].push_back(cv::COLOR_BayerRG2GRAY);


204  enc::isBayer(src_encoding) || (src_encoding == enc::YUV422);


56  if  (depth ==  "8U"  ) {


[ _≫_ Next: Save images kinect - 30fps
](//question2135.rssing.com/chan-36145539/all_p4.html#c36145539a71 "Next
Article")


I do not get an Ordered PointCloud from "roslaunch realsense2_camera
rs_rgbd.launch". It runs fine, but the array I get back from the topic
/camera/depth_registered/points varies in size. e.g. I set both colour and
depth to (480,848,3) so expect an array = 1,221,120... but get e.g. 1015911 or
1044357 etc ...


199  const  std::vector<int> getConversionCode(std::string src_encoding,
std::string dst_encoding)


[ _≫_ Next: Any suggestions for combining scans of different frequencies?
](//question2135.rssing.com/chan-36145539/all_p4.html#c36145539a63 "Next
Article")


366  ros_image.width = [ image
](classcv__bridge_1_1CvImage.html#a8b0cc1c26637754fbccb91b4fc086526) .cols;


[ cv_bridge::TIF
](namespacecv__bridge.html#a166887feb09ea6ce14e8742384e574bfafbe159afef10463d25bc0042af05c969)


30  * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT


![JasperLoader Emerges, Targets Italy with Gootkit Banking
Trojan](//3.bp.blogspot.com/-PsLw92lxTvA/XMGnQCXq8uI/AAAAAAAABI4/KJ5XDuqo8PsOIDiWSJs9sqmx5UPuCaB5gCLcBGAs/s640/image36.png)


edited


504  ros_image.format = format;


513  }


579  }


#  Provide feedback


Information about depth_image_proc can be found at [
http://wiki.ros.org/depth_image_proc ](http://wiki.ros.org/depth_image_proc)

---

All reactions


155  res[std::make_pair(RGB, RGBA)].push_back(cv::COLOR_RGB2RGBA);


**Definition:** [ cv_bridge.h:69 ](cv__bridge_8h_source.html#l00069)


#  [ Intel RealSense depth camera on Ubuntu Arm
](//question2135.rssing.com/chan-36145539/article64-live.html)


400  {


238  // And deal with depth differences if the colors are different


[ ](javascript:; "Ouch") 0


[ ](//www.rssing.com/index.php "Home")


170  res[std::make_pair(BGRA, BGR)].push_back(cv::COLOR_BGRA2BGR);


    /camera/depth/image_rect_raw
    /rosout_agg
    /rosout_agg
    /camera/depth/camera_info
    /rosout
    /rosout
    /camera/depth/image_rect_raw
    /camera/depth/metadata
    /camera/color/camera_info
    /camera/depth/metadata
    /camera/color/image_raw/compressed
    /camera/color/image_raw
    /camera/color/metadata
    /camera/color/image_raw/theora
    /camera/color/camera_info
    /camera/color/image_raw/compressed
    /camera/color/image_raw
    /camera/color/image_raw/theora
    /camera/color/metadata
    /rosout
    /rosout
    /rosout_agg
    /rosout_agg
    /camera/aligned_depth_to_color/camera_info
    /camera/align_to_color/parameter_descriptions
    /camera/align_to_color/parameter_updates
    /rosout_agg
    /rosout_agg
    /camera/depth/image_rect_raw/compressedDepth/parameter_descriptions
    /camera/depth/image_rect_raw/compressedDepth/parameter_updates
    /camera/depth/image_rect_raw/compressed/parameter_updates
    /camera/color/image_raw/compressed/parameter_updates
    /camera/color/image_raw/compressed/parameter_descriptions
    /camera/aligned_depth_to_color/image_raw/compressed
    /camera/aligned_depth_to_color/image_raw/compressedDepth
    /rosout
    /camera/aligned_depth_to_color/image_raw
    /rosout
    /camera/color/camera_info
    /rosout_agg


659  }


226  return  std::vector<int>(1, SAME_FORMAT);


280  const_cast<uchar*>(&source.data[0]), source.step);


[ ![@MartyG-
RealSense](https://avatars.githubusercontent.com/u/41145062?s=40&v=4)
](/MartyG-RealSense) [ MartyG-RealSense ](/MartyG-RealSense) mentioned this
issue  Apr 10, 2023


[ 72 ](namespacecv__bridge.html#a60b43d74db6ef87fd6cd35d9305b1ef1) int  [
getCvType ](namespacecv__bridge.html#a60b43d74db6ef87fd6cd35d9305b1ef1) (
const  std::string& encoding)


###  [ JasperLoader Emerges, Targets Italy with Gootkit Banking Trojan
](////talos181.rssing.com/chan-58296078/article541.html#c58296078a541i381855922)


501  }


  * [ Main Page  ](index.html)
  * [ Namespaces  ](namespaces.html)
  * [ Classes  ](annotated.html)
  * [ Files  ](files.html)


67  return  5;


    /rosout
    /camera/depth/metadata
    /camera/depth/camera_info
    /rosout_agg
    /camera/depth/image_rect_raw
    /camera/depth/image_rect_raw/compressedDepth
    /camera/depth/image_rect_raw/compressed
    /rosout
    /camera/depth/camera_info
    /camera/depth/metadata
    /rosout_agg
    /camera/depth/image_rect_raw
    /diagnostics
    /diagnostics
    /diagnostics
    /diagnostics
    /camera/depth/image_rect_raw/compressedDepth
    /camera/depth/image_rect_raw/compressed
    /rosout
    /camera/depth/camera_info
    /camera/depth/metadata
    /camera/depth/image_rect_raw
    /rosout_agg
    /camera/realsense2_camera_manager/bond
    /camera/realsense2_camera_manager/bond
    /camera/depth/image_rect_raw/compressedDepth
    /camera/depth/image_rect_raw/compressed
    /rosout
    /camera/depth/camera_info
    /camera/depth/metadata
    /camera/depth/image_rect_raw
    /rosout_agg
    /camera/depth/image_rect_raw/compressedDepth
    /camera/depth/image_rect_raw/compressed
    /rosout
    /camera/depth/camera_info
    /camera/depth/metadata
    /camera/depth/image_rect_raw
    /rosout_agg
    /diagnostics


[ YUV422
](../../../../api/sensor_msgs/html/namespacesensor__msgs_1_1image__encodings.html#a4cd4806e2221b58787bf6fa643ccf60d)


Sorry, something went wrong.


**Definition:** [ cv_bridge.cpp:355 ](cv__bridge_8cpp_source.html#l00355)


    /camera/depth/image_rect_raw
    /rosout
    /camera/depth/metadata
    /camera/depth/camera_info
    /rosout_agg
    /camera/depth/image_rect_raw/compressedDepth
    /camera/depth/image_rect_raw/compressed
    /rosout
    /camera/depth/metadata
    /camera/depth/camera_info
    /camera/depth/image_rect_raw
    /rosout_agg
    /diagnostics
    /diagnostics
    /diagnostics
    /diagnostics
    /camera/depth/image_rect_raw/compressedDepth
    /camera/depth/image_rect_raw/compressed
    /rosout
    /camera/depth/metadata
    /camera/depth/camera_info
    /camera/depth/image_rect_raw
    /rosout_agg
    /camera/realsense2_camera_manager/bond
    /camera/realsense2_camera_manager/bond
    /camera/depth/image_rect_raw/compressedDepth
    /camera/depth/image_rect_raw/compressed
    /rosout
    /camera/depth/camera_info
    /camera/depth/metadata
    /rosout_agg
    /camera/depth/image_rect_raw
    /camera/depth/image_rect_raw/compressedDepth
    /camera/depth/image_rect_raw/compressed
    /rosout
    /camera/depth/camera_info
    /camera/depth/metadata
    /camera/depth/image_rect_raw
    /rosout_agg
    /diagnostics


79  if  (encoding == enc::BGR16)  return  CV_16UC3;


[ _≫_ Next: Turtlebot depth image not showing in image_view
](//question2135.rssing.com/chan-36145539/all_p4.html#c36145539a68 "Next
Article")


81  if  (encoding == enc::BGRA8)  return  CV_8UC4;


Password


[ ↂ
](////myhome191.rssing.com/chan-15086300/article8401.html#c15086300a8401i282862088
"5 Dromlee Crescent, Beaumont, Dublin 9 - €399,950")


![Decoration of the High Command of the Hitler Youth for Distinguished
Foreigners](//4.bp.blogspot.com/-16fApX0rWmw/UBO8cvq9qpI/AAAAAAAABX0/UTZiUUYnjIU/s640/the+Hitler+Youth+for+Distinguished+Foreigners+-+obverse+-+fake+board.jpg)


473  case  [ TIFF
](namespacecv__bridge.html#a166887feb09ea6ce14e8742384e574bfa870473c7ea88913e2eb0f065ee00f8b6)
:


510  const  std::string& encoding)


Sorry, something went wrong.
[ ![@CameronDevine](https://avatars.githubusercontent.com/u/10394896?s=80&v=4)
](/CameronDevine)
Copy link
Contributor
###
**[ CameronDevine ](/CameronDevine) ** commented  Nov 15, 2023
[ @monajalal ](https://github.com/monajalal) appears to be running the `
rosbag ` command as root, so there shouldn't be any permissions issues with it
getting saved to ` /root ` .

---

All reactions
Sorry, something went wrong.
[
![@gonultasbu](https://avatars.githubusercontent.com/u/19195222?s=80&u=0695a60fe4cff728cf746782f274975216ff4315&v=4)
](/gonultasbu)
Copy link
###
**[ gonultasbu ](/gonultasbu) ** commented  Nov 15, 2023
Good catch. I'm guessing it may be hidden or if it is a shared resource system
(something like a cluster, the computer name makes me think it is something
like that) it may be getting deleted automatically. I would advise not running
as root or simply saving it somewhere else where users have proper rw
permissions as opposed to. ` ~/ ` .

---

All reactions
Sorry, something went wrong.
[
![@monajalal](https://avatars.githubusercontent.com/u/1892917?s=80&u=fb3f8f2771bf62335706b46ad426a3dfa3ae9c73&v=4)
](/monajalal)
Copy link
###
**[ monajalal ](/monajalal) ** commented  Nov 15, 2023
[ @gonultasbu ](https://github.com/gonultasbu) I am not sure what exactly was
going on but fixed it and gave credit to you here [
https://robotics.stackexchange.com/a/105440/16739


685  if  (source_typed->encoding == encoding)


std::string getFormat(Format format)


651  for  (  size_t  j = 0; j < source->image.rows; ++j) {


  * [ Notifications ](/login?return_to=%2FIntelRealSense%2Flibrealsense)
  * [ Fork  4.8k  ](/login?return_to=%2FIntelRealSense%2Flibrealsense)
  * [ Star  7.3k  ](/login?return_to=%2FIntelRealSense%2Flibrealsense)


58  }  else  if  (depth ==  "8S"  ) {


[ 55 ](namespacecv__bridge.html#a76369e4bbe0a2fda233cf5d4640ba2aa) static  int
[ depthStrToInt ](namespacecv__bridge.html#a76369e4bbe0a2fda233cf5d4640ba2aa)
(  const  std::string depth) {


469  case  [ SR
](namespacecv__bridge.html#a166887feb09ea6ce14e8742384e574bfa55079b5ac03221deb5d4bac1ed17996e)
:


527  case  3:


[ ](javascript:; "Like") 0


627  result->image = cv::Mat(source->image.size(), CV_8UC3);


    /camera/depth/camera_info
    /camera/depth/metadata
    /camera/depth/image_rect_raw
    /rosout_agg
    /camera/depth/image_rect_raw/compressedDepth
    /camera/depth/image_rect_raw/compressed
    /camera/depth/metadata
    /rosout
    /camera/depth/camera_info
    /rosout_agg
    /camera/depth/image_rect_raw
    /diagnostics
    /diagnostics
    /diagnostics
    /diagnostics
    /camera/depth/image_rect_raw/compressedDepth
    /camera/depth/image_rect_raw/compressed
    /rosout
    /camera/depth/metadata
    /camera/depth/camera_info
    /camera/depth/image_rect_raw
    /rosout_agg
    /camera/realsense2_camera_manager/bond
    /camera/realsense2_camera_manager/bond
    /camera/depth/image_rect_raw/compressedDepth
    /camera/depth/image_rect_raw/compressed
    /rosout
    /camera/depth/camera_info
    /camera/depth/metadata
    /rosout_agg
    /camera/depth/image_rect_raw
    /camera/depth/image_rect_raw/compressedDepth
    /camera/depth/image_rect_raw/compressed
    /rosout
    /camera/depth/image_rect_raw
    /camera/depth/camera_info
    /camera/depth/metadata
    /rosout_agg
    /diagnostics
    /diagnostics


Closed


You can’t perform that action at this time.


[ ![@MikeHallettUK](https://avatars.githubusercontent.com/u/57232441?s=80&v=4)
](/MikeHallettUK)


179  // Deal with Bayer


358  [ toImageMsg
](classcv__bridge_1_1CvImage.html#a48a7cc72fa96bdf0180d0306543ceb07) (*ptr);


  * [ Issues  84  ](/IntelRealSense/realsense-ros/issues)
  * [ Pull requests  6  ](/IntelRealSense/realsense-ros/pulls)
  * [ Discussions  ](/IntelRealSense/realsense-ros/discussions)
  * [ Actions  ](/IntelRealSense/realsense-ros/actions)
  * [ Projects  0  ](/IntelRealSense/realsense-ros/projects)
  * [ Wiki  ](/IntelRealSense/realsense-ros/wiki)
  * [ Security  ](/IntelRealSense/realsense-ros/security)
  * [ Insights  ](/IntelRealSense/realsense-ros/pulse)
Additional navigation options
  * [ Code  ](/IntelRealSense/realsense-ros)
  * [ Issues  ](/IntelRealSense/realsense-ros/issues)
  * [ Pull requests  ](/IntelRealSense/realsense-ros/pulls)
  * [ Discussions  ](/IntelRealSense/realsense-ros/discussions)
  * [ Actions  ](/IntelRealSense/realsense-ros/actions)
  * [ Projects  ](/IntelRealSense/realsense-ros/projects)
  * [ Wiki  ](/IntelRealSense/realsense-ros/wiki)
  * [ Security  ](/IntelRealSense/realsense-ros/security)
  * [ Insights  ](/IntelRealSense/realsense-ros/pulse)
New issue
**Have a question about this project?** Sign up for a free GitHub account to
open an issue and contact its maintainers and the community.
Pick a username

Email Address

Password

Sign up for GitHub
By clicking “Sign up for GitHub”, you agree to our [ terms of service
](https://docs.github.com/terms) and [ privacy statement
](https://docs.github.com/privacy) . We’ll occasionally send you account
related emails.
Already on GitHub? [ Sign in ](/login?return_to=%2FIntelRealSense%2Frealsense-
ros%2Fissues%2Fnew%2Fchoose) to your account
Jump to bottom
#  d435 on v2.0.2 w/ librealsense v2.10.0:: ` [ERROR] [1518537840.126603320]:
Compressed Depth Image Transport - Compression requires single-channel 32bit-
floating point or 16bit raw depth images (input format is: rgb8). ` #315
Closed
[ moorage ](/moorage) opened this issue  Feb 13, 2018  · 20 comments


569  encoding = enc::BGR8;


[ 406 ](namespacecv__bridge.html#aafa38a1d9be98d9efaefe45fd873133c) [
CvImageConstPtr
](../../../../api/roscpp_traits/html/classboost_1_1shared__ptr.html) [
toCvShare ](namespacecv__bridge.html#aafa38a1d9be98d9efaefe45fd873133c) (
const  sensor_msgs::ImageConstPtr& source,


[ _≫_ Next: Is this the right way to obatin depth information?
](//question2135.rssing.com/chan-36145539/all_p4.html#c36145539a74 "Next
Article")


49  #include < [ cv_bridge/rgb_colors.h ](rgb__colors_8h.html) >


[ CWAndersn ](/CWAndersn) opened this issue  Feb 7, 2022  · 15 comments


  * [ Code  ](/IntelRealSense/realsense-ros)
  * [ Issues  84  ](/IntelRealSense/realsense-ros/issues)
  * [ Pull requests  6  ](/IntelRealSense/realsense-ros/pulls)
  * [ Discussions  ](/IntelRealSense/realsense-ros/discussions)
  * [ Actions  ](/IntelRealSense/realsense-ros/actions)
  * [ Projects  0  ](/IntelRealSense/realsense-ros/projects)
  * [ Wiki  ](/IntelRealSense/realsense-ros/wiki)
  * [ Security  ](/IntelRealSense/realsense-ros/security)
  * [ Insights  ](/IntelRealSense/realsense-ros/pulse)


Sorry, something went wrong.


315  else


Explore


312  ptr->encoding = src_encoding;


Thanks. I am using a D455.


![Woman is 21st murder victim](//barbadostoday.bb/wp-
content/uploads/2019/04/MG_3723.jpg)


No branches or pull requests


317  // Convert the source data to the desired encoding


Repositories


[ ](javascript:; "Ouch") 0


* Open Source


###  [ The Umbrella Academy’s Justin Min shares adorable first selfie with new
boyfriend
](////metro2989.rssing.com/chan-40972540/article57410.html#c40972540a57410i495009908)


cv::Vec3d getRGBColor(const int color)


I have to record a dataset using the kinect, it should contains RBG images and
depth images.. Using this code: char filename[80]; int i=0,j=0; void
imageCallbackdepth(const sensor_msgs::ImageConstPtr& msg) { // convert message
from ROS to openCV cv_bridge::CvImagePtr cv_ptr; try { cv_ptr =
cv_bridge::toCvCopy(msg, sensor_msgs::image_encodings::TYPE_32FC1); } catch
(cv_bridge::Exception& e) { ROS_ERROR("cv_bridge exception: %s", e.what());
return; } sprintf(filename,"depth_%d.png", i++);
cv::imwrite(filename,cv_ptr->image); } void imageCallbackrgb(const
sensor_msgs::ImageConstPtr& msg) { //The same for RGB } I have a couple of
questions: How can I make sure that I'm saving images at 30fps? Am I not
missing any frame? How can I change this parameter? Saving RBG and depth at
the same time and adding another sensor (stereocamera) doesn't effect that? My
program is correct, is it the right way to do this?


![HAFSA ROBINSON](//augustacrime.com/wp-content/uploads/2016/12/Hafsa-
Robinson-23-Theft-by-taking-240x300.jpg)


[ ](javascript:;)


209  // If we have no color info in the source, we can only convert to the
same format which


Hi, Giving x,y pixels coordinate in camera/rgb/image_raw, I am trying to
extract the related depth from camera/depth_registered/image_raw. I start the
xtion via "roslaunch openni2_launch openni2" Running "rosrun rqt_reconfigure
rqt_reconfigure" and checking camera/driver confirms depth_registration is
active. Also, displaying the /camera/depth_registered/points in rviz shows
something that looks nice. It seems to me that when using an xtion pro live,
there is no need for calibration, so I did not do any. It also seems to me
that if registration is done, coordinates in the depth image and in the rgb
image are the same, so I do the following in python: in the callback for the
rgb image (bridge is an instance of CvBridge): cv_image =
bridge.imgmsg_to_cv2(image, image.encoding) # code for getting x,y coordinate
of a pixel of interest in the image I run some code that displays the image
and shows the pixel x,y: cv2.circle(cv_image,(x,y),2,(255,0,0),-1) this
confirms x,y are correct, in this case at the center of a colored ball in
front of the camera callback for depth image: image_cv =
bridge.imgmsg_to_cv2(depth_image, depth_image.encoding) depth_image =
np.squeeze(np.array(image_cv, dtype=np.float32)) depth =
float(depth_image[x][y]) but I just get "0.0" for the depth, no matter where
the ball is in the field of vision. Anything I am doing incorrectly ?


Hi all, Im going to develop some package with the [Intel RealSense depth
camera](http://click.intel.com/intelrrealsensetm-developer-kit-featuring-
sr300.html), but before i get that hardware, i wanna know if its possible to
use it on the Ubuntu Arm version of ROS. Thank you so much!!


691  return  [ cvtColor
](namespacecv__bridge.html#ab9a4ba669b03a3b0a35651a6c0d77be1) (source_typed,
encoding);


321  for  (  size_t  i=0; i<conversion_codes.size(); ++i) {


699  }  //namespace cv_bridge


[ ](javascript:; "Share Article") [
](//www.rssing.com/contact.php?r=o6&u=%2F%2Fquestion2135.rssing.com%2Fchan-36145539%2Farticle62-live.html
"Article Support")


Mike

---

All reactions


629  }


Unless I'm just missing it, the only additional topics I see here are the
/camera/aligned_depth_to_color topics, which publish the [ aligned depth maps
](https://dev.intelrealsense.com/docs/align-depth) . What am I missing here?
Thanks in advance.

---

The text was updated successfully, but these errors were encountered:


    * [ CI/CD & Automation ](/solutions/ci-cd/)
    * [ DevOps ](/solutions/devops/)
    * [ DevSecOps  ](https://resources.github.com/devops/fundamentals/devsecops/)


##  Comments


606  result->image.at<cv::Vec3b>(j, i) = cv::Vec3b(  int  (rgb[2] * 255),
int(rgb[1] * 255), int(rgb[0] * 255));


689  {


[ 392 ](namespacecv__bridge.html#acbf2da402f4d3e505613e95b5a2aed35) [
CvImagePtr
](../../../../api/roscpp_traits/html/classboost_1_1shared__ptr.html) [
toCvCopy ](namespacecv__bridge.html#acbf2da402f4d3e505613e95b5a2aed35) (
const  sensor_msgs::ImageConstPtr& source,


370  size_t  size = ros_image.step * [ image
](classcv__bridge_1_1CvImage.html#a8b0cc1c26637754fbccb91b4fc086526) .rows;


631  }


**Definition:** [ cv_bridge.h:261 ](cv__bridge_8h_source.html#l00261)


100  boost::cmatch m;


[ sensor_msgs::image_encodings::BGR8
](../../../../api/sensor_msgs/html/namespacesensor__msgs_1_1image__encodings.html#a4e6f21877b4f17ef08effa5c79db1d1b)


332  if  (src_depth == 8 && dst_depth == 16)


All reactions


Labels


March 1, 2014, 10:11 am


[ ↂ
](////lists288.rssing.com/chan-11077187/article374.html#c11077187a374i164684108
"Top 20 Hot and Sexy Dragon Ball Z Girls \(Characters\)")


Copy link


[ Go to the documentation of this file. ](cv__bridge_8cpp.html)


442  }


[ ![@MartyG-
RealSense](https://avatars.githubusercontent.com/u/41145062?s=80&v=4)
](/MartyG-RealSense)


611  }


568  (enc::bitDepth(source->encoding) == 16))


Include my email address so I can be contacted


](https://robotics.stackexchange.com/a/105440/16739)

---

👍  1  gonultasbu reacted with thumbs up emoji
All reactions
  * 👍  1 reaction
Sorry, something went wrong.
[ ![@CameronDevine](https://avatars.githubusercontent.com/u/10394896?s=80&v=4)
](/CameronDevine)
Copy link
Contributor
###
**[ CameronDevine ](/CameronDevine) ** commented  Nov 15, 2023
[ @monajalal ](https://github.com/monajalal) Looking at your stackexchange
post I think the problem might have to do with a missing docker volume
mounting.

---

All reactions
Sorry, something went wrong.
[ Sign up for free ](/join?source=comment-repo) **to join this conversation on
GitHub** . Already have an account? [ Sign in to comment
](/login?return_to=https%3A%2F%2Fgithub.com%2FIntelRealSense%2Frealsense-
ros%2Fissues%2F315)
Assignees
No one assigned
Labels
[ ROS Wrapper 2  ](/IntelRealSense/realsense-ros/labels/ROS%20Wrapper%202)
Projects
None yet
Milestone
No milestone
Development
No branches or pull requests
13 participants
[ ![@moorage](https://avatars.githubusercontent.com/u/8590?s=52&v=4)
](/moorage) [
![@monajalal](https://avatars.githubusercontent.com/u/1892917?s=52&v=4)


459  case  [ PNG
](namespacecv__bridge.html#a166887feb09ea6ce14e8742384e574bfa0a36eb1d5d593f0c0c5b298ae353ab94)
:


[ cv_bridge.h ](cv__bridge_8h.html)


156  res[std::make_pair(RGB, BGRA)].push_back(cv::COLOR_RGB2BGRA);


337  image1.convertTo(image2, image2_type);


284  fromTo.reserve(num_channels*byte_depth);


#  Provide feedback


356  {


I am trying to interpret data from a message of the type `sensor_msgs/Image`.
When I run `rostopic echo ...` for the topic, I get the following, along with
the data array: height: 720 width: 1280 encoding: 32FC1 is_bigendian: 0 step:
5120 The
[documentation](http://docs.ros.org/api/sensor_msgs/html/msg/Image.html) says
that the size of the array should be `step` times `rows` (i.e. height). This
gives `720` times `5120` = 3686400 which is good because it says that 4 uint8
data elements in data array should be combined to get the 32 bit float value
(see the encoding; `4` times `1280`=5120 which is the step size). To confirm
the size of the data array, I edited my subscriber (added at the end) to read
array elements corresponding to indices `3686400 to 4686400`. I expected an
error at the very beginning, but it threw a segmentation fault only after the
index `3690487` . How can this be explained? What am I doing wrong? All the
output values corresponding to these indices are zero. Right now this is how
my subscriber looks: #include  #include "ros/ros.h" //#include
"std_msgs/String.h" #include "sensor_msgs/Image.h" using namespace std; void
depthCallback(const sensor_msgs::Image::ConstPtr& msg) { for(int
i=3686400;iheight); ROS_INFO("Depth Info: [%d]", msg->data[i]); cout


  * [ Code  ](/IntelRealSense/realsense-ros)
  * [ Issues  ](/IntelRealSense/realsense-ros/issues)
  * [ Pull requests  ](/IntelRealSense/realsense-ros/pulls)
  * [ Discussions  ](/IntelRealSense/realsense-ros/discussions)
  * [ Actions  ](/IntelRealSense/realsense-ros/actions)
  * [ Projects  ](/IntelRealSense/realsense-ros/projects)
  * [ Wiki  ](/IntelRealSense/realsense-ros/wiki)
  * [ Security  ](/IntelRealSense/realsense-ros/security)
  * [ Insights  ](/IntelRealSense/realsense-ros/pulse)


367  ros_image.encoding = [ encoding
](classcv__bridge_1_1CvImage.html#ac3e39d95b3691df0b08496267517f2db) ;


293  // Interpret mat_swap back as the proper type


Resources


276  return  mat;


[ ![Very Hungry Caterpillar™ Shirt: World of Eric Carle™+ Little Goodall
by...](//i.etsystatic.com/6018612/r/il/7591e4/3868173454/il_570xN.3868173454_gxfr.jpg)
](////cryptomnesia.rssing.com/chan-1183730/article16627.html#c1183730a16627i1139077293)


458  return  "jp2"  ;


Hello, I came to know from
[this](http://ieeexplore.ieee.org/stamp/stamp.jsp?arnumber=6521938) , kinect
gives a invalid flag on for depth value less than 40cm distance. My question
was how using ROS, I can read the invalid flag within the blind zone(less than
40 cm). I wrote a publisher which read from /camera/depth/points as PCL2 and
then calculated the ibstacle distacle. It publishes data to another topic. But
for moving objects which suddenly came in front of kinect in les the 40 cm
then it cannot detect obstacle. Can anyone please help me regarding this?
thank you.


                 /camera/aligned_depth_to_color/image_raw                                            7 msgs    : sensor_msgs/Image
                 /camera/aligned_depth_to_color/image_raw/compressed                                 7 msgs    : sensor_msgs/CompressedImage
                 /camera/aligned_depth_to_color/image_raw/compressed/parameter_descriptions          1 msg     : dynamic_reconfigure/ConfigDescription
                 /camera/aligned_depth_to_color/image_raw/compressed/parameter_updates               1 msg     : dynamic_reconfigure/Config
                 /camera/aligned_depth_to_color/image_raw/compressedDepth                            7 msgs    : sensor_msgs/CompressedImage
                 /camera/aligned_depth_to_color/image_raw/compressedDepth/parameter_descriptions     1 msg     : dynamic_reconfigure/ConfigDescription
                 /camera/aligned_depth_to_color/image_raw/compressedDepth/parameter_updates          1 msg     : dynamic_reconfigure/Config
                 /camera/aligned_depth_to_color/image_raw/theora                                     3 msgs    : theora_image_transport/Packet
                 /camera/aligned_depth_to_color/image_raw/theora/parameter_descriptions              1 msg     : dynamic_reconfigure/ConfigDescription
                 /camera/aligned_depth_to_color/image_raw/theora/parameter_updates                   1 msg     : dynamic_reconfigure/Config
                 /camera/color/camera_info                                                          28 msgs    : sensor_msgs/CameraInfo
                 /camera/color/image_raw                                                            27 msgs    : sensor_msgs/Image
                 /camera/color/image_raw/compressed                                                 31 msgs    : sensor_msgs/CompressedImage
                 /camera/color/image_raw/compressed/parameter_descriptions                           1 msg     : dynamic_reconfigure/ConfigDescription
                 /camera/color/image_raw/compressed/parameter_updates                                1 msg     : dynamic_reconfigure/Config
                 /camera/color/image_raw/compressedDepth/parameter_descriptions                      1 msg     : dynamic_reconfigure/ConfigDescription
                 /camera/color/image_raw/compressedDepth/parameter_updates                           1 msg     : dynamic_reconfigure/Config
                 /camera/color/image_raw/theora                                                     30 msgs    : theora_image_transport/Packet
                 /camera/color/image_raw/theora/parameter_descriptions                               1 msg     : dynamic_reconfigure/ConfigDescription
                 /camera/color/image_raw/theora/parameter_updates                                    1 msg     : dynamic_reconfigure/Config
                 /camera/color/metadata                                                             28 msgs    : realsense2_camera/Metadata
                 /camera/depth/camera_info                                                         173 msgs    : sensor_msgs/CameraInfo
                 /camera/depth/image_rect_raw                                                      174 msgs    : sensor_msgs/Image
                 /camera/depth/image_rect_raw/compressed                                           123 msgs    : sensor_msgs/CompressedImage
                 /camera/depth/image_rect_raw/compressed/parameter_descriptions                      1 msg     : dynamic_reconfigure/ConfigDescription
                 /camera/depth/image_rect_raw/compressed/parameter_updates                           1 msg     : dynamic_reconfigure/Config
                 /camera/depth/image_rect_raw/compressedDepth                                      123 msgs    : sensor_msgs/CompressedImage
                 /camera/depth/image_rect_raw/compressedDepth/parameter_descriptions                 1 msg     : dynamic_reconfigure/ConfigDescription
                 /camera/depth/image_rect_raw/compressedDepth/parameter_updates                      1 msg     : dynamic_reconfigure/Config
                 /camera/depth/image_rect_raw/theora                                                 3 msgs    : theora_image_transport/Packet
                 /camera/depth/image_rect_raw/theora/parameter_descriptions                          1 msg     : dynamic_reconfigure/ConfigDescription
                 /camera/depth/image_rect_raw/theora/parameter_updates                               1 msg     : dynamic_reconfigure/Config
                 /camera/depth/metadata                                                            172 msgs    : realsense2_camera/Metadata
                 /camera/extrinsics/depth_to_color                                                   1 msg     : realsense2_camera/Extrinsics
                 /camera/realsense2_camera_manager/bond                                             88 msgs    : bond/Status                           (2 connections)
                 /camera/rgb_camera/auto_exposure_roi/parameter_descriptions                         1 msg     : dynamic_reconfigure/ConfigDescription
                 /camera/rgb_camera/auto_exposure_roi/parameter_updates                              1 msg     : dynamic_reconfigure/Config
                 /camera/rgb_camera/parameter_descriptions                                           1 msg     : dynamic_reconfigure/ConfigDescription
                 /camera/rgb_camera/parameter_updates                                                1 msg     : dynamic_reconfigure/Config
                 /camera/stereo_module/auto_exposure_roi/parameter_descriptions                      1 msg     : dynamic_reconfigure/ConfigDescription


[ ↂ
](////barbados171.rssing.com/chan-13839764/article16821.html#c13839764a16821i186843027
"Woman is 21st murder victim")


[ cv_bridge ](namespacecv__bridge.html)


[ ](javascript:; "Ouch") 0


561  else


403  }


Toggle navigation


edited


#  Saved searches


646  cv::Mat(source->image-min_image_value).convertTo(img_scaled->image,
CV_8UC3, 255.0 /


**[ monajalal ](/monajalal) ** commented  Nov 16, 2023


123  if  ((encoding == enc::RGB8) || (encoding == enc::RGB16))  return  RGB;


Title:


[ ](https://github.com "GitHub") © 2024 GitHub, Inc.


    /camera/depth/image_rect_raw
    /camera/depth/image_rect_raw/compressed
    /camera/depth/image_rect_raw/compressed/parameter_descriptions
    /camera/depth/image_rect_raw/compressed/parameter_updates
    /camera/depth/image_rect_raw/compressedDepth
    /camera/depth/image_rect_raw/compressedDepth/parameter_descriptions
    /camera/depth/image_rect_raw/compressedDepth/parameter_updates
    /camera/depth/image_rect_raw/theora
    /camera/depth/image_rect_raw/theora/parameter_descriptions
    /camera/depth/image_rect_raw/theora/parameter_updates
    /camera/depth/metadata
    /camera/depth_registered/points
    /camera/extrinsics/depth_to_color
    /camera/motion_module/parameter_descriptions
    /camera/motion_module/parameter_updates
    /camera/realsense2_camera_manager/bond
    /camera/rgb_camera/auto_exposure_roi/parameter_descriptions
    /camera/rgb_camera/auto_exposure_roi/parameter_updates
    /camera/rgb_camera/parameter_descriptions
    /camera/rgb_camera/parameter_updates
    /camera/stereo_module/auto_exposure_roi/parameter_descriptions
    /camera/stereo_module/auto_exposure_roi/parameter_updates
    /camera/stereo_module/parameter_descriptions
    /camera/stereo_module/parameter_updates
    /diagnostics
    /rosout
    /rosout_agg
    /tf
    /tf_static


#  [ publish disparity from depth - Kinect
](//question2135.rssing.com/chan-36145539/article61-live.html)


604  cv::Vec3d rgb = [ rgb_colors::getRGBColor
](namespacecv__bridge_1_1rgb__colors.html#ae0042fb7032cf0b5a4770f7d16c6cc90)
(label);


334  else  if  (src_depth == 16 && dst_depth == 8)


#  [ Turtlebot depth image not showing in image_view
](//question2135.rssing.com/chan-36145539/article68-live.html)


668  source_typed->encoding = source->encoding;


Copy link


[ cv_bridge::cvtColorForDisplay
](namespacecv__bridge.html#ac82f0aba256a6eac48cf4378a8990268)


165  res[std::make_pair(RGBA, BGR)].push_back(cv::COLOR_RGBA2BGR);


602  else


###  [ People's Blog • Germany Bans the Number 44
](////political6769.rssing.com/chan-78425830/article66.html#c78425830a66i1994484930)


**Definition:** [ cv_bridge.h:48 ](cv__bridge_8h_source.html#l00048)


New issue


    /camera/depth/image_rect_raw/compressed
    /rosout
    /camera/depth/camera_info
    /camera/depth/metadata
    /camera/depth/image_rect_raw
    /rosout_agg
    /camera/depth/image_rect_raw/compressedDepth
    /camera/depth/image_rect_raw/compressed
    /camera/depth/camera_info
    /rosout
    /camera/depth/metadata
    /camera/depth/image_rect_raw
    /rosout_agg
    /diagnostics
    /diagnostics
    /diagnostics
    /diagnostics
    /camera/depth/image_rect_raw/compressedDepth
    /camera/depth/image_rect_raw/compressed
    /camera/depth/camera_info
    /rosout
    /camera/depth/metadata
    /camera/depth/image_rect_raw
    /rosout_agg
    /camera/realsense2_camera_manager/bond
    /camera/realsense2_camera_manager/bond
    /camera/depth/image_rect_raw/compressedDepth
    /camera/depth/image_rect_raw/compressed
    /rosout
    /camera/depth/camera_info
    /camera/depth/metadata
    /camera/depth/image_rect_raw
    /rosout_agg
    /camera/depth/image_rect_raw/compressedDepth
    /camera/depth/image_rect_raw/compressed
    /camera/depth/metadata
    /rosout
    /camera/depth/camera_info
    /camera/depth/image_rect_raw
    /rosout_agg


310  if  (dst_encoding.empty() || dst_encoding == src_encoding)


665  [ CvImagePtr
](../../../../api/roscpp_traits/html/classboost_1_1shared__ptr.html)
source_typed(  new  [ CvImage
](classcv__bridge_1_1CvImage.html#adcb3774384cd81c101f3c9beedede4e7) ());


Toggle navigation


**[ MartyG-RealSense ](/MartyG-RealSense) ** commented  Jun 28, 2022  •


425  ptr->image = matFromImage(source);


546  throw  [ Exception ](classcv__bridge_1_1Exception.html) (
"cv_bridge.cvtColorForDisplay() called with empty image."  );


395  return  [ toCvCopy
](namespacecv__bridge.html#acbf2da402f4d3e505613e95b5a2aed35) (*source,
encoding);


650  if  (source->encoding == enc::TYPE_32FC1) {


424  ptr->tracked_object_ = tracked_object;


[ ](javascript:; "Share Article") [
](//www.rssing.com/contact.php?r=o6&u=%2F%2Fquestion2135.rssing.com%2Fchan-36145539%2Farticle71-live.html
"Article Support")


    /camera/depth/image_rect_raw/compressed
    /rosout
    /camera/depth/camera_info
    /camera/depth/metadata
    /camera/depth/image_rect_raw
    /rosout_agg
    /camera/realsense2_camera_manager/bond
    /camera/realsense2_camera_manager/bond
    /camera/depth/image_rect_raw/compressedDepth
    /camera/depth/image_rect_raw/compressed
    /camera/depth/camera_info
    /rosout
    /camera/depth/metadata
    /camera/depth/image_rect_raw
    /rosout_agg
    /diagnostics
    /diagnostics
    /diagnostics
    /diagnostics
    /camera/depth/image_rect_raw/compressedDepth
    /camera/depth/image_rect_raw/compressed
    /rosout
    /camera/depth/metadata
    /camera/depth/camera_info
    /camera/depth/image_rect_raw
    /rosout_agg
    /camera/depth/image_rect_raw/compressedDepth
    /camera/depth/image_rect_raw/compressed
    /rosout
    /camera/depth/camera_info
    /camera/depth/metadata
    /camera/depth/image_rect_raw
    /rosout_agg
    /camera/realsense2_camera_manager/bond
    /camera/realsense2_camera_manager/bond
    /camera/depth/image_rect_raw/compressedDepth
    /camera/depth/image_rect_raw/compressed
    /rosout
    /camera/depth/camera_info
    /camera/depth/metadata


###  [ People's Blog • First Pictures of the Eclipse ! ! !
](////satire6144.rssing.com/chan-78334822/article122.html#c78334822a122i1295535114)


[ ![@MartyG-
RealSense](https://avatars.githubusercontent.com/u/41145062?s=80&v=4)
](/MartyG-RealSense)


**[ MartyG-RealSense ](/MartyG-RealSense) ** commented  Feb 7, 2022  •


[ ](javascript:;) Switch Editions?
[ Cancel ](javascript:;)


64  }  else  if  (depth ==  "32S"  ) {


**Definition:** [ cv_bridge.h:68 ](cv__bridge_8h_source.html#l00068)


Labels


[ cv_bridge::Format
](namespacecv__bridge.html#a166887feb09ea6ce14e8742384e574bf)


[ ](javascript:; "Ouch") 0


Is anyone aware of ROS nodes implementing an algorithm to estimate a depth map
from a monocular camera, like described in [this
paper](https://papers.nips.cc/paper/2921-learning-depth-from-single-monocular-
images.pdf)? I've found a little published code such as
[this](https://bitbucket.org/fayao/dcnf-fcsp) and
[this](http://make3d.cs.cornell.edu/code.html) and
[this](https://github.com/asousa/DepthPrediction), but it's all buggy Matlab
code and undocumented.


413  const  [ boost::shared_ptr<void const>
](../../../../api/roscpp_traits/html/classboost_1_1shared__ptr.html) &
tracked_object,


Hi, I am trying to get the coordinates in space (X,Y,Z) of an object. For
this, I am detecting the object using the image from the bumblebee's left
camera (from here I can obtain the X and Y coordinates), and would like to
obtain the Z-coordinate. I have the code for doing this with an Asus Xtion,
but this uses a depth map. Can I get a depth map as well from my bumblebee2
camera? Or should I just use the disparity image I get from stereo_image_proc?
Thanks!


491  [ CvImagePtr
](../../../../api/roscpp_traits/html/classboost_1_1shared__ptr.html) temp;


644  }  else  {


422  ptr->header = source.header;


[ ](javascript:; "Share Article") [
](//www.rssing.com/contact.php?r=o6&u=%2F%2Fquestion2135.rssing.com%2Fchan-36145539%2Farticle70-live.html
"Article Support")


639  img_scaled->header = source->header;


[ ](javascript:; "Share Article") [
](//www.rssing.com/contact.php?r=o6&u=%2F%2Fquestion2135.rssing.com%2Fchan-36145539%2Farticle66-live.html
"Article Support")


630  return  result;


**[ MartyG-RealSense ](/MartyG-RealSense) ** commented  Jun 17, 2022


60  }  else  if  (depth ==  "16U"  ) {


662  }


[ ![@MikeHallettUK](https://avatars.githubusercontent.com/u/57232441?s=80&v=4)
](/MikeHallettUK)


                        cv2.imwrite(depthpath + image_name, (cv_image).astype(np.uint16))

    if __name__ == '__main__':
            ImageCreator('/workspace/mona_2023-11-10-22-05-02.bag', '/workspace/mona_23_11_10/rgb/', '/workspace/mona_23_11_10/depth/', 1, 1)


364  ros_image.header = [ header
](classcv__bridge_1_1CvImage.html#ada0ff87a844dbd6f25a87bf2fee5742f) ;


{{ message }}


296  return  mat_swap;


By Solution


451  case  [ JPG
](namespacecv__bridge.html#a166887feb09ea6ce14e8742384e574bfa45436b05357bb96126834efae66c50e8)
:


378  {


    * [ Actions  Automate any workflow  ](/features/actions)
    * [ Packages  Host and manage packages  ](/features/packages)
    * [ Security  Find and fix vulnerabilities  ](/features/security)
    * [ Codespaces  Instant dev environments  ](/features/codespaces)
    * [ Copilot  Write better code with AI  ](/features/copilot)
    * [ Code review  Manage code changes  ](/features/code-review)
    * [ Issues  Plan and track work  ](/features/issues)
    * [ Discussions  Collaborate outside of code  ](/features/discussions)


375  memcpy((  char  *)(&ros_image.data[0]), [ image
](classcv__bridge_1_1CvImage.html#a8b0cc1c26637754fbccb91b4fc086526) .data,
size);


596  for  (  size_t  j = 0; j < source->image.rows; ++j) {


April 11, 2024, 5:07 am


    * [ Topics ](/topics)
    * [ Trending ](/trending)
    * [ Collections ](/collections)


    /camera/align_to_color/parameter_descriptions
    /camera/align_to_color/parameter_updates
    /camera/aligned_depth_to_color/camera_info
    /camera/aligned_depth_to_color/image_raw
    /camera/aligned_depth_to_color/image_raw/compressed
    /camera/aligned_depth_to_color/image_raw/compressed/parameter_descriptions
    /camera/aligned_depth_to_color/image_raw/compressed/parameter_updates
    /camera/aligned_depth_to_color/image_raw/compressedDepth
    /camera/aligned_depth_to_color/image_raw/compressedDepth/parameter_descriptions
    /camera/aligned_depth_to_color/image_raw/compressedDepth/parameter_updates
    /camera/aligned_depth_to_color/image_raw/theora
    /camera/aligned_depth_to_color/image_raw/theora/parameter_descriptions
    /camera/aligned_depth_to_color/image_raw/theora/parameter_updates
    /camera/color/camera_info
    /camera/color/image_raw
    /camera/color/image_raw/compressed
    /camera/color/image_raw/compressed/parameter_descriptions
    /camera/color/image_raw/compressed/parameter_updates
    /camera/color/image_raw/compressedDepth
    /camera/color/image_raw/compressedDepth/parameter_descriptions
    /camera/color/image_raw/compressedDepth/parameter_updates
    /camera/color/image_raw/theora
    /camera/color/image_raw/theora/parameter_descriptions
    /camera/color/image_raw/theora/parameter_updates
    /camera/color/image_rect_color
    /camera/color/image_rect_color/compressed
    /camera/color/image_rect_color/compressed/parameter_descriptions
    /camera/color/image_rect_color/compressed/parameter_updates
    /camera/color/image_rect_color/compressedDepth
    /camera/color/image_rect_color/compressedDepth/parameter_descriptions
    /camera/color/image_rect_color/compressedDepth/parameter_updates
    /camera/color/image_rect_color/theora
    /camera/color/image_rect_color/theora/parameter_descriptions
    /camera/color/image_rect_color/theora/parameter_updates
    /camera/color/metadata
    /camera/color_rectify_color/parameter_descriptions
    /camera/color_rectify_color/parameter_updates
    /camera/depth/camera_info


Closed
#  d435 on v2.0.2 w/ librealsense v2.10.0:: ` [ERROR] [1518537840.126603320]:
Compressed Depth Image Transport - Compression requires single-channel 32bit-
floating point or 16bit raw depth images (input format is: rgb8). ` #315
[ moorage ](/moorage) opened this issue  Feb 13, 2018  · 20 comments
Labels
[ ROS Wrapper 2  ](/IntelRealSense/realsense-ros/labels/ROS%20Wrapper%202)
##  Comments
[
![@moorage](https://avatars.githubusercontent.com/u/8590?s=80&u=6fd9b2d1bf0397375a129368253fabaa027ff3b2&v=4)
](/moorage)
Copy link
###
**[ moorage ](/moorage) ** commented  Feb 13, 2018  •
edited
I'm getting a lot of errors when running ` rs_rgbd.launch ` when starting up `
rosbag record -a ` and seeing almost no data (just 1 second worth out of 30)
published to ` /camera/depth_registered/points ` on my d435.
I'm running realsense ros v ` 2.0.2 ` with librealsense ` v2.10.0 ` . When I
boot up ` roslaunch realsense_ros_camera rs_rgbd.launch ` , I get a constant
stream of the following error:

    [ERROR] [1518537840.126603320]: Compressed Depth Image Transport - Compression requires single-channel 32bit-floating point or 16bit raw depth images (input format is: rgb8).

Over the course of running the camera for 30 seconds, occasionally, there's
some of these interspersed:

    [ERROR] [1518537921.717247204]: cv_bridge exception: '[16UC1] is not a color format. but [bgr8] is. The conversion does not make sense'
    [ERROR] [1518537921.726020775]: Compressed Depth Image Transport - Compression requires single-channel 32bit-floating point or 16bit raw depth images (input format is: rgb8).

As well as these, a couple times (not regularly):

     13/02 08:04:04,348 WARNING [140517392402176] (backend-v4l2.cpp:825) Frames didn't arrived within 5 seconds

This also happens once:


386  cv_data_ptr += [ image
](classcv__bridge_1_1CvImage.html#a8b0cc1c26637754fbccb91b4fc086526) .step;


[ _≪_ Previous: rviz does not display the depth cloud
](//question2135.rssing.com/chan-36145539/all_p4.html#c36145539a67 "Previous
Article")


    * [ CI/CD & Automation ](/solutions/ci-cd/)
    * [ DevOps ](/solutions/devops/)
    * [ DevSecOps  ](https://resources.github.com/devops/fundamentals/devsecops/)


526  break  ;


121  if  ((encoding == enc::MONO8) || (encoding == enc::MONO16))  return  [
GRAY
](namespacecv__bridge_1_1rgb__colors.html#aa6343a2cb9080c11afefb714570c63cca04e661921a463f3df840acbb03527c98)
;


[ cv_bridge::PNG
](namespacecv__bridge.html#a166887feb09ea6ce14e8742384e574bfa0a36eb1d5d593f0c0c5b298ae353ab94)


418  (boost::endian::order::native != boost::endian::order::big)))


May 5, 2016, 7:34 am


380  uchar* ros_data_ptr = (uchar*)(&ros_image.data[0]);


Closed


[ 355 ](classcv__bridge_1_1CvImage.html#a48a7cc72fa96bdf0180d0306543ceb07)
sensor_msgs::ImagePtr [ CvImage::toImageMsg
](classcv__bridge_1_1CvImage.html#a48a7cc72fa96bdf0180d0306543ceb07) ()  const


24  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS


490  [ CvImagePtr
](../../../../api/roscpp_traits/html/classboost_1_1shared__ptr.html) tempThis
= boost::make_shared<CvImage>(*this);


133  // We don't support conversions to/from other types


###  [ Decoration of the High Command of the Hitler Youth for Distinguished
Foreigners
](////ailsby1.rssing.com/chan-14855252/article8.html#c14855252a8i1619676318)


239  std::vector<int> res = val->second;


##  Top-Rated Images


316  {


[ ](//www.rssing.com/index.php?zw=2123 "Home") [ $ ](javascript:; "MoMoney")


[ _≪_ Previous: Intel RealSense depth camera on Ubuntu Arm
](//question2135.rssing.com/chan-36145539/all_p4.html#c36145539a64 "Previous
Article")


'image_transport/compressed' - 'image_transport/compressedDepth' -
'image_transport/theora' </rosparam> <rosparam
param="/realsense/depth/image_rect_raw/disable_pub_plugins" > -
'image_transport/compressed' - 'image_transport/compressedDepth' -
'image_transport/theora' </rosparam> <rosparam
param="/realsense/color/image_raw/disable_pub_plugins" > -
'image_transport/compressed' - 'image_transport/compressedDepth' -
'image_transport/theora' </rosparam> `

---

👍  2  wx-b and shnhrtkyk reacted with thumbs up emoji
All reactions
  * 👍  2 reactions
Sorry, something went wrong.
This was referenced  Jun 5, 2019
[ error when try rosbag record it  #725  ](/IntelRealSense/realsense-
ros/issues/725)
Closed
[ cv_bridge exception: '[16UC1] is not a color format. but [bgr8] is.  #797
](/IntelRealSense/realsense-ros/issues/797)
Closed
[ ![@CameronDevine](https://avatars.githubusercontent.com/u/10394896?s=80&v=4)
](/CameronDevine)
Copy link
Contributor
###
**[ CameronDevine ](/CameronDevine) ** commented  Sep 13, 2019
I was able to get around this issue by using the ` -x ` option in ` rosbag `
to exclude the one topic that was causing issues. The full command to do this
is,

    rosbag record -a -x ".*(theora)"

---

👍  2  malleshamdasari and ashBabu reacted with thumbs up emoji
All reactions
  * 👍  2 reactions


Format


103  boost::regex(  "(8U|8S|16U|16S|32S|32F|64F)C([0-9]+)"  ))) {


Hello, I am trying to find the closest object to a zed camera. I am using the
package: [zed_wrapper](http://wiki.ros.org/zed-ros-wrapper). I need to find
the depth (z value) of each pixel in the scene. My understanding is that the
topic: > /camera/depth/image_rect_color will provide me the required
information. The command `rostopic type /camera/depth/image_rect_color`
returned sensor_msgs/Image which I believe is the msg type for depth images.
The command `rosmsg show sensor_msgs/Image` returned std_msgs/Header header
uint32 seq time stamp string frame_id uint32 height uint32 width string
encoding uint8 is_bigendian uint32 step uint8[] data I believe that the last
field: > uint8[] data gives the actual info. I believe that at this point, I
should write a subscriber. Do I have enough information to write a subscriber?
Is there any other way I can get this information without writing a
subscriber? Kindly help. Thank You.


[ 429 ](namespacecv__bridge.html#ab9a4ba669b03a3b0a35651a6c0d77be1) [
CvImagePtr
](../../../../api/roscpp_traits/html/classboost_1_1shared__ptr.html) [
cvtColor ](namespacecv__bridge.html#ab9a4ba669b03a3b0a35651a6c0d77be1) (
const  [ CvImageConstPtr
](../../../../api/roscpp_traits/html/classboost_1_1shared__ptr.html) & source,


[ ![19 Reader-Favourite March Purchases — From Steals To
Splurges](//www.refinery29.com/images/11700583.png?auto=webp&width=600&height=600&quality=85&crop=1:1)
](////refinery1042.rssing.com/chan-72297680/article18978.html#c72297680a18978i36572736)


233  std::map<std::pair<Encoding, Encoding>, std::vector<int>
>::const_iterator val = CONVERSION_CODES.find(key);


I am subscribing to the topic `/camera/depth/image_rect_color` in the package
[zed-ros-wrapper](http://wiki.ros.org/zed-ros-wrapper) to obtain depth
information using a zed camera. Right now, my subscriber looks at a random
pixel and reads the depth information. Is there any way to find out which
pixel corresponds to what element(index) in the matrix? Also if I run
`rostopic echo /camera/depth/image_rect_color`, I find that the encoding is
`32FC1`. But the data matrix is `int` (I believe `unit8` denotes `int`). Also,
I haven't seen any value above 255. So, the matrix looks like `8UC1`. What am
I missing here or how does a 32FC1 matrix looks like?


     * /camera2/realsense2_camera/infra2_fps: 30
     * /camera2/realsense2_camera/infra2_height: 480
     * /camera2/realsense2_camera/infra2_optical_frame_id: camera_infra2_opt...
     * /camera2/realsense2_camera/infra2_width: 640
     * /camera2/realsense2_camera/json_file_path:
     * /camera2/realsense2_camera/serial_no: 805212060530
     * /rosdistro: kinetic
     * /rosversion: 1.12.7

    NODES
      /camera2/
        realsense2_camera (nodelet/nodelet)
        realsense2_camera_manager (nodelet/nodelet)
      /camera1/
        realsense2_camera (nodelet/nodelet)
        realsense2_camera_manager (nodelet/nodelet)

    ROS_MASTER_URI=http://localhost:11311
    rs_multiple_devices.launch http://localhost:11311
    core service [/rosout] found
    process[camera1/realsense2_camera_manager-1]: started with pid [1310]
    process[camera1/realsense2_camera-2]: started with pid [1311]
    process[camera2/realsense2_camera_manager-3]: started with pid [1312]
    process[camera2/realsense2_camera-4]: started with pid [1314]
    [camera2/realsense2_camera-4] killing on exit
    [camera2/realsense2_camera_manager-3] killing on exit
    [camera1/realsense2_camera_manager-1] killing on exit
    shutting down processing monitor...
    ... shutting down processing monitor complete
    done

It would be a great assistance if you could look into the issue. Thanks.

---

All reactions
Sorry, something went wrong.
[ ![@basvroeg](https://avatars.githubusercontent.com/u/35264855?s=80&v=4)
](/basvroeg)
Copy link


* Solutions


URL:


4  * Copyright (c) 2011, Willow Garage, Inc.


150  res[std::make_pair( [ GRAY
](namespacecv__bridge_1_1rgb__colors.html#aa6343a2cb9080c11afefb714570c63cca04e661921a463f3df840acbb03527c98)
, RGBA)].push_back(cv::COLOR_GRAY2RGBA);


![Saline County Jail Booking Activity – Saturday, October
3rd](//thepost.s3.amazonaws.com/wp-content/uploads/2015/10/Quinn-Brian-
Wade-300x203.jpg)


[ 398 ](namespacecv__bridge.html#a49fedf7e642d505557b866f6e307a034) [
CvImagePtr
](../../../../api/roscpp_traits/html/classboost_1_1shared__ptr.html) [
toCvCopy ](namespacecv__bridge.html#acbf2da402f4d3e505613e95b5a2aed35) (
const  sensor_msgs::Image& source,


sensor_msgs::ImagePtr toImageMsg() const


    /rosout_agg
    /rosout_agg
    /rosout_agg
    /rosout_agg
    /camera/color/camera_info
    /camera/color/image_raw/compressed
    /camera/color/image_raw
    /camera/color/image_raw/theora
    /camera/color/metadata
    /camera/color/camera_info
    /rosout
    /camera/color/image_raw/compressed
    /camera/color/image_raw
    /camera/realsense2_camera_manager/bond
    /camera/color/image_raw/theora
    /camera/color/metadata
    /camera/color/camera_info
    /camera/color/image_raw/compressed
    /camera/color/image_raw
    /camera/depth/metadata
    /camera/depth/metadata
    /camera/color/image_raw/theora
    /camera/color/metadata
    /camera/color/camera_info
    /camera/color/image_raw/compressed
    /camera/color/image_raw
    /rosout_agg
    /rosout_agg
    /rosout_agg
    /rosout_agg
    /rosout_agg
    /camera/depth/camera_info
    /camera/color/image_raw/theora
    /camera/color/metadata
    /camera/depth/image_rect_raw
    /camera/depth/camera_info
    /camera/depth/image_rect_raw
    /camera/color/camera_info
    /rosout
    /rosout


* [ src ](dir_68267d1309a1af8e8297ef4c3efbcdba.html)


* [ The ReadME Project  GitHub community articles  ](/readme)


[ ](javascript:; "Like") 0


[ _≫_ Next: subscribing rgb and depth simutaneously very slow
](//question2135.rssing.com/chan-36145539/all_p4.html#c36145539a69 "Next
Article")


###  [ Frequency Adverbs
](////adverbs45.rssing.com/chan-14763103/article227.html#c14763103a227i286089440)


452  return  "jpg"  ;


94  if  (encoding == enc::BAYER_GRBG16)  return  CV_16UC1;


324  {


186  res[std::make_pair(BAYER_BGGR, BGR)].push_back(cv::COLOR_BayerRG2BGR);


Hi [ @monajalal ](https://github.com/monajalal) Do you see the same color
format error if you perform an **RGBD** launch instead of rs_camera.launch? An
RGBD launch can be performed with the steps below.


213  throw  [ Exception ](classcv__bridge_1_1Exception.html) (  "["  \+
src_encoding +  "] is not a color format. but ["  \+ dst_encoding +


[ cv_bridge::cvtColor
](namespacecv__bridge.html#ab9a4ba669b03a3b0a35651a6c0d77be1)


Hi [ @MikeHallettUK ](https://github.com/MikeHallettUK) Whilst the rs_rgbd
launch file enables depth-color alignment by default, the rs_camera one does
not. There is not a provided reason for this. You can enable it by adding the
term **align_depth:=true** to your roslaunch instruction.


190  res[std::make_pair(BAYER_GBRG, BGR)].push_back(cv::COLOR_BayerGR2BGR);


158  res[std::make_pair(BGR, [ GRAY
](namespacecv__bridge_1_1rgb__colors.html#aa6343a2cb9080c11afefb714570c63cca04e661921a463f3df840acbb03527c98)
)].push_back(cv::COLOR_BGR2GRAY);


#  [ERROR] [1699653946.712325915]: cv_bridge exception: '[16UC1] is not a
color format. but [bgr8] is. The conversion does not make sense' during
roslaunch realsense2_camera rs_camera.launch align_depth:=true  #2929


468  return  "ras"  ;


681  else  if  (source->encoding ==  "CV_16UC4"  )


Image encoding ("mono8", "bgr8", etc.)


[ ](javascript:; "Share Article") [
](//www.rssing.com/contact.php?r=o6&u=%2F%2Fquestion2135.rssing.com%2Fchan-36145539%2Farticle77-live.html
"Article Support")


[ _≫_ Next: Intel RealSense depth camera on Ubuntu Arm
](//question2135.rssing.com/chan-36145539/all_p4.html#c36145539a64 "Next
Article")


126  if  (encoding == enc::YUV422)  return  [ YUV422
](../../../../api/sensor_msgs/html/namespacesensor__msgs_1_1image__encodings.html#a4cd4806e2221b58787bf6fa643ccf60d)
;


CvImageConstPtr toCvShare(const sensor_msgs::ImageConstPtr &source, const
std::string &encoding=std::string())


Query


523  {


419  return  [ toCvCopy
](namespacecv__bridge.html#acbf2da402f4d3e505613e95b5a2aed35) (source,
encoding);


Copy link


[ X ](javascript:;) 0


[ _≫_ Next: How to obtain depth coordinate using two,widely sperated, cameras:
ROS, python Baxter
](//question2135.rssing.com/chan-36145539/all_p4.html#c36145539a73 "Next
Article")


96  // Miscellaneous


    /camera/color/image_raw/theora
    /camera/color/metadata
    /camera/color/camera_info
    /camera/color/image_raw/compressed
    /camera/color/image_raw
    /camera/color/image_raw/theora
    /camera/color/metadata
    /camera/depth/metadata
    /camera/color/camera_info
    /camera/color/image_raw/compressed
    /camera/color/image_raw
    /camera/color/image_raw/theora
    /camera/color/metadata
    /rosout
    /rosout_agg
    /rosout
    /rosout
    /rosout_agg
    /rosout_agg
    /rosout_agg
    /rosout_agg
    /rosout_agg
    /camera/aligned_depth_to_color/camera_info
    /camera/aligned_depth_to_color/image_raw/compressedDepth
    /camera/aligned_depth_to_color/image_raw/compressed
    /rosout
    /rosout
    /camera/aligned_depth_to_color/image_raw
    /camera/color/camera_info
    /rosout_agg
    /rosout_agg
    /camera/color/image_raw/compressed
    /camera/color/image_raw
    /camera/depth/camera_info
    /camera/color/image_raw/theora
    /camera/color/metadata
    /rosout
    /camera/depth/metadata
    /camera/depth/image_rect_raw
    /rosout_agg


416  // If the encoding different or the endianness different, you have to
copy


3  *


483  cv::Mat [ image
](classcv__bridge_1_1CvImage.html#a8b0cc1c26637754fbccb91b4fc086526) ;


**Definition:** [ cv_bridge.cpp:55 ](cv__bridge_8cpp_source.html#l00055)


303  const  std::string& dst_encoding)


207  bool  is_num_channels_the_same = (enc::numChannels(src_encoding) ==
enc::numChannels(dst_encoding));


###  [ First Pictures of the Eclipse ! ! !
](////political6691.rssing.com/chan-78391714/article69.html#c78391714a69i1437484910)


April 8, 2024, 1:08 pm


**Definition:** [ cv_bridge.h:67 ](cv__bridge_8h_source.html#l00067)


Closed


623  {


265  std::stringstream ss;


**[ MikeHallettUK ](/MikeHallettUK) ** commented  Jun 16, 2022


174  res[std::make_pair( [ YUV422
](../../../../api/sensor_msgs/html/namespacesensor__msgs_1_1image__encodings.html#a4cd4806e2221b58787bf6fa643ccf60d)
, RGB)].push_back(cv::COLOR_YUV2RGB_UYVY);


460  return  "png"  ;


    root@8603c293ad2b:/workspace/catkin_ws# roslaunch realsense2_camera rs_camera.launch align_depth:=true

    ETC MESSAGES

    [ERROR] [1699653946.712325915]: cv_bridge exception: '[16UC1] is not a color format. but [bgr8] is. The conversion does not make sense'


Copy link


688  try


    /rosout
    /camera/depth/camera_info
    /camera/depth/metadata
    /camera/depth/image_rect_raw
    /rosout_agg
    /camera/realsense2_camera_manager/bond
    /camera/realsense2_camera_manager/bond
    /camera/depth/image_rect_raw/compressedDepth
    /camera/depth/image_rect_raw/compressed
    /rosout
    /camera/depth/camera_info
    /camera/depth/metadata
    /rosout_agg
    /camera/depth/image_rect_raw
    /diagnostics
    /diagnostics
    /diagnostics
    /diagnostics
    /camera/depth/image_rect_raw/compressedDepth
    /camera/depth/image_rect_raw/compressed
    /camera/depth/image_rect_raw
    /rosout
    /camera/depth/camera_info
    /camera/depth/metadata
    /rosout_agg
    /camera/depth/image_rect_raw/compressedDepth
    /camera/depth/image_rect_raw/compressed
    /camera/depth/camera_info
    /rosout
    /camera/depth/metadata
    /camera/depth/image_rect_raw
    /rosout_agg
    /camera/realsense2_camera_manager/bond
    /camera/realsense2_camera_manager/bond
    /camera/depth/image_rect_raw/compressedDepth
    /camera/depth/image_rect_raw/compressed
    /rosout
    /camera/depth/camera_info
    /camera/depth/image_rect_raw
    /camera/depth/metadata


124  if  ((encoding == enc::BGRA8) || (encoding == enc::BGRA16))  return
BGRA;


401  // Construct matrix pointing to source data


Sorry, something went wrong.


29  * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER


645  img_scaled->encoding = enc::BGR8;


[ cv_bridge::JPG
](namespacecv__bridge.html#a166887feb09ea6ce14e8742384e574bfa45436b05357bb96126834efae66c50e8)


598  int  label = source->image.at< int  >(j, i);


212  if  (is_dst_color_format)


589  if  (encoding == [ sensor_msgs::image_encodings::BGR8
](../../../../api/sensor_msgs/html/namespacesensor__msgs_1_1image__encodings.html#a4e6f21877b4f17ef08effa5c79db1d1b)
&&


[ ](javascript:; "Ouch") 0


**Definition:** [ cv_bridge.h:64 ](cv__bridge_8h_source.html#l00064)


**[ MikeHallettUK ](/MikeHallettUK) ** commented  Jun 28, 2022


and I am able to see ` color_raw `


const std::string BGR8


[ ](javascript:; "Share Article") [
](//www.rssing.com/contact.php?r=o6&u=%2F%2Fquestion2135.rssing.com%2Fchan-36145539%2Farticle78-live.html
"Article Support")


474  return  "tiff"  ;


Closed


Copy link


222  if  (!is_dst_color_format) {


[ Sign up
](/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-
name%3E%2F%3Crepo-
name%3E%2Fvoltron%2Fissues_fragments%2Fissue_layout&source=header-
repo&source_repo=IntelRealSense%2Flibrealsense)


87  if  (encoding == enc::BAYER_RGGB8)  return  CV_8UC1;


static int depthStrToInt(const std::string depth)


[ ](//www.rssing.com/index.php?zw=2123 "Home") [ $ ](javascript:; "MoMoney")


[ Search ](javascript:;)


Mike

---

All reactions


![Frequency
Adverbs](//busyteacher.org/uploads/posts/2014-04/thumbs/1396577766_adverbs-of-
frecuency-0.png)


Name


243  return  res;


613  // Perform scaling if asked for


26  * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,


520  const  cv::Mat rgb_a = cv::imdecode(in, cv::IMREAD_UNCHANGED);


**Have a question about this project?** Sign up for a free GitHub account to
open an issue and contact its maintainers and the community.


I was wondering if any more information could be provided on the support for
ordered RGB-D PointClouds for RealSense depth cameras. According to the
documentation, [ support for ordered pointclouds is included by the rgbd-
launch ros package ](https://dev.intelrealsense.com/docs/pointcloud-
visualization#section-2-ordered-pointcloud-using-rgbd) . When this package is
used, what topic is meant to publish the ordered PointCloud? These are the
topics that I see from rostopic list:


[ cv_bridge::depthStrToInt
](namespacecv__bridge.html#a76369e4bbe0a2fda233cf5d4640ba2aa)


441  return  ptr;


###  [ Top 20 Hot and Sexy Dragon Ball Z Girls (Characters)
](////lists288.rssing.com/chan-11077187/article374.html#c11077187a374i164684108)


[ _≫_ Next: How to interpret data matrix in sensor_msgs/Image?
](//question2135.rssing.com/chan-36145539/all_p4.html#c36145539a75 "Next
Article")


**Definition:** [ cv_bridge.h:86 ](cv__bridge_8h_source.html#l00086)


BUT... I do not get an Ordered PointCloud from "roslaunch realsense2_camera
rs_rgbd.launch" = any idea why not ?


[
![@monajalal](https://avatars.githubusercontent.com/u/1892917?s=80&u=fb3f8f2771bf62335706b46ad426a3dfa3ae9c73&v=4)
](/monajalal)


[ ](javascript:; "Like") 0


519  // Loads as BGR or BGRA.


542  double  min_image_value = options. [ min_image_value
](structcv__bridge_1_1CvtColorForDisplayOptions.html#ada340f931aabaff069d2d9585cc2186e)
;


Already on GitHub? [ Sign in
](/login?return_to=%2FIntelRealSense%2Flibrealsense%2Fissues%2Fnew%2Fchoose)
to your account


552  {


371  ros_image.data.resize(size);


**Definition:** [ cv_bridge.h:79 ](cv__bridge_8h_source.html#l00079)


Mike

---

All reactions


* Solutions


[ _≪_ Previous: get a depth image using a kinect and openCV.
](//question2135.rssing.com/chan-36145539/all_p4.html#c36145539a70 "Previous
Article")


301  const  std_msgs::Header& src_header,


281  cv::Mat mat_swap(source.height, source.width, mat.type());


sensor_msgs::CompressedImagePtr toCompressedImageMsg(const Format
dst_format=JPG) const


You are very welcome, [ @CWAndersn ](https://github.com/CWAndersn) \- thanks
for the update!

---

All reactions


12  * * Redistributions of source code must retain the above copyright


620  result->header = source->header;


* 👍  1 reaction


RSSing.com


**Definition:** [ cv_bridge.h:64 ](cv__bridge_8h_source.html#l00064)


148  res[std::make_pair( [ GRAY
](namespacecv__bridge_1_1rgb__colors.html#aa6343a2cb9080c11afefb714570c63cca04e661921a463f3df840acbb03527c98)
, RGB)].push_back(cv::COLOR_GRAY2RGB);


[ ](//www.rssing.com/index.php?zw=2123 "Home") [ $ ](javascript:; "MoMoney")


145  for  (  int  i=0; i<=5; ++i)


75  if  (encoding == enc::BGR8)  return  CV_8UC3;


[ cv_bridge::JPE
](namespacecv__bridge.html#a166887feb09ea6ce14e8742384e574bfa686f9486d4e5fe72f6abf4002c276934)


3 participants


41  #include <boost/regex.hpp>


[ cv_bridge::CvImagePtr
](namespacecv__bridge.html#a1be6ad7c0a2d37ef773198f59ed2f456)


10  * are met:


305  // Copy metadata


No milestone


    mi- 0
    unique_id- 2-2-23
    path- /sys/devices/pci0000:00/0000:00:14.0/usb2/2-2/2-2:1.0/video4linux/video0
    susb specification- 310

     29/05 12:28:01,682 DEBUG [139779508533120] (ds5-factory.cpp:279) try_fetch_usb_device(...) failed.
     29/05 12:28:01,682 DEBUG [139779508533120] (ds5-factory.cpp:279) try_fetch_usb_device(...) failed.
     29/05 12:28:01,932 DEBUG [140516943759104] (ds5-factory.cpp:279) try_fetch_usb_device(...) failed.
     29/05 12:28:01,932 DEBUG [140516943759104] (ds5-factory.cpp:279) try_fetch_usb_device(...) failed.
     29/05 12:28:01,932 DEBUG [140516943759104] (ds5-factory.cpp:279) try_fetch_usb_device(...) failed.
     29/05 12:28:01,932 DEBUG [140516943759104] (ds5-factory.cpp:279) try_fetch_usb_device(...) failed.
     29/05 12:28:01,932 DEBUG [140516943759104] (context.cpp:366)
    Device disconnected:

    uvc devices:
    id- /dev/video5
    vid- 8086
    pid- ad3
    mi- 3
    unique_id- 2-2-22
    path- /sys/devices/pci0000:00/0000:00:14.0/usb2/2-2/2-2:1.3/video4linux/video5
    susb specification- 310

    id- /dev/video3
    vid- 8086
    pid- ad3
    mi- 0
    unique_id- 2-2-22
    path- /sys/devices/pci0000:00/0000:00:14.0/usb2/2-2/2-2:1.0/video4linux/video3
    susb specification- 310

    id- /dev/video4
    vid- 8086
    pid- ad3
    mi- 0
    unique_id- 2-2-22
    path- /sys/devices/pci0000:00/0000:00:14.0/usb2/2-2/2-2:1.0/video4linux/video4
    susb specification- 310


666  source_typed->image = source->image;


385  ros_data_ptr += ros_image.step;


580  else


595  result->image = cv::Mat(source->image.rows, source->image.cols, CV_8UC3);


33  * POSSIBILITY OF SUCH DAMAGE.


[ ](javascript:; "Share Article") [
](//www.rssing.com/contact.php?r=o6&u=%2F%2Fquestion2135.rssing.com%2Fchan-36145539%2Farticle72-live.html
"Article Support")


368  ros_image.is_bigendian = (boost::endian::order::native ==
boost::endian::order::big);


618  {


692  }


381  uchar* cv_data_ptr = [ image
](classcv__bridge_1_1CvImage.html#a8b0cc1c26637754fbccb91b4fc086526) .data;


RSSing.com


Cancel  Submit feedback


**Definition:** [ cv_bridge.h:80 ](cv__bridge_8h_source.html#l00080)


Hi, I use a Kinect for Xbox 360. What is the accuracy of depth in the
different ranges ? Thanks for reply.


You can’t perform that action at this time.


Sign up for GitHub


[ ↂ
](////nickalive1.rssing.com/chan-12111484/article19428.html#c12111484a19428i709189718
"Wicked Cool Toys Announces 'The Loud House' Plush Toy Line | NYTF 2018
\[Updated\]")


More Pages to Explore .....


Development


CvImageConstPtr cvtColorForDisplay(const CvImageConstPtr &source, const
std::string &encoding=std::string(), const CvtColorForDisplayOptions
options=CvtColorForDisplayOptions())


377  else


I believe when using rs_camera.launch the pointcloud is published to the topic
/camera/depth/color/points instead. Thank you!

---

All reactions


Sorry, something went wrong.
[
![@Triocrossing](https://avatars.githubusercontent.com/u/8653434?s=80&u=82957cb4bd0866d76801e133f0adfd94e24e9287&v=4)
](/Triocrossing)
Copy link
###
**[ Triocrossing ](/Triocrossing) ** commented  Mar 6, 2020
Thanks for the idea of [ @CameronDevine ](https://github.com/CameronDevine) ,
I modified it a little bit and now it works like a charm for me.
` rosbag record -a -O $1.bag -x "(.*)/theora | (.*)/theora/(.*) |
(.*)/compressedDepth" `
"|" is used for excluding multiple topic/subtopics.

---

All reactions
Sorry, something went wrong.
[
![@felixvd](https://avatars.githubusercontent.com/u/4535737?s=80&u=ab62e090ab2bfe181a6d95f16672111fee9df926&v=4)
](/felixvd)
Copy link
###
**[ felixvd ](/felixvd) ** commented  Apr 8, 2020
I get the error for all the depth image topics. I'm on 2.2.12 and Melodic.
When I subscribe to the uncompressed depth image with ` rqt_image_view ` , I
get this error:
` double free or corruption (!prev) `
` Aborted (core dumped) `

---

All reactions
Sorry, something went wrong.
[ ![@apartridge](https://avatars.githubusercontent.com/u/1118143?s=40&v=4)
](/apartridge) [ apartridge ](/apartridge) mentioned this issue  Aug 18, 2020
[ Compressed Depth Image Error  zivid/zivid-ros#21  ](/zivid/zivid-
ros/issues/21)
Open
[
![@gonultasbu](https://avatars.githubusercontent.com/u/19195222?s=80&u=0695a60fe4cff728cf746782f274975216ff4315&v=4)


![Consuelo Ortiga y Rey: The
](//ourhappyschool.com/sites/default/files/LoveRizalJensen_0.jpg)


#  [ ros indigo / xtion : getting depth from pixel coordinates
](//question2135.rssing.com/chan-36145539/article80-live.html)


     29/05 12:28:01,932 DEBUG [140516943759104] (context.cpp:373)
    Device connected:

    uvc devices:
    id- /dev/video1
    vid- 8086
    pid- ad3
    mi- 0
    unique_id- 2-2-23
    path- /sys/devices/pci0000:00/0000:00:14.0/usb2/2-2/2-2:1.0/video4linux/video1
    susb specification- 310

    id- /dev/video2
    vid- 8086
    pid- ad3
    mi- 3
    unique_id- 2-2-23
    path- /sys/devices/pci0000:00/0000:00:14.0/usb2/2-2/2-2:1.3/video4linux/video2
    susb specification- 310

    id- /dev/video0
    vid- 8086
    pid- ad3
    mi- 0
    unique_id- 2-2-23
    path- /sys/devices/pci0000:00/0000:00:14.0/usb2/2-2/2-2:1.0/video4linux/video0
    susb specification- 310

     29/05 12:28:07,077 WARNING [139779508533120] (types.cpp:57) set_xu(ctrl=1) failed! Last Error: Input/output error
     29/05 12:28:07,079 WARNING [139779508533120] (rs.cpp:329) null pointer passed for argument "device"
    [ INFO] [1527577170.501326875]: Interrupt Signal is received! Terminating RealSense Node...
    /camera2/realsense2_camera/fisheye_width: 640
     * /camera2/realsense2_camera/gyro_fps: 1000
     * /camera2/realsense2_camera/gyro_optical_frame_id: camera_gyro_optic...
     * /camera2/realsense2_camera/infra1_fps: 30
     * /camera2/realsense2_camera/infra1_height: 480
     * /camera2/realsense2_camera/infra1_optical_frame_id: camera_infra1_opt...
     * /camera2/realsense2_camera/infra1_width: 640


266  ss << "Image is wrongly formed: height * step != size or "  <<
source.height << " * "  <<


289  fromTo.push_back(byte_depth*i + byte_depth - 1 - j);


[ ![@MartyG-
RealSense](https://avatars.githubusercontent.com/u/41145062?s=40&v=4)
](/MartyG-RealSense) [ MartyG-RealSense ](/MartyG-RealSense) added the [ ros
](/IntelRealSense/librealsense/labels/ros) label  Feb 7, 2022


[ ![@MartyG-
RealSense](https://avatars.githubusercontent.com/u/41145062?s=40&v=4)
](/MartyG-RealSense) [ MartyG-RealSense ](/MartyG-RealSense) mentioned this
issue  Jan 18, 2024


610  return  result;


439  sensor_msgs::CompressedImagePtr ptr =
boost::make_shared<sensor_msgs::CompressedImage>();


#  [ Kinect invalid flag less than 0.4 m
](//question2135.rssing.com/chan-36145539/article79-live.html)


[ ![@MikeHallettUK](https://avatars.githubusercontent.com/u/57232441?s=80&v=4)
](/MikeHallettUK)


592  [ CvImagePtr
](../../../../api/roscpp_traits/html/classboost_1_1shared__ptr.html) result(
new  [ CvImage
](classcv__bridge_1_1CvImage.html#adcb3774384cd81c101f3c9beedede4e7) ());


670  // If we get the OpenCV format, if we have 1,3 or 4 channels, we are most
likely in mono, BGR or BGRA modes


572  }


Collaborator


322  int  conversion_code = conversion_codes[i];


**[ MartyG-RealSense ](/MartyG-RealSense) ** commented  Feb 7, 2022


19  * contributors may be used to endorse or promote products derived


112  throw  [ Exception ](classcv__bridge_1_1Exception.html) (  "Unrecognized
image encoding ["  \+ encoding +  "]"  );


    * [ Enterprise ](/enterprise)
    * [ Teams ](/team)
    * [ Startups ](/enterprise/startups)
    * [ Education  ](https://education.github.com)


Closed


269  }


[ _≫_ Next: Image array size is not consistent with the message type
documentation
](//question2135.rssing.com/chan-36145539/all_p4.html#c36145539a76 "Next
Article")


#  [ How to obtain depth coordinate using two,widely sperated, cameras: ROS,
python Baxter ](//question2135.rssing.com/chan-36145539/article73-live.html)


[ cv_bridge::CvtColorForDisplayOptions::colormap
](structcv__bridge_1_1CvtColorForDisplayOptions.html#ac9997c80cc25010e95cee3c96f5a8f4d)


492  if  (enc::hasAlpha(encoding))


[ question  ](/IntelRealSense/realsense-ros/labels/question)


**Melodic**
sudo apt-get install ros-melodic-rgbd-launch


###  [ People's Blog • First Pictures of the Eclipse ! ! !
](////satire3490.rssing.com/chan-77006292/article253.html#c77006292a253i838655542)


210  // was resolved in the previous condition. Otherwise, fail


[ _≫_ Next: Get depth from Kinect sensor in gazebo simulator
](//question2135.rssing.com/chan-36145539/all_p4.html#c36145539a77 "Next
Article")


[ ](//www.rssing.com/index.php)


[
![@RealSenseCustomerSupport](https://avatars.githubusercontent.com/u/46742753?s=80&u=aa4cfa144cecc4018ac8e0190ea1a51ed2255898&v=4)
](/RealSenseCustomerSupport)
Copy link
Collaborator
###
**[ RealSenseCustomerSupport ](/RealSenseCustomerSupport) ** commented  Mar 7,
2019
[Please Ignore - RealSense system comment]

---

All reactions
Sorry, something went wrong.
[
![@RealSenseCustomerSupport](https://avatars.githubusercontent.com/u/46742753?s=80&u=aa4cfa144cecc4018ac8e0190ea1a51ed2255898&v=4)
](/RealSenseCustomerSupport)
Copy link
Collaborator
###
**[ RealSenseCustomerSupport ](/RealSenseCustomerSupport) ** commented  Mar
19, 2019
* * *
Close this issue for lack of activity. Please feel free to reopen if the issue
is still relevant.

---

All reactions
Sorry, something went wrong.
[
![@RealSenseCustomerSupport](https://avatars.githubusercontent.com/u/46742753?s=40&u=aa4cfa144cecc4018ac8e0190ea1a51ed2255898&v=4)
](/RealSenseCustomerSupport) [ RealSenseCustomerSupport
](/RealSenseCustomerSupport) closed this as [ completed
](/IntelRealSense/realsense-
ros/issues?q=is%3Aissue+is%3Aclosed+archived%3Afalse+reason%3Acompleted) Mar
26, 2019
[
![@NovoG93](https://avatars.githubusercontent.com/u/31406662?s=80&u=51720ef5971ca18dd4be892c6c70d985fc74585c&v=4)
](/NovoG93)


357  sensor_msgs::ImagePtr ptr = boost::make_shared<sensor_msgs::Image>();


583  (enc::bitDepth(encoding) != 8))


674  source_typed->encoding = enc::MONO16;


175  res[std::make_pair( [ YUV422
](../../../../api/sensor_msgs/html/namespacesensor__msgs_1_1image__encodings.html#a4cd4806e2221b58787bf6fa643ccf60d)
, BGR)].push_back(cv::COLOR_YUV2BGR_UYVY);


October 14, 2013, 3:54 am


120  {


[ ](javascript:; "Like") 0


**[ CWAndersn ](/CWAndersn) ** commented  Feb 7, 2022  •


[ ![@CWAndersn](https://avatars.githubusercontent.com/u/36552123?s=52&v=4)
](/CWAndersn) [ ![@MartyG-
RealSense](https://avatars.githubusercontent.com/u/41145062?s=52&v=4)
](/MartyG-RealSense) [
![@MikeHallettUK](https://avatars.githubusercontent.com/u/57232441?s=52&v=4)
](/MikeHallettUK)


205  bool  is_dst_color_format = enc::isColor(dst_encoding) ||
enc::isMono(dst_encoding) ||


Hi, So basically I want to be able to obtain the depth,z, coordinate of a
certain object. I figured since I am using two cameras, there could be some
triangulation that can be done. I also looked into the disparity map process,
but my cameras are far apart, and the disparity map created is rubbish, so i
need another method


#  [ Is this the right way to obatin depth information?
](//question2135.rssing.com/chan-36145539/article74-live.html)


193  res[std::make_pair(BAYER_GRBG, RGB)].push_back(cv::COLOR_BayerGB2RGB);


8  * Redistribution and use in source and binary forms, with or without


**Definition:** [ rgb_colors.h:106 ](rgb__colors_8h_source.html#l00106)


  * [ //javier1830.rssing.com/chan-79050542/index-page1.html ](//javier1830.rssing.com/chan-79050542/index-page1.html)
  * [ //myteespot208.rssing.com/chan-10670238/index-page1.html ](//myteespot208.rssing.com/chan-10670238/index-page1.html)
  * [ //anomos11.rssing.com/chan-38630269/index-latest.php ](//anomos11.rssing.com/chan-38630269/index-latest.php)
  * [ //rejuvenation911.rssing.com/chan-79051226/index-page1.html ](//rejuvenation911.rssing.com/chan-79051226/index-page1.html)
  * [ //ansehen267.rssing.com/chan-44928903/article2.html ](//ansehen267.rssing.com/chan-44928903/article2.html)
  * [ //swisscleantech15.rssing.com/chan-79051200/article10.html ](//swisscleantech15.rssing.com/chan-79051200/article10.html)
  * [ //shortening164.rssing.com/chan-79051083/article10.html ](//shortening164.rssing.com/chan-79051083/article10.html)
  * [ //fanatic7799.rssing.com/chan-79051176/index-latest.php ](//fanatic7799.rssing.com/chan-79051176/index-latest.php)
  * [ //daybooks78.rssing.com/chan-79050875/index-page1.html ](//daybooks78.rssing.com/chan-79050875/index-page1.html)
  * [ //brasil4599.rssing.com/chan-79050718/index-page1.html ](//brasil4599.rssing.com/chan-79050718/index-page1.html)
  * [ //darlleen78.rssing.com/chan-79050407/article4.html ](//darlleen78.rssing.com/chan-79050407/article4.html)
  * [ //pockmarking19.rssing.com/chan-10669134/index-latest.php ](//pockmarking19.rssing.com/chan-10669134/index-latest.php)
  * [ //dasyurid78.rssing.com/chan-79050579/article1.html ](//dasyurid78.rssing.com/chan-79050579/article1.html)
  * [ //fanatic7795.rssing.com/chan-79051036/index-page1.html ](//fanatic7795.rssing.com/chan-79051036/index-page1.html)
  * [ //dayflies78.rssing.com/chan-79050911/article23.html ](//dayflies78.rssing.com/chan-79050911/article23.html)
  * [ //regions2049.rssing.com/chan-79050969/article9.html ](//regions2049.rssing.com/chan-79050969/article9.html)
  * [ //participatory719.rssing.com/chan-79051344/index-page1.html ](//participatory719.rssing.com/chan-79051344/index-page1.html)
  * [ //waste4928.rssing.com/chan-79051090/index-latest.php ](//waste4928.rssing.com/chan-79051090/index-latest.php)
  * [ //datiscosid78.rssing.com/chan-79050663/index-page1.html ](//datiscosid78.rssing.com/chan-79050663/index-page1.html)
  * [ //datapoint78.rssing.com/chan-79050620/article29.html ](//datapoint78.rssing.com/chan-79050620/article29.html)


Is this an error I should ignore or could you please let me know how to
resolve it?


[ 444 ](namespacecv__bridge.html#a4efa938de96a8e11269645d8a8fa6f72)
std::string [ getFormat
](namespacecv__bridge.html#a4efa938de96a8e11269645d8a8fa6f72) ( [ Format
](namespacecv__bridge.html#a166887feb09ea6ce14e8742384e574bf) format) {


344  image1 = image2;


###  [ HAFSA ROBINSON
](////augustacrime16.rssing.com/chan-36733858/article181.html#c36733858a181i777026533)


April 11, 2024, 5:27 pm


September 25, 2016, 12:44 pm


None yet


664  // If no color conversion is possible, we must "guess" the input format


Copy link


RSSing.com


68  }


16  * disclaimer in the documentation and/or other materials provided


**Noetic**
sudo apt-get install ros-noetic-rgbd-launch


August 25, 2016, 9:37 am


478  }


539  const  std::string& encoding_out,


It's great rto hear that you achieved a working setup!


###  Footer navigation


[ ![@MartyG-
RealSense](https://avatars.githubusercontent.com/u/41145062?s=80&v=4)
](/MartyG-RealSense)


319  cv::Mat image1 = source;


391  // Deep copy data, returnee is mutable


Name


438  {


477  throw  [ Exception ](classcv__bridge_1_1Exception.html) (  "Unrecognized
image format"  );


  * [ Notifications ](/login?return_to=%2FIntelRealSense%2Frealsense-ros)
  * [ Fork  1.7k  ](/login?return_to=%2FIntelRealSense%2Frealsense-ros)
  * [ Star  2.3k  ](/login?return_to=%2FIntelRealSense%2Frealsense-ros)


134  return  INVALID;


278  // Otherwise, reinterpret the data as bytes and switch the channels
accordingly


Sorry, something went wrong.


No milestone


    /camera/depth/image_rect_raw/compressedDepth
    /camera/depth/image_rect_raw/compressed
    /rosout
    /camera/depth/camera_info
    /camera/depth/metadata
    /camera/depth/image_rect_raw
    /rosout_agg
    /camera/realsense2_camera_manager/bond
    /camera/realsense2_camera_manager/bond
    /camera/depth/image_rect_raw/compressedDepth
    /camera/depth/image_rect_raw/compressed
    /camera/depth/camera_info
    /camera/depth/metadata
    /rosout
    /camera/depth/image_rect_raw
    /rosout_agg
    /diagnostics
    /diagnostics
    /diagnostics
    /diagnostics
    /camera/depth/image_rect_raw/compressedDepth
    /camera/depth/image_rect_raw/compressed
    /rosout
    /camera/depth/camera_info
    /camera/depth/metadata
    /rosout_agg
    /camera/depth/image_rect_raw
    /camera/depth/image_rect_raw/compressedDepth
    /camera/depth/image_rect_raw/compressed
    /camera/depth/metadata
    /rosout
    /camera/depth/camera_info
    /camera/depth/image_rect_raw
    /rosout_agg
    /camera/realsense2_camera_manager/bond
    /camera/realsense2_camera_manager/bond
    /camera/depth/image_rect_raw/compressedDepth
    /camera/depth/image_rect_raw/compressed
    /rosout
    /camera/depth/metadata


Get the OpenCV type enum corresponding to the encoding.


588  // Convert label to bgr image


**Definition:** [ cv_bridge.h:81 ](cv__bridge_8h_source.html#l00081)


23  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT


531  return  toCvCopyImpl(rgb_a, source.header, enc::MONO8, encoding);


Closed


![Pumas 2022/2023 Font \(TTF &
OTF\)](//footballfonts.com/u/img/pumas-22-23-otf-font-installation.jpg)


[ _≪_ Previous: Image array size is not consistent with the message type
documentation
](//question2135.rssing.com/chan-36145539/all_p4.html#c36145539a76 "Previous
Article")


I have a bag fille recorded with a kinect camera. RVIZ displays correctly the
RGB but it does not display the depth cloud any more. It used to work ( the
same bag fille) using oppeni_camera as fixed frame and using the raw
configuration. But it's not working any more.


[ Search ](javascript:;)


**[ CWAndersn ](/CWAndersn) ** commented  Feb 7, 2022


[ ![Stay Salty POTS Awareness Stretchy Stacking Bracelets | Set of
Three|...](//i.etsystatic.com/28677176/r/il/b2413c/4350795851/il_570xN.4350795851_fflz.jpg)
](////pomaces4.rssing.com/chan-3795444/article11960.html#c3795444a11960i1086411135)


[ cv_bridge::TIFF
](namespacecv__bridge.html#a166887feb09ea6ce14e8742384e574bfa870473c7ea88913e2eb0f065ee00f8b6)


[ cv_bridge::toCvShare
](namespacecv__bridge.html#aafa38a1d9be98d9efaefe45fd873133c)


[ ](javascript:; "Share Article") [
](//www.rssing.com/contact.php?r=o6&u=%2F%2Fquestion2135.rssing.com%2Fchan-36145539%2Farticle65-live.html
"Article Support")


169  res[std::make_pair(BGRA, RGB)].push_back(cv::COLOR_BGRA2RGB);


2. Launch the **rs_rgbd** launch file.


456  return  "jpe"  ;


I have a code in C ++ that stores a Kinect's depth image, I wonder if there is
any way to get an image, in where I can define the depth of the things
captured into this image. for example, I only want the things that are at max
at 1 meter of distance of the Kinect's sensor I found the code into a thread
here, so I edited it so I can try to get the image, the code is the next.
\---------- #include  #include  #include  #include  #include  #include  using
namespace std; unsigned int cnt = 0; void RetornoImagen(const
sensor_msgs::ImageConstPtr& msg_depth ) { //convertimos a un tipo de imagen de
opencV cv_bridge::CvImagePtr img_ptr_depth; try{ img_ptr_depth =
cv_bridge::toCvCopy(*msg_depth, sensor_msgs::image_encodings::TYPE_32FC1); }
catch (cv_bridge::Exception& e) { ROS_ERROR("cv_bridge exception: %s",
e.what()); return; } double minVal, maxVal; cv::Mat &mat =
img_ptr_depth->image; cv::Mat img2; cv::Mat invertida;
cv::imshow("windowName",mat ); //mat.convertTo(img2,CV_8U, 255.0/(maxVal -
minVal), 100.0 ); minMaxLoc(mat, &minVal, &maxVal,NULL,NULL); //find minimum
and maximum intensities img2=mat; mat.convertTo(img2,CV_32FC1,65535.0/(maxVal
- minVal), -minVal * 65535.0/(maxVal - minVal)); cv::imshow("ventana2",img2);
bbbb cv::waitKey(3); //ROS_INFO("asdasd"); char file1[100]; char file2[100];
cnt++; sprintf( file1, "%04d_depth.png", cnt ); ; //parametros de compresion
std::vector  pp; pp.push_back(CV_IMWRITE_PNG_COMPRESSION); pp.push_back(0);
//guardamos la imagen en el disco duro, donde se ejecuta el nodo.
imwrite(file1,img2,pp); //imwrite(file2,img2); ROS_INFO_STREAM("El minimo es:"


#  [ Depth map from bumblebee2 camera?
](//question2135.rssing.com/chan-36145539/article72-live.html)


I am using ROS Noetic inside docker.


Pick a username


[ ](javascript:; "Like") 0


Sorry, something went wrong.
[
![@ankurbaruah90](https://avatars.githubusercontent.com/u/21272990?s=80&u=c13b3e1b4d9ad61d72c2e15546eb7b7d93a9c1f7&v=4)
](/ankurbaruah90)
Copy link
###
**[ ankurbaruah90 ](/ankurbaruah90) ** commented  May 29, 2018
Hello [ @icarpis ](https://github.com/icarpis) , I am facing the same issue `
get_xu(id=11) failed! Last Error: Input/output error ` when attempting to
start multiple d415 cameras. I am posting the RealSense log in debug level
here.

    SUMMARY
    ========

    PARAMETERS
     * /camera1/realsense2_camera/accel_fps: 1000
     * /camera1/realsense2_camera/accel_optical_frame_id: camera_accel_opti...
     * /camera1/realsense2_camera/align_depth: False
     * /camera1/realsense2_camera/camera_aligned_depth_to_color_frame_id: camera_aligned_de...
     * /camera1/realsense2_camera/camera_aligned_depth_to_fisheye_frame_id: camera_aligned_de...
     * /camera1/realsense2_camera/camera_aligned_depth_to_infra1_frame_id: camera_aligned_de...
     * /camera1/realsense2_camera/camera_aligned_depth_to_infra2_frame_id: camera_aligned_de...
     * /camera1/realsense2_camera/color_fps: 30
     * /camera1/realsense2_camera/color_height: 480
     * /camera1/realsense2_camera/color_optical_frame_id: camera_color_opti...
     * /camera1/realsense2_camera/color_width: 640
     * /camera1/realsense2_camera/depth_fps: 30
     * /camera1/realsense2_camera/depth_height: 480
     * /camera1/realsense2_camera/depth_optical_frame_id: camera_depth_opti...
     * /camera1/realsense2_camera/depth_width: 640
     * /camera1/realsense2_camera/enable_color: True
     * /camera1/realsense2_camera/enable_depth: True
     * /camera1/realsense2_camera/enable_fisheye: True
     * /camera1/realsense2_camera/enable_imu: True
     * /camera1/realsense2_camera/enable_infra1: True
     * /camera1/realsense2_camera/enable_infra2: True
     * /camera1/realsense2_camera/enable_pointcloud: False
     * /camera1/realsense2_camera/enable_sync: False


[ Claim  ](javascript:; "Claim Chan")


388  }


[ _≫_ Next: ros indigo / xtion : getting depth from pixel coordinates
](//question2135.rssing.com/chan-36145539/all_p4.html#c36145539a80 "Next
Article")


#  [ why RGB and depth Image synchronization not working?
](//question2135.rssing.com/chan-36145539/article62-live.html)


Cancel  Create saved search


40  #include <boost/make_shared.hpp>


433  }


[ 437 ](classcv__bridge_1_1CvImage.html#abeb18e0ed2af0adaf67daa6b93cb6a32)
sensor_msgs::CompressedImagePtr [ CvImage::toCompressedImageMsg
](classcv__bridge_1_1CvImage.html#abeb18e0ed2af0adaf67daa6b93cb6a32) (  const
[ Format ](namespacecv__bridge.html#a166887feb09ea6ce14e8742384e574bf)
dst_format)  const


Collaborator


214  "] is. The conversion does not make sense"  );


252  int  byte_depth = enc::bitDepth(source.encoding) / 8;


217  return  std::vector<int>(1, SAME_FORMAT);


To see all available qualifiers, see our [ documentation
](https://docs.github.com/search-github/github-code-search/understanding-
github-code-search-syntax) .


197  }


287  {


[ ](javascript:; "Share Article") [
](//www.rssing.com/contact.php?r=o6&u=%2F%2Fquestion2135.rssing.com%2Fchan-36145539%2Farticle68-live.html
"Article Support")


[ ](javascript:; "Share Article") [
](//www.rssing.com/contact.php?r=o6&u=%2F%2Fquestion2135.rssing.com%2Fchan-36145539%2Farticle76-live.html
"Article Support")


    [ INFO] [1700066936.163198139]: Subscribing to /camera/align_to_color/parameter_updates
    [ INFO] [1700066936.166001252]: Subscribing to /diagnostics
    [ INFO] [1700066937.171336767]: Subscribing to /camera/depth/image_rect_raw
    [ INFO] [1700066937.174795810]: Subscribing to /camera/depth/camera_info
    [ INFO] [1700066937.176709788]: Subscribing to /camera/depth/metadata
    [ INFO] [1700066937.179327005]: Subscribing to /camera/color/image_raw
    [ INFO] [1700066937.180329311]: Subscribing to /camera/color/camera_info
    [ INFO] [1700066937.181524309]: Subscribing to /camera/color/metadata
    [ INFO] [1700066937.182494680]: Subscribing to /camera/aligned_depth_to_color/image_raw
    [ INFO] [1700066937.185050478]: Subscribing to /camera/aligned_depth_to_color/camera_info
    [ INFO] [1700066937.187028774]: Subscribing to /camera/extrinsics/depth_to_color
    [ INFO] [1700066937.188047749]: Subscribing to /camera/stereo_module/auto_exposure_roi/parameter_descriptions
    [ INFO] [1700066937.188988715]: Subscribing to /camera/stereo_module/auto_exposure_roi/parameter_updates
    [ INFO] [1700066937.189890298]: Subscribing to /camera/rgb_camera/auto_exposure_roi/parameter_descriptions
    [ INFO] [1700066937.190998247]: Subscribing to /camera/rgb_camera/auto_exposure_roi/parameter_updates
    ^

---

All reactions
Sorry, something went wrong.
[
![@monajalal](https://avatars.githubusercontent.com/u/1892917?s=80&u=fb3f8f2771bf62335706b46ad426a3dfa3ae9c73&v=4)
](/monajalal)
Copy link
###
**[ monajalal ](/monajalal) ** commented  Nov 15, 2023
[ @gonultasbu ](https://github.com/gonultasbu)
however, using

    root@7a805700666e:/workspace# rosbag record -O mona_noetic.bag -a -x "(.*)theora(.*)|(.*)compressed(.*)"
    [ INFO] [1700067159.717991764]: Subscribing to /rosout_agg
    [ INFO] [1700067159.719413972]: Recording to 'mona_noetic.bag'.
    [ INFO] [1700067159.720969980]: Subscribing to /rosout
    [ INFO] [1700067159.722081049]: Subscribing to /camera/realsense2_camera_manager/bond
    [ INFO] [1700067159.723081056]: Subscribing to /tf_static
    [ INFO] [1700067159.724717571]: Subscribing to /tf
    [ INFO] [1700067160.729423310]: Subscribing to /camera/stereo_module/parameter_descriptions


137  static  const  int  SAME_FORMAT = -1;


545  if  (!source)


root@8603c293ad2b:/workspace/catkin_ws# rosrun bag_converter convert.py


345  }


BUT... the Pointcloud2 "/camera/depth/color/points" does NOT seem to be
aligned ?

---

All reactions


202  Encoding dst_encod = getEncoding(dst_encoding);


161  res[std::make_pair(BGR, BGRA)].push_back(cv::COLOR_BGR2BGRA);


![Class 10 Sanskrit Grammar Book Solutions
अपठित-अवबोधनम्](//www.learncbse.in/wp-content/uploads/2017/08/NCERT-Solutions-
for-Class-10th-Sanskrit-Chapter-1-अपठित-अवबोधनम-2.jpg)


Search


461  case  [ PBM
](namespacecv__bridge.html#a166887feb09ea6ce14e8742384e574bfa2da0f7870b7ac7950c08ff8243c28757)
:


Jump to bottom


#  [ERROR] [1699653946.712325915]: cv_bridge exception: '[16UC1] is not a
color format. but [bgr8] is. The conversion does not make sense' during
roslaunch realsense2_camera rs_camera.launch align_depth:=true  #2929


143  std::map<std::pair<Encoding, Encoding>, std::vector<int> >
getConversionCodes() {


232  std::pair<Encoding, Encoding> key(src_encod, dst_encod);


[ ↂ
](////salina38.rssing.com/chan-7227570/article826.html#c7227570a826i536103691
"Saline County Jail Booking Activity – Saturday, October 3rd")


624  result->image = cv::Mat(source->image.size(), CV_8UC1);