<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[voxl-dfs-server: stereo pointcloud coordinate frame]]></title><description><![CDATA[<p dir="auto">Very quick question. I'm working on an application where I need to project the stereo_front_pc (from voxl-dfs-server) into the hires camera frame. This of course requires that I know the coordinate frame of the generated pointcloud. Since the underlying rectification process is closed source, I can't see any transformations involved in the rectification, just the resulting maps.</p>
<p dir="auto">Is the coordinate frame associated with left camera, rectified left camera (in which case, how do I lookup R), or something else?</p>
<p dir="auto">Tagging <a class="plugin-mentions-user plugin-mentions-a" href="https://forum.modalai.com/uid/11">@James-Strawson</a> and @thomas, since they are the authors of this package.</p>
<p dir="auto">Thanks!</p>
]]></description><link>https://forum.modalai.com/topic/3145/voxl-dfs-server-stereo-pointcloud-coordinate-frame</link><generator>RSS for Node</generator><lastBuildDate>Tue, 19 May 2026 13:19:31 GMT</lastBuildDate><atom:link href="https://forum.modalai.com/topic/3145.rss" rel="self" type="application/rss+xml"/><pubDate>Sun, 25 Feb 2024 20:31:53 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to voxl-dfs-server: stereo pointcloud coordinate frame on Mon, 26 Feb 2024 19:14:19 GMT]]></title><description><![CDATA[<p dir="auto">Hi Eric,</p>
<p dir="auto">The stereo camera pair intrinsics and extrinsics are saved to /data/modalai/opencv_stereo_intrinsics.yaml and /data/modalai/opencv_stereo_extrinsics.yaml</p>
<p dir="auto">We then use the following opencv calls to generate the rectification maps for each left and right image</p>
<pre><code>cv::Mat R1, P1, R2, P2;
	cv::Mat map11, map12, map21, map22;
	cv::Mat Q; // Output 4×4 disparity-to-depth mapping matrix, to be used later
	double alpha = -1; // default scaling, similar to our "zoom" parameter
	cv::stereoRectify(M1, D1, M2, D2, img_size, R, T, R1, R2, P1, P2, Q, cv::CALIB_ZERO_DISPARITY, alpha, img_size);

	// make sure this uses CV_32_FC2 map format so we can read it and convert to our own
	// MCV undistortion map format, map12 and 22 are empty/unused!!
	cv::initUndistortRectifyMap(M1, D1, R1, P1, img_size, CV_32FC2, map11, map12);
	cv::initUndistortRectifyMap(M2, D2, R2, P2, img_size, CV_32FC2, map21, map22);
</code></pre>
<p dir="auto">Those maps then get converted into a format that can be used by the Qualcomm hardware acceleration blocks for image dewarping, but the fundamental matrices and undistortion coefficients stay the same. I think the above lines is what you are after.</p>
<p dir="auto">You are correct that the disparity map is centered about the left camera, I believe this is typical in OpenCV land too.</p>
<p dir="auto">Note that we do not do a precise calibration between the Stereo and Hires Cameras from the factory, depending on how precise you need to alignment to be you may need to use a tool like Kalibr to do that.</p>
]]></description><link>https://forum.modalai.com/post/14922</link><guid isPermaLink="true">https://forum.modalai.com/post/14922</guid><dc:creator><![CDATA[James Strawson]]></dc:creator><pubDate>Mon, 26 Feb 2024 19:14:19 GMT</pubDate></item><item><title><![CDATA[Reply to voxl-dfs-server: stereo pointcloud coordinate frame on Mon, 26 Feb 2024 17:00:31 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="https://forum.modalai.com/uid/1859">@eric</a></p>
<p dir="auto">Hey Eric, happy to try and help you with this!</p>
<p dir="auto">Firstly, <code>voxl-inspect-extrinsics</code> should be helpful in at least getting some of the transformation matrices for the different cameras with respect to the body. If you need to configure extrinsics, check out the guide <a href="https://docs.modalai.com/configure-extrinsics/" rel="nofollow ugc">here</a>.</p>
<p dir="auto">When we generate the pointcloud, it's based purely off the values in the disparity map. And we obtain the disparity map from a lower-level API that doesn't explicitly specify which pixel coordinate system it generates the disparity map with respect to. So I dug through the documentation and all I could find was a brief <em>hint</em> that it might be the left image which lines up with your observed outputs.</p>
<p dir="auto">Your results do look off, though, and I think I might know why: Inside of <code>voxl-dfs-server</code> we do an undistortion process on the left and right images before computing DFS. If you get points in undistorted space and try to project them back onto a distorted image the result will definitely be a little off.</p>
<p dir="auto">I understand the need to go from the undistorted space back to distorted space for extrinsics lookup, but I'm not sure I have a great method to do so. One thing you could try -- we undistort our images using a distortion grid specified in:</p>
<pre><code>typedef struct mcv_undistort_config_t{
    int width;  
    int height; 
    int image_mode; 
    mcv_cvp_undistort_grid_t* undistort_grid;

    /* Unused */
    mcvWarpMode warp_mode;       ///&lt; currently unused
    mcvBorderMode border_mode;   ///&lt; currently unused
    float transform[9];          ///&lt; currently unused

} mcv_undistort_config_t;
</code></pre>
<p dir="auto">where</p>
<pre><code>/**
 * @brief General structure for an undistortion grid
 */
typedef struct mcv_cvp_undistort_grid_t {
    double* x;
    double* y;
} mcv_cvp_undistort_grid_t;
</code></pre>
<p dir="auto">This undistortion grid gets populated before the DFS process starts, I wonder if you could extract it and somehow invert the result to get a grid that projects from undistorted space back to distorted space?</p>
<p dir="auto">I apologize, I'm definitely not an expert here. Will forward this thread to James when he gets in, he'll likely have a better insight.</p>
<p dir="auto">Hope this at least helps somewhat!</p>
<p dir="auto">Thomas Patton</p>
]]></description><link>https://forum.modalai.com/post/14918</link><guid isPermaLink="true">https://forum.modalai.com/post/14918</guid><dc:creator><![CDATA[[[global:former_user]]]]></dc:creator><pubDate>Mon, 26 Feb 2024 17:00:31 GMT</pubDate></item><item><title><![CDATA[Reply to voxl-dfs-server: stereo pointcloud coordinate frame on Sun, 25 Feb 2024 22:38:18 GMT]]></title><description><![CDATA[<p dir="auto">I am seeing a very strong correlation between projected pointcloud and the front left image, but it's not perfect (bottom edge seems a bit off), so my guess is that the pointcloud coordinate frame is aligned with the left camera after slight rotation (for rectification):</p>
<p dir="auto"><img src="/assets/uploads/files/1708900398842-42715ed9-e314-4d3b-bb4e-17b1c43c82d3-image.png" alt="42715ed9-e314-4d3b-bb4e-17b1c43c82d3-image.png" class=" img-fluid img-markdown" /></p>
<p dir="auto">If so, how to extract this rotation and correct the transform?</p>
]]></description><link>https://forum.modalai.com/post/14907</link><guid isPermaLink="true">https://forum.modalai.com/post/14907</guid><dc:creator><![CDATA[eric]]></dc:creator><pubDate>Sun, 25 Feb 2024 22:38:18 GMT</pubDate></item></channel></rss>