<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Converting RealSense Pointcloud to PCL Pointcloud in Items with no label</title>
    <link>https://community.intel.com/t5/Items-with-no-label/Converting-RealSense-Pointcloud-to-PCL-Pointcloud/m-p/541964#M7941</link>
    <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for the code, I have found it before, but the pointcloud is single-colored somehow. I will post info tomorrow. I appreciate your help, thanks again!&lt;/P&gt;</description>
    <pubDate>Thu, 21 Jun 2018 14:48:20 GMT</pubDate>
    <dc:creator>EMráz</dc:creator>
    <dc:date>2018-06-21T14:48:20Z</dc:date>
    <item>
      <title>Converting RealSense Pointcloud to PCL Pointcloud</title>
      <link>https://community.intel.com/t5/Items-with-no-label/Converting-RealSense-Pointcloud-to-PCL-Pointcloud/m-p/541957#M7934</link>
      <description>&lt;P&gt;Hello everyone,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I know this has been questioned few times, but I would like to make this clear - not only for me, but for everyone trying to implement this. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What I am trying to do is basically to convert the pointcloud data from RealSense camera (D415) to PCD format, which is conventional in PCL (pointcloud library). By saying pointcloud data, I mean depth data + RGB data - if you combine these two you get exactly the same as in realsense viewer, when you hit the 3D button. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What I have accomplished so far: I succesfully converted depth frame - thanks to the PCL Wrapper &lt;A href="https://github.com/IntelRealSense/librealsense/tree/master/wrappers/pcl"&gt;https://github.com/IntelRealSense/librealsense/tree/master/wrappers/pcl&lt;/A&gt; librealsense/wrappers/pcl at master · IntelRealSense/librealsense · GitHub &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This is how I am accesing XYZ values of points - so the depth values&lt;/P&gt;&lt;P&gt;p.x = ptr-&amp;gt;x;&lt;/P&gt;&lt;P&gt;p.y = ptr-&amp;gt;y;&lt;/P&gt;&lt;P&gt;p.z = ptr-&amp;gt;z;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Where p is pcl::PointCloud object and ptr is pointing to rs2::points.get_vertices(). Also I know I can access the RGB values just like XYZ, so p.r and so. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So what my greatest "wish" is - is to provide solution for me (   ) and of course for the others - maybe contribute to PCL wrapper in librealsense library - so the depth and color data from RS cameras would be easily convertible to PCD format. I am developing on Ubuntu. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I know how depth data is stored, at least I think I understand it - XYZ values of a single point are the coordinates (in meters), where [0,0,0] point is the camera base.  &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Little bit of background of my work, if you are interested. I am willing to create 3D map by registering a number of pointcloud datasets (frames). I would like to do this on the keypoints principle, that means I would like to apply SIFT algorithm - that is why I need to know correspondence between XYZ and RGB values of points in the pointcloud. &lt;/P&gt;</description>
      <pubDate>Thu, 21 Jun 2018 07:51:38 GMT</pubDate>
      <guid>https://community.intel.com/t5/Items-with-no-label/Converting-RealSense-Pointcloud-to-PCL-Pointcloud/m-p/541957#M7934</guid>
      <dc:creator>EMráz</dc:creator>
      <dc:date>2018-06-21T07:51:38Z</dc:date>
    </item>
    <item>
      <title>Re: Converting RealSense Pointcloud to PCL Pointcloud</title>
      <link>https://community.intel.com/t5/Items-with-no-label/Converting-RealSense-Pointcloud-to-PCL-Pointcloud/m-p/541958#M7935</link>
      <description>&lt;P&gt;Somebody who was trying to do a conversion to PCD used the sample program you linked to for the conversion and then saved it with this line:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;pcl::io::savePCDFile(filename+".pcd", * cloud);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://github.com/IntelRealSense/librealsense/issues/1455"&gt;https://github.com/IntelRealSense/librealsense/issues/1455&lt;/A&gt; Export an organized point cloud · Issue # 1455 · IntelRealSense/librealsense · GitHub &lt;/P&gt;</description>
      <pubDate>Thu, 21 Jun 2018 08:43:02 GMT</pubDate>
      <guid>https://community.intel.com/t5/Items-with-no-label/Converting-RealSense-Pointcloud-to-PCL-Pointcloud/m-p/541958#M7935</guid>
      <dc:creator>MartyG</dc:creator>
      <dc:date>2018-06-21T08:43:02Z</dc:date>
    </item>
    <item>
      <title>Re: Converting RealSense Pointcloud to PCL Pointcloud</title>
      <link>https://community.intel.com/t5/Items-with-no-label/Converting-RealSense-Pointcloud-to-PCL-Pointcloud/m-p/541959#M7936</link>
      <description>&lt;P&gt;Thank you for replying,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Saving of the Point Cloud is not a problem, I know how to save it. Function points_to_pcl(points) converts only XYZ values, not RGB. I need to find out, how I can align RGB values to Depth frame.&lt;/P&gt;</description>
      <pubDate>Thu, 21 Jun 2018 08:57:04 GMT</pubDate>
      <guid>https://community.intel.com/t5/Items-with-no-label/Converting-RealSense-Pointcloud-to-PCL-Pointcloud/m-p/541959#M7936</guid>
      <dc:creator>EMráz</dc:creator>
      <dc:date>2018-06-21T08:57:04Z</dc:date>
    </item>
    <item>
      <title>Re: Converting RealSense Pointcloud to PCL Pointcloud</title>
      <link>https://community.intel.com/t5/Items-with-no-label/Converting-RealSense-Pointcloud-to-PCL-Pointcloud/m-p/541960#M7937</link>
      <description>&lt;P&gt;Here's how someone did the PCL conversion for RGB:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://github.com/IntelRealSense/librealsense/issues/1143"&gt;https://github.com/IntelRealSense/librealsense/issues/1143&lt;/A&gt; Generate a colorized PCL point cloud · Issue # 1143 · IntelRealSense/librealsense · GitHub &lt;/P&gt;</description>
      <pubDate>Thu, 21 Jun 2018 09:30:23 GMT</pubDate>
      <guid>https://community.intel.com/t5/Items-with-no-label/Converting-RealSense-Pointcloud-to-PCL-Pointcloud/m-p/541960#M7937</guid>
      <dc:creator>MartyG</dc:creator>
      <dc:date>2018-06-21T09:30:23Z</dc:date>
    </item>
    <item>
      <title>Re: Converting RealSense Pointcloud to PCL Pointcloud</title>
      <link>https://community.intel.com/t5/Items-with-no-label/Converting-RealSense-Pointcloud-to-PCL-Pointcloud/m-p/541961#M7938</link>
      <description>&lt;P&gt;Hi!&lt;/P&gt;&lt;P&gt;You can try this !&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;typedef pcl::PointXYZRGB P_pcl;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;typedef pcl::PointCloud&amp;lt;&amp;lt;span style="color: # b9bcd1;"&amp;gt;P_pcl&amp;gt; point_cloud;&lt;P&gt;&amp;nbsp;&lt;/P&gt;typedef point_cloud::Ptr ptr_cloud;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;std::tuple&amp;lt;&amp;lt;span style="color: # b9bcd1;"&amp;gt;uint8_t, uint8_t, uint8_t&amp;gt; get_texcolor(rs2::video_frame texture, rs2::texture_coordinate texcoords)&lt;/P&gt;&lt;P&gt;{&lt;/P&gt;&lt;P&gt;   const int w = texture.get_width(), h = texture.get_height();&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;   int x = std::min(std::max(int(texcoords.u*w + .5f), 0), w - 1);&lt;P&gt;&amp;nbsp;&lt;/P&gt;   int y = std::min(std::max(int(texcoords.v*h + .5f), 0), h - 1);&lt;P&gt;&amp;nbsp;&lt;/P&gt;   int idx = x * texture.get_bytes_per_pixel() + y * texture.get_stride_in_bytes();&lt;P&gt;&amp;nbsp;&lt;/P&gt;   const auto texture_data = reinterpret_cast&amp;lt;&amp;lt;span style="color: # cc7832; font-weight: bold;"&amp;gt;const uint8_t*&amp;gt;(texture.get_data());&lt;P&gt;&amp;nbsp;&lt;/P&gt;   return std::tuple&amp;lt;&amp;lt;span style="color: # b9bcd1;"&amp;gt;uint8_t, uint8_t, uint8_t&amp;gt;(&lt;P&gt;  texture_data[idx], texture_data[idx + 1], texture_data[idx + 2]);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;}&lt;P&gt;&lt;/P&gt;&lt;P&gt;ptr_cloud points_to_pcl(const rs2::points&amp;amp; points, const rs2::video_frame&amp;amp; color){&lt;/P&gt;&lt;P&gt;   ptr_cloud cloud(new point_cloud);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;   auto sp = points.get_profile().as&amp;lt;&amp;lt;span style="color: # b5b6e3;"&amp;gt;rs2::video_stream_profile&amp;gt;();&lt;P&gt;&amp;nbsp;&lt;/P&gt;   cloud-&amp;gt;width = static_cast&amp;lt;&amp;lt;span style="color: # b9bcd1;"&amp;gt;uint32_t&amp;gt;(sp.width());&lt;P&gt;&amp;nbsp;&lt;/P&gt;   cloud-&amp;gt;height = static_cast&amp;lt;&amp;lt;span style="color: # b9bcd1;"&amp;gt;uint32_t&amp;gt;(sp.height());&lt;P&gt;&amp;nbsp;&lt;/P&gt;   cloud-&amp;gt;&amp;lt;span style="color: # 9373a5;"...</description>
      <pubDate>Thu, 21 Jun 2018 11:38:20 GMT</pubDate>
      <guid>https://community.intel.com/t5/Items-with-no-label/Converting-RealSense-Pointcloud-to-PCL-Pointcloud/m-p/541961#M7938</guid>
      <dc:creator>BMana</dc:creator>
      <dc:date>2018-06-21T11:38:20Z</dc:date>
    </item>
    <item>
      <title>Re: Converting RealSense Pointcloud to PCL Pointcloud</title>
      <link>https://community.intel.com/t5/Items-with-no-label/Converting-RealSense-Pointcloud-to-PCL-Pointcloud/m-p/541962#M7939</link>
      <description>&lt;P&gt;Thanks so much for your help with this question!   &lt;/P&gt;</description>
      <pubDate>Thu, 21 Jun 2018 11:44:22 GMT</pubDate>
      <guid>https://community.intel.com/t5/Items-with-no-label/Converting-RealSense-Pointcloud-to-PCL-Pointcloud/m-p/541962#M7939</guid>
      <dc:creator>MartyG</dc:creator>
      <dc:date>2018-06-21T11:44:22Z</dc:date>
    </item>
    <item>
      <title>Re: Converting RealSense Pointcloud to PCL Pointcloud</title>
      <link>https://community.intel.com/t5/Items-with-no-label/Converting-RealSense-Pointcloud-to-PCL-Pointcloud/m-p/541963#M7940</link>
      <description>&lt;P&gt;The sources if you need more infos : &lt;A href="https://github.com/IntelRealSense/librealsense/issues/1601"&gt;https://github.com/IntelRealSense/librealsense/issues/1601&lt;/A&gt; Obtaining RGB values fora colorised PCL point cloud. · Issue # 1601 · IntelRealSense/librealsense · GitHub &lt;/P&gt;&lt;P&gt;You can mark the answer as resolved if it works! &lt;/P&gt;</description>
      <pubDate>Thu, 21 Jun 2018 12:19:09 GMT</pubDate>
      <guid>https://community.intel.com/t5/Items-with-no-label/Converting-RealSense-Pointcloud-to-PCL-Pointcloud/m-p/541963#M7940</guid>
      <dc:creator>BMana</dc:creator>
      <dc:date>2018-06-21T12:19:09Z</dc:date>
    </item>
    <item>
      <title>Re: Converting RealSense Pointcloud to PCL Pointcloud</title>
      <link>https://community.intel.com/t5/Items-with-no-label/Converting-RealSense-Pointcloud-to-PCL-Pointcloud/m-p/541964#M7941</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for the code, I have found it before, but the pointcloud is single-colored somehow. I will post info tomorrow. I appreciate your help, thanks again!&lt;/P&gt;</description>
      <pubDate>Thu, 21 Jun 2018 14:48:20 GMT</pubDate>
      <guid>https://community.intel.com/t5/Items-with-no-label/Converting-RealSense-Pointcloud-to-PCL-Pointcloud/m-p/541964#M7941</guid>
      <dc:creator>EMráz</dc:creator>
      <dc:date>2018-06-21T14:48:20Z</dc:date>
    </item>
    <item>
      <title>Re: Converting RealSense Pointcloud to PCL Pointcloud</title>
      <link>https://community.intel.com/t5/Items-with-no-label/Converting-RealSense-Pointcloud-to-PCL-Pointcloud/m-p/541965#M7942</link>
      <description>&lt;P&gt;The code that I post above works with the good colors &lt;/P&gt;</description>
      <pubDate>Thu, 21 Jun 2018 14:50:29 GMT</pubDate>
      <guid>https://community.intel.com/t5/Items-with-no-label/Converting-RealSense-Pointcloud-to-PCL-Pointcloud/m-p/541965#M7942</guid>
      <dc:creator>BMana</dc:creator>
      <dc:date>2018-06-21T14:50:29Z</dc:date>
    </item>
    <item>
      <title>Re: Converting RealSense Pointcloud to PCL Pointcloud</title>
      <link>https://community.intel.com/t5/Items-with-no-label/Converting-RealSense-Pointcloud-to-PCL-Pointcloud/m-p/541966#M7943</link>
      <description>&lt;P&gt;Hello again,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So I will post here my code - all points have the same color, I cannot tell why. I replaced pcl::io::savePCDFileBinary with pcl::io::savePCDFileASCII. So I can see the values through text editor. Every point has RGB value of 4283717469. This is the code: &lt;A href="https://github.com/eMrazSVK/JetsonSLAM/blob/master/pcl_testing.cpp"&gt;https://github.com/eMrazSVK/JetsonSLAM/blob/master/pcl_testing.cpp&lt;/A&gt; JetsonSLAM/pcl_testing.cpp at master · eMrazSVK/JetsonSLAM · GitHub &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can also take a look at the CMakeLists.txt, but I think it is all right so far. If any additional info would help, just let me know, I will post it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you.&lt;/P&gt;&lt;P&gt;EDIT: MartyG sorry, I unmarked the question as answered, because it did not solve the problem for me for now. &lt;/P&gt;&lt;P&gt; &lt;/P&gt;</description>
      <pubDate>Fri, 22 Jun 2018 08:46:07 GMT</pubDate>
      <guid>https://community.intel.com/t5/Items-with-no-label/Converting-RealSense-Pointcloud-to-PCL-Pointcloud/m-p/541966#M7943</guid>
      <dc:creator>EMráz</dc:creator>
      <dc:date>2018-06-22T08:46:07Z</dc:date>
    </item>
    <item>
      <title>Re: Converting RealSense Pointcloud to PCL Pointcloud</title>
      <link>https://community.intel.com/t5/Items-with-no-label/Converting-RealSense-Pointcloud-to-PCL-Pointcloud/m-p/541967#M7944</link>
      <description>&lt;P&gt;No worries, taking off the Answered marking is the right thing to do if you need further assistance.  &lt;/P&gt;</description>
      <pubDate>Fri, 22 Jun 2018 10:49:20 GMT</pubDate>
      <guid>https://community.intel.com/t5/Items-with-no-label/Converting-RealSense-Pointcloud-to-PCL-Pointcloud/m-p/541967#M7944</guid>
      <dc:creator>MartyG</dc:creator>
      <dc:date>2018-06-22T10:49:20Z</dc:date>
    </item>
    <item>
      <title>Re: Converting RealSense Pointcloud to PCL Pointcloud</title>
      <link>https://community.intel.com/t5/Items-with-no-label/Converting-RealSense-Pointcloud-to-PCL-Pointcloud/m-p/541968#M7945</link>
      <description>&lt;P&gt;So I am Replying to my own question, which was answered on Git ( &lt;A href="https://github.com/IntelRealSense/librealsense/issues/1939"&gt;https://github.com/IntelRealSense/librealsense/issues/1939&lt;/A&gt; &lt;A href="https://github.com/IntelRealSense/librealsense/issues/1939"&gt;https://github.com/IntelRealSense/librealsense/issues/1939&lt;/A&gt; )&lt;/P&gt;&lt;P&gt;So, the problem in baptiste-mnh solution was basically in exchanging two lines:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;auto points = pc.calculate(depth);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;pc.map_to(colored_frame);&lt;P&gt;&lt;/P&gt;&lt;P&gt;To:&lt;/P&gt;&lt;P&gt;pc.map_to(colored_frame);&lt;/P&gt;&lt;P&gt;auto points = pc.calculate(depth);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It is described in the Git issue posted above. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So here is the full working code, it may be considered like PCL wrapper for RealSense supporting XYZ + RGB conversion - &lt;A href="https://github.com/eMrazSVK/JetsonSLAM/blob/master/pcl_testing.cpp"&gt;https://github.com/eMrazSVK/JetsonSLAM/blob/master/pcl_testing.cpp&lt;/A&gt; &lt;A href="https://github.com/eMrazSVK/JetsonSLAM/blob/master/pcl_testing.cpp"&gt;https://github.com/eMrazSVK/JetsonSLAM/blob/master/pcl_testing.cpp&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks everyone for your help!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 25 Jun 2018 09:33:35 GMT</pubDate>
      <guid>https://community.intel.com/t5/Items-with-no-label/Converting-RealSense-Pointcloud-to-PCL-Pointcloud/m-p/541968#M7945</guid>
      <dc:creator>EMráz</dc:creator>
      <dc:date>2018-06-25T09:33:35Z</dc:date>
    </item>
    <item>
      <title>Re: Converting RealSense Pointcloud to PCL Pointcloud</title>
      <link>https://community.intel.com/t5/Items-with-no-label/Converting-RealSense-Pointcloud-to-PCL-Pointcloud/m-p/541969#M7946</link>
      <description>&lt;P&gt;Oh, you answer one of my issues &lt;/P&gt;&lt;P&gt;When I was exporting .ply, the first one wasn't colored but the next ones were colored. I think it's because I inversed those lines!&lt;/P&gt;</description>
      <pubDate>Mon, 25 Jun 2018 10:55:07 GMT</pubDate>
      <guid>https://community.intel.com/t5/Items-with-no-label/Converting-RealSense-Pointcloud-to-PCL-Pointcloud/m-p/541969#M7946</guid>
      <dc:creator>BMana</dc:creator>
      <dc:date>2018-06-25T10:55:07Z</dc:date>
    </item>
  </channel>
</rss>

