Change intrinsic camera parameters

Hey, basic question but yet I havent found a solution for that in the examples or in this forum. How can I change the intrinsic parameters (fox, cx cy, fx, fy) of my camera in a python script? I would like to simulate different kinds of sensors…

vpi = omni.kit.viewport.get_viewport_interface()

I use these two lines to set the active camera, but I have no clue how I can change the intrinsic camera parameters… I know that I can read them with the synthetic data extension, but this is not what I want here…

Thanks a lot!

Hi @fastblizzard

You can read and change the parameter of a camera prim by inspecting its attributes as shown in the next code (just change the prim_path to your camera path):

import omni

stage = omni.usd.get_context().get_stage()
prim_path = "/Camera"

prim= stage.GetPrimAtPath(prim_path)
focal_length = prim.GetAttribute("focalLength")

# get value
print("focal length:", focal_length.Get())

# set value

thanks a lot, I will try it out.
Thanks , it works. I am trying to compute the intrinsic camera matrix [3x3] for later processing. But it seems that the view_projection_matrix returned from the synthecif_helper is not what I am looking for. I am actually wondering what it is… The documentation is updated (thank you all! ), but this is still a bit mysterious.
Thanks !