99 Commits

Author SHA1 Message Date
Lawrence Lee
9c5ce0d9bb Fix focal len autofill after browser adjustments
Don't update the camera-based perspective focal length and crop factor
parameters when making other adjustments using the file browser or batch
editor.

Closes #6402
2022-01-08 12:02:25 -08:00
Lawrence37
eb01f99bf2
Merge pull request #5814 from Lawrence37/perspective-lines
GUI improvements for perspective correction
2020-10-08 09:55:37 -07:00
Lawrence Lee
11d68a7136 Fix autofill amount bug (#5826)
I forgot to change some values when fixing the order of profiled
distortion correction in the processing pipeline (#5595).
2020-07-05 11:41:12 -07:00
Lawrence Lee
55a8238971 Fix temp image dimensions in transform (#5594)
The temporary image should be the same size as the transformed image,
not the original image.
2020-07-01 11:15:06 -07:00
Lawrence Lee
c2ea6b2ebc Merge from 'dev' 2020-06-25 21:58:02 -07:00
Lawrence37
763e3f7364
Merge pull request #5595 from Lawrence37/distortion
Move profiled distortion correction in pipeline
2020-06-25 10:56:58 -07:00
Lawrence Lee
72de3f21c7 Remove misleading comments 2020-06-25 10:39:21 -07:00
Lawrence Lee
7abe6c9044 Merge from branch 'dev' 2020-06-18 16:42:17 -07:00
Lawrence Lee
6b7c1871b9 Implement basic perspective control lines (WIP) 2020-06-08 18:21:12 -07:00
Lawrence Lee
fb5094b6f9 Merge from branch 'dev' 2020-05-04 14:07:45 -07:00
Lawrence Lee
8a970f95bc Merge from branch 'dev' 2020-05-04 11:49:34 -07:00
Desmis
e573de78b4 merge with dev 2020-03-19 13:40:11 +01:00
Lawrence Lee
357cf5b96a Remove scaling from perspective correction
Scaling is applied at the end of all geometric transformations, so it
would be more appropriate outside of the perspective correction tool.
Such an implementation would also work better with the auto-fit feature.
2020-02-26 22:52:55 -08:00
Lawrence Lee
9a594474d9 Add auto focal length for perspective in editor
If the focal length and/or crop factor for the camera-based perspective
correction tool are not edited, they will be set using the focal length
information found in the image metadata. This only applies to the editor
(batch editor and CLI still default to 24 for the focal length and 1 for
the crop factor).
2020-02-23 21:21:36 -08:00
Ingo Weyrich
2c831a11a7 more double promote fixes 2020-02-09 23:34:12 +01:00
Lawrence
f16773eb3f Merge branch 'dev' into perspective
Resolve minor conflict in ImProcFunctions::transformGeneral and add new
arguments for use of ImProcFunctions::needsTransform in
PerspectiveCorrection::autocompute.
2020-01-18 18:41:26 -08:00
Lawrence
7395b26db4 Add rotation to camera-based perspective tool
This rotation is different from the Rotate tool and the post-correction
adjustment rotation because it is applied between camera shift and
camera angle. It is equivalent to correcting the camera's roll and is
the same as the rotation calculated by automatic perspective correction.
2020-01-18 17:13:24 -08:00
Desmis
62c18b4921 merge with dev 2020-01-11 11:51:04 +01:00
Ingo Weyrich
1a02f16c35 crash in Tab: transform, fixes #5604 2020-01-11 11:20:41 +01:00
Desmis
31d3b7bb4c merge with dev 2020-01-07 10:16:40 +01:00
Ingo Weyrich
e07ff4032b log transform: Fix segfault 2020-01-03 11:35:20 +01:00
Lawrence
b266cb7ca3 Remove scale parameter from distortion correction
Scale is no longer useful in LensCorrection::correctDistortion. Remove
the scale parameter from the functions.
2020-01-02 18:33:35 -08:00
Lawrence
512517327f Move profiled distortion correction in pipeline
Lensfun/LCP distortion correction was applied before automatic scaling
and perspective correction in the inverse transformation. This means it
was applied after scaling and perspective in the pipeline. It should
actually come first.
2020-01-02 17:10:41 -08:00
Ingo Weyrich
49d594f67a Log transform: add method combobox 2020-01-02 19:28:57 +01:00
Ingo Weyrich
2ce6e6d1d3 skip unnecessary transform 2020-01-02 14:35:27 +01:00
Ingo Weyrich
085c68fc29 Log tranform: fix bug in preview mode 2020-01-01 19:06:02 +01:00
Ingo Weyrich
52f7c2c531 Log transform: further speedup 2020-01-01 15:18:47 +01:00
Ingo Weyrich
399a0055c6 Log transform: Fix broken build 2019-12-31 20:07:39 +01:00
Ingo Weyrich
58d8e66b72 Log transform: speedup, #5588 2019-12-31 19:09:06 +01:00
Ingo Weyrich
bcb7df44df Log transform: fix segfault 2019-12-31 15:23:24 +01:00
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