<?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: Pyrealsense2: Colorizer not working / no implmentation of Align in Items with no label</title>
    <link>https://community.intel.com/t5/Items-with-no-label/Pyrealsense2-Colorizer-not-working-no-implmentation-of-Align/m-p/276981#M159</link>
    <description>&lt;P&gt;I have very little knowledge of Python coding, so may not be of much help here.  I did look at an SDK 2.0 script reference though, and noticed that it used the 'frameset' instruction instead of 'frames' for get_color_frame and get_depth_frame.  So maybe you could try changing these lines to:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;color = frameset.get_color_frame() &lt;/P&gt;&lt;P&gt;depth = frameset.get_depth_frame() &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This is the page I referred to:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://github.com/IntelRealSense/librealsense/tree/development/examples/align"&gt;https://github.com/IntelRealSense/librealsense/tree/development/examples/align&lt;/A&gt; librealsense/examples/align at development · IntelRealSense/librealsense · GitHub &lt;/P&gt;</description>
    <pubDate>Wed, 04 Oct 2017 07:09:19 GMT</pubDate>
    <dc:creator>MartyG</dc:creator>
    <dc:date>2017-10-04T07:09:19Z</dc:date>
    <item>
      <title>Pyrealsense2: Colorizer not working / no implmentation of Align</title>
      <link>https://community.intel.com/t5/Items-with-no-label/Pyrealsense2-Colorizer-not-working-no-implmentation-of-Align/m-p/276980#M158</link>
      <description>&lt;P&gt;Hello All,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm having a bear of a time getting up and running with Pyrealsense2 python bindings as part of the Intel RealSense SDK v2.7.9 release (with the ultimate goal of using it with OpenCV 3.3's python bindings).  I can't seem to find much actual documentation on use and almost no examples.  Generally, because the bindings are advertised as Cython wrappers I assume that less some obvious syntactical differences any C++ example should work using the python wrappers.  I've already run into three issues I can't figure out doing this and would be very grateful if anyone reading this can help me out a bit (or point me in the right direction)!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;B&gt;Colorize Doesn't Colorize:&lt;/B&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Using the following snippet adapted from the simple example in the repo:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;#  First import the library&lt;/P&gt;&lt;P&gt;import numpy as np&lt;/P&gt;&lt;P&gt;import cv2&lt;/P&gt;&lt;P&gt;import pyrealsense2 as rs2&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;c = rs2.colorizer()&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;#  Create a context object. This object owns the handles to all connected &lt;/P&gt;&lt;P&gt;#  realsense devices&lt;/P&gt;&lt;P&gt;pipeline = rs2.pipeline()&lt;/P&gt;&lt;P&gt;pipeline.start()&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;while True:&lt;/P&gt;&lt;P&gt;  #  This call waits until a new coherent set of frames is available on a &lt;/P&gt;&lt;P&gt;  #  device. Calls to get_frame_data(...) and get_frame_timestamp(...) on a&lt;/P&gt;&lt;P&gt;  #  device will return stable values until wait_for_frames(...) is called.&lt;/P&gt;&lt;P&gt;  frames = pipeline.wait_for_frames()&lt;/P&gt;&lt;P&gt;  color = frames.get_color_frame()&lt;/P&gt;&lt;P&gt;  depth = frames.get_depth_frame()&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  if (not depth) or (not color): &lt;/P&gt;&lt;P&gt;    print("Color or Depth not available!")&lt;/P&gt;&lt;P&gt;    break&lt;/P&gt;&lt;P&gt;  &lt;/P&gt;&lt;P&gt;  depth_RGB = c.colorize(depth)&lt;/P&gt;&lt;P&gt;  depth_img = np.asanyarray(depth_RGB.get_data())&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  #  Show the image in a new window&lt;/P&gt;&lt;P&gt;  cv2.namedWindow("Depth",cv2.WINDOW_NORMAL)    &lt;/P&gt;&lt;P&gt;  cv2.resizeWindow("Depth",640,480)&lt;/P&gt;&lt;P&gt;  cv2.imshow("Depth",depth_img)&lt;/P&gt;&lt;P&gt;  cv2.waitKey(0) &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I get an image that looks something like below.  It's limited to a reduced ROI in the full depth sensor field of view, "squashed" vertically, and certainly not re-colorized into 3 channel RGB of BGR.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;B&gt;Can't Discard Null Frame References:&lt;/B&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;In the same script I have the issue that the color frame stream always returns null frame references and the depth frame stream sometimes does as well.  When this happens the statement `if (not depth) or (not color): break` is unsuccessful at preventing get_data from throwing an exception with `RuntimeError: null pointer passed for argument "frame_ref"`&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;B&gt;No Implementation of Align:&lt;/B&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;A look at python.cpp seems to suggest that the python bindings do not implement the equivalent of rs2::context.create_align(RS2_STREAM_COLOR) as shown in the align C++ example.  Is that the case, is this planned for future implementation?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm getting the sense it might be a better idea to work with librealsense exclusively in C++ to write a subroutine for frame grabbing, alignment transformation, and processing/clipping that called from a python environment with numpy and the OpenCV python bindings.  Does that sound right?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks again!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;B&gt;System Configuration&lt;/B&gt;Camera ModelSR300Firmware Version3.21.0.0Operating System VersionUbuntu 16.04 LTSKernel Version4.10.0-35-generic (UVC Patched)</description>
      <pubDate>Tue, 03 Oct 2017 21:30:47 GMT</pubDate>
      <guid>https://community.intel.com/t5/Items-with-no-label/Pyrealsense2-Colorizer-not-working-no-implmentation-of-Align/m-p/276980#M158</guid>
      <dc:creator>idata</dc:creator>
      <dc:date>2017-10-03T21:30:47Z</dc:date>
    </item>
    <item>
      <title>Re: Pyrealsense2: Colorizer not working / no implmentation of Align</title>
      <link>https://community.intel.com/t5/Items-with-no-label/Pyrealsense2-Colorizer-not-working-no-implmentation-of-Align/m-p/276981#M159</link>
      <description>&lt;P&gt;I have very little knowledge of Python coding, so may not be of much help here.  I did look at an SDK 2.0 script reference though, and noticed that it used the 'frameset' instruction instead of 'frames' for get_color_frame and get_depth_frame.  So maybe you could try changing these lines to:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;color = frameset.get_color_frame() &lt;/P&gt;&lt;P&gt;depth = frameset.get_depth_frame() &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This is the page I referred to:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://github.com/IntelRealSense/librealsense/tree/development/examples/align"&gt;https://github.com/IntelRealSense/librealsense/tree/development/examples/align&lt;/A&gt; librealsense/examples/align at development · IntelRealSense/librealsense · GitHub &lt;/P&gt;</description>
      <pubDate>Wed, 04 Oct 2017 07:09:19 GMT</pubDate>
      <guid>https://community.intel.com/t5/Items-with-no-label/Pyrealsense2-Colorizer-not-working-no-implmentation-of-Align/m-p/276981#M159</guid>
      <dc:creator>MartyG</dc:creator>
      <dc:date>2017-10-04T07:09:19Z</dc:date>
    </item>
    <item>
      <title>Re: Pyrealsense2: Colorizer not working / no implmentation of Align</title>
      <link>https://community.intel.com/t5/Items-with-no-label/Pyrealsense2-Colorizer-not-working-no-implmentation-of-Align/m-p/276982#M160</link>
      <description>&lt;P&gt;Hi Ryank,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt; &lt;P&gt;&amp;nbsp;&lt;/P&gt;Have you tried changing the lines MartyG suggested?  &lt;P&gt;&amp;nbsp;&lt;/P&gt; &lt;P&gt;&amp;nbsp;&lt;/P&gt;Regards,&lt;P&gt;&amp;nbsp;&lt;/P&gt;-Yermi &lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 10 Oct 2017 23:06:48 GMT</pubDate>
      <guid>https://community.intel.com/t5/Items-with-no-label/Pyrealsense2-Colorizer-not-working-no-implmentation-of-Align/m-p/276982#M160</guid>
      <dc:creator>idata</dc:creator>
      <dc:date>2017-10-10T23:06:48Z</dc:date>
    </item>
  </channel>
</rss>

