diff --git a/scripts/colmap2nerf.py b/scripts/colmap2nerf.py
index b3fdfe8f763d4fe0610eec13be4132e8648fbf18..b4f463e0a2bb8a024411ab6246b5a11454023c54 100755
--- a/scripts/colmap2nerf.py
+++ b/scripts/colmap2nerf.py
@@ -306,10 +306,11 @@ if __name__ == "__main__":
 			for g in out["frames"]:
 				mg = g["transform_matrix"][0:3,:]
 				p, w = closest_point_2_lines(mf[:,3], mf[:,2], mg[:,3], mg[:,2])
-				if w > 0.01:
+				if w > 0.00001:
 					totp += p*w
 					totw += w
-		totp /= totw
+		if totw > 0.0:
+			totp /= totw
 		print(totp) # the cameras are looking at totp
 		for f in out["frames"]:
 			f["transform_matrix"][0:3,3] -= totp