Convert pixel from perspective to equirectangular

I have a calculation problem. I have a perspective from equirectangular (with phi [-90, 90] and theta [0, 360]) and I wan’t to convert one pixel to equirectangular equivalent. I have searched Internet and GitHub and found only sth like this GitHub - timy90022/Perspective-and-Equirectangular: A tool to transfer Perspective between Equirectangular – it can convert but whole image – I need to map only one pixel in fast time.

I have this input:

  • theta
  • phi
  • fov
  • size of perspective
  • size of equirectangular
  • coordinates of pixel (in perspective)

I have found also this Convert Cubemap pixel coordinates to equivalents in Equirectangular - OpenCV Q&A Forum , but I need something more than 6 perspectives.

Thank you for help :slightly_smiling_face: