jdibenes / hl2ss

HoloLens 2 Sensor Streaming. Real-time streaming of HoloLens 2 sensor data over WiFi. Research Mode and External USB-C A/V supported.
Other
205 stars 51 forks source link

Better PV Extrinsics #99

Open nhahn opened 5 months ago

nhahn commented 5 months ago

For the PV calibration -- there is an alternative that can be used to get the extrinsics from the Research Mode Rignode to the PV camera. By taking the RM Rignode locator and then locating that in the PV coordinate system, we get the consistent, correct extrinsics. This code solves that problem, and could be included in the calibration information for the PV, rather than having to run the separate calibration script.

static void PV_OnVideoFrameArrived_Intrinsics(MediaFrameReader const& sender, MediaFrameArrivedEventArgs const& args)
.....  
 GUID nodeId = ResearchMode_GetRigNodeId();
 SpatialLocator g_locator = SpatialGraphInteropPreview::CreateLocatorForNode(nodeId);
 int64_t timestamp = frame.SystemRelativeTime().Value().count();
 float4x4 extrinsics = Locator_Locate(QPCTimestampToPerceptionTimestamp(timestamp), Locator_GetLocator(), frame.CoordinateSystem());

Thanks for the great library!

jdibenes commented 5 months ago

That is very cool. Thanks for sharing.