<?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: Convert YUYV frame to RGB8 frame in Items with no label</title>
    <link>https://community.intel.com/t5/Items-with-no-label/Convert-YUYV-frame-to-RGB8-frame/m-p/579331#M10693</link>
    <description>&lt;P&gt;Awesome, thanks so much for sharing your method with the community!  &lt;/P&gt;</description>
    <pubDate>Wed, 25 Jul 2018 14:45:18 GMT</pubDate>
    <dc:creator>MartyG</dc:creator>
    <dc:date>2018-07-25T14:45:18Z</dc:date>
    <item>
      <title>Convert YUYV frame to RGB8 frame</title>
      <link>https://community.intel.com/t5/Items-with-no-label/Convert-YUYV-frame-to-RGB8-frame/m-p/579325#M10687</link>
      <description>&lt;P&gt;Are there methods available in the librealsense SDK to convert a YUYV frame into a RGB8 frame?&lt;/P&gt;&lt;P&gt;When saving a stream in a .bag file I prefer saving the files in YUYV format, to minimize CPU load. &lt;/P&gt;&lt;P&gt;However, when viewing/ exporting the color data of the stream I'd like to convert this into RGB8 colors.&lt;/P&gt;&lt;P&gt;Therefore I was wondering if a conversion from a YUYV frame to RGB8 frame is integrated in the SDK. &lt;/P&gt;</description>
      <pubDate>Wed, 25 Jul 2018 07:16:50 GMT</pubDate>
      <guid>https://community.intel.com/t5/Items-with-no-label/Convert-YUYV-frame-to-RGB8-frame/m-p/579325#M10687</guid>
      <dc:creator>THark</dc:creator>
      <dc:date>2018-07-25T07:16:50Z</dc:date>
    </item>
    <item>
      <title>Re: Convert YUYV frame to RGB8 frame</title>
      <link>https://community.intel.com/t5/Items-with-no-label/Convert-YUYV-frame-to-RGB8-frame/m-p/579326#M10688</link>
      <description>&lt;P&gt;There is a tool called Convert for converting a bag file into a range of formats such as PNG, color frames only or depth frames only.  Would this be an acceptable alternative to a YUYV to RGB8 conversion?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://github.com/IntelRealSense/librealsense/tree/master/tools/convert"&gt;https://github.com/IntelRealSense/librealsense/tree/master/tools/convert&lt;/A&gt; librealsense/tools/convert at master · IntelRealSense/librealsense · GitHub &lt;/P&gt;</description>
      <pubDate>Wed, 25 Jul 2018 07:36:57 GMT</pubDate>
      <guid>https://community.intel.com/t5/Items-with-no-label/Convert-YUYV-frame-to-RGB8-frame/m-p/579326#M10688</guid>
      <dc:creator>MartyG</dc:creator>
      <dc:date>2018-07-25T07:36:57Z</dc:date>
    </item>
    <item>
      <title>Re: Convert YUYV frame to RGB8 frame</title>
      <link>https://community.intel.com/t5/Items-with-no-label/Convert-YUYV-frame-to-RGB8-frame/m-p/579327#M10689</link>
      <description>&lt;P&gt;The converter will still keep the same image format if I understand correctly. For example, when selecting the png export, the exported color frames are still gray. So this does not seem to be the solution I'm looking for. It could be that I just need to write a solution myself, but I was just wondering if this conversion between YUYV and RGB8 already had been done before. &lt;/P&gt;</description>
      <pubDate>Wed, 25 Jul 2018 07:56:06 GMT</pubDate>
      <guid>https://community.intel.com/t5/Items-with-no-label/Convert-YUYV-frame-to-RGB8-frame/m-p/579327#M10689</guid>
      <dc:creator>THark</dc:creator>
      <dc:date>2018-07-25T07:56:06Z</dc:date>
    </item>
    <item>
      <title>Re: Convert YUYV frame to RGB8 frame</title>
      <link>https://community.intel.com/t5/Items-with-no-label/Convert-YUYV-frame-to-RGB8-frame/m-p/579328#M10690</link>
      <description>&lt;P&gt;YUYV to RGB conversion can be done using OpenCV.  Here's an example:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://chapmankids.net/blog/2016/09/16/yuyv-yuv422-to-bgrrgb-conversion-for-logitch-c270-camera-using-opencv/"&gt;http://chapmankids.net/blog/2016/09/16/yuyv-yuv422-to-bgrrgb-conversion-for-logitch-c270-camera-using-opencv/&lt;/A&gt; YUYV (YUV422) to BGR/RGB conversion (for Logitch C270 camera using openCV) | Chapman Kids Blog &lt;/P&gt;</description>
      <pubDate>Wed, 25 Jul 2018 08:09:27 GMT</pubDate>
      <guid>https://community.intel.com/t5/Items-with-no-label/Convert-YUYV-frame-to-RGB8-frame/m-p/579328#M10690</guid>
      <dc:creator>MartyG</dc:creator>
      <dc:date>2018-07-25T08:09:27Z</dc:date>
    </item>
    <item>
      <title>Re: Convert YUYV frame to RGB8 frame</title>
      <link>https://community.intel.com/t5/Items-with-no-label/Convert-YUYV-frame-to-RGB8-frame/m-p/579329#M10691</link>
      <description>&lt;P&gt;Ok great, then I'll use OpenCV to do the conversion. &lt;/P&gt;</description>
      <pubDate>Wed, 25 Jul 2018 08:18:23 GMT</pubDate>
      <guid>https://community.intel.com/t5/Items-with-no-label/Convert-YUYV-frame-to-RGB8-frame/m-p/579329#M10691</guid>
      <dc:creator>THark</dc:creator>
      <dc:date>2018-07-25T08:18:23Z</dc:date>
    </item>
    <item>
      <title>Re: Convert YUYV frame to RGB8 frame</title>
      <link>https://community.intel.com/t5/Items-with-no-label/Convert-YUYV-frame-to-RGB8-frame/m-p/579330#M10692</link>
      <description>&lt;P&gt;It turns out that OpenCV has quite a friendly mechanism to convert between different image formats. &lt;/P&gt;&lt;P&gt;Below you can find a snippet of the code I'm using to convert from YUYV to a BGR frame (I had some issues with a RGB frame).&lt;/P&gt;&lt;P&gt;Hopefully this will be useful for other people trying to do similar conversions. &lt;/P&gt;&lt;P&gt;It should be relatively easy to change the YUYV or BGR format for different image formats when necessary.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;// Includes&lt;/P&gt;&lt;P&gt;# include &lt;/P&gt;&lt;P&gt;# include  &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;// Code snippet&lt;/P&gt;&lt;P&gt;rs2::pipeline pipe;&lt;/P&gt;&lt;P&gt;rs2::config cfg;&lt;/P&gt;&lt;P&gt;//Create a configuration for configuring the pipeline with a non default profile&lt;/P&gt;&lt;P&gt;int width = 1280; &lt;/P&gt;&lt;P&gt;int height = 720; &lt;/P&gt;&lt;P&gt;cfg.enable_stream(RS2_STREAM_COLOR, width, height, RS2_FORMAT_YUYV, 30);&lt;/P&gt;&lt;P&gt;pipe.start(cfg); &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;// Record x frames&lt;/P&gt;&lt;P&gt;int x = 10; &lt;/P&gt;&lt;P&gt;for (int i = 0; i &amp;lt; x; i++){&lt;/P&gt;&lt;P&gt;     auto frames = pipe.wait_for_frames();&lt;/P&gt;&lt;P&gt;     rs2::frame color_frame = frames.get_color_frame();&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;     // Creating OpenCV Matrix from a color image.&lt;/P&gt;&lt;P&gt;     cv::Mat color(cv::Size(width, height), CV_8UC2, (void*)color_frame.get_data(), cv::Mat::AUTO_STEP);&lt;/P&gt;&lt;P&gt;     cv::Mat colorRGB;&lt;/P&gt;&lt;P&gt;     // Apply color conversion&lt;/P&gt;&lt;P&gt;     cvtColor(color, colorRGB, cv::COLOR_YUV2BGRA_YUY2);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;     // Display the last frame of the recording to test if the conversion worked (the first frame of the recording is quite dark)&lt;/P&gt;&lt;P&gt;     if (i ==x-1) {&lt;/P&gt;&lt;P&gt;          imshow("RGB image", colorRGB);&lt;/P&gt;&lt;P&gt;          cv::waitKey(0);&lt;/P&gt;&lt;P&gt;     }&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;</description>
      <pubDate>Wed, 25 Jul 2018 14:43:02 GMT</pubDate>
      <guid>https://community.intel.com/t5/Items-with-no-label/Convert-YUYV-frame-to-RGB8-frame/m-p/579330#M10692</guid>
      <dc:creator>THark</dc:creator>
      <dc:date>2018-07-25T14:43:02Z</dc:date>
    </item>
    <item>
      <title>Re: Convert YUYV frame to RGB8 frame</title>
      <link>https://community.intel.com/t5/Items-with-no-label/Convert-YUYV-frame-to-RGB8-frame/m-p/579331#M10693</link>
      <description>&lt;P&gt;Awesome, thanks so much for sharing your method with the community!  &lt;/P&gt;</description>
      <pubDate>Wed, 25 Jul 2018 14:45:18 GMT</pubDate>
      <guid>https://community.intel.com/t5/Items-with-no-label/Convert-YUYV-frame-to-RGB8-frame/m-p/579331#M10693</guid>
      <dc:creator>MartyG</dc:creator>
      <dc:date>2018-07-25T14:45:18Z</dc:date>
    </item>
  </channel>
</rss>

