Hall�chen!
T. Modes writes:
> Am Montag, 18. November 2013 09:22:30 UTC+1 schrieb Torsten Bronger:
>
> [...]
>
> [...]
> In the documentation to both function it states
> <cite>
> The algorithm will look for a lens with crop factor not less than of given
> camera, since the mathematical models of the lens can be incorrect for
> sensor sizes larger than the one used for calibration.
> </cite>
>
> So the example you have given should not be possible according to
> the lensfun documentation.
Well, we have two issues here.
First, my example was erroneously swapped. I meant: Calibration was
made with APS-C (crop 1.5, aspect ratio 3:2), to-be-corrected image
was taken with Four-Thirds (2.0, 4:3).
Secondly, LensFun's documentation is wrong (even self-contradictory)
in the cited sentence. It was fixed to:
"The algorithm will look for a lens with crop factor not larger
than of given camera, since the mathematical models of the lens
can be incorrect for sensor sizes larger than the one used for
calibration."
> [...]
>
> So it would only be possible from calibration data from smaller
> crop factor cameras to deduce the calibration data for higher crop
> factor camera. But with libpano distortion model this is also not
> possible the other way around, because of the normalization. So
> you would need to recalculate all factors and not only to scale
> the factors.
I would have agreed till yesterday. I know that Adobe does more
than mere re-scaling of the "r" coordinate to get the sensor size
right, and even before this discussion here, I suspected a bug in
LensFun because of this.
However, LensFun behaves perfectly for cropped sensors, if the
calibration was done with a full-frame sensor. I can tell for sure
because LensFun now contains a testimage.py program which creates
distorted pictures for testing LensFun. The images are *exactly*
corrected in all cases. Since the distorting program works in the
coordinate system of the actual calibration sensor, cropping is
really simple here.
Besides, you can take a distorted picture, crop it manually in Gimp,
and let it be undistorted by LensFun with a camera with a
correspondingly higher crop factor -- works precisely.
I still have not understood why this works, though.
> [...]
>
> <snip>
>
>> 3. Introduce a new <aspect-ratio> tag in LensFun.
>
> One more point to consider: Even when you stay inside one crop
> factor, there are two possibilities to achieve a different aspect
> ratio: a) cropping height or b) a multi-aspect sensor. This have
> not been considered in the proposal.
The pair (crop factor, aspect ratio) must be correct. For
multi-aspect sensors, a virtual camera for each aspect ratio needs
to be defined in LensFun. The same is necessary for multi-crop
cameras (e.g. Nikon FX cameras in DX mode). The calling program
must pass the correct camera then.
We have now implemented the <aspect-ratio> tag, and a corresponding
attribute field in the lfLens class.