Perspective-and-Equirectangular
Perspective-and-Equirectangular copied to clipboard
hFOV calculation is wrong
Hey, first of all thanks for this nice library. I stumbled on a bug inside Perspec2Equirec.py in the calculation of the hFOV.
instead of self.hFOV = float(self._height) / self._width * FOV
the correct formula to calculate the horizontal FOV would be:
self.hFOV = np.rad2deg(2 * np.arctan(self._height * np.tan(np.radians(FOV/2)) / self._width))
see here.
It makes no difference as long as the input images are squared but when using images with a different aspect ratio it leads to incorrect projections.
The auther used wFOV and hFOV in his source code, it seems that wFoV refers to widthFoV (actually horizontal FOV) and hFOV refers to heightFOV (actually vertical FOV)?