3D coordinates to pixel coordinates for Brown camera

I’d like to transform 3D coordinates into camera pixel coordinates for a Brown camera

In the doc, I see the formula for perspective, fisheye and sherical

Is there a place where I could find the formula?

Scrolling through the code; I found somewhere where to undistort Brown camera, but I don’t know if undistort and then perspective is the route to go.
Moreover, I don’t understand how to get the “f” argument from focal_x and focal_y

Thanks for your help