Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Equidistant fisheye model #1631

Open
qume opened this issue Dec 20, 2023 · 4 comments
Open

Equidistant fisheye model #1631

qume opened this issue Dec 20, 2023 · 4 comments

Comments

@qume
Copy link

qume commented Dec 20, 2023

Using Equidistant fisheye model (equidistant_r3) always seems to fail at this line:

ALICEVISION_LOG_WARNING("Can't find initial image pair intrinsics (NULL ptr): " << viewI.getIntrinsicId() << ", " << viewJ.getIntrinsicId());

Has this been run successfully? And if so is there a trick to getting past this error?

@servantftechnicolor we would very much like to use this, as the standard fisheye models based on pinhole model don't seem to be adequate, and this looks like a needed improvement for wide fisheyes/

@servantftechnicolor
Copy link
Contributor

servantftechnicolor commented Dec 20, 2023 via email

@qume
Copy link
Author

qume commented Jan 16, 2024

First, apologies for the very slow reply to your message. We have been doing some experiments to see if we can get a better idea of the issue we are having.

In a nutshell - we have tested doing mesh generation using (almost) all of the commercial packages out there, plus meshroom, and with very wide fisheyes, we are unable to get meshes which are of the same quality when using rectilinar lenses.

We suspected it's a limitation with the pinhole model, which is why I was excited to see different models in Meshroom.

The meshes when using fisheyes seem to end up with what should be hard/straight edges being 'wavy', and just generally poor reconstruction all around.

One thing we also suspect, which may not be fixed by just a non-pinhole model, is that we think the distortion is not equal / circular all the way around the lens. So there may need to be some distortion parameters which are a function of the polar angle around the principle point.

I would love to know if anyone else has managed to produce high quality meshes using fisheye lenses. We produce a 360 degree 3x12mp global shutter fisheye rig, and are keen to improve the quality of the meshes it produces.

@servantftechnicolor
Copy link
Contributor

If you have a rig, and always use the same fisheye cameras, then you really should print / display calibration checkerboards and calibrate your lens for distortion. make sure your(s) boards cover the whole image, or have multiple images where all the regions of the images are measured. For me that's really the first step. Then You should calibrate the geometry of your rig (if it is fixed).

@NeedsMoar
Copy link

One thing we also suspect, which may not be fixed by just a non-pinhole model, is that we think the distortion is not equal / circular all the way around the lens. So there may need to be some distortion parameters which are a function of the polar angle around the principle point.

If you dig up some lens distortion charts from reviews online you'll find that cheaper lenses with fewer elements have a bad tendency towards developing a sine-like curve starting somewhere maybe halfway out to the corners and going through a full cycle (so the chart looks roughly like a ripple spreading from the center). I'm not an optical engineer, but as far as I can tell this is impossible to correct without some minimal number of lens elements and corresponding increase in lens size barring technology advances since there's always a limit on what can be recovered from sensor data.

This paper and most other sources seem to call this mustache distortion and attribute it to variable focal length lens designs but I've seen it more often on cheap fisheyes (or fisheye adapters). It can be seen in a compressed fashion in circular fisheye images where the picture is blurred and bulged terribly towards then middle and begins to pinch together more and more along the outer radius.

Decentering tends to show up along with that particular issue (or even just with barrel distortion) especially on compact / budget APS-C fisheye / UW lenses where the lens might have a decent optical design but the company producing it is doing so on rejected parts or doesn't have the equipment to properly align internal elements.

We produce a 360 degree 3x12mp global shutter fisheye rig, and are keen to improve the quality of the meshes it produces.

If you're producing a product and not manufacturing lenses yourself (which I'm guessing you aren't), the manufacturer should be providing a distortion chart and some sort of guarantee on maximum deviation from it, or you're going to be stuck calibrating every single device sold if if you want them working right out of the box. If it's just a mustache or barrel distortion issue that affects every lens about the same you might be ok creating a profile that ships with it, but decentering issues in particular can produce wildly different centers for the barrel distortion between lenses and there's no recovering any of the data that was outside of the sensor area so you either have to detect and crop it somehow or do something more complicated.

That's if I understand what you're wanting to do correctly. If not, just ignore me. :-) That paper might help, and if you google it NVidia V-Ray has a standalone tool that will measure lens distortion (to apply to 3D scenes as lens shaders so they'll match shot footage when compositing, but it can be used to correct as well I think). I think Rawtherapee has downloadable charts and a profile generation tool as well but that isn't an API you can hook into easily.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants