Last active
September 4, 2024 12:53
-
-
Save edz-o/84d63fec2fc2d70721e775337c07e9c9 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def DepthConversion(PointDepth, f): | |
H = PointDepth.shape[0] | |
W = PointDepth.shape[1] | |
i_c = np.float(H) / 2 - 1 | |
j_c = np.float(W) / 2 - 1 | |
columns, rows = np.meshgrid(np.linspace(0, W-1, num=W), np.linspace(0, H-1, num=H)) | |
DistanceFromCenter = ((rows - i_c)**2 + (columns - j_c)**2)**(0.5) | |
PlaneDepth = PointDepth / (1 + (DistanceFromCenter / f)**2)**(0.5) | |
return PlaneDepth |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment