Forum Discussion
stepanK
12 years agoHonored Guest
coefficients of distortion function...
I may be overlooking something, but can someone share recommended values of constants k0, k1, k2 and k3 in optical distortion function that warps the linear image into pincushion distorted prior sending to the helmet? The function is no rocket science, but I'd love to avoid looking these 4 numbers by trial and error ;)
Thanks in advance!
Thanks in advance!
4 Replies
- zaloExplorer
- I got those numbers by creating an OVR::Util::Render::StereoConfig object and calling it's GetDistortionK() method. The numbers seem to be the default for no hmd detected.
(If you have a hmd connected, you can get it's HMDInfo and give it to the StereoConfig to set it up)
I did this:if(m_oculus)
{
m_oculus->GetDeviceInfo(&m_oculusInfo);
m_stereoConfig.SetHMDInfo(m_oculusInfo);
}
float d1 = m_stereoConfig.GetDistortionK(0);
float d2 = m_stereoConfig.GetDistortionK(1);
float d3 = m_stereoConfig.GetDistortionK(2);
float d4 = m_stereoConfig.GetDistortionK(3); - JamesMcCraeExplorerPerhaps of little practical benefit to determine the magic coefficients ;) , but an insight nonetheless, the distortion function is the first four terms of a Taylor series expansion of the sin() function (multiply in the "r"):
sin(r) ~= k_0 r + k_1 r^3 + k_2 r^5 + k_3 r^7 + ...
I believe the Rift uses spherical plano convex lenses, and this produces a radially symmetric distortion, thus the shape of a circle becomes relevant, which sin() captures :) - stepanKHonored Guest@zalo - thanks, that is exactly what I was looking for! I am python coder with very different needs from typical OVR users, would have to install MSVC, which You saved me from :)
Quick Links
- Horizon Developer Support
- Quest User Forums
- Troubleshooting Forum for problems with a game or app
- Quest Support for problems with your device
Other Meta Support
Related Content
- 5 months ago
- 10 months ago