Gazebo | Ignition | Community
Ask Your Question

Customize CameraLens function for Wide angle (fish eye) cameras

asked 2016-10-20 08:26:24 -0500

sekaran gravatar image

In class CameraLens(), [r = c1ffun(theta/c2+c3)], I like to define my own mapping function using theta as input for the function (for example - Polynomial Fish Eye Transform). I like to know what is the better way of doing it.

Some important issues are: 1. I cannot access the value of 'theta' and so I could not define anything on my own. 2. I cannot set the value of 'r' for the above mentioned mapping function. 3. I don't have access to the source code of CameraLens() class? If so, then I could implement something on my own.

How the see the implementation of CameraLens() class?

PS: I already checked this tutorial . I dont want to use any standard models like gnomonical, stereographic, equidistant, equisolid_angle, orthographic.

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2016-10-20 17:06:31 -0500

nkoenig gravatar image

Theta is the <horizontal_fov>, and r is the result of the function which means you don't set that value.

According to the tutorial, you can set everything in SDF:

All of our source code is open:

edit flag offensive delete link more


I already in the tutorial how to use the custom type lens with the same mapping function r = c1ffun(theta/c2+c3). But, I need to change the function itself. In the source code, I see the values for c1, c2, c3 etc are set to the shader. But I cannot really find, where r = c1ffun(theta/c2+c3) is implemented in the source code?

sekaran gravatar imagesekaran ( 2016-10-21 08:23:38 -0500 )edit

Thanks for the reply. I just found its implemented in the shader 'wide_lens_map_vs.glsl'. But <horizontal_fov> is not 'theta' exactly. The value of 'theta' is calculated in the same shader.

sekaran gravatar imagesekaran ( 2016-10-21 09:07:02 -0500 )edit

Hi! I am wondering if someone actually changed the mapping function according to the actual fish eye model used in opencv? if yes, can anyone point me towards the source. If not, can somebody explain me whether this function can be related with that model and produce the same results, in that case I am looking forward to some mathematical explanation particularly used in this mapping function instead of the opencv one.

owais2k12 gravatar imageowais2k12 ( 2018-07-24 01:05:52 -0500 )edit
Login/Signup to Answer

Question Tools

1 follower


Asked: 2016-10-20 08:00:52 -0500

Seen: 912 times

Last updated: Oct 20 '16