Hallöchen!

First and foremost: What I propose here is, if actually done, a
long-term project (> 1 year).  I'd like to see clipping.c being
merged into lens.c.  It may sound insane to do this with the two
biggest iops but here is my reasoning:

Both modules transform coordinates.  It is sensful to do this in one
flow without leaving the realm of floating point numbers.  This way,
one eliminates rounding and interpolation errors due to the
generating of an intermediate image.  Additionally, it may be faster
even if the OpenCL support in clipping.c is lost.

More seriously, the perspective control (PC) in DT is flawed.  It
cannot recover the original aspect ratio, see
<http://wilson.bronger.org/perspective/>.  It is difficult to add
this feature to clipping.c because the field-of-view of the image
must be known.  Moreover, PC in DT doesn't work with extreme
positions of the vanishing point, i.e. if it is close to or below
the image centre.

Lensfun has all information, even more precise than could be derived
from EXIF data.  So I could add PC, mirroring, and rotation to
Lensfun.  If this is supported by lens.c, only cropping would be
missing before clipping.c became superfluous.  One month ago, I
completed a Python program that does the PC.  It is built to work
for me as a standalone program, but also to be converted easily into
Lensfun C++ code.  I think mirroring and rotation are easy enough.

The Lensfun code would need two lines (vertical/horizontal) or three
lines (full).  It detects horizonal/vertical automatically.  There
is a tweaking parameter -1..+1 that can be exposed as a slider.  It
handles pathological cases well.  Additionally, it keeps the scale
in the centre.

However, I would do this only if it is interesting for DT.  Then, I
would ask the Lensfun maintainer for permission to hack on it.  If
everything goes fine, a DT developer uses the new functions in
lens.c.  If the new DT code cannot be fenced with #ifdefs, this has
to wait until the new Lensfun version is sufficiently wide-spread.

I do not *expect* a DT developer to work on it -- it would be enough
for me if the DT teams says it is a nice idea and maybe someone will
work on it, sometime.

But if the DT team says that this is not the way they want to go, I
continue to use my standalone script.  One can then think about
fixing the existing DT PC code.

Tschö,
Torsten.

-- 
Torsten Bronger    Jabber ID: torsten.bron...@jabber.rwth-aachen.de
                                  or http://bronger-jmp.appspot.com


------------------------------------------------------------------------------
Want fast and easy access to all the code in your enterprise? Index and
search up to 200,000 lines of code with a free copy of Black Duck
Code Sight - the same software that powers the world's largest code
search on Ohloh, the Black Duck Open Hub! Try it now.
http://p.sf.net/sfu/bds
_______________________________________________
darktable-devel mailing list
darktable-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/darktable-devel

Reply via email to