<?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 converting PXCImage to Mat format in Software Archive</title>
    <link>https://community.intel.com/t5/Software-Archive/converting-PXCImage-to-Mat-format/m-p/1090765#M65211</link>
    <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;

&lt;P&gt;&amp;nbsp; &amp;nbsp;Greeting,&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;

&lt;P&gt;&amp;nbsp;I am working on obstacle detection using realsense, R200 camera and&amp;nbsp;&lt;SPAN style="font-size: 1em; line-height: 1.5;"&gt;I am having a difficulty of converting PXCImage to a Mat format (OpenCV for further image processing). I used IplImage as an intermediate but i am loosing a lot of information when converting it to mat. i saw this effect (discontinuity on depth image) when i extracted the edge of depth image. what should i do? please anyone, I need help on this issue.&lt;/SPAN&gt;&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;

&lt;P&gt;&lt;SPAN style="font-size: 1em; line-height: 1.5;"&gt;&amp;nbsp;thank you in advance&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Fri, 15 Apr 2016 09:20:48 GMT</pubDate>
    <dc:creator>Issayas_T_</dc:creator>
    <dc:date>2016-04-15T09:20:48Z</dc:date>
    <item>
      <title>converting PXCImage to Mat format</title>
      <link>https://community.intel.com/t5/Software-Archive/converting-PXCImage-to-Mat-format/m-p/1090765#M65211</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;

&lt;P&gt;&amp;nbsp; &amp;nbsp;Greeting,&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;

&lt;P&gt;&amp;nbsp;I am working on obstacle detection using realsense, R200 camera and&amp;nbsp;&lt;SPAN style="font-size: 1em; line-height: 1.5;"&gt;I am having a difficulty of converting PXCImage to a Mat format (OpenCV for further image processing). I used IplImage as an intermediate but i am loosing a lot of information when converting it to mat. i saw this effect (discontinuity on depth image) when i extracted the edge of depth image. what should i do? please anyone, I need help on this issue.&lt;/SPAN&gt;&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;

&lt;P&gt;&lt;SPAN style="font-size: 1em; line-height: 1.5;"&gt;&amp;nbsp;thank you in advance&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 15 Apr 2016 09:20:48 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Archive/converting-PXCImage-to-Mat-format/m-p/1090765#M65211</guid>
      <dc:creator>Issayas_T_</dc:creator>
      <dc:date>2016-04-15T09:20:48Z</dc:date>
    </item>
    <item>
      <title>Have a look at this video</title>
      <link>https://community.intel.com/t5/Software-Archive/converting-PXCImage-to-Mat-format/m-p/1090766#M65212</link>
      <description>&lt;P&gt;Have a look at this video that explains how to get the raw data from an F200, and convert the images into an OpenCV Mat object:&lt;/P&gt;

&lt;P&gt;&lt;A href="https://www.youtube.com/watch?v=wIkIdjN6Oyw"&gt;https://www.youtube.com/watch?v=wIkIdjN6Oyw&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;And here is the conversion shown in the video:&lt;/P&gt;

&lt;PRE class="brush:cpp;"&gt;cv::Mat PXCImage2CVMat(PXCImage *pxcImage, PXCImage::PixelFormat format)
{
    PXCImage::ImageData data;
    pxcImage-&amp;gt;AcquireAccess(PXCImage::ACCESS_READ, format, &amp;amp;data);

    int width = pxcImage-&amp;gt;QueryInfo().width;
    int height = pxcImage-&amp;gt;QueryInfo().height;

    if(!format)
        format = pxcImage-&amp;gt;QueryInfo().format;

    int type;
    if(format == PXCImage::PIXEL_FORMAT_Y8)
        type = CV_8UC1;
    else if(format == PXCImage::PIXEL_FORMAT_RGB24)
        type = CV_8UC3;
    else if(format == PXCImage::PIXEL_FORMAT_DEPTH_F32)
        type = CV_32FC1;

    cv::Mat ocvImage = cv::Mat(cv::Size(width, height), type, data.planes[0]);

    pxcImage-&amp;gt;ReleaseAccess(&amp;amp;data);
    return ocvImage;
}&lt;/PRE&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 15 Apr 2016 11:46:30 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Archive/converting-PXCImage-to-Mat-format/m-p/1090766#M65212</guid>
      <dc:creator>samontab</dc:creator>
      <dc:date>2016-04-15T11:46:30Z</dc:date>
    </item>
    <item>
      <title> </title>
      <link>https://community.intel.com/t5/Software-Archive/converting-PXCImage-to-Mat-format/m-p/1090767#M65213</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;

&lt;P&gt;&amp;nbsp;i found it very useful.........thanks samontab&lt;/P&gt;</description>
      <pubDate>Fri, 15 Apr 2016 12:53:39 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Archive/converting-PXCImage-to-Mat-format/m-p/1090767#M65213</guid>
      <dc:creator>Issayas_T_</dc:creator>
      <dc:date>2016-04-15T12:53:39Z</dc:date>
    </item>
    <item>
      <title>  </title>
      <link>https://community.intel.com/t5/Software-Archive/converting-PXCImage-to-Mat-format/m-p/1090768#M65214</link>
      <description>&lt;P&gt;&amp;nbsp;&amp;nbsp;&lt;/P&gt;

&lt;P&gt;&amp;nbsp; &amp;nbsp;Greeting,&lt;/P&gt;

&lt;P&gt;&amp;nbsp;i could not visualize how a realsense camera allocate memory to grab an&amp;nbsp;&lt;SPAN style="font-size: 13.008px; line-height: 19.512px;"&gt;image of PXCImage format. I was wondering if anyone can tell me &amp;nbsp;about this two things&lt;/SPAN&gt;&lt;/P&gt;

&lt;P&gt;&lt;SPAN style="font-size: 13.008px; line-height: 19.512px;"&gt;&amp;nbsp;&amp;nbsp; 1.&amp;nbsp;&lt;/SPAN&gt;colorData.pitches[0]&lt;/P&gt;

&lt;P&gt;&amp;nbsp; &amp;nbsp;2.&amp;nbsp;data.planes[0];&lt;/P&gt;

&lt;P&gt;&amp;nbsp;thank you&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 16 Apr 2016 17:39:23 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Archive/converting-PXCImage-to-Mat-format/m-p/1090768#M65214</guid>
      <dc:creator>Issayas_T_</dc:creator>
      <dc:date>2016-04-16T17:39:23Z</dc:date>
    </item>
  </channel>
</rss>

