I am attempting to simulate a wide angle camera in Isaac Sim 4.2.0, specifically this camera: OAK-D Pro W – Luxonis
Here is the code I am using to simulate the camera:
def create_mono_camera(camera_prim_path):
width, height = 1280, 800
camera = Camera(
prim_path = camera_prim_path,
resolution = (width, height),
)
camera.initialize()
# Using coefficients from candidate OAK-D Pro W Camera
camera_matrix = [[569.0758666992188, 0.0, 632.8007202148438],[0.0, 569.033935546875, 367.555908203125],[0.0, 0.0, 1.0]]
# These are the coefficiens for the Ratinal Polynomial Model
# k1, k2, p1, p2, k3, k4, k5, k6, s1, s2, s3, s4, tx, ty
distortion_coefficients = [ 10.102782249450684, 3.5927071571350098, -1.2150891052442603e-05, -0.00010162794205825776, 0.07836529612541199, 10.494465827941895, 6.792006969451904, 0.5550446510314941, 0.0, 0.0, 0.0, 0.0, -0.00024047934857662767, -0.0019406505161896348]
distortion_coefficients = distortion_coefficients[:8] # Isaac Sim only supports 8 coefficients
pixel_size = 3 * 1e-3 # in microns, 3 microns is common
f_stop = 2.0 # f-number, the ratio of the lens focal length to the diameter of the entrance pupil
focus_distance = 0.18 # in meters, the distance from the camera to the object plane
diagonal_fov = 150 # in degrees, the diagonal field of view to be rendered
effective_focal_length = 1.69 # in mm
# Calculate the focal length and aperture size from the camera matrix
((fx,_,cx),(_,fy,cy),(_,_,_)) = camera_matrix
horizontal_aperture = pixel_size * width # The aperture size in mm
vertical_aperture = pixel_size * height
camera.set_focal_length(effective_focal_length/100.0)
camera.set_horizontal_aperture(horizontal_aperture/100.0)
camera.set_vertical_aperture(vertical_aperture/100.0)
camera.set_lens_aperture(f_stop*1000.0)
camera.set_focus_distance(focus_distance)
camera.set_clipping_range(0.05, 1.0e5)
camera.set_projection_type("fisheyePolynomial")
camera.set_rational_polynomial_properties(width, height, cx, cy, diagonal_fov, distortion_coefficients)
return camera
The resulting images look quite grainy (image attached). When I switch the camera type back to Pinhole, however, the images no longer look grainy. What could be the issue here?