petergu684 / HoloLens2-ResearchMode-Unity

Unity Plugin for using research mode functionality in HoloLens 2. Modified based on HoloLens2ForCV.
MIT License
202 stars 59 forks source link

Extrinsics Matrix #42

Closed gamecoolha closed 1 year ago

gamecoolha commented 2 years ago
hstring HL2ResearchMode::PrintDepthExtrinsics()  
{
    std::stringstream ss;
    ss << "Extrinsics: \n" << MatrixToString(m_depthCameraPose);
    std::string msg = ss.str();
    std::wstring widemsg = std::wstring(msg.begin(), msg.end());
    OutputDebugString(widemsg.c_str());
    return winrt::to_hstring(msg);
}

Are these codes solving the extrinsic parameter matrix of the camera?

petergu684 commented 1 year ago

Extrinsic parameters are saved in m_depthCameraPose during initialization and this function just converts the matrix into string format via MatrixToString and return it so that you can get a string containing extrinsics in C#. The same string is printed in output console if app is started with "start debugging" in visual studio.