<?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: How to get the world coordinates from 3D image for OpenCV? in Items with no label</title>
    <link>https://community.intel.com/t5/Items-with-no-label/How-to-get-the-world-coordinates-from-3D-image-for-OpenCV/m-p/515929#M6791</link>
    <description>&lt;P&gt;I did some further research.  In this link, a person gets the world coordinates from the image coordinates in OpenCV with a non-RealSense camera using a function called solvePnP.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://answers.opencv.org/question/62779/image-coordinate-to-world-coordinate-opencv/"&gt;http://answers.opencv.org/question/62779/image-coordinate-to-world-coordinate-opencv/&lt;/A&gt; image coordinate to world coordinate opencv - OpenCV Q&amp;amp;A Forum&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And on another YouTube video, somebody gets coordinates in mm using OpenCV's triangulatePoints function.  The useful point on this video is the detailed text description's explanation of the process under 'Show More', not the video itself.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://www.youtube.com/watch?v=FrYBhLJGiE4"&gt;https://www.youtube.com/watch?v=FrYBhLJGiE4&lt;/A&gt; OpenCV triangulate points - YouTube&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This next video is about getting the image coordinates, which isn't what you asked for.  But it has a link to source code that still works, and in the comments the author of the video says to someone who asked about world coordinates that they can get them with the same script by changing the script to use camera capture.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://www.youtube.com/watch?v=TYeNGnAQNt0"&gt;https://www.youtube.com/watch?v=TYeNGnAQNt0&lt;/A&gt; opencv tutorial:program to find the coordinates of a pixel on an image - YouTube&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;That was all I was able to find that seemed relevant.  Sorry I could not be of more help in this case.&lt;/P&gt;</description>
    <pubDate>Sun, 07 May 2017 06:10:18 GMT</pubDate>
    <dc:creator>MartyG</dc:creator>
    <dc:date>2017-05-07T06:10:18Z</dc:date>
    <item>
      <title>How to get the world coordinates from 3D image for OpenCV?</title>
      <link>https://community.intel.com/t5/Items-with-no-label/How-to-get-the-world-coordinates-from-3D-image-for-OpenCV/m-p/515926#M6788</link>
      <description>&lt;P&gt;Hey guys, it is me again. I finally managed to construct the world coordinates image using the QueryVertices function, but I really do not get it how to have access to the distance in mm.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have read lots of forums and the documentation, which says I need to give the location (x,y) to the vertices matrix and then I get the distance in mm (I am not sure if it is x,y position in the world's space or x,y pixel's position). Nevertheless, neither I find that matrix nor I know how to construct it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;At the end of every thing, I only need the whole world coordinates (x,y,z) in the openCV's coordinate system.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Again, I am working with OpenCV,  the R200 camera and VisualStudio C++&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PXCImage* R200Driver::DepthToWorldByQueryVertices() {&lt;/P&gt;&lt;P&gt;  PXCImage *depth = frameDepth;&lt;/P&gt;&lt;P&gt;  PXCPoint3DF32 ligKht = {};&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  if (!drawVertices || !projection) return 0;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  PXCImage::ImageInfo drawVerticesInfo = drawVertices-&amp;gt;QueryInfo();&lt;/P&gt;&lt;P&gt;  PXCImage::ImageData drawVerticesDat;&lt;/P&gt;&lt;P&gt;  if (PXC_STATUS_NO_ERROR &amp;gt; drawVertices-&amp;gt;AcquireAccess(PXCImage::ACCESS_WRITE, drawVerticesInfo.format, &amp;amp;drawVerticesDat))&lt;/P&gt;&lt;P&gt;  return 0;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  /* Retrieve vertices */&lt;/P&gt;&lt;P&gt;  float brightness = 200.f;&lt;/P&gt;&lt;P&gt;  pxcStatus sts = projection-&amp;gt;QueryVertices(depth, &amp;amp;vertices[0]);&lt;/P&gt;&lt;P&gt;  if (sts &amp;gt;= PXC_STATUS_NO_ERROR) {&lt;/P&gt;&lt;P&gt;  PXCImage::ImageInfo dinfo = depth-&amp;gt;QueryInfo();&lt;/P&gt;&lt;P&gt;  pxcBYTE* pdrawVerticesDat = drawVerticesDat.planes[0];&lt;/P&gt;&lt;P&gt;  int hist, num;&lt;/P&gt;&lt;P&gt;  float avg, nz1, nz2;&lt;/P&gt;&lt;P&gt;  for (pxcI32 y = 0; y &amp;lt; dinfo.height - 1; y++) {&lt;/P&gt;&lt;P&gt;  for (pxcI32 x = 0; x &amp;lt; dinfo.width - 1; x++) {&lt;/P&gt;&lt;P&gt;  pdrawVerticesDat[4 * x] = pdrawVerticesDat[4 * x + 1] = pdrawVerticesDat[4 * x + 2] = 0;&lt;/P&gt;&lt;P&gt;  PXCPoint3DF32 *vertex = &amp;amp;vertices[y * dinfo.width + x];&lt;/P&gt;&lt;P&gt;  if (vertex-&amp;gt;z) {&lt;/P&gt;&lt;P&gt;  hist = 255;&lt;/P&gt;&lt;P&gt;  nz1 = (vertex[0].z - vertex[1].z) + (vertex[dinfo.width].z - vertex[dinfo.width + 1].z);&lt;/P&gt;&lt;P&gt;  nz2 = (vertex[0].z - vertex[dinfo.width].z) + (vertex[1].z - vertex[dinfo.width + 1].z);&lt;/P&gt;&lt;P&gt;  if (nz1 &amp;gt; 1 || nz2 &amp;gt; 1) {&lt;/P&gt;&lt;P&gt;  hist = (int)(brightness / sqrt(abs(nz1) + abs(nz2)));&lt;/P&gt;&lt;P&gt;  if (hist &amp;gt; 255) hist = 255;&lt;/P&gt;&lt;P&gt;  if (hist &amp;lt; 0) hist = 0;&lt;/P&gt;&lt;P&gt;  }&lt;/P&gt;&lt;P&gt;  pdrawVerticesDat[4 * x] = pdrawVerticesDat[4 * x + 1] = pdrawVerticesDat[4 * x + 2] = hist;&lt;/P&gt;&lt;P&gt;  }&lt;/P&gt;&lt;P&gt;  pdrawVerticesDat[4 * x + 3] = MAXBYTE;&lt;/P&gt;&lt;P&gt;  }&lt;/P&gt;&lt;P&gt;  pdrawVerticesDat += drawVerticesDat.pitches[0];&lt;/P&gt;&lt;P&gt;  }&lt;/P&gt;&lt;P&gt;  }&lt;/P&gt;&lt;P&gt;  drawVertices-&amp;gt;ReleaseAccess(&amp;amp;drawVerticesDat);&lt;/P&gt;&lt;P&gt;  return drawVertices;&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;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 06 May 2017 20:22:28 GMT</pubDate>
      <guid>https://community.intel.com/t5/Items-with-no-label/How-to-get-the-world-coordinates-from-3D-image-for-OpenCV/m-p/515926#M6788</guid>
      <dc:creator>FApon</dc:creator>
      <dc:date>2017-05-06T20:22:28Z</dc:date>
    </item>
    <item>
      <title>Re: How to get the world coordinates from 3D image for OpenCV?</title>
      <link>https://community.intel.com/t5/Items-with-no-label/How-to-get-the-world-coordinates-from-3D-image-for-OpenCV/m-p/515927#M6789</link>
      <description>&lt;P&gt;RealSense expert Samontab published a YouTube video about getting raw camera data into OpenCV.  I don't know if it will be useful to your particular issue but it may be worth a look.  &lt;/P&gt;&lt;P&gt;&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; Accessing data from the Intel RealSense F200 - YouTube &lt;/P&gt;</description>
      <pubDate>Sat, 06 May 2017 22:15:53 GMT</pubDate>
      <guid>https://community.intel.com/t5/Items-with-no-label/How-to-get-the-world-coordinates-from-3D-image-for-OpenCV/m-p/515927#M6789</guid>
      <dc:creator>MartyG</dc:creator>
      <dc:date>2017-05-06T22:15:53Z</dc:date>
    </item>
    <item>
      <title>Re: How to get the world coordinates from 3D image for OpenCV?</title>
      <link>https://community.intel.com/t5/Items-with-no-label/How-to-get-the-world-coordinates-from-3D-image-for-OpenCV/m-p/515928#M6790</link>
      <description>&lt;P&gt;Hello MartyG&lt;/P&gt;&lt;P&gt;Thank you for your reply, but I saw that video at the beginning of everything (maybe 4 months ago  ), it was really helpful because it gave me the relationship between FPS and what I was able to stream.&lt;/P&gt;&lt;P&gt;Unfortunately that information is not useful anymore, it is way different having the depth raw image from having the distance and the world coordinates.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks any way&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Kind regards&lt;/P&gt;&lt;P&gt;Fabian&lt;/P&gt;</description>
      <pubDate>Sun, 07 May 2017 02:05:10 GMT</pubDate>
      <guid>https://community.intel.com/t5/Items-with-no-label/How-to-get-the-world-coordinates-from-3D-image-for-OpenCV/m-p/515928#M6790</guid>
      <dc:creator>FApon</dc:creator>
      <dc:date>2017-05-07T02:05:10Z</dc:date>
    </item>
    <item>
      <title>Re: How to get the world coordinates from 3D image for OpenCV?</title>
      <link>https://community.intel.com/t5/Items-with-no-label/How-to-get-the-world-coordinates-from-3D-image-for-OpenCV/m-p/515929#M6791</link>
      <description>&lt;P&gt;I did some further research.  In this link, a person gets the world coordinates from the image coordinates in OpenCV with a non-RealSense camera using a function called solvePnP.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://answers.opencv.org/question/62779/image-coordinate-to-world-coordinate-opencv/"&gt;http://answers.opencv.org/question/62779/image-coordinate-to-world-coordinate-opencv/&lt;/A&gt; image coordinate to world coordinate opencv - OpenCV Q&amp;amp;A Forum&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And on another YouTube video, somebody gets coordinates in mm using OpenCV's triangulatePoints function.  The useful point on this video is the detailed text description's explanation of the process under 'Show More', not the video itself.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://www.youtube.com/watch?v=FrYBhLJGiE4"&gt;https://www.youtube.com/watch?v=FrYBhLJGiE4&lt;/A&gt; OpenCV triangulate points - YouTube&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This next video is about getting the image coordinates, which isn't what you asked for.  But it has a link to source code that still works, and in the comments the author of the video says to someone who asked about world coordinates that they can get them with the same script by changing the script to use camera capture.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://www.youtube.com/watch?v=TYeNGnAQNt0"&gt;https://www.youtube.com/watch?v=TYeNGnAQNt0&lt;/A&gt; opencv tutorial:program to find the coordinates of a pixel on an image - YouTube&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;That was all I was able to find that seemed relevant.  Sorry I could not be of more help in this case.&lt;/P&gt;</description>
      <pubDate>Sun, 07 May 2017 06:10:18 GMT</pubDate>
      <guid>https://community.intel.com/t5/Items-with-no-label/How-to-get-the-world-coordinates-from-3D-image-for-OpenCV/m-p/515929#M6791</guid>
      <dc:creator>MartyG</dc:creator>
      <dc:date>2017-05-07T06:10:18Z</dc:date>
    </item>
    <item>
      <title>Re: How to get the world coordinates from 3D image for OpenCV?</title>
      <link>https://community.intel.com/t5/Items-with-no-label/How-to-get-the-world-coordinates-from-3D-image-for-OpenCV/m-p/515930#M6792</link>
      <description>&lt;P&gt;So, you want to know how to get the vertex for a specific pixel in the image, right?&lt;/P&gt;&lt;P&gt;If the pixel you're interested in is in the depth image, that's easy as the vertices array is aligned to the depth image by default. For a point (u,v) in the depth image, the corresponding world point is v = vertices[u + v * depthImage.info.width].&lt;/P&gt;&lt;P&gt;If it's in the colour image, it's a bit more complicated. You'll first have to map the colour points to the depth image. There are a couple of ways to do this, depending on your situation. The easiest is probably by using &lt;A href="https://software.intel.com/sites/landingpage/realsense/camera-sdk/v1.1/documentation/html/index.html?mapcolortodepth_pxcprojection.html"&gt;https://software.intel.com/sites/landingpage/realsense/camera-sdk/v1.1/documentation/html/index.html?mapcolortodepth_pxcprojection.html&lt;/A&gt; MapColourToDepth, but this is only efficient if you have a "small number" of pixels you want to map. If you need to map anything approaching the whole image and you're at all concerned about performance, it'd be best to use either &lt;A href="https://software.intel.com/sites/landingpage/realsense/camera-sdk/v1.1/documentation/html/index.html?projectcolortocamera_pxcprojection.html"&gt;https://software.intel.com/sites/landingpage/realsense/camera-sdk/v1.1/documentation/html/index.html?projectcolortocamera_pxcprojection.html&lt;/A&gt; ProjectColourToCamera or &lt;A href="http://https//software.intel.com/sites/landingpage/realsense/camera-sdk/v1.1/documentation/html/index.html?queryinvuvmap_pxcprojection.html"&gt;http://https//software.intel.com/sites/landingpage/realsense/camera-sdk/v1.1/documentation/html/index.html?queryinvuvmap_pxcprojection.html&lt;/A&gt; QueryInvUVMap. Once you have your colour pixel mapped to the depth image, the case is reduced to the depth image method above.&lt;/P&gt;&lt;P&gt;Note, for help with any of the methods linked, search this forum/google for the method name and you should find some snippets to get you started.&lt;/P&gt;</description>
      <pubDate>Mon, 08 May 2017 08:41:37 GMT</pubDate>
      <guid>https://community.intel.com/t5/Items-with-no-label/How-to-get-the-world-coordinates-from-3D-image-for-OpenCV/m-p/515930#M6792</guid>
      <dc:creator>jb455</dc:creator>
      <dc:date>2017-05-08T08:41:37Z</dc:date>
    </item>
    <item>
      <title>Re: How to get the world coordinates from 3D image for OpenCV?</title>
      <link>https://community.intel.com/t5/Items-with-no-label/How-to-get-the-world-coordinates-from-3D-image-for-OpenCV/m-p/515931#M6793</link>
      <description>&lt;P&gt;Hello fhfonsecaa,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;Thank you for your interest in the Intel® RealSense™ Technology.&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;I was wondering if you could check the suggestion provided by &lt;I&gt;jb455&lt;/I&gt;.&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;If you have any other question or update, don't hesitate to contact us.&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;Andres V.</description>
      <pubDate>Wed, 10 May 2017 22:58:20 GMT</pubDate>
      <guid>https://community.intel.com/t5/Items-with-no-label/How-to-get-the-world-coordinates-from-3D-image-for-OpenCV/m-p/515931#M6793</guid>
      <dc:creator>idata</dc:creator>
      <dc:date>2017-05-10T22:58:20Z</dc:date>
    </item>
  </channel>
</rss>

