Commit Graph

119 Commits

Author SHA1 Message Date
Ingo Weyrich
d17f71eb72 Applying geometric transformations leads to dark artifacts in combination with capture sharpening, fixes #5588 2019-12-30 15:27:17 +01:00
Lawrence
f83a62be5b Add back the old perspective tool
Add perspective correction method chooser to allow choice between the
original perspective tool (simple) and the new one (camera-based).
2019-12-28 17:18:59 -08:00
Lawrence
f9a8875bb5 Add more perspective correction adjusters
Add camera lens/sensor shift support with horizontal/vertical shift
adjusters.

Add shifting and rotation of corrected image. This allows
post-correction adjustments to be made more easily given the fixed image
canvas size.

Add scaling of final result. This also helps reduce frustrations with
the fixed image canvas size.

Replace field of view with focal length and crop factor. Use of focal
length and crop factor is more common than diagonal angular field of
view. The new adjusters should be more intuitive for most photographers.
The implementation of perspective correction uses a focal length
relative to the image dimensions. The existing code calculates that
focal length with trigonometry. The new code does it by multiplying
by a ratio.

Replace vertical bias with horizontal and vertical perspective
distortion recovery. Vertical bias is not intuitive as it causes
vertical lines to converge off-center if horizontal correction is
applied. The new adjusters perform perspective distortion on the
projection of the corrected image, allowing vertical/horizontal lines to
converge towards the center lines of the image.

Refactor perspective transformation math to use dynamically computed
homogeneous coordinate matrices instead of pre-calculated formulas. This
should add some overhead, but results in more maintainable code and
possible improved performance due to the reduced number of arithmetic
and assignments needed for each pixel.

Integrate new adjusters in the GUI. This includes fine granularity for
batch processing add/set modes and history.
2019-12-27 16:40:41 -08:00
Lawrence
f4c37598ee Generalize perspective correction
Revise perspective transformation to remove hard-coded angular field of
view and horizontal perspective axis of rotation. Add vertical bias
parameter to retain ability to perform vertical perspective
transformation independent of the horizontal perspective axis of
rotation. Add field of view parameter as a tentative method for
specifying angular field of view.

The current implementation of perspective transformation applies
horizontal perspective transformation in such a way that preserves the
orientation of a horizontal line going through the center of the image.
In common use cases, horizontal lines such as the horizon do not go
through the center of the image. In such cases, the horizontal
perspective axis of rotation should not be parallel to the image's
y-axis. This commit makes the axis of rotation dependent on the vertical
parameter.

The two axes of rotation should be placed at the appropriate distance
from the image in order to prevent stretched or compressed proportions.
In the current implementation, the axes are at a fixed relative distance
from the image. This commit adds the ability to specify the distance in
the form of the diagonal angular field of view.
2019-12-18 10:22:05 -08:00
Desmis
10d2c6a2a6 merge with dev 2019-12-02 16:00:50 +01:00
Flössie
5852ee02b9 Make LFDatabase::findModifier() non-static 2019-12-02 08:20:25 +01:00
Desmis
29d132f0fc Improve code graduated filter 2019-11-22 07:47:58 +01:00
Ingo Weyrich
89d8c341a6 Some code cleanups 2019-11-21 19:36:16 +01:00
Ingo Weyrich
ec3ba6d9b8 renamed sleef.c to sleef.h 2019-11-03 17:03:40 +01:00
Ingo Weyrich
ee6dd7d0d1 reduce <omp.h> dependencies 2019-11-03 16:14:16 +01:00
Ingo Weyrich
e682b364b5 Further reduction of include dependencies 2019-11-01 14:51:33 +01:00
Ingo Weyrich
20726d5bfe Forward declare Imagefloat 2019-10-28 20:01:16 +01:00
Flössie
f7c57eeeda Make ImProcFunctions::transCoord() const 2019-10-08 14:12:42 +02:00
Ingo Weyrich
c88a74e83a Merge pull request #5427 from Beep6581/speedup_transform
Speedup for transform
2019-09-16 17:18:38 +02:00
Ingo Weyrich
796e8f0289 Removed timing code 2019-09-16 17:17:49 +02:00
Flössie
9a020899a3 Minor cleanups 2019-09-11 09:16:06 +02:00
Morgan Hardwood
60b2196bce Updated gnu.org links to use HTTPS 2019-09-10 12:34:57 +02:00
Ingo Weyrich
4312e68265 SSE code for interpolateTransformCubic and interpolateTransformChannelsCubic, also some cleanups 2019-08-27 19:59:10 +02:00
Ingo Weyrich
5a5952dddb added two comments 2019-08-27 13:36:52 +02:00
Ingo Weyrich
9a624ca01e Speedup for transform 2019-08-27 13:25:34 +02:00
Ingo Weyrich
4fedfb2b26 cppcheck: further fixes 2019-08-06 22:10:38 +02:00
Flössie
0cbc4923bc Relax dependency from procparams.h 2019-02-28 20:44:50 +01:00
Flössie
37027e46bd Fix non-OpenMP build 2019-02-06 06:54:31 +01:00
Alberto Griggio
dbb9fcd2b1 Lens corrections: apply CA correction after distortion, and not before 2018-04-11 11:03:07 +02:00
Alberto Griggio
19281eedd1 merge branch 'lensprofile-ca-correction' into 'dev' 2017-11-14 22:53:27 +01:00
heckflosse
bd9592cb1f Fix two warnings when using gcc < 7 2017-11-12 13:42:25 +01:00
Ingo Weyrich
5946a00511 Merge pull request #4176 from Beep6581/extraclean
get rt cleaner when built using -Wextra #4155
2017-11-11 18:06:00 +01:00
Alberto Griggio
2006a1755b fixed regression in ImProcFunctions::transformGeneral introduced by recent refactorings 2017-10-31 10:49:40 +01:00
Alberto Griggio
770479f643 removed unused parameters from transformLCPCAOnly 2017-10-31 09:38:27 +01:00
Alberto Griggio
dfff9812bf improved profile-based CA correction in preview
also cleaned up the code
2017-10-31 00:51:01 +01:00
Alberto Griggio
5a05b04e09 profile-based CA correction applied during 1:1 preview 2017-10-29 21:41:19 +01:00
Alberto Griggio
a29287eaa0 started working on enabling full support for CA correction with a lens profile 2017-10-26 22:51:03 +02:00
Alberto Griggio
1c86c3c44d Disable LCP CA correction if LCP distortion is enabled
This was the old behaviour before lensfun integration. In order to enable both CA and distortion correction from the LCP, more work is needed.

(temporary) fix for #4159
2017-10-26 15:02:55 +02:00
heckflosse
9a17962f4b Make compilation unit rtengine/iptransform.cc -Wextra clean, #4155 2017-10-25 16:53:17 +02:00
Hombre57
8cef3c5e2f Merge branch 'dev' into multiframe-handling 2017-09-17 15:04:29 +02:00
Flössie
fb06a75c81 Fix clang warnings on new lensfun code (fixes #4086) 2017-09-17 11:06:11 +02:00
Hombre57
0905294bda Merge branch 'dev' into multiframe-handling, with some merge bugfix 2017-09-17 01:15:51 +02:00
heckflosse
818200522a Fix some inconsistencies in Profiled Lens Correction gui 2017-09-15 20:11:49 +02:00
Flössie
05b97f5c50 Fix some new Coverity warnings 2017-09-13 19:58:48 +02:00
Alberto Griggio
c2960caab5 some (minor) code cleanup 2017-09-13 15:06:47 +02:00
Flössie
f2853d8742 Some little cleanups to rtlensfun.*
- Sanitize `std::unique_ptr<>` handling
- Use `NonCopyable`
- Employ `explicit operator bool()`
- Correct use of `std::vector::emplace_back()`
- Cleanup includes
- Streamline implementation order
2017-09-12 20:58:20 +02:00
Alberto Griggio
4dc0e20ae0 merge with lcp-vignetting-issue4062 2017-09-11 17:22:01 +02:00
Alberto Griggio
e4ba4d19f5 made lensfun-based correction compatible with auto fill mode 2017-09-10 22:02:43 +02:00
Flössie
d442f7a85b LCP cleanup (#4062)
- Removed `using namespace`
- Use real `Cache`
- Use `std::shared_ptr<LCPProfile>`
- Moved `LCPPersModel` to .cc

More could be done...
2017-09-09 20:19:11 +02:00
Alberto Griggio
f3ae370ea7 fixed bug in passing image dimensions to the lensfun correction engine 2017-09-07 16:53:53 +02:00
Alberto Griggio
940577ce45 handle coarse rotation in lensfun distortion correction 2017-09-07 09:57:37 +02:00
Alberto Griggio
dde94bc6d3 added basic integration of lensfun
so far only distortion correction, and no GUI yet
2017-09-07 00:53:03 +02:00
Alberto Griggio
b4d3caf9c6 changed signature of ImProcFunctions::transform to take as input an ImageMetaData pointer 2017-09-06 00:15:41 +02:00
Alberto Griggio
2c257d2215 started refactoring ImProcFunctions::transform in preparation for lensfun integration 2017-09-03 20:48:49 +02:00
Alberto Griggio
0ecb02afdd Merge pull request #3916 from Beep6581/lcp-distortion-alt-match
Lcp distortion alt match
2017-06-26 23:37:14 +02:00