You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
While this issue #66 mentioned that BARF struggles to reconstruct in NDC, I could not train even NeRF using NDC.
This is the function to convert rays to ndc rays in camera.py
defconvert_NDC(opt,center,ray,intr,near=1):
# shift camera center (ray origins) to near plane (z=1)# (unlike conventional NDC, we assume the cameras are facing towards the +z direction)center=center+(near-center[...,2:])/ray[...,2:]*ray# projectioncx,cy,cz=center.unbind(dim=-1) # [B,HW]rx,ry,rz=ray.unbind(dim=-1) # [B,HW]scale_x=intr[:,0,0]/intr[:,0,2] # [B]scale_y=intr[:,1,1]/intr[:,1,2] # [B]cnx=scale_x[:,None]*(cx/cz)
cny=scale_y[:,None]*(cy/cz)
cnz=1-2*near/czrnx=scale_x[:,None]*(rx/rz-cx/cz)
rny=scale_y[:,None]*(ry/rz-cy/cz)
rnz=2*near/czcenter_ndc=torch.stack([cnx,cny,cnz],dim=-1) # [B,HW,3]ray_ndc=torch.stack([rnx,rny,rnz],dim=-1) # [B,HW,3]returncenter_ndc,ray_ndc
Additionally, the function below is generating ndc rays in vanilla-nerf.
While this issue #66 mentioned that BARF struggles to reconstruct in NDC, I could not train even NeRF using NDC.
This is the function to convert rays to ndc rays in camera.py
Additionally, the function below is generating ndc rays in vanilla-nerf.
When I compare two methods,
2
is not multiplied inscale_x
andscale_y
.Could you tell me the reason?
The text was updated successfully, but these errors were encountered: